{
  "$schema": "https://registry.buildy.tw/schema/registry-item.json",
  "dependencies": [],
  "description": "Book a table: name, phone, date, time, guests, optional notes and consent.",
  "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 table reservation: name, phone and/or email, date, time, guests, optional notes and consent; in the split\n  layout, the ways to reach the house sit beside the form. Axes: layout (single, split), density, fields (full,\n  compact).\n-->\n<script lang=\"ts\" module>\n  import type { Snippet } from \"svelte\";\n  import type { ReservationLabels } from \"./reservation-form.types\";\n  import type { Feature } from \"./feature-grid.types\";\n\n  export type ReservationFormProps = {\n    id: string;\n    title: string;\n    text: string;\n    labels: ReservationLabels;\n    details: Feature[];\n    layout?: \"single\" | \"split\";\n    fields?: \"full\" | \"compact\";\n    terms?: \"show\" | \"hide\";\n    density?: \"default\" | \"compact\";\n    landmarkLabel?: string;\n  };\n</script>\n\n<script lang=\"ts\">\n  import Box from \"../compose/Box.svelte\";\n  import Button from \"../compose/Button.svelte\";\n  import Checkbox from \"../compose/Checkbox.svelte\";\n  import Form from \"../compose/Form.svelte\";\n  import Grid from \"../compose/Grid.svelte\";\n  import Group from \"../compose/Group.svelte\";\n  import Input from \"../compose/Input.svelte\";\n  import Label from \"../compose/Label.svelte\";\n  import LucideIcon from \"../icons/LucideIcon.svelte\";\n  import Stack from \"../compose/Stack.svelte\";\n  import Text from \"../compose/Text.svelte\";\n  import Textarea from \"../compose/Textarea.svelte\";\n  import Field from \"../components/field.svelte\";\n  import NumberField from \"../components/number-field.svelte\";\n  import SectionFrame from \"../components/section-frame.svelte\";\n  import { cn, tpl } from \"../utils\";\n\n  let {\n    id,\n    title,\n    text,\n    labels,\n    details,\n    layout = \"single\",\n    fields = \"full\",\n    terms = \"hide\",\n    density = \"default\",\n    landmarkLabel,\n  }: ReservationFormProps = $props();\n</script>\n\n<SectionFrame\n  id={id}\n  title={title}\n  lead={text}\n  density={density}\n  measure={(((layout as string) === \"single\") ? \"xl\" : \"default\")}\n  landmarkLabel={landmarkLabel}\n>\n  <Grid cols={(((layout as string) === \"split\") ? \"1-2\" : \"1\")} class=\"items-start gap-8\">\n    <Form method=\"dialog\" class=\"flex w-full flex-col gap-4\" data-slot=\"reservation-form\">\n      <Field label={labels.name} htmlFor={tpl(\"{0}-name\", id)}>\n        <Input type=\"text\" name=\"name\" autocomplete=\"name\" id={tpl(\"{0}-name\", id)} data-slot=\"field\" />\n      </Field>\n      <Field label={labels.phone} htmlFor={tpl(\"{0}-phone\", id)}>\n        <Input type=\"tel\" name=\"phone\" autocomplete=\"tel\" id={tpl(\"{0}-phone\", id)} data-slot=\"field\" />\n      </Field>\n      {#if ((fields as string) === \"full\")}\n        <Field label={labels.email} htmlFor={tpl(\"{0}-email\", id)}>\n          <Input type=\"email\" name=\"email\" autocomplete=\"email\" id={tpl(\"{0}-email\", id)} data-slot=\"field\" />\n        </Field>\n      {/if}\n      <Group gap=\"4\" class=\"flex-wrap\">\n        <Box class=\"min-w-0 flex-1\">\n          <Field label={labels.date} htmlFor={tpl(\"{0}-date\", id)}>\n            <Input type=\"date\" name=\"date\" id={tpl(\"{0}-date\", id)} data-slot=\"field\" />\n          </Field>\n        </Box>\n        <Box class=\"min-w-0 flex-1\">\n          <Field label={labels.time} htmlFor={tpl(\"{0}-time\", id)}>\n            <Input type=\"time\" name=\"time\" id={tpl(\"{0}-time\", id)} data-slot=\"field\" />\n          </Field>\n        </Box>\n      </Group>\n      <Stack gap=\"2\">\n        <Label class=\"text-xs font-bold text-foreground\">\n          {labels.guests}\n        </Label>\n        <NumberField\n          value=\"2\"\n          name={tpl(\"{0}-guests\", id)}\n          min=\"1\"\n          label={labels.guests}\n          decrease={labels.decrease}\n          increase={labels.increase}\n        />\n      </Stack>\n      {#if ((fields as string) === \"full\")}\n        <Field label={labels.notes} htmlFor={tpl(\"{0}-notes\", id)}>\n          <Textarea rows={4} name=\"notes\" id={tpl(\"{0}-notes\", id)} data-slot=\"field\" />\n        </Field>\n      {/if}\n      {#if ((terms as string) === \"show\")}\n        <Group gap=\"2\" align=\"center\" class={cn(\"w-fit\", \"\")}>\n          <Checkbox name=\"consent\" id={tpl(\"{0}-consent\", id)} />\n          <Label for={tpl(\"{0}-consent\", id)} class=\"text-sm\">\n            {labels.consent}\n          </Label>\n        </Group>\n      {/if}\n      <Button variant=\"default\" size=\"default\" type=\"submit\" class=\"w-fit\">\n        {labels.submit}\n      </Button>\n    </Form>\n    {#if (((layout as string) === \"split\") && ((details?.length ?? 0) > 0))}\n      <Stack gap=\"4\" data-slot=\"details\">\n        {#each details as d (d.id)}\n          <Group gap=\"4\" align=\"start\" data-slot=\"detail\">\n            <LucideIcon name={d.icon} size={20} />\n            <Stack gap=\"0\">\n              <Text size=\"base\" weight=\"semibold\">\n                {d.title}\n              </Text>\n              <Text size=\"sm\" class=\"text-muted-foreground\">\n                {d.text}\n              </Text>\n            </Stack>\n          </Group>\n        {/each}\n      </Stack>\n    {/if}\n  </Grid>\n</SectionFrame>\n",
      "path": "blocks/reservation-form.svelte",
      "target": "blocks/reservation-form.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 ReservationLabels = {\n  name: string;\n  phone: string;\n  email: string;\n  date: string;\n  time: string;\n  guests: string;\n  notes: string;\n  consent: string;\n  submit: string;\n  decrease: string;\n  increase: string;\n};\n",
      "path": "blocks/reservation-form.types.ts",
      "target": "blocks/reservation-form.types.ts"
    }
  ],
  "meta": {
    "category": "commerce",
    "group": "restaurant",
    "kind": "block",
    "tags": [
      "svelte",
      "block"
    ]
  },
  "name": "reservation-form",
  "registryDependencies": [
    "box",
    "button",
    "checkbox",
    "feature-grid",
    "field",
    "form",
    "grid",
    "group",
    "input",
    "label",
    "lucide-icon",
    "number-field",
    "section-frame",
    "stack",
    "text",
    "textarea",
    "utils"
  ],
  "runtime": "svelte",
  "title": "Reservation Form",
  "type": "registry:block"
}
