{
  "name": "calendar-heatmap",
  "type": "ui:component",
  "title": "CalendarHeatmap",
  "description": "Activity and contribution density heatmap grid using OKLCH primary intensity stops.",
  "dependencies": [],
  "registryDependencies": [
    "theme"
  ],
  "files": [
    {
      "path": "src/ui/calendar-heatmap.tsx",
      "target": "src/ui/calendar-heatmap.tsx",
      "sha256": "dd5b731ba06f1a080bcdb2a202165946ecd07d21f01e3002b7e2be434d0be980",
      "content": "import './theme.css';\nimport { scope } from '@fierst/aster';\n\nconst hmScope = scope`\n  :scope { display: grid; gap: 0.5rem; font-family: var(--aster-font-sans); overflow-x: auto; }\n  .hm-grid { display: grid; grid-template-rows: repeat(7, 12px); grid-auto-flow: column; grid-auto-columns: 12px; gap: 3px; }\n  .hm-cell {\n    width: 12px;\n    height: 12px;\n    border-radius: 2px;\n    background: var(--aster-surface-muted);\n    border: 1px solid var(--aster-border);\n  }\n  .hm-cell.l-1 { background: color-mix(in srgb, var(--aster-primary) 24%, var(--aster-surface)); border-color: transparent; }\n  .hm-cell.l-2 { background: color-mix(in srgb, var(--aster-primary) 50%, var(--aster-surface)); border-color: transparent; }\n  .hm-cell.l-3 { background: color-mix(in srgb, var(--aster-primary) 76%, var(--aster-surface)); border-color: transparent; }\n  .hm-cell.l-4 { background: var(--aster-primary); border-color: transparent; }\n  .hm-legend { display: flex; align-items: center; justify-content: flex-end; gap: 4px; font-size: 0.72rem; color: var(--aster-on-surface-subtle); }\n`;\n\nexport function CalendarHeatmap({\n  values,\n  label = 'Activity heatmap',\n  class: extraClass,\n}: {\n  /** Array of { date, count } entries (typically 7 * weeks). */\n  values: readonly { date: string; count: number }[];\n  label?: string;\n  class?: string;\n}) {\n  const max = Math.max(...values.map((v) => v.count), 1);\n  const level = (count: number) => {\n    if (count <= 0) return 0;\n    const ratio = count / max;\n    if (ratio <= 0.25) return 1;\n    if (ratio <= 0.5) return 2;\n    if (ratio <= 0.75) return 3;\n    return 4;\n  };\n\n  return (\n    <div class={[hmScope, extraClass].filter(Boolean).join(' ')} role=\"img\" aria-label={label}>\n      <div class=\"hm-grid\">\n        {values.map((item) => (\n          <span\n            key={item.date}\n            class={`hm-cell l-${level(item.count)}`}\n            title={`${item.date}: ${item.count}`}\n          />\n        ))}\n      </div>\n      <div class=\"hm-legend\" aria-hidden=\"true\">\n        <span>Less</span>\n        {[0, 1, 2, 3, 4].map((l) => (\n          <span key={l} class={`hm-cell l-${l}`} />\n        ))}\n        <span>More</span>\n      </div>\n    </div>\n  );\n}\n"
    }
  ]
}
