{
  "$schema": "https://registry.buildy.tw/schema/registry-item.json",
  "dependencies": [],
  "description": "The cart drawer in its open state, filled or empty.",
  "devDependencies": [],
  "digest": "0.1.0",
  "files": [
    {
      "content": "// Code generated by packages/kit-compose/src/organisms.ts from packages/compose-gen/specs (compose-gen organism emitters on kit-compose). DO NOT EDIT.\n/**\n * The cart drawer in its open state, over a faded page: the head with a close button, the lines with a quantity\n * field, the free-delivery bar, the totals and the button. The empty state shows an icon, a line and the way\n * back. Static markup: opening and closing are the page's. Axes: state (filled, empty), media (image, none).\n */\nimport { type ReactNode } from \"react\";\nimport { Block, Box, Button, Container, Group, Title } from \"../compose\";\nimport { LucideIcon } from \"../icons/LucideIcon\";\nimport { DrawerLines } from \"../components/drawer-lines\";\nimport { EmptyState } from \"../components/empty-state\";\nimport { tpl } from \"../utils\";\nimport type { DrawerLabels } from \"./cart-drawer.types\";\nimport type { CartLine, CartLabels } from \"./cart-list.types\";\nimport type { SummaryRow } from \"./order-summary.types\";\n\nexport type CartDrawerProps = {\n  id: string;\n  lines: CartLine[];\n  rows: SummaryRow[];\n  labels: CartLabels;\n  drawer: DrawerLabels;\n  state?: \"filled\" | \"empty\";\n  media?: \"image\" | \"none\";\n  landmarkLabel?: string;\n};\n\nexport function CartDrawer({\n  id,\n  lines,\n  rows,\n  labels,\n  drawer,\n  state = \"filled\",\n  media = \"image\",\n  landmarkLabel,\n}: CartDrawerProps) {\n  return (\n    <Block tag=\"section\" className=\"py-8\" aria-label={(landmarkLabel ?? drawer.title)} data-slot=\"section\">\n      <Container className=\"mx-auto w-full max-w-6xl px-4\" data-slot=\"container\">\n        <Box className=\"flex min-h-160 overflow-hidden rounded bg-muted inset-ring inset-ring-border\">\n          <Box className=\"hidden flex-1 flex-col gap-4 p-8 sm:flex\" aria-hidden=\"true\">\n            <Box className=\"h-8 w-48 rounded bg-background\" />\n            <Box className=\"h-40 rounded bg-background\" />\n            <Box className=\"h-40 rounded bg-background\" />\n          </Box>\n          <Box\n            className=\"flex w-full flex-col bg-background shadow-lg sm:max-w-sm\"\n            role=\"group\"\n            aria-label={drawer.title}\n            data-slot=\"drawer\"\n          >\n            <Group gap=\"4\" align=\"center\" justify=\"between\" className=\"border-b border-border p-4\">\n              <Title as={2} size=\"lg\" weight=\"semibold\">\n                {drawer.title}\n              </Title>\n              <Button variant=\"ghost\" size=\"sm\" layout=\"icon\" aria-label={drawer.close}>\n                <LucideIcon name=\"x\" size={16} />\n              </Button>\n            </Group>\n            {(((state as string) === \"empty\") || ((lines?.length ?? 0) === 0)) ? (\n              <Box className=\"flex flex-1 flex-col justify-center p-4\" data-slot=\"empty\">\n                <EmptyState\n                  icon=\"shopping-bag\"\n                  title={drawer.empty}\n                  text={drawer.emptyText}\n                  action={(\n                    <Button variant=\"outline\" size=\"default\">\n                      {drawer.browse}\n                    </Button>\n                  )}\n                />\n              </Box>\n            ) : (\n              <DrawerLines field={tpl(\"{0}-qty\", id)} lines={lines} rows={rows} labels={labels} drawer={drawer} media={media} />\n            )}\n          </Box>\n        </Box>\n      </Container>\n    </Block>\n  );\n}\n",
      "path": "blocks/cart-drawer.tsx",
      "target": "blocks/cart-drawer.tsx"
    },
    {
      "content": "// Code generated by packages/kit-compose/src/organisms.ts from packages/compose-gen/specs (compose-gen organism emitters on kit-compose). DO NOT EDIT.\n\nexport type DrawerLabels = {\n  title: string;\n  close: string;\n  progress: string;\n  empty: string;\n  emptyText: string;\n  browse: string;\n};\n",
      "path": "blocks/cart-drawer.types.ts",
      "target": "blocks/cart-drawer.types.ts"
    }
  ],
  "meta": {
    "category": "commerce",
    "group": "checkout",
    "kind": "block",
    "tags": [
      "react",
      "block"
    ]
  },
  "name": "cart-drawer",
  "registryDependencies": [
    "cart-list",
    "compose",
    "drawer-lines",
    "empty-state",
    "lucide-icon",
    "order-summary",
    "utils"
  ],
  "runtime": "react",
  "title": "Cart Drawer",
  "type": "registry:block"
}
