{
  "$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 */\nimport { For, type JSX } from \"solid-js\";\nimport { Box, Grid } from \"../compose\";\nimport { EmptyState } from \"../components/empty-state\";\nimport { ProductCard } from \"../blocks/product-card\";\nimport { SectionFrame } from \"../components/section-frame\";\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  onAdd?: (id: string) => void;\n};\n\nexport function ProductGrid({\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  onAdd,\n}: ProductGridProps) {\n  return (\n    <SectionFrame id={id} title={title} tone={tone} density={density} landmarkLabel={landmarkLabel}>\n      {((products?.length ?? 0) === 0) ? (\n        <EmptyState icon=\"package\" title={labels.empty} />\n      ) : ((layout as string) === \"rail\") ? (\n        <Box class=\"flex snap-x gap-4 overflow-x-auto pb-4\" data-slot=\"items\">\n          <For each={products ?? []}>{(p) => (\n            <Box 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                onAdd={() => onAdd?.(p.id)}\n              />\n            </Box>\n          )}</For>\n        </Box>\n      ) : (\n        <Grid cols={(((layout as string) === \"list\") ? \"1\" : cols)} class=\"gap-4\" data-slot=\"items\">\n          <For each={products ?? []}>{(p) => (\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              onAdd={() => onAdd?.(p.id)}\n            />\n          )}</For>\n        </Grid>\n      )}\n    </SectionFrame>\n  );\n}\n",
      "path": "blocks/product-grid.tsx",
      "target": "blocks/product-grid.tsx"
    }
  ],
  "meta": {
    "category": "commerce",
    "group": "catalog",
    "kind": "block",
    "tags": [
      "solid",
      "block"
    ]
  },
  "name": "product-grid",
  "registryDependencies": [
    "compose",
    "empty-state",
    "product-card",
    "section-frame",
    "utils"
  ],
  "runtime": "solid",
  "title": "Product Grid",
  "type": "registry:block"
}
