{
  "$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\">\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</script>\n\n<script setup lang=\"ts\">\nimport Button from \"../compose/Button.vue\";\nimport Group from \"../compose/Group.vue\";\nimport Inline from \"../compose/Inline.vue\";\nimport List from \"../compose/List.vue\";\nimport ListItem from \"../compose/ListItem.vue\";\nimport Progress from \"../compose/Progress.vue\";\nimport Stack from \"../compose/Stack.vue\";\nimport Text from \"../compose/Text.vue\";\nimport MediaFrame from \"../components/media-frame.vue\";\nimport NumberField from \"../components/number-field.vue\";\nimport { fmtMoney, tpl } from \"../utils\";\n\nconst { lines, rows, labels, drawer, media = \"image\", field = \"qty\" } = defineProps<DrawerLinesProps>();\n</script>\n\n<template>\n  <Stack gap=\"4\" align=\"stretch\" class=\"flex-1 p-4\" data-slot=\"lines\">\n    <Group v-for=\"line in lines\" :key=\"line.id\" gap=\"4\" align=\"start\" data-slot=\"item\">\n      <MediaFrame\n        v-if=\"((media as string) === 'image')\"\n        :alt=\"line.name\"\n        :src=\"line.image\"\n        ratio=\"1/1\"\n        class=\"size-16 shrink-0\"\n      />\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  </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      <template v-for=\"(row, i) in rows\" :key=\"row.id\">\n        <ListItem v-if=\"(row.strong ? true : (i === 0))\"\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      </template>\n    </List>\n    <Button variant=\"default\" size=\"lg\" class=\"w-full\">\n      {{ labels.checkout }}\n    </Button>\n  </Stack>\n</template>\n",
      "path": "components/drawer-lines.vue",
      "target": "components/drawer-lines.vue"
    }
  ],
  "meta": {
    "category": "components",
    "kind": "component",
    "tags": [
      "vue",
      "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": "vue",
  "title": "Drawer Lines",
  "type": "registry:component"
}
