{
  "$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 */\nimport { type ReactNode } from \"react\";\nimport { Box, Form, Grid, Input, Textarea } from \"../compose\";\nimport { CartSummaryCard } from \"../components/cart-summary-card\";\nimport { CheckoutStep } from \"../components/checkout-step\";\nimport { CheckoutSubmit } from \"../components/checkout-submit\";\nimport { Field } from \"../components/field\";\nimport { PaymentOptions } from \"../components/payment-options\";\nimport { SectionFrame } from \"../components/section-frame\";\nimport { SlotGrid } from \"../components/slot-grid\";\nimport { tpl } from \"../utils\";\nimport type { CheckoutLabels } from \"./checkout-form.types\";\nimport type { Day } from \"../components/slot-grid.types\";\nimport type { Payment } from \"../components/payment-options.types\";\nimport type { CartLine } from \"./cart-list.types\";\nimport type { SummaryRow } from \"./order-summary.types\";\nimport type { Promo, CartSummaryLabels } from \"../components/cart-summary-card.types\";\n\nexport 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\nexport function CheckoutForm({\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) {\n  return (\n    <SectionFrame id={id} title={title} tone={tone} landmarkLabel={landmarkLabel}>\n      <Box className=\"grid grid-cols-1 items-start gap-8 lg:grid-cols-3\">\n        <Form\n          method=\"dialog\"\n          className={\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\" className=\"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\" className=\"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            {((days?.length ?? 0) > 0) ? (\n              <SlotGrid days={days} name={tpl(\"{0}-slot\", id)} item=\"plain\" />\n            ) : null}\n          </CheckoutStep>\n          <CheckoutStep number=\"4\" title={labels.payment} text={labels.paymentText} layout={layout}>\n            {((payments?.length ?? 0) > 0) ? (\n              <PaymentOptions payments={payments} name={tpl(\"{0}-payment\", id)} checked=\"payment-card\" />\n            ) : null}\n          </CheckoutStep>\n          <CheckoutSubmit id={id} consent={labels.consent} submit={labels.submit} legal={labels.legal} />\n        </Form>\n        {((summary as string) === \"aside\") ? (\n          <Box className=\"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        ) : null}\n      </Box>\n    </SectionFrame>\n  );\n}\n",
      "path": "blocks/checkout-form.tsx",
      "target": "blocks/checkout-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 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": [
      "react",
      "block"
    ]
  },
  "name": "checkout-form",
  "registryDependencies": [
    "cart-list",
    "cart-summary-card",
    "checkout-step",
    "checkout-submit",
    "compose",
    "field",
    "order-summary",
    "payment-options",
    "section-frame",
    "slot-grid",
    "utils"
  ],
  "runtime": "react",
  "title": "Checkout Form",
  "type": "registry:block"
}
