{
  "$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-->\n<script lang=\"ts\" module>\n  import type { Snippet } from \"svelte\";\n  import type { Dish, FoodLabels } from \"./dish-showcase.types\";\n\n  export 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</script>\n\n<script lang=\"ts\">\n  import Box from \"../compose/Box.svelte\";\n  import Grid from \"../compose/Grid.svelte\";\n  import Group from \"../compose/Group.svelte\";\n  import Stack from \"../compose/Stack.svelte\";\n  import Text from \"../compose/Text.svelte\";\n  import AddQty from \"../components/add-qty.svelte\";\n  import CartCount from \"../components/cart-count.svelte\";\n  import EmptyState from \"../components/empty-state.svelte\";\n  import MediaFrame from \"../components/media-frame.svelte\";\n  import SectionFrame from \"../components/section-frame.svelte\";\n  import { fmtMoney, tpl } from \"../utils\";\n\n  let {\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 = $props();\n</script>\n\n<SectionFrame id={id} title={title} lead={lead} tone={tone} landmarkLabel={landmarkLabel}>\n  {#if ((dishes?.length ?? 0) === 0)}\n    <EmptyState icon=\"shopping-bag\" title={empty} />\n  {:else}\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        {#each dishes as d (d.id)}\n          <Stack gap=\"4\" class=\"rounded bg-card inset-ring inset-ring-border overflow-hidden pb-4\" data-slot=\"item\">\n            {#if ((media as string) === \"image\")}\n              <MediaFrame alt={d.name} src={d.image} />\n            {/if}\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        {/each}\n      </Grid>\n    </Stack>\n  {/if}\n</SectionFrame>\n",
      "path": "blocks/dish-cart-grid.svelte",
      "target": "blocks/dish-cart-grid.svelte"
    }
  ],
  "meta": {
    "category": "commerce",
    "group": "food",
    "kind": "block",
    "tags": [
      "svelte",
      "block"
    ]
  },
  "name": "dish-cart-grid",
  "registryDependencies": [
    "add-qty",
    "box",
    "cart-count",
    "dish-showcase",
    "empty-state",
    "grid",
    "group",
    "media-frame",
    "section-frame",
    "stack",
    "text",
    "utils"
  ],
  "runtime": "svelte",
  "title": "Dish Cart Grid",
  "type": "registry:block"
}
