{
  "$schema": "https://registry.buildy.tw/schema/registry-item.json",
  "dependencies": [],
  "description": "Fill a box by weight: produce tiles beside the box with a meter.",
  "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 vegetable box by weight: produce tiles (picture, name, price per kg, a weight field in kg named after the\n  item) beside the box card with a meter of how full the box is, the total and the order button. Axes: layout\n  (split, stacked), tone.\n-->\n<script lang=\"ts\">\nimport type { Dish, FoodLabels } from \"./dish-showcase.types\";\n\nexport type VeggieBoxProps = {\n  id: string;\n  title: string;\n  lead?: string;\n  dishes: Dish[];\n  empty?: string;\n  labels: FoodLabels;\n  fill?: number;\n  total: number;\n  currency: string;\n  layout?: \"split\" | \"stacked\";\n  tone?: \"default\" | \"muted\";\n  landmarkLabel?: string;\n};\n</script>\n\n<script setup lang=\"ts\">\nimport Box from \"../compose/Box.vue\";\nimport Button from \"../compose/Button.vue\";\nimport Group from \"../compose/Group.vue\";\nimport Inline from \"../compose/Inline.vue\";\nimport Label from \"../compose/Label.vue\";\nimport LucideIcon from \"../icons/LucideIcon.vue\";\nimport Meter from \"../compose/Meter.vue\";\nimport Stack from \"../compose/Stack.vue\";\nimport Text from \"../compose/Text.vue\";\nimport EmptyState from \"../components/empty-state.vue\";\nimport MediaFrame from \"../components/media-frame.vue\";\nimport NumberField from \"../components/number-field.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  fill = 60,\n  total,\n  currency,\n  layout = \"split\",\n  tone = \"default\",\n  landmarkLabel,\n} = defineProps<VeggieBoxProps>();\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=\"package\" :title=\"empty\" />\n    <Box v-else class=\"grid grid-cols-1 items-start gap-8 lg:grid-cols-3\">\n      <Box\n        :class=\"\n          (layout as string) === 'split' ? 'grid grid-cols-2 gap-4 md:grid-cols-3 lg:col-span-2'\n          : 'grid grid-cols-2 gap-4 md:grid-cols-3 lg:col-span-3 lg:grid-cols-6'\n        \"\n        data-slot=\"items\"\n      >\n        <Stack\n          v-for=\"d in dishes\"\n          :key=\"d.id\"\n          gap=\"2\"\n          class=\"rounded bg-card inset-ring inset-ring-border p-4\"\n          data-slot=\"item\"\n        >\n          <MediaFrame :alt=\"d.name\" :src=\"d.image\" ratio=\"1/1\" />\n          <Text size=\"sm\" weight=\"semibold\">\n            {{ d.name }}\n          </Text>\n          <Text size=\"xs\" class=\"text-muted-foreground\">\n            {{ tpl(labels.perKg, fmtMoney(d.price, d.currency)) }}\n          </Text>\n          <NumberField\n            value=\"1\"\n            :name=\"tpl('{0}-kg-{1}', id, d.id)\"\n            min=\"0\"\n            :label=\"tpl(labels.weightOf, d.name)\"\n            :decrease=\"tpl(labels.decreaseOf, d.name)\"\n            :increase=\"tpl(labels.increaseOf, d.name)\"\n          />\n        </Stack>\n      </Box>\n      <Stack\n        gap=\"4\"\n        :class=\"\n          (layout as string) === 'split' ? 'rounded bg-card inset-ring inset-ring-border p-6 lg:sticky lg:top-8'\n          : 'rounded bg-card inset-ring inset-ring-border p-6 lg:col-span-3'\n        \"\n        data-slot=\"summary\"\n      >\n        <Text size=\"lg\" weight=\"semibold\">\n          {{ labels.summary }}\n        </Text>\n        <Label :for=\"tpl('{0}-fill', id)\" class=\"text-sm text-muted-foreground\">\n          {{ labels.boxFill }}\n        </Label>\n        <Meter :value=\"fill\" :min=\"0\" :max=\"100\" :id=\"tpl('{0}-fill', id)\" />\n        <Group gap=\"2\" align=\"baseline\" justify=\"between\">\n          <Text size=\"sm\" class=\"text-muted-foreground\">\n            {{ labels.total }}\n          </Text>\n          <Inline class=\"text-2xl font-bold\" role=\"status\" aria-live=\"polite\" data-slot=\"total\">\n            {{ fmtMoney(total, currency) }}\n          </Inline>\n        </Group>\n        <Button variant=\"default\" size=\"lg\" type=\"button\" class=\"w-full\">\n          <LucideIcon name=\"shopping-bag\" :size=\"16\" />\n          {{ labels.order }}\n        </Button>\n      </Stack>\n    </Box>\n  </SectionFrame>\n</template>\n",
      "path": "blocks/veggie-box.vue",
      "target": "blocks/veggie-box.vue"
    }
  ],
  "meta": {
    "category": "commerce",
    "group": "food",
    "kind": "block",
    "tags": [
      "vue",
      "block"
    ]
  },
  "name": "veggie-box",
  "registryDependencies": [
    "box",
    "button",
    "dish-showcase",
    "empty-state",
    "group",
    "inline",
    "label",
    "lucide-icon",
    "media-frame",
    "meter",
    "number-field",
    "section-frame",
    "stack",
    "text",
    "utils"
  ],
  "runtime": "vue",
  "title": "Veggie Box",
  "type": "registry:block"
}
