{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "heat-calendar-demo",
  "title": "Heat Calendar Demo",
  "description": "A worked example of Heat Calendar: A year of daily counts laid out as weeks, with a tooltip on every day and arrow keys that move through them.",
  "registryDependencies": [
    "https://ui.tinkererslabs.com/r/heat-calendar.json"
  ],
  "files": [
    {
      "path": "components/demos/heat-calendar-demo.tsx",
      "content": "\"use client\"\n\nimport {\n  HeatCalendar,\n  type HeatCalendarDay,\n} from \"@/registry/default/heat-calendar/heat-calendar\"\n\nconst END = Date.UTC(2026, 10, 1)\n\nfunction commits(): HeatCalendarDay[] {\n  let seed = 7\n  const random = () => {\n    seed = (seed * 16807) % 2147483647\n    return seed / 2147483647\n  }\n\n  return Array.from({ length: 365 }, (_, index) => {\n    const time = END - (364 - index) * 86_400_000\n    const weekday = new Date(time).getUTCDay()\n    const weekend = weekday === 0 || weekday === 6\n    const holiday = index > 270 && index < 284\n    const roll = random()\n    const count =\n      holiday || roll < (weekend ? 0.7 : 0.15)\n        ? 0\n        : Math.round(random() * (weekend ? 3 : 9) + (index / 365) * 4)\n\n    return { date: new Date(time).toISOString().slice(0, 10), count }\n  })\n}\n\nconst days = commits()\nconst total = days.reduce((sum, day) => sum + day.count, 0)\n\nexport function HeatCalendarDemo() {\n  return (\n    <div className=\"bg-card text-card-foreground border-border w-full max-w-[52rem] min-w-0 rounded-xl border p-4 md:p-6\">\n      <h3 className=\"text-sm font-medium\">\n        {total.toLocaleString(\"en-US\")} commits in the last year\n      </h3>\n      <p className=\"text-muted-foreground mt-1 mb-4 text-sm\">\n        Hover a day, or tab in and use the arrow keys.\n      </p>\n      <HeatCalendar\n        data={days}\n        end=\"2026-11-01\"\n        label=\"Commits per day\"\n        locale=\"en-US\"\n        unit={{ one: \"commit\", other: \"commits\" }}\n      />\n    </div>\n  )\n}\n",
      "type": "registry:example"
    }
  ],
  "type": "registry:example"
}