{
  "$schema": "https://registry.buildy.tw/schema/registry-item.json",
  "dependencies": [],
  "description": "Contacts, address, a window and the payment beside a sticky order summary.",
  "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 checkout on one page: contacts, address, a delivery window, the payment and the consent as stacked steps,\n  beside a sticky order summary with the lines, a promo code and the totals. Static markup. Axes: layout (cards:\n  each step in a card, numbered: numbered steps divided by a line), summary (aside, none), tone.\n-->\n<script lang=\"ts\" module>\n  import type { Snippet } from \"svelte\";\n  import type { CheckoutLabels } from \"./checkout-form.types\";\n  import type { Day } from \"../components/slot-grid.types\";\n  import type { Payment } from \"../components/payment-options.types\";\n  import type { CartLine } from \"./cart-list.types\";\n  import type { SummaryRow } from \"./order-summary.types\";\n  import type { Promo, CartSummaryLabels } from \"../components/cart-summary-card.types\";\n\n  export type CheckoutFormProps = {\n    id: string;\n    title?: string;\n    days: Day[];\n    payments: Payment[];\n    lines: CartLine[];\n    rows: SummaryRow[];\n    promos: Promo[];\n    labels: CheckoutLabels;\n    totals: CartSummaryLabels;\n    layout?: \"cards\" | \"numbered\";\n    summary?: \"aside\" | \"none\";\n    tone?: \"default\" | \"muted\";\n    landmarkLabel?: string;\n  };\n</script>\n\n<script lang=\"ts\">\n  import Box from \"../compose/Box.svelte\";\n  import Form from \"../compose/Form.svelte\";\n  import Grid from \"../compose/Grid.svelte\";\n  import Input from \"../compose/Input.svelte\";\n  import Textarea from \"../compose/Textarea.svelte\";\n  import CartSummaryCard from \"../components/cart-summary-card.svelte\";\n  import CheckoutStep from \"../components/checkout-step.svelte\";\n  import CheckoutSubmit from \"../components/checkout-submit.svelte\";\n  import Field from \"../components/field.svelte\";\n  import PaymentOptions from \"../components/payment-options.svelte\";\n  import SectionFrame from \"../components/section-frame.svelte\";\n  import SlotGrid from \"../components/slot-grid.svelte\";\n  import { tpl } from \"../utils\";\n\n  let {\n    id,\n    title = \"\",\n    days,\n    payments,\n    lines,\n    rows,\n    promos,\n    labels,\n    totals,\n    layout = \"cards\",\n    summary = \"aside\",\n    tone = \"default\",\n    landmarkLabel,\n  }: CheckoutFormProps = $props();\n</script>\n\n<SectionFrame id={id} title={title} tone={tone} landmarkLabel={landmarkLabel}>\n  <Box class=\"grid grid-cols-1 items-start gap-8 lg:grid-cols-3\">\n    <Form\n      method=\"dialog\"\n      class={\n        (summary as string) === \"aside\" ? \"flex flex-col gap-6 lg:col-span-2\"\n        : \"flex flex-col gap-6 lg:col-span-3\"\n      }\n      data-slot=\"checkout-form\"\n    >\n      <CheckoutStep number=\"1\" title={labels.contacts} text={labels.contactsText} layout={layout}>\n        <Grid cols=\"1-2\" class=\"gap-4\">\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          <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        </Grid>\n      </CheckoutStep>\n      <CheckoutStep number=\"2\" title={labels.address} text={labels.addressText} layout={layout}>\n        <Field label={labels.street} htmlFor={tpl(\"{0}-street\", id)}>\n          <Input type=\"text\" name=\"street\" autocomplete=\"address-line1\" id={tpl(\"{0}-street\", id)} data-slot=\"field\" />\n        </Field>\n        <Grid cols=\"2-4\" class=\"gap-4\">\n          <Field label={labels.house} htmlFor={tpl(\"{0}-house\", id)}>\n            <Input type=\"text\" name=\"house\" id={tpl(\"{0}-house\", id)} data-slot=\"field\" />\n          </Field>\n          <Field label={labels.flat} htmlFor={tpl(\"{0}-flat\", id)}>\n            <Input type=\"text\" name=\"flat\" id={tpl(\"{0}-flat\", id)} data-slot=\"field\" />\n          </Field>\n          <Field label={labels.entrance} htmlFor={tpl(\"{0}-entrance\", id)}>\n            <Input type=\"text\" name=\"entrance\" id={tpl(\"{0}-entrance\", id)} data-slot=\"field\" />\n          </Field>\n          <Field label={labels.floor} htmlFor={tpl(\"{0}-floor\", id)}>\n            <Input type=\"text\" name=\"floor\" id={tpl(\"{0}-floor\", id)} data-slot=\"field\" />\n          </Field>\n        </Grid>\n        <Field label={labels.comment} htmlFor={tpl(\"{0}-comment\", id)}>\n          <Textarea rows={4} name=\"comment\" id={tpl(\"{0}-comment\", id)} data-slot=\"field\" />\n        </Field>\n      </CheckoutStep>\n      <CheckoutStep number=\"3\" title={labels.slot} text={labels.slotText} layout={layout}>\n        {#if ((days?.length ?? 0) > 0)}\n          <SlotGrid days={days} name={tpl(\"{0}-slot\", id)} item=\"plain\" />\n        {/if}\n      </CheckoutStep>\n      <CheckoutStep number=\"4\" title={labels.payment} text={labels.paymentText} layout={layout}>\n        {#if ((payments?.length ?? 0) > 0)}\n          <PaymentOptions payments={payments} name={tpl(\"{0}-payment\", id)} checked=\"payment-card\" />\n        {/if}\n      </CheckoutStep>\n      <CheckoutSubmit id={id} consent={labels.consent} submit={labels.submit} legal={labels.legal} />\n    </Form>\n    {#if ((summary as string) === \"aside\")}\n      <Box class=\"lg:sticky lg:top-8\" data-slot=\"aside\">\n        <CartSummaryCard\n          field={tpl(\"{0}-promo\", id)}\n          lines={lines}\n          rows={rows}\n          promos={promos}\n          labels={totals}\n          items=\"show\"\n        />\n      </Box>\n    {/if}\n  </Box>\n</SectionFrame>\n",
      "path": "blocks/checkout-form.svelte",
      "target": "blocks/checkout-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 CheckoutLabels = {\n  contacts: string;\n  contactsText: string;\n  name: string;\n  phone: string;\n  email: string;\n  address: string;\n  addressText: string;\n  street: string;\n  house: string;\n  flat: string;\n  entrance: string;\n  floor: string;\n  comment: string;\n  slot: string;\n  slotText: string;\n  payment: string;\n  paymentText: string;\n  consent: string;\n  submit: string;\n  legal: string;\n};\n",
      "path": "blocks/checkout-form.types.ts",
      "target": "blocks/checkout-form.types.ts"
    }
  ],
  "meta": {
    "category": "commerce",
    "group": "checkout",
    "kind": "block",
    "tags": [
      "svelte",
      "block"
    ]
  },
  "name": "checkout-form",
  "registryDependencies": [
    "box",
    "cart-list",
    "cart-summary-card",
    "checkout-step",
    "checkout-submit",
    "field",
    "form",
    "grid",
    "input",
    "order-summary",
    "payment-options",
    "section-frame",
    "slot-grid",
    "textarea",
    "utils"
  ],
  "runtime": "svelte",
  "title": "Checkout Form",
  "type": "registry:block"
}
