{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "stats-radial",
  "type": "registry:component",
  "title": "Stats Radial",
  "description": "A light section with three radial progress rings that sweep in on view, with tick marks that light up behind the arc, counting center numbers and a short description under each.",
  "author": "Hyperblur <hello@hyperblur.dev>",
  "dependencies": [],
  "registryDependencies": [],
  "categories": [
    "stats",
    "stats",
    "radial",
    "progress ring",
    "light",
    "count up",
    "section"
  ],
  "docs": "https://hyperblur.dev/effects/stats-radial",
  "files": [
    {
      "path": "registry/hyperblur/stats-radial.tsx",
      "type": "registry:component",
      "target": "components/hyperblur/stats-radial.tsx",
      "content": "\"use client\";\n\nimport * as React from \"react\";\n\nexport interface RadialStat {\n  value: number;\n  max?: number;\n  decimals?: number;\n  prefix?: string;\n  suffix?: string;\n  caption?: string;\n  label: string;\n  description?: string;\n}\n\nexport interface StatsRadialProps extends Omit<React.HTMLAttributes<HTMLElement>, \"title\"> {\n  eyebrow?: string;\n  title?: string;\n  subtitle?: string;\n  stats?: RadialStat[];\n  footnote?: string;\n  duration?: number;\n  accent?: string;\n}\n\nconst css = `\n.hb-ka8 {\n  --hb-ka8-accent: #2f7bff;\n  box-sizing: border-box;\n  position: relative;\n  width: 100%;\n  container-type: inline-size;\n  background: #ffffff;\n  color: #111111;\n  font-family: inherit;\n  -webkit-font-smoothing: antialiased;\n}\n.hb-ka8 *, .hb-ka8 *::before, .hb-ka8 *::after { box-sizing: border-box; }\n.hb-ka8::before {\n  content: \"\";\n  position: absolute;\n  inset: 0;\n  background-image: radial-gradient(rgba(17, 17, 17, .09) 1px, transparent 1px);\n  background-size: 22px 22px;\n  -webkit-mask: radial-gradient(70% 60% at 50% 0%, #000, transparent 75%);\n  mask: radial-gradient(70% 60% at 50% 0%, #000, transparent 75%);\n  pointer-events: none;\n}\n.hb-ka8-wrap { position: relative; max-width: 1120px; margin: 0 auto; padding: 80px 24px 96px; }\n.hb-ka8-head { max-width: 640px; margin: 0 auto 48px; text-align: center; }\n.hb-ka8-eyebrow {\n  display: inline-flex;\n  align-items: center;\n  gap: 8px;\n  margin: 0 0 18px;\n  padding: 5px 12px;\n  border: 1px solid #e8e8e8;\n  border-radius: 999px;\n  background: #fff;\n  box-shadow: 0 1px 2px rgba(0, 0, 0, .04);\n  color: #555;\n  font-size: 12.5px;\n  font-weight: 500;\n}\n.hb-ka8-eyebrow i { width: 6px; height: 6px; border-radius: 50%; background: var(--hb-ka8-accent); }\n.hb-ka8-title {\n  margin: 0;\n  font-size: clamp(28px, 4.2cqw, 44px);\n  font-weight: 600;\n  line-height: 1.08;\n  letter-spacing: -.035em;\n  text-wrap: balance;\n}\n.hb-ka8-sub { margin: 14px 0 0; color: #666; font-size: 16px; line-height: 1.6; }\n.hb-ka8-grid {\n  display: grid;\n  grid-template-columns: repeat(3, minmax(0, 1fr));\n  gap: 16px;\n  margin: 0;\n  padding: 0;\n  list-style: none;\n}\n.hb-ka8-card {\n  display: flex;\n  flex-direction: column;\n  align-items: center;\n  min-width: 0;\n  padding: 32px 28px 30px;\n  border: 1px solid #ececec;\n  border-radius: 22px;\n  background: linear-gradient(180deg, #fff, #fbfbfb);\n  box-shadow: 0 1px 0 #fff inset, 0 1px 2px rgba(0, 0, 0, .04), 0 18px 40px -24px rgba(0, 0, 0, .14);\n  text-align: center;\n  transition: transform .4s cubic-bezier(.2, .8, .2, 1), box-shadow .4s ease;\n}\n.hb-ka8-card:hover { transform: translateY(-3px); box-shadow: 0 1px 0 #fff inset, 0 2px 4px rgba(0, 0, 0, .04), 0 28px 50px -26px rgba(0, 0, 0, .2); }\n.hb-ka8-ring { position: relative; width: min(100%, 188px); aspect-ratio: 1; }\n.hb-ka8-ring svg { display: block; width: 100%; height: 100%; }\n.hb-ka8-track { fill: none; stroke: #f0f0f0; stroke-width: 12; }\n.hb-ka8-arc { fill: none; stroke-width: 12; stroke-linecap: round; }\n.hb-ka8-tick { stroke: #e2e2e2; stroke-width: 1.4; stroke-linecap: round; }\n.hb-ka8-tick[data-on=\"true\"] { stroke: var(--hb-ka8-accent); }\n.hb-ka8-center {\n  position: absolute;\n  inset: 0;\n  display: flex;\n  flex-direction: column;\n  align-items: center;\n  justify-content: center;\n}\n.hb-ka8-num {\n  display: flex;\n  align-items: baseline;\n  font-size: clamp(34px, 4cqw, 44px);\n  font-weight: 600;\n  line-height: 1;\n  letter-spacing: -.045em;\n  font-variant-numeric: tabular-nums;\n}\n.hb-ka8-num small { margin-left: 2px; color: #8a8a8a; font-size: .45em; font-weight: 600; letter-spacing: 0; }\n.hb-ka8-cap { margin-top: 6px; color: #8a8a8a; font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; }\n.hb-ka8-label { margin: 22px 0 0; font-size: 17px; font-weight: 600; letter-spacing: -.01em; }\n.hb-ka8-desc { margin: 8px 0 0; max-width: 300px; color: #666; font-size: 14px; line-height: 1.6; }\n.hb-ka8-foot { margin: 28px 0 0; color: #8a8a8a; font-size: 12.5px; text-align: center; }\n.hb-ka8-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }\n@container (max-width: 820px) {\n  .hb-ka8-grid { grid-template-columns: minmax(0, 1fr); max-width: 520px; margin: 0 auto; }\n  .hb-ka8-card { display: grid; grid-template-columns: 140px minmax(0, 1fr); align-items: center; gap: 4px 24px; text-align: left; padding: 24px; }\n  .hb-ka8-ring { grid-row: span 2; width: 140px; }\n  .hb-ka8-label { margin: 0; align-self: end; }\n  .hb-ka8-desc { align-self: start; }\n  .hb-ka8-num { font-size: 30px; }\n}\n@container (max-width: 460px) {\n  .hb-ka8-wrap { padding: 64px 16px 72px; }\n  .hb-ka8-head { margin-bottom: 32px; }\n  .hb-ka8-card { grid-template-columns: 104px minmax(0, 1fr); gap: 4px 16px; padding: 18px; border-radius: 18px; }\n  .hb-ka8-ring { width: 104px; }\n  .hb-ka8-num { font-size: 24px; }\n  .hb-ka8-cap { display: none; }\n  .hb-ka8-label { font-size: 15px; }\n  .hb-ka8-desc { font-size: 13px; }\n}\n@media (prefers-reduced-motion: reduce) {\n  .hb-ka8-card { transition: none; }\n  .hb-ka8-card: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 ease(x: number) {\n  return x < 0.5 ? 4 * x * x * x : 1 - Math.pow(-2 * x + 2, 3) / 2;\n}\n\nconst TICKS = 48;\nconst tickLines = Array.from({ length: TICKS }, (_, i) => {\n  const a = (i / TICKS) * Math.PI * 2 - Math.PI / 2;\n  const r1 = 95;\n  const r2 = i % 4 === 0 ? 100 : 98;\n  return {\n    x1: (100 + Math.cos(a) * r1).toFixed(2),\n    y1: (100 + Math.sin(a) * r1).toFixed(2),\n    x2: (100 + Math.cos(a) * r2).toFixed(2),\n    y2: (100 + Math.sin(a) * r2).toFixed(2),\n  };\n});\n\nconst defaultStats: RadialStat[] = [\n  { value: 94, suffix: \"%\", caption: \"CSAT\", label: \"Customer satisfaction\", description: \"Up from 81% in the first quarter after switching, measured across 2,400 teams.\" },\n  { value: 4.8, max: 5, decimals: 1, suffix: \"/5\", caption: \"Agent rating\", label: \"Agents actually like it\", description: \"Average score from 11,300 support agents on independent review sites.\" },\n  { value: 63, suffix: \"%\", caption: \"Deflected\", label: \"Solved before a ticket\", description: \"Help center answers and guided flows close most questions on their own.\" },\n];\n\nexport function StatsRadial({\n  eyebrow = \"Helpline customer report 2026\",\n  title = \"Support that customers rate, and agents enjoy\",\n  subtitle = \"Three numbers we track every week, measured the same way since our first customer.\",\n  stats = defaultStats,\n  footnote = \"Survey of 2,400 support teams, July to September 2026.\",\n  duration = 1800,\n  accent = \"#2f7bff\",\n  className = \"\",\n  style,\n  ...rest\n}: StatsRadialProps) {\n  const uid = React.useId();\n  const ref = React.useRef<HTMLUListElement>(null);\n  const t = useProgress(ref, Math.max(duration, 200));\n  const gid = `hb-ka8-g${uid.replace(/[^a-zA-Z0-9]/g, \"\")}`;\n  const vars = { \"--hb-ka8-accent\": accent, ...style } as React.CSSProperties;\n\n  return (\n    <section className={`hb-ka8 ${className}`} style={vars} aria-labelledby={`${uid}-t`} {...rest}>\n      <style href=\"hb-stats-radial\" precedence=\"default\">{css}</style>\n      <div className=\"hb-ka8-wrap\">\n        <header className=\"hb-ka8-head\">\n          {eyebrow && (\n            <p className=\"hb-ka8-eyebrow\">\n              <i aria-hidden=\"true\" />\n              {eyebrow}\n            </p>\n          )}\n          <h2 id={`${uid}-t`} className=\"hb-ka8-title\">{title}</h2>\n          {subtitle && <p className=\"hb-ka8-sub\">{subtitle}</p>}\n        </header>\n        <ul ref={ref} className=\"hb-ka8-grid\">\n          {stats.map((s, i) => {\n            const max = s.max ?? 100;\n            const pct = Math.min(Math.max(s.value / max, 0), 1);\n            const delay = i * 0.12;\n            const span = Math.max(1 - 0.12 * Math.max(stats.length - 1, 0), 0.3);\n            const local = t >= 1 ? 1 : ease(Math.min(Math.max((t - delay) / span, 0), 1));\n            const now = pct * local;\n            const decimals = s.decimals ?? 0;\n            const shown = (s.value * local).toFixed(decimals);\n            const full = `${s.prefix ?? \"\"}${s.value.toFixed(decimals)}${s.suffix ?? \"\"}`;\n            return (\n              <li key={`${s.label}-${i}`} className=\"hb-ka8-card\">\n                <div className=\"hb-ka8-ring\">\n                  <svg viewBox=\"0 0 200 200\" aria-hidden=\"true\">\n                    <defs>\n                      <linearGradient id={`${gid}-${i}`} x1=\"0\" y1=\"0\" x2=\"1\" y2=\"1\">\n                        <stop offset=\"0\" stopColor={accent} stopOpacity=\".45\" />\n                        <stop offset=\"1\" stopColor={accent} />\n                      </linearGradient>\n                    </defs>\n                    {tickLines.map((l, k) => (\n                      <line key={k} className=\"hb-ka8-tick\" data-on={k / TICKS < now} x1={l.x1} y1={l.y1} x2={l.x2} y2={l.y2} />\n                    ))}\n                    <circle className=\"hb-ka8-track\" cx=\"100\" cy=\"100\" r=\"80\" />\n                    <circle\n                      className=\"hb-ka8-arc\"\n                      cx=\"100\"\n                      cy=\"100\"\n                      r=\"80\"\n                      pathLength={100}\n                      stroke={`url(#${gid}-${i})`}\n                      strokeDasharray=\"100 100\"\n                      strokeDashoffset={(100 - now * 100).toFixed(2)}\n                      opacity={now > 0.002 ? 1 : 0}\n                      transform=\"rotate(-90 100 100)\"\n                    />\n                  </svg>\n                  <div className=\"hb-ka8-center\">\n                    <span className=\"hb-ka8-sr\">{full}</span>\n                    <span className=\"hb-ka8-num\" aria-hidden=\"true\">\n                      {s.prefix}\n                      {shown}\n                      {s.suffix && <small>{s.suffix}</small>}\n                    </span>\n                    {s.caption && <span className=\"hb-ka8-cap\">{s.caption}</span>}\n                  </div>\n                </div>\n                <h3 className=\"hb-ka8-label\">{s.label}</h3>\n                {s.description && <p className=\"hb-ka8-desc\">{s.description}</p>}\n              </li>\n            );\n          })}\n        </ul>\n        {footnote && <p className=\"hb-ka8-foot\">{footnote}</p>}\n      </div>\n    </section>\n  );\n}\n"
    }
  ]
}