{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "stock-transfer-manager",
  "title": "Stock Transfer Manager",
  "type": "registry:block",
  "files": [
    {
      "path": "packages/registry-react/blocks/stock-transfer-manager/StockTransferManager.tsx",
      "content": "'use client'\n\nimport * as React from 'react'\nimport { ArrowRight, Barcode, CheckCircle2, Plus, QrCode, Trash2, Truck, Warehouse } from 'lucide-react'\nimport { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from '@/components/ui/card'\nimport { Button } from '@/components/ui/button'\nimport { Input } from '@/components/ui/input'\nimport { Badge } from '@/components/ui/badge'\nimport { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from '@/components/ui/select'\nimport { Table, TableBody, TableCell, TableHead, TableHeader, TableRow } from '@/components/ui/table'\n\nexport interface TransferItem {\n  id: string\n  sku: string\n  name: string\n  barcode: string\n  lotNumber: string\n  sourceBin: string\n  targetBin: string\n  availableQty: number\n  transferQty: number\n  unit: string\n  condition: 'sellable' | 'quarantine' | 'damaged'\n}\n\nexport interface StockTransferProps {\n  transferId?: string\n  initialStatus?: 'draft' | 'staged' | 'in_transit' | 'received'\n  className?: string\n}\n\nexport function StockTransferManager({\n  transferId = 'TRF-2026-8841',\n  initialStatus = 'staged',\n  className,\n}: StockTransferProps) {\n  const [status, setStatus] = React.useState(initialStatus)\n  const [sourceWarehouse, setSourceWarehouse] = React.useState('wh-east-01')\n  const [targetWarehouse, setTargetWarehouse] = React.useState('wh-central-02')\n  const [transportType, setTransportType] = React.useState('pallet_freight')\n  const [barcodeQuery, setBarcodeQuery] = React.useState('')\n\n  const [items, setItems] = React.useState<TransferItem[]>([\n    {\n      id: 'itm-1',\n      sku: 'SKU-LOGI-884',\n      name: 'Industrial Barcode Scanner IP65',\n      barcode: '079357318921',\n      lotNumber: 'LOT-2026-A1',\n      sourceBin: 'A-04-R2-B12',\n      targetBin: 'C-01-R1-B03',\n      availableQty: 140,\n      transferQty: 25,\n      unit: 'pcs',\n      condition: 'sellable',\n    },\n    {\n      id: 'itm-2',\n      sku: 'SKU-PWR-331',\n      name: 'Lithium Iron Battery Pack 48V',\n      barcode: '079357318945',\n      lotNumber: 'LOT-2025-X9',\n      sourceBin: 'B-12-R4-B01',\n      targetBin: 'D-08-R2-B09',\n      availableQty: 48,\n      transferQty: 12,\n      unit: 'units',\n      condition: 'sellable',\n    },\n    {\n      id: 'itm-3',\n      sku: 'SKU-SENS-102',\n      name: 'Optical Proximity Sensor M18',\n      barcode: '079357318988',\n      lotNumber: 'LOT-2026-C4',\n      sourceBin: 'A-02-R1-B06',\n      targetBin: 'A-09-R3-B02',\n      availableQty: 320,\n      transferQty: 80,\n      unit: 'pcs',\n      condition: 'sellable',\n    },\n  ])\n\n  const totalUnits = items.reduce((sum, item) => sum + Number(item.transferQty || 0), 0)\n  const totalLineItems = items.length\n\n  function addItem() {\n    setItems((prev) => [\n      ...prev,\n      {\n        id: `itm-${Date.now()}`,\n        sku: 'SKU-GEN-001',\n        name: 'Standard Packing Material Kit',\n        barcode: '079357399999',\n        lotNumber: 'LOT-UNASSIGNED',\n        sourceBin: 'A-01-R1-B01',\n        targetBin: 'B-01-R1-B01',\n        availableQty: 100,\n        transferQty: 10,\n        unit: 'kits',\n        condition: 'sellable',\n      },\n    ])\n  }\n\n  function removeItem(id: string) {\n    setItems((prev) => prev.filter((i) => i.id !== id))\n  }\n\n  function updateItemQty(id: string, qty: number) {\n    setItems((prev) => prev.map((i) => (i.id === id ? { ...i, transferQty: qty } : i)))\n  }\n\n  function updateItemCondition(id: string, condition: 'sellable' | 'quarantine' | 'damaged') {\n    setItems((prev) => prev.map((i) => (i.id === id ? { ...i, condition } : i)))\n  }\n\n  function handleScan() {\n    if (!barcodeQuery) return\n    setItems((prev) =>\n      prev.map((i) =>\n        i.barcode === barcodeQuery || i.sku === barcodeQuery ? { ...i, transferQty: i.transferQty + 1 } : i,\n      ),\n    )\n    setBarcodeQuery('')\n  }\n\n  return (\n    <div data-slot=\"stock-transfer-manager\" className={`w-full space-y-6 ${className ?? ''}`}>\n      {/* Header Summary Card */}\n      <Card>\n        <CardHeader className=\"flex flex-col gap-4 sm:flex-row sm:items-center sm:justify-between\">\n          <div className=\"space-y-1\">\n            <div className=\"flex items-center gap-2\">\n              <span className=\"text-muted-foreground font-mono text-sm font-medium\">{transferId}</span>\n              <Badge\n                variant={\n                  status === 'received'\n                    ? 'default'\n                    : status === 'in_transit'\n                      ? 'secondary'\n                      : status === 'staged'\n                        ? 'outline'\n                        : 'outline'\n                }\n                className=\"capitalize\"\n              >\n                {status.replace('_', ' ')}\n              </Badge>\n            </div>\n            <CardTitle className=\"text-xl\">Inter-Warehouse Stock Transfer</CardTitle>\n            <CardDescription>\n              Transfer goods between fulfillment hubs with bin-level tracking and scan verification.\n            </CardDescription>\n          </div>\n          <div className=\"flex items-center gap-2\">\n            {status === 'staged' && (\n              <Button variant=\"default\" className=\"gap-2\" onClick={() => setStatus('in_transit')}>\n                <Truck className=\"size-4\" />\n                Dispatch Transfer\n              </Button>\n            )}\n            {status === 'in_transit' && (\n              <Button variant=\"default\" className=\"gap-2\" onClick={() => setStatus('received')}>\n                <CheckCircle2 className=\"size-4\" />\n                Confirm Receipt\n              </Button>\n            )}\n            {status === 'received' && (\n              <Button variant=\"outline\" className=\"gap-2\" onClick={() => setStatus('staged')}>\n                Reset Transfer\n              </Button>\n            )}\n          </div>\n        </CardHeader>\n\n        <CardContent className=\"border-border grid grid-cols-1 gap-4 border-t pt-4 sm:grid-cols-3\">\n          {/* Source Hub */}\n          <div className=\"border-border space-y-2 rounded-lg border p-3\">\n            <div className=\"text-muted-foreground flex items-center gap-1.5 text-xs font-medium\">\n              <Warehouse className=\"size-3.5\" />\n              <span>ORIGIN FACILITY</span>\n            </div>\n            <Select\n              value={sourceWarehouse}\n              onValueChange={setSourceWarehouse}\n              disabled={status !== 'draft' && status !== 'staged'}\n            >\n              <SelectTrigger className=\"w-full\">\n                <SelectValue placeholder=\"Select origin warehouse\" />\n              </SelectTrigger>\n              <SelectContent>\n                <SelectItem value=\"wh-east-01\">East Coast Fulfillment (NJ-01)</SelectItem>\n                <SelectItem value=\"wh-west-02\">West Coast Distribution (CA-04)</SelectItem>\n                <SelectItem value=\"wh-midwest-03\">Midwest Logistics Hub (IL-02)</SelectItem>\n              </SelectContent>\n            </Select>\n          </div>\n\n          {/* Destination Hub */}\n          <div className=\"border-border space-y-2 rounded-lg border p-3\">\n            <div className=\"text-muted-foreground flex items-center gap-1.5 text-xs font-medium\">\n              <ArrowRight className=\"size-3.5\" />\n              <span>DESTINATION FACILITY</span>\n            </div>\n            <Select\n              value={targetWarehouse}\n              onValueChange={setTargetWarehouse}\n              disabled={status !== 'draft' && status !== 'staged'}\n            >\n              <SelectTrigger className=\"w-full\">\n                <SelectValue placeholder=\"Select target warehouse\" />\n              </SelectTrigger>\n              <SelectContent>\n                <SelectItem value=\"wh-central-02\">Central Distribution Center (TX-01)</SelectItem>\n                <SelectItem value=\"wh-north-01\">Northern Sorting Facility (WA-02)</SelectItem>\n                <SelectItem value=\"wh-south-03\">Southeast Regional Hub (GA-03)</SelectItem>\n              </SelectContent>\n            </Select>\n          </div>\n\n          {/* Carrier / Transport */}\n          <div className=\"border-border space-y-2 rounded-lg border p-3\">\n            <div className=\"text-muted-foreground flex items-center gap-1.5 text-xs font-medium\">\n              <Truck className=\"size-3.5\" />\n              <span>SHIPPING METHOD</span>\n            </div>\n            <Select\n              value={transportType}\n              onValueChange={setTransportType}\n              disabled={status !== 'draft' && status !== 'staged'}\n            >\n              <SelectTrigger className=\"w-full\">\n                <SelectValue placeholder=\"Select transit mode\" />\n              </SelectTrigger>\n              <SelectContent>\n                <SelectItem value=\"pallet_freight\">Dedicated LTL Freight (Palletized)</SelectItem>\n                <SelectItem value=\"express_courier\">Priority Courier (Same Day Air)</SelectItem>\n                <SelectItem value=\"internal_fleet\">Internal Fleet Transfer (Route 09)</SelectItem>\n              </SelectContent>\n            </Select>\n          </div>\n        </CardContent>\n      </Card>\n\n      {/* Line Items Table Card */}\n      <Card>\n        <CardHeader className=\"flex flex-col gap-3 pb-3 sm:flex-row sm:items-center sm:justify-between\">\n          <div>\n            <CardTitle className=\"text-base font-semibold\">Manifest Line Items</CardTitle>\n            <CardDescription>\n              {totalLineItems} unique SKUs · {totalUnits} total units staged for transfer\n            </CardDescription>\n          </div>\n\n          {/* Quick Scan / SKU lookup bar */}\n          <div className=\"flex items-center gap-2\">\n            <div className=\"relative w-64\">\n              <Barcode className=\"text-muted-foreground pointer-events-none absolute top-2.5 left-2.5 size-4\" />\n              <Input\n                value={barcodeQuery}\n                onChange={(e) => setBarcodeQuery(e.target.value)}\n                placeholder=\"Scan barcode or SKU...\"\n                className=\"pl-8\"\n                onKeyDown={(e) => e.key === 'Enter' && handleScan()}\n              />\n            </div>\n            <Button variant=\"secondary\" size=\"icon\" title=\"Scan Barcode\" onClick={handleScan}>\n              <QrCode className=\"size-4\" />\n            </Button>\n            <Button variant=\"outline\" size=\"sm\" className=\"gap-1\" onClick={addItem}>\n              <Plus className=\"size-3.5\" />\n              Add Item\n            </Button>\n          </div>\n        </CardHeader>\n\n        <CardContent className=\"p-0\">\n          <Table>\n            <TableHeader>\n              <TableRow>\n                <TableHead className=\"w-[280px]\">Product / SKU</TableHead>\n                <TableHead>Lot / Batch</TableHead>\n                <TableHead>Source Bin</TableHead>\n                <TableHead>Target Bin</TableHead>\n                <TableHead className=\"text-right\">Available</TableHead>\n                <TableHead className=\"w-[120px] text-right\">Transfer Qty</TableHead>\n                <TableHead>Condition</TableHead>\n                <TableHead className=\"w-[50px]\"></TableHead>\n              </TableRow>\n            </TableHeader>\n            <TableBody>\n              {items.map((item) => (\n                <TableRow key={item.id}>\n                  {/* SKU + Name */}\n                  <TableCell>\n                    <div className=\"font-medium\">{item.name}</div>\n                    <div className=\"text-muted-foreground flex items-center gap-2 font-mono text-xs\">\n                      <span>{item.sku}</span>\n                      <span>·</span>\n                      <span>{item.barcode}</span>\n                    </div>\n                  </TableCell>\n\n                  {/* Lot Number */}\n                  <TableCell>\n                    <span className=\"font-mono text-xs\">{item.lotNumber}</span>\n                  </TableCell>\n\n                  {/* Source Bin */}\n                  <TableCell>\n                    <span className=\"bg-muted text-foreground rounded px-1.5 py-0.5 font-mono text-xs font-medium\">\n                      {item.sourceBin}\n                    </span>\n                  </TableCell>\n\n                  {/* Target Bin */}\n                  <TableCell>\n                    <span className=\"border-border text-foreground rounded border px-1.5 py-0.5 font-mono text-xs font-medium\">\n                      {item.targetBin}\n                    </span>\n                  </TableCell>\n\n                  {/* Available Qty */}\n                  <TableCell className=\"text-muted-foreground text-right font-mono text-xs\">\n                    {item.availableQty} {item.unit}\n                  </TableCell>\n\n                  {/* Transfer Qty Input */}\n                  <TableCell className=\"text-right\">\n                    <Input\n                      type=\"number\"\n                      min={1}\n                      max={item.availableQty}\n                      value={item.transferQty}\n                      onChange={(e) => updateItemQty(item.id, Number(e.target.value))}\n                      className=\"h-8 text-right font-mono\"\n                      disabled={status === 'received'}\n                    />\n                  </TableCell>\n\n                  {/* Condition */}\n                  <TableCell>\n                    <Select\n                      value={item.condition}\n                      onValueChange={(val: 'sellable' | 'quarantine' | 'damaged') => updateItemCondition(item.id, val)}\n                      disabled={status === 'received'}\n                    >\n                      <SelectTrigger className=\"h-8 w-[110px] text-xs capitalize\">\n                        <SelectValue />\n                      </SelectTrigger>\n                      <SelectContent>\n                        <SelectItem value=\"sellable\">Sellable</SelectItem>\n                        <SelectItem value=\"quarantine\">Quarantine</SelectItem>\n                        <SelectItem value=\"damaged\">Damaged</SelectItem>\n                      </SelectContent>\n                    </Select>\n                  </TableCell>\n\n                  {/* Remove Action */}\n                  <TableCell>\n                    <Button\n                      variant=\"ghost\"\n                      size=\"icon\"\n                      className=\"text-muted-foreground hover:text-destructive size-8\"\n                      disabled={status === 'received'}\n                      onClick={() => removeItem(item.id)}\n                    >\n                      <Trash2 className=\"size-4\" />\n                    </Button>\n                  </TableCell>\n                </TableRow>\n              ))}\n            </TableBody>\n          </Table>\n        </CardContent>\n\n        <CardFooter className=\"border-border text-muted-foreground flex items-center justify-between border-t py-3 text-xs\">\n          <div>All inventory movements are recorded in immutable ledger log #LOG-9402.</div>\n          <div className=\"text-foreground font-medium\">\n            Total: <span className=\"font-mono\">{totalUnits}</span> items across{' '}\n            <span className=\"font-mono\">{totalLineItems}</span> positions\n          </div>\n        </CardFooter>\n      </Card>\n    </div>\n  )\n}\n",
      "type": "registry:block",
      "target": "~/components/blocks/stock-transfer-manager/StockTransferManager.tsx"
    },
    {
      "path": "packages/registry-react/blocks/stock-transfer-manager/index.ts",
      "content": "export { StockTransferManager } from './StockTransferManager'\nexport type { TransferItem, StockTransferProps } from './StockTransferManager'\n",
      "type": "registry:block",
      "target": "~/components/blocks/stock-transfer-manager/index.ts"
    }
  ],
  "dependencies": [
    "lucide-react"
  ],
  "devDependencies": [],
  "registryDependencies": [
    "https://uipkge.dev/r/react/card.json",
    "https://uipkge.dev/r/react/button.json",
    "https://uipkge.dev/r/react/input.json",
    "https://uipkge.dev/r/react/badge.json",
    "https://uipkge.dev/r/react/select.json",
    "https://uipkge.dev/r/react/table.json"
  ],
  "description": "Inter-facility inventory transfer console with bin-level routing, barcode lookup, and condition classification.",
  "categories": [
    "dashboard",
    "data-display"
  ]
}