{
  "$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-->\n<script lang=\"ts\" module>\n  import type { Snippet } from \"svelte\";\n  import type { DrawerLabels } from \"./cart-drawer.types\";\n  import type { CartLine, CartLabels } from \"./cart-list.types\";\n  import type { SummaryRow } from \"./order-summary.types\";\n\n  export 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</script>\n\n<script lang=\"ts\">\n  import Block from \"../compose/Block.svelte\";\n  import Box from \"../compose/Box.svelte\";\n  import Button from \"../compose/Button.svelte\";\n  import Container from \"../compose/Container.svelte\";\n  import Group from \"../compose/Group.svelte\";\n  import LucideIcon from \"../icons/LucideIcon.svelte\";\n  import Title from \"../compose/Title.svelte\";\n  import DrawerLines from \"../components/drawer-lines.svelte\";\n  import EmptyState from \"../components/empty-state.svelte\";\n  import { tpl } from \"../utils\";\n\n  let {\n    id,\n    lines,\n    rows,\n    labels,\n    drawer,\n    state = \"filled\",\n    media = \"image\",\n    landmarkLabel,\n  }: CartDrawerProps = $props();\n</script>\n\n<Block tag=\"section\" class=\"py-8\" aria-label={(landmarkLabel ?? drawer.title)} data-slot=\"section\">\n  <Container class=\"mx-auto w-full max-w-6xl px-4\" data-slot=\"container\">\n    <Box class=\"flex min-h-160 overflow-hidden rounded bg-muted inset-ring inset-ring-border\">\n      <Box class=\"hidden flex-1 flex-col gap-4 p-8 sm:flex\" aria-hidden=\"true\">\n        <Box class=\"h-8 w-48 rounded bg-background\" />\n        <Box class=\"h-40 rounded bg-background\" />\n        <Box class=\"h-40 rounded bg-background\" />\n      </Box>\n      <Box\n        class=\"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\" class=\"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        {#if (((state as string) === \"empty\") || ((lines?.length ?? 0) === 0))}\n          <Box class=\"flex flex-1 flex-col justify-center p-4\" data-slot=\"empty\">\n            <EmptyState icon=\"shopping-bag\" title={drawer.empty} text={drawer.emptyText}>\n              {#snippet action()}\n                <Button variant=\"outline\" size=\"default\">\n                  {drawer.browse}\n                </Button>\n              {/snippet}\n            </EmptyState>\n          </Box>\n        {:else}\n          <DrawerLines field={tpl(\"{0}-qty\", id)} lines={lines} rows={rows} labels={labels} drawer={drawer} media={media} />\n        {/if}\n      </Box>\n    </Box>\n  </Container>\n</Block>\n",
      "path": "blocks/cart-drawer.svelte",
      "target": "blocks/cart-drawer.svelte"
    },
    {
      "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": [
      "svelte",
      "block"
    ]
  },
  "name": "cart-drawer",
  "registryDependencies": [
    "block",
    "box",
    "button",
    "cart-list",
    "container",
    "drawer-lines",
    "empty-state",
    "group",
    "lucide-icon",
    "order-summary",
    "title",
    "utils"
  ],
  "runtime": "svelte",
  "title": "Cart Drawer",
  "type": "registry:block"
}
