{
  "$schema": "https://registry.buildy.tw/schema/registry-item.json",
  "dependencies": [],
  "description": "The cart lines beside a summary with a promo code and a free-delivery bar.",
  "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 ShoppingCartLabels = {\n  back: string;\n  clear: string;\n  empty: string;\n};\n",
      "path": "blocks/shopping-cart.types.ts",
      "target": "blocks/shopping-cart.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 cart as a page: the lines as cards (picture, name, variant, price, quantity, line total, remove) with the\n  way back, beside the order summary with a promo code and the free-delivery bar. Static markup. Axes: layout\n  (split: the summary beside the lines, stacked: below them), promo (show, hide), progress (show, hide), tone.\n-->\n<script lang=\"ts\">\nimport type { ShoppingCartLabels } from \"./shopping-cart.types\";\nimport type { CartLine, CartLabels } from \"./cart-list.types\";\nimport type { SummaryRow } from \"./order-summary.types\";\nimport type { Promo, CartSummaryLabels } from \"../components/cart-summary-card.types\";\n\nexport type ShoppingCartProps = {\n  id: string;\n  title: string;\n  lines: CartLine[];\n  rows: SummaryRow[];\n  promos: Promo[];\n  labels: CartLabels;\n  totals: CartSummaryLabels;\n  actions: ShoppingCartLabels;\n  layout?: \"split\" | \"stacked\";\n  promo?: \"show\" | \"hide\";\n  progress?: \"show\" | \"hide\";\n  tone?: \"default\" | \"muted\";\n  landmarkLabel?: string;\n};\n</script>\n\n<script setup lang=\"ts\">\nimport Box from \"../compose/Box.vue\";\nimport Button from \"../compose/Button.vue\";\nimport Group from \"../compose/Group.vue\";\nimport LucideIcon from \"../icons/LucideIcon.vue\";\nimport Stack from \"../compose/Stack.vue\";\nimport Text from \"../compose/Text.vue\";\nimport CartSummaryCard from \"../components/cart-summary-card.vue\";\nimport EmptyState from \"../components/empty-state.vue\";\nimport MediaFrame from \"../components/media-frame.vue\";\nimport NumberField from \"../components/number-field.vue\";\nimport SectionFrame from \"../components/section-frame.vue\";\nimport { fmtMoney, tpl } from \"../utils\";\n\nconst {\n  id,\n  title,\n  lines,\n  rows,\n  promos,\n  labels,\n  totals,\n  actions,\n  layout = \"split\",\n  promo = \"show\",\n  progress = \"show\",\n  tone = \"default\",\n  landmarkLabel,\n} = defineProps<ShoppingCartProps>();\n</script>\n\n<template>\n  <SectionFrame :id=\"id\" :title=\"title\" :tone=\"tone\" :landmarkLabel=\"landmarkLabel\">\n    <Box\n      :class=\"\n        (layout as string) === 'split' ? 'grid grid-cols-1 items-start gap-8 lg:grid-cols-3'\n        : 'grid grid-cols-1 gap-8'\n      \"\n    >\n      <Stack\n        gap=\"4\"\n        align=\"stretch\"\n        :class=\"(((layout as string) === 'split') ? 'lg:col-span-2' : '')\"\n        data-slot=\"lines\"\n      >\n        <EmptyState v-if=\"((lines?.length ?? 0) === 0)\" icon=\"shopping-cart\" :title=\"actions.empty\" />\n        <Group v-for=\"line in lines\" :key=\"line.id\"\n          gap=\"4\"\n          align=\"center\"\n          class=\"rounded bg-card inset-ring inset-ring-border flex-wrap p-4\"\n          data-slot=\"item\"\n        >\n          <MediaFrame :alt=\"line.name\" :src=\"line.image\" ratio=\"1/1\" class=\"size-20 shrink-0\" />\n          <Stack gap=\"0\" class=\"min-w-40 flex-1\">\n            <Text size=\"sm\" weight=\"semibold\">\n              {{ line.name }}\n            </Text>\n            <Text size=\"xs\" class=\"text-muted-foreground\">\n              {{ line.variant }}\n            </Text>\n            <Text size=\"sm\">\n              {{ fmtMoney(line.price, line.currency) }}\n            </Text>\n          </Stack>\n          <NumberField\n            :value=\"(line.qty == null ? undefined : String(line.qty))\"\n            :name=\"tpl('{0}-qty-{1}', id, line.id)\"\n            min=\"1\"\n            :label=\"labels.qty\"\n            :decrease=\"labels.decrease\"\n            :increase=\"labels.increase\"\n          />\n          <Text size=\"base\" weight=\"bold\" class=\"w-24 text-right\">\n            {{ fmtMoney((line.price * line.qty), line.currency) }}\n          </Text>\n          <Button variant=\"ghost\" size=\"sm\" layout=\"icon\" :aria-label=\"labels.remove\">\n            <LucideIcon name=\"trash\" :size=\"16\" />\n          </Button>\n        </Group>\n        <Group gap=\"4\" justify=\"between\" class=\"flex-wrap\">\n          <Button variant=\"outline\" size=\"default\">\n            <LucideIcon name=\"arrow-left\" :size=\"16\" />\n            {{ actions.back }}\n          </Button>\n          <Button variant=\"ghost\" size=\"default\">\n            {{ actions.clear }}\n          </Button>\n        </Group>\n      </Stack>\n      <Box :class=\"(((layout as string) === 'split') ? 'lg:sticky lg:top-8' : '')\" data-slot=\"aside\">\n        <CartSummaryCard\n          :field=\"tpl('{0}-promo', id)\"\n          :lines=\"lines\"\n          :rows=\"rows\"\n          :promos=\"promos\"\n          :labels=\"totals\"\n          :promo=\"promo\"\n          :progress=\"progress\"\n        />\n      </Box>\n    </Box>\n  </SectionFrame>\n</template>\n",
      "path": "blocks/shopping-cart.vue",
      "target": "blocks/shopping-cart.vue"
    }
  ],
  "meta": {
    "category": "commerce",
    "group": "checkout",
    "kind": "block",
    "tags": [
      "vue",
      "block"
    ]
  },
  "name": "shopping-cart",
  "registryDependencies": [
    "box",
    "button",
    "cart-list",
    "cart-summary-card",
    "empty-state",
    "group",
    "lucide-icon",
    "media-frame",
    "number-field",
    "order-summary",
    "section-frame",
    "stack",
    "text",
    "utils"
  ],
  "runtime": "vue",
  "title": "Shopping Cart",
  "type": "registry:block"
}
