{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "local-reservation-bar",
  "type": "registry:component",
  "title": "Local Reservation Bar",
  "description": "A wide reservation bar with date, time and a guest stepper over a warm sunset street scene, with live availability dots around the chosen time.",
  "author": "Hyperblur <hello@hyperblur.dev>",
  "dependencies": [],
  "registryDependencies": [],
  "categories": [
    "local",
    "reservation",
    "restaurant",
    "booking",
    "table",
    "availability",
    "hero"
  ],
  "docs": "https://hyperblur.dev/effects/local-reservation-bar",
  "files": [
    {
      "path": "registry/hyperblur/local-reservation-bar.tsx",
      "type": "registry:component",
      "target": "components/hyperblur/local-reservation-bar.tsx",
      "content": "\"use client\";\n\nimport * as React from \"react\";\n\nexport interface LocalReservationQuery {\n  date: string;\n  time: string;\n  party: number;\n}\n\nexport interface LocalReservationBarProps extends Omit<React.HTMLAttributes<HTMLElement>, \"title\" | \"onSubmit\"> {\n  eyebrow?: string;\n  title?: string;\n  subtitle?: string;\n  dates?: string[];\n  times?: string[];\n  defaultTime?: string;\n  defaultParty?: number;\n  minParty?: number;\n  maxParty?: number;\n  submitLabel?: string;\n  note?: string;\n  accent?: string;\n  onSubmit?: (query: LocalReservationQuery) => void;\n}\n\nconst defaultDates = [\"Tonight, Fri Nov 7\", \"Sat, Nov 8\", \"Sun, Nov 9\", \"Tue, Nov 11\", \"Wed, Nov 12\", \"Thu, Nov 13\"];\nconst defaultTimes = [\"5:30 pm\", \"6:00 pm\", \"6:30 pm\", \"7:00 pm\", \"7:30 pm\", \"8:00 pm\", \"8:30 pm\", \"9:00 pm\", \"9:30 pm\"];\n\nfunction seats(seed: number) {\n  let h = seed * 2654435761;\n  h = (h ^ (h >>> 13)) >>> 0;\n  return h % 6;\n}\n\nconst css = `\n.hb-kl6 {\n  --hb-kl6-accent: #e0673a;\n  box-sizing: border-box;\n  width: 100%;\n  container-type: inline-size;\n  position: relative;\n  overflow: hidden;\n  isolation: isolate;\n  background: #2a1512;\n  color: #fff6ec;\n  font-family: inherit;\n  -webkit-font-smoothing: antialiased;\n}\n.hb-kl6 *, .hb-kl6 *::before, .hb-kl6 *::after { box-sizing: border-box; }\n.hb-kl6-scene { position: absolute; inset: 0; z-index: -1; background: linear-gradient(180deg, #3b1a1b 0%, #8a3a26 46%, #e48a4a 78%, #f3c07a 100%); }\n.hb-kl6-sun { position: absolute; left: 50%; top: 58%; width: 520px; height: 520px; margin-left: -260px; border-radius: 50%; background: radial-gradient(circle, rgba(255, 214, 150, .9) 0%, rgba(255, 170, 100, .35) 40%, transparent 70%); animation: hb-kl6-glow 8s ease-in-out infinite; }\n@keyframes hb-kl6-glow { 50% { transform: scale(1.08); opacity: .85; } }\n.hb-kl6-city { position: absolute; left: 0; right: 0; bottom: 0; width: 100%; height: 46%; display: block; }\n.hb-kl6-win { animation: hb-kl6-flick 5s ease-in-out infinite; animation-delay: var(--hb-kl6-d); }\n@keyframes hb-kl6-flick { 0%, 100% { opacity: 1; } 45% { opacity: .45; } 55% { opacity: 1; } }\n.hb-kl6-wrap { position: relative; max-width: 1120px; margin: 0 auto; padding: 104px 24px 200px; text-align: center; }\n.hb-kl6-eyebrow { display: inline-flex; align-items: center; gap: 10px; margin: 0 0 18px; color: #ffd9b8; font-size: 13px; letter-spacing: .2em; text-transform: uppercase; }\n.hb-kl6-eyebrow::before, .hb-kl6-eyebrow::after { content: \"\"; width: 24px; height: 1px; background: currentColor; opacity: .6; }\n.hb-kl6-title { margin: 0 auto; max-width: 760px; font-family: var(--font-sans, ui-sans-serif, system-ui, sans-serif); font-weight: 400; font-size: clamp(40px, 6.4cqw, 76px); line-height: .98; letter-spacing: -.02em; text-wrap: balance; text-shadow: 0 2px 30px rgba(60, 20, 10, .4); }\n.hb-kl6-sub { margin: 18px auto 0; max-width: 520px; color: #ffe3cc; font-size: 16.5px; line-height: 1.6; }\n.hb-kl6-bar {\n  margin: 40px auto 0;\n  max-width: 940px;\n  display: grid;\n  grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr) minmax(0, 1fr) auto;\n  align-items: stretch;\n  padding: 8px;\n  border-radius: 24px;\n  background: rgba(255, 249, 242, .96);\n  color: #2a1512;\n  box-shadow: 0 1px 0 #fff inset, 0 40px 80px -30px rgba(40, 10, 5, .7);\n  text-align: left;\n}\n.hb-kl6-field { position: relative; min-width: 0; padding: 10px 18px; border-radius: 16px; transition: background .2s; }\n.hb-kl6-field + .hb-kl6-field::before { content: \"\"; position: absolute; left: 0; top: 14px; bottom: 14px; width: 1px; background: #ecdccb; }\n.hb-kl6-field:hover, .hb-kl6-field:focus-within { background: #f7ebdd; }\n.hb-kl6-field:hover::before, .hb-kl6-field:focus-within::before, .hb-kl6-field:hover + .hb-kl6-field::before, .hb-kl6-field:focus-within + .hb-kl6-field::before { opacity: 0; }\n.hb-kl6-label { display: block; color: #9a7663; font-size: 11.5px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; }\n.hb-kl6-select { appearance: none; display: block; width: 100%; margin-top: 4px; padding: 0 20px 0 0; border: 0; background: transparent; color: #2a1512; font: inherit; font-size: 16px; font-weight: 600; cursor: pointer; text-overflow: ellipsis; }\n.hb-kl6-select:focus-visible { outline: none; }\n.hb-kl6-chev { position: absolute; right: 18px; bottom: 16px; color: #9a7663; pointer-events: none; }\n.hb-kl6-field:has(.hb-kl6-select:focus-visible) { box-shadow: 0 0 0 2px var(--hb-kl6-accent); }\n.hb-kl6-step { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 2px; }\n.hb-kl6-step output { font-size: 16px; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }\n.hb-kl6-stepbtns { display: flex; gap: 6px; }\n.hb-kl6-round { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; border: 1px solid #e3cfba; background: #fff; color: #2a1512; cursor: pointer; transition: border-color .2s, background .2s; }\n.hb-kl6-round:hover:not(:disabled) { border-color: var(--hb-kl6-accent); }\n.hb-kl6-round:disabled { opacity: .35; cursor: not-allowed; }\n.hb-kl6-round:focus-visible, .hb-kl6-go:focus-visible, .hb-kl6-slot:focus-visible { outline: 2px solid var(--hb-kl6-accent); outline-offset: 2px; }\n.hb-kl6-go { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 0 26px; min-height: 56px; border: 0; border-radius: 18px; background: var(--hb-kl6-accent); color: #fff; font: inherit; font-size: 15.5px; font-weight: 600; white-space: nowrap; cursor: pointer; box-shadow: inset 0 1px 0 rgba(255,255,255,.3), 0 10px 24px -10px var(--hb-kl6-accent); transition: transform .2s, filter .2s; }\n.hb-kl6-go:hover { transform: translateY(-1px); filter: brightness(1.06); }\n.hb-kl6-avail { max-width: 940px; margin: 14px auto 0; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: center; }\n.hb-kl6-availlabel { color: #ffe3cc; font-size: 13px; margin-right: 4px; }\n.hb-kl6-slot { display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 999px; border: 1px solid rgba(255, 240, 225, .25); background: rgba(40, 14, 10, .35); backdrop-filter: blur(10px); color: #fff6ec; font: inherit; font-size: 13.5px; font-variant-numeric: tabular-nums; cursor: pointer; transition: background .2s, border-color .2s; }\n.hb-kl6-slot:hover:not(:disabled) { background: rgba(40, 14, 10, .55); border-color: rgba(255, 240, 225, .5); }\n.hb-kl6-slot[aria-pressed=\"true\"] { background: #fff6ec; color: #2a1512; border-color: #fff6ec; }\n.hb-kl6-slot:disabled { opacity: .5; cursor: not-allowed; text-decoration: line-through; }\n.hb-kl6-dot { position: relative; width: 8px; height: 8px; border-radius: 50%; background: var(--hb-kl6-c); }\n.hb-kl6-dot::after { content: \"\"; position: absolute; inset: 0; border-radius: 50%; background: var(--hb-kl6-c); animation: hb-kl6-ping 1.8s ease-out infinite; }\n@keyframes hb-kl6-ping { to { transform: scale(2.6); opacity: 0; } }\n.hb-kl6-result { max-width: 940px; margin: 18px auto 0; display: inline-flex; align-items: center; gap: 10px; padding: 10px 16px; border-radius: 14px; background: rgba(255, 249, 242, .14); border: 1px solid rgba(255, 240, 225, .25); backdrop-filter: blur(10px); color: #fff6ec; font-size: 14px; animation: hb-kl6-pop .45s cubic-bezier(.2,.8,.2,1) both; }\n@keyframes hb-kl6-pop { from { opacity: 0; transform: translateY(6px) scale(.98); } }\n.hb-kl6-note { margin: 16px 0 0; color: rgba(255, 227, 204, .8); font-size: 13px; }\n@container (max-width: 860px) {\n  .hb-kl6-bar { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 4px; }\n  .hb-kl6-field + .hb-kl6-field::before { display: none; }\n  .hb-kl6-go { grid-column: 1 / -1; }\n  .hb-kl6-wrap { padding: 72px 20px 160px; }\n}\n@container (max-width: 440px) {\n  .hb-kl6-bar { grid-template-columns: minmax(0, 1fr); }\n}\n@media (prefers-reduced-motion: reduce) {\n  .hb-kl6 *, .hb-kl6 *::before, .hb-kl6 *::after { animation: none !important; transition: none !important; }\n}\n`;\n\nfunction City() {\n  const towers = [\n    { x: 0, w: 70, h: 120 }, { x: 64, w: 54, h: 170 }, { x: 112, w: 90, h: 110 }, { x: 196, w: 46, h: 200 },\n    { x: 236, w: 80, h: 140 }, { x: 310, w: 60, h: 95 }, { x: 680, w: 70, h: 130 }, { x: 744, w: 50, h: 185 },\n    { x: 788, w: 96, h: 120 }, { x: 878, w: 58, h: 160 }, { x: 930, w: 80, h: 105 }, { x: 1004, w: 60, h: 175 },\n    { x: 1058, w: 90, h: 125 }, { x: 1142, w: 60, h: 150 },\n  ];\n  const windows: { x: number; y: number; d: string }[] = [];\n  towers.forEach((t, ti) => {\n    for (let r = 0; r < Math.floor(t.h / 26); r++) {\n      for (let c = 0; c < Math.floor((t.w - 12) / 16); c++) {\n        const k = (ti * 31 + r * 7 + c * 13) % 9;\n        if (k < 3) windows.push({ x: t.x + 10 + c * 16, y: 260 - t.h + 14 + r * 26, d: `${((k * 1.3 + ti * 0.4) % 5).toFixed(1)}s` });\n      }\n    }\n  });\n  return (\n    <svg className=\"hb-kl6-city\" viewBox=\"0 0 1200 260\" preserveAspectRatio=\"xMidYMax slice\" aria-hidden=\"true\">\n      <path d=\"M0 210 C 200 180, 380 230, 600 200 S 1000 180, 1200 205 L 1200 260 L 0 260 Z\" fill=\"#6b2c1f\" opacity=\".55\" />\n      {towers.map((t, i) => <rect key={i} x={t.x} y={260 - t.h} width={t.w} height={t.h} fill=\"#3a1714\" />)}\n      {windows.map((w, i) => (\n        <rect key={i} className=\"hb-kl6-win\" x={w.x} y={w.y} width=\"7\" height=\"10\" rx=\"1\" fill=\"#ffc77a\" style={{ \"--hb-kl6-d\": w.d } as React.CSSProperties} />\n      ))}\n      <g transform=\"translate(430 120)\">\n        <rect x=\"0\" y=\"40\" width=\"340\" height=\"100\" fill=\"#2b100e\" />\n        <path d=\"M-14 40 L 354 40 L 330 14 L 10 14 Z\" fill=\"#4a1d18\" />\n        <path d=\"M-14 40 L 354 40\" stroke=\"#ffb46a\" strokeWidth=\"2\" />\n        {Array.from({ length: 4 }, (_, i) => (\n          <g key={i}>\n            <rect x={20 + i * 80} y=\"58\" width=\"60\" height=\"62\" rx=\"30\" fill=\"#ffcf8a\" opacity=\".92\" />\n            <rect x={20 + i * 80} y=\"58\" width=\"60\" height=\"62\" rx=\"30\" fill=\"none\" stroke=\"#5a2318\" strokeWidth=\"3\" />\n            <circle cx={50 + i * 80} cy=\"96\" r=\"7\" fill=\"#7a3220\" opacity=\".55\" />\n          </g>\n        ))}\n        {Array.from({ length: 12 }, (_, i) => (\n          <circle key={`b${i}`} cx={(6 + i * 29).toFixed(0)} cy={(26 + (i % 2) * 5).toFixed(0)} r=\"3.2\" fill=\"#ffe2a8\" className=\"hb-kl6-win\" style={{ \"--hb-kl6-d\": `${(i * 0.37).toFixed(2)}s` } as React.CSSProperties} />\n        ))}\n      </g>\n    </svg>\n  );\n}\n\nexport function LocalReservationBar({\n  eyebrow = \"Lantern House · Mission District\",\n  title = \"Dinner under the string lights.\",\n  subtitle = \"Wood-fired plates, a long natural wine list and a patio that stays warm till close. Tables open 30 days ahead.\",\n  dates = defaultDates,\n  times = defaultTimes,\n  defaultTime = \"7:30 pm\",\n  defaultParty = 2,\n  minParty = 1,\n  maxParty = 12,\n  submitLabel = \"Find a table\",\n  note = \"Parties over 8? Call us at (415) 555-0119 for the private room.\",\n  accent = \"#e0673a\",\n  onSubmit,\n  className,\n  style,\n  ...rest\n}: LocalReservationBarProps) {\n  const uid = React.useId();\n  const [date, setDate] = React.useState(dates[0] ?? \"\");\n  const [time, setTime] = React.useState(times.includes(defaultTime) ? defaultTime : times[0] ?? \"\");\n  const [party, setParty] = React.useState(defaultParty);\n  const [found, setFound] = React.useState<LocalReservationQuery | null>(null);\n\n  const dateIndex = Math.max(0, dates.indexOf(date));\n  const timeIndex = Math.max(0, times.indexOf(time));\n  const around = times.slice(Math.max(0, Math.min(timeIndex - 2, times.length - 5)), Math.max(0, Math.min(timeIndex - 2, times.length - 5)) + 5);\n\n  const availability = (t: string) => {\n    const left = seats(dateIndex * 17 + times.indexOf(t) * 5 + party * 3);\n    return party > 6 ? Math.max(0, left - 3) : left;\n  };\n  const tone = (n: number) => (n === 0 ? \"#b8a59a\" : n <= 2 ? \"#f5b544\" : \"#5fd38d\");\n\n  const submit = (event: React.FormEvent) => {\n    event.preventDefault();\n    const query = { date, time, party };\n    setFound(query);\n    onSubmit?.(query);\n  };\n\n  const foundCount = found ? availability(found.time) : 0;\n\n  return (\n    <section\n      className={[\"hb-kl6\", className].filter(Boolean).join(\" \")}\n      style={{ \"--hb-kl6-accent\": accent, ...style } as React.CSSProperties}\n      {...rest}\n    >\n      <style href=\"hb-local-reservation-bar\" precedence=\"default\">{css}</style>\n      <div className=\"hb-kl6-scene\" aria-hidden=\"true\">\n        <div className=\"hb-kl6-sun\" />\n        <City />\n      </div>\n      <div className=\"hb-kl6-wrap\">\n        <p className=\"hb-kl6-eyebrow\">{eyebrow}</p>\n        <h2 className=\"hb-kl6-title\">{title}</h2>\n        <p className=\"hb-kl6-sub\">{subtitle}</p>\n        <form className=\"hb-kl6-bar\" onSubmit={submit}>\n          <div className=\"hb-kl6-field\">\n            <label className=\"hb-kl6-label\" htmlFor={`${uid}-date`}>Date</label>\n            <select id={`${uid}-date`} className=\"hb-kl6-select\" value={date} onChange={(e) => { setDate(e.target.value); setFound(null); }}>\n              {dates.map((d) => <option key={d} value={d}>{d}</option>)}\n            </select>\n            <svg className=\"hb-kl6-chev\" width=\"12\" height=\"12\" viewBox=\"0 0 24 24\" fill=\"none\" aria-hidden=\"true\"><path d=\"M6 9l6 6 6-6\" stroke=\"currentColor\" strokeWidth=\"2.4\" strokeLinecap=\"round\" strokeLinejoin=\"round\" /></svg>\n          </div>\n          <div className=\"hb-kl6-field\">\n            <label className=\"hb-kl6-label\" htmlFor={`${uid}-time`}>Time</label>\n            <select id={`${uid}-time`} className=\"hb-kl6-select\" value={time} onChange={(e) => { setTime(e.target.value); setFound(null); }}>\n              {times.map((t) => <option key={t} value={t}>{t}</option>)}\n            </select>\n            <svg className=\"hb-kl6-chev\" width=\"12\" height=\"12\" viewBox=\"0 0 24 24\" fill=\"none\" aria-hidden=\"true\"><path d=\"M6 9l6 6 6-6\" stroke=\"currentColor\" strokeWidth=\"2.4\" strokeLinecap=\"round\" strokeLinejoin=\"round\" /></svg>\n          </div>\n          <div className=\"hb-kl6-field\">\n            <span className=\"hb-kl6-label\" id={`${uid}-party`}>Guests</span>\n            <div className=\"hb-kl6-step\" role=\"group\" aria-labelledby={`${uid}-party`}>\n              <output aria-live=\"polite\">{party} {party === 1 ? \"guest\" : \"guests\"}</output>\n              <div className=\"hb-kl6-stepbtns\">\n                <button type=\"button\" className=\"hb-kl6-round\" aria-label=\"Remove a guest\" disabled={party <= minParty} onClick={() => { setParty((p) => Math.max(minParty, p - 1)); setFound(null); }}>\n                  <svg width=\"12\" height=\"12\" viewBox=\"0 0 24 24\" fill=\"none\" aria-hidden=\"true\"><path d=\"M5 12h14\" stroke=\"currentColor\" strokeWidth=\"2.6\" strokeLinecap=\"round\" /></svg>\n                </button>\n                <button type=\"button\" className=\"hb-kl6-round\" aria-label=\"Add a guest\" disabled={party >= maxParty} onClick={() => { setParty((p) => Math.min(maxParty, p + 1)); setFound(null); }}>\n                  <svg width=\"12\" height=\"12\" viewBox=\"0 0 24 24\" fill=\"none\" aria-hidden=\"true\"><path d=\"M12 5v14M5 12h14\" stroke=\"currentColor\" strokeWidth=\"2.6\" strokeLinecap=\"round\" /></svg>\n                </button>\n              </div>\n            </div>\n          </div>\n          <button type=\"submit\" className=\"hb-kl6-go\">\n            <svg width=\"16\" height=\"16\" viewBox=\"0 0 24 24\" fill=\"none\" aria-hidden=\"true\">\n              <circle cx=\"11\" cy=\"11\" r=\"7\" stroke=\"currentColor\" strokeWidth=\"2.2\" />\n              <path d=\"M20 20l-4-4\" stroke=\"currentColor\" strokeWidth=\"2.2\" strokeLinecap=\"round\" />\n            </svg>\n            {submitLabel}\n          </button>\n        </form>\n        <div className=\"hb-kl6-avail\" role=\"group\" aria-label=\"Live availability\">\n          <span className=\"hb-kl6-availlabel\">Live availability</span>\n          {around.map((t) => {\n            const n = availability(t);\n            return (\n              <button\n                key={t}\n                type=\"button\"\n                className=\"hb-kl6-slot\"\n                aria-pressed={t === time}\n                disabled={n === 0}\n                aria-label={`${t}, ${n === 0 ? \"fully booked\" : `${n} tables left`}`}\n                onClick={() => { setTime(t); setFound(null); }}\n              >\n                <span className=\"hb-kl6-dot\" style={{ \"--hb-kl6-c\": tone(n) } as React.CSSProperties} aria-hidden=\"true\" />\n                {t}\n              </button>\n            );\n          })}\n        </div>\n        {found ? (\n          <div className=\"hb-kl6-result\" role=\"status\">\n            <span className=\"hb-kl6-dot\" style={{ \"--hb-kl6-c\": tone(foundCount) } as React.CSSProperties} aria-hidden=\"true\" />\n            {foundCount > 0\n              ? `${foundCount} ${foundCount === 1 ? \"table\" : \"tables\"} for ${found.party} at ${found.time}, ${found.date}. We will hold it for 10 minutes.`\n              : `${found.time} is fully booked. Try one of the green times above.`}\n          </div>\n        ) : null}\n        {note ? <p className=\"hb-kl6-note\">{note}</p> : null}\n      </div>\n    </section>\n  );\n}\n"
    }
  ]
}