{
  "$schema": "https://registry.buildy.tw/schema/registry-item.json",
  "dependencies": [],
  "description": "The gallery and the buy box of one product.",
  "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 ProductDetailLabels = {\n  add: string;\n  soldOut: string;\n  inStock: string;\n  qty: string;\n  decrease: string;\n  increase: string;\n  reviews: string;\n  ratingLabel: string;\n  shipping: string;\n  returns: string;\n  was: string;\n  empty: string;\n};\n",
      "path": "blocks/product-detail.types.ts",
      "target": "blocks/product-detail.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  A product page: a gallery (the main picture and optional thumbnails) beside the buy box (badge, rating, price,\n  stock, quantity, add button, shipping and returns notes). Axes: layout (split, stacked), media side, thumbs\n  (none, below), buy (full, compact), tone, density.\n-->\n<script lang=\"ts\">\nimport type { ProductDetailLabels } from \"./product-detail.types\";\nimport type { Product } from \"./product-card.types\";\n\nexport type ProductDetailProps = {\n  id: string;\n  product?: Product;\n  labels: ProductDetailLabels;\n  badges: Record<string, string>;\n  level?: 1 | 2;\n  layout?: \"split\" | \"stacked\";\n  mediaSide?: \"start\" | \"end\";\n  thumbs?: \"none\" | \"below\";\n  buy?: \"full\" | \"compact\";\n  tone?: \"default\" | \"muted\";\n  density?: \"default\" | \"roomy\";\n  landmarkLabel?: 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 LucideIcon from \"../icons/LucideIcon.vue\";\nimport Stack from \"../compose/Stack.vue\";\nimport Text from \"../compose/Text.vue\";\nimport EmptyState from \"../components/empty-state.vue\";\nimport NumberField from \"../components/number-field.vue\";\nimport ProductGallery from \"../components/product-gallery.vue\";\nimport ProductPrice from \"../components/product-price.vue\";\nimport Rating from \"../components/rating.vue\";\nimport SectionFrame from \"../components/section-frame.vue\";\nimport { at, tpl } from \"../utils\";\n\nconst {\n  id,\n  product,\n  labels,\n  badges,\n  level = 1,\n  layout = \"split\",\n  mediaSide = \"start\",\n  thumbs = \"below\",\n  buy = \"full\",\n  tone = \"default\",\n  density = \"default\",\n  landmarkLabel,\n} = defineProps<ProductDetailProps>();\nconst emit = defineEmits<{ add: [id: string] }>();\n</script>\n\n<template>\n  <SectionFrame v-if=\"!product\" :id=\"id\" :tone=\"tone\" :density=\"density\" :landmarkLabel=\"landmarkLabel\">\n    <EmptyState icon=\"package\" :title=\"labels.empty\" />\n  </SectionFrame>\n  <SectionFrame v-else\n    :id=\"id\"\n    :title=\"product?.name\"\n    :lead=\"product?.summary\"\n    :heading=\"{ level }\"\n    :layout=\"(((layout as string) === 'split') ? 'split' : 'stack')\"\n    :media=\"{ show: true, side: mediaSide, align: 'start' }\"\n    :tone=\"tone\"\n    :density=\"density\"\n    :landmarkLabel=\"landmarkLabel\"\n  >\n    <Stack gap=\"4\" align=\"stretch\" data-slot=\"buy-box\">\n      <Text\n        v-if=\"product?.category\"\n        size=\"xs\"\n        class=\"uppercase tracking-wide text-muted-foreground\"\n        data-slot=\"category\"\n      >\n        {{ product?.category }}\n      </Text>\n      <ProductPrice\n        :price=\"product?.price\"\n        :compareAt=\"product?.compareAt\"\n        :currency=\"product?.currency\"\n        :badge=\"(product?.badge ? at(badges, product?.badge) : '')\"\n        :was=\"labels.was\"\n      />\n      <Group gap=\"2\">\n        <Rating :value=\"product?.rating\" :label=\"tpl(labels.ratingLabel, product?.rating)\" />\n        <Text size=\"sm\" class=\"text-muted-foreground\">\n          {{ tpl(labels.reviews, product?.reviews) }}\n        </Text>\n      </Group>\n      <Text\n        size=\"sm\"\n        weight=\"medium\"\n        :class=\"(product?.inStock ? 'text-foreground' : 'text-destructive')\"\n        data-slot=\"stock\"\n      >\n        {{ (product?.inStock ? labels.inStock : labels.soldOut) }}\n      </Text>\n      <Group gap=\"4\" class=\"flex-wrap\">\n        <NumberField v-if=\"((buy as string) === 'full')\"\n          value=\"1\"\n          :name=\"tpl('{0}-qty', id)\"\n          min=\"1\"\n          :label=\"labels.qty\"\n          :decrease=\"labels.decrease\"\n          :increase=\"labels.increase\"\n        />\n        <Button :disabled=\"!product?.inStock\" @click=\"() => emit('add', product?.id)\">\n          {{ labels.add }}\n        </Button>\n      </Group>\n      <List v-if=\"((buy as string) === 'full')\" tag=\"ul\" class=\"flex flex-col gap-2 text-sm text-muted-foreground\">\n        <ListItem class=\"flex items-center gap-2\">\n          <LucideIcon name=\"truck\" :size=\"16\" />\n          <Inline>\n            {{ labels.shipping }}\n          </Inline>\n        </ListItem>\n        <ListItem class=\"flex items-center gap-2\">\n          <LucideIcon name=\"shield-check\" :size=\"16\" />\n          <Inline>\n            {{ labels.returns }}\n          </Inline>\n        </ListItem>\n      </List>\n    </Stack>\n    <template #aside>\n      <ProductGallery :name=\"product?.name\" :image=\"product?.image\" :thumbs=\"thumbs\" />\n    </template>\n  </SectionFrame>\n</template>\n",
      "path": "blocks/product-detail.vue",
      "target": "blocks/product-detail.vue"
    }
  ],
  "meta": {
    "category": "commerce",
    "group": "product",
    "kind": "block",
    "tags": [
      "vue",
      "block"
    ]
  },
  "name": "product-detail",
  "registryDependencies": [
    "button",
    "empty-state",
    "group",
    "inline",
    "list",
    "list-item",
    "lucide-icon",
    "number-field",
    "product-card",
    "product-gallery",
    "product-price",
    "rating",
    "section-frame",
    "stack",
    "text",
    "utils"
  ],
  "runtime": "vue",
  "title": "Product Detail",
  "type": "registry:block"
}
