{"$schema":"https://ui.shadcn.com/schema/registry-item.json","name":"flight-manifest","type":"registry:component","title":"Flight Manifest","description":"A launch table on warm black: filter it, and an orange wipe runs across each row you point at; open a flight for its window, pad and mass.","dependencies":[],"registryDependencies":[],"files":[{"path":"components/viberdy/flight-manifest.tsx","content":"\"use client\";\n\nimport { useEffect, useId, useRef, useState, useSyncExternalStore } from \"react\";\nimport type { CSSProperties, RefObject } 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\nconst hvClamp = (v: number, a = 0, b = 1) => (v < a ? a : v > b ? b : v);\n\n/** Where p sits between a and b, clamped to 0..1. */\nconst hvRange = (p: number, a: number, b: number) => hvClamp((p - a) / (b - a));\n\n/** Ease out (cubic): fast, then settles. */\nconst hvOut = (t: number) => 1 - Math.pow(1 - hvClamp(t), 3);\n\nfunction hvReducedSub(fn: () => void) {\n  if (typeof window === \"undefined\" || typeof window.matchMedia !== \"function\") return () => {};\n  const mq = window.matchMedia(\"(prefers-reduced-motion: reduce)\");\n  mq.addEventListener(\"change\", fn);\n  return () => mq.removeEventListener(\"change\", fn);\n}\n\nconst hvReducedSnap = () => typeof window !== \"undefined\" && typeof window.matchMedia === \"function\" && window.matchMedia(\"(prefers-reduced-motion: reduce)\").matches;\n\n/** True when the reader asked for reduced motion. Live: follows the system setting as it changes. */\nfunction useHvReduced(): boolean {\n  return useSyncExternalStore(hvReducedSub, hvReducedSnap, () => false);\n}\n\n/**\n * The scrolling box an element lives in: the nearest ancestor that actually\n * scrolls, or null for the window. Resolved on every frame, because a box only\n * becomes a scroller once its content is taller than it.\n */\nfunction hvScrollParent(el: Element | null): HTMLElement | null {\n  let n = el?.parentElement ?? null;\n  while (n && n !== document.body && n !== document.documentElement) {\n    const oy = getComputedStyle(n).overflowY;\n    if ((oy === \"auto\" || oy === \"scroll\" || oy === \"overlay\") && n.scrollHeight > n.clientHeight + 1) return n;\n    n = n.parentElement;\n  }\n  return null;\n}\n\ninterface HvFrame {\n  /** The element's box, in viewport pixels. */\n  rect: DOMRect;\n  /** The visible part of whatever scrolls it: the scroller's box, or the window. */\n  view: { top: number; height: number; left: number; width: number };\n}\n\n/**\n * Run `apply` with the element's position whenever anything scrolls or\n * resizes, at most once per frame. One capture-phase scroll listener hears\n * every scroller, so the same section works on a page and inside a scrolling\n * preview. `apply` writes to the DOM; nothing here re-renders React.\n */\nfunction useHvScrollFrame<T extends HTMLElement>(ref: RefObject<T | null>, apply: (f: HvFrame) => void) {\n  const applyRef = useRef(apply);\n  useEffect(() => {\n    applyRef.current = apply;\n  });\n  useEffect(() => {\n    let raf = 0;\n    const run = () => {\n      raf = 0;\n      const el = ref.current;\n      if (!el) return;\n      const sp = hvScrollParent(el);\n      const r = sp ? sp.getBoundingClientRect() : null;\n      const view = sp && r ? { top: r.top, height: sp.clientHeight, left: r.left, width: sp.clientWidth } : { top: 0, height: window.innerHeight, left: 0, width: window.innerWidth };\n      applyRef.current({ rect: el.getBoundingClientRect(), view });\n    };\n    const kick = () => {\n      if (!raf) raf = requestAnimationFrame(run);\n    };\n    document.addEventListener(\"scroll\", kick, { capture: true, passive: true });\n    window.addEventListener(\"resize\", kick);\n    const ro = typeof ResizeObserver !== \"undefined\" ? new ResizeObserver(kick) : null;\n    if (ref.current && ro) ro.observe(ref.current);\n    run();\n    return () => {\n      document.removeEventListener(\"scroll\", kick, { capture: true });\n      window.removeEventListener(\"resize\", kick);\n      ro?.disconnect();\n      if (raf) cancelAnimationFrame(raf);\n    };\n  }, [ref]);\n}\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\nexport interface ManifestFlight {\n  date: string;\n  mission: string;\n  payload: string;\n  orbit: string;\n  status: \"go\" | \"hold\" | \"flown\";\n  /** Shown when the row is opened. */\n  details: [string, string][];\n}\n\nconst MF_STATUS: Record<ManifestFlight[\"status\"], string> = { go: \"Go\", hold: \"Hold\", flown: \"Flown\" };\n\nconst MF_CSS =\n  \".hv-mf-row{position:relative;isolation:isolate}\" +\n  \".hv-mf-row::before{content:'';position:absolute;inset:0;z-index:-1;background:\" + HV_ORANGE + \";transform:scaleX(0);transform-origin:left;transition:transform 380ms cubic-bezier(.2,.8,.2,1)}\" +\n  \".hv-mf-row:hover::before,.hv-mf-row:focus-visible::before,.hv-mf-row[aria-expanded=true]::before{transform:scaleX(1)}\" +\n  \".hv-mf-row:hover,.hv-mf-row:focus-visible,.hv-mf-row[aria-expanded=true]{color:\" + HV_BLACK + \"!important}\" +\n  \".hv-mf-row{transition:color 200ms}\" +\n  \".hv-mf-row:hover .hv-mf-pill,.hv-mf-row:focus-visible .hv-mf-pill,.hv-mf-row[aria-expanded=true] .hv-mf-pill{box-shadow:inset 0 0 0 1.5px \" + HV_BLACK + \"!important;background:transparent!important;color:\" + HV_BLACK + \"!important}\" +\n  \".hv-mf-row .hv-mf-x{transition:transform 260ms cubic-bezier(.2,.8,.2,1)}.hv-mf-row[aria-expanded=true] .hv-mf-x{transform:rotate(45deg)}\" +\n  \".hv-mf-grid{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:4px 16px;align-items:baseline}\" +\n  \"@container (min-width:768px){.hv-mf-grid{grid-template-columns:150px minmax(0,1.1fr) minmax(0,1.3fr) minmax(0,1fr) 92px 24px;gap:24px;align-items:center}}\" +\n  \".hv-mf-more{display:grid;grid-template-rows:0fr;transition:grid-template-rows 360ms cubic-bezier(.2,.8,.2,1)}.hv-mf-more[data-open]{grid-template-rows:1fr}\" +\n  \"@keyframes hv-mf-in{from{opacity:0;transform:translateY(8px)}}.hv-mf-li{animation:hv-mf-in 360ms cubic-bezier(.2,.8,.2,1) both;animation-delay:calc(var(--i) * 40ms)}\" +\n  \"@media (prefers-reduced-motion:reduce){.hv-mf-row::before,.hv-mf-row,.hv-mf-row .hv-mf-x,.hv-mf-more{transition:none}.hv-mf-li{animation:none}}\";\n\nexport interface FlightManifestProps {\n  eyebrow?: string;\n  headline?: string;\n  flights?: ManifestFlight[];\n  className?: string;\n  style?: CSSProperties;\n}\n\n/**\n * FlightManifest — the launch table: filter it, open a flight for its details.\n */\nexport function FlightManifest({\n  eyebrow = \"Flight manifest\",\n  headline = \"Next on the stand.\",\n  flights = [\n    { date: \"14 Nov 2026\", mission: \"AR-31\", payload: \"Rideshare · 14 satellites\", orbit: \"SSO 540 km\", status: \"go\", details: [[\"Payload mass\", \"412 kg\"], [\"Window\", \"02:14–02:44 UTC\"], [\"Pad\", \"LC-2\"], [\"Engines\", \"9 × R-9, two relights\"]] },\n    { date: \"02 Dec 2026\", mission: \"AR-32\", payload: \"Dedicated · weather radar\", orbit: \"SSO 610 km\", status: \"go\", details: [[\"Payload mass\", \"486 kg\"], [\"Window\", \"21:05–21:20 UTC\"], [\"Pad\", \"LC-1\"], [\"Engines\", \"9 × R-9, one relight\"]] },\n    { date: \"19 Dec 2026\", mission: \"HF-118\", payload: \"Hot fire · upper stage\", orbit: \"Test stand B\", status: \"hold\", details: [[\"Duration\", \"240 s at 100%\"], [\"Starts\", \"3\"], [\"Stand\", \"B, horizontal\"], [\"Status\", \"Waiting on propellant\"]] },\n    { date: \"28 Sep 2026\", mission: \"AR-30\", payload: \"Rideshare · 9 satellites\", orbit: \"LEO 500 km\", status: \"flown\", details: [[\"Payload mass\", \"338 kg\"], [\"Lift-off\", \"03:41 UTC\"], [\"Pad\", \"LC-2\"], [\"Result\", \"All payloads deployed\"]] },\n    { date: \"06 Aug 2026\", mission: \"AR-29\", payload: \"Dedicated · imaging\", orbit: \"SSO 525 km\", status: \"flown\", details: [[\"Payload mass\", \"455 kg\"], [\"Lift-off\", \"22:17 UTC\"], [\"Pad\", \"LC-1\"], [\"Result\", \"Nominal, booster recovered\"]] },\n  ],\n  className = \"\",\n  style,\n}: FlightManifestProps) {\n  const [filter, setFilter] = useState<\"all\" | \"upcoming\" | \"flown\">(\"all\");\n  const [open, setOpen] = useState<string | null>(null);\n  const ref = useRef<HTMLElement>(null);\n  const reduced = useHvReduced();\n  const base = useId();\n  const shown = flights.filter((f) => (filter === \"all\" ? true : filter === \"flown\" ? f.status === \"flown\" : f.status !== \"flown\"));\n  const count = (k: \"all\" | \"upcoming\" | \"flown\") => flights.filter((f) => (k === \"all\" ? true : k === \"flown\" ? f.status === \"flown\" : f.status !== \"flown\")).length;\n\n  // Rows draw in from the left as they cross the lower part of the view.\n  useHvScrollFrame(ref, (f) => {\n    const root = ref.current;\n    if (!root) return;\n    root.querySelectorAll<HTMLElement>(\"[data-mf-rule]\").forEach((el) => {\n      const r = el.getBoundingClientRect();\n      const t = reduced ? 1 : hvOut(hvRange((f.view.top + f.view.height - r.top) / f.view.height, 0.04, 0.3));\n      el.style.transform = \"scaleX(\" + t.toFixed(4) + \")\";\n    });\n  });\n\n  return (\n    <section ref={ref} data-hv-ground=\"black\" className={\"hv-scope @container relative w-full \" + className} style={{ background: HV_BLACK, color: HV_BONE, fontFamily: HV_DISPLAY, ...style }}>\n      <style>{HV_CSS + MF_CSS}</style>\n      <div className=\"mx-auto w-full max-w-[1320px] px-5 py-20 @3xl:px-[4cqw] @3xl:py-28\">\n        <div className=\"mb-10 flex flex-col gap-6 @3xl:mb-14 @3xl:flex-row @3xl:items-end @3xl:justify-between\">\n          <div className=\"flex flex-col gap-3\">\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.8 }}>\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,7cqw,112px)]\" style={{ fontWeight: 900, fontVariationSettings: '\"wdth\" 70' }}>\n              {headline}\n            </h2>\n          </div>\n          <div role=\"group\" aria-label=\"Show flights\" className=\"flex self-start @3xl:self-auto\" style={{ boxShadow: \"inset 0 0 0 1.5px \" + HV_BONE }}>\n            {([\"all\", \"upcoming\", \"flown\"] as const).map((k) => (\n              <button\n                key={k}\n                type=\"button\"\n                aria-pressed={filter === k}\n                onClick={() => {\n                  setFilter(k);\n                  setOpen(null);\n                }}\n                className=\"hv-press h-10 border-0 px-4 text-[12px] font-medium uppercase tracking-[0.12em]\"\n                style={{ fontFamily: HV_MONO, background: filter === k ? HV_BONE : \"transparent\", color: filter === k ? HV_BLACK : HV_BONE, cursor: \"pointer\" }}\n              >\n                {k} <span className=\"hv-num\" style={{ opacity: 0.6 }}>{count(k)}</span>\n              </button>\n            ))}\n          </div>\n        </div>\n        <div aria-hidden className=\"hidden @3xl:block\">\n        <div className=\"hv-mf-grid px-3 pb-3 text-[11px] uppercase tracking-[0.14em]\" style={{ fontFamily: HV_MONO, opacity: 0.55 }}>\n          <span>Date</span>\n          <span>Mission</span>\n          <span>Payload</span>\n          <span>Orbit</span>\n          <span>Status</span>\n          <span />\n        </div>\n        </div>\n        <ul key={filter} className=\"m-0 list-none p-0\">\n          {shown.map((fl, i) => {\n            const isOpen = open === fl.mission;\n            const panel = base + fl.mission;\n            return (\n              <li key={fl.mission} className=\"hv-mf-li relative\" style={{ \"--i\": i } as CSSProperties}>\n                <span aria-hidden data-mf-rule=\"\" data-hv-live=\"\" className=\"absolute inset-x-0 top-0 h-px origin-left\" style={{ background: \"rgba(239,235,228,.28)\" }} />\n                <button type=\"button\" aria-expanded={isOpen} aria-controls={panel} onClick={() => setOpen(isOpen ? null : fl.mission)} className=\"hv-mf-row hv-mf-grid w-full border-0 bg-transparent px-3 py-5 text-left @3xl:py-6\" style={{ color: \"inherit\", font: \"inherit\", cursor: \"pointer\" }}>\n                  <span className=\"hv-num text-[12px] uppercase tracking-[0.1em] @3xl:text-[13px]\" style={{ fontFamily: HV_MONO }}>\n                    {fl.date}\n                  </span>\n                  <span className=\"order-first col-span-2 text-[34px] uppercase leading-none @3xl:order-none @3xl:col-span-1 @3xl:text-[40px]\" style={{ fontWeight: 900, fontVariationSettings: '\"wdth\" 76' }}>\n                    {fl.mission}\n                  </span>\n                  <span className=\"col-span-2 text-[15px] @3xl:col-span-1\" style={{ fontWeight: 500 }}>\n                    {fl.payload}\n                  </span>\n                  <span className=\"text-[12px] uppercase tracking-[0.1em] @3xl:text-[13px]\" style={{ fontFamily: HV_MONO, opacity: 0.8 }}>\n                    {fl.orbit}\n                  </span>\n                  <span className=\"justify-self-end @3xl:justify-self-start\">\n                    <span className=\"hv-mf-pill inline-flex h-7 min-w-[56px] items-center justify-center gap-1.5 px-2.5 text-[11.5px] font-bold uppercase tracking-[0.12em]\" style={{ fontFamily: HV_MONO, background: fl.status === \"go\" ? HV_ORANGE : \"transparent\", color: fl.status === \"go\" ? HV_BLACK : HV_BONE, boxShadow: fl.status === \"go\" ? \"none\" : \"inset 0 0 0 1.5px rgba(239,235,228,.5)\" }}>\n                      {fl.status === \"hold\" ? <span aria-hidden className=\"h-1.5 w-1.5\" style={{ background: \"currentColor\" }} /> : null}\n                      {MF_STATUS[fl.status]}\n                    </span>\n                  </span>\n                  <svg className=\"hv-mf-x hidden justify-self-end @3xl:block\" width=\"16\" height=\"16\" viewBox=\"0 0 16 16\" aria-hidden>\n                    <path d=\"M8 2v12M2 8h12\" stroke=\"currentColor\" strokeWidth=\"2\" />\n                  </svg>\n                </button>\n                <div id={panel} className=\"hv-mf-more\" data-open={isOpen ? \"\" : undefined} style={{ visibility: isOpen ? \"visible\" : \"hidden\", transition: isOpen ? \"grid-template-rows 360ms cubic-bezier(.2,.8,.2,1), visibility 0s\" : \"grid-template-rows 360ms cubic-bezier(.2,.8,.2,1), visibility 0s linear 360ms\" }}>\n                  <div className=\"overflow-hidden\">\n                    <dl className=\"m-0 grid grid-cols-2 gap-x-6 gap-y-4 px-3 pb-6 pt-1 @3xl:grid-cols-4 @3xl:pl-[174px]\">\n                      {fl.details.map(([k, v]) => (\n                        <div key={k}>\n                          <dt className=\"text-[11px] uppercase tracking-[0.14em]\" style={{ fontFamily: HV_MONO, opacity: 0.55 }}>\n                            {k}\n                          </dt>\n                          <dd className=\"m-0 mt-1 text-[17px]\" style={{ fontWeight: 600 }}>\n                            {v}\n                          </dd>\n                        </div>\n                      ))}\n                    </dl>\n                  </div>\n                </div>\n              </li>\n            );\n          })}\n        </ul>\n        <span aria-hidden className=\"block h-px w-full\" style={{ background: \"rgba(239,235,228,.28)\" }} />\n      </div>\n    </section>\n  );\n}\n","type":"registry:component","target":"components/viberdy/flight-manifest.tsx"}],"meta":{"tier":"free","tags":["table","schedule","list","accordion","filter","hover effect","orange","dark mode","section"],"href":"https://viberdy.dev/library/flight-manifest","aiPrompt":"Build FlightManifest, a launch table 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\nHeader: mono eyebrow \"Flight manifest\", h2 \"Next on the stand.\" (clamp(56px, 7cqw, 112px), weight 900, wdth 70); a filter group (All / Upcoming / Flown with live counts) of aria-pressed buttons in a 1.5px bone outline, the pressed one filled bone. Columns on desktop (container >= 768px): 150px date (mono 13px), mission (40px, weight 900, wdth 76), payload (15px), orbit (mono), status pill (Go = filled #FF5B14 with black text; Hold and Flown = 1.5px outline), a plus that turns 45° when open. Under 768px each row is a card: mission at 34px first, then date, payload, orbit and the pill.\nEach row is a full-width button with aria-expanded and aria-controls. Hover, focus or open: an orange layer wipes in from the left (::before scaleX 0 -> 1, 380ms cubic-bezier(.2,.8,.2,1)), the text turns black and the pill becomes a black outline. Opening reveals a details grid (2 columns on phone, 4 on desktop, indented 174px) with a grid-template-rows 0fr -> 1fr transition. Rows re-deal on filter change (fade and rise 8px, 40ms stagger). The 1px rules between rows draw out from the left as the scroll brings them up (range 0.04..0.3 of the view, written in a scroll frame). Five sample flights with mass, window, pad and engine details. Header row hidden on phone by a wrapper (an unlayered display:grid would beat Tailwind's hidden). Props: eyebrow, headline, flights.","license":"https://viberdy.dev/license"}}