{
  "$schema": "https://registry.buildy.tw/schema/registry-item.json",
  "dependencies": [],
  "description": "Products as cards in a grid, a list or a rail that scrolls sideways.",
  "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  A section with a heading and the products as cards in a grid, as a list of horizontal cards, or as a rail that\n  scrolls sideways; an empty state when there are none. Axes: layout (grid, list, rail), columns, ratio, rating,\n  action, tone, density.\n-->\n<script lang=\"ts\">\nimport type { Product, ProductLabels } from \"./product-card.types\";\n\nexport type ProductGridProps = {\n  id: string;\n  title: string;\n  products: Product[];\n  labels: ProductLabels;\n  badges: Record<string, string>;\n  layout?: \"grid\" | \"list\" | \"rail\";\n  cols?: \"1-2\" | \"1-3\" | \"1-4\";\n  ratio?: \"4/3\" | \"1/1\" | \"3/4\";\n  rating?: \"show\" | \"hide\";\n  action?: \"button\" | \"none\";\n  tone?: \"default\" | \"muted\";\n  density?: \"roomy\" | \"default\" | \"compact\";\n  landmarkLabel?: string;\n};\n</script>\n\n<script setup lang=\"ts\">\nimport Box from \"../compose/Box.vue\";\nimport Grid from \"../compose/Grid.vue\";\nimport EmptyState from \"../components/empty-state.vue\";\nimport ProductCard from \"../blocks/product-card.vue\";\nimport SectionFrame from \"../components/section-frame.vue\";\n\nconst {\n  id,\n  title,\n  products,\n  labels,\n  badges,\n  layout = \"grid\",\n  cols = \"1-3\",\n  ratio = \"4/3\",\n  rating = \"show\",\n  action = \"button\",\n  tone = \"default\",\n  density = \"default\",\n  landmarkLabel,\n} = defineProps<ProductGridProps>();\nconst emit = defineEmits<{ add: [id: string] }>();\n</script>\n\n<template>\n  <SectionFrame :id=\"id\" :title=\"title\" :tone=\"tone\" :density=\"density\" :landmarkLabel=\"landmarkLabel\">\n    <EmptyState v-if=\"((products?.length ?? 0) === 0)\" icon=\"package\" :title=\"labels.empty\" />\n    <Box\n      v-else-if=\"((layout as string) === 'rail')\"\n      class=\"flex snap-x gap-4 overflow-x-auto pb-4\"\n      data-slot=\"items\"\n    >\n      <Box v-for=\"p in products\" :key=\"p.id\" class=\"w-64 shrink-0 snap-start\" data-slot=\"product\">\n        <ProductCard\n          :product=\"p\"\n          :labels=\"labels\"\n          :badges=\"badges\"\n          :layout=\"(((layout as string) === 'list') ? 'horizontal' : 'vertical')\"\n          :ratio=\"ratio\"\n          :rating=\"rating\"\n          :action=\"action\"\n          :density=\"(((density as string) === 'compact') ? 'compact' : 'default')\"\n          @add=\"() => emit('add', p.id)\"\n        />\n      </Box>\n    </Box>\n    <Grid v-else :cols=\"(((layout as string) === 'list') ? '1' : cols)\" class=\"gap-4\" data-slot=\"items\">\n      <ProductCard v-for=\"p in products\" :key=\"p.id\"\n        :product=\"p\"\n        :labels=\"labels\"\n        :badges=\"badges\"\n        :layout=\"(((layout as string) === 'list') ? 'horizontal' : 'vertical')\"\n        :ratio=\"ratio\"\n        :rating=\"rating\"\n        :action=\"action\"\n        :density=\"(((density as string) === 'compact') ? 'compact' : 'default')\"\n        @add=\"() => emit('add', p.id)\"\n      />\n    </Grid>\n  </SectionFrame>\n</template>\n",
      "path": "blocks/product-grid.vue",
      "target": "blocks/product-grid.vue"
    }
  ],
  "meta": {
    "category": "commerce",
    "group": "catalog",
    "kind": "block",
    "tags": [
      "vue",
      "block"
    ]
  },
  "name": "product-grid",
  "registryDependencies": [
    "box",
    "empty-state",
    "grid",
    "product-card",
    "section-frame",
    "utils"
  ],
  "runtime": "vue",
  "title": "Product Grid",
  "type": "registry:block"
}
