{
  "$schema": "https://registry.buildy.tw/schema/registry-item.json",
  "dependencies": [],
  "description": "A compact list of groceries with a small picture 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  Groceries as a compact list: a small square picture (or none), the name, the pack size, the price and an add\n  button, in one or two columns. Axes: thumbs (show, hide), cols (1, 2), 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 GroceryListProps = {\n    id: string;\n    title: string;\n    lead?: string;\n    dishes: Dish[];\n    empty?: string;\n    labels: FoodLabels;\n    thumbs?: \"show\" | \"hide\";\n    cols?: \"1\" | \"2\";\n    tone?: \"default\" | \"muted\";\n    landmarkLabel?: string;\n  };\n</script>\n\n<script lang=\"ts\">\n  import Inline from \"../compose/Inline.svelte\";\n  import List from \"../compose/List.svelte\";\n  import ListItem from \"../compose/ListItem.svelte\";\n  import Stack from \"../compose/Stack.svelte\";\n  import Text from \"../compose/Text.svelte\";\n  import AddIcon from \"../components/add-icon.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    thumbs = \"show\",\n    cols = \"2\",\n    tone = \"default\",\n    landmarkLabel,\n  }: GroceryListProps = $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    <List\n      tag=\"ul\"\n      class={\n        (cols as string) === \"2\" ? \"grid grid-cols-1 gap-x-8 md:grid-cols-2\"\n        : \"grid grid-cols-1\"\n      }\n      data-slot=\"items\"\n    >\n      {#each dishes as d (d.id)}\n        <ListItem class=\"flex items-center gap-4 border-b border-border py-2\" data-slot=\"item\">\n          {#if ((thumbs as string) === \"show\")}\n            <MediaFrame alt={d.name} src={d.image} ratio=\"1/1\" class=\"size-12 shrink-0\" />\n          {/if}\n          <Stack gap=\"0\" class=\"min-w-0 flex-1\">\n            <Text size=\"sm\" weight=\"semibold\">\n              {d.name}\n            </Text>\n            <Text size=\"xs\" class=\"text-muted-foreground\">\n              {tpl(\"{0} · {1}\", d.weight, d.tag)}\n            </Text>\n          </Stack>\n          <Inline class=\"text-sm font-bold\">\n            {fmtMoney(d.price, d.currency)}\n          </Inline>\n          <AddIcon label={tpl(labels.addOf, d.name)} />\n        </ListItem>\n      {/each}\n    </List>\n  {/if}\n</SectionFrame>\n",
      "path": "blocks/grocery-list.svelte",
      "target": "blocks/grocery-list.svelte"
    }
  ],
  "meta": {
    "category": "commerce",
    "group": "food",
    "kind": "block",
    "tags": [
      "svelte",
      "block"
    ]
  },
  "name": "grocery-list",
  "registryDependencies": [
    "add-icon",
    "dish-showcase",
    "empty-state",
    "inline",
    "list",
    "list-item",
    "media-frame",
    "section-frame",
    "stack",
    "text",
    "utils"
  ],
  "runtime": "svelte",
  "title": "Grocery List",
  "type": "registry:block"
}
