{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "invoice-04",
  "description": "A packing slip listing items with SKU and bin, a pick checkbox for each and a barcode of the order number, with no prices.",
  "registryDependencies": [
    "button",
    "https://www.dashboardblocks.com/r/radix/billing.json",
    "https://www.dashboardblocks.com/r/radix/block-state.json",
    "https://www.dashboardblocks.com/r/radix/invoice.json",
    "https://www.dashboardblocks.com/r/radix/status-label.json"
  ],
  "files": [
    {
      "path": "registry/components/dashboardblocks/invoice/invoice-04.tsx",
      "content": "'use client'\n\nimport { formatBillingDate } from '@/registry/components/dashboardblocks/billing'\nimport {\n  BlockReady,\n  BlockStateProvider,\n  type BlockStateProps,\n  getBlockState,\n} from '@/registry/components/dashboardblocks/block-state'\nimport {\n  Barcode,\n  DocumentBrand,\n  DocumentFooter,\n  DocumentHeader,\n  DocumentHeadline,\n  DocumentLayout,\n  DocumentMeta,\n  DocumentPage,\n  DocumentParties,\n  DocumentSection,\n  DocumentSummary,\n  DocumentToolbar,\n  type DocumentLine,\n  type DocumentParty,\n  LineItemsTable,\n  PrintButton,\n} from '@/registry/components/dashboardblocks/invoice'\nimport { StatusLabel } from '@/registry/components/dashboardblocks/status-label'\nimport { IconPlaceholder } from '@/registry/icons/icon-placeholder'\nimport { startTransition, useState } from 'react'\n\nimport { Button } from '@/components/ui/button'\n\ninterface Invoice4Props extends BlockStateProps {\n  billTo: DocumentParty\n  brand: { name: string; website: string }\n  /** Facts about the sender, printed at the foot of the page. */\n  footer: string[]\n  giftMessage?: string\n  /** Put the bin or shelf in `detail`. Leave out, or pass none, to show the empty state. */\n  lines?: DocumentLine[]\n  onMarkPacked?: () => Promise<void>\n  orderDate: Date\n  /** Printed as a Code 39 barcode, so keep to digits, capitals and - . */\n  orderNumber: string\n  packages: string\n  returnsUrl: string\n  shipBy: Date\n  shipping: string\n  shipTo: DocumentParty\n  weight?: string\n}\n\nconst exampleProps: Invoice4Props = {\n  billTo: {\n    label: 'Bill to',\n    lines: ['1650 Fillmore Street', 'Denver, CO 80206', 'tomas.reyes@hey.com'],\n    name: 'Tomás Reyes',\n  },\n  brand: { name: 'Tidepool Goods', website: 'tidepoolgoods.com' },\n  footer: ['Tidepool Goods', 'Returns to 2200 NW Front Avenue, Portland, OR 97209'],\n  giftMessage:\n    'Happy housewarming, Ana! Can’t wait to see the new place. Love, Tomás and Jun',\n  lines: [\n    {\n      description: 'Oat linen duvet cover, queen',\n      detail: 'Bin A-14',\n      id: 'duvet',\n      quantity: 1,\n      sku: 'LIN-DUV-Q-OAT',\n      unitPrice: 189,\n    },\n    {\n      description: 'Oat linen pillowcases, set of 2',\n      detail: 'Bin A-15',\n      id: 'pillowcases',\n      quantity: 2,\n      sku: 'LIN-PIL-S2-OAT',\n      unitPrice: 58,\n    },\n    {\n      description: 'Stoneware mugs, set of 4, wrap each one',\n      detail: 'Bin C-03',\n      id: 'mugs',\n      quantity: 1,\n      sku: 'STN-MUG-S4-SND',\n      unitPrice: 64,\n    },\n    {\n      description: 'Sage waffle bath towel',\n      detail: 'Bin B-22',\n      id: 'towels',\n      quantity: 4,\n      sku: 'WAF-BTH-SGE',\n      unitPrice: 42,\n    },\n    {\n      description: 'Beeswax taper candles, pair',\n      detail: 'Bin D-07',\n      id: 'candles',\n      quantity: 3,\n      sku: 'BWX-TPR-PR',\n      unitPrice: 18,\n    },\n    {\n      description: 'Gift wrap and card',\n      detail: 'Packing station',\n      id: 'gift',\n      quantity: 1,\n      sku: 'SVC-GIFT',\n      unitPrice: 6,\n    },\n  ],\n  orderDate: new Date(Date.UTC(2026, 8, 25)),\n  orderNumber: 'SO-10482',\n  packages: '2 boxes',\n  returnsUrl: 'https://tidepoolgoods.com/returns',\n  shipBy: new Date(Date.UTC(2026, 8, 28)),\n  shipping: 'UPS Ground',\n  shipTo: {\n    label: 'Ship to',\n    lines: ['Unit 5B, 88 Ocean Parkway', 'Brooklyn, NY 11218', '+1 (718) 555-0142'],\n    name: 'Ana Castillo',\n  },\n  weight: '6.4 kg',\n}\n\nfunction markPacked() {\n  return new Promise<void>((resolve) => setTimeout(resolve, 600))\n}\n\nconst logo = (\n  <svg viewBox='0 0 36 36' fill='none' aria-hidden>\n    <circle cx='18' cy='18' r='17' stroke='currentColor' strokeWidth='2' />\n    <path\n      d='M7 20c3-3 5-3 7.5 0s5 3 7.5 0 5-3 7 0'\n      stroke='currentColor'\n      strokeWidth='2'\n      strokeLinecap='round'\n    />\n  </svg>\n)\n\nconst Invoice4 = (props: Invoice4Props) => {\n  const {\n    billTo,\n    brand,\n    footer,\n    giftMessage,\n    lines = [],\n    onMarkPacked = markPacked,\n    orderDate,\n    orderNumber,\n    packages,\n    returnsUrl,\n    shipBy,\n    shipping,\n    shipTo,\n    errorMessage,\n    status,\n    weight,\n  } = props\n  const state = getBlockState(status, lines)\n  const [picked, setPicked] = useState<string[]>([])\n  const [packing, setPacking] = useState<'idle' | 'saving' | 'packed'>('idle')\n  const units = lines.reduce((sum, line) => sum + line.quantity, 0)\n  const allPicked = picked.length === lines.length\n\n  const pack = async () => {\n    setPacking('saving')\n    try {\n      await onMarkPacked()\n      startTransition(() => setPacking('packed'))\n    } catch {\n      startTransition(() => setPacking('idle'))\n    }\n  }\n\n  return (\n    <BlockStateProvider errorMessage={errorMessage} state={state}>\n      <DocumentLayout>\n        <DocumentToolbar\n          description={\n            <p role='status'>\n              <BlockReady className='text-sm'>\n                {packing === 'packed'\n                  ? `Order ${orderNumber} packed and ready for pickup`\n                  : `${picked.length} of ${lines.length} items picked`}\n              </BlockReady>\n            </p>\n          }\n        >\n          <PrintButton>Print slip</PrintButton>\n          <Button\n            size='sm'\n            disabled={!!state || !allPicked || packing !== 'idle'}\n            onClick={pack}\n          >\n            <IconPlaceholder\n              lucide='PackageIcon'\n              tabler='IconPackage'\n              hugeicons='PackageIcon'\n              phosphor='PackageIcon'\n              remixicon='RiBox3Line'\n              aria-hidden\n            />\n            {packing === 'saving'\n              ? 'Saving'\n              : packing === 'packed'\n                ? 'Packed'\n                : 'Mark as packed'}\n          </Button>\n        </DocumentToolbar>\n        <DocumentPage>\n          <DocumentHeader\n            brand={<DocumentBrand logo={logo} name={brand.name} detail={brand.website} />}\n            title='Packing slip'\n            number={`Order ${orderNumber}`}\n            status={\n              <StatusLabel tone={packing === 'packed' ? 'good' : 'info'}>\n                {packing === 'packed' ? 'Packed' : 'To pack'}\n              </StatusLabel>\n            }\n          >\n            <Barcode\n              value={orderNumber}\n              className='mt-2 items-start @xl/document:items-end print:items-end'\n            />\n          </DocumentHeader>\n          <DocumentSummary>\n            <DocumentHeadline\n              label='Items to pack'\n              value={\n                <>\n                  {units}\n                  <span className='text-muted-foreground ml-1 text-base font-normal tracking-normal'>\n                    {units === 1 ? 'unit' : 'units'}\n                  </span>\n                </>\n              }\n            >\n              {`${lines.length} ${lines.length === 1 ? 'line' : 'lines'} to pick, from the bins listed below.`}\n            </DocumentHeadline>\n            <DocumentMeta\n              items={[\n                { label: 'Ordered', value: formatBillingDate(orderDate) },\n                { label: 'Ship by', value: formatBillingDate(shipBy) },\n                { label: 'Shipping', value: shipping },\n                { label: 'Packages', note: weight, value: packages },\n              ]}\n            />\n          </DocumentSummary>\n          {state !== 'empty' && state !== 'error' && (\n            <>\n              <DocumentParties parties={[shipTo, billTo]} />\n              <LineItemsTable\n                caption={`${units} units in ${lines.length} lines`}\n                hidePrices\n                lines={lines}\n                selection={{\n                  label: (line) => `Picked ${line.description}`,\n                  onChange: (id, isSelected) =>\n                    setPicked((current) =>\n                      isSelected\n                        ? [...current, id]\n                        : current.filter((item) => item !== id),\n                    ),\n                  selected: picked,\n                }}\n              />\n              <div className='grid gap-8 border-t pt-8 @xl/document:grid-cols-2 print:grid-cols-2'>\n                {giftMessage && (\n                  <DocumentSection title='Gift message'>\n                    <BlockReady>\n                      <p className='text-muted-foreground text-pretty italic'>\n                        {giftMessage}\n                      </p>\n                    </BlockReady>\n                  </DocumentSection>\n                )}\n                <DocumentSection title='Returns'>\n                  <BlockReady>\n                    <p className='text-muted-foreground text-pretty'>\n                      Free returns within 30 days. Start one at{' '}\n                      <a\n                        href={returnsUrl}\n                        className='text-foreground underline underline-offset-4'\n                      >\n                        {returnsUrl.replace(/^https:\\/\\//, '')}\n                      </a>{' '}\n                      with order number {orderNumber}.\n                    </p>\n                  </BlockReady>\n                </DocumentSection>\n              </div>\n            </>\n          )}\n          <DocumentFooter parts={footer} />\n        </DocumentPage>\n      </DocumentLayout>\n    </BlockStateProvider>\n  )\n}\n\nexport { Invoice4, exampleProps as invoice4ExampleProps, type Invoice4Props }\n",
      "type": "registry:component",
      "target": "@components/dashboardblocks/invoice/invoice-04.tsx"
    }
  ],
  "meta": {
    "shows": "A packing slip listing items with SKU and bin, a pick checkbox for each and a barcode of the order number, with no prices.",
    "size": "full",
    "usedWith": [
      "invoice-02",
      "inventory-01"
    ],
    "component": "Invoice4",
    "props": "{ billTo: { label: string; lines: string[]; name: string }; brand: { name: string; website: string }; footer: string[]; giftMessage?: string; lines?: { detail?: string; description: string; id: string; optional?: boolean; quantity: number; sku?: string; taxRate?: number; unit?: string; unitPrice: number }[]; onMarkPacked?: () => Promise<void>; orderDate: Date; orderNumber: string; packages: string; returnsUrl: string; shipBy: Date; shipping: string; shipTo: { label: string; lines: string[]; name: string }; weight?: string; errorMessage?: string; status?: \"loading\" | \"error\" }"
  },
  "type": "registry:component"
}
