{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "stats-band",
  "title": "Stats Band",
  "type": "registry:block",
  "files": [
    {
      "path": "packages/registry-react/blocks/stats-band/StatsBand.tsx",
      "content": "'use client'\n\nimport * as React from 'react'\nimport { Check, Clock, Copy, Globe, ShieldCheck, TrendingUp, Users, Zap } from 'lucide-react'\nimport { Badge } from '@/components/ui/badge'\nimport { Button } from '@/components/ui/button'\nimport { cn } from '@/lib/utils'\n\nexport interface StatsBandProps {\n  variant?: 'plain' | 'bordered'\n}\n\ntype Timeframe = 'realtime' | '24h' | '7d' | '30d'\n\ninterface MetricData {\n  id: string\n  label: string\n  subtitle: string\n  values: Record<Timeframe, { main: string; change: string; isPositive: boolean; note: string }>\n  icon: React.ElementType\n  breakdown: { region: string; val: string; status: string }[]\n}\n\nconst stats: MetricData[] = [\n  {\n    id: 'uptime',\n    label: 'Platform Availability',\n    subtitle: 'Multi-region Active-Active SLA',\n    icon: ShieldCheck,\n    values: {\n      realtime: { main: '100.00%', change: '0 incident in 90d', isPositive: true, note: 'Zero degradation' },\n      '24h': { main: '99.95%', change: '+0.001%', isPositive: true, note: '100% healthy' },\n      '7d': { main: '99.995%', change: '+0.005%', isPositive: true, note: 'Target > 99.99%' },\n      '30d': { main: '99.988%', change: '+0.02%', isPositive: true, note: 'Statutory SLA met' },\n    },\n    breakdown: [\n      { region: 'us-east-1 (N. Virginia)', val: '100.0%', status: 'Operational' },\n      { region: 'eu-west-1 (Frankfurt)', val: '100.0%', status: 'Operational' },\n      { region: 'ap-southeast-1 (Singapore)', val: '100.0%', status: 'Operational' },\n      { region: 'sa-east-1 (São Paulo)', val: '99.99%', status: 'Operational' },\n    ],\n  },\n  {\n    id: 'throughput',\n    label: 'Component Installs & Pulls',\n    subtitle: 'Daily registry resolutions',\n    icon: Zap,\n    values: {\n      realtime: { main: '1.42M', change: '+34.2k / hr', isPositive: true, note: 'Peak throughput' },\n      '24h': { main: '3.89M', change: '+22.4% vs prev', isPositive: true, note: '320k unique repos' },\n      '7d': { main: '26.4M', change: '+18.8%', isPositive: true, note: '1.4k new teams' },\n      '30d': { main: '104.2M', change: '+41.0%', isPositive: true, note: 'Global scale' },\n    },\n    breakdown: [\n      { region: 'Vue 3.5 / Nuxt 4 Core', val: '58.2%', status: 'Dominant' },\n      { region: 'React 19 / Next.js Mirror', val: '41.8%', status: 'Growing' },\n      { region: 'Direct CLI Installations', val: '88.4%', status: 'Automated' },\n      { region: 'Manual Source Downloads', val: '11.6%', status: 'Direct' },\n    ],\n  },\n  {\n    id: 'latency',\n    label: 'Global Edge P99 Latency',\n    subtitle: 'Cloudflare Workers cache hits',\n    icon: Clock,\n    values: {\n      realtime: { main: '12ms', change: '-4ms reduction', isPositive: true, note: 'Global median: 8ms' },\n      '24h': { main: '14ms', change: '-2ms vs baseline', isPositive: true, note: '99.9% cache hit' },\n      '7d': { main: '16ms', change: '-12ms optimization', isPositive: true, note: 'Zero edge cold-starts' },\n      '30d': { main: '18ms', change: '-24ms', isPositive: true, note: 'V4 pipeline rollout' },\n    },\n    breakdown: [\n      { region: 'North America (Edge)', val: '9ms', status: 'Fastest' },\n      { region: 'Europe (Edge)', val: '11ms', status: 'Optimal' },\n      { region: 'Asia-Pacific (Edge)', val: '14ms', status: 'Optimal' },\n      { region: 'Latin America (Edge)', val: '18ms', status: 'Optimal' },\n    ],\n  },\n  {\n    id: 'satisfaction',\n    label: 'Enterprise Developer NPS',\n    subtitle: 'Surveyed across 450+ companies',\n    icon: Users,\n    values: {\n      realtime: { main: '+78', change: 'Top 1% dev tools', isPositive: true, note: 'Verified feedback' },\n      '24h': { main: '4.94 / 5', change: '99.2% positive', isPositive: true, note: 'From 1,240 ratings' },\n      '7d': { main: '+76', change: '+4 pts vs qtr', isPositive: true, note: '98% retention' },\n      '30d': { main: '+74', change: '+12 pts YoY', isPositive: true, note: 'Industry benchmark' },\n    },\n    breakdown: [\n      { region: 'Code Quality & Typing', val: '99.6%', status: '5 Stars' },\n      { region: 'Zero-Lockin Ownership', val: '98.8%', status: '5 Stars' },\n      { region: 'Visual Design Aesthetics', val: '99.2%', status: '5 Stars' },\n      { region: 'Documentation & Demos', val: '97.4%', status: '4.9 Stars' },\n    ],\n  },\n]\n\nexport function StatsBand({ variant = 'bordered' }: StatsBandProps) {\n  const [selectedTimeframe, setSelectedTimeframe] = React.useState<Timeframe>('realtime')\n  const [activeStatIndex, setActiveStatIndex] = React.useState<number | null>(null)\n  const [copied, setCopied] = React.useState(false)\n\n  const copyStatsPayload = () => {\n    navigator.clipboard.writeText(JSON.stringify(stats, null, 2))\n    setCopied(true)\n    setTimeout(() => setCopied(false), 2000)\n  }\n\n  return (\n    <section\n      data-slot=\"stats-band\"\n      className={cn(\n        'bg-card relative w-full overflow-hidden',\n        variant === 'bordered' ? 'border-border rounded-2xl border shadow-xs' : '',\n      )}\n    >\n      {/* Top Telemetry Header Bar */}\n      <div className=\"border-border bg-muted/20 flex flex-col justify-between gap-4 border-b px-6 py-4 sm:flex-row sm:items-center\">\n        <div className=\"flex items-center gap-2.5\">\n          <div className=\"bg-success flex size-2.5 animate-pulse rounded-full\" />\n          <span className=\"text-foreground font-mono text-xs font-semibold tracking-wider uppercase\">\n            Real-time Telemetry & Performance Matrix\n          </span>\n          <Badge\n            variant=\"outline\"\n            className=\"border-success/20 bg-success/10 text-success text-success hidden font-mono text-xs sm:inline-flex\"\n          >\n            All Systems Operational\n          </Badge>\n        </div>\n\n        <div className=\"flex items-center gap-2 self-end sm:self-auto\">\n          {/* Timeframe Selectors */}\n          <div className=\"bg-background border-border flex items-center rounded-lg border p-0.5\">\n            {[\n              { id: 'realtime', label: 'Live P99' },\n              { id: '24h', label: '24H' },\n              { id: '7d', label: '7D' },\n              { id: '30d', label: '30D' },\n            ].map((tf) => (\n              <button\n                key={tf.id}\n                type=\"button\"\n                className={cn(\n                  'rounded px-2.5 py-1 font-mono text-xs transition-colors',\n                  selectedTimeframe === tf.id\n                    ? 'bg-primary text-primary-foreground font-semibold shadow-xs'\n                    : 'text-muted-foreground hover:text-foreground',\n                )}\n                onClick={() => setSelectedTimeframe(tf.id as any)}\n              >\n                {tf.label}\n              </button>\n            ))}\n          </div>\n\n          <Button variant=\"outline\" size=\"sm\" className=\"h-7 gap-1.5 px-2 font-mono text-xs\" onClick={copyStatsPayload}>\n            {copied ? <Check className=\"text-success size-3\" /> : <Copy className=\"size-3\" />}\n            <span>{copied ? 'Copied' : 'JSON'}</span>\n          </Button>\n        </div>\n      </div>\n\n      {/* 4-Column KPI Metric Cards */}\n      <div className=\"divide-border grid grid-cols-1 divide-y sm:grid-cols-2 sm:divide-x sm:divide-y-0 lg:grid-cols-4\">\n        {stats.map((item, idx) => {\n          const Icon = item.icon\n          const isSelected = activeStatIndex === idx\n          return (\n            <div\n              key={item.id}\n              className={cn(\n                'hover:bg-muted/30 group relative cursor-pointer p-6 transition-colors',\n                isSelected ? 'bg-muted/40 ring-primary/30 ring-1 ring-inset' : '',\n              )}\n              onClick={() => setActiveStatIndex(isSelected ? null : idx)}\n            >\n              <div className=\"flex items-start justify-between\">\n                <p className=\"text-muted-foreground font-mono text-xs tracking-wider uppercase\">{item.label}</p>\n                <Icon className=\"text-muted-foreground group-hover:text-primary size-4 transition-colors\" />\n              </div>\n\n              <div className=\"mt-3 flex items-baseline gap-2\">\n                <span className=\"text-foreground font-mono text-3xl font-bold tracking-tight\">\n                  {item.values[selectedTimeframe].main}\n                </span>\n              </div>\n\n              <p className=\"text-muted-foreground mt-1 line-clamp-1 text-xs\">{item.subtitle}</p>\n\n              <div className=\"border-border/60 mt-4 flex items-center justify-between border-t pt-3\">\n                <span className=\"text-success inline-flex items-center gap-1 font-mono text-xs font-medium\">\n                  <TrendingUp className=\"size-3\" />\n                  {item.values[selectedTimeframe].change}\n                </span>\n                <span className=\"text-muted-foreground font-mono text-xs\">{item.values[selectedTimeframe].note}</span>\n              </div>\n            </div>\n          )\n        })}\n      </div>\n\n      {/* Telemetry Regional Drilldown Drawer when a card is selected */}\n      {activeStatIndex !== null && (\n        <div className=\"bg-muted/20 border-border space-y-4 border-t p-6\">\n          <div className=\"flex items-center justify-between\">\n            <div className=\"flex items-center gap-2\">\n              <Globe className=\"text-primary size-4\" />\n              <span className=\"text-foreground text-xs font-semibold\">\n                Regional Telemetry & Infrastructure Breakdown: {stats[activeStatIndex].label}\n              </span>\n            </div>\n            <Button variant=\"ghost\" size=\"sm\" className=\"h-6 text-xs\" onClick={() => setActiveStatIndex(null)}>\n              Close Breakdown\n            </Button>\n          </div>\n\n          <div className=\"grid grid-cols-1 gap-3 sm:grid-cols-2 lg:grid-cols-4\">\n            {stats[activeStatIndex].breakdown.map((sub) => (\n              <div\n                key={sub.region}\n                className=\"border-border bg-background flex items-center justify-between rounded-lg border p-3 shadow-xs\"\n              >\n                <div>\n                  <p className=\"text-foreground text-xs font-medium\">{sub.region}</p>\n                  <p className=\"text-muted-foreground mt-0.5 font-mono text-xs\">{sub.status}</p>\n                </div>\n                <span className=\"text-success font-mono text-xs font-bold\">{sub.val}</span>\n              </div>\n            ))}\n          </div>\n        </div>\n      )}\n    </section>\n  )\n}\nexport default StatsBand\n",
      "type": "registry:block",
      "target": "~/components/blocks/StatsBand.tsx"
    }
  ],
  "dependencies": [
    "lucide-react"
  ],
  "devDependencies": [],
  "registryDependencies": [
    "https://uipkge.dev/r/react/badge.json",
    "https://uipkge.dev/r/react/button.json"
  ],
  "description": "Interactive live telemetry and performance matrix band with multi-timeframe switching, real-time SLA verification, regional cluster drilldown, and JSON export.",
  "categories": [
    "marketing"
  ]
}