feat(activity-heatmap): add activity heatmap component

Merged
SY
2d ago
+1681-2

What and why

Adds the activity-heatmap component for displaying calendar activity and contributions over a year on a grid of weeks by weekdays.

  • Pure calendar arithmetic and layout in registry/default/lib/activity-heatmap.ts calculated in UTC to prevent time-zone shifts.
  • Accessible WAI-ARIA grid pattern with roving tabindex, 2D arrow key navigation, Home/End/PageUp/PageDown, Enter, and Space selection.
  • Intensity levels 0 to 4 mapped from counts using theme tokens (bg-muted/40 through bg-primary).
  • Header text summary and bottom intensity legend with range display.
  • Controlled and uncontrolled selection support with selectedDate, defaultSelectedDate, and onDaySelect.
  • Full docs, previews, interactive examples, and unit/UI test suites across Radix and Base UI environments.

Closes #46

Checklist

  • bun run typecheck, bun run lint and bun run test pass
  • Tests cover the change, including keyboard interaction for UI components
  • New components are added to registry.json, lib/catalog.ts, components/docs/preview-registry.tsx and lib/agent-docs/component-usage.ts, each at its alphabetical position
  • Checked in light and dark mode