{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "stats-arc-grid",
  "type": "registry:component",
  "title": "Stats Arc Grid",
  "description": "An asymmetric grid of big numbers, each with a segmented gauge rising from the tile corner and a large half dial on the feature tile. Segments light up toward each goal while the figures count, and glow on hover.",
  "author": "Hyperblur <hello@hyperblur.dev>",
  "dependencies": [],
  "registryDependencies": [],
  "categories": [
    "stats",
    "stats",
    "gauge",
    "radial",
    "big numbers",
    "grid",
    "section"
  ],
  "docs": "https://hyperblur.dev/effects/stats-arc-grid",
  "files": [
    {
      "path": "registry/hyperblur/stats-arc-grid.tsx",
      "type": "registry:component",
      "target": "components/hyperblur/stats-arc-grid.tsx",
      "content": "\"use client\";\n\nimport * as React from \"react\";\n\nexport interface ArcStat {\n  value: number;\n  decimals?: number;\n  prefix?: string;\n  suffix?: string;\n  label: string;\n  progress: number;\n  caption?: string;\n}\n\nexport interface StatsArcGridProps extends Omit<React.HTMLAttributes<HTMLElement>, \"title\"> {\n  eyebrow?: string;\n  title?: string;\n  subtitle?: string;\n  feature?: ArcStat;\n  stats?: ArcStat[];\n  duration?: number;\n  accent?: string;\n}\n\nconst css = `\n.hb-wb8 {\n  --hb-wb8-accent: #a3e635;\n  box-sizing: border-box;\n  position: relative;\n  width: 100%;\n  container-type: inline-size;\n  background: #0a0a0a;\n  color: #ededed;\n  font-family: inherit;\n  -webkit-font-smoothing: antialiased;\n}\n.hb-wb8 *, .hb-wb8 *::before, .hb-wb8 *::after { box-sizing: border-box; }\n.hb-wb8-wrap { max-width: 1120px; margin: 0 auto; padding: 80px 24px 96px; }\n.hb-wb8-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 32px; margin-bottom: 32px; }\n.hb-wb8-eyebrow { margin: 0 0 12px; color: var(--hb-wb8-accent); font-size: 12px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; font-family: var(--font-mono, ui-monospace, monospace); }\n.hb-wb8-title { margin: 0; max-width: 540px; font-size: clamp(28px, 3.8cqw, 42px); font-weight: 600; line-height: 1.04; letter-spacing: -.04em; text-wrap: balance; }\n.hb-wb8-sub { margin: 0; max-width: 320px; color: #8f8f8f; font-size: 14.5px; line-height: 1.6; }\n.hb-wb8-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) repeat(2, minmax(0, 1fr)); grid-auto-rows: minmax(190px, auto); gap: 12px; margin: 0; padding: 0; list-style: none; }\n.hb-wb8-tile {\n  position: relative;\n  min-width: 0;\n  overflow: hidden;\n  padding: 22px 22px 20px;\n  border: 1px solid rgba(255, 255, 255, .07);\n  border-radius: 20px;\n  background: radial-gradient(120% 120% at 100% 100%, color-mix(in srgb, var(--hb-wb8-accent) 7%, #111), #0f0f0f 60%);\n  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .05);\n  transition: border-color .4s ease, transform .5s cubic-bezier(.2, .8, .2, 1);\n}\n.hb-wb8-tile:hover { border-color: color-mix(in srgb, var(--hb-wb8-accent) 30%, rgba(255, 255, 255, .08)); transform: translateY(-2px); }\n.hb-wb8-tile[data-big] { grid-row: span 2; padding: 28px; background: radial-gradient(90% 70% at 50% 100%, color-mix(in srgb, var(--hb-wb8-accent) 12%, #111), #0f0f0f 70%); }\n.hb-wb8-arc { position: absolute; right: 0; bottom: 0; width: 56%; aspect-ratio: 1; pointer-events: none; }\n.hb-wb8-tile[data-big] .hb-wb8-arc { left: 50%; right: auto; bottom: -2px; width: 92%; aspect-ratio: 2; transform: translateX(-50%); }\n.hb-wb8-seg { fill: #1d1d1d; transition: fill .25s ease, filter .3s ease; }\n.hb-wb8-seg[data-on=\"true\"] { fill: var(--hb-wb8-accent); }\n.hb-wb8-tile:hover .hb-wb8-seg[data-on=\"true\"] { filter: drop-shadow(0 0 4px color-mix(in srgb, var(--hb-wb8-accent) 70%, transparent)); }\n.hb-wb8-copy { position: relative; z-index: 1; }\n.hb-wb8-num { display: flex; align-items: baseline; font-size: clamp(34px, 4.2cqw, 48px); font-weight: 600; line-height: 1; letter-spacing: -.05em; font-variant-numeric: tabular-nums; }\n.hb-wb8-tile[data-big] .hb-wb8-num { font-size: clamp(52px, 7.4cqw, 88px); }\n.hb-wb8-num small { margin-left: 3px; color: #8f8f8f; font-size: .48em; letter-spacing: -.02em; }\n.hb-wb8-label { margin: 10px 0 0; max-width: 54%; font-size: 13.5px; font-weight: 500; line-height: 1.35; }\n.hb-wb8-tile[data-big] .hb-wb8-label { max-width: 300px; font-size: 16px; }\n.hb-wb8-cap { position: absolute; left: 22px; bottom: 18px; z-index: 1; max-width: 48%; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; display: inline-flex; align-items: center; gap: 6px; color: #8f8f8f; font-size: 12px; font-family: var(--font-mono, ui-monospace, monospace); font-variant-numeric: tabular-nums; }\n.hb-wb8-cap i { width: 6px; height: 6px; border-radius: 2px; background: var(--hb-wb8-accent); }\n.hb-wb8-tile[data-big] .hb-wb8-cap { max-width: none; left: 50%; bottom: 22px; transform: translateX(-50%); padding: 4px 10px; border: 1px solid rgba(255, 255, 255, .1); border-radius: 999px; background: rgba(10, 10, 10, .7); white-space: nowrap; }\n.hb-wb8-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }\n@container (max-width: 860px) {\n  .hb-wb8-head { flex-direction: column; align-items: flex-start; gap: 14px; }\n  .hb-wb8-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }\n  .hb-wb8-tile[data-big] { grid-column: span 2; grid-row: auto; min-height: 340px; }\n  .hb-wb8-tile[data-big] .hb-wb8-arc { width: min(92%, 520px); }\n}\n@container (max-width: 460px) {\n  .hb-wb8-wrap { padding: 60px 16px 72px; }\n  .hb-wb8-grid { grid-template-columns: minmax(0, 1fr); grid-auto-rows: minmax(170px, auto); }\n  .hb-wb8-tile[data-big] { grid-column: auto; min-height: 300px; }\n}\n@media (prefers-reduced-motion: reduce) {\n  .hb-wb8-tile, .hb-wb8-seg { transition: none; }\n  .hb-wb8-tile:hover { transform: none; }\n}\n`;\n\nfunction useProgress<T extends Element>(ref: React.RefObject<T | null>, duration: number) {\n  const [t, setT] = React.useState(0);\n  React.useEffect(() => {\n    const el = ref.current;\n    if (!el) return;\n    let raf = 0;\n    const run = () => {\n      if (window.matchMedia(\"(prefers-reduced-motion: reduce)\").matches) {\n        setT(1);\n        return;\n      }\n      const start = performance.now();\n      const tick = (now: number) => {\n        const p = Math.min((now - start) / duration, 1);\n        setT(p);\n        if (p < 1) raf = requestAnimationFrame(tick);\n      };\n      raf = requestAnimationFrame(tick);\n    };\n    if (typeof IntersectionObserver === \"undefined\") {\n      raf = requestAnimationFrame(() => setT(1));\n      return () => cancelAnimationFrame(raf);\n    }\n    const io = new IntersectionObserver(\n      (entries) => {\n        if (entries.some((e) => e.isIntersecting)) {\n          io.disconnect();\n          run();\n        }\n      },\n      { threshold: 0.2 },\n    );\n    io.observe(el);\n    return () => {\n      io.disconnect();\n      cancelAnimationFrame(raf);\n    };\n  }, [ref, duration]);\n  return t;\n}\n\nfunction easeOut(x: number) {\n  return 1 - Math.pow(1 - x, 4);\n}\n\nfunction sector(cx: number, cy: number, r0: number, r1: number, a0: number, a1: number) {\n  const p = (r: number, a: number) => `${(cx + Math.cos(a) * r).toFixed(2)} ${(cy + Math.sin(a) * r).toFixed(2)}`;\n  return `M${p(r1, a0)} A${r1} ${r1} 0 0 1 ${p(r1, a1)} L${p(r0, a1)} A${r0} ${r0} 0 0 0 ${p(r0, a0)} Z`;\n}\n\nfunction segments(count: number, cx: number, cy: number, r0: number, r1: number, from: number, to: number, gap: number) {\n  const step = (to - from) / count;\n  return Array.from({ length: count }, (_, i) => {\n    const a0 = from + i * step + gap / 2;\n    const a1 = from + (i + 1) * step - gap / 2;\n    return sector(cx, cy, r0, r1, a0, a1);\n  });\n}\n\nconst smallSegs = segments(22, 200, 200, 128, 176, Math.PI, Math.PI * 1.5, 0.022);\nconst bigSegs = segments(40, 200, 200, 128, 190, Math.PI, Math.PI * 2, 0.018);\n\nconst defaultFeature: ArcStat = { value: 2.74, decimals: 2, prefix: \"$\", suffix: \"B\", label: \"Payments processed on Ferro in 2026, with seven weeks still to go\", progress: 0.82, caption: \"82% of the annual target\" };\n\nconst defaultStats: ArcStat[] = [\n  { value: 99.995, decimals: 3, suffix: \"%\", label: \"API uptime over the last 12 months\", progress: 0.99, caption: \"SLA 99.95%\" },\n  { value: 41, suffix: \"ms\", label: \"Median authorization latency worldwide\", progress: 0.41, caption: \"of 100 ms budget\" },\n  { value: 186, label: \"Countries where merchants accept payouts\", progress: 0.95, caption: \"186 of 195\" },\n  { value: 0.04, decimals: 2, suffix: \"%\", label: \"Fraud rate after automated screening\", progress: 0.18, caption: \"industry avg 0.22%\" },\n];\n\nfunction Tile({ s, big, t, delay }: { s: ArcStat; big?: boolean; t: number; delay: number }) {\n  const local = t >= 1 ? 1 : easeOut(Math.min(Math.max((t - delay) / (1 - delay), 0), 1));\n  const segs = big ? bigSegs : smallSegs;\n  const lit = Math.max(0, Math.min(1, s.progress)) * local;\n  const dec = s.decimals ?? 0;\n  const shown = (s.value * local).toFixed(dec);\n  const full = `${s.prefix ?? \"\"}${s.value.toFixed(dec)}${s.suffix ?? \"\"}`;\n  return (\n    <li className=\"hb-wb8-tile\" data-big={big ? \"\" : undefined}>\n      <svg className=\"hb-wb8-arc\" viewBox={big ? \"0 0 400 200\" : \"0 0 200 200\"} aria-hidden=\"true\">\n          {segs.map((d, k) => (\n            <path\n              key={k}\n              className=\"hb-wb8-seg\"\n              d={d}\n              data-on={k / segs.length < lit - 0.0001}\n              style={{ fillOpacity: (0.45 + 0.55 * (k / segs.length)).toFixed(2) }}\n            />\n          ))}\n      </svg>\n      <div className=\"hb-wb8-copy\">\n        <span className=\"hb-wb8-sr\">{full}</span>\n        <span className=\"hb-wb8-num\" aria-hidden=\"true\">\n          {s.prefix}\n          {shown}\n          {s.suffix && <small>{s.suffix}</small>}\n        </span>\n        <p className=\"hb-wb8-label\">{s.label}</p>\n      </div>\n      {s.caption && (\n        <span className=\"hb-wb8-cap\"><i aria-hidden=\"true\" />{s.caption}</span>\n      )}\n    </li>\n  );\n}\n\nexport function StatsArcGrid({\n  eyebrow = \"Ferro by the numbers\",\n  title = \"Infrastructure that money trusts\",\n  subtitle = \"Each gauge shows how far we are toward the goal we publish every January. Figures audited quarterly.\",\n  feature = defaultFeature,\n  stats = defaultStats,\n  duration = 2000,\n  accent = \"#a3e635\",\n  className = \"\",\n  style,\n  ...rest\n}: StatsArcGridProps) {\n  const uid = React.useId();\n  const ref = React.useRef<HTMLUListElement>(null);\n  const t = useProgress(ref, Math.max(duration, 200));\n  const vars = { \"--hb-wb8-accent\": accent, ...style } as React.CSSProperties;\n\n  return (\n    <section className={`hb-wb8 ${className}`} style={vars} aria-labelledby={`${uid}-t`} {...rest}>\n      <style href=\"hb-stats-arc-grid\" precedence=\"default\">{css}</style>\n      <div className=\"hb-wb8-wrap\">\n        <div className=\"hb-wb8-head\">\n          <div>\n            <p className=\"hb-wb8-eyebrow\">{eyebrow}</p>\n            <h2 id={`${uid}-t`} className=\"hb-wb8-title\">{title}</h2>\n          </div>\n          {subtitle && <p className=\"hb-wb8-sub\">{subtitle}</p>}\n        </div>\n        <ul ref={ref} className=\"hb-wb8-grid\">\n          {feature && <Tile s={feature} big t={t} delay={0} />}\n          {stats.map((s, i) => (\n            <Tile key={`${s.label}-${i}`} s={s} t={t} delay={Math.min(0.12 + i * 0.08, 0.6)} />\n          ))}\n        </ul>\n      </div>\n    </section>\n  );\n}\n"
    }
  ]
}