{"$schema":"https://ui.shadcn.com/schema/registry-item.json","name":"hot-fire-request-form","type":"registry:component","title":"Hot Fire Request Form","description":"A booking form in hi-vis: underlined fields that light orange, chip choices that fill solid, inline errors that name the fix, and a sent state that replays the request.","dependencies":[],"registryDependencies":[],"files":[{"path":"components/viberdy/hot-fire-request-form.tsx","content":"\"use client\";\n\nimport { useId, useState } from \"react\";\nimport type { CSSProperties, FormEvent } from \"react\";\n\n\n/** Safety orange as a field colour. Black on it reads at 6.3:1. */\nconst HV_ORANGE = \"#FF5B14\";\n\n/** The hot highlight, for orange marks on black. */\nconst HV_HOT = \"#FF7A1A\";\n\nconst HV_BLACK = \"#0B0A09\";\n\nconst HV_BONE = \"#EFEBE4\";\n\n/**\n * The display face: Archivo's width axis does the shouting (wdth 62..125).\n * Load it as a variable font with the width axis and expose it as --font-hv,\n * e.g. in Next: Archivo({ subsets: [\"latin\"], axes: [\"wdth\"], variable: \"--font-hv\" }).\n */\nconst HV_DISPLAY = 'var(--font-hv, \"Archivo\"), \"Archivo\", \"Arial Narrow\", ui-sans-serif, system-ui, sans-serif';\n\n/** Labels and readouts: Geist Mono as --font-hv-mono (any monospace works). */\nconst HV_MONO = 'var(--font-hv-mono, \"Geist Mono\"), \"Geist Mono\", ui-monospace, \"SFMono-Regular\", Menlo, monospace';\n\n/**\n * The kit's scoped CSS: one focus ring (2px, offset 3px, in the ink of the\n * ground it sits on), tabular figures, the press, and transitions off for\n * anything a frame loop writes.\n */\nconst HV_CSS =\n  \".hv-scope{--hv-ring:\" + HV_HOT + \"}\" +\n  \".hv-scope[data-hv-ground=orange],.hv-scope [data-hv-ground=orange]{--hv-ring:\" + HV_BLACK + \"}\" +\n  \".hv-scope[data-hv-ground=bone],.hv-scope [data-hv-ground=bone]{--hv-ring:\" + HV_BLACK + \"}\" +\n  \".hv-scope :focus-visible{outline:2px solid var(--hv-ring)!important;outline-offset:3px!important}\" +\n  \".hv-scope .hv-num{font-variant-numeric:tabular-nums}\" +\n  \".hv-scope [data-hv-live]{transition:none!important}\" +\n  \".hv-scope .hv-press{transition:transform 160ms cubic-bezier(.2,.8,.2,1),background-color 160ms,color 160ms}\" +\n  \".hv-scope .hv-press:active{transform:scale(.97)}\" +\n  \".hv-scope .hv-arr{transition:transform 220ms cubic-bezier(.2,.8,.2,1)}.hv-scope a:hover .hv-arr,.hv-scope button:hover .hv-arr{transform:translateX(3px)}\" +\n  \"@media (prefers-reduced-motion:reduce){.hv-scope .hv-press,.hv-scope .hv-arr{transition:none}}\";\n\n/** The kit's arrow: slides on hover. */\nfunction HvArrow({ size = 14 }: { size?: number }) {\n  return (\n    <svg className=\"hv-arr\" width={size} height={size} viewBox=\"0 0 14 14\" aria-hidden>\n      <path d=\"M2 7h9M7.5 3.5L11 7l-3.5 3.5\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"1.8\" strokeLinecap=\"square\" />\n    </svg>\n  );\n}\n\n/** Ardent's mark: a shock diamond, the bright knot in a rocket plume. Takes the current colour. */\nfunction HvMark({ size = 22 }: { size?: number }) {\n  return (\n    <svg width={size} height={size} viewBox=\"0 0 24 24\" aria-hidden>\n      <path d=\"M12 1.5 L19 12 L12 22.5 L5 12 Z\" fill=\"currentColor\" />\n      <path d=\"M12 7.2 L15.2 12 L12 16.8 L8.8 12 Z\" fill=\"var(--hv-mark-cut, #0B0A09)\" />\n    </svg>\n  );\n}\n\nexport interface HotFireRequest {\n  company: string;\n  email: string;\n  thrust: string;\n  burn: string;\n  notes: string;\n}\n\nconst RF_CSS =\n  \".hv-rf-field{position:relative;display:block}\" +\n  \".hv-rf-field input,.hv-rf-field textarea{width:100%;border:0;border-radius:0;background:transparent;color:\" + HV_BONE + \";font:inherit;font-size:20px;font-weight:600;padding:26px 0 10px;outline:none;box-shadow:inset 0 -2px 0 rgba(239,235,228,.35);transition:box-shadow 200ms}\" +\n  \".hv-rf-field textarea{resize:vertical;min-height:96px;font-size:17px;font-weight:500;line-height:1.45}\" +\n  \".hv-rf-field input:focus,.hv-rf-field textarea:focus{box-shadow:inset 0 -3px 0 \" + HV_ORANGE + \"}\" +\n  \".hv-rf-field[data-bad] input{box-shadow:inset 0 -3px 0 \" + HV_HOT + \"}\" +\n  \".hv-rf-field>span{position:absolute;left:0;top:0;font-size:11.5px;text-transform:uppercase;letter-spacing:.14em;opacity:.72}\" +\n  \".hv-rf-scope .hv-rf-field input:focus-visible,.hv-rf-scope .hv-rf-field textarea:focus-visible{outline:none!important}\" +\n  \".hv-rf-chip{position:relative;display:inline-flex;align-items:center;height:40px;padding:0 14px;cursor:pointer;font-size:13px;font-weight:700;text-transform:uppercase;letter-spacing:.06em;box-shadow:inset 0 0 0 1.5px rgba(239,235,228,.5);transition:background-color 160ms,color 160ms,box-shadow 160ms}\" +\n  \".hv-rf-chip:hover{box-shadow:inset 0 0 0 1.5px \" + HV_BONE + \"}\" +\n  \".hv-rf-chip:has(input:checked){background:\" + HV_ORANGE + \";color:\" + HV_BLACK + \";box-shadow:none}\" +\n  \".hv-rf-chip:has(input:focus-visible){outline:2px solid \" + HV_HOT + \";outline-offset:3px}\" +\n  \".hv-rf-chip input{position:absolute;opacity:0;width:1px;height:1px}\" +\n  \"@media (prefers-reduced-motion:reduce){.hv-rf-field input,.hv-rf-field textarea,.hv-rf-chip{transition:none}}\";\n\n/** A plain, linear-time email check (one @, a dot in the domain, no spaces). */\nconst RF_EMAIL = /^[^\\s@]+@[^\\s@.]+(\\.[^\\s@.]+)+$/;\n\nexport interface HotFireRequestFormProps {\n  eyebrow?: string;\n  headline?: string;\n  sub?: string;\n  thrustClasses?: string[];\n  burns?: string[];\n  /** Where the request goes. Resolve when it has been received; throw (or reject) to show the error line. */\n  onSubmit: (request: HotFireRequest) => Promise<void> | void;\n  /** What the form says once onSubmit has resolved. */\n  sentText?: string;\n  className?: string;\n  style?: CSSProperties;\n}\n\n/**\n * HotFireRequestForm — book time on the test stand.\n */\nexport function HotFireRequestForm({\n  eyebrow = \"Test your own stage\",\n  headline = \"Book a hot fire.\",\n  sub = \"Bring an upper stage or a single engine. We fire it on stand B, horizontal, and send you the data the same day.\",\n  thrustClasses = [\"Under 100 kN\", \"100–500 kN\", \"500 kN +\"],\n  burns = [\"30 s\", \"120 s\", \"240 s\", \"Full duration\"],\n  onSubmit,\n  sentText = \"Request received. We reply within two working days with a stand date.\",\n  className = \"\",\n  style,\n}: HotFireRequestFormProps) {\n  const [form, setForm] = useState<HotFireRequest>({ company: \"\", email: \"\", thrust: thrustClasses[1] ?? \"\", burn: burns[1] ?? \"\", notes: \"\" });\n  const [touched, setTouched] = useState(false);\n  const [state, setState] = useState<\"idle\" | \"sending\" | \"sent\" | \"error\">(\"idle\");\n  const id = useId();\n  const badCompany = form.company.trim().length < 2;\n  const badEmail = !RF_EMAIL.test(form.email.trim());\n  const set = (k: keyof HotFireRequest) => (e: { target: { value: string } }) => setForm((f) => ({ ...f, [k]: e.target.value }));\n\n  const submit = async (e: FormEvent<HTMLFormElement>) => {\n    e.preventDefault();\n    setTouched(true);\n    if (badCompany || badEmail || state === \"sending\") {\n      const first = e.currentTarget.querySelector<HTMLInputElement>(badCompany ? \"#\" + CSS.escape(id + \"c\") : \"#\" + CSS.escape(id + \"e\"));\n      first?.focus();\n      return;\n    }\n    setState(\"sending\");\n    try {\n      await onSubmit({ ...form, company: form.company.trim(), email: form.email.trim(), notes: form.notes.trim() });\n      setState(\"sent\");\n    } catch {\n      setState(\"error\");\n    }\n  };\n\n  const chips = (name: keyof HotFireRequest, label: string, options: string[]) => (\n    <fieldset className=\"m-0 min-w-0 border-0 p-0\">\n      <legend className=\"mb-3 p-0 text-[11.5px] uppercase tracking-[0.14em]\" style={{ fontFamily: HV_MONO, opacity: 0.72 }}>\n        {label}\n      </legend>\n      <div className=\"flex flex-wrap gap-2\">\n        {options.map((o) => (\n          <label key={o} className=\"hv-rf-chip\">\n            <input type=\"radio\" name={id + name} value={o} checked={form[name] === o} onChange={set(name)} />\n            {o}\n          </label>\n        ))}\n      </div>\n    </fieldset>\n  );\n\n  return (\n    <section data-hv-ground=\"black\" className={\"hv-scope hv-rf-scope @container relative w-full \" + className} style={{ background: HV_BLACK, color: HV_BONE, fontFamily: HV_DISPLAY, ...style }}>\n      <style>{HV_CSS + RF_CSS}</style>\n      <div className=\"mx-auto grid w-full max-w-[1320px] grid-cols-1 gap-12 px-5 py-20 @3xl:grid-cols-[minmax(0,0.9fr)_minmax(0,1.1fr)] @3xl:gap-[6cqw] @3xl:px-[4cqw] @3xl:py-28\">\n        <div className=\"flex flex-col gap-4\">\n          <p className=\"m-0 flex items-center gap-2.5 text-[11.5px] font-medium uppercase tracking-[0.14em] @3xl:text-[12.5px]\" style={{ fontFamily: HV_MONO, opacity: 0.85 }}>\n            <span aria-hidden className=\"inline-block h-2 w-2\" style={{ background: HV_HOT }} />\n            {eyebrow}\n          </p>\n          <h2 className=\"m-0 text-[clamp(44px,12cqw,64px)] uppercase leading-[0.86] @3xl:text-[clamp(56px,6.4cqw,104px)]\" style={{ fontWeight: 900, fontVariationSettings: '\"wdth\" 70' }}>\n            {headline}\n          </h2>\n          <p className=\"m-0 max-w-[40ch] text-[16px] leading-[1.5]\" style={{ fontWeight: 450, opacity: 0.8 }}>\n            {sub}\n          </p>\n        </div>\n        {state === \"sent\" ? (\n          <div role=\"status\" className=\"flex flex-col items-start justify-center gap-5 p-8\" style={{ background: HV_ORANGE, color: HV_BLACK }}>\n            <HvMark size={28} />\n            <p className=\"m-0 text-[clamp(26px,3cqw,36px)] uppercase leading-[0.95]\" style={{ fontWeight: 900, fontVariationSettings: '\"wdth\" 76' }}>\n              {sentText}\n            </p>\n            <p className=\"m-0 text-[12px] uppercase tracking-[0.12em]\" style={{ fontFamily: HV_MONO }}>\n              {form.company.trim()} · {form.thrust} · {form.burn}\n            </p>\n          </div>\n        ) : (\n          <form noValidate onSubmit={submit} className=\"flex flex-col gap-8\" aria-busy={state === \"sending\"}>\n            <div className=\"grid grid-cols-1 gap-8 @3xl:grid-cols-2\">\n              <label className=\"hv-rf-field\" data-bad={touched && badCompany ? \"\" : undefined}>\n                <span style={{ fontFamily: HV_MONO }}>Company</span>\n                <input id={id + \"c\"} name=\"company\" autoComplete=\"organization\" required value={form.company} onChange={set(\"company\")} aria-invalid={touched && badCompany} aria-describedby={touched && badCompany ? id + \"ce\" : undefined} />\n                {touched && badCompany ? (\n                  <em id={id + \"ce\"} className=\"mt-2 block text-[12.5px] not-italic\" style={{ color: HV_HOT }}>\n                    Tell us who is firing.\n                  </em>\n                ) : null}\n              </label>\n              <label className=\"hv-rf-field\" data-bad={touched && badEmail ? \"\" : undefined}>\n                <span style={{ fontFamily: HV_MONO }}>Work email</span>\n                <input id={id + \"e\"} name=\"email\" type=\"email\" autoComplete=\"email\" inputMode=\"email\" required value={form.email} onChange={set(\"email\")} aria-invalid={touched && badEmail} aria-describedby={touched && badEmail ? id + \"ee\" : undefined} />\n                {touched && badEmail ? (\n                  <em id={id + \"ee\"} className=\"mt-2 block text-[12.5px] not-italic\" style={{ color: HV_HOT }}>\n                    We need an address that takes mail.\n                  </em>\n                ) : null}\n              </label>\n            </div>\n            {chips(\"thrust\", \"Stage thrust\", thrustClasses)}\n            {chips(\"burn\", \"Burn length\", burns)}\n            <label className=\"hv-rf-field\">\n              <span style={{ fontFamily: HV_MONO }}>Anything we should know (optional)</span>\n              <textarea name=\"notes\" rows={3} value={form.notes} onChange={set(\"notes\")} />\n            </label>\n            <div className=\"flex flex-wrap items-center gap-5\">\n              <button type=\"submit\" disabled={state === \"sending\"} className=\"hv-press inline-flex h-14 items-center gap-2.5 border-0 px-7 text-[15px] font-bold uppercase tracking-[0.06em]\" style={{ background: HV_ORANGE, color: HV_BLACK, cursor: state === \"sending\" ? \"progress\" : \"pointer\", opacity: state === \"sending\" ? 0.7 : 1 }}>\n                {state === \"sending\" ? \"Sending\" : \"Send request\"}\n                <HvArrow />\n              </button>\n              <p aria-live=\"polite\" className=\"m-0 text-[13px]\" style={{ color: state === \"error\" ? HV_HOT : \"inherit\", opacity: state === \"error\" ? 1 : 0.7 }}>\n                {state === \"error\" ? \"That did not go through. Try again in a moment.\" : \"No account needed. We only use this to reply.\"}\n              </p>\n            </div>\n          </form>\n        )}\n      </div>\n    </section>\n  );\n}\n","type":"registry:component","target":"components/viberdy/hot-fire-request-form.tsx"}],"meta":{"tier":"free","tags":["form","contact form","booking","validation","radio chips","dark mode","orange","section"],"href":"https://viberdy.dev/library/hot-fire-request-form","aiPrompt":"Build HotFireRequestForm, a booking form on warm black. Style: Hi-Vis. Fixed palette, no theming: safety orange #FF5B14 as a flat field (black on it is 6.3:1; dim text on orange stays at 75%+ black), hot orange #FF7A1A for marks on black, warm black #0B0A09, bone #EFEBE4. Type: Archivo variable (wght 100-900, wdth 62-125) loaded with its wdth axis (next/font: Archivo({ subsets: [\"latin\"], axes: [\"wdth\"], variable: \"--font-hv\" })) and read as var(--font-hv, \"Archivo\"), display at weight 850-900, wdth 62-80, uppercase, line-height 0.84-0.9; Geist Mono (var(--font-hv-mono)) for labels at 11-12.5px, uppercase, tracking 0.12-0.16em. Square corners everywhere. Every section root carries data-hv-ground=\"black\" | \"orange\" | \"bone\". One focus ring: 2px solid, offset 3px, hot orange on black and black on orange or bone. Scroll-told parts are driven by one number p (0..1) that chases the measured scroll with v += (target - v) * 0.16 per frame, written straight to the DOM (no React state per frame); a capture-phase scroll listener on document hears any scroller, so it works on a page and inside a scrolling box. Reduced motion shows the settled end state. Links go through a safe-href helper (https, http, mailto, same-site paths and anchors only; backslashes refused). React 19, Tailwind v4 with container queries (@container on the root, @3xl = 768px for the desktop layout). No three.js, no images.\n\nLayout: desktop two columns (0.9fr / 1.1fr, gap 6cqw); left a mono eyebrow \"Test your own stage\" with a hot-orange square, h2 \"Book a hot fire.\" at clamp(56px, 6.4cqw, 104px) weight 900 wdth 70, and a 16px sub. Right, a noValidate form: Company and Work email side by side on desktop as underlined fields (20px weight 600 input, a 2px rule at 35% bone that turns 3px safety orange on focus and 3px hot orange when invalid; the mono label sits above). Then two fieldsets with legends (Stage thrust: Under 100 kN, 100-500 kN, 500 kN +; Burn length: 30 s, 120 s, 240 s, Full duration) of 40px chips that are real radio inputs inside labels: outlined in bone at 50%, filled orange with black text when checked (:has(input:checked)), focus ring through :has(input:focus-visible). An optional notes textarea, then a 56px orange \"Send request\" button and a polite live line. On submit: company needs 2+ characters and the email must pass a linear-time check (one @, a dot in the domain, no spaces, no backtracking-prone groups); a bad field gets aria-invalid, a plain-words error tied with aria-describedby, and the first bad one takes focus. onSubmit is required and may be async: while it runs the button says \"Sending\" (aria-busy on the form); when it resolves the form is replaced by an orange role=status panel that confirms and replays company, thrust and burn; if it throws the form stays filled and the live line says it did not go through. Props: eyebrow, headline, sub, thrustClasses, burns, onSubmit, sentText.","license":"https://viberdy.dev/license"}}