{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "pulse-demo",
  "type": "registry:block",
  "title": "Pulse: Live Regions",
  "description": "Live Data Dot Grid Background example, Live Regions: An inference platform's hero where requests land as small rings labelled with their region and deploys as orange ones, ticking the counter below. A take on the animated background (backdrop). Fits hero, CTA and stats sections.",
  "author": "KeyframeUI <https://keyframeui.com>",
  "categories": [
    "hero",
    "cta",
    "stats",
    "animated-background",
    "chart",
    "map",
    "background",
    "data",
    "canvas"
  ],
  "docs": "Live preview, examples and props: https://keyframeui.com/components/pulse#pulse-demo",
  "registryDependencies": [
    "https://keyframeui.com/r/pulse.json"
  ],
  "files": [
    {
      "path": "components/pulse-demo.tsx",
      "type": "registry:component",
      "content": "\"use client\";\n\nimport * as React from \"react\";\n\nimport { Pulse, type PulseEvent } from \"@/components/ui/pulse\";\n\n// Rough spots on a flattened world map, squeezed a little so nothing sits on the very edge.\nconst REGIONS = [\n  { code: \"sfo1\", x: 0.16, y: 0.28 },\n  { code: \"iad1\", x: 0.28, y: 0.27 },\n  { code: \"gru1\", x: 0.37, y: 0.7 },\n  { code: \"lhr1\", x: 0.49, y: 0.19 },\n  { code: \"fra1\", x: 0.53, y: 0.21 },\n  { code: \"bom1\", x: 0.7, y: 0.42 },\n  { code: \"sin1\", x: 0.79, y: 0.55 },\n  { code: \"syd1\", x: 0.91, y: 0.76 },\n  { code: \"nrt1\", x: 0.88, y: 0.3 },\n] as const;\n\nconst MODELS = [\"ranker-v4\", \"embed-small\", \"vision-2\", \"router-mini\"];\nconst TEAMS = [\"Okto Health\", \"Field & Fold\", \"Harbor Labs\", \"Tinta Studio\", \"Northwind Ops\"];\n\ntype Line = { kind: \"Inference\" | \"Deploy\" | \"New team\"; region: string; detail: string };\n\nlet nextId = 0;\n\nfunction makeEvent(): { event: PulseEvent; line: Line; batch: number } {\n  const region = REGIONS[Math.floor(Math.random() * REGIONS.length)];\n  const jitter = () => (Math.random() - 0.5) * 0.03;\n  const roll = Math.random();\n  const id = `ev-${nextId++}`;\n  const at = { x: region.x + jitter(), y: region.y + jitter(), label: region.code };\n  if (roll < 0.1) {\n    const model = MODELS[Math.floor(Math.random() * MODELS.length)];\n    return {\n      event: { id, ...at, strength: 0.95, tone: \"accent\" },\n      line: { kind: \"Deploy\", region: region.code, detail: `${model} live` },\n      batch: 0,\n    };\n  }\n  if (roll < 0.18) {\n    const team = TEAMS[Math.floor(Math.random() * TEAMS.length)];\n    return {\n      event: { id, ...at, strength: 0.75, tone: \"accent\" },\n      line: { kind: \"New team\", region: region.code, detail: team },\n      batch: 0,\n    };\n  }\n  const ms = 18 + Math.round(Math.random() * 60);\n  return {\n    event: { id, ...at, strength: 0.25 + Math.random() * 0.3, tone: \"ink\" },\n    line: { kind: \"Inference\", region: region.code, detail: `${ms} ms` },\n    batch: 40 + Math.floor(Math.random() * 160),\n  };\n}\n\nexport function PulseDemo() {\n  const [events, setEvents] = React.useState<PulseEvent[]>([]);\n  const [served, setServed] = React.useState(1_284_906);\n  const [line, setLine] = React.useState<Line>({ kind: \"Inference\", region: \"fra1\", detail: \"41 ms\" });\n\n  // A stand-in for a websocket: one event every 300–1400ms.\n  React.useEffect(() => {\n    let timer = 0;\n    const tick = () => {\n      const next = makeEvent();\n      setEvents((list) => [...list.slice(-11), next.event]);\n      setServed((n) => n + next.batch);\n      setLine(next.line);\n      timer = window.setTimeout(tick, 300 + Math.random() * 1100);\n    };\n    timer = window.setTimeout(tick, 500);\n    return () => window.clearTimeout(timer);\n  }, []);\n\n  return (\n    <Pulse\n      events={events}\n      className=\"flex h-[var(--demo-height,36rem)] w-full flex-col rounded-2xl border border-border bg-background text-foreground\"\n    >\n      {/* Keeps the copy readable while rings run under it. */}\n      <div\n        aria-hidden\n        className=\"pointer-events-none absolute inset-0 bg-[radial-gradient(ellipse_80%_34%_at_50%_50%,var(--background)_45%,transparent)] sm:bg-[radial-gradient(ellipse_40%_44%_at_50%_50%,var(--background)_30%,transparent)]\"\n      />\n\n      <div className=\"relative flex flex-1 flex-col items-center justify-center px-6 text-center\">\n        <h2 className=\"max-w-[16ch] text-4xl/[1.05] font-semibold tracking-tight text-balance sm:text-6xl/[1.02]\">\n          Inference that runs where your users are\n        </h2>\n        <p className=\"mt-5 max-w-md text-base/7 text-pretty text-muted-foreground\">\n          Lumbra routes every call to the closest free GPU. Each ring behind this text is traffic\n          landing in one of our regions right now.\n        </p>\n        <div className=\"mt-8 flex flex-wrap items-center justify-center gap-3\">\n          <a\n            href=\"https://lumbra.example/signup\"\n            className=\"inline-flex h-11 items-center rounded-full bg-foreground px-5 text-sm font-medium text-background transition-opacity hover:opacity-85\"\n          >\n            Start building\n          </a>\n          <a\n            href=\"https://lumbra.example/regions\"\n            className=\"inline-flex h-11 items-center rounded-full border border-border bg-background px-5 text-sm font-medium transition-colors hover:bg-muted\"\n          >\n            See regions\n          </a>\n        </div>\n      </div>\n\n      <div className=\"relative flex flex-col gap-1 border-t border-border bg-background/90 px-5 py-3 text-xs sm:flex-row sm:items-center sm:justify-between\">\n        <p className=\"text-muted-foreground\">\n          <span className=\"font-medium text-foreground tabular-nums\">{served.toLocaleString(\"en-US\")}</span>{\" \"}\n          requests served today\n        </p>\n        <p className=\"truncate font-mono text-muted-foreground\">\n          <span className={line.kind === \"Inference\" ? \"text-foreground\" : \"text-[#e64a12] dark:text-[#ff6a3d]\"}>\n            {line.kind}\n          </span>\n          {\" · \"}\n          {line.region}\n          {\" · \"}\n          {line.detail}\n        </p>\n      </div>\n    </Pulse>\n  );\n}\n"
    }
  ]
}