{
  "$schema": "https://registry.buildy.tw/schema/registry-item.json",
  "dependencies": [],
  "description": "The filled body of the CartDrawer: the lines with a quantity field, then the free-delivery bar, the subtotal and total and the button.",
  "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 */\nimport { Fragment, type ReactNode } from \"react\";\nimport { Button, Group, Inline, List, ListItem, Progress, Stack, Text } from \"../compose\";\nimport { MediaFrame } from \"../components/media-frame\";\nimport { NumberField } from \"../components/number-field\";\nimport { fmtMoney, tpl } from \"../utils\";\nimport type { CartLine, CartLabels } from \"../blocks/cart-list.types\";\nimport type { SummaryRow } from \"../blocks/order-summary.types\";\nimport type { DrawerLabels } from \"../blocks/cart-drawer.types\";\n\nexport type DrawerLinesProps = {\n  lines: CartLine[];\n  rows: SummaryRow[];\n  labels: CartLabels;\n  drawer: DrawerLabels;\n  media?: \"image\" | \"none\";\n  field?: string;\n};\n\nexport function DrawerLines({\n  lines,\n  rows,\n  labels,\n  drawer,\n  media = \"image\",\n  field = \"qty\",\n}: DrawerLinesProps) {\n  return (\n    <>\n      <Stack gap=\"4\" align=\"stretch\" className=\"flex-1 p-4\" data-slot=\"lines\">\n        {(lines ?? []).map((line) => (\n          <Group key={line.id} gap=\"4\" align=\"start\" data-slot=\"item\">\n            {((media as string) === \"image\") ? (\n              <MediaFrame alt={line.name} src={line.image} ratio=\"1/1\" className=\"size-16 shrink-0\" />\n            ) : null}\n            <Stack gap=\"2\" align=\"stretch\" className=\"flex-1\">\n              <Group gap=\"2\" justify=\"between\" align=\"start\">\n                <Text size=\"sm\" weight=\"semibold\">\n                  {line.name}\n                </Text>\n                <Inline className=\"text-sm font-medium\">\n                  {fmtMoney((line.price * line.qty), line.currency)}\n                </Inline>\n              </Group>\n              <Text size=\"xs\" className=\"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        ))}\n      </Stack>\n      <Stack gap=\"4\" align=\"stretch\" className=\"border-t border-border p-4\" data-slot=\"drawer-lines\">\n        <Stack gap=\"2\" align=\"stretch\" className=\"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\" className=\"flex flex-col gap-2\">\n          {(rows ?? []).map((row, i) => (\n            <Fragment key={row.id}>\n              {(row.strong ? true : (i === 0)) ? (\n                <ListItem\n                  className={\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              ) : null}\n            </Fragment>\n          ))}\n        </List>\n        <Button variant=\"default\" size=\"lg\" className=\"w-full\">\n          {labels.checkout}\n        </Button>\n      </Stack>\n    </>\n  );\n}\n",
      "path": "components/drawer-lines.tsx",
      "target": "components/drawer-lines.tsx"
    }
  ],
  "meta": {
    "category": "components",
    "kind": "component",
    "tags": [
      "react",
      "component"
    ]
  },
  "name": "drawer-lines",
  "registryDependencies": [
    "cart-drawer",
    "cart-list",
    "compose",
    "media-frame",
    "number-field",
    "order-summary",
    "utils"
  ],
  "runtime": "react",
  "title": "Drawer Lines",
  "type": "registry:component"
}
