{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "booking-reservation-form",
  "title": "Booking / Reservation Form",
  "description": "A booking form in one card: service cards, a month calendar with closed days and keyboard navigation, time slots built from your opening hours with booked ones struck out, a guest counter, contact fields, a live summary and a confirmation screen.",
  "dependencies": [
    "motion",
    "clsx",
    "tailwind-merge"
  ],
  "files": [
    {
      "path": "registry/new-york/booking-reservation-form/booking-reservation-form.tsx",
      "content": "\"use client\";\n\nimport * as React from \"react\";\nimport { AnimatePresence, motion, useReducedMotion } from \"motion/react\";\nimport { clsx, type ClassValue } from \"clsx\";\nimport { twMerge } from \"tailwind-merge\";\n\nfunction cn(...inputs: ClassValue[]) {\n  return twMerge(clsx(inputs));\n}\n\nexport interface BookingService {\n  id: string;\n  name: string;\n  /** Minutes. */\n  duration: number;\n  price?: number;\n  description?: string;\n}\n\nexport interface BookingData {\n  serviceId: string;\n  /** YYYY-MM-DD */\n  date: string;\n  /** HH:MM, 24 hour */\n  time: string;\n  guests: number;\n  name: string;\n  email: string;\n  phone: string;\n  notes: string;\n}\n\nexport interface BookingReservationFormProps {\n  title?: string;\n  description?: string;\n  /** Services or table types to choose from. Pass [] to skip the step. */\n  services?: BookingService[];\n  /** Party size picker. Set max to 1 to hide it. */\n  guests?: { min: number; max: number; default: number } | null;\n  /** Opening time and closing time, 24 hour, and the gap between slots in minutes. */\n  hours?: { open: string; close: string; step: number };\n  /** Days of the week you are closed, 0 = Sunday. */\n  closedDays?: number[];\n  /** How many days ahead people can book. */\n  daysAhead?: number;\n  /** Return true for slots that are already taken. Defaults to a fixed demo pattern. */\n  isBooked?: (date: string, time: string) => boolean;\n  currency?: string;\n  /**\n   * Called with the booking. Return a promise: the button spins while it runs, a rejection (or a\n   * returned string) shows an error, and success shows the confirmation.\n   */\n  onBook?: (data: BookingData) => void | string | Promise<void | string>;\n  theme?: \"dark\" | \"light\";\n  className?: string;\n}\n\nconst PALETTES = {\n  dark: { bg: \"#0A0A0A\", text: \"#F5F4F1\", muted: \"rgba(245,244,241,0.6)\", faint: \"rgba(245,244,241,0.36)\", card: \"#111111\", border: \"rgba(255,255,255,0.1)\", field: \"rgba(255,255,255,0.03)\", fieldBorder: \"rgba(255,255,255,0.14)\", chip: \"rgba(255,255,255,0.05)\", on: \"#F5F4F1\", onText: \"#0A0A0A\", error: \"#FF7A6B\", ok: \"#4ADE80\", ring: \"rgba(245,244,241,0.6)\" },\n  light: { bg: \"#FAFAF8\", text: \"#0A0A0A\", muted: \"rgba(10,10,10,0.6)\", faint: \"rgba(10,10,10,0.38)\", card: \"#FFFFFF\", border: \"rgba(10,10,10,0.1)\", field: \"#FFFFFF\", fieldBorder: \"rgba(10,10,10,0.16)\", chip: \"rgba(10,10,10,0.04)\", on: \"#0A0A0A\", onText: \"#FAFAF8\", error: \"#D93F2B\", ok: \"#16A34A\", ring: \"rgba(10,10,10,0.5)\" },\n};\n\nconst DEFAULT_SERVICES: BookingService[] = [\n  { id: \"consult\", name: \"Consultation\", duration: 30, price: 0, description: \"A first chat about what you need.\" },\n  { id: \"standard\", name: \"Standard session\", duration: 60, price: 90, description: \"The most booked option.\" },\n  { id: \"extended\", name: \"Extended session\", duration: 90, price: 130, description: \"For bigger projects or two people.\" },\n];\n\nconst MONTHS = [\"January\", \"February\", \"March\", \"April\", \"May\", \"June\", \"July\", \"August\", \"September\", \"October\", \"November\", \"December\"];\nconst WD = [\"Sun\", \"Mon\", \"Tue\", \"Wed\", \"Thu\", \"Fri\", \"Sat\"];\nconst pad = (n: number) => String(n).padStart(2, \"0\");\nconst key = (d: Date) => `${d.getFullYear()}-${pad(d.getMonth() + 1)}-${pad(d.getDate())}`;\nconst toMin = (t: string) => Number(t.slice(0, 2)) * 60 + Number(t.slice(3, 5));\nconst toTime = (m: number) => `${pad(Math.floor(m / 60))}:${pad(m % 60)}`;\nfunction demoBooked(date: string, time: string) {\n  let h = 0;\n  for (const c of date + time) h = (h * 31 + c.charCodeAt(0)) >>> 0;\n  return h % 4 === 0;\n}\n\nexport function BookingReservationForm({\n  title = \"Book a session\",\n  description = \"Pick a service, a day and a time. You will get a confirmation by email straight away.\",\n  services = DEFAULT_SERVICES,\n  guests = { min: 1, max: 6, default: 2 },\n  hours = { open: \"09:00\", close: \"18:00\", step: 30 },\n  closedDays = [0],\n  daysAhead = 42,\n  isBooked = demoBooked,\n  currency = \"€\",\n  onBook,\n  theme = \"dark\",\n  className,\n}: BookingReservationFormProps) {\n  const p = PALETTES[theme];\n  const reduce = !!useReducedMotion();\n  const uid = React.useId();\n  const [today, setToday] = React.useState<Date | null>(null);\n  const [month, setMonth] = React.useState<Date | null>(null);\n  const [service, setService] = React.useState(services[1]?.id ?? services[0]?.id ?? \"\");\n  const [date, setDate] = React.useState<string | null>(null);\n  const [time, setTime] = React.useState<string | null>(null);\n  const [party, setParty] = React.useState(guests?.default ?? 1);\n  const [f, setF] = React.useState({ name: \"\", email: \"\", phone: \"\", notes: \"\" });\n  const [touched, setTouched] = React.useState(false);\n  const [status, setStatus] = React.useState<\"idle\" | \"loading\" | \"done\">(\"idle\");\n  const [error, setError] = React.useState(\"\");\n  const [focusDay, setFocusDay] = React.useState<string | null>(null);\n  const dayRefs = React.useRef<Record<string, HTMLButtonElement | null>>({});\n  const doneRef = React.useCallback((el: HTMLHeadingElement | null) => el?.focus(), []);\n\n  // Today is only known in the browser; render the calendar after mount.\n  React.useEffect(() => {\n    const id = setTimeout(() => {\n      const t = new Date();\n      t.setHours(0, 0, 0, 0);\n      setToday(t);\n      setMonth(new Date(t.getFullYear(), t.getMonth(), 1));\n    }, 0);\n    return () => clearTimeout(id);\n  }, []);\n\n  const svc = services.find((s) => s.id === service);\n  const duration = svc?.duration ?? hours.step;\n  const last = today ? new Date(today.getFullYear(), today.getMonth(), today.getDate() + daysAhead) : null;\n  const isOpen = (d: Date) => !!today && !!last && d >= today && d <= last && !closedDays.includes(d.getDay());\n  const slots = React.useMemo(() => {\n    if (!date) return [];\n    const out: { t: string; booked: boolean }[] = [];\n    for (let m = toMin(hours.open); m + duration <= toMin(hours.close); m += hours.step) out.push({ t: toTime(m), booked: isBooked(date, toTime(m)) });\n    return out;\n  }, [date, hours, duration, isBooked]);\n\n  const cells = React.useMemo(() => {\n    if (!month) return [];\n    const first = (month.getDay() + 6) % 7; // weeks start on Monday\n    const days = new Date(month.getFullYear(), month.getMonth() + 1, 0).getDate();\n    return [...Array.from({ length: first }, () => null), ...Array.from({ length: days }, (_, i) => new Date(month.getFullYear(), month.getMonth(), i + 1))];\n  }, [month]);\n\n  const pickDay = (k: string) => {\n    setDate(k);\n    setTime(null);\n    setError(\"\");\n  };\n  const gridKey = (e: React.KeyboardEvent, d: Date) => {\n    const map: Record<string, number> = { ArrowRight: 1, ArrowLeft: -1, ArrowDown: 7, ArrowUp: -7 };\n    if (!(e.key in map)) return;\n    e.preventDefault();\n    const n = new Date(d.getFullYear(), d.getMonth(), d.getDate() + map[e.key]);\n    if (month && (n.getMonth() !== month.getMonth() || n.getFullYear() !== month.getFullYear())) setMonth(new Date(n.getFullYear(), n.getMonth(), 1));\n    setFocusDay(key(n));\n    setTimeout(() => dayRefs.current[key(n)]?.focus(), 0);\n  };\n\n  const emailOk = /^\\S+@\\S+\\.\\S+$/.test(f.email.trim());\n  const nameOk = f.name.trim().length > 1;\n  const submit = async (e: React.FormEvent) => {\n    e.preventDefault();\n    setTouched(true);\n    setError(\"\");\n    if (!date || !time) return setError(\"Choose a day and a time first.\");\n    if (!nameOk || !emailOk) return;\n    setStatus(\"loading\");\n    try {\n      const res = await onBook?.({ serviceId: service, date, time, guests: party, ...f, name: f.name.trim(), email: f.email.trim() });\n      if (typeof res === \"string\") {\n        setError(res);\n        setStatus(\"idle\");\n        return;\n      }\n      setStatus(\"done\");\n    } catch (err) {\n      setError(err instanceof Error ? err.message : \"Something went wrong. Please try again.\");\n      setStatus(\"idle\");\n    }\n  };\n\n  const ring = { [\"--tw-ring-color\" as string]: p.ring, [\"--tw-ring-offset-color\" as string]: p.card } as React.CSSProperties;\n  const focus = \"outline-none focus-visible:ring-2 focus-visible:ring-offset-2\";\n  const fieldCls = \"w-full rounded-xl border px-3.5 text-[16px] outline-none focus-visible:ring-2\";\n  const label = \"mb-1.5 block text-[13px]\";\n  const dateLabel = (k: string) => {\n    const d = new Date(`${k}T12:00:00`);\n    return `${WD[d.getDay()]} ${d.getDate()} ${MONTHS[d.getMonth()].slice(0, 3)}`;\n  };\n  const end = time ? toTime(toMin(time) + duration) : null;\n  const canPrev = !!month && !!today && (month.getFullYear() > today.getFullYear() || month.getMonth() > today.getMonth());\n  const canNext = !!month && !!last && new Date(month.getFullYear(), month.getMonth() + 1, 1) <= last;\n\n  return (\n    <section className={cn(\"@container w-full\", className)} style={{ background: p.bg, color: p.text }}>\n      <div className=\"mx-auto max-w-5xl px-6 py-16 @[640px]:py-20\">\n        <div className=\"mb-8\">\n          <h2 className=\"m-0 text-[30px] leading-[1.1] font-semibold tracking-[-0.03em] @[640px]:text-[40px]\">{title}</h2>\n          {description && <p className=\"mt-3 mb-0 max-w-[520px] text-[16px] leading-[1.6]\" style={{ color: p.muted }}>{description}</p>}\n        </div>\n        <div className=\"overflow-hidden rounded-2xl border\" style={{ background: p.card, borderColor: p.border }}>\n          <AnimatePresence mode=\"wait\" initial={false}>\n            {status === \"done\" && date && time ? (\n              <motion.div key=\"done\" role=\"status\" initial={reduce ? false : { opacity: 0, y: 10 }} animate={{ opacity: 1, y: 0 }} exit={reduce ? undefined : { opacity: 0 }} className=\"flex flex-col items-center px-6 py-14 text-center\">\n                <motion.span initial={reduce ? false : { scale: 0.5 }} animate={{ scale: 1 }} transition={{ type: \"spring\", stiffness: 260, damping: 15 }} className=\"flex h-14 w-14 items-center justify-center rounded-full\" style={{ background: p.ok, color: \"#0A0A0A\" }} aria-hidden=\"true\">\n                  <svg width=\"24\" height=\"24\" viewBox=\"0 0 16 16\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"2.2\" strokeLinecap=\"round\" strokeLinejoin=\"round\">\n                    <path d=\"m3 8.5 3 3 7-7\" />\n                  </svg>\n                </motion.span>\n                <h3 ref={doneRef} tabIndex={-1} className=\"mt-5 mb-0 text-[24px] font-semibold tracking-[-0.02em] outline-none\">\n                  You are booked, {f.name.trim().split(\" \")[0]}\n                </h3>\n                <p className=\"mt-2 mb-0 text-[15px]\" style={{ color: p.muted }}>\n                  {svc?.name} · {dateLabel(date)} · {time} to {end}\n                  {guests && guests.max > 1 ? ` · ${party} ${party === 1 ? \"guest\" : \"guests\"}` : \"\"}\n                </p>\n                <p className=\"mt-1 mb-0 text-[13.5px]\" style={{ color: p.faint }}>\n                  A confirmation is on its way to {f.email.trim()}.\n                </p>\n                <button\n                  type=\"button\"\n                  onClick={() => {\n                    setStatus(\"idle\");\n                    setTime(null);\n                    setTouched(false);\n                  }}\n                  className={cn(\"mt-6 h-10 cursor-pointer rounded-full border px-4 text-[14px] font-medium\", focus)}\n                  style={{ borderColor: p.border, background: \"transparent\", color: p.text, ...ring }}\n                >\n                  Book another time\n                </button>\n              </motion.div>\n            ) : (\n              <motion.form key=\"form\" noValidate onSubmit={submit} initial={reduce ? false : { opacity: 0 }} animate={{ opacity: 1 }} exit={reduce ? undefined : { opacity: 0 }} className=\"grid @[860px]:grid-cols-[1.15fr_1fr]\">\n                {/* Left: service, calendar and times */}\n                <div className=\"flex flex-col gap-6 p-5 @[640px]:p-7\">\n                  {services.length > 0 && (\n                    <fieldset className=\"m-0 min-w-0 border-0 p-0\">\n                      <legend className=\"mb-2 p-0 text-[13px] font-medium\">1. Service</legend>\n                      <div className=\"grid grid-cols-1 gap-2 @[520px]:grid-cols-3\">\n                        {services.map((s) => {\n                          const on = service === s.id;\n                          return (\n                            <label key={s.id} className=\"relative flex cursor-pointer flex-col rounded-xl border p-3 transition-colors has-[:focus-visible]:ring-2\" style={{ borderColor: on ? p.on : p.fieldBorder, background: on ? p.chip : \"transparent\", ...ring }}>\n                              <input type=\"radio\" name={`${uid}-svc`} value={s.id} checked={on} onChange={() => (setService(s.id), setTime(null))} className=\"sr-only\" />\n                              <span className=\"text-[14px] font-medium\">{s.name}</span>\n                              <span className=\"mt-1 text-[12.5px] tabular-nums\" style={{ color: p.faint }}>\n                                {s.duration} min{s.price !== undefined ? ` · ${s.price === 0 ? \"Free\" : `${currency}${s.price}`}` : \"\"}\n                              </span>\n                              {on && <motion.span layoutId={`${uid}-svc-dot`} className=\"absolute top-3 right-3 h-2 w-2 rounded-full\" style={{ background: p.ok }} aria-hidden=\"true\" />}\n                            </label>\n                          );\n                        })}\n                      </div>\n                    </fieldset>\n                  )}\n\n                  <div>\n                    <div className=\"mb-2 flex items-center justify-between\">\n                      <p className=\"m-0 text-[13px] font-medium\" id={`${uid}-cal`}>\n                        {services.length > 0 ? \"2.\" : \"1.\"} Day <span style={{ color: p.faint }}>{month ? `· ${MONTHS[month.getMonth()]} ${month.getFullYear()}` : \"\"}</span>\n                      </p>\n                      <div className=\"flex gap-1\">\n                        {(\n                          [\n                            [-1, \"Previous month\", canPrev],\n                            [1, \"Next month\", canNext],\n                          ] as const\n                        ).map(([d, l, ok]) => (\n                          <button key={l} type=\"button\" aria-label={l} disabled={!ok} onClick={() => month && setMonth(new Date(month.getFullYear(), month.getMonth() + d, 1))} className={cn(\"flex h-8 w-8 cursor-pointer items-center justify-center rounded-full border text-[14px] disabled:cursor-default disabled:opacity-30\", focus)} style={{ borderColor: p.fieldBorder, background: \"transparent\", color: p.text, ...ring }}>\n                            {d < 0 ? \"‹\" : \"›\"}\n                          </button>\n                        ))}\n                      </div>\n                    </div>\n                    <div role=\"grid\" aria-labelledby={`${uid}-cal`} className=\"grid grid-cols-7 gap-1\">\n                      {[\"Mon\", \"Tue\", \"Wed\", \"Thu\", \"Fri\", \"Sat\", \"Sun\"].map((w) => (\n                        <span key={w} role=\"columnheader\" className=\"pb-1 text-center text-[11.5px]\" style={{ color: p.faint }}>\n                          {w.slice(0, 2)}\n                        </span>\n                      ))}\n                      {!month && Array.from({ length: 35 }, (_, i) => <span key={i} className=\"h-10 animate-pulse rounded-lg\" style={{ background: p.chip }} />)}\n                      {cells.map((d, i) => {\n                        if (!d) return <span key={`e${i}`} />;\n                        const k = key(d);\n                        const open = isOpen(d);\n                        const on = date === k;\n                        const isToday = today && k === key(today);\n                        const tabbable = focusDay ? focusDay === k : on || (!date && isToday) || (!date && !isToday && open && i === cells.findIndex((c) => c && isOpen(c)));\n                        return (\n                          <button\n                            key={k}\n                            ref={(el) => {\n                              dayRefs.current[k] = el;\n                            }}\n                            type=\"button\"\n                            role=\"gridcell\"\n                            aria-selected={on}\n                            aria-label={`${WD[d.getDay()]} ${d.getDate()} ${MONTHS[d.getMonth()]}${open ? \"\" : \", unavailable\"}`}\n                            disabled={!open}\n                            tabIndex={tabbable ? 0 : -1}\n                            onClick={() => pickDay(k)}\n                            onKeyDown={(e) => gridKey(e, d)}\n                            className={cn(\"relative h-10 cursor-pointer rounded-lg border-0 text-[13.5px] tabular-nums transition-colors disabled:cursor-default\", focus)}\n                            style={{ background: on ? p.on : \"transparent\", color: on ? p.onText : open ? p.text : p.faint, textDecoration: open ? undefined : \"line-through\", opacity: open ? 1 : 0.45, ...ring }}\n                          >\n                            {d.getDate()}\n                            {isToday && !on && <span className=\"absolute bottom-1 left-1/2 h-1 w-1 -translate-x-1/2 rounded-full\" style={{ background: p.ok }} aria-hidden=\"true\" />}\n                          </button>\n                        );\n                      })}\n                    </div>\n                  </div>\n\n                  <div>\n                    <p className=\"m-0 mb-2 text-[13px] font-medium\">\n                      {services.length > 0 ? \"3.\" : \"2.\"} Time <span style={{ color: p.faint }}>{date ? `· ${dateLabel(date)}` : \"\"}</span>\n                    </p>\n                    {!date ? (\n                      <p className=\"m-0 rounded-xl border border-dashed px-4 py-5 text-center text-[13.5px]\" style={{ borderColor: p.fieldBorder, color: p.faint }}>\n                        Choose a day to see free times.\n                      </p>\n                    ) : (\n                      <div role=\"radiogroup\" aria-label=\"Time\" className=\"grid grid-cols-3 gap-1.5 @[520px]:grid-cols-4\">\n                        {slots.map((s, i) => {\n                          const on = time === s.t;\n                          return (\n                            <motion.button\n                              key={`${date}-${s.t}`}\n                              type=\"button\"\n                              role=\"radio\"\n                              aria-checked={on}\n                              aria-label={`${s.t}${s.booked ? \", booked\" : \"\"}`}\n                              disabled={s.booked}\n                              onClick={() => (setTime(s.t), setError(\"\"))}\n                              initial={reduce ? false : { opacity: 0, y: 6 }}\n                              animate={{ opacity: 1, y: 0 }}\n                              transition={{ delay: reduce ? 0 : i * 0.015 }}\n                              className={cn(\"h-10 cursor-pointer rounded-lg border text-[13.5px] tabular-nums transition-colors disabled:cursor-not-allowed disabled:line-through\", focus)}\n                              style={{ borderColor: on ? p.on : p.fieldBorder, background: on ? p.on : \"transparent\", color: on ? p.onText : s.booked ? p.faint : p.text, opacity: s.booked ? 0.45 : 1, ...ring }}\n                            >\n                              {s.t}\n                            </motion.button>\n                          );\n                        })}\n                      </div>\n                    )}\n                  </div>\n                </div>\n\n                {/* Right: details and summary */}\n                <div className=\"flex flex-col gap-4 border-t p-5 @[640px]:p-7 @[860px]:border-t-0 @[860px]:border-l\" style={{ borderColor: p.border }}>\n                  <p className=\"m-0 text-[13px] font-medium\">{services.length > 0 ? \"4.\" : \"3.\"} Your details</p>\n                  {guests && guests.max > 1 && (\n                    <div className=\"flex items-center justify-between\">\n                      <span className=\"text-[14px]\" id={`${uid}-g`}>\n                        Guests\n                      </span>\n                      <div className=\"flex items-center rounded-full border\" style={{ borderColor: p.fieldBorder }} role=\"group\" aria-labelledby={`${uid}-g`}>\n                        <button type=\"button\" aria-label=\"Fewer guests\" disabled={party <= guests.min} onClick={() => setParty((n) => n - 1)} className={cn(\"h-9 w-9 cursor-pointer rounded-full border-0 bg-transparent text-[18px] disabled:cursor-default disabled:opacity-30\", focus)} style={{ color: p.text, ...ring }}>\n                          −\n                        </button>\n                        <span className=\"w-8 text-center text-[15px] font-medium tabular-nums\" aria-live=\"polite\">\n                          {party}\n                        </span>\n                        <button type=\"button\" aria-label=\"More guests\" disabled={party >= guests.max} onClick={() => setParty((n) => n + 1)} className={cn(\"h-9 w-9 cursor-pointer rounded-full border-0 bg-transparent text-[18px] disabled:cursor-default disabled:opacity-30\", focus)} style={{ color: p.text, ...ring }}>\n                          +\n                        </button>\n                      </div>\n                    </div>\n                  )}\n                  <div>\n                    <label htmlFor={`${uid}-n`} className={label} style={{ color: p.muted }}>\n                      Full name\n                    </label>\n                    <input id={`${uid}-n`} autoComplete=\"name\" value={f.name} aria-invalid={(touched && !nameOk) || undefined} aria-describedby={`${uid}-n-e`} onChange={(e) => setF((v) => ({ ...v, name: e.target.value }))} className={cn(fieldCls, \"h-11\")} style={{ background: p.field, borderColor: touched && !nameOk ? p.error : p.fieldBorder, color: p.text, ...ring }} />\n                    {touched && !nameOk && (\n                      <p id={`${uid}-n-e`} className=\"m-0 mt-1 text-[12.5px]\" style={{ color: p.error }}>\n                        Add your name.\n                      </p>\n                    )}\n                  </div>\n                  <div className=\"grid grid-cols-1 gap-3 @[480px]:grid-cols-2 @[860px]:grid-cols-1 @[1000px]:grid-cols-2\">\n                    <div>\n                      <label htmlFor={`${uid}-e`} className={label} style={{ color: p.muted }}>\n                        Email\n                      </label>\n                      <input id={`${uid}-e`} type=\"email\" autoComplete=\"email\" value={f.email} aria-invalid={(touched && !emailOk) || undefined} aria-describedby={`${uid}-e-e`} onChange={(e) => setF((v) => ({ ...v, email: e.target.value }))} className={cn(fieldCls, \"h-11\")} style={{ background: p.field, borderColor: touched && !emailOk ? p.error : p.fieldBorder, color: p.text, ...ring }} />\n                      {touched && !emailOk && (\n                        <p id={`${uid}-e-e`} className=\"m-0 mt-1 text-[12.5px]\" style={{ color: p.error }}>\n                          Add a valid email.\n                        </p>\n                      )}\n                    </div>\n                    <div>\n                      <label htmlFor={`${uid}-p`} className={label} style={{ color: p.muted }}>\n                        Phone <span style={{ color: p.faint }}>(optional)</span>\n                      </label>\n                      <input id={`${uid}-p`} type=\"tel\" autoComplete=\"tel\" value={f.phone} onChange={(e) => setF((v) => ({ ...v, phone: e.target.value }))} className={cn(fieldCls, \"h-11\")} style={{ background: p.field, borderColor: p.fieldBorder, color: p.text, ...ring }} />\n                    </div>\n                  </div>\n                  <div>\n                    <label htmlFor={`${uid}-x`} className={label} style={{ color: p.muted }}>\n                      Notes <span style={{ color: p.faint }}>(optional)</span>\n                    </label>\n                    <textarea id={`${uid}-x`} rows={2} value={f.notes} onChange={(e) => setF((v) => ({ ...v, notes: e.target.value }))} className={cn(fieldCls, \"resize-y py-2.5 leading-[1.5]\")} style={{ background: p.field, borderColor: p.fieldBorder, color: p.text, ...ring }} />\n                  </div>\n\n                  <div className=\"mt-auto rounded-xl p-4\" style={{ background: p.chip }} aria-live=\"polite\">\n                    <p className=\"m-0 flex items-baseline justify-between gap-3 text-[14px]\">\n                      <span className=\"font-medium\">{svc?.name ?? \"Booking\"}</span>\n                      {svc?.price !== undefined && <span className=\"tabular-nums\">{svc.price === 0 ? \"Free\" : `${currency}${svc.price}`}</span>}\n                    </p>\n                    <p className=\"m-0 mt-1 text-[13px] tabular-nums\" style={{ color: date && time ? p.muted : p.faint }}>\n                      {date && time ? `${dateLabel(date)}, ${time} to ${end}` : date ? `${dateLabel(date)}, pick a time` : \"No day or time yet\"}\n                    </p>\n                  </div>\n                  <p role=\"alert\" className=\"m-0 min-h-[18px] text-[13px]\" style={{ color: p.error }}>\n                    {error}\n                  </p>\n                  <button type=\"submit\" disabled={status === \"loading\"} className={cn(\"flex h-12 w-full cursor-pointer items-center justify-center gap-2 rounded-xl border-0 text-[15px] font-medium transition-opacity hover:opacity-90 disabled:cursor-wait\", focus)} style={{ background: p.on, color: p.onText, ...ring }}>\n                    {status === \"loading\" ? (\n                      <>\n                        <motion.span className=\"h-4 w-4 rounded-full border-2 border-current border-t-transparent\" animate={reduce ? undefined : { rotate: 360 }} transition={{ repeat: Infinity, duration: 0.8, ease: \"linear\" }} aria-hidden=\"true\" />\n                        Booking...\n                      </>\n                    ) : date && time ? (\n                      `Book ${time} on ${dateLabel(date)}`\n                    ) : (\n                      \"Book\"\n                    )}\n                  </button>\n                </div>\n              </motion.form>\n            )}\n          </AnimatePresence>\n        </div>\n      </div>\n    </section>\n  );\n}\n\nexport default BookingReservationForm;\n",
      "type": "registry:component"
    }
  ],
  "type": "registry:component"
}