{
  "$schema": "https://registry.buildy.tw/schema/registry-item.json",
  "dependencies": [],
  "description": "Cart Summary Card 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\nexport type Promo = {\n  id: string;\n  code: string;\n};\n\nexport type CartSummaryLabels = {\n  title: string;\n  items: string;\n  promo: string;\n  apply: string;\n  codes: string;\n  progress: string;\n  checkout: string;\n  note: string;\n};\n",
      "path": "components/cart-summary-card.types.ts",
      "target": "components/cart-summary-card.types.ts"
    },
    {
      "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 order summary card of the cart page and the checkout: the lines in short (optional), a promo code field\n  with ready codes, the free-delivery progress, the totals, the button and a note. Static markup.\n-->\n<script lang=\"ts\">\nimport type { Promo, CartSummaryLabels } from \"./cart-summary-card.types\";\nimport type { CartLine } from \"../blocks/cart-list.types\";\nimport type { SummaryRow } from \"../blocks/order-summary.types\";\n\nexport type CartSummaryCardProps = {\n  lines: CartLine[];\n  rows: SummaryRow[];\n  promos: Promo[];\n  labels: CartSummaryLabels;\n  items?: \"show\" | \"hide\";\n  promo?: \"show\" | \"hide\";\n  field?: string;\n  progress?: \"show\" | \"hide\";\n  value?: number;\n};\n</script>\n\n<script setup lang=\"ts\">\nimport Badge from \"../compose/Badge.vue\";\nimport Button from \"../compose/Button.vue\";\nimport Group from \"../compose/Group.vue\";\nimport Inline from \"../compose/Inline.vue\";\nimport Input from \"../compose/Input.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 Title from \"../compose/Title.vue\";\nimport MediaFrame from \"../components/media-frame.vue\";\nimport { cn, fmtMoney, tpl } from \"../utils\";\n\nconst {\n  lines,\n  rows,\n  promos,\n  labels,\n  items = \"hide\",\n  promo = \"show\",\n  field = \"promo\",\n  progress = \"show\",\n  value = 70,\n} = defineProps<CartSummaryCardProps>();\n</script>\n\n<template>\n  <Stack gap=\"6\" align=\"stretch\" class=\"rounded bg-card inset-ring inset-ring-border p-6\" data-slot=\"summary\">\n    <Group gap=\"4\" align=\"baseline\" justify=\"between\">\n      <Title :as=\"2\" size=\"lg\" weight=\"semibold\">\n        {{ labels.title }}\n      </Title>\n      <Text size=\"xs\" class=\"text-muted-foreground\">\n        {{ tpl(labels.items, ((lines?.length ?? 0) == null ? undefined : String((lines?.length ?? 0)))) }}\n      </Text>\n    </Group>\n    <List\n      v-if=\"(((items as string) === 'show') && ((lines?.length ?? 0) > 0))\"\n      tag=\"ul\"\n      class=\"flex flex-col gap-4\"\n      data-slot=\"summary-lines\"\n    >\n      <ListItem v-for=\"line in lines\" :key=\"line.id\" class=\"flex items-center gap-4 text-sm\" data-slot=\"cart-line\">\n        <MediaFrame :alt=\"line.name\" :src=\"line.image\" ratio=\"1/1\" class=\"size-12 shrink-0\" />\n        <Stack gap=\"0\" class=\"flex-1\">\n          <Text size=\"sm\" weight=\"semibold\">\n            {{ line.name }}\n          </Text>\n          <Text size=\"xs\" class=\"text-muted-foreground\">\n            {{ tpl(\"{0} x {1}\", line.qty, fmtMoney(line.price, line.currency)) }}\n          </Text>\n        </Stack>\n        <Inline class=\"font-medium\">\n          {{ fmtMoney((line.price * line.qty), line.currency) }}\n        </Inline>\n      </ListItem>\n    </List>\n    <Stack v-if=\"((promo as string) === 'show')\" gap=\"2\" align=\"stretch\" data-slot=\"promo\">\n      <Group gap=\"2\" align=\"center\">\n        <Input type=\"text\" :name=\"field\" :aria-label=\"labels.promo\" :placeholder=\"labels.promo\" class=\"min-w-0 flex-1\" />\n        <Button variant=\"outline\" size=\"default\" type=\"button\">\n          {{ labels.apply }}\n        </Button>\n      </Group>\n      <Group v-if=\"((promos?.length ?? 0) > 0)\" gap=\"2\" align=\"center\" class=\"flex-wrap\">\n        <Text size=\"xs\" class=\"text-muted-foreground\">\n          {{ labels.codes }}\n        </Text>\n        <Badge v-for=\"c in promos\" :key=\"c.id\" variant=\"outline\" size=\"sm\">\n          {{ c.code }}\n        </Badge>\n      </Group>\n    </Stack>\n    <Stack\n      v-if=\"((progress as string) === 'show')\"\n      gap=\"2\"\n      align=\"stretch\"\n      class=\"rounded bg-muted p-4\"\n      data-slot=\"progress\"\n    >\n      <Text size=\"sm\">\n        {{ labels.progress }}\n      </Text>\n      <Progress :value=\"(value == null ? undefined : String(value))\" max=\"100\" :aria-label=\"labels.progress\" />\n    </Stack>\n    <List v-if=\"((rows?.length ?? 0) > 0)\" tag=\"ul\" class=\"flex flex-col gap-2\">\n      <ListItem v-for=\"row in rows\" :key=\"row.id\"\n        :class=\"cn(\n          'flex items-center justify-between gap-4',\n          (\n            row.strong ? 'border-t border-border pt-4 text-base font-bold'\n            : 'text-sm text-muted-foreground'\n          )\n        )\"\n        data-slot=\"row\"\n      >\n        <Inline>\n          {{ row.label }}\n        </Inline>\n        <Inline>\n          {{ fmtMoney(row.amount, row.currency) }}\n        </Inline>\n      </ListItem>\n    </List>\n    <Button variant=\"default\" size=\"lg\" class=\"w-full\">\n      {{ labels.checkout }}\n    </Button>\n    <Text size=\"xs\" class=\"text-muted-foreground\">\n      {{ labels.note }}\n    </Text>\n  </Stack>\n</template>\n",
      "path": "components/cart-summary-card.vue",
      "target": "components/cart-summary-card.vue"
    }
  ],
  "meta": {
    "category": "components",
    "kind": "component",
    "tags": [
      "vue",
      "component"
    ]
  },
  "name": "cart-summary-card",
  "registryDependencies": [
    "badge",
    "button",
    "cart-list",
    "group",
    "inline",
    "input",
    "list",
    "list-item",
    "media-frame",
    "order-summary",
    "progress",
    "stack",
    "text",
    "title",
    "utils"
  ],
  "runtime": "vue",
  "title": "Cart Summary Card",
  "type": "registry:component"
}
