{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "request-heatmap",
  "title": "Request Heatmap",
  "type": "registry:component",
  "description": "Hour by weekday grid that fills on a diagonal wave",
  "dependencies": [
    "motion@^12.43.0"
  ],
  "files": [
    {
      "path": "src/kavyn/request-heatmap.jsx",
      "type": "registry:file",
      "target": "@components/kavyn/request-heatmap.jsx",
      "content": "'use client'\n\nimport { useMemo, useState } from 'react'\nimport { motion } from 'motion/react'\n\nconst DAYS = ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun']\n\n// Requests by hour and weekday. Cells fill in on a diagonal wave; hover reads the value.\nexport default function RequestHeatmap({ title = 'Requests by hour' }) {\n  const [on, setOn] = useState(null)\n  const grid = useMemo(() => DAYS.map((_, d) => Array.from({ length: 24 }, (_, h) => {\n    const work = h >= 9 && h <= 20 ? 1 : 0.25\n    const wk = d >= 5 ? 0.55 : 1\n    return Math.min(1, work * wk * (0.55 + 0.45 * Math.sin((h / 24) * Math.PI)) + ((h * 7 + d * 13) % 10) / 40)\n  })), [])\n  const cell = on ? grid[on[0]][on[1]] : null\n  return (\n    <div className=\"w-[440px] max-w-full rounded-2xl border border-line bg-panel p-4\">\n      <div className=\"mb-3 flex items-center justify-between text-xs\">\n        <span className=\"text-tx\">{title}</span>\n        <span className=\"font-mono text-mute\">{cell !== null ? `${DAYS[on[0]]} ${String(on[1]).padStart(2, '0')}:00 · ${(cell * 48).toFixed(1)}k` : 'last 7 days'}</span>\n      </div>\n      <div className=\"grid gap-[3px]\" onMouseLeave={() => setOn(null)}>\n        {grid.map((row, d) => (\n          <div key={d} className=\"grid grid-cols-[28px_repeat(24,1fr)] items-center gap-[3px]\">\n            <span className=\"text-[10px] text-faint\">{DAYS[d]}</span>\n            {row.map((v, h) => (\n              <motion.span key={h} onMouseEnter={() => setOn([d, h])}\n                initial={{ opacity: 0, scale: 0.4 }} animate={{ opacity: 1, scale: on && on[0] === d && on[1] === h ? 1.35 : 1 }}\n                transition={{ delay: on ? 0 : (d + h) * 0.012, type: 'spring', stiffness: 400, damping: 26 }}\n                className=\"aspect-square rounded-[3px]\" style={{ backgroundColor: `color-mix(in oklab, var(--acc) ${Math.round(6 + v * 85)}%, var(--panel))` }} />\n            ))}\n          </div>\n        ))}\n      </div>\n      <div className=\"mt-2 grid grid-cols-[28px_1fr] font-mono text-[9px] text-faint\"><span /><div className=\"flex justify-between\"><span>00</span><span>06</span><span>12</span><span>18</span><span>23</span></div></div>\n    </div>\n  )\n}\n"
    }
  ],
  "cssVars": {
    "theme": {
      "color-bg": "var(--bg)",
      "color-panel": "var(--panel)",
      "color-panel2": "var(--panel2)",
      "color-line": "var(--line)",
      "color-line2": "var(--line2)",
      "color-tx": "var(--tx)",
      "color-mute": "var(--mute)",
      "color-faint": "var(--faint)",
      "color-acc": "var(--acc)",
      "color-acc-fg": "var(--acc-fg)"
    },
    "light": {
      "bg": "#ffffff",
      "panel": "#f5f5f7",
      "panel2": "#e8e8ed",
      "line": "#e5e5ea",
      "line2": "#d2d2d7",
      "tx": "#1d1d1f",
      "mute": "#6e6e73",
      "faint": "#a1a1a6",
      "acc": "#1d1d1f",
      "acc-fg": "#ffffff"
    },
    "dark": {
      "bg": "#000000",
      "panel": "#141416",
      "panel2": "#1f1f22",
      "line": "#262628",
      "line2": "#3a3a3d",
      "tx": "#f5f5f7",
      "mute": "#a1a1a6",
      "faint": "#6e6e73",
      "acc": "#f5f5f7",
      "acc-fg": "#000000"
    }
  },
  "css": {
    ".light": {
      "--bg": "#ffffff",
      "--panel": "#f5f5f7",
      "--panel2": "#e8e8ed",
      "--line": "#e5e5ea",
      "--line2": "#d2d2d7",
      "--tx": "#1d1d1f",
      "--mute": "#6e6e73",
      "--faint": "#a1a1a6",
      "--acc": "#1d1d1f",
      "--acc-fg": "#ffffff"
    }
  }
}
