feat(activity-heatmap): add activity heatmap component
Merged
SY
2d ago+1681+1681+0123456789012345678901234567890123456789-2-2-0123456789
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.tscalculated 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/40throughbg-primary). - Header text summary and bottom intensity legend with range display.
- Controlled and uncontrolled selection support with
selectedDate,defaultSelectedDate, andonDaySelect. - Full docs, previews, interactive examples, and unit/UI test suites across Radix and Base UI environments.
Closes #46
Checklist
-
bun run typecheck,bun run lintandbun run testpass - Tests cover the change, including keyboard interaction for UI components
- New components are added to
registry.json,lib/catalog.ts,components/docs/preview-registry.tsxandlib/agent-docs/component-usage.ts, each at its alphabetical position - Checked in light and dark mode