{
  "$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\">\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</script>\n\n<script setup lang=\"ts\">\nimport Box from \"../compose/Box.vue\";\nimport Grid from \"../compose/Grid.vue\";\nimport Group from \"../compose/Group.vue\";\nimport Stack from \"../compose/Stack.vue\";\nimport Text from \"../compose/Text.vue\";\nimport AddQty from \"../components/add-qty.vue\";\nimport CartCount from \"../components/cart-count.vue\";\nimport EmptyState from \"../components/empty-state.vue\";\nimport MediaFrame from \"../components/media-frame.vue\";\nimport SectionFrame from \"../components/section-frame.vue\";\nimport { fmtMoney, tpl } from \"../utils\";\n\nconst {\n  id,\n  title,\n  lead = \"\",\n  dishes,\n  empty = \"\",\n  labels,\n  count = 0,\n  media = \"image\",\n  tone = \"default\",\n  landmarkLabel,\n} = defineProps<DishCartGridProps>();\n</script>\n\n<template>\n  <SectionFrame :id=\"id\" :title=\"title\" :lead=\"lead\" :tone=\"tone\" :landmarkLabel=\"landmarkLabel\">\n    <EmptyState v-if=\"((dishes?.length ?? 0) === 0)\" icon=\"shopping-bag\" :title=\"empty\" />\n    <Stack v-else 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        <Stack\n          v-for=\"d in dishes\"\n          :key=\"d.id\"\n          gap=\"4\"\n          class=\"rounded bg-card inset-ring inset-ring-border overflow-hidden pb-4\"\n          data-slot=\"item\"\n        >\n          <MediaFrame v-if=\"((media as string) === 'image')\" :alt=\"d.name\" :src=\"d.image\" />\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      </Grid>\n    </Stack>\n  </SectionFrame>\n</template>\n",
      "path": "blocks/dish-cart-grid.vue",
      "target": "blocks/dish-cart-grid.vue"
    }
  ],
  "meta": {
    "category": "commerce",
    "group": "food",
    "kind": "block",
    "tags": [
      "vue",
      "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": "vue",
  "title": "Dish Cart Grid",
  "type": "registry:block"
}
