{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "warehouse-inventory-grid",
  "title": "Warehouse Inventory Grid",
  "type": "registry:block",
  "files": [
    {
      "path": "packages/registry-react/blocks/warehouse-inventory-grid/WarehouseInventoryGrid.tsx",
      "content": "'use client'\n\nimport * as React from 'react'\nimport {\n  AlertTriangle,\n  ArrowDownToLine,\n  ArrowRightLeft,\n  ArrowUpRight,\n  Barcode,\n  Boxes,\n  Building2,\n  Check,\n  CheckCircle2,\n  ClipboardCheck,\n  MoreHorizontal,\n  Package,\n  PackagePlus,\n  Printer,\n  QrCode,\n  Search,\n  Tag,\n  Truck,\n  Warehouse,\n  X,\n} from 'lucide-react'\nimport { cn } from '@/lib/utils'\nimport { Badge } from '@/components/ui/badge'\nimport { Button } from '@/components/ui/button'\nimport { Card, CardContent, CardHeader, CardTitle } from '@/components/ui/card'\nimport {\n  DropdownMenu,\n  DropdownMenuContent,\n  DropdownMenuItem,\n  DropdownMenuLabel,\n  DropdownMenuSeparator,\n  DropdownMenuTrigger,\n} from '@/components/ui/dropdown-menu'\nimport { Input } from '@/components/ui/input'\nimport { Progress } from '@/components/ui/progress'\nimport { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from '@/components/ui/select'\nimport { Separator } from '@/components/ui/separator'\nimport {\n  Sheet,\n  SheetClose,\n  SheetContent,\n  SheetDescription,\n  SheetFooter,\n  SheetHeader,\n  SheetTitle,\n} from '@/components/ui/sheet'\nimport { Table, TableBody, TableCell, TableHead, TableHeader, TableRow } from '@/components/ui/table'\n\nexport type StockStatus = 'in_stock' | 'low_stock'\n\nexport interface WarehouseItem {\n  id: string\n  sku: string\n  barcode: string\n  name: string\n  category: string\n  palletId: string\n  zone: string\n  binLocation: string\n  aisle: string\n  rack: string\n  shelf: string\n  onHand: number\n  allocated: number\n  available: number\n  reorderThreshold: number\n  unitVolume: string\n  status: StockStatus\n  lastCycleCount: string\n}\n\nconst warehouseItems: WarehouseItem[] = [\n  {\n    id: 'wh-1',\n    sku: '#SKU-84920',\n    barcode: 'UPC-018249',\n    name: 'Aero Runner 10.5 Matte Black',\n    category: 'Footwear & Apparel',\n    palletId: 'PLT-84920-04',\n    zone: 'Zone A-West (High-Velocity)',\n    binLocation: 'Aisle 04 · Rack B · Shelf 02',\n    aisle: 'Aisle 04',\n    rack: 'Rack B',\n    shelf: 'Shelf 02',\n    onHand: 450,\n    allocated: 85,\n    available: 365,\n    reorderThreshold: 100,\n    unitVolume: '0.04 m³',\n    status: 'in_stock',\n    lastCycleCount: '2 days ago',\n  },\n  {\n    id: 'wh-2',\n    sku: '#SKU-84921',\n    barcode: 'UPC-029481',\n    name: 'Technical Shell Jacket L',\n    category: 'Outerwear',\n    palletId: 'PLT-84921-02',\n    zone: 'Zone A-North (Apparel Pick)',\n    binLocation: 'Aisle 02 · Rack D · Shelf 01',\n    aisle: 'Aisle 02',\n    rack: 'Rack D',\n    shelf: 'Shelf 01',\n    onHand: 38,\n    allocated: 30,\n    available: 8,\n    reorderThreshold: 50,\n    unitVolume: '0.02 m³',\n    status: 'low_stock',\n    lastCycleCount: 'Yesterday',\n  },\n  {\n    id: 'wh-3',\n    sku: '#SKU-77210',\n    barcode: 'UPC-093812',\n    name: 'Heavy Duty Pallet Straps (50m)',\n    category: 'Packaging & Materials',\n    palletId: 'PLT-77210-09',\n    zone: 'Zone B-Bulk (Industrial)',\n    binLocation: 'Aisle 07 · Rack A · Shelf 04',\n    aisle: 'Aisle 07',\n    rack: 'Rack A',\n    shelf: 'Shelf 04',\n    onHand: 820,\n    allocated: 140,\n    available: 680,\n    reorderThreshold: 200,\n    unitVolume: '0.08 m³',\n    status: 'in_stock',\n    lastCycleCount: '5 days ago',\n  },\n  {\n    id: 'wh-4',\n    sku: '#SKU-99341',\n    barcode: 'UPC-048201',\n    name: 'Thermal Packaging Liner 24x24',\n    category: 'Cold Chain Supplies',\n    palletId: 'PLT-99341-01',\n    zone: 'Zone C-Cold (Temp Controlled)',\n    binLocation: 'Aisle 01 · Rack C · Shelf 03',\n    aisle: 'Aisle 01',\n    rack: 'Rack C',\n    shelf: 'Shelf 03',\n    onHand: 24,\n    allocated: 18,\n    available: 6,\n    reorderThreshold: 60,\n    unitVolume: '0.05 m³',\n    status: 'low_stock',\n    lastCycleCount: 'Today',\n  },\n  {\n    id: 'wh-5',\n    sku: '#SKU-65239',\n    barcode: 'UPC-067194',\n    name: 'Industrial Barcode Scanner BT',\n    category: 'WMS Equipment',\n    palletId: 'PLT-65239-03',\n    zone: 'Zone D-Secure (High-Value)',\n    binLocation: 'Aisle 09 · Rack A · Shelf 01',\n    aisle: 'Aisle 09',\n    rack: 'Rack A',\n    shelf: 'Shelf 01',\n    onHand: 115,\n    allocated: 15,\n    available: 100,\n    reorderThreshold: 30,\n    unitVolume: '0.01 m³',\n    status: 'in_stock',\n    lastCycleCount: '3 days ago',\n  },\n  {\n    id: 'wh-6',\n    sku: '#SKU-54018',\n    barcode: 'UPC-081924',\n    name: 'Anti-Static Bubble Wrap Roll',\n    category: 'Packaging & Materials',\n    palletId: 'PLT-54018-05',\n    zone: 'Zone B-Bulk (Packaging Bay)',\n    binLocation: 'Aisle 06 · Rack E · Shelf 02',\n    aisle: 'Aisle 06',\n    rack: 'Rack E',\n    shelf: 'Shelf 02',\n    onHand: 190,\n    allocated: 45,\n    available: 145,\n    reorderThreshold: 75,\n    unitVolume: '0.12 m³',\n    status: 'in_stock',\n    lastCycleCount: '1 week ago',\n  },\n]\n\nexport function WarehouseInventoryGrid({ className, ...props }: React.HTMLAttributes<HTMLDivElement>) {\n  const [facility, setFacility] = React.useState('bay-area')\n  const [searchQuery, setSearchQuery] = React.useState('')\n  const [categoryFilter, setCategoryFilter] = React.useState('all')\n  const [statusFilter, setStatusFilter] = React.useState('all')\n  const [zoneFilter, setZoneFilter] = React.useState('all')\n\n  const [drawerOpen, setDrawerOpen] = React.useState(false)\n  const [drawerMode, setDrawerMode] = React.useState<'transfer' | 'receive'>('transfer')\n  const [selectedItem, setSelectedItem] = React.useState<WarehouseItem | null>(null)\n\n  const [transferDestination, setTransferDestination] = React.useState('bin-dest-1')\n  const [transferQty, setTransferQty] = React.useState(50)\n  const [transferPalletId, setTransferPalletId] = React.useState('PLT-84920-04')\n  const [transferReason, setTransferReason] = React.useState('reslotting')\n\n  const [receivePo, setReceivePo] = React.useState('po-8910')\n  const [receiveSku, setReceiveSku] = React.useState('SKU-84920')\n  const [receiveQty, setReceiveQty] = React.useState(250)\n  const [receiveBin, setReceiveBin] = React.useState('bay-02')\n\n  const [actionFeedback, setActionFeedback] = React.useState<string | null>(null)\n\n  const filteredItems = React.useMemo(() => {\n    return warehouseItems.filter((item) => {\n      const q = searchQuery.trim().toLowerCase()\n      const matchesSearch =\n        !q ||\n        item.name.toLowerCase().includes(q) ||\n        item.sku.toLowerCase().includes(q) ||\n        item.barcode.toLowerCase().includes(q) ||\n        item.binLocation.toLowerCase().includes(q) ||\n        item.category.toLowerCase().includes(q)\n\n      const matchesCategory = categoryFilter === 'all' || item.category === categoryFilter\n      const matchesStatus = statusFilter === 'all' || item.status === statusFilter\n      const matchesZone = zoneFilter === 'all' || item.zone.toLowerCase().includes(zoneFilter.toLowerCase())\n\n      return matchesSearch && matchesCategory && matchesStatus && matchesZone\n    })\n  }, [searchQuery, categoryFilter, statusFilter, zoneFilter])\n\n  const openTransferDrawer = (item?: WarehouseItem) => {\n    const target = item || warehouseItems[0]\n    setSelectedItem(target)\n    setTransferPalletId(target.palletId)\n    setTransferQty(Math.min(50, target.available))\n    setDrawerMode('transfer')\n    setDrawerOpen(true)\n  }\n\n  const openReceiveDrawer = () => {\n    setDrawerMode('receive')\n    setDrawerOpen(true)\n  }\n\n  const handleConfirmTransfer = () => {\n    if (!selectedItem) return\n    setActionFeedback(`Successfully relocated ${transferQty} units of ${selectedItem.sku} to destination bin.`)\n    setDrawerOpen(false)\n    setTimeout(() => {\n      setActionFeedback(null)\n    }, 4000)\n  }\n\n  const handleConfirmReceive = () => {\n    setActionFeedback(`Received ${receiveQty} units for ${receivePo.toUpperCase()} staged into Bay 02.`)\n    setDrawerOpen(false)\n    setTimeout(() => {\n      setActionFeedback(null)\n    }, 4000)\n  }\n\n  const handlePrintBarcode = (item: WarehouseItem) => {\n    setActionFeedback(`Barcode label queued for ${item.sku} (${item.barcode}) on Zebra Printer #2.`)\n    setTimeout(() => {\n      setActionFeedback(null)\n    }, 3500)\n  }\n\n  const handleCycleCount = (item: WarehouseItem) => {\n    setActionFeedback(`Cycle count logged and verified for bin ${item.binLocation}.`)\n    setTimeout(() => {\n      setActionFeedback(null)\n    }, 3500)\n  }\n\n  return (\n    <div data-slot=\"warehouse-inventory-grid\" className={cn('w-full space-y-6', className)} {...props}>\n      {/* Header Section */}\n      <div className=\"flex flex-col gap-4 lg:flex-row lg:items-center lg:justify-between\">\n        <div className=\"space-y-1\">\n          <div className=\"flex flex-wrap items-center gap-2.5\">\n            <div className=\"bg-primary/10 text-primary flex size-8 shrink-0 items-center justify-center rounded-lg\">\n              <Warehouse className=\"size-4.5 shrink-0\" />\n            </div>\n            <h1 className=\"text-foreground text-xl font-bold tracking-tight sm:text-2xl\">\n              Warehouse Inventory & Bin Locations\n            </h1>\n            <Badge wrap variant=\"outline\" className=\"border-success/30 bg-success/10 text-success gap-1.5\">\n              <span className=\"bg-success size-1.5 shrink-0 animate-pulse rounded-full\" />\n              WMS Live\n            </Badge>\n          </div>\n          <p className=\"text-muted-foreground text-xs sm:text-sm\">\n            Real-time multi-bin locator, safety stock reorder thresholds, and pallet relocation manifests.\n          </p>\n        </div>\n\n        <div className=\"flex flex-wrap items-center gap-2.5\">\n          {/* Warehouse Facility Select */}\n          <Select value={facility} onValueChange={setFacility}>\n            <SelectTrigger className=\"w-full sm:w-[320px]\">\n              <Building2 className=\"text-muted-foreground size-4 shrink-0\" />\n              <SelectValue placeholder=\"Select warehouse facility\" className=\"min-w-0 truncate\" />\n            </SelectTrigger>\n            <SelectContent>\n              <SelectItem value=\"bay-area\">Bay Area Fulfillment Center #04 · Aisle A-D</SelectItem>\n              <SelectItem value=\"seattle\">Seattle Logistics Hub #02 · High-Bay B</SelectItem>\n              <SelectItem value=\"dallas\">Dallas Central Depot #01 · Mezzanine C</SelectItem>\n              <SelectItem value=\"newark\">Newark Cold Chain #03 · Zone Free-01</SelectItem>\n            </SelectContent>\n          </Select>\n\n          <Button variant=\"outline\" className=\"gap-1.5\" onClick={() => openTransferDrawer()}>\n            <ArrowRightLeft className=\"size-4 shrink-0\" />\n            Relocate Bin\n          </Button>\n\n          <Button className=\"gap-1.5 shadow-xs\" onClick={openReceiveDrawer}>\n            <PackagePlus className=\"size-4 shrink-0\" />\n            Receive Inventory\n          </Button>\n        </div>\n      </div>\n\n      {/* Notification / Action Feedback Banner */}\n      {actionFeedback && (\n        <div className=\"border-primary/20 bg-primary/5 text-foreground flex items-center justify-between rounded-lg border px-4 py-3 text-sm shadow-xs transition-colors\">\n          <div className=\"flex items-center gap-2.5\">\n            <CheckCircle2 className=\"text-success size-4 shrink-0\" />\n            <span className=\"text-xs font-medium sm:text-sm\">{actionFeedback}</span>\n          </div>\n          <Button\n            variant=\"ghost\"\n            size=\"xs\"\n            className=\"h-6 w-6 shrink-0 p-0\"\n            aria-label=\"Dismiss notification\"\n            onClick={() => setActionFeedback(null)}\n          >\n            <X className=\"size-3.5 shrink-0\" />\n          </Button>\n        </div>\n      )}\n\n      {/* 4 WMS Inventory Metric Cards */}\n      <div className=\"grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-4\">\n        {/* Metric 1: Total SKUs */}\n        <Card className=\"shadow-xs\">\n          <CardHeader className=\"flex flex-row items-center justify-between space-y-0 pb-2\">\n            <CardTitle className=\"text-muted-foreground text-xs font-medium tracking-wider uppercase\">\n              Total SKUs in Stock\n            </CardTitle>\n            <div className=\"bg-primary/10 text-primary flex size-8 shrink-0 items-center justify-center rounded-md\">\n              <Package className=\"size-4 shrink-0\" />\n            </div>\n          </CardHeader>\n          <CardContent className=\"space-y-1\">\n            <div className=\"text-foreground text-2xl font-bold tracking-tight tabular-nums\">\n              1,842 <span className=\"text-muted-foreground text-sm font-normal\">SKUs</span>\n            </div>\n            <p className=\"text-muted-foreground flex items-center gap-1.5 pt-1 text-xs\">\n              <span className=\"text-success flex items-center font-medium\">\n                <ArrowUpRight className=\"mr-0.5 inline size-3 shrink-0\" />\n                +48 SKUs\n              </span>\n              <span>· 99.4% count accuracy</span>\n            </p>\n          </CardContent>\n        </Card>\n\n        {/* Metric 2: Warehouse Capacity */}\n        <Card className=\"shadow-xs\">\n          <CardHeader className=\"flex flex-row items-center justify-between space-y-0 pb-2\">\n            <CardTitle className=\"text-muted-foreground text-xs font-medium tracking-wider uppercase\">\n              Warehouse Capacity\n            </CardTitle>\n            <div className=\"bg-info/10 text-info flex size-8 shrink-0 items-center justify-center rounded-md\">\n              <Boxes className=\"size-4 shrink-0\" />\n            </div>\n          </CardHeader>\n          <CardContent className=\"space-y-2\">\n            <div className=\"flex flex-wrap items-baseline justify-between gap-x-2 gap-y-0.5\">\n              <div className=\"text-foreground text-2xl font-bold tracking-tight tabular-nums\">84.5%</div>\n              <span className=\"text-muted-foreground text-xs tabular-nums\">12,400 / 14,800 pallets</span>\n            </div>\n            <Progress value={84.5} className=\"h-1.5\" />\n            <p className=\"text-muted-foreground text-xs\">2,400 available slots in High-Bay & Bulk</p>\n          </CardContent>\n        </Card>\n\n        {/* Metric 3: Low Stock Alerts */}\n        <Card className=\"shadow-xs\">\n          <CardHeader className=\"flex flex-row items-center justify-between space-y-0 pb-2\">\n            <CardTitle className=\"text-muted-foreground text-xs font-medium tracking-wider uppercase\">\n              Low Stock Alerts\n            </CardTitle>\n            <div className=\"bg-warning/10 text-warning flex size-8 shrink-0 items-center justify-center rounded-md\">\n              <AlertTriangle className=\"size-4 shrink-0\" />\n            </div>\n          </CardHeader>\n          <CardContent className=\"space-y-1\">\n            <div className=\"flex items-center gap-2\">\n              <div className=\"text-warning text-warning text-2xl font-bold tracking-tight tabular-nums\">12</div>\n              <Badge wrap variant=\"warning\" className=\"text-xs font-normal\">\n                Action required\n              </Badge>\n            </div>\n            <p className=\"text-muted-foreground pt-1 text-xs\">Below safety stock threshold · 4 POs in transit</p>\n          </CardContent>\n        </Card>\n\n        {/* Metric 4: Inbound Shipments Today */}\n        <Card className=\"shadow-xs\">\n          <CardHeader className=\"flex flex-row items-center justify-between space-y-0 pb-2\">\n            <CardTitle className=\"text-muted-foreground text-xs font-medium tracking-wider uppercase\">\n              Inbound Shipments Today\n            </CardTitle>\n            <div className=\"bg-success/10 text-success flex size-8 shrink-0 items-center justify-center rounded-md\">\n              <Truck className=\"size-4 shrink-0\" />\n            </div>\n          </CardHeader>\n          <CardContent className=\"space-y-1\">\n            <div className=\"text-foreground text-2xl font-bold tracking-tight tabular-nums\">\n              4 <span className=\"text-muted-foreground text-sm font-normal\">POs arriving</span>\n            </div>\n            <p className=\"text-muted-foreground pt-1 text-xs\">2,450 units expected by 16:00 · Bay 02 & 05</p>\n          </CardContent>\n        </Card>\n      </div>\n\n      {/* Inventory Filter & Search Toolbar */}\n      <Card className=\"shadow-xs\">\n        <CardHeader className=\"border-border border-b pb-3\">\n          <div className=\"flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between\">\n            <div className=\"flex flex-1 flex-wrap items-center gap-2\">\n              <div className=\"relative w-full min-w-0 md:max-w-sm\">\n                <Search className=\"text-muted-foreground absolute top-1/2 left-3 size-4 shrink-0 -translate-y-1/2\" />\n                <Input\n                  value={searchQuery}\n                  onChange={(e) => setSearchQuery(e.target.value)}\n                  placeholder=\"Search SKU or product\"\n                  className=\"h-9 pl-9 text-xs sm:text-sm\"\n                />\n              </div>\n\n              {/* Category Filter */}\n              <Select value={categoryFilter} onValueChange={setCategoryFilter}>\n                <SelectTrigger className=\"h-9 w-[160px] text-xs\">\n                  <SelectValue placeholder=\"All Categories\" />\n                </SelectTrigger>\n                <SelectContent>\n                  <SelectItem value=\"all\">All Categories</SelectItem>\n                  <SelectItem value=\"Footwear & Apparel\">Footwear & Apparel</SelectItem>\n                  <SelectItem value=\"Outerwear\">Outerwear</SelectItem>\n                  <SelectItem value=\"Packaging & Materials\">Packaging & Materials</SelectItem>\n                  <SelectItem value=\"Cold Chain Supplies\">Cold Chain Supplies</SelectItem>\n                  <SelectItem value=\"WMS Equipment\">WMS Equipment</SelectItem>\n                </SelectContent>\n              </Select>\n\n              {/* Status Filter */}\n              <Select value={statusFilter} onValueChange={setStatusFilter}>\n                <SelectTrigger className=\"h-9 w-[140px] text-xs\">\n                  <SelectValue placeholder=\"All Stock Status\" />\n                </SelectTrigger>\n                <SelectContent>\n                  <SelectItem value=\"all\">All Statuses</SelectItem>\n                  <SelectItem value=\"in_stock\">In Stock</SelectItem>\n                  <SelectItem value=\"low_stock\">Low Stock (Reorder)</SelectItem>\n                </SelectContent>\n              </Select>\n            </div>\n\n            <div className=\"text-muted-foreground flex items-center gap-2 text-xs\">\n              <span>\n                Showing <strong className=\"text-foreground tabular-nums\">{filteredItems.length}</strong> of{' '}\n                {warehouseItems.length} inventory items\n              </span>\n            </div>\n          </div>\n        </CardHeader>\n\n        <CardContent className=\"p-0\">\n          {/* Inventory Table */}\n          <div className=\"overflow-x-auto\">\n            <Table>\n              <TableHeader>\n                <TableRow className=\"hover:bg-transparent\">\n                  <TableHead className=\"w-[180px] text-xs font-semibold\">SKU & Barcode</TableHead>\n                  <TableHead className=\"min-w-[220px] text-xs font-semibold\">Item & Category</TableHead>\n                  <TableHead className=\"min-w-[210px] text-xs font-semibold\">Bin / Rack Location</TableHead>\n                  <TableHead className=\"text-right text-xs font-semibold\">On Hand</TableHead>\n                  <TableHead className=\"text-right text-xs font-semibold\">Allocated</TableHead>\n                  <TableHead className=\"text-right text-xs font-semibold\">Available (ATP)</TableHead>\n                  <TableHead className=\"min-w-[160px] text-xs font-semibold\">Reorder & Status</TableHead>\n                  <TableHead className=\"w-[60px] text-right text-xs font-semibold\">Actions</TableHead>\n                </TableRow>\n              </TableHeader>\n              <TableBody>\n                {filteredItems.map((item) => (\n                  <TableRow key={item.id} className=\"hover:bg-muted/40 transition-colors\">\n                    {/* SKU & Barcode */}\n                    <TableCell className=\"py-3\">\n                      <div className=\"space-y-0.5\">\n                        <div className=\"text-foreground font-mono text-xs font-semibold\">{item.sku}</div>\n                        <div className=\"text-muted-foreground flex items-center gap-1 font-mono text-xs\">\n                          <Barcode className=\"text-muted-foreground/70 size-3 shrink-0\" />\n                          <span>{item.barcode}</span>\n                        </div>\n                      </div>\n                    </TableCell>\n\n                    {/* Item Name & Category */}\n                    <TableCell className=\"py-3\">\n                      <div className=\"space-y-0.5\">\n                        <div className=\"text-foreground text-sm font-medium\">{item.name}</div>\n                        <div className=\"text-muted-foreground flex items-center gap-1.5 text-xs\">\n                          <span>{item.category}</span>\n                          <span>·</span>\n                          <span className=\"font-mono text-xs\">{item.palletId}</span>\n                        </div>\n                      </div>\n                    </TableCell>\n\n                    {/* Bin / Rack Location Badge */}\n                    <TableCell className=\"py-3\">\n                      <div className=\"space-y-1\">\n                        <Badge wrap variant=\"outline\" className=\"bg-muted/30 gap-1.5 font-mono text-xs font-medium\">\n                          <Tag className=\"text-primary size-3 shrink-0\" />\n                          {item.binLocation}\n                        </Badge>\n                        <div className=\"text-muted-foreground text-xs\">{item.zone}</div>\n                      </div>\n                    </TableCell>\n\n                    {/* On Hand */}\n                    <TableCell className=\"py-3 text-right\">\n                      <div className=\"text-foreground text-sm font-semibold tabular-nums\">\n                        {item.onHand.toLocaleString()}{' '}\n                        <span className=\"text-muted-foreground text-xs font-normal\">units</span>\n                      </div>\n                      <div className=\"text-muted-foreground text-xs tabular-nums\">{item.unitVolume}</div>\n                    </TableCell>\n\n                    {/* Allocated */}\n                    <TableCell className=\"py-3 text-right\">\n                      <div className=\"text-muted-foreground text-sm font-medium tabular-nums\">\n                        {item.allocated.toLocaleString()}{' '}\n                        <span className=\"text-muted-foreground text-xs font-normal\">units</span>\n                      </div>\n                      <div className=\"text-muted-foreground text-xs tabular-nums\">\n                        {Math.round((item.allocated / item.onHand) * 100)}% reserved\n                      </div>\n                    </TableCell>\n\n                    {/* Available (ATP) */}\n                    <TableCell className=\"py-3 text-right\">\n                      <div className=\"text-foreground text-sm font-bold tabular-nums\">\n                        {item.available.toLocaleString()}{' '}\n                        <span className=\"text-muted-foreground text-xs font-normal\">units</span>\n                      </div>\n                      <div className=\"text-success text-xs font-medium\">Ready to pick</div>\n                    </TableCell>\n\n                    {/* Reorder Threshold & Status */}\n                    <TableCell className=\"py-3\">\n                      <div className=\"space-y-1\">\n                        {item.status === 'in_stock' ? (\n                          <Badge wrap variant=\"success\" className=\"gap-1 text-xs\">\n                            <CheckCircle2 className=\"size-3 shrink-0\" />\n                            In Stock\n                          </Badge>\n                        ) : (\n                          <Badge wrap variant=\"warning\" className=\"gap-1 text-xs\">\n                            <AlertTriangle className=\"size-3 shrink-0\" />\n                            Low Stock - Reorder\n                          </Badge>\n                        )}\n                        <div className=\"text-muted-foreground text-xs tabular-nums\">\n                          Min safety: {item.reorderThreshold} units\n                        </div>\n                      </div>\n                    </TableCell>\n\n                    {/* Actions Menu */}\n                    <TableCell className=\"py-3 text-right\">\n                      <DropdownMenu>\n                        <DropdownMenuTrigger asChild>\n                          <Button variant=\"ghost\" size=\"icon-sm\" className=\"size-8 shrink-0\">\n                            <MoreHorizontal className=\"size-4 shrink-0\" />\n                            <span className=\"sr-only\">Open menu</span>\n                          </Button>\n                        </DropdownMenuTrigger>\n                        <DropdownMenuContent align=\"end\" className=\"w-48\">\n                          <DropdownMenuLabel className=\"text-muted-foreground text-xs\">Bin Actions</DropdownMenuLabel>\n                          <DropdownMenuItem className=\"cursor-pointer gap-2\" onClick={() => openTransferDrawer(item)}>\n                            <ArrowRightLeft className=\"text-muted-foreground size-4 shrink-0\" />\n                            Transfer / Relocate Bin\n                          </DropdownMenuItem>\n                          <DropdownMenuItem className=\"cursor-pointer gap-2\" onClick={() => handlePrintBarcode(item)}>\n                            <Printer className=\"text-muted-foreground size-4 shrink-0\" />\n                            Print Barcode Label\n                          </DropdownMenuItem>\n                          <DropdownMenuItem className=\"cursor-pointer gap-2\" onClick={() => handleCycleCount(item)}>\n                            <ClipboardCheck className=\"text-muted-foreground size-4 shrink-0\" />\n                            Log Cycle Count\n                          </DropdownMenuItem>\n                          <DropdownMenuSeparator />\n                          <DropdownMenuItem className=\"text-warning cursor-pointer gap-2\" onClick={openReceiveDrawer}>\n                            <PackagePlus className=\"size-4 shrink-0\" />\n                            Receive Restock Batch\n                          </DropdownMenuItem>\n                        </DropdownMenuContent>\n                      </DropdownMenu>\n                    </TableCell>\n                  </TableRow>\n                ))}\n\n                {filteredItems.length === 0 && (\n                  <TableRow>\n                    <TableCell colSpan={8} className=\"text-muted-foreground h-32 text-center text-sm\">\n                      No warehouse inventory items found matching your criteria.\n                    </TableCell>\n                  </TableRow>\n                )}\n              </TableBody>\n            </Table>\n          </div>\n        </CardContent>\n      </Card>\n\n      {/* Quick Transfer / Relocate Bin Drawer (Sheet) */}\n      <Sheet open={drawerOpen} onOpenChange={setDrawerOpen}>\n        <SheetContent side=\"right\" className=\"w-full space-y-6 overflow-y-auto p-6 sm:max-w-md\">\n          {/* Drawer Header */}\n          <SheetHeader className=\"space-y-1 text-left\">\n            <div className=\"flex items-center gap-2\">\n              <div className=\"bg-primary/10 text-primary flex size-8 shrink-0 items-center justify-center rounded-md\">\n                {drawerMode === 'transfer' ? (\n                  <ArrowRightLeft className=\"size-4 shrink-0\" />\n                ) : (\n                  <PackagePlus className=\"size-4 shrink-0\" />\n                )}\n              </div>\n              <SheetTitle className=\"text-lg font-bold\">\n                {drawerMode === 'transfer' ? 'Relocate Bin / Pallet Transfer' : 'Receive Inventory Inbound'}\n              </SheetTitle>\n            </div>\n            <SheetDescription className=\"text-muted-foreground text-xs\">\n              {drawerMode === 'transfer'\n                ? 'Relocate inventory pallets between rack coordinates and generate WMS transfer manifests.'\n                : 'Process inbound freight shipments, inspect UPC barcodes, and assign initial staging bins.'}\n            </SheetDescription>\n          </SheetHeader>\n\n          {/* Mode: Transfer Bin */}\n          {drawerMode === 'transfer' && selectedItem && (\n            <div className=\"space-y-4\">\n              {/* Item Card Summary */}\n              <div className=\"border-border bg-muted/20 space-y-3 rounded-lg border p-4\">\n                <div className=\"flex items-start justify-between gap-2\">\n                  <div>\n                    <div className=\"text-primary font-mono text-xs font-semibold\">{selectedItem.sku}</div>\n                    <div className=\"text-foreground text-sm font-medium\">{selectedItem.name}</div>\n                    <div className=\"text-muted-foreground text-xs\">{selectedItem.category}</div>\n                  </div>\n                  <Badge wrap variant=\"outline\" className=\"font-mono text-xs\">\n                    {selectedItem.palletId}\n                  </Badge>\n                </div>\n\n                <Separator />\n\n                <div className=\"grid grid-cols-1 gap-2 text-xs sm:grid-cols-2\">\n                  <div>\n                    <span className=\"text-muted-foreground\">Current Bin:</span>\n                    <p className=\"text-foreground mt-0.5 font-mono text-xs font-medium\">{selectedItem.binLocation}</p>\n                  </div>\n                  <div>\n                    <span className=\"text-muted-foreground\">Available to Move:</span>\n                    <p className=\"text-success text-success mt-0.5 font-bold tabular-nums\">\n                      {selectedItem.available} units\n                    </p>\n                  </div>\n                </div>\n              </div>\n\n              {/* Transfer Form Fields */}\n              <div className=\"space-y-4\">\n                <div className=\"space-y-1.5\">\n                  <label className=\"text-foreground text-xs font-medium\">Destination Rack / Bin Location</label>\n                  <Select value={transferDestination} onValueChange={setTransferDestination}>\n                    <SelectTrigger className=\"w-full text-xs\">\n                      <SelectValue placeholder=\"Select target bin location\" />\n                    </SelectTrigger>\n                    <SelectContent>\n                      <SelectItem value=\"bin-dest-1\">\n                        Aisle 01 · Rack A · Shelf 03 (Zone A-North · Standard Rack)\n                      </SelectItem>\n                      <SelectItem value=\"bin-dest-2\">Aisle 03 · Rack B · Shelf 01 (Zone A-West · Fast-Pick)</SelectItem>\n                      <SelectItem value=\"bin-dest-3\">Aisle 08 · Rack C · Shelf 04 (Zone B-Bulk · High-Bay)</SelectItem>\n                      <SelectItem value=\"bin-dest-4\">Aisle 05 · Rack D · Shelf 02 (Zone C-Cold · Cold Bay)</SelectItem>\n                    </SelectContent>\n                  </Select>\n                </div>\n\n                <div className=\"space-y-1.5\">\n                  <div className=\"flex items-center justify-between\">\n                    <label className=\"text-foreground text-xs font-medium\">Transfer Quantity (Units)</label>\n                    <span className=\"text-muted-foreground text-xs tabular-nums\">\n                      Max: {selectedItem.available} units\n                    </span>\n                  </div>\n                  <Input\n                    type=\"number\"\n                    min={1}\n                    max={selectedItem.available}\n                    value={transferQty}\n                    onChange={(e) => setTransferQty(Number(e.target.value))}\n                    className=\"text-xs tabular-nums sm:text-sm\"\n                  />\n                  <div className=\"flex gap-1.5 pt-1\">\n                    <Button\n                      type=\"button\"\n                      variant=\"outline\"\n                      size=\"xs\"\n                      className=\"flex-1 text-xs\"\n                      onClick={() => setTransferQty(Math.min(25, selectedItem.available))}\n                    >\n                      25\n                    </Button>\n                    <Button\n                      type=\"button\"\n                      variant=\"outline\"\n                      size=\"xs\"\n                      className=\"flex-1 text-xs\"\n                      onClick={() => setTransferQty(Math.min(50, selectedItem.available))}\n                    >\n                      50\n                    </Button>\n                    <Button\n                      type=\"button\"\n                      variant=\"outline\"\n                      size=\"xs\"\n                      className=\"flex-1 text-xs\"\n                      onClick={() => setTransferQty(Math.min(100, selectedItem.available))}\n                    >\n                      100\n                    </Button>\n                    <Button\n                      type=\"button\"\n                      variant=\"outline\"\n                      size=\"xs\"\n                      className=\"flex-1 text-xs\"\n                      onClick={() => setTransferQty(selectedItem.available)}\n                    >\n                      All ({selectedItem.available})\n                    </Button>\n                  </div>\n                </div>\n\n                <div className=\"space-y-1.5\">\n                  <label className=\"text-foreground text-xs font-medium\">Pallet ID / Batch Lot</label>\n                  <Input\n                    value={transferPalletId}\n                    onChange={(e) => setTransferPalletId(e.target.value)}\n                    className=\"font-mono text-xs\"\n                  />\n                </div>\n\n                <div className=\"space-y-1.5\">\n                  <label className=\"text-foreground text-xs font-medium\">Transfer Reason</label>\n                  <Select value={transferReason} onValueChange={setTransferReason}>\n                    <SelectTrigger className=\"w-full text-xs\">\n                      <SelectValue placeholder=\"Select transfer reason\" />\n                    </SelectTrigger>\n                    <SelectContent>\n                      <SelectItem value=\"reslotting\">Zone Re-slotting (Velocity Optimization)</SelectItem>\n                      <SelectItem value=\"consolidation\">Consolidation & Space Reclamation</SelectItem>\n                      <SelectItem value=\"staging\">Fast-Pick Outbound Wave Staging</SelectItem>\n                      <SelectItem value=\"rack-repair\">Damaged Rack Maintenance Relocation</SelectItem>\n                      <SelectItem value=\"quarantine\">Quarantine & Quality Audit Transfer</SelectItem>\n                    </SelectContent>\n                  </Select>\n                </div>\n\n                {/* Verified Scanner / Operator Badge */}\n                <div className=\"border-border bg-muted/40 space-y-1 rounded-md border p-3 text-xs\">\n                  <div className=\"text-muted-foreground flex items-center justify-between\">\n                    <span className=\"flex items-center gap-1.5\">\n                      <QrCode className=\"text-primary size-3.5 shrink-0\" />\n                      WMS Scanner Terminal\n                    </span>\n                    <span className=\"text-foreground font-mono font-medium\">TC57-OP44</span>\n                  </div>\n                  <p className=\"text-muted-foreground\">Operator: Marcus Vance (Badge #OP-921)</p>\n                </div>\n              </div>\n            </div>\n          )}\n\n          {/* Mode: Receive Inbound PO */}\n          {drawerMode === 'receive' && (\n            <div className=\"space-y-4\">\n              <div className=\"space-y-1.5\">\n                <label className=\"text-foreground text-xs font-medium\">Inbound Purchase Order</label>\n                <Select value={receivePo} onValueChange={setReceivePo}>\n                  <SelectTrigger className=\"w-full text-xs\">\n                    <SelectValue placeholder=\"Select purchase order\" />\n                  </SelectTrigger>\n                  <SelectContent>\n                    <SelectItem value=\"po-8910\">PO-2026-8910 · Acme Footwear Corp (500 units)</SelectItem>\n                    <SelectItem value=\"po-8914\">PO-2026-8914 · Pacific Packaging Ltd (1,200 units)</SelectItem>\n                    <SelectItem value=\"po-8919\">PO-2026-8919 · Thermal Supply Chain Co (750 units)</SelectItem>\n                  </SelectContent>\n                </Select>\n              </div>\n\n              <div className=\"space-y-1.5\">\n                <label className=\"text-foreground text-xs font-medium\">Target SKU / Barcode</label>\n                <Input\n                  value={receiveSku}\n                  onChange={(e) => setReceiveSku(e.target.value)}\n                  placeholder=\"#SKU-84920 or UPC code\"\n                  className=\"font-mono text-xs\"\n                />\n              </div>\n\n              <div className=\"space-y-1.5\">\n                <label className=\"text-foreground text-xs font-medium\">Received Quantity (Units)</label>\n                <Input\n                  type=\"number\"\n                  value={receiveQty}\n                  onChange={(e) => setReceiveQty(Number(e.target.value))}\n                  className=\"text-xs tabular-nums\"\n                />\n              </div>\n\n              <div className=\"space-y-1.5\">\n                <label className=\"text-foreground text-xs font-medium\">Assigned Inbound Staging Bay</label>\n                <Select value={receiveBin} onValueChange={setReceiveBin}>\n                  <SelectTrigger className=\"w-full text-xs\">\n                    <SelectValue placeholder=\"Select staging bin\" />\n                  </SelectTrigger>\n                  <SelectContent>\n                    <SelectItem value=\"bay-02\">Staging Bay Inbound-02 (Aisle 00 · Cross-Dock)</SelectItem>\n                    <SelectItem value=\"bay-05\">Staging Bay Inbound-05 (Cold Holding)</SelectItem>\n                    <SelectItem value=\"bay-08\">Bulk Floor Staging Area B</SelectItem>\n                  </SelectContent>\n                </Select>\n              </div>\n\n              <div className=\"text-foreground border-success/20 bg-success/5 space-y-1 rounded-md border p-3 text-xs\">\n                <div className=\"text-success flex items-center gap-1.5 font-medium\">\n                  <Check className=\"size-3.5 shrink-0\" />\n                  Inbound Freight Scan Ready\n                </div>\n                <p className=\"text-muted-foreground\">\n                  Pallet tags will be generated and printed automatically upon receipt confirmation.\n                </p>\n              </div>\n            </div>\n          )}\n\n          {/* Drawer Footer */}\n          <SheetFooter className=\"border-border flex flex-col-reverse gap-2 border-t pt-4 sm:flex-row sm:justify-end\">\n            <SheetClose asChild>\n              <Button variant=\"outline\" className=\"w-full sm:w-auto\">\n                Cancel\n              </Button>\n            </SheetClose>\n            {drawerMode === 'transfer' ? (\n              <Button className=\"w-full gap-1.5 sm:w-auto\" onClick={handleConfirmTransfer}>\n                <ArrowRightLeft className=\"size-4 shrink-0\" />\n                Confirm Bin Transfer\n              </Button>\n            ) : (\n              <Button className=\"w-full gap-1.5 sm:w-auto\" onClick={handleConfirmReceive}>\n                <ArrowDownToLine className=\"size-4 shrink-0\" />\n                Confirm Receipt\n              </Button>\n            )}\n          </SheetFooter>\n        </SheetContent>\n      </Sheet>\n    </div>\n  )\n}\n",
      "type": "registry:block",
      "target": "~/components/blocks/WarehouseInventoryGrid.tsx"
    }
  ],
  "dependencies": [
    "lucide-react"
  ],
  "devDependencies": [],
  "registryDependencies": [
    "https://uipkge.dev/r/react/badge.json",
    "https://uipkge.dev/r/react/button.json",
    "https://uipkge.dev/r/react/card.json",
    "https://uipkge.dev/r/react/dropdown-menu.json",
    "https://uipkge.dev/r/react/input.json",
    "https://uipkge.dev/r/react/progress.json",
    "https://uipkge.dev/r/react/select.json",
    "https://uipkge.dev/r/react/separator.json",
    "https://uipkge.dev/r/react/sheet.json",
    "https://uipkge.dev/r/react/table.json"
  ],
  "description": "WMS warehouse inventory and bin locator grid: facility selector, 4 summary metric cards for SKUs, capacity, low-stock triggers, and inbound shipments, searchable inventory table with multi-rack bin badges, on-hand/allocated/ATP counts, barcode scanning support, and slide-over bin relocation and receiving drawer.",
  "categories": [
    "logistics",
    "app",
    "ecommerce",
    "dashboard"
  ]
}