{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "proof-live-activity",
  "type": "registry:component",
  "title": "Live Activity Proof",
  "description": "A light social proof section pairing a rating summary with a live feed of recent sign ups. New activity toasts slide in at the top every few seconds while older ones drift down and fade.",
  "author": "Hyperblur <hello@hyperblur.dev>",
  "dependencies": [],
  "registryDependencies": [],
  "categories": [
    "social-proof",
    "social proof",
    "live",
    "toasts",
    "rating",
    "activity",
    "light"
  ],
  "docs": "https://hyperblur.dev/effects/proof-live-activity",
  "files": [
    {
      "path": "registry/hyperblur/proof-live-activity.tsx",
      "type": "registry:component",
      "target": "components/hyperblur/proof-live-activity.tsx",
      "content": "\"use client\";\n\nimport * as React from \"react\";\n\nexport interface ProofActivity {\n  name: string;\n  city: string;\n  action: string;\n  time: string;\n  color?: string;\n}\n\nexport interface ProofRatingSource {\n  name: string;\n  score: number;\n}\n\nexport interface ProofLiveActivityProps extends Omit<React.HTMLAttributes<HTMLElement>, \"title\"> {\n  eyebrow?: string;\n  title?: string;\n  subtitle?: string;\n  rating?: number;\n  reviewCount?: string;\n  distribution?: number[];\n  sources?: ProofRatingSource[];\n  activities?: ProofActivity[];\n  liveLabel?: string;\n  interval?: number;\n  cta?: { label: string; href: string };\n  accent?: string;\n  onActivityChange?: (activity: ProofActivity, index: number) => void;\n}\n\nconst defaultActivities: ProofActivity[] = [\n  { name: \"Maya\", city: \"Lisbon\", action: \"just joined the Team plan\", time: \"now\", color: \"#f59e0b\" },\n  { name: \"Tobias\", city: \"Hamburg\", action: \"left a 5 star review\", time: \"1 min ago\", color: \"#10b981\" },\n  { name: \"Aiko\", city: \"Osaka\", action: \"invited 6 teammates\", time: \"2 min ago\", color: \"#6366f1\" },\n  { name: \"Lucas\", city: \"São Paulo\", action: \"upgraded to Pro yearly\", time: \"3 min ago\", color: \"#ef4444\" },\n  { name: \"Freya\", city: \"Copenhagen\", action: \"published her first board\", time: \"4 min ago\", color: \"#0ea5e9\" },\n  { name: \"Omar\", city: \"Dubai\", action: \"started a free trial\", time: \"6 min ago\", color: \"#8b5cf6\" },\n  { name: \"Clara\", city: \"Montréal\", action: \"connected Slack and Linear\", time: \"7 min ago\", color: \"#ec4899\" },\n];\n\nconst defaultSources: ProofRatingSource[] = [\n  { name: \"Stackrank\", score: 4.9 },\n  { name: \"Reviewly\", score: 4.8 },\n  { name: \"App Store\", score: 4.9 },\n];\n\nconst ROW = 74;\n\nconst css = `\n.hb-yj4 {\n  --hb-yj4-accent: #f59e0b;\n  position: relative;\n  box-sizing: border-box;\n  width: 100%;\n  overflow: hidden;\n  isolation: isolate;\n  container-type: inline-size;\n  background: #ffffff;\n  color: #111111;\n  font-family: inherit;\n  -webkit-font-smoothing: antialiased;\n}\n.hb-yj4 *, .hb-yj4 *::before, .hb-yj4 *::after { box-sizing: border-box; }\n.hb-yj4::before {\n  content: \"\";\n  position: absolute;\n  inset: 0;\n  z-index: -1;\n  background:\n    radial-gradient(40% 60% at 85% 50%, color-mix(in srgb, var(--hb-yj4-accent) 12%, transparent), transparent 70%),\n    radial-gradient(rgba(17, 17, 17, .06) 1px, transparent 1px) 0 0 / 20px 20px;\n  -webkit-mask: linear-gradient(90deg, transparent, #000 40%);\n  mask: linear-gradient(90deg, transparent, #000 40%);\n  pointer-events: none;\n}\n.hb-yj4-inner {\n  display: grid;\n  gap: 40px;\n  align-items: center;\n  max-width: 1120px;\n  margin: 0 auto;\n  padding: 72px 20px;\n}\n@container (min-width: 820px) {\n  .hb-yj4-inner { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 64px; padding: 104px 32px; }\n}\n.hb-yj4-eyebrow {\n  display: inline-flex;\n  align-items: center;\n  gap: 8px;\n  margin: 0 0 16px;\n  color: #6b6b6b;\n  font-size: 13px;\n  font-weight: 500;\n}\n.hb-yj4-eyebrow::before {\n  content: \"\";\n  width: 8px;\n  height: 8px;\n  border-radius: 50%;\n  background: #22c55e;\n  box-shadow: 0 0 0 4px rgba(34, 197, 94, .18);\n  animation: hb-yj4-pulse 2s ease-in-out infinite;\n}\n.hb-yj4-title {\n  margin: 0;\n  font-size: clamp(30px, 4.6cqw, 46px);\n  line-height: 1.05;\n  letter-spacing: -.035em;\n  font-weight: 650;\n  text-wrap: balance;\n}\n.hb-yj4-sub { margin: 16px 0 0; max-width: 460px; color: #5f5f5f; font-size: 16px; line-height: 1.6; }\n.hb-yj4-rating {\n  display: grid;\n  gap: 22px;\n  margin-top: 32px;\n  padding: 22px;\n  border: 1px solid rgba(17, 17, 17, .08);\n  border-radius: 18px;\n  background: linear-gradient(180deg, #fff, #fafafa);\n  box-shadow: 0 1px 0 #fff inset, 0 12px 32px -18px rgba(17, 17, 17, .25);\n}\n@container (min-width: 480px) { .hb-yj4-rating { grid-template-columns: auto minmax(0, 1fr); align-items: center; } }\n.hb-yj4-score { font-size: 56px; line-height: 1; letter-spacing: -.04em; font-weight: 650; font-variant-numeric: tabular-nums; }\n.hb-yj4-stars { display: flex; gap: 2px; margin-top: 8px; color: var(--hb-yj4-accent); }\n.hb-yj4-stars svg { width: 16px; height: 16px; }\n.hb-yj4-count { margin-top: 6px; color: #6b6b6b; font-size: 13px; }\n.hb-yj4-bars { display: grid; gap: 7px; }\n.hb-yj4-bar { display: grid; grid-template-columns: 14px minmax(0, 1fr) 36px; align-items: center; gap: 10px; color: #6b6b6b; font-size: 12px; font-variant-numeric: tabular-nums; }\n.hb-yj4-track { height: 7px; border-radius: 99px; background: rgba(17, 17, 17, .07); overflow: hidden; }\n.hb-yj4-fill {\n  height: 100%;\n  border-radius: inherit;\n  background: var(--hb-yj4-accent);\n  transform-origin: left;\n  animation: hb-yj4-grow 1.2s cubic-bezier(.2, .8, .2, 1) both;\n}\n.hb-yj4-sources { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }\n.hb-yj4-source {\n  display: inline-flex;\n  align-items: center;\n  gap: 8px;\n  padding: 7px 12px;\n  border: 1px solid rgba(17, 17, 17, .08);\n  border-radius: 999px;\n  background: #fff;\n  font-size: 13px;\n  font-weight: 500;\n}\n.hb-yj4-source b { color: #111; font-weight: 650; }\n.hb-yj4-source span { color: #6b6b6b; }\n.hb-yj4-feed {\n  position: relative;\n  padding: 18px;\n  border: 1px solid rgba(17, 17, 17, .08);\n  border-radius: 24px;\n  background: linear-gradient(180deg, #fafafa, #f3f3f1);\n  box-shadow: inset 0 1px 0 #fff;\n}\n.hb-yj4-feed-head {\n  display: flex;\n  align-items: center;\n  justify-content: space-between;\n  padding: 2px 4px 14px;\n  font-size: 13px;\n  font-weight: 600;\n}\n.hb-yj4-live {\n  display: inline-flex;\n  align-items: center;\n  gap: 6px;\n  padding: 4px 9px;\n  border-radius: 999px;\n  background: rgba(34, 197, 94, .12);\n  color: #15803d;\n  font-size: 11px;\n  font-weight: 600;\n  letter-spacing: .04em;\n  text-transform: uppercase;\n}\n.hb-yj4-live::before { content: \"\"; width: 6px; height: 6px; border-radius: 50%; background: currentColor; animation: hb-yj4-pulse 1.4s ease-in-out infinite; }\n.hb-yj4-stack {\n  position: relative;\n  overflow: hidden;\n  -webkit-mask: linear-gradient(180deg, #000 70%, transparent);\n  mask: linear-gradient(180deg, #000 70%, transparent);\n}\n.hb-yj4-toast {\n  position: absolute;\n  left: 0;\n  right: 0;\n  top: 0;\n  display: flex;\n  align-items: center;\n  gap: 12px;\n  height: 62px;\n  padding: 0 14px;\n  border: 1px solid rgba(17, 17, 17, .07);\n  border-radius: 14px;\n  background: #fff;\n  box-shadow: 0 1px 2px rgba(17, 17, 17, .04), 0 10px 24px -14px rgba(17, 17, 17, .2);\n  transition: transform .6s cubic-bezier(.2, .8, .2, 1), opacity .6s ease;\n}\n.hb-yj4-new { animation: hb-yj4-in .6s cubic-bezier(.2, .9, .3, 1.15) both; }\n.hb-yj4-av {\n  flex: none;\n  display: grid;\n  place-items: center;\n  width: 36px;\n  height: 36px;\n  border-radius: 50%;\n  color: #fff;\n  font-size: 14px;\n  font-weight: 650;\n}\n.hb-yj4-msg { min-width: 0; flex: 1; font-size: 13.5px; line-height: 1.3; }\n.hb-yj4-msg b, .hb-yj4-msg span, .hb-yj4-msg small { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }\n.hb-yj4-msg b { font-weight: 600; }\n.hb-yj4-msg span { color: #5f5f5f; }\n.hb-yj4-msg small { color: #9a9a9a; font-size: 11.5px; }\n.hb-yj4-check { flex: none; color: #22c55e; }\n.hb-yj4-foot {\n  display: flex;\n  justify-content: space-between;\n  align-items: center;\n  gap: 12px;\n  padding: 10px 4px 0;\n  color: #6b6b6b;\n  font-size: 13px;\n}\n.hb-yj4-foot a { color: #111; font-weight: 600; text-decoration: none; border-bottom: 1px solid rgba(17, 17, 17, .2); }\n.hb-yj4-foot a:hover { border-color: var(--hb-yj4-accent); }\n.hb-yj4-foot a:focus-visible { outline: 2px solid var(--hb-yj4-accent); outline-offset: 3px; }\n@keyframes hb-yj4-pulse { 50% { opacity: .45; } }\n@keyframes hb-yj4-grow { from { transform: scaleX(0); } }\n@keyframes hb-yj4-in { from { opacity: 0; transform: translateY(-24px) scale(.96); } }\n@media (prefers-reduced-motion: reduce) {\n  .hb-yj4 *, .hb-yj4 *::before, .hb-yj4 *::after { animation: none !important; transition: none !important; }\n}\n`;\n\nfunction Star() {\n  return (\n    <svg viewBox=\"0 0 20 20\" fill=\"currentColor\" aria-hidden=\"true\">\n      <path d=\"m10 1.8 2.5 5.1 5.6.8-4 4 1 5.5-5.1-2.6-5 2.6 1-5.5-4.1-4 5.6-.8Z\" />\n    </svg>\n  );\n}\n\nexport function ProofLiveActivity({\n  eyebrow = \"Happening right now\",\n  title = \"Joined by 12,000 teams this year, and counting\",\n  subtitle = \"From two person studios to scaling startups, people pick Relay to plan their week in one calm place.\",\n  rating = 4.9,\n  reviewCount = \"from 2,418 reviews\",\n  distribution = [86, 9, 3, 1, 1],\n  sources = defaultSources,\n  activities = defaultActivities,\n  liveLabel = \"142 sign ups this week\",\n  interval = 2600,\n  cta = { label: \"Start free\", href: \"#\" },\n  accent = \"#f59e0b\",\n  onActivityChange,\n  className,\n  style,\n  ...rest\n}: ProofLiveActivityProps) {\n  const [tick, setTick] = React.useState(0);\n  const [paused, setPaused] = React.useState(false);\n  const cb = React.useRef(onActivityChange);\n  const n = activities.length;\n\n  const acts = React.useRef(activities);\n\n  React.useEffect(() => {\n    cb.current = onActivityChange;\n    acts.current = activities;\n  }, [onActivityChange, activities]);\n\n  React.useEffect(() => {\n    if (paused || n < 2) return;\n    if (window.matchMedia(\"(prefers-reduced-motion: reduce)\").matches) return;\n    const id = window.setInterval(() => {\n      setTick((t) => t + 1);\n    }, Math.max(800, interval));\n    return () => window.clearInterval(id);\n  }, [paused, n, interval]);\n\n  React.useEffect(() => {\n    if (tick === 0 || n === 0) return;\n    cb.current?.(acts.current[tick % n], tick % n);\n  }, [tick, n]);\n\n  const visible = [0, 1, 2, 3, 4].map((k) => {\n    const abs = tick - k;\n    const idx = ((abs % n) + n) % n;\n    return { k, abs, item: activities[idx] };\n  });\n\n  return (\n    <section\n      className={[\"hb-yj4\", className].filter(Boolean).join(\" \")}\n      style={{ \"--hb-yj4-accent\": accent, ...style } as React.CSSProperties}\n      {...rest}\n    >\n      <style href=\"hb-proof-live-activity\" precedence=\"default\">{css}</style>\n      <div className=\"hb-yj4-inner\">\n        <div>\n          {eyebrow ? <p className=\"hb-yj4-eyebrow\">{eyebrow}</p> : null}\n          <h2 className=\"hb-yj4-title\">{title}</h2>\n          {subtitle ? <p className=\"hb-yj4-sub\">{subtitle}</p> : null}\n          <div className=\"hb-yj4-rating\">\n            <div>\n              <div className=\"hb-yj4-score\">{rating.toFixed(1)}</div>\n              <div className=\"hb-yj4-stars\" aria-label={`${rating.toFixed(1)} out of 5 stars`}>\n                {[0, 1, 2, 3, 4].map((i) => (\n                  <Star key={i} />\n                ))}\n              </div>\n              <div className=\"hb-yj4-count\">{reviewCount}</div>\n            </div>\n            <div className=\"hb-yj4-bars\">\n              {distribution.slice(0, 5).map((v, i) => (\n                <div className=\"hb-yj4-bar\" key={i}>\n                  <span>{5 - i}</span>\n                  <div className=\"hb-yj4-track\">\n                    <div className=\"hb-yj4-fill\" style={{ width: `${Math.max(0, Math.min(100, v)).toFixed(1)}%`, animationDelay: `${(i * 0.08).toFixed(2)}s` }} />\n                  </div>\n                  <span>{v}%</span>\n                </div>\n              ))}\n            </div>\n          </div>\n          {sources.length ? (\n            <div className=\"hb-yj4-sources\">\n              {sources.map((s) => (\n                <span className=\"hb-yj4-source\" key={s.name}>\n                  <b>{s.score.toFixed(1)}</b>\n                  <span>{s.name}</span>\n                </span>\n              ))}\n            </div>\n          ) : null}\n        </div>\n        <div className=\"hb-yj4-feed\" onPointerEnter={() => setPaused(true)} onPointerLeave={() => setPaused(false)}>\n          <div className=\"hb-yj4-feed-head\">\n            <span>Recent activity</span>\n            <span className=\"hb-yj4-live\">Live</span>\n          </div>\n          <div className=\"hb-yj4-stack\" style={{ height: ROW * 4 + 20 }} aria-live=\"polite\" aria-atomic=\"false\">\n            {visible.map(({ k, abs, item }) => (\n              <div\n                key={abs}\n                className={k === 0 && tick > 0 ? \"hb-yj4-toast hb-yj4-new\" : \"hb-yj4-toast\"}\n                style={{ transform: `translateY(${k * ROW}px) scale(${(1 - k * 0.03).toFixed(2)})`, opacity: k >= 4 ? 0 : 1 - k * 0.18 }}\n                aria-hidden={k !== 0}\n              >\n                <span className=\"hb-yj4-av\" style={{ background: item.color ?? accent }}>\n                  {item.name[0]}\n                </span>\n                <div className=\"hb-yj4-msg\">\n                  <b>\n                    {item.name} from {item.city}\n                  </b>\n                  <span>{item.action}</span>\n                  <small>{item.time}</small>\n                </div>\n                <svg className=\"hb-yj4-check\" width=\"18\" height=\"18\" viewBox=\"0 0 20 20\" fill=\"none\" aria-hidden=\"true\">\n                  <circle cx=\"10\" cy=\"10\" r=\"8\" fill=\"currentColor\" opacity=\".15\" />\n                  <path d=\"m6.5 10.2 2.3 2.3 4.7-4.8\" stroke=\"currentColor\" strokeWidth=\"1.8\" strokeLinecap=\"round\" strokeLinejoin=\"round\" />\n                </svg>\n              </div>\n            ))}\n          </div>\n          <div className=\"hb-yj4-foot\">\n            <span>{liveLabel}</span>\n            {cta ? <a href={cta.href}>{cta.label}</a> : null}\n          </div>\n        </div>\n      </div>\n    </section>\n  );\n}\n"
    }
  ]
}