{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "scheduler-week",
  "title": "Week scheduler",
  "description": "Drag-and-drop week calendar with resize, drag-to-create and recurring events.",
  "dependencies": [],
  "registryDependencies": [
    "https://goodui.dev/r/scheduler.json"
  ],
  "files": [
    {
      "path": "registry/blocks/scheduling/scheduler-week.tsx",
      "content": "\"use client\"\n\nimport * as React from \"react\"\nimport { Scheduler, type SlotgridEvent } from \"@/components/slotgrid/scheduler\"\nimport { addDays, startOfWeek } from \"@/components/slotgrid/core\"\n\nconst COLORS = { blue: \"#3b82f6\", violet: \"#8b5cf6\", emerald: \"#10b981\", amber: \"#f59e0b\", rose: \"#f43f5e\" }\n\nfunction seed(): SlotgridEvent[] {\n  const monday = startOfWeek(new Date(), 1)\n  const at = (day: number, h: number, m = 0) => {\n    const d = addDays(monday, day)\n    d.setHours(h, m, 0, 0)\n    return d\n  }\n  return [\n    { id: \"standup\", title: \"Team standup\", start: at(0, 9), end: at(0, 9, 15), color: COLORS.blue, recurrence: { freq: \"weekly\", byWeekday: [1, 2, 3, 4, 5] } },\n    { id: \"1\", title: \"Haircut · Emma Clarke\", start: at(0, 10), end: at(0, 11), color: COLORS.violet },\n    { id: \"2\", title: \"Color & style · Mia Wong\", start: at(0, 10, 30), end: at(0, 12, 30), color: COLORS.rose },\n    { id: \"3\", title: \"Consultation · Noah Patel\", start: at(1, 13), end: at(1, 14), color: COLORS.emerald },\n    { id: \"4\", title: \"Beard trim · Leo Garcia\", start: at(1, 15), end: at(1, 15, 45), color: COLORS.violet },\n    { id: \"5\", title: \"Yoga class (12 spots)\", start: at(2, 18), end: at(2, 19, 30), color: COLORS.amber },\n    { id: \"6\", title: \"Physio · Ava Johnson\", start: at(3, 11), end: at(3, 11, 45), color: COLORS.emerald },\n    { id: \"7\", title: \"Room 2 · Workshop\", start: at(3, 14), end: at(3, 17), color: COLORS.blue },\n    { id: \"8\", title: \"Quarterly review\", start: at(4, 15), end: at(4, 16, 30), color: COLORS.rose },\n    { id: \"9\", title: \"Trade show\", start: at(2, 0), end: at(4, 0), allDay: true, color: COLORS.amber },\n  ]\n}\n\nexport default function SchedulerWeek() {\n  // Demo data is anchored to the current week, so it is created after mount (not during prerender).\n  const [events, setEvents] = React.useState<SlotgridEvent[]>([])\n  React.useEffect(() => setEvents(seed()), [])\n\n  return (\n    <div className=\"p-4 md:p-6\">\n      <Scheduler\n        events={events}\n        defaultView=\"week\"\n        height={680}\n        onEventChange={({ event, start, end }) =>\n          setEvents((list) => list.map((e) => (e.id === event.id ? { ...e, start, end } : e)))\n        }\n        onSlotSelect={({ start, end, allDay }) =>\n          setEvents((list) => [...list, { id: crypto.randomUUID(), title: \"New booking\", start, end, allDay, color: COLORS.emerald }])\n        }\n      />\n    </div>\n  )\n}\n",
      "type": "registry:component",
      "target": "components/goodui/scheduler-week.tsx"
    }
  ],
  "categories": [
    "scheduling"
  ],
  "type": "registry:block"
}