{
  "$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 */\nimport { For, type JSX } from \"solid-js\";\nimport { Box, Button, Checkbox, Form, Grid, Group, Input, Label, Stack, Text, Textarea } from \"../compose\";\nimport { LucideIcon } from \"../icons/LucideIcon\";\nimport { Field } from \"../components/field\";\nimport { NumberField } from \"../components/number-field\";\nimport { SectionFrame } from \"../components/section-frame\";\nimport { cn, tpl } from \"../utils\";\nimport type { ReservationLabels } from \"./reservation-form.types\";\nimport type { Feature } from \"./feature-grid.types\";\n\nexport 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\nexport function ReservationForm({\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) {\n  return (\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          {((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          ) : null}\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          {((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          ) : null}\n          {((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          ) : null}\n          <Button variant=\"default\" size=\"default\" type=\"submit\" class=\"w-fit\">\n            {labels.submit}\n          </Button>\n        </Form>\n        {(((layout as string) === \"split\") && ((details?.length ?? 0) > 0)) ? (\n          <Stack gap=\"4\" data-slot=\"details\">\n            <For each={details ?? []}>{(d) => (\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            )}</For>\n          </Stack>\n        ) : null}\n      </Grid>\n    </SectionFrame>\n  );\n}\n",
      "path": "blocks/reservation-form.tsx",
      "target": "blocks/reservation-form.tsx"
    },
    {
      "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": [
      "solid",
      "block"
    ]
  },
  "name": "reservation-form",
  "registryDependencies": [
    "compose",
    "feature-grid",
    "field",
    "lucide-icon",
    "number-field",
    "section-frame",
    "utils"
  ],
  "runtime": "solid",
  "title": "Reservation Form",
  "type": "registry:block"
}
