{
  "$schema": "https://registry.buildy.tw/schema/registry-item.json",
  "dependencies": [],
  "description": "Delivery zones and their prices as a table or as cards.",
  "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  Delivery zones and their prices as a table or as cards: the zone and its areas, the price, the order that\n  ships free, the minimum order, the time and an express badge. Axes: layout (table, cards), tone, density.\n-->\n<script lang=\"ts\" module>\n  import type { Snippet } from \"svelte\";\n  import type { Zone, ZoneLabels } from \"./zone-table.types\";\n\n  export type ZoneTableProps = {\n    id: string;\n    title: string;\n    lead?: string;\n    zones: Zone[];\n    empty?: string;\n    labels: ZoneLabels;\n    layout?: \"table\" | \"cards\";\n    tone?: \"default\" | \"muted\";\n    density?: \"default\" | \"compact\";\n    landmarkLabel?: string;\n  };\n</script>\n\n<script lang=\"ts\">\n  import Badge from \"../compose/Badge.svelte\";\n  import Grid from \"../compose/Grid.svelte\";\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 Title from \"../compose/Title.svelte\";\n  import EmptyState from \"../components/empty-state.svelte\";\n  import SectionFrame from \"../components/section-frame.svelte\";\n  import ZoneRows from \"../components/zone-rows.svelte\";\n  import { fmtMoney } from \"../utils\";\n\n  let {\n    id,\n    title,\n    lead = \"\",\n    zones,\n    empty = \"\",\n    labels,\n    layout = \"table\",\n    tone = \"default\",\n    density = \"default\",\n    landmarkLabel,\n  }: ZoneTableProps = $props();\n</script>\n\n<SectionFrame id={id} title={title} lead={lead} tone={tone} density={density} landmarkLabel={landmarkLabel}>\n  {#if ((zones?.length ?? 0) === 0)}\n    <EmptyState icon=\"map\" title={empty} />\n  {:else if ((layout as string) === \"table\")}\n    <ZoneRows zones={zones} labels={labels} />\n  {:else}\n    <Grid cols=\"1-3\" class=\"gap-4\" data-slot=\"items\">\n      {#each zones as z (z.id)}\n        <Stack gap=\"4\" class=\"rounded bg-card inset-ring inset-ring-border p-6\" data-slot=\"item\">\n          <Stack gap=\"2\">\n            <Title as={3} size=\"lg\" weight=\"bold\">\n              {z.name}\n            </Title>\n            <Text size=\"sm\" class=\"text-muted-foreground\">\n              {z.area}\n            </Text>\n          </Stack>\n          <Text size=\"3xl\" weight=\"bold\">\n            {fmtMoney(z.price, z.currency)}\n          </Text>\n          <List tag=\"ul\" class=\"flex flex-col gap-2 border-t border-border pt-4\">\n            <ListItem class=\"flex items-center justify-between gap-4 text-sm\">\n              <Inline class=\"text-muted-foreground\">\n                {labels.freeFrom}\n              </Inline>\n              <Inline class=\"font-medium\">\n                {fmtMoney(z.freeFrom, z.currency)}\n              </Inline>\n            </ListItem>\n            <ListItem class=\"flex items-center justify-between gap-4 text-sm\">\n              <Inline class=\"text-muted-foreground\">\n                {labels.minOrder}\n              </Inline>\n              <Inline class=\"font-medium\">\n                {fmtMoney(z.minOrder, z.currency)}\n              </Inline>\n            </ListItem>\n            <ListItem class=\"flex items-center justify-between gap-4 text-sm\">\n              <Inline class=\"text-muted-foreground\">\n                {labels.time}\n              </Inline>\n              <Inline class=\"font-medium\">\n                {z.time}\n              </Inline>\n            </ListItem>\n          </List>\n          {#if z.express}\n            <Badge variant=\"secondary\" size=\"default\" class=\"w-fit\">\n              {z.express}\n            </Badge>\n          {/if}\n        </Stack>\n      {/each}\n    </Grid>\n  {/if}\n</SectionFrame>\n",
      "path": "blocks/zone-table.svelte",
      "target": "blocks/zone-table.svelte"
    },
    {
      "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\nexport type Zone = {\n  id: string;\n  name: string;\n  area: string;\n  price: number;\n  freeFrom: number;\n  minOrder: number;\n  time: string;\n  express: string;\n  currency: string;\n};\n\nexport type ZoneLabels = {\n  caption: string;\n  zone: string;\n  price: string;\n  freeFrom: string;\n  minOrder: string;\n  time: string;\n  express: string;\n};\n",
      "path": "blocks/zone-table.types.ts",
      "target": "blocks/zone-table.types.ts"
    }
  ],
  "meta": {
    "category": "commerce",
    "group": "delivery",
    "kind": "block",
    "tags": [
      "svelte",
      "block"
    ]
  },
  "name": "zone-table",
  "registryDependencies": [
    "badge",
    "empty-state",
    "grid",
    "inline",
    "list",
    "list-item",
    "section-frame",
    "stack",
    "text",
    "title",
    "utils",
    "zone-rows"
  ],
  "runtime": "svelte",
  "title": "Zone Table",
  "type": "registry:block"
}
