{
  "$schema": "https://registry.buildy.tw/schema/registry-item.json",
  "dependencies": [],
  "description": "Pizza cards with a size and a crust radio group and an add button.",
  "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 * Pizzas with a picker on each card: the picture, name and toppings, a radio group of sizes and one of crusts\n * (each a fieldset with role radiogroup), the price and an add button. Axes: layout (cards, rows), tone.\n */\nimport { type ReactNode } from \"react\";\nimport { Box, Button, Group, Inline, Stack, Text } from \"../compose\";\nimport { EmptyState } from \"../components/empty-state\";\nimport { MediaFrame } from \"../components/media-frame\";\nimport { OptionChips } from \"../components/option-chips\";\nimport { SectionFrame } from \"../components/section-frame\";\nimport { fmtMoney, tpl } from \"../utils\";\nimport type { Dish, FoodLabels } from \"./dish-showcase.types\";\nimport type { DishOption } from \"../components/option-chips.types\";\n\nexport type PizzaPickerProps = {\n  id: string;\n  title: string;\n  lead?: string;\n  dishes: Dish[];\n  empty?: string;\n  labels: FoodLabels;\n  sizes: DishOption[];\n  crusts: DishOption[];\n  layout?: \"cards\" | \"rows\";\n  tone?: \"default\" | \"muted\";\n  landmarkLabel?: string;\n};\n\nexport function PizzaPicker({\n  id,\n  title,\n  lead = \"\",\n  dishes,\n  empty = \"\",\n  labels,\n  sizes,\n  crusts,\n  layout = \"cards\",\n  tone = \"default\",\n  landmarkLabel,\n}: PizzaPickerProps) {\n  return (\n    <SectionFrame id={id} title={title} lead={lead} tone={tone} landmarkLabel={landmarkLabel}>\n      {((dishes?.length ?? 0) === 0) ? (\n        <EmptyState icon=\"star\" title={empty} />\n      ) : (\n        <Box\n          className={\n            (layout as string) === \"rows\" ? \"flex flex-col gap-4\"\n            : \"grid grid-cols-1 gap-4 md:grid-cols-3\"\n          }\n          data-slot=\"items\"\n        >\n          {(dishes ?? []).map((d) => (\n            <Box key={d.id}\n              className={\n                (layout as string) === \"rows\" ? \"rounded bg-card inset-ring inset-ring-border grid grid-cols-1 gap-4 p-4 md:grid-cols-3\"\n                : \"rounded bg-card inset-ring inset-ring-border flex flex-col gap-4 p-4\"\n              }\n              data-slot=\"item\"\n            >\n              <MediaFrame alt={d.name} src={d.image} ratio=\"1/1\" />\n              <Stack gap=\"4\" className={(((layout as string) === \"rows\") ? \"md:col-span-2\" : \"\")}>\n                <Stack gap=\"2\">\n                  <Text size=\"lg\" weight=\"semibold\">\n                    {d.name}\n                  </Text>\n                  <Text size=\"sm\" className=\"text-muted-foreground\">\n                    {d.summary}\n                  </Text>\n                </Stack>\n                <OptionChips name={tpl(\"{0}-size-{1}\", id, d.id)} legend={labels.size} options={sizes} />\n                <OptionChips name={tpl(\"{0}-crust-{1}\", id, d.id)} legend={labels.crust} options={crusts} />\n                <Group gap=\"4\" align=\"center\" justify=\"between\" className=\"mt-auto\">\n                  <Inline className=\"text-xl font-bold\">\n                    {fmtMoney(d.price, d.currency)}\n                  </Inline>\n                  <Button variant=\"default\" size=\"default\" type=\"button\" aria-label={tpl(labels.addOf, d.name)}>\n                    {labels.add}\n                  </Button>\n                </Group>\n              </Stack>\n            </Box>\n          ))}\n        </Box>\n      )}\n    </SectionFrame>\n  );\n}\n",
      "path": "blocks/pizza-picker.tsx",
      "target": "blocks/pizza-picker.tsx"
    }
  ],
  "meta": {
    "category": "commerce",
    "group": "food",
    "kind": "block",
    "tags": [
      "react",
      "block"
    ]
  },
  "name": "pizza-picker",
  "registryDependencies": [
    "compose",
    "dish-showcase",
    "empty-state",
    "media-frame",
    "option-chips",
    "section-frame",
    "utils"
  ],
  "runtime": "react",
  "title": "Pizza Picker",
  "type": "registry:block"
}
