{"$schema":"https://ui.shadcn.com/schema/registry-item.json","name":"aura-booking-picker","type":"registry:component","title":"Aura Booking Picker","description":"A booking picker in three quiet steps, treatment, day and time, where the chosen time blooms into a grained halo, and a request that needs your handler before it confirms anything.","dependencies":[],"registryDependencies":[],"files":[{"path":"components/viberdy/aura-booking-picker.tsx","content":"\"use client\";\n\nimport { useId, useMemo, useRef, useState } from \"react\";\nimport type { CSSProperties, FormEvent, PointerEvent as ReactPointerEvent, ReactNode } from \"react\";\n\n/**\n * AuraBookingPicker — a booking picker where the chosen time blooms into light.\n *\n * A treatment, a strip of days (closed days dimmed) and the times left on\n * the chosen day, as native radio groups. The time you pick blooms into a\n * grained halo and the summary line resolves to match. An email and one\n * filled button send the request to `onRequest`, which is required: the\n * picker never claims a booking on its own. Days count from `start` in UTC,\n * so the server and the browser draw the same strip.\n *\n * Part of the Diffused Glow kit: a warm bone day (#f6f1e6) and a jade room\n * (#0b120f); soft, grained halos in gold, rose or jade (or any #rrggbb), at\n * most two per view; a serif through var(--font-serif) over Geist. Respects\n * prefers-reduced-motion. No dependencies beyond React. Paste it as its own\n * file: it repeats the kit's small helpers, which would clash in one module.\n * For the serif, load Fraunces with next/font (variable: \"--font-serif\") on a parent.\n */\n\nconst SANS = 'var(--font-sans, \"Geist\", \"Inter\", ui-sans-serif, system-ui, sans-serif)';\n\nconst MONO = 'var(--font-mono, \"Geist Mono\", ui-monospace, \"SFMono-Regular\", Menlo, Consolas, monospace)';\n\nconst SERIF = 'var(--font-serif, \"Fraunces\", \"Iowan Old Style\", \"Palatino Linotype\", Georgia, serif)';\n\nconst EASE = \"cubic-bezier(0.22, 1, 0.36, 1)\";\n\nconst RESOLVE = \"cubic-bezier(0.16, 1, 0.3, 1)\";\n\nconst HEX = /^#[0-9a-fA-F]{6}$/;\n\n/** The two grounds the kit is set on: the warm day and the jade room. */\nconst TONES = {\n  day: {\n    ground: \"#f6f1e6\",\n    panel: \"#efe7d6\",\n    raised: \"#fbf8f1\",\n    ink: \"rgba(34,31,26,0.92)\",\n    ink2: \"rgba(34,31,26,0.58)\",\n    ink3: \"rgba(34,31,26,0.4)\",\n    line: \"rgba(34,31,26,0.09)\",\n    line2: \"rgba(34,31,26,0.18)\",\n    shadow: \"0 30px 80px -20px rgba(40,30,10,0.14)\",\n  },\n  jewel: {\n    ground: \"#0b120f\",\n    panel: \"#101c17\",\n    raised: \"#16261f\",\n    ink: \"rgba(243,237,226,0.94)\",\n    ink2: \"rgba(243,237,226,0.63)\",\n    ink3: \"rgba(243,237,226,0.4)\",\n    line: \"rgba(243,237,226,0.08)\",\n    line2: \"rgba(243,237,226,0.16)\",\n    shadow: \"0 40px 100px -24px rgba(0,0,0,0.5)\",\n  },\n} as const;\n\nexport type DgTone = keyof typeof TONES;\n\n/** The bronze accent, used only as light. */\nconst BRONZE = \"#c9a15e\";\n\n/** The one filled action in the kit: booking. */\nconst JADE_FILL = \"#2f6f57\";\n\n/** Halo colours. Gold and rose belong to the jade room; jade is the day's own light. */\nexport const DG_GLOWS = {\n  gold: \"#f5c48c\",\n  rose: \"#f2a39a\",\n  jade: \"#bcd9c8\",\n} as const;\n\nfunction own<T extends object>(map: T, key: string): key is Extract<keyof T, string> {\n  return Object.prototype.hasOwnProperty.call(map, key);\n}\n\n/** A named glow or a #rrggbb; anything else falls back to gold. */\nfunction glowHex(value: string): string {\n  if (own(DG_GLOWS, value)) return DG_GLOWS[value];\n  return HEX.test(value) ? value : DG_GLOWS.gold;\n}\n\nfunction toneOf(value: string) {\n  return own(TONES, value) ? TONES[value] : TONES.day;\n}\n\nfunction rgbOf(hex: string): [number, number, number] {\n  const n = parseInt(hex.slice(1), 16);\n  return [(n >> 16) & 255, (n >> 8) & 255, n & 255];\n}\n\nfunction rgba(hex: string, a: number): string {\n  const [r, g, b] = rgbOf(hex);\n  return `rgba(${r},${g},${b},${a})`;\n}\n\n/**\n * Grain as an SVG turbulence tile. It is only ever laid inside a light (masked\n * to the halo's shape), never over the whole page: grain belongs to the glow.\n */\nconst GRAIN_URL = `url(\"data:image/svg+xml,${encodeURIComponent(\n  \"<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='g'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.5  0 0 0 0 0.5  0 0 0 0 0.5  0 0 0 0.9 0'/></filter><rect width='160' height='160' filter='url(#g)'/></svg>\",\n)}\")`;\n\n/** Links: strip tabs and newlines, refuse backslashes, allow http(s), mailto, tel and same-site paths. */\nfunction safeHref(raw: string): string {\n  const v = raw.replace(/[\\t\\n\\r]/g, \"\").trim();\n  if (!v || v.includes(\"\\\\\")) return \"#\";\n  if (/^(https?:|mailto:|tel:)/i.test(v)) return v;\n  if (/^[/#?]/.test(v) && !/^\\/\\//.test(v)) return v;\n  return \"#\";\n}\n\n// Each part carries only the CSS it needs, so any one of them works on its own.\n// Nothing is interpolated into these sheets; colours arrive as CSS variables.\n// revert-layer keeps an element's own rounded corners when a host page's focus rule flattens them.\nconst FOCUS_CSS = \".dg-scope :focus-visible,.dg-scope:focus-visible{outline:2px solid var(--dg-ring);outline-offset:3px;border-radius:revert-layer}\";\n\n/** The focus ring colour for a ground: bronze light on the jade room, jade on the day. */\nfunction ringVar(tone: string): CSSProperties {\n  return { \"--dg-ring\": tone === \"jewel\" ? BRONZE : JADE_FILL } as CSSProperties;\n}\n\n// Registered, so the inner light glides in CSS (a soft 600ms settle) without a render per pointer move.\nconst GLOW_BTN_CSS =\n  \"@property --dg-gx{syntax:'<percentage>';inherits:true;initial-value:30%}\" +\n  \"@property --dg-gy{syntax:'<percentage>';inherits:true;initial-value:30%}\" +\n  \".dg-glow{transition:--dg-gx 600ms \" + EASE + \",--dg-gy 600ms \" + EASE + \",transform 420ms \" + EASE + \",background-color 300ms ease}\" +\n  \".dg-glow:active{transform:scale(0.97)}\" +\n  \".dg-glow .dg-bloom{opacity:0;transform:scale(0.85);transition:opacity 450ms \" + EASE + \",transform 450ms \" + EASE + \"}\" +\n  \".dg-glow:hover .dg-bloom,.dg-glow:focus-visible .dg-bloom{opacity:1;transform:scale(1)}\" +\n  \"@keyframes dg-exhale{from{transform:translate(-50%,-50%) scale(0.3);opacity:0.9}to{transform:translate(-50%,-50%) scale(1.6);opacity:0}}\" +\n  \"@media (prefers-reduced-motion: reduce){.dg-glow,.dg-glow .dg-bloom{transition:none}.dg-glow:active{transform:none}.dg-exhale{display:none}}\";\n\nexport type SoftGlowButtonProps = {\n  children: ReactNode;\n  /** Renders a link when set, else a button. */\n  href?: string;\n  onClick?: () => void;\n  /** The ground it sits on: \"jewel\" (the dark jade room) or \"day\" (warm bone). */\n  tone?: DgTone;\n  /** \"solid\": the one booking action. \"quiet\": a hairline pill for the second action. */\n  variant?: \"solid\" | \"quiet\";\n  /** The light's colour: gold, rose, jade or a #rrggbb. */\n  glow?: string;\n  size?: \"md\" | \"lg\";\n  type?: \"button\" | \"submit\";\n  disabled?: boolean;\n  className?: string;\n};\n\n/**\n * A pill with a light inside it. A soft, grained glow follows the pointer\n * across the pill with a slow settle (eased in CSS through registered custom\n * properties, so moving costs no renders), and a diffused bloom rises behind\n * it on hover or focus. A press sinks the pill slightly and the light exhales:\n * a soft ring spreads from where you pressed and fades. Solid is jade on the\n * day ground and lit glass in the jade room; quiet is a hairline pill whose\n * light only wakes under the pointer.\n */\nexport function SoftGlowButton({\n  children,\n  href,\n  onClick,\n  tone = \"day\",\n  variant = \"solid\",\n  glow,\n  size = \"md\",\n  type = \"button\",\n  disabled,\n  className,\n}: SoftGlowButtonProps) {\n  const t = toneOf(tone);\n  const light = glowHex(glow ?? (tone === \"jewel\" ? \"gold\" : \"jade\"));\n  const [exhales, setExhales] = useState<{ id: number; x: number; y: number }[]>([]);\n  const nextId = useRef(0);\n  const solid = variant === \"solid\";\n  const dark = tone === \"jewel\";\n\n  const onMove = (e: ReactPointerEvent<HTMLElement>) => {\n    const r = e.currentTarget.getBoundingClientRect();\n    e.currentTarget.style.setProperty(\"--dg-gx\", `${(((e.clientX - r.left) / (r.width || 1)) * 100).toFixed(1)}%`);\n    e.currentTarget.style.setProperty(\"--dg-gy\", `${(((e.clientY - r.top) / (r.height || 1)) * 100).toFixed(1)}%`);\n  };\n  const onDown = (e: ReactPointerEvent<HTMLElement>) => {\n    const r = e.currentTarget.getBoundingClientRect();\n    const id = ++nextId.current;\n    setExhales((all) => [...all.slice(-2), { id, x: e.clientX - r.left, y: e.clientY - r.top }]);\n  };\n\n  const h = size === \"lg\" ? 54 : 46;\n  const fill = solid ? (dark ? \"rgba(243,237,226,0.08)\" : JADE_FILL) : \"transparent\";\n  const style: CSSProperties = {\n    ...ringVar(tone),\n    height: h,\n    padding: size === \"lg\" ? \"0 30px\" : \"0 22px\",\n    fontFamily: SANS,\n    fontSize: size === \"lg\" ? 16 : 15,\n    fontWeight: 500,\n    color: solid && !dark ? \"#f6f1e6\" : t.ink,\n    backgroundColor: fill,\n    boxShadow: solid\n      ? dark\n        ? `inset 0 0 0 1px ${t.line2}, inset 0 1px 0 rgba(243,237,226,0.12)`\n        : \"inset 0 1px 0 rgba(255,255,255,0.18), 0 18px 40px -18px rgba(47,111,87,0.6)\"\n      : `inset 0 0 0 1px ${t.line2}`,\n    opacity: disabled ? 0.5 : 1,\n    cursor: disabled ? \"not-allowed\" : \"pointer\",\n  };\n  const inner = (\n    <>\n      {/* The bloom behind the pill. */}\n      <span\n        aria-hidden\n        className=\"dg-bloom pointer-events-none absolute -inset-x-[30%] -inset-y-[90%] -z-10 rounded-full\"\n        style={{ background: `radial-gradient(closest-side, ${rgba(light, dark ? 0.32 : 0.45)}, ${rgba(light, 0)})`, filter: \"blur(6px)\" }}\n      />\n      {/* The light inside it, grained, following the pointer. */}\n      <span aria-hidden className=\"pointer-events-none absolute inset-0 overflow-hidden rounded-full\">\n        <span\n          className=\"absolute inset-0\"\n          style={{\n            background: `radial-gradient(60% 120% at var(--dg-gx) var(--dg-gy), ${rgba(light, solid ? (dark ? 0.42 : 0.5) : 0.3)}, ${rgba(light, 0)} 70%)`,\n            opacity: solid ? 1 : 0.9,\n          }}\n        />\n        <span\n          className=\"absolute inset-0\"\n          style={{\n            backgroundImage: GRAIN_URL,\n            mixBlendMode: \"overlay\",\n            opacity: 0.5,\n            WebkitMaskImage: \"radial-gradient(60% 120% at var(--dg-gx) var(--dg-gy), #000, transparent 70%)\",\n            maskImage: \"radial-gradient(60% 120% at var(--dg-gx) var(--dg-gy), #000, transparent 70%)\",\n          }}\n        />\n        {exhales.map((x) => (\n          <span\n            key={x.id}\n            className=\"dg-exhale absolute rounded-full\"\n            onAnimationEnd={() => setExhales((all) => all.filter((y) => y.id !== x.id))}\n            style={{\n              left: x.x,\n              top: x.y,\n              width: h * 3,\n              height: h * 3,\n              background: `radial-gradient(closest-side, ${rgba(light, 0.55)}, ${rgba(light, 0)})`,\n              animation: `dg-exhale 900ms ${EASE} forwards`,\n            }}\n          />\n        ))}\n      </span>\n      <span className=\"relative inline-flex items-center gap-2\">{children}</span>\n    </>\n  );\n  const cls =\n    \"dg-scope dg-glow relative isolate inline-flex select-none items-center justify-center whitespace-nowrap rounded-full\" +\n    (className ? \" \" + className : \"\");\n  return (\n    <>\n      <style>{GLOW_BTN_CSS + FOCUS_CSS}</style>\n      {href && !disabled ? (\n        <a href={safeHref(href)} onClick={onClick} onPointerMove={onMove} onPointerDown={onDown} className={cls} style={style}>\n          {inner}\n        </a>\n      ) : (\n        <button type={type} onClick={onClick} onPointerMove={onMove} onPointerDown={disabled ? undefined : onDown} disabled={disabled} className={cls} style={style}>\n          {inner}\n        </button>\n      )}\n    </>\n  );\n}\n\nconst BOOK_CSS =\n  \"@keyframes dg-bloom{from{opacity:0;transform:scale(0.4)}to{opacity:1;transform:scale(1)}}\" +\n  \"@keyframes dg-resolve{from{opacity:0;filter:blur(8px)}to{opacity:1;filter:blur(0)}}\" +\n  \"@media (prefers-reduced-motion: reduce){.dg-bloom,.dg-resolve{animation:none!important}}\";\n\nconst STRIP_FADE = \"linear-gradient(90deg, #000 calc(100% - 48px), transparent)\";\n\nconst DAY_NAME = new Intl.DateTimeFormat(\"en-GB\", { weekday: \"short\", timeZone: \"UTC\" });\n\nconst DAY_NUM = new Intl.DateTimeFormat(\"en-GB\", { day: \"numeric\", timeZone: \"UTC\" });\n\nconst DAY_LONG = new Intl.DateTimeFormat(\"en-GB\", { weekday: \"short\", day: \"numeric\", month: \"short\", timeZone: \"UTC\" });\n\nexport type DgBookingRequest = { treatment: string; date: string; time: string; email: string };\n\nexport type AuraBookingPickerProps = {\n  treatments: { id: string; name: string; minutes: number }[];\n  /** The first bookable day, as an ISO date (\"2026-10-12\"); days are counted from it in UTC. */\n  start: string;\n  days?: number;\n  /** Weekdays the clinic is closed (0 Sunday to 6 Saturday). */\n  closed?: number[];\n  times?: string[];\n  /** Whether a time is already taken on a day. */\n  isTaken?: (date: string, time: string) => boolean;\n  /** Called with the request. Resolve when it is received; throw to show `failed`. Required: the picker never claims a booking on its own. */\n  onRequest: (request: DgBookingRequest) => Promise<void> | void;\n  done?: string;\n  failed?: string;\n  tone?: DgTone;\n  glow?: string;\n  className?: string;\n};\n\n/**\n * A booking picker in three quiet steps: the treatment, a strip of days and\n * the times left on the chosen day. The time you choose blooms into a soft,\n * grained halo, and the summary line resolves to match. An email and one\n * filled button send the request to your handler, which is required; while\n * it runs the button says so, and when it resolves the summary turns into a\n * lit confirmation. Every choice is a native radio group; days count from\n * `start` in UTC, so the server and the browser draw the same strip.\n */\nexport function AuraBookingPicker({\n  treatments,\n  start,\n  days = 10,\n  closed = [1],\n  times = [\"09:30\", \"11:00\", \"12:30\", \"14:00\", \"15:30\", \"17:00\", \"18:30\"],\n  isTaken,\n  onRequest,\n  done = \"Requested. We will confirm by email within the hour.\",\n  failed = \"That did not go through. Try again, or call us.\",\n  tone = \"day\",\n  glow,\n  className,\n}: AuraBookingPickerProps) {\n  const t = toneOf(tone);\n  const light = glowHex(glow ?? (tone === \"jewel\" ? \"gold\" : \"jade\"));\n  const uid = useId().replace(/[^a-zA-Z0-9]/g, \"\");\n  const dates = useMemo(() => {\n    const base = new Date(start + \"T00:00:00Z\");\n    if (Number.isNaN(base.getTime())) return [];\n    return Array.from({ length: Math.max(1, Math.min(60, days)) }, (_, i) => {\n      const d = new Date(base.getTime() + i * 86400000);\n      return { iso: d.toISOString().slice(0, 10), d, closed: closed.includes(d.getUTCDay()) };\n    });\n  }, [start, days, closed]);\n  const [treatment, setTreatment] = useState(treatments[0]?.id ?? \"\");\n  const [date, setDate] = useState(() => dates.find((d) => !d.closed)?.iso ?? \"\");\n  const [time, setTime] = useState(\"\");\n  const [email, setEmail] = useState(\"\");\n  const [state, setState] = useState<\"idle\" | \"sending\" | \"done\" | \"error\">(\"idle\");\n  const [hint, setHint] = useState(\"\");\n  const [badEmail, setBadEmail] = useState(false);\n  const emailRef = useRef<HTMLInputElement>(null);\n\n  const tr = treatments.find((x) => x.id === treatment);\n  const day = dates.find((d) => d.iso === date);\n  const summary = [tr?.name, day ? DAY_LONG.format(day.d) : \"\", time, tr ? `${tr.minutes} min` : \"\"].filter(Boolean).join(\" · \");\n\n  const submit = async (e: FormEvent) => {\n    e.preventDefault();\n    if (state === \"sending\" || state === \"done\") return;\n    if (!day) {\n      setHint(\"Choose a day first.\");\n      return;\n    }\n    if (!time) {\n      setHint(\"Choose a time first.\");\n      return;\n    }\n    if (!emailRef.current?.checkValidity()) {\n      setHint(\"Enter an email address for the confirmation.\");\n      setBadEmail(true);\n      emailRef.current?.focus();\n      return;\n    }\n    setHint(\"\");\n    setBadEmail(false);\n    setState(\"sending\");\n    try {\n      await onRequest({ treatment, date, time, email: email.trim() });\n      setState(\"done\");\n    } catch {\n      setState(\"error\");\n    }\n  };\n\n  const pill = (checked: boolean, disabled = false): CSSProperties => ({\n    color: disabled ? t.ink3 : checked ? t.ink : t.ink2,\n    background: checked ? t.raised : \"transparent\",\n    boxShadow: checked ? `inset 0 0 0 1px ${t.line2}, ${t.shadow}` : `inset 0 0 0 1px ${t.line}`,\n    textDecoration: disabled ? \"line-through\" : \"none\",\n    cursor: disabled ? \"not-allowed\" : \"pointer\",\n  });\n  const labelCls = \"mb-3 block text-[11px] uppercase tracking-[0.18em]\";\n  const done_ = state === \"done\";\n\n  return (\n    <form onSubmit={submit} noValidate className={\"dg-scope w-full\" + (className ? \" \" + className : \"\")} style={{ ...ringVar(tone), color: t.ink, fontFamily: SANS }}>\n      <style>{FOCUS_CSS + BOOK_CSS}</style>\n      <fieldset disabled={done_ || state === \"sending\"} className=\"m-0 grid min-w-0 grid-cols-[minmax(0,1fr)] gap-7 border-0 p-0\">\n        <div role=\"radiogroup\" aria-labelledby={`${uid}-tl`}>\n          <span id={`${uid}-tl`} className={labelCls} style={{ fontFamily: MONO, color: t.ink3 }}>\n            Treatment\n          </span>\n          <div className=\"flex flex-wrap gap-2\">\n            {treatments.map((x) => (\n              <label key={x.id} className=\"relative\">\n                <input type=\"radio\" name={`${uid}-t`} value={x.id} checked={treatment === x.id} onChange={() => setTreatment(x.id)} className=\"peer sr-only\" />\n                <span className=\"inline-block rounded-full px-4 py-2 text-[14px] transition-all duration-300 peer-focus-visible:outline peer-focus-visible:outline-2 peer-focus-visible:outline-offset-2\" style={{ ...pill(treatment === x.id), outlineColor: \"var(--dg-ring)\" }}>\n                  {x.name}\n                </span>\n              </label>\n            ))}\n          </div>\n        </div>\n\n        <div role=\"radiogroup\" aria-labelledby={`${uid}-dl`}>\n          <span id={`${uid}-dl`} className={labelCls} style={{ fontFamily: MONO, color: t.ink3 }}>\n            Day\n          </span>\n          {/* The strip scrolls sideways; its right edge fades so a cut-off day reads as more to come. */}\n          <div className=\"-mx-1 flex gap-2 overflow-x-auto px-1 pb-2 [scrollbar-width:none] [&::-webkit-scrollbar]:hidden\" style={{ WebkitMaskImage: STRIP_FADE, maskImage: STRIP_FADE }}>\n            {dates.map((d) => (\n              <label key={d.iso} className=\"relative shrink-0\">\n                <input\n                  type=\"radio\"\n                  name={`${uid}-d`}\n                  value={d.iso}\n                  checked={date === d.iso}\n                  disabled={d.closed}\n                  onChange={() => {\n                    setDate(d.iso);\n                    setTime(\"\");\n                  }}\n                  className=\"peer sr-only\"\n                />\n                <span\n                  className=\"flex w-[60px] flex-col items-center rounded-[18px] py-2.5 transition-all duration-300 peer-focus-visible:outline peer-focus-visible:outline-2 peer-focus-visible:outline-offset-2\"\n                  style={{ ...pill(date === d.iso, d.closed), textDecoration: \"none\", outlineColor: \"var(--dg-ring)\" }}\n                >\n                  <span className=\"text-[11px] uppercase tracking-[0.12em]\" style={{ fontFamily: MONO }}>\n                    {DAY_NAME.format(d.d)}\n                  </span>\n                  <span className=\"text-[22px] leading-tight\" style={{ fontFamily: SERIF }}>\n                    {DAY_NUM.format(d.d)}\n                  </span>\n                </span>\n              </label>\n            ))}\n          </div>\n        </div>\n\n        <div role=\"radiogroup\" aria-labelledby={`${uid}-hl`}>\n          <span id={`${uid}-hl`} className={labelCls} style={{ fontFamily: MONO, color: t.ink3 }}>\n            Time\n          </span>\n          <div className=\"flex flex-wrap gap-2\">\n            {times.map((tm) => {\n              const taken = isTaken?.(date, tm) ?? false;\n              const on = time === tm;\n              return (\n                <label key={tm} className=\"relative\">\n                  <input type=\"radio\" name={`${uid}-h`} value={tm} checked={on} disabled={taken} onChange={() => setTime(tm)} className=\"peer sr-only\" />\n                  {on && (\n                    <span aria-hidden className=\"dg-bloom pointer-events-none absolute -inset-4 rounded-full\" style={{ animation: `dg-bloom 600ms ${EASE} both` }}>\n                      <span className=\"absolute inset-0 rounded-full\" style={{ background: `radial-gradient(closest-side, ${rgba(light, 0.75)}, ${rgba(light, 0)})` }} />\n                      <span className=\"absolute inset-0 rounded-full\" style={{ backgroundImage: GRAIN_URL, mixBlendMode: \"overlay\", opacity: 0.6, WebkitMaskImage: \"radial-gradient(closest-side, #000, transparent)\", maskImage: \"radial-gradient(closest-side, #000, transparent)\" }} />\n                    </span>\n                  )}\n                  <span\n                    className=\"relative inline-block rounded-full px-4 py-2 text-[14px] tabular-nums transition-all duration-300 peer-focus-visible:outline peer-focus-visible:outline-2 peer-focus-visible:outline-offset-2\"\n                    style={{ ...pill(on, taken), fontFamily: MONO, outlineColor: \"var(--dg-ring)\" }}\n                  >\n                    {tm}\n                  </span>\n                </label>\n              );\n            })}\n          </div>\n        </div>\n      </fieldset>\n\n      <div className=\"relative mt-8 overflow-hidden rounded-[24px] p-5\" style={{ background: done_ ? t.raised : t.panel, boxShadow: `inset 0 0 0 1px ${t.line}` }}>\n        {done_ && (\n          <span aria-hidden className=\"dg-bloom pointer-events-none absolute -left-10 -top-16 h-56 w-56 rounded-full\" style={{ background: `radial-gradient(closest-side, ${rgba(light, 0.7)}, ${rgba(light, 0)})`, animation: `dg-bloom 900ms ${EASE} both` }} />\n        )}\n        <p key={summary + state} className=\"dg-resolve relative m-0 text-[19px] leading-snug\" style={{ fontFamily: SERIF, fontWeight: 400, animation: `dg-resolve 600ms ${RESOLVE} both` }}>\n          {done_ ? done : time ? summary : \"Choose a time to see your visit.\"}\n        </p>\n        {!done_ && (\n          <div className=\"relative mt-5 flex flex-col gap-3 min-[520px]:flex-row\">\n            <label htmlFor={`${uid}-email`} className=\"sr-only\">\n              Email for the confirmation\n            </label>\n            <input\n              ref={emailRef}\n              id={`${uid}-email`}\n              type=\"email\"\n              required\n              autoComplete=\"email\"\n              placeholder=\"Email for the confirmation\"\n              value={email}\n              onChange={(e) => {\n                setEmail(e.target.value);\n                if (state === \"error\") setState(\"idle\");\n              }}\n              aria-describedby={`${uid}-msg`}\n              aria-invalid={badEmail || undefined}\n              className=\"h-[46px] min-w-0 flex-1 rounded-full px-5 text-[15px]\"\n              style={{ color: t.ink, boxShadow: `inset 0 0 0 1px ${t.line2}`, background: t.raised }}\n            />\n            <SoftGlowButton type=\"submit\" tone={tone} disabled={state === \"sending\"}>\n              {state === \"sending\" ? \"Requesting\" : \"Request this time\"}\n            </SoftGlowButton>\n          </div>\n        )}\n      </div>\n      <p id={`${uid}-msg`} role=\"status\" aria-live=\"polite\" className=\"mt-3 min-h-[20px] text-[13px]\" style={{ color: state === \"error\" || hint ? \"#a0473b\" : t.ink3 }}>\n        {state === \"error\" ? failed : state === \"done\" ? done : hint}\n      </p>\n    </form>\n  );\n}\n","type":"registry:component","target":"components/viberdy/aura-booking-picker.tsx"}],"meta":{"tier":"free","tags":["form","booking","appointment","date picker","time slots","spa","clinic","radio group"],"href":"https://viberdy.dev/library/aura-booking-picker","aiPrompt":"Build a React + Tailwind form, `AuraBookingPicker({ treatments, start, days, closed, times, isTaken, onRequest, done, failed, tone, glow })`, a booking picker where the chosen time blooms into light.\n\nThree radiogroups of native radios styled as pills (peer focus rings): the treatment; a horizontally scrolling strip of `days` days counted from `start` (an ISO date, UTC), each a 60px card with the weekday in mono and the day number in serif, days whose UTC weekday is in `closed` disabled; and the times, where isTaken(date, time) disables and strikes through a time. Changing the day clears the time. Behind the chosen time, an aria-hidden grained radial halo that blooms from scale 0.4 over 600ms. Below, a panel whose serif summary line (treatment, formatted date, time, minutes) re-keys and resolves from blur on every change; an email input (required, autocomplete email, aria-invalid only for an email error) and a SoftGlowButton submit. Submit: require a time, then validity, then await onRequest (required) with a Requesting label; on success show the done line in a lit panel, on failure the failed line. One polite status line for hints, errors and success.\n\nDiffused Glow grammar: two grounds, a warm bone day (#f6f1e6; panels #efe7d6, raised #fbf8f1; ink #221f1a at 92/58/40%; hairlines at 9% and 18%) and a near-black jade room (#0b120f; panels #101c17 and #16261f; ink #f3ede2 at 94/63/40%). Light is soft and grained: halos in gold #f5c48c, rose #f2a39a and, on the day ground, jade #bcd9c8 (or any #rrggbb validated against /^#[0-9a-fA-F]{6}$/), never more than two per view, each a wide gaussian skirt with a warmer core, and the grain lives inside the light (an SVG feTurbulence tile masked to the halo, or noise in the shader), never as a page overlay. In the jade room light is added (screen blend); on the day ground it pools as colour (the paper takes the tint). One bronze accent #c9a15e used as light and one jade fill #2f6f57 kept for the booking action; one filled action per view. A serif (Fraunces by default, through var(--font-serif, \"Fraunces\", Georgia, serif)) at 340-400 for display with 0.98-1.04 leading and *italic* accents, over Geist for UI and Geist Mono uppercase captions. Radii 24-28px on panels, pills for controls; feathered shadows only. Motion is slow: halos breathe on about 10s, drift on 36s or longer and settle toward the pointer over about 900ms (1 - e^(-3dt)); resolves run 700-1100ms out of a blur on cubic-bezier(0.16, 1, 0.3, 1); hovers under 450ms. Keyframes and a focus ring (a .dg-scope rule with border-radius: revert-layer) live in a small static <style> the component renders itself; nothing is interpolated into it. Respect prefers-reduced-motion. No dependencies beyond React.","license":"https://viberdy.dev/license"}}