{
  "$schema": "https://registry.buildy.tw/schema/registry-item.json",
  "dependencies": [],
  "description": "Drawer Lines component",
  "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 filled body of the CartDrawer: the lines with a quantity field, then the free-delivery bar, the subtotal\n  and total and the button.\n-->\n<script lang=\"ts\" module>\n  import type { Snippet } from \"svelte\";\n  import type { CartLine, CartLabels } from \"../blocks/cart-list.types\";\n  import type { SummaryRow } from \"../blocks/order-summary.types\";\n  import type { DrawerLabels } from \"../blocks/cart-drawer.types\";\n\n  export type DrawerLinesProps = {\n    lines: CartLine[];\n    rows: SummaryRow[];\n    labels: CartLabels;\n    drawer: DrawerLabels;\n    media?: \"image\" | \"none\";\n    field?: string;\n  };\n</script>\n\n<script lang=\"ts\">\n  import Button from \"../compose/Button.svelte\";\n  import Group from \"../compose/Group.svelte\";\n  import Inline from \"../compose/Inline.svelte\";\n  import List from \"../compose/List.svelte\";\n  import ListItem from \"../compose/ListItem.svelte\";\n  import Progress from \"../compose/Progress.svelte\";\n  import Stack from \"../compose/Stack.svelte\";\n  import Text from \"../compose/Text.svelte\";\n  import MediaFrame from \"../components/media-frame.svelte\";\n  import NumberField from \"../components/number-field.svelte\";\n  import { fmtMoney, tpl } from \"../utils\";\n\n  let { lines, rows, labels, drawer, media = \"image\", field = \"qty\" }: DrawerLinesProps = $props();\n</script>\n\n<Stack gap=\"4\" align=\"stretch\" class=\"flex-1 p-4\" data-slot=\"lines\">\n  {#each lines as line (line.id)}\n    <Group gap=\"4\" align=\"start\" data-slot=\"item\">\n      {#if ((media as string) === \"image\")}\n        <MediaFrame alt={line.name} src={line.image} ratio=\"1/1\" class=\"size-16 shrink-0\" />\n      {/if}\n      <Stack gap=\"2\" align=\"stretch\" class=\"flex-1\">\n        <Group gap=\"2\" justify=\"between\" align=\"start\">\n          <Text size=\"sm\" weight=\"semibold\">\n            {line.name}\n          </Text>\n          <Inline class=\"text-sm font-medium\">\n            {fmtMoney((line.price * line.qty), line.currency)}\n          </Inline>\n        </Group>\n        <Text size=\"xs\" class=\"text-muted-foreground\">\n          {line.variant}\n        </Text>\n        <NumberField\n          value={(line.qty == null ? undefined : String(line.qty))}\n          name={tpl(\"{0}-{1}\", field, line.id)}\n          min=\"1\"\n          label={labels.qty}\n          decrease={labels.decrease}\n          increase={labels.increase}\n        />\n      </Stack>\n    </Group>\n  {/each}\n</Stack>\n<Stack gap=\"4\" align=\"stretch\" class=\"border-t border-border p-4\" data-slot=\"drawer-lines\">\n  <Stack gap=\"2\" align=\"stretch\" class=\"rounded bg-muted p-4\" data-slot=\"progress\">\n    <Text size=\"sm\">\n      {drawer.progress}\n    </Text>\n    <Progress value=\"96\" max=\"100\" aria-label={drawer.progress} />\n  </Stack>\n  <List tag=\"ul\" class=\"flex flex-col gap-2\">\n    {#each rows as row, i (row.id)}\n      {#if (row.strong ? true : (i === 0))}\n        <ListItem\n          class={\n            row.strong ? \"flex justify-between text-base font-bold\"\n            : \"flex justify-between text-sm text-muted-foreground\"\n          }\n          data-slot=\"summary-row\"\n        >\n          <Inline>\n            {row.label}\n          </Inline>\n          <Inline>\n            {fmtMoney(row.amount, row.currency)}\n          </Inline>\n        </ListItem>\n      {/if}\n    {/each}\n  </List>\n  <Button variant=\"default\" size=\"lg\" class=\"w-full\">\n    {labels.checkout}\n  </Button>\n</Stack>\n",
      "path": "components/drawer-lines.svelte",
      "target": "components/drawer-lines.svelte"
    }
  ],
  "meta": {
    "category": "components",
    "kind": "component",
    "tags": [
      "svelte",
      "component"
    ]
  },
  "name": "drawer-lines",
  "registryDependencies": [
    "button",
    "cart-drawer",
    "cart-list",
    "group",
    "inline",
    "list",
    "list-item",
    "media-frame",
    "number-field",
    "order-summary",
    "progress",
    "stack",
    "text",
    "utils"
  ],
  "runtime": "svelte",
  "title": "Drawer Lines",
  "type": "registry:component"
}
