{
  "$schema": "https://registry.buildy.tw/schema/registry-item.json",
  "dependencies": [],
  "description": "Cards with a quantity field and an add button, under a live cart count.",
  "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 * Dishes added to the cart from the card: the live cart count over a grid of cards, each with a picture, name,\n * weight, price and a quantity field named after the dish beside the add button. Axes: media (image, none),\n * tone.\n */\nimport { For, type JSX } from \"solid-js\";\nimport { Box, Grid, Group, Stack, Text } from \"../compose\";\nimport { AddQty } from \"../components/add-qty\";\nimport { CartCount } from \"../components/cart-count\";\nimport { EmptyState } from \"../components/empty-state\";\nimport { MediaFrame } from \"../components/media-frame\";\nimport { SectionFrame } from \"../components/section-frame\";\nimport { fmtMoney, tpl } from \"../utils\";\nimport type { Dish, FoodLabels } from \"./dish-showcase.types\";\n\nexport type DishCartGridProps = {\n  id: string;\n  title: string;\n  lead?: string;\n  dishes: Dish[];\n  empty?: string;\n  labels: FoodLabels;\n  count?: number;\n  media?: \"image\" | \"none\";\n  tone?: \"default\" | \"muted\";\n  landmarkLabel?: string;\n};\n\nexport function DishCartGrid({\n  id,\n  title,\n  lead = \"\",\n  dishes,\n  empty = \"\",\n  labels,\n  count = 0,\n  media = \"image\",\n  tone = \"default\",\n  landmarkLabel,\n}: DishCartGridProps) {\n  return (\n    <SectionFrame id={id} title={title} lead={lead} tone={tone} landmarkLabel={landmarkLabel}>\n      {((dishes?.length ?? 0) === 0) ? (\n        <EmptyState icon=\"shopping-bag\" title={empty} />\n      ) : (\n        <Stack gap=\"4\" align=\"stretch\">\n          <Group justify=\"end\">\n            <CartCount count={count} label={labels.inCart} />\n          </Group>\n          <Grid cols=\"1-3\" class=\"gap-4\" data-slot=\"items\">\n            <For each={dishes ?? []}>{(d) => (\n              <Stack gap=\"4\" class=\"rounded bg-card inset-ring inset-ring-border overflow-hidden pb-4\" data-slot=\"item\">\n                {((media as string) === \"image\") ? (\n                  <MediaFrame alt={d.name} src={d.image} />\n                ) : null}\n                <Stack gap=\"2\" class={(((media as string) === \"image\") ? \"px-4\" : \"px-4 pt-4\")}>\n                  <Group gap=\"2\" align=\"baseline\" justify=\"between\">\n                    <Text size=\"base\" weight=\"semibold\">\n                      {d.name}\n                    </Text>\n                    <Text size=\"xs\" class=\"text-muted-foreground\">\n                      {d.weight}\n                    </Text>\n                  </Group>\n                  <Text size=\"lg\" weight=\"bold\">\n                    {fmtMoney(d.price, d.currency)}\n                  </Text>\n                </Stack>\n                <Box class=\"px-4\">\n                  <AddQty name={tpl(\"{0}-qty-{1}\", id, d.id)} dish={d.name} labels={labels} />\n                </Box>\n              </Stack>\n            )}</For>\n          </Grid>\n        </Stack>\n      )}\n    </SectionFrame>\n  );\n}\n",
      "path": "blocks/dish-cart-grid.tsx",
      "target": "blocks/dish-cart-grid.tsx"
    }
  ],
  "meta": {
    "category": "commerce",
    "group": "food",
    "kind": "block",
    "tags": [
      "solid",
      "block"
    ]
  },
  "name": "dish-cart-grid",
  "registryDependencies": [
    "add-qty",
    "cart-count",
    "compose",
    "dish-showcase",
    "empty-state",
    "media-frame",
    "section-frame",
    "utils"
  ],
  "runtime": "solid",
  "title": "Dish Cart Grid",
  "type": "registry:block"
}
