{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "scheduler",
  "title": "Scheduler",
  "author": "superzero11 <https://github.com/superzero11/uiset>",
  "description": "Calendars on UI SDK createSpans: a week, a day or a room timeline where people draw, move and resize events with the pointer or arrows, overlapping events sharing lanes, a month view, a toolbar, an event dialog, and agent actions.",
  "dependencies": [
    "@ui-sdk/core@0.1.0-beta.5",
    "@ui-sdk/react@0.1.0-beta.5"
  ],
  "registryDependencies": [
    "https://uiset.dev/r/uiset.json",
    "https://uiset.dev/r/alert-dialog.json",
    "https://uiset.dev/r/button.json",
    "https://uiset.dev/r/calendar.json",
    "https://uiset.dev/r/dialog.json",
    "https://uiset.dev/r/field.json",
    "https://uiset.dev/r/segmented-control.json",
    "https://uiset.dev/r/select.json"
  ],
  "files": [
    {
      "path": "registry/uiset/ui/scheduler.tsx",
      "content": "\"use client\"\n\nimport { pageLocale, stackSpans, type Span } from \"@ui-sdk/core\"\nimport { usePart, usePrimitive, type PartProps } from \"@ui-sdk/react/primitive\"\nimport { useEffect, useId, useMemo, useRef, useState, type CSSProperties, type FormEvent, type ReactNode } from \"react\"\nimport {\n  AlertDialog,\n  AlertDialogBackdrop,\n  AlertDialogClose,\n  AlertDialogContent,\n  AlertDialogDescription,\n  AlertDialogTitle,\n  AlertDialogTrigger,\n} from \"./alert-dialog\"\nimport { Button } from \"./button\"\nimport { Calendar, CalendarDay, CalendarGrid, CalendarWeekday, CalendarWeekdays, CalendarWeeks } from \"./calendar\"\nimport {\n  Dialog,\n  DialogBackdrop,\n  DialogClose,\n  DialogContent,\n  DialogDescription,\n  DialogTitle,\n} from \"./dialog\"\nimport { Field, FieldError, FieldLabel, Input } from \"./field\"\nimport { SegmentedControl, SegmentedControlItem } from \"./segmented-control\"\nimport { Select, SelectContent, SelectItem, SelectLabel, SelectTrigger } from \"./select\"\nimport { Icon } from \"./shell/icons\"\nimport {\n  clock,\n  createScheduleController,\n  schedulePrimitive,\n  type ScheduleChange,\n  type ScheduleController,\n  type ScheduleEvent,\n} from \"./scheduler/schedule\"\nimport \"./shell/shell.css\"\nimport \"./chart/tokens.css\"\nimport \"./scheduler/scheduler.css\"\n\ntype ScheduleTrack = { id: string; label: string; short?: string }\n\ntype ScheduleProps = {\n  /** The schedule's name, for people and agents. */\n  label: string\n  tracks: ScheduleTrack[]\n  /** Minutes from midnight are wall-clock time in `timeZone`. */\n  events?: ScheduleEvent[]\n  defaultEvents?: ScheduleEvent[]\n  onEventsChange?: (events: ScheduleEvent[], details: ScheduleChange) => void\n  /** \"y\": a week or a day, time running down. \"x\": a timeline, rooms down and time across. */\n  axis?: \"y\" | \"x\"\n  startHour?: number\n  endHour?: number\n  /** Minutes events snap to. */\n  step?: number\n  /** How long an event a click on an empty stretch makes, in minutes. */\n  size?: number\n  overlap?: boolean\n  locked?: (event: ScheduleEvent) => boolean\n  /** Enter, Space or a click on an event. Without it, events don't open. */\n  onEventOpen?: (event: ScheduleEvent) => void\n  onCreate?: (span: Span) => ScheduleEvent | null\n  /** An event's face. Defaults to its title, times and place. */\n  renderEvent?: (event: ScheduleEvent) => ReactNode\n  /** How times read. Defaults to 12-hour English, like \"9:30 AM\". */\n  timeLabel?: (minutes: number) => string\n  /** Lets an event dialog, or other code, check times and return focus: `createScheduleController()`. */\n  controller?: ScheduleController\n  /** Now, for the current-time line on today's track. Pass the real clock in an app. */\n  now?: Date\n  /** The zone events' times are in, and `now` is read in. Defaults to the viewer's. */\n  timeZone?: string\n  /** The track that is today, like \"2026-11-16\". */\n  today?: string\n  className?: string\n}\n\n/** spanStyle gives CSS text; React wants an object. */\nfunction styleOf(css: string): CSSProperties {\n  const style: Record<string, string> = {}\n  for (const rule of css.split(\";\")) {\n    const at = rule.indexOf(\":\")\n    if (at < 0) continue\n    const key = rule.slice(0, at).trim()\n    style[key.startsWith(\"--\") ? key : key.replace(/-([a-z])/g, (_, c: string) => c.toUpperCase())] = rule\n      .slice(at + 1)\n      .trim()\n  }\n  return style as CSSProperties\n}\n\nconst series = (color?: number) => `var(--chart-${Math.min(8, Math.max(1, Math.round(color ?? 1)))})`\n\n/** Minutes past midnight of `date` on the wall clock in `timeZone` (the viewer's by default). */\nfunction wallMinutes(date: Date, timeZone?: string) {\n  if (!timeZone) return date.getHours() * 60 + date.getMinutes()\n  const parts = new Intl.DateTimeFormat(\"en-US\", { hour: \"numeric\", minute: \"numeric\", hourCycle: \"h23\", timeZone }).formatToParts(date)\n  const part = (type: string) => Number(parts.find((p) => p.type === type)?.value ?? 0)\n  return part(\"hour\") * 60 + part(\"minute\")\n}\n\nfunction TrackPart({ value, ...props }: { value: string } & PartProps<\"div\">) {\n  return usePart(schedulePrimitive, \"track\", { value }, props, \"div\")\n}\n\nfunction EventPart({ value, ...props }: { value: string } & PartProps<\"button\">) {\n  return usePart(schedulePrimitive, \"event\", { value }, props, \"button\")\n}\n\n/**\n * A week, a day or a timeline of events. Drag an empty stretch to draw one, or click\n * for an hour; drag an event to move it, its edge to resize it. Each event is a button:\n * arrows move it, Shift with arrows changes its end, Delete removes it, Enter opens it.\n */\nfunction Schedule({\n  label,\n  tracks,\n  events,\n  defaultEvents,\n  onEventsChange,\n  axis = \"y\",\n  startHour = 8,\n  endHour = 20,\n  step = 15,\n  size = 60,\n  overlap = true,\n  locked,\n  onEventOpen,\n  onCreate,\n  renderEvent,\n  timeLabel = clock,\n  controller,\n  now,\n  timeZone,\n  today,\n  className,\n}: ScheduleProps) {\n  const helpId = useId()\n  const min = startHour * 60\n  const max = endHour * 60\n  const labels = new Map(tracks.map((t) => [t.id, t.label]))\n  const handle = usePrimitive(schedulePrimitive, {\n    events,\n    defaultEvents,\n    onEventsChange,\n    tracks: tracks.map((t) => t.id),\n    trackLabel: (id) => labels.get(id) ?? id,\n    axis,\n    min,\n    max,\n    step,\n    size,\n    minSize: step,\n    overlap,\n    locked,\n    onCreate,\n    timeLabel,\n    controller,\n    onOpen: onEventOpen\n      ? (id) => {\n          const event = handle.state.events.find((e) => e.id === id)\n          if (event) onEventOpen(event)\n        }\n      : undefined,\n  })\n  const hours = Array.from({ length: endHour - startHour + 1 }, (_, i) => startHour + i)\n  const nowMinutes = now ? wallMinutes(now, timeZone) : null\n  const nowAt = nowMinutes !== null && nowMinutes >= min && nowMinutes <= max ? (nowMinutes - min) / (max - min) : null\n  const hourName = (h: number) => timeLabel(h * 60).replace(\":00\", \"\")\n  // Named from this render's tracks, so a new week's names are never a render behind.\n  const nameOf = (event: ScheduleEvent) =>\n    `${event.title}, ${labels.get(event.track) ?? event.track}, ${timeLabel(event.start)} to ${timeLabel(event.end)}${\n      event.location ? `, ${event.location}` : \"\"\n    }`\n\n  return usePart(\n    handle,\n    \"root\",\n    {},\n    {\n      \"aria-label\": label,\n      \"aria-describedby\": helpId,\n      className: [\"schedule\", className].filter(Boolean).join(\" \"),\n      \"data-axis\": axis,\n      style: { \"--schedule-tracks\": tracks.length, \"--schedule-hours\": endHour - startHour } as CSSProperties,\n      children: ({ events: drawn }: { events: ScheduleEvent[] }) => {\n        const byTrack = new Map<string, ScheduleEvent[]>()\n        for (const event of drawn) {\n          const list = byTrack.get(event.track)\n          if (list) list.push(event)\n          else byTrack.set(event.track, [event])\n        }\n        return (\n          <>\n            <p id={helpId} hidden>\n              Each event is a button. Arrow keys move it, Shift with arrows changes when it\n              ends, Delete removes it, and Enter opens it.\n            </p>\n            <div className=\"schedule-head\" aria-hidden=\"true\">\n              <span className=\"schedule-corner\" />\n              {axis === \"y\"\n                ? tracks.map((t) => (\n                    <span key={t.id} className=\"schedule-track-name\" data-today={t.id === today ? \"\" : undefined}>\n                      {t.short ?? t.label}\n                    </span>\n                  ))\n                : hours.slice(0, -1).map((h) => (\n                    <span key={h} className=\"schedule-hour-name\">\n                      {hourName(h)}\n                    </span>\n                  ))}\n            </div>\n            <div className=\"schedule-body\">\n              <div className=\"schedule-gutter\" aria-hidden=\"true\">\n                {axis === \"y\"\n                  ? hours.slice(0, -1).map((h) => (\n                      <span key={h} className=\"schedule-hour-name\">\n                        {hourName(h)}\n                      </span>\n                    ))\n                  : tracks.map((t) => (\n                      <span key={t.id} className=\"schedule-track-name\">\n                        {t.short ?? t.label}\n                      </span>\n                    ))}\n              </div>\n              <div className=\"schedule-tracks\">\n                {tracks.map((track) => {\n                  const own = (byTrack.get(track.id) ?? []).sort((a, b) => a.start - b.start)\n                  const lanes = stackSpans(own)\n                  return (\n                    <TrackPart\n                      key={track.id}\n                      value={track.id}\n                      className=\"schedule-track\"\n                      aria-label={track.label}\n                      data-today={track.id === today ? \"\" : undefined}\n                    >\n                      {track.id === today && nowAt !== null && (\n                        <span\n                          className=\"schedule-now\"\n                          aria-hidden=\"true\"\n                          style={axis === \"y\" ? { top: `${nowAt * 100}%` } : { insetInlineStart: `${nowAt * 100}%` }}\n                        />\n                      )}\n                      {own.map((event) => (\n                        <EventPart\n                          key={event.id}\n                          value={event.id}\n                          className=\"schedule-event\"\n                          aria-label={nameOf(event)}\n                          aria-describedby={helpId}\n                          data-locked={locked?.(event) ? \"\" : undefined}\n                          style={\n                            {\n                              ...styleOf(handle.api.spans.spanStyle(event, lanes.get(event.id))),\n                              \"--series\": series(event.color),\n                            } as CSSProperties\n                          }\n                        >\n                          {renderEvent ? (\n                            renderEvent(event)\n                          ) : (\n                            <>\n                              <span className=\"schedule-event-title\">{event.title}</span>\n                              <span className=\"schedule-event-time\">\n                                {timeLabel(event.start)} – {timeLabel(event.end)}\n                              </span>\n                              {event.location && <span className=\"schedule-event-place\">{event.location}</span>}\n                            </>\n                          )}\n                          {!locked?.(event) && (\n                            <span className=\"schedule-event-edge\" data-span-edge=\"end\" aria-hidden=\"true\" />\n                          )}\n                        </EventPart>\n                      ))}\n                    </TrackPart>\n                  )\n                })}\n              </div>\n            </div>\n          </>\n        )\n      },\n    } as never,\n    \"div\",\n  )\n}\n\n/** A month at a glance: each day lists its first events; choosing a day opens it. */\nfunction MonthView({\n  month,\n  events,\n  today,\n  onDayChoose,\n  onMonthChange,\n  label = \"Month\",\n  limit = 3,\n  weekStartsOn,\n  locale,\n  timeLabel = clock,\n}: {\n  /** \"2026-11\" */\n  month: string\n  events: ScheduleEvent[]\n  today?: string\n  onDayChoose?: (day: string) => void\n  onMonthChange?: (month: string) => void\n  label?: string\n  /** Events shown per day before \"N more\". */\n  limit?: number\n  /** 0 for Sunday, 1 for Monday. Defaults to the locale's; match your week view. */\n  weekStartsOn?: number\n  /** The language of day names. Defaults to the page's, read after mounting, as Calendar does. */\n  locale?: string\n  timeLabel?: (minutes: number) => string\n}) {\n  // English on the server and the first render, so both match; then the page's language.\n  const [pageLang, setPageLang] = useState(\"en-US\")\n  useEffect(() => setPageLang(pageLocale() ?? \"en-US\"), [])\n  const lang = locale ?? pageLang\n  const fullDate = useMemo(\n    () => new Intl.DateTimeFormat(lang, { weekday: \"long\", month: \"long\", day: \"numeric\", year: \"numeric\", timeZone: \"UTC\" }),\n    [lang],\n  )\n  const dayName = (iso: string, list: ScheduleEvent[]) => {\n    const date = fullDate.format(new Date(`${iso}T00:00:00Z`))\n    if (!list.length) return date\n    const what = list.map((e) => `${e.title} at ${timeLabel(e.start)}`).join(\", \")\n    return `${date}, ${list.length} ${list.length === 1 ? \"event\" : \"events\"}: ${what}`\n  }\n  const byDay = new Map<string, ScheduleEvent[]>()\n  for (const e of [...events].sort((a, b) => a.start - b.start)) {\n    const list = byDay.get(e.track) ?? []\n    list.push(e)\n    byDay.set(e.track, list)\n  }\n  return (\n    <Calendar\n      className=\"schedule-month\"\n      month={month}\n      onMonthChange={(m) => onMonthChange?.(m)}\n      today={today}\n      weekStartsOn={weekStartsOn}\n      locale={locale}\n      value={null}\n      onValueChange={(day) => day && onDayChoose?.(String(day))}\n    >\n      <CalendarGrid aria-label={label}>\n        <CalendarWeekdays>{(index) => <CalendarWeekday index={index} />}</CalendarWeekdays>\n        <CalendarWeeks>\n          {(cell) => (\n            // The day's name carries its events: an aria-label replaces what's inside, so\n            // the chips alone would be silent to screen readers.\n            <CalendarDay value={cell.date} aria-label={dayName(cell.date, byDay.get(cell.date) ?? [])}>\n              {() => {\n                const list = byDay.get(cell.date) ?? []\n                return (\n                  <span className=\"schedule-month-day\">\n                    <span className=\"schedule-month-number\">{Number(cell.date.slice(8))}</span>\n                    {list.slice(0, limit).map((e) => (\n                      <span key={e.id} className=\"schedule-month-chip\" style={{ \"--series\": series(e.color) } as CSSProperties}>\n                        {timeLabel(e.start).replace(\":00\", \"\")} {e.title}\n                      </span>\n                    ))}\n                    {list.length > limit && <span className=\"schedule-month-more\">{list.length - limit} more</span>}\n                  </span>\n                )\n              }}\n            </CalendarDay>\n          )}\n        </CalendarWeeks>\n      </CalendarGrid>\n    </Calendar>\n  )\n}\n\ntype SchedulerView = \"day\" | \"week\" | \"month\" | \"timeline\"\n\n/** Today, previous and next, the range shown, the view, and New event. */\nfunction SchedulerToolbar({\n  title,\n  view,\n  views = [\"day\", \"week\", \"month\"],\n  onViewChange,\n  onToday,\n  onPrevious,\n  onNext,\n  onNewEvent,\n  unit,\n}: {\n  title: string\n  view: SchedulerView\n  views?: SchedulerView[]\n  onViewChange: (view: SchedulerView) => void\n  onToday: () => void\n  onPrevious: () => void\n  onNext: () => void\n  onNewEvent?: () => void\n  /** Names the arrows: \"week\" gives \"Previous week\" and \"Next week\". */\n  unit: string\n}) {\n  const names: Record<SchedulerView, string> = { day: \"Day\", week: \"Week\", month: \"Month\", timeline: \"Timeline\" }\n  return (\n    <div className=\"scheduler-toolbar\" role=\"group\" aria-label=\"Schedule tools\">\n      <div className=\"scheduler-nav\">\n        <Button variant=\"outline\" onClick={onToday}>\n          Today\n        </Button>\n        <Button variant=\"ghost\" onClick={onPrevious} aria-label={`Previous ${unit}`}>\n          <Icon name=\"chevron\" className=\"scheduler-prev\" />\n        </Button>\n        <Button variant=\"ghost\" onClick={onNext} aria-label={`Next ${unit}`}>\n          <Icon name=\"chevron\" />\n        </Button>\n        <h2 className=\"scheduler-title\" aria-live=\"polite\">\n          {title}\n        </h2>\n      </div>\n      <div className=\"scheduler-actions\">\n        <SegmentedControl aria-label=\"View\" value={view} onValueChange={(v) => v && onViewChange(v as SchedulerView)}>\n          {views.map((v) => (\n            <SegmentedControlItem key={v} value={v}>\n              {names[v]}\n            </SegmentedControlItem>\n          ))}\n        </SegmentedControl>\n        {onNewEvent && (\n          <Button onClick={onNewEvent}>\n            <Icon name=\"plus\" />\n            New event\n          </Button>\n        )}\n      </div>\n    </div>\n  )\n}\n\nconst toTime = (minutes: number) =>\n  `${String(Math.floor(minutes / 60)).padStart(2, \"0\")}:${String(minutes % 60).padStart(2, \"0\")}`\nconst fromTime = (text: string) => {\n  const [h, m] = text.split(\":\").map(Number)\n  return (h ?? 0) * 60 + (m ?? 0)\n}\n\ntype EventDraft = Partial<ScheduleEvent> & Pick<ScheduleEvent, \"track\" | \"start\" | \"end\">\n\n/**\n * Create or edit an event: title, day or track, start and end, where. Delete asks first.\n * With the schedule's controller it keeps the schedule's rules (hours, steps, overlaps)\n * and hands focus back to the event, or to its neighbor once it's deleted.\n */\nfunction EventDialog({\n  event,\n  tracks,\n  schedule,\n  startHour = 0,\n  endHour = 24,\n  step = 5,\n  timeLabel = clock,\n  trackName = \"When\",\n  onSave,\n  onDelete,\n  onClose,\n}: {\n  /** The event to edit, a draft for a new one (no id yet means \"new\"), or null when closed. */\n  event: EventDraft | null\n  tracks: ScheduleTrack[]\n  /** The schedule's controller, from `createScheduleController()`, also passed to the Schedule. */\n  schedule?: ScheduleController\n  /** The hours an event has to fit in; match the Schedule's. */\n  startHour?: number\n  endHour?: number\n  /** Minutes the times go in. */\n  step?: number\n  timeLabel?: (minutes: number) => string\n  /** What the track picker is called: \"When\" for days, \"Room\" for rooms. */\n  trackName?: string\n  onSave: (event: ScheduleEvent) => void\n  onDelete?: (event: ScheduleEvent) => void\n  onClose: () => void\n}) {\n  // The dialog keeps showing its event while it animates closed.\n  const [last, setLast] = useState(event)\n  if (event && event !== last) setLast(event)\n  const shown = event ?? last\n  const isNew = !shown?.id\n  const errorId = useId()\n  const [error, setError] = useState<{ text: string; field: \"start\" | \"end\" } | null>(null)\n  const startInput = useRef<HTMLInputElement>(null)\n  const endInput = useRef<HTMLInputElement>(null)\n  // Where focus goes on close: the saved event, or a deleted one's neighbor.\n  const returnTo = useRef<{ id?: string; neighbor?: string } | null>(null)\n  const finalFocus = () => {\n    const target = returnTo.current\n    returnTo.current = null\n    // Cancel and Escape go back where the dialog was opened from.\n    if (!target) return undefined\n    const { id, neighbor } = target\n    return (\n      (id && schedule?.eventElement(id)) || (neighbor && schedule?.eventElement(neighbor)) || schedule?.element() || undefined\n    )\n  }\n  const min = startHour * 60\n  const max = Math.min(endHour * 60, 24 * 60 - 1)\n  const close = () => {\n    setError(null)\n    onClose()\n  }\n\n  return (\n    <Dialog open={event !== null} onOpenChange={(open: boolean) => !open && close()}>\n      <DialogBackdrop />\n      <DialogContent className=\"scheduler-dialog\" finalFocus={finalFocus}>\n        {shown && (\n          <>\n            <DialogTitle>{isNew ? \"New event\" : shown.title}</DialogTitle>\n            <DialogDescription>{isNew ? \"Add it to the schedule.\" : \"Change it, or delete it.\"}</DialogDescription>\n            <form\n              key={shown.id ?? \"new\"}\n              className=\"scheduler-form\"\n              aria-label={isNew ? \"New event\" : `Edit ${shown.title}`}\n              onSubmit={(e: FormEvent<HTMLFormElement>) => {\n                e.preventDefault()\n                const data = new FormData(e.currentTarget)\n                const start = fromTime(String(data.get(\"event-start\")))\n                const end = fromTime(String(data.get(\"event-end\")))\n                const next: ScheduleEvent = {\n                  ...(shown as ScheduleEvent),\n                  id: shown.id ?? crypto.randomUUID(),\n                  title: String(data.get(\"event-title\")),\n                  track: String(data.get(\"event-track\")),\n                  start,\n                  end,\n                  location: String(data.get(\"event-location\") ?? \"\") || undefined,\n                }\n                const problem =\n                  end <= start\n                    ? { text: \"It has to end after it starts.\", field: \"end\" as const }\n                    : start < min || end > endHour * 60\n                      ? { text: `It has to fit between ${timeLabel(min)} and ${timeLabel(endHour * 60)}.`, field: \"start\" as const }\n                      : schedule?.problem(next)\n                        ? { text: schedule.problem(next)!, field: \"start\" as const }\n                        : null\n                setError(problem)\n                if (problem) {\n                  ;(problem.field === \"end\" ? endInput : startInput).current?.focus()\n                  return\n                }\n                onSave(next)\n                returnTo.current = { id: next.id }\n                close()\n              }}\n            >\n              <Field name=\"event-title\">\n                <FieldLabel>Title</FieldLabel>\n                <Input required defaultValue={shown.title} autoComplete=\"off\" />\n                <FieldError match=\"valueMissing\">Name the event.</FieldError>\n              </Field>\n              <Field name=\"event-track\">\n                <Select name=\"event-track\" defaultValue={shown.track}>\n                  <SelectLabel>{trackName}</SelectLabel>\n                  <SelectTrigger />\n                  <SelectContent>\n                    {tracks.map((t) => (\n                      <SelectItem key={t.id} value={t.id}>\n                        {t.label}\n                      </SelectItem>\n                    ))}\n                  </SelectContent>\n                </Select>\n              </Field>\n              <div className=\"scheduler-form-row\">\n                <Field name=\"event-start\">\n                  <FieldLabel>Starts</FieldLabel>\n                  <Input\n                    ref={startInput}\n                    type=\"time\"\n                    required\n                    step={step * 60}\n                    min={toTime(min)}\n                    max={toTime(max)}\n                    defaultValue={toTime(shown.start)}\n                    aria-invalid={error?.field === \"start\" ? true : undefined}\n                    aria-describedby={error?.field === \"start\" ? errorId : undefined}\n                  />\n                  <FieldError match=\"rangeUnderflow\">Starts at {timeLabel(min)} or later.</FieldError>\n                  <FieldError match=\"rangeOverflow\">Starts by {timeLabel(max)}.</FieldError>\n                  <FieldError match=\"stepMismatch\">Times go in steps of {step} minutes.</FieldError>\n                </Field>\n                <Field name=\"event-end\">\n                  <FieldLabel>Ends</FieldLabel>\n                  <Input\n                    ref={endInput}\n                    type=\"time\"\n                    required\n                    step={step * 60}\n                    min={toTime(min)}\n                    max={toTime(max)}\n                    defaultValue={toTime(shown.end)}\n                    aria-invalid={error?.field === \"end\" ? true : undefined}\n                    aria-describedby={error?.field === \"end\" ? errorId : undefined}\n                  />\n                  <FieldError match=\"rangeUnderflow\">Ends at {timeLabel(min)} or later.</FieldError>\n                  <FieldError match=\"rangeOverflow\">Ends by {timeLabel(max)}.</FieldError>\n                  <FieldError match=\"stepMismatch\">Times go in steps of {step} minutes.</FieldError>\n                </Field>\n              </div>\n              <p id={errorId} className=\"scheduler-form-error\" role=\"alert\">\n                {error?.text}\n              </p>\n              <Field name=\"event-location\">\n                <FieldLabel>Where</FieldLabel>\n                <Input defaultValue={shown.location} autoComplete=\"off\" />\n              </Field>\n              <div className=\"scheduler-form-actions\">\n                {!isNew && onDelete && (\n                  <AlertDialog>\n                    <AlertDialogTrigger data-variant=\"ghost\">\n                      <Icon name=\"trash\" />\n                      Delete event\n                    </AlertDialogTrigger>\n                    <AlertDialogBackdrop />\n                    <AlertDialogContent>\n                      <AlertDialogTitle>Delete “{shown.title}”?</AlertDialogTitle>\n                      <AlertDialogDescription>It comes off everyone’s schedule.</AlertDialogDescription>\n                      <div className=\"scheduler-form-actions\">\n                        <AlertDialogClose>Keep the event</AlertDialogClose>\n                        <AlertDialogClose\n                          data-variant=\"destructive\"\n                          data-agent-confirm={`Deletes the event “${shown.title}”`}\n                          onClick={() => {\n                            returnTo.current = { neighbor: schedule?.neighbor(shown.id!) ?? undefined }\n                            onDelete(shown as ScheduleEvent)\n                            close()\n                          }}\n                        >\n                          Delete for good\n                        </AlertDialogClose>\n                      </div>\n                    </AlertDialogContent>\n                  </AlertDialog>\n                )}\n                <span className=\"scheduler-spacer\" />\n                <DialogClose>Cancel</DialogClose>\n                <Button type=\"submit\">{isNew ? \"Add event\" : \"Save event\"}</Button>\n              </div>\n            </form>\n          </>\n        )}\n      </DialogContent>\n    </Dialog>\n  )\n}\n\nexport { EventDialog, MonthView, Schedule, SchedulerToolbar, clock, createScheduleController }\nexport type { EventDraft, ScheduleChange, ScheduleController, ScheduleEvent, ScheduleProps, ScheduleTrack, SchedulerView }\n",
      "type": "registry:ui",
      "target": "@ui/scheduler.tsx"
    },
    {
      "path": "registry/uiset/ui/scheduler/schedule.ts",
      "content": "import {\n  createChange,\n  createController,\n  createSpans,\n  definePrimitive,\n  isSpanFree,\n  live,\n  type ChangeDetails,\n  type Span,\n  type SpanAction,\n  type SpansDraft,\n  type SpansReason,\n} from \"@ui-sdk/core\"\nimport { returnFocus } from \"../uiset/focus\"\n\n// A schedule's behavior: tracks (days down a week, or rooms across a timeline) holding\n// events. UI SDK's createSpans draws, moves and resizes them with the pointer, moves them\n// with arrows (Shift for the end), deletes with Delete, snaps to a step, keeps sizes in\n// bounds, refuses overlaps when asked and announces every change. Each event is a\n// button: a tab stop that Enter, Space or a click opens.\n\ntype ScheduleEvent = Span & {\n  title: string\n  /** A chart slot, 1 to 8, for its color. */\n  color?: number\n  location?: string\n}\n\ntype ScheduleChange = ChangeDetails<SpansReason> & { id: string; action: SpanAction }\n\n/** What code outside the schedule can do: an event dialog checking times and returning focus. */\ntype ScheduleControllerApi = {\n  /** Why an event can't go where it says, or undefined if it fits: hours, length, step, overlaps. */\n  problem(event: ScheduleEvent): string | undefined\n  /** The event's element, if it's shown. */\n  eventElement(id: string): HTMLElement | undefined\n  /** Where focus should go when an event leaves: the next on its track, else the one before, else the nearest track's. */\n  neighbor(id: string): string | undefined\n  /** Somewhere to put focus: the first event, else the schedule itself. */\n  element(): HTMLElement | undefined\n}\n\n/** Connects an event dialog, or any code, to a schedule. Create it once and pass it to both. */\nconst createScheduleController = () => createController<ScheduleControllerApi>()\ntype ScheduleController = ReturnType<typeof createScheduleController>\n\ntype ScheduleOptions = {\n  events?: ScheduleEvent[]\n  defaultEvents?: ScheduleEvent[]\n  onEventsChange?: (events: ScheduleEvent[], details: ScheduleChange) => void\n  /** Track ids in order: ISO dates for days, or resource ids for a timeline. */\n  tracks: string[]\n  trackLabel?: (track: string) => string\n  /** \"y\": time runs down (a week); \"x\": time runs across (a timeline of rooms). */\n  axis?: \"x\" | \"y\"\n  /** Minutes from midnight, wall-clock time in the zone the schedule shows. */\n  min?: number\n  max?: number\n  step?: number\n  minSize?: number\n  maxSize?: number\n  /** What a click on an empty stretch creates, in minutes. */\n  size?: number\n  overlap?: boolean\n  locked?: (event: ScheduleEvent) => boolean\n  /** Makes the event a draw or click creates; return null to refuse. */\n  onCreate?: (span: Span) => ScheduleEvent | null\n  /** Enter, a click, or an agent opens an event. Without it, events don't open. */\n  onOpen?: (id: string) => void\n  /** How times read, like \"9:30 AM\". */\n  timeLabel?: (minutes: number) => string\n  controller?: ScheduleController\n}\n\n/** 12-hour English times, like \"9:30 AM\". Pass `timeLabel` for other clocks and languages. */\nconst clock = (minutes: number) => {\n  const h = Math.floor(minutes / 60) % 24\n  const m = minutes % 60\n  return `${((h + 11) % 12) + 1}:${String(m).padStart(2, \"0\")} ${h < 12 ? \"AM\" : \"PM\"}`\n}\n\n/** @internal Left out of @uiset/web's declarations: its type names UI SDK internals. */\nconst schedulePrimitive = definePrimitive({\n  name: \"schedule\",\n  options: {\n    events: \"value\",\n    defaultEvents: \"value\",\n    onEventsChange: \"callback\",\n    tracks: \"value\",\n    trackLabel: \"value\",\n    axis: \"string\",\n    min: \"number\",\n    max: \"number\",\n    step: \"number\",\n    minSize: \"number\",\n    maxSize: \"number\",\n    size: \"number\",\n    overlap: \"boolean\",\n    locked: \"value\",\n    onCreate: \"action\",\n    onOpen: \"callback\",\n    timeLabel: \"value\",\n    controller: \"value\",\n  },\n  controlled: [\"events\"],\n  live: [\"draft\"],\n  state: (options: ScheduleOptions) => ({\n    events: options.events ?? options.defaultEvents ?? ([] as ScheduleEvent[]),\n    draft: null as SpansDraft<ScheduleEvent> | null,\n  }),\n  sync: (options) => (options.events === undefined ? {} : { events: options.events }),\n  api: (context) => {\n    const opts = () => context.options()\n    const change = createChange(context)\n    const time = (minutes: number) => (opts().timeLabel ?? clock)(minutes)\n    const trackName = (track: string) => opts().trackLabel?.(track) ?? track\n    const describe = (event: ScheduleEvent) =>\n      `${event.title}, ${trackName(event.track)}, ${time(event.start)} to ${time(event.end)}${\n        event.location ? `, ${event.location}` : \"\"\n      }`\n    const min = () => opts().min ?? 8 * 60\n    const max = () => opts().max ?? 20 * 60\n    const step = () => opts().step ?? 15\n    const minSize = () => opts().minSize ?? step()\n    const maxSize = () => opts().maxSize ?? 24 * 60\n    const isLocked = (event: ScheduleEvent) => opts().locked?.(event) ?? false\n\n    const spans = createSpans<{ events: ScheduleEvent[]; draft: SpansDraft<ScheduleEvent> | null }, ScheduleEvent>(\n      context,\n      {\n        key: \"events\",\n        draft: \"draft\",\n        set: (value, details) => change(\"events\", value, details),\n        axis: opts().axis ?? \"y\",\n        min,\n        max,\n        step,\n        minSize,\n        maxSize,\n        size: () => opts().size ?? 60,\n        tracks: () => opts().tracks,\n        overlap: opts().overlap ?? true,\n        create: (span) =>\n          opts().onCreate ? opts().onCreate!(span) : { ...span, id: crypto.randomUUID(), title: \"New event\" },\n        disabled: isLocked,\n        label: describe,\n        createAutoScroll: { edge: 32 },\n      },\n    )\n\n    const all = () => context.store.get().events\n    /** The same rules a drag keeps, for a form or an agent. */\n    const problem = (event: ScheduleEvent) => {\n      if (!opts().tracks.includes(event.track)) return `${trackName(event.track)} isn't on this schedule.`\n      if (event.end <= event.start) return \"It has to end after it starts.\"\n      if (event.start < min() || event.end > max())\n        return `It has to fit between ${time(min())} and ${time(max())}.`\n      if (event.start % step() || event.end % step()) return `Times go in steps of ${step()} minutes.`\n      if (event.end - event.start < minSize()) return `It has to last at least ${minSize()} minutes.`\n      if (event.end - event.start > maxSize()) return `It can last at most ${maxSize()} minutes.`\n      if (!(opts().overlap ?? true) && !isSpanFree(all().filter((e) => e.id !== event.id), event))\n        return \"That time overlaps another event.\"\n      return undefined\n    }\n\n    const findEvent = (name: string) => {\n      const byId = all().find((e) => e.id === name)\n      if (byId) return byId\n      const matches = all().filter((e) => e.title.toLowerCase() === String(name).toLowerCase())\n      if (!matches.length) throw new Error(`No event \"${name}\" on this schedule.`)\n      if (matches.length > 1)\n        throw new Error(\n          `\"${name}\" names ${matches.length} events: ${matches\n            .map((e) => `${trackName(e.track)} at ${time(e.start)} (id ${e.id})`)\n            .join(\"; \")}. Give the id.`,\n        )\n      return matches[0]!\n    }\n    const unlocked = (event: ScheduleEvent) => {\n      if (isLocked(event)) throw new Error(`${event.title} is locked: it can't change.`)\n      return event\n    }\n    const findTrack = (name: string) => {\n      const track = opts().tracks.find(\n        (t) => t === name || trackName(t).toLowerCase().startsWith(String(name).toLowerCase()),\n      )\n      if (!track)\n        throw new Error(`No day or track \"${name}\". Showing: ${opts().tracks.map(trackName).join(\", \")}.`)\n      return track\n    }\n    // Agents give times as \"14:30\" or minutes from midnight.\n    const minutes = (value: string | number) => {\n      if (typeof value === \"number\") return value\n      const match = /^(\\d{1,2}):(\\d{2})$/.exec(String(value).trim())\n      if (!match) throw new Error(`Give times as HH:MM, like 14:30, not \"${value}\".`)\n      return Number(match[1]) * 60 + Number(match[2])\n    }\n    const refuse = (event: ScheduleEvent) => {\n      const why = problem(event)\n      if (why) throw new Error(`${event.title} doesn't fit: ${why}`)\n    }\n\n    const eventElement = (id: string) => context.element(\"event\", id) ?? undefined\n    const rootElement = () => context.element(\"root\") ?? undefined\n    // The events shown, track by track and by time. (Events on days not shown stay in state.)\n    const ordered = () => {\n      const order = opts().tracks\n      return all()\n        .filter((e) => order.includes(e.track))\n        .sort((a, b) => order.indexOf(a.track) - order.indexOf(b.track) || a.start - b.start)\n    }\n    const neighbor = (id: string) => {\n      const event = all().find((e) => e.id === id)\n      if (!event) return undefined\n      const own = ordered().filter((e) => e.track === event.track)\n      const at = own.findIndex((e) => e.id === id)\n      const near = own[at + 1] ?? own[at - 1]\n      if (near) return near.id\n      const order = opts().tracks\n      const index = order.indexOf(event.track)\n      for (let distance = 1; distance < order.length; distance++) {\n        for (const track of [order[index + distance], order[index - distance]]) {\n          const first = track ? ordered().find((e) => e.track === track) : undefined\n          if (first) return first.id\n        }\n      }\n      return undefined\n    }\n\n    return {\n      spans,\n      describe,\n      time,\n      problem,\n      eventElement,\n      neighbor,\n      element: () => {\n        const first = ordered()[0]\n        return (first && eventElement(first.id)) || rootElement()\n      },\n      rootElement,\n      /** The events now, and a way to set them from code (a web element's live `events`). */\n      events: () => all(),\n      setEvents: (next: ScheduleEvent[]) => change(\"events\", next, { reason: \"imperative\", id: \"\", action: \"move\" }),\n      /** Opens an event from a press; a schedule without `onOpen` ignores it. */\n      open: (id: string) => opts().onOpen?.(id),\n      /**\n       * Every event for agents, as `{ value, label }`: the id, which tells same-named events\n       * apart, and the event as a person reads it.\n       */\n      list: () => all().map((e) => ({ value: e.id, label: describe(e) })),\n      /** Opens an event's details, by its title or id. */\n      openEvent(event: string) {\n        const open = opts().onOpen\n        if (!open) throw new Error(\"This schedule doesn't open events.\")\n        open(findEvent(event).id)\n        return true\n      },\n      /** Adds an event: a day or track, start and end as HH:MM, and a title. */\n      addEvent(track: string, start: string, end: string, title: string) {\n        const proposed = { id: crypto.randomUUID(), track: findTrack(track), start: minutes(start), end: minutes(end) }\n        const made = opts().onCreate ? opts().onCreate!(proposed) : { ...proposed, title: \"New event\" }\n        if (!made) throw new Error(\"This schedule doesn't take new events.\")\n        const event: ScheduleEvent = { ...made, ...proposed, id: made.id, title: String(title || made.title) }\n        refuse(event)\n        if (!change(\"events\", [...all(), event], { reason: \"imperative\", id: event.id, action: \"draw\" }))\n          throw new Error(`${event.title} wasn't added.`)\n        return event.id\n      },\n      /** Moves an event to another day or track and start time, keeping its length. */\n      moveEvent(event: string, track: string, start: string) {\n        const found = unlocked(findEvent(event))\n        const from = minutes(start)\n        const next = { ...found, track: findTrack(track), start: from, end: from + (found.end - found.start) }\n        refuse(next)\n        if (!spans.update(found.id, { track: next.track, start: next.start, end: next.end }))\n          throw new Error(`${found.title} didn't move.`)\n        return true\n      },\n      /** Changes when an event ends. */\n      resizeEvent(event: string, end: string) {\n        const found = unlocked(findEvent(event))\n        const next = { ...found, end: minutes(end) }\n        refuse(next)\n        if (!spans.update(found.id, { end: next.end })) throw new Error(`${found.title} didn't change.`)\n        return true\n      },\n      /** Deletes an event. Not offered to agents: they delete through the dialog's confirm. */\n      removeEvent(event: string) {\n        return spans.remove(unlocked(findEvent(event)).id)\n      },\n    }\n  },\n  slots: (slot) => ({\n    // The root hands its render function the events as drawn: the draft during a drag.\n    // It takes focus when the last event goes, so focus never falls to the page.\n    root: slot<{}, { events: ScheduleEvent[] }>({\n      role: \"group\",\n      state: (state, { api }) => ({ events: api.spans.spans(state) }),\n      attrs: () => ({ \"aria-roledescription\": \"schedule\", tabindex: \"-1\" }),\n    }),\n    track: slot<{ value: string }>({\n      props: { value: \"string\" },\n      role: \"group\",\n      on: {\n        pointerdown: (event, { api, props }) => {\n          if ((event.target as Element).closest?.(\"[data-span-id]\")) return\n          api.spans.trackPointerdown(event as PointerEvent, props.value)\n        },\n      },\n      bind: (el, { api, props }) => api.spans.bindTrack(el, props.value),\n    }),\n    // A native button: Enter, Space and a click open it.\n    event: slot<{ value: string }>({\n      props: { value: \"string\" },\n      role: \"button\",\n      focus: \"native\",\n      keys: [\"ArrowUp\", \"ArrowDown\", \"ArrowLeft\", \"ArrowRight\", \"Delete\", \"Backspace\"],\n      press: ({ api, key }) => api.open(key),\n      attrs: () => ({ type: \"button\", \"aria-roledescription\": \"event\" }),\n      // Drag states are live: written straight to the element as a drag goes.\n      live: live((state, { api, key }) => api.spans.spanAttrs(state, key)),\n      on: {\n        keydown: (event, { api, key }) => {\n          const e = event as KeyboardEvent\n          if (e.key === \"Enter\" || e.key === \" \") return\n          const deleting = e.key === \"Delete\" || e.key === \"Backspace\"\n          const next = deleting ? api.neighbor(key) : undefined\n          // A deleted event takes its focus with it: hand it to the next event, or the schedule.\n          if (api.spans.keydown(e, key) && deleting)\n            returnFocus(() => (next && api.eventElement(next)) || api.rootElement())\n        },\n        pointerdown: (event, { api, key }) => api.spans.spanPointerdown(event as PointerEvent, key),\n      },\n      bind: (el, { api, key }) => api.spans.bindSpan(el, key),\n    }),\n  }),\n  agent: {\n    actions: [\"addEvent\", \"moveEvent\", \"resizeEvent\", \"openEvent\"],\n    items: (api) => api.list(),\n  },\n})\n\nexport { clock, createScheduleController, schedulePrimitive }\nexport type { ScheduleChange, ScheduleController, ScheduleControllerApi, ScheduleEvent, ScheduleOptions }\n",
      "type": "registry:file",
      "target": "@ui/scheduler/schedule.ts"
    },
    {
      "path": "registry/uiset/ui/scheduler/scheduler.css",
      "content": "@layer ui-sdk, uiset.tokens, uiset.base, uiset.skin;\n\n@layer uiset.base {\n  .schedule {\n    --hour: 3rem;\n    --gutter: 4.25rem;\n    --schedule-line: var(--chart-grid, var(--ui-border));\n    display: grid;\n    grid-template-rows: auto 1fr;\n    max-block-size: var(--schedule-height, 36rem);\n    overflow: auto;\n    border: 1px solid var(--ui-border);\n    border-radius: calc(var(--ui-radius) + 6px);\n    background: var(--ui-background);\n    color: var(--ui-foreground);\n    font-size: 0.8125rem;\n    overscroll-behavior: contain;\n    /* Focus scrolls an event clear of the sticky head and gutter. */\n    scroll-padding-block-start: 2.5rem;\n    scroll-padding-inline-start: var(--gutter);\n\n    &:focus-visible {\n      outline: 2px solid var(--ui-ring-border);\n      outline-offset: 2px;\n    }\n  }\n\n  .schedule-head {\n    position: sticky;\n    top: 0;\n    z-index: 3;\n    display: grid;\n    grid-template-columns: var(--gutter) repeat(var(--schedule-tracks), minmax(7rem, 1fr));\n    border-block-end: 1px solid var(--ui-border);\n    background: var(--ui-background);\n  }\n\n  .schedule-track-name {\n    padding: 0.5rem;\n    color: var(--ui-muted-foreground);\n    font-weight: 600;\n    text-align: center;\n\n    /* Today reads in full-contrast text, marked by an accent bar rather than a color. */\n    &[data-today] {\n      color: var(--ui-foreground);\n      box-shadow: inset 0 -3px 0 var(--ui-primary);\n    }\n  }\n\n  /* The corner and the hours stay put while a narrow week scrolls sideways. */\n  .schedule-corner,\n  .schedule-gutter {\n    position: sticky;\n    inset-inline-start: 0;\n    z-index: 2;\n    background: var(--ui-background);\n  }\n\n  .schedule-hour-name {\n    color: var(--ui-muted-foreground);\n    font-size: 0.75rem;\n    font-variant-numeric: tabular-nums;\n  }\n\n  .schedule-body {\n    display: grid;\n    grid-template-columns: var(--gutter) 1fr;\n  }\n\n  .schedule-gutter {\n    display: grid;\n    grid-auto-rows: var(--hour);\n\n    .schedule-hour-name {\n      padding-inline-end: 0.5rem;\n      text-align: end;\n      translate: 0 -0.5em;\n\n      /* The first label sits at the top edge instead of under the sticky header. */\n      &:first-child {\n        translate: none;\n      }\n    }\n  }\n\n  .schedule-tracks {\n    display: grid;\n    grid-template-columns: repeat(var(--schedule-tracks), minmax(7rem, 1fr));\n    block-size: calc(var(--schedule-hours) * var(--hour));\n    background-image: linear-gradient(to bottom, var(--schedule-line) 1px, transparent 1px);\n    background-size: 100% var(--hour);\n  }\n\n  .schedule-track {\n    position: relative;\n    border-inline-start: 1px solid var(--schedule-line);\n    touch-action: none;\n    cursor: cell;\n\n    /* A finger scrolls the schedule; a tap still makes an event, and events still drag. */\n    @media (pointer: coarse) {\n      touch-action: pan-x pan-y;\n    }\n\n    &[data-today] {\n      background: color-mix(in oklch, var(--ui-primary) 4%, transparent);\n    }\n  }\n\n  .schedule-event {\n    --series: var(--chart-1);\n    /* The edge mixes the series halfway to the text color, so it clears 3:1 on any surface.\n       Mixes are in OKLab: OKLCH would turn an orange event purple on the way to a cool gray. */\n    --edge: color-mix(in oklab, var(--series) 50%, var(--ui-foreground));\n    display: block;\n    box-sizing: border-box;\n    min-block-size: 1.25rem;\n    margin: 0;\n    padding: 0.125rem 0.375rem;\n    overflow: hidden;\n    appearance: none;\n    border: 1px solid var(--edge);\n    border-inline-start: 3px solid var(--series);\n    font: inherit;\n    text-align: start;\n    border-radius: calc(var(--ui-radius) + 1px);\n    background: color-mix(in oklab, var(--series) 16%, var(--ui-background));\n    color: var(--ui-foreground);\n    line-height: 1.25;\n    white-space: nowrap;\n    text-overflow: ellipsis;\n    cursor: grab;\n    touch-action: none;\n    user-select: none;\n    outline: none;\n\n    &:focus-visible {\n      z-index: 2;\n      outline: 2px solid var(--ui-ring-border);\n      outline-offset: 1px;\n    }\n\n    &[data-dragging],\n    &[data-resizing],\n    &[data-drawing] {\n      z-index: 2;\n      box-shadow: var(--ui-shadow);\n      cursor: grabbing;\n    }\n\n    &[data-locked] {\n      cursor: default;\n      background-image: repeating-linear-gradient(\n        -45deg,\n        color-mix(in oklch, var(--series) 12%, transparent) 0 4px,\n        transparent 4px 8px\n      );\n    }\n  }\n\n  .schedule-event-title,\n  .schedule-event-time,\n  .schedule-event-place {\n    display: block;\n    overflow: hidden;\n    text-overflow: ellipsis;\n    white-space: nowrap;\n  }\n\n  .schedule-event-title {\n    font-weight: 600;\n  }\n\n  .schedule-event-time,\n  .schedule-event-place {\n    margin-block-start: 0.125rem;\n    color: var(--ui-muted-foreground);\n    font-size: 0.75rem;\n  }\n\n  /* Day and week: an event is as tall as its time. One too short for two lines puts its\n     time beside the title on one line, and the place shows only when a third line fits,\n     so no line is ever cut in half. */\n  .schedule:not([data-axis=\"x\"]) .schedule-event {\n    container-type: size;\n    /* A hairline between events side by side or back to back (B20). */\n    margin-inline-end: 2px;\n    margin-block-end: 1px;\n  }\n\n  @container (height < 3.4em) {\n    .schedule-event-place {\n      display: none;\n    }\n  }\n\n  @container (height < 2.35em) {\n    .schedule-event-title,\n    .schedule-event-time {\n      display: inline;\n    }\n\n    .schedule-event-time {\n      margin-inline-start: 0.375rem;\n    }\n  }\n\n  /* The end edge resizes; it's a pointer target only, Shift+arrows do it by keyboard. */\n  .schedule-event-edge {\n    position: absolute;\n    inset-inline: 0;\n    inset-block-end: 0;\n    block-size: 0.5rem;\n    cursor: ns-resize;\n  }\n\n  .schedule-now {\n    position: absolute;\n    inset-inline: 0;\n    z-index: 1;\n    block-size: 2px;\n    background: var(--tone-danger);\n    pointer-events: none;\n\n    &::before {\n      content: \"\";\n      position: absolute;\n      inset-inline-start: 0;\n      inset-block-start: -3px;\n      inline-size: 8px;\n      block-size: 8px;\n      border-radius: 50%;\n      background: var(--tone-danger);\n    }\n  }\n\n  /* Timeline: rooms down the side, time across. */\n  .schedule[data-axis=\"x\"] {\n    --gutter: 8rem;\n    --hour-width: 5rem;\n    --row: 3.75rem;\n\n    .schedule-head {\n      grid-template-columns: var(--gutter) repeat(var(--schedule-hours), minmax(var(--hour-width), 1fr));\n    }\n\n    .schedule-head .schedule-hour-name {\n      padding: 0.5rem 0.375rem;\n      border-inline-start: 1px solid var(--schedule-line);\n    }\n\n    .schedule-gutter {\n      grid-auto-rows: var(--row);\n\n      .schedule-track-name {\n        display: flex;\n        align-items: center;\n        text-align: start;\n        translate: none;\n      }\n    }\n\n    .schedule-tracks {\n      grid-template-columns: 1fr;\n      grid-auto-rows: var(--row);\n      min-inline-size: calc(var(--schedule-hours) * var(--hour-width));\n      block-size: auto;\n      background-image: linear-gradient(to right, var(--schedule-line) 1px, transparent 1px);\n      background-size: calc(100% / var(--schedule-hours)) 100%;\n    }\n\n    .schedule-track {\n      border-inline-start: 0;\n      border-block-end: 1px solid var(--schedule-line);\n    }\n\n    .schedule-event-edge {\n      inset-block: 0;\n      inset-inline: auto 0;\n      inline-size: 0.5rem;\n      block-size: auto;\n      cursor: ew-resize;\n    }\n\n    .schedule-now {\n      inset-block: 0;\n      inset-inline-end: auto;\n      inline-size: 2px;\n      block-size: auto;\n\n      &::before {\n        inset-inline-start: -3px;\n        inset-block-start: -4px;\n      }\n    }\n  }\n\n  /* Month */\n  /* The month view fills its column: one track it can shrink in, not UI SDK's calendar\n     columns (a full-width table inside those measured itself a million pixels wide). */\n  .schedule-month {\n    display: grid;\n    grid-template-columns: minmax(0, 1fr);\n    inline-size: 100%;\n\n    [data-slot=\"calendar-grid\"] {\n      inline-size: 100%;\n      table-layout: fixed;\n    }\n\n    [data-slot=\"calendar-day\"] {\n      inline-size: 100%;\n      block-size: auto;\n      min-block-size: 6rem;\n      align-items: stretch;\n      justify-content: start;\n      padding: 0.375rem;\n      text-align: start;\n    }\n\n    /* A table cell ignores min-height, and its height works as one: React's month is a\n       table, so its weeks keep the same height as the web month's rows. */\n    td[data-slot=\"calendar-day\"] {\n      block-size: 6rem;\n    }\n  }\n\n  .schedule-month-day {\n    display: grid;\n    align-content: start;\n    gap: 0.25rem;\n    inline-size: 100%;\n    min-width: 0;\n  }\n\n  /* Days read from the top of their cells, and today is a filled date, not an underline\n     that would run under its events too. */\n  .schedule-month [data-slot=\"calendar-day\"] {\n    vertical-align: top;\n\n    &[data-today] {\n      text-decoration: none;\n    }\n  }\n\n  .schedule-month [data-today] .schedule-month-number {\n    justify-self: start;\n    min-inline-size: 1.75em;\n    padding-inline: 0.375em;\n    border-radius: 999px;\n    background: var(--ui-primary);\n    color: var(--ui-primary-foreground);\n    text-align: center;\n  }\n\n  .schedule-month-number {\n    font-weight: 600;\n    font-variant-numeric: tabular-nums;\n  }\n\n  .schedule-month-chip {\n    overflow: hidden;\n    padding: 0.0625rem 0.25rem;\n    border-inline-start: 3px solid var(--series);\n    border-radius: 3px;\n    background: color-mix(in oklch, var(--series) 14%, transparent);\n    font-size: 0.6875rem;\n    font-weight: 500;\n    text-overflow: ellipsis;\n    white-space: nowrap;\n  }\n\n  .schedule-month-more {\n    color: var(--ui-muted-foreground);\n    font-size: 0.6875rem;\n  }\n\n  /* Toolbar and dialog */\n  .scheduler-toolbar {\n    display: flex;\n    flex-wrap: wrap;\n    align-items: center;\n    justify-content: space-between;\n    gap: 0.5rem 1rem;\n  }\n\n  .scheduler-nav,\n  .scheduler-actions {\n    display: flex;\n    flex-wrap: wrap;\n    align-items: center;\n    gap: 0.375rem;\n  }\n\n  .scheduler-prev {\n    scale: -1 1;\n  }\n\n  .scheduler-title {\n    margin: 0 0 0 0.5rem;\n    font-size: 1.125rem;\n    font-weight: 650;\n  }\n\n  .scheduler-dialog {\n    inline-size: min(calc(100vw - 2rem), 30rem);\n  }\n\n  .scheduler-form {\n    display: grid;\n    gap: 1rem;\n  }\n\n  .scheduler-form-row {\n    display: grid;\n    gap: 1rem;\n    grid-template-columns: repeat(auto-fit, minmax(min(100%, 9rem), 1fr));\n  }\n\n  .scheduler-form-error {\n    margin: 0;\n    color: var(--tone-danger);\n    font-size: 0.875rem;\n\n    &:empty {\n      display: none;\n    }\n  }\n\n  .scheduler-form-actions {\n    display: flex;\n    flex-wrap: wrap;\n    align-items: center;\n    gap: 0.5rem;\n  }\n\n  .scheduler-spacer {\n    flex: 1;\n  }\n}\n",
      "type": "registry:file",
      "target": "@ui/scheduler/scheduler.css"
    },
    {
      "path": "registry/uiset/ui/chart/tokens.css",
      "content": "@layer ui-sdk, uiset.tokens, uiset.base, uiset.skin;\n\n/*\n  Chart colors, validated per surface with the dataviz six-checks script (docs/charts.md):\n  categorical slots in a fixed order (never cycled, never by rank), one-hue sequential\n  steps, a diverging pair with a gray midpoint, and quiet chrome. Text never uses these;\n  it stays in --ui-foreground and --ui-muted-foreground.\n*/\n\n@layer uiset.tokens {\n  :where([data-uiset]) {\n    --chart-1: light-dark(oklch(0.575 0.163 255.5), oklch(0.622 0.161 255.1));\n    --chart-2: light-dark(oklch(0.671 0.175 40.6), oklch(0.622 0.173 40.1));\n    --chart-3: light-dark(oklch(0.669 0.141 162.1), oklch(0.621 0.128 163.1));\n    --chart-4: light-dark(oklch(0.764 0.161 75.1), oklch(0.67 0.143 73.2));\n    --chart-5: light-dark(oklch(0.716 0.141 357.4), oklch(0.622 0.171 0.8));\n    --chart-6: light-dark(oklch(0.529 0.18 142.5), oklch(0.529 0.18 142.5));\n    --chart-7: light-dark(oklch(0.527 0.197 283.4), oklch(0.67 0.145 286.8));\n    --chart-8: light-dark(oklch(0.623 0.191 24.9), oklch(0.669 0.159 22.3));\n    /* \"Other\" and de-emphasized series: a gray that never reads as a slot. */\n    --chart-other: color-mix(in oklch, var(--ui-muted-foreground) 70%, var(--ui-background));\n\n    /* Sequential, one hue: step 1 is \"little\", step 7 is \"most\". Dark mode runs the same\n       ramp from the surface up, so \"most\" is always the loudest. */\n    --chart-seq-1: light-dark(oklch(0.905 0.041 252.8), oklch(0.338 0.103 256.9));\n    --chart-seq-2: light-dark(oklch(0.812 0.079 253.4), oklch(0.433 0.128 256.5));\n    --chart-seq-3: light-dark(oklch(0.717 0.118 253.6), oklch(0.527 0.15 255.9));\n    --chart-seq-4: light-dark(oklch(0.622 0.161 255.1), oklch(0.622 0.161 255.1));\n    --chart-seq-5: light-dark(oklch(0.527 0.15 255.9), oklch(0.717 0.118 253.6));\n    --chart-seq-6: light-dark(oklch(0.433 0.128 256.5), oklch(0.812 0.079 253.4));\n    --chart-seq-7: light-dark(oklch(0.338 0.103 256.9), oklch(0.905 0.041 252.8));\n\n    /* Diverging: two poles that read as opposite, a gray middle that reads as nothing. */\n    --chart-neg: var(--chart-8);\n    --chart-mid: light-dark(oklch(0.951 0.004 95), oklch(0.34 0.005 106.7));\n    --chart-pos: var(--chart-1);\n\n    /* Chrome: hairlines one step off the surface, solid, never dashed. */\n    --chart-grid: color-mix(in oklch, var(--ui-foreground) 9%, var(--ui-background));\n    --chart-axis: color-mix(in oklch, var(--ui-foreground) 24%, var(--ui-background));\n    --chart-surface: var(--ui-background);\n    --chart-crosshair: color-mix(in oklch, var(--ui-foreground) 45%, var(--ui-background));\n    --chart-area-opacity: 0.1;\n  }\n}\n\n@layer uiset.skin {\n  /* Blueprint paper is mid blue (L 0.36): its set sits above the usual dark band so every\n     slot keeps 3:1 on the paper. Adjacent pairs: CVD ΔE 14.6, normal 18.7. The first six\n     (a segmented bar's most parts) also clear every pair: CVD 9.3, normal 17.3. */\n  [data-uiset][data-skin=\"blueprint\"] {\n    --chart-1: oklch(0.74 0.11 279.9);\n    --chart-2: oklch(0.86 0.14 159.9);\n    --chart-3: oklch(0.739 0.17 49.8);\n    --chart-4: oklch(0.7 0.2 351);\n    --chart-5: oklch(0.89 0.18 96);\n    --chart-6: oklch(0.89 0.1 327);\n    --chart-7: oklch(0.859 0.14 130.1);\n    --chart-8: oklch(0.789 0.117 242.6);\n    --chart-seq-1: color-mix(in oklab, var(--blueprint-line) 14%, var(--blueprint-paper));\n    --chart-seq-2: color-mix(in oklab, var(--blueprint-line) 28%, var(--blueprint-paper));\n    --chart-seq-3: color-mix(in oklab, var(--blueprint-line) 42%, var(--blueprint-paper));\n    --chart-seq-4: color-mix(in oklab, var(--blueprint-line) 56%, var(--blueprint-paper));\n    --chart-seq-5: color-mix(in oklab, var(--blueprint-line) 70%, var(--blueprint-paper));\n    --chart-seq-6: color-mix(in oklab, var(--blueprint-line) 85%, var(--blueprint-paper));\n    --chart-seq-7: var(--blueprint-line);\n    --chart-neg: var(--chart-3);\n    --chart-pos: var(--chart-2);\n    --chart-mid: color-mix(in oklab, var(--blueprint-line) 20%, var(--blueprint-paper));\n    --chart-grid: var(--blueprint-faint);\n    --chart-axis: color-mix(in oklab, var(--blueprint-line) 55%, var(--blueprint-paper));\n    --chart-crosshair: var(--blueprint-line);\n    --chart-area-opacity: 0.16;\n  }\n\n  /* Studio keeps the validated dark set and lights its sequential ramp like a lamp.\n     Ramps mix in OKLab: OKLCH would swing the hue from amber through pink to the panel. */\n  [data-uiset][data-skin=\"studio\"] {\n    --chart-seq-1: color-mix(in oklab, var(--studio-lamp) 14%, var(--studio-panel));\n    --chart-seq-2: color-mix(in oklab, var(--studio-lamp) 28%, var(--studio-panel));\n    --chart-seq-3: color-mix(in oklab, var(--studio-lamp) 42%, var(--studio-panel));\n    --chart-seq-4: color-mix(in oklab, var(--studio-lamp) 56%, var(--studio-panel));\n    --chart-seq-5: color-mix(in oklab, var(--studio-lamp) 70%, var(--studio-panel));\n    --chart-seq-6: color-mix(in oklab, var(--studio-lamp) 85%, var(--studio-panel));\n    --chart-seq-7: var(--studio-lamp);\n    --chart-crosshair: var(--studio-lamp);\n  }\n  /* Phosphor: the tube's own green first, then the other phosphors (blue, P3 amber, P22\n     red, P4 white, lavender, cyan, pink), each 3:1 or more on the tube. Adjacent pairs:\n     CVD ΔE ≥ 9.5, normal ≥ 17; the first six clear every pair (CVD 9.4, normal 19.6). */\n  [data-uiset][data-skin=\"phosphor\"] {\n    --chart-1: oklch(0.88 0.17 148);\n    --chart-2: oklch(0.72 0.2 250);\n    --chart-3: oklch(0.84 0.17 75);\n    --chart-4: oklch(0.68 0.17 28);\n    --chart-5: oklch(0.96 0.02 150);\n    --chart-6: oklch(0.84 0.11 300);\n    --chart-7: oklch(0.92 0.11 195);\n    --chart-8: oklch(0.76 0.14 355);\n    --chart-seq-1: color-mix(in oklab, var(--phosphor-glow) 14%, var(--phosphor-tube));\n    --chart-seq-2: color-mix(in oklab, var(--phosphor-glow) 28%, var(--phosphor-tube));\n    --chart-seq-3: color-mix(in oklab, var(--phosphor-glow) 42%, var(--phosphor-tube));\n    --chart-seq-4: color-mix(in oklab, var(--phosphor-glow) 56%, var(--phosphor-tube));\n    --chart-seq-5: color-mix(in oklab, var(--phosphor-glow) 70%, var(--phosphor-tube));\n    --chart-seq-6: color-mix(in oklab, var(--phosphor-glow) 85%, var(--phosphor-tube));\n    --chart-seq-7: var(--phosphor-glow);\n    --chart-neg: var(--chart-4);\n    --chart-pos: var(--chart-2);\n    --chart-mid: color-mix(in oklab, var(--phosphor-dim) 30%, var(--phosphor-tube));\n    --chart-grid: oklch(0.75 0.11 150 / 0.2);\n    --chart-axis: color-mix(in oklab, var(--phosphor-dim) 70%, var(--phosphor-tube));\n    --chart-crosshair: var(--phosphor-glow);\n    --chart-area-opacity: 0.14;\n  }\n\n  /* Ink: data is the one place with color, a muted print-like set, like color e-paper:\n     ink first, then blue, orange, sage, dark red, purple, teal, mustard, each 3:1 or more\n     on the screen. Adjacent pairs: CVD ΔE ≥ 9.8, normal ≥ 16; the first six clear every\n     pair (CVD 9.8, normal 16.5). Sequential steps are ink on the screen. */\n  [data-uiset][data-skin=\"ink\"] {\n    --chart-1: oklch(0.2 0 0);\n    --chart-2: oklch(0.5 0.12 250);\n    --chart-3: oklch(0.58 0.15 55);\n    --chart-4: oklch(0.58 0.06 150);\n    --chart-5: oklch(0.42 0.15 25);\n    --chart-6: oklch(0.38 0.15 300);\n    --chart-7: oklch(0.58 0.09 195);\n    --chart-8: oklch(0.58 0.12 95);\n    --chart-seq-1: color-mix(in oklab, var(--ink-ink) 14%, var(--ink-screen));\n    --chart-seq-2: color-mix(in oklab, var(--ink-ink) 28%, var(--ink-screen));\n    --chart-seq-3: color-mix(in oklab, var(--ink-ink) 42%, var(--ink-screen));\n    --chart-seq-4: color-mix(in oklab, var(--ink-ink) 56%, var(--ink-screen));\n    --chart-seq-5: color-mix(in oklab, var(--ink-ink) 70%, var(--ink-screen));\n    --chart-seq-6: color-mix(in oklab, var(--ink-ink) 85%, var(--ink-screen));\n    --chart-seq-7: var(--ink-ink);\n    --chart-neg: var(--chart-5);\n    --chart-pos: var(--chart-2);\n    --chart-mid: var(--ink-tint);\n    --chart-grid: oklch(0.82 0 0);\n    --chart-axis: oklch(0.55 0 0);\n    --chart-crosshair: var(--ink-ink);\n    --chart-area-opacity: 0.12;\n  }\n}\n",
      "type": "registry:file",
      "target": "@ui/chart/tokens.css"
    },
    {
      "path": "registry/uiset/ui/shell/shell.css",
      "content": "@layer ui-sdk, uiset.tokens, uiset.base, uiset.skin;\n\n@layer uiset.base {\n  :where([data-uiset]) {\n    /* Status colors: text and edges hold 4.5:1 / 3:1 on --ui-background in each scheme. */\n    /* Dark values also clear 4.5:1 on the mid-dark Blueprint and Studio panels. */\n    --tone-info: light-dark(oklch(0.48 0.15 255), oklch(0.86 0.08 240));\n    --tone-success: light-dark(oklch(0.47 0.12 150), oklch(0.87 0.11 150));\n    --tone-warning: light-dark(oklch(0.5 0.12 70), oklch(0.89 0.11 85));\n    --tone-danger: light-dark(oklch(0.46 0.19 27), oklch(0.86 0.08 25));\n    --tone-neutral: var(--ui-muted-foreground);\n  }\n\n  .uiset-visually-hidden {\n    position: absolute;\n    width: 1px;\n    height: 1px;\n    overflow: hidden;\n    clip-path: inset(50%);\n    white-space: nowrap;\n  }\n\n  .uiset-icon {\n    width: 1rem;\n    height: 1rem;\n    flex-shrink: 0;\n    fill: none;\n    stroke: currentColor;\n    stroke-width: 1.75;\n    stroke-linecap: round;\n    stroke-linejoin: round;\n  }\n\n  /* App shell */\n\n  .app-shell {\n    --sidebar-width: 15rem;\n    display: grid;\n    grid-template-columns: var(--sidebar-width) minmax(0, 1fr);\n    min-height: var(--app-shell-height, 100dvh);\n    background: var(--ui-background);\n    color: var(--ui-foreground);\n\n    &[data-narrow] {\n      grid-template-columns: minmax(0, 1fr);\n    }\n  }\n\n  [data-sidebar=\"collapsed\"] .app-shell:not([data-narrow]) {\n    --sidebar-width: 3.75rem;\n  }\n\n  .app-sidebar,\n  .app-drawer {\n    display: flex;\n    flex-direction: column;\n    gap: 0.75rem;\n    min-width: 0;\n    padding: 0.75rem;\n    border-inline-end: 1px solid var(--ui-border);\n    background: color-mix(in oklab, var(--ui-muted) 55%, var(--ui-background));\n    overflow: hidden;\n  }\n\n  .app-sidebar-top {\n    display: flex;\n    align-items: center;\n    justify-content: space-between;\n    gap: 0.5rem;\n    min-height: 2.25rem;\n  }\n\n  .app-brand {\n    min-width: 0;\n    margin: 0;\n    overflow: hidden;\n    font-weight: 600;\n    white-space: nowrap;\n    text-overflow: ellipsis;\n  }\n\n  [data-sidebar=\"collapsed\"] .app-sidebar .app-brand {\n    display: none;\n  }\n\n  .app-sidebar-toggle,\n  .app-menu-button {\n    flex-shrink: 0;\n    width: 2.25rem;\n    height: 2.25rem;\n    padding: 0;\n  }\n\n  .app-main {\n    display: flex;\n    flex-direction: column;\n    min-width: 0;\n  }\n\n  /* Its padding counts in its height, with or without a page's box-sizing reset. */\n  .app-header {\n    box-sizing: border-box;\n    display: flex;\n    flex-wrap: wrap;\n    align-items: center;\n    gap: 0.75rem;\n    min-height: 3.25rem;\n    padding: 0.5rem 1rem;\n    border-bottom: 1px solid var(--ui-border);\n  }\n\n  /* The padding is a variable, so a full-bleed page (an inbox) can cancel it exactly. */\n  .app-content {\n    --app-shell-pad: clamp(1rem, 3vw, 2rem);\n    flex: 1;\n    min-width: 0;\n    padding: var(--app-shell-pad);\n  }\n\n  .sidebar-nav {\n    display: grid;\n    gap: 1rem;\n  }\n\n  .sidebar-group {\n    display: grid;\n    gap: 0.25rem;\n\n    ul {\n      display: grid;\n      gap: 2px;\n      margin: 0;\n      padding: 0;\n      list-style: none;\n    }\n  }\n\n  .sidebar-group-title {\n    margin: 0;\n    padding-inline: 0.5rem;\n    font-size: 0.75rem;\n    font-weight: 600;\n    color: var(--ui-muted-foreground);\n  }\n\n  /* Collapsed to icons: group titles leave the layout (a hidden title used to keep its\n     width and push the icons off center), and a rule separates the groups instead. */\n  [data-sidebar=\"collapsed\"] .app-sidebar {\n    .sidebar-group-title {\n      position: absolute;\n      width: 1px;\n      height: 1px;\n      overflow: hidden;\n      clip-path: inset(50%);\n      white-space: nowrap;\n    }\n\n    .sidebar-nav {\n      gap: 0.5rem;\n    }\n\n    .sidebar-group + .sidebar-group {\n      padding-block-start: 0.5rem;\n      border-block-start: 1px solid var(--ui-border);\n    }\n  }\n\n  /* A tooltip trigger, so UI SDK's stylesheet would draw it as a button: reset that. */\n  .sidebar-link {\n    display: flex;\n    align-items: center;\n    justify-content: flex-start;\n    gap: 0.625rem;\n    width: 100%;\n    height: auto;\n    min-height: 2.25rem;\n    padding: 0.375rem 0.5rem;\n    border: 0;\n    border-radius: var(--ui-radius);\n    background: transparent;\n    color: var(--ui-foreground);\n    font-weight: 400;\n    text-decoration: none;\n\n    &:hover {\n      background: var(--ui-muted);\n    }\n\n    &[aria-current=\"page\"] {\n      position: relative;\n      background: var(--ui-muted);\n      font-weight: 600;\n\n      /* A short bar, inset from the corners (an inset shadow bent around them). */\n      &::before {\n        content: \"\";\n        position: absolute;\n        inset-block: 0.5rem;\n        inset-inline-start: 0;\n        inline-size: 3px;\n        border-radius: 999px;\n        background: var(--ui-primary);\n      }\n    }\n\n    &:focus-visible {\n      outline: 2px solid var(--ui-ring-border);\n      outline-offset: -2px;\n    }\n  }\n\n  .sidebar-icon {\n    display: inline-grid;\n    place-items: center;\n    width: 1.25rem;\n    flex-shrink: 0;\n  }\n\n  .sidebar-label {\n    flex: 1;\n    min-width: 0;\n    overflow: hidden;\n    white-space: nowrap;\n    text-overflow: ellipsis;\n  }\n\n  .sidebar-badge {\n    font-size: 0.75rem;\n  }\n\n  /* Each link is a square icon button, centered in the rail under the toggle; the current\n     page shows by its fill and an accent icon (a side bar on a square reads as a glitch). */\n  [data-sidebar=\"collapsed\"] .app-sidebar {\n    .sidebar-link {\n      justify-content: center;\n      inline-size: 2.25rem;\n      min-block-size: 2.25rem;\n      margin-inline: auto;\n      padding: 0;\n\n      &[aria-current=\"page\"] {\n        color: color-mix(in oklch, var(--ui-primary) 55%, var(--ui-foreground));\n\n        &::before {\n          display: none;\n        }\n      }\n    }\n\n    .sidebar-label,\n    .sidebar-badge {\n      position: absolute;\n      width: 1px;\n      height: 1px;\n      overflow: hidden;\n      clip-path: inset(50%);\n    }\n  }\n\n  /* The tooltip repeats the visible label, so it only shows when labels are hidden. */\n  [data-sidebar=\"expanded\"] .sidebar-tooltip,\n  .app-drawer .sidebar-tooltip {\n    display: none;\n  }\n\n  /* Page structure */\n\n  .breadcrumbs ol {\n    display: flex;\n    flex-wrap: wrap;\n    align-items: center;\n    gap: 0.25rem;\n    margin: 0;\n    padding: 0;\n    list-style: none;\n    font-size: 0.875rem;\n  }\n\n  .breadcrumbs li {\n    display: inline-flex;\n    align-items: center;\n    gap: 0.25rem;\n    color: var(--ui-muted-foreground);\n\n    a {\n      color: inherit;\n      text-underline-offset: 0.2em;\n    }\n\n    [aria-current=\"page\"] {\n      color: var(--ui-foreground);\n      font-weight: 500;\n    }\n  }\n\n  .breadcrumbs-separator {\n    width: 0.875rem;\n    height: 0.875rem;\n  }\n\n  .page-header {\n    display: grid;\n    gap: 0.75rem;\n    margin-bottom: 1.5rem;\n  }\n\n  .page-header-row {\n    display: flex;\n    flex-wrap: wrap;\n    align-items: flex-end;\n    justify-content: space-between;\n    gap: 1rem;\n  }\n\n  .page-header-title {\n    margin: 0;\n    font-size: clamp(1.5rem, 3vw, 1.875rem);\n    line-height: 1.15;\n    text-wrap: balance;\n  }\n\n  .page-header-description {\n    max-width: 42rem;\n    margin: 0.375rem 0 0;\n    color: var(--ui-muted-foreground);\n  }\n\n  .page-header-actions {\n    display: flex;\n    flex-wrap: wrap;\n    gap: 0.5rem;\n  }\n\n  .card {\n    display: grid;\n    gap: 1rem;\n    min-width: 0;\n    padding: 1.25rem;\n    border: 1px solid var(--ui-border);\n    border-radius: calc(var(--ui-radius) + 6px);\n    background: var(--ui-background);\n  }\n\n  .card-header {\n    display: grid;\n    gap: 0.25rem;\n  }\n\n  .card-title {\n    margin: 0;\n    font-size: 1rem;\n    font-weight: 600;\n  }\n\n  .card-description {\n    margin: 0;\n    color: var(--ui-muted-foreground);\n    font-size: 0.875rem;\n  }\n\n  .card-footer {\n    display: flex;\n    flex-wrap: wrap;\n    gap: 0.5rem;\n    padding-top: 1rem;\n    border-top: 1px solid var(--ui-border);\n  }\n\n  /* Data display */\n\n  .badge {\n    --badge-color: var(--tone-neutral);\n    display: inline-flex;\n    align-items: center;\n    gap: 0.25rem;\n    padding: 0.0625rem 0.5rem;\n    border: 1px solid color-mix(in oklab, var(--badge-color) 55%, transparent);\n    border-radius: min(999px, calc(var(--ui-radius) * 999));\n    background: color-mix(in oklab, var(--badge-color) 10%, var(--ui-background));\n    color: var(--badge-color);\n    font-size: 0.75rem;\n    font-weight: 600;\n    line-height: 1.5;\n    white-space: nowrap;\n\n    &[data-tone=\"info\"] {\n      --badge-color: var(--tone-info);\n    }\n\n    &[data-tone=\"success\"] {\n      --badge-color: var(--tone-success);\n    }\n\n    &[data-tone=\"warning\"] {\n      --badge-color: var(--tone-warning);\n    }\n\n    &[data-tone=\"danger\"] {\n      --badge-color: var(--tone-danger);\n    }\n  }\n\n  .count-badge {\n    position: relative;\n    display: inline-flex;\n    vertical-align: middle;\n  }\n\n  /* The solid button's colors: every skin already holds 4.5:1 between them. */\n  .count-badge-count {\n    position: absolute;\n    inset-block-start: 0;\n    inset-inline-end: 0;\n    translate: 40% -40%;\n    display: inline-flex;\n    align-items: center;\n    justify-content: center;\n    box-sizing: border-box;\n    min-width: 1.125rem;\n    height: 1.125rem;\n    padding-inline: 0.3125rem;\n    border-radius: min(999px, calc(var(--ui-radius) * 999));\n    background: var(--uiset-solid-bg);\n    color: var(--uiset-solid-fg);\n    box-shadow: 0 0 0 2px var(--ui-background);\n    font-size: 0.6875rem;\n    font-weight: 600;\n    font-variant-numeric: tabular-nums;\n    line-height: 1;\n    white-space: nowrap;\n    pointer-events: none;\n\n    &:dir(rtl) {\n      translate: -40% -40%;\n    }\n\n    &[data-dot] {\n      min-width: 0.625rem;\n      width: 0.625rem;\n      height: 0.625rem;\n      padding: 0;\n      translate: 20% -20%;\n\n      &:dir(rtl) {\n        translate: -20% -20%;\n      }\n    }\n  }\n\n  /* Each avatar overlaps the one before it, with a ring of the page color between them. */\n  .avatar-group {\n    display: inline-flex;\n    align-items: center;\n    vertical-align: middle;\n\n    & > * {\n      box-shadow: 0 0 0 2px var(--ui-background);\n    }\n\n    /* A small overlap: more would cover the next avatar's initials. */\n    & > * + * {\n      margin-inline-start: calc(var(--ui-spacing) * -1);\n    }\n  }\n\n  .avatar-group-more {\n    font-variant-numeric: tabular-nums;\n  }\n\n  /* Content sits at the top, so figures in a row line up whether or not one has a trend. */\n  .stat {\n    display: grid;\n    align-content: start;\n    gap: 0.25rem;\n\n    p {\n      margin: 0;\n    }\n  }\n\n  .stat-label {\n    font-size: 0.875rem;\n    color: var(--ui-muted-foreground);\n  }\n\n  .stat-trend {\n    max-inline-size: 100%;\n  }\n\n  /* A standalone figure keeps proportional digits; tabular ones look loose this big. */\n  .stat-value {\n    font-size: 1.75rem;\n    font-weight: 650;\n    line-height: 1.15;\n  }\n\n  .stat-change {\n    display: inline-flex;\n    align-items: center;\n    gap: 0.25rem;\n    font-size: 0.875rem;\n    font-weight: 600;\n\n    &[data-good] {\n      color: var(--tone-success);\n    }\n\n    &[data-bad] {\n      color: var(--tone-danger);\n    }\n  }\n\n  .stat-period,\n  .stat-description {\n    color: var(--ui-muted-foreground);\n    font-weight: 400;\n  }\n\n  .stat-description {\n    font-size: 0.8125rem;\n  }\n\n  .empty-state {\n    display: grid;\n    justify-items: center;\n    gap: 0.5rem;\n    padding: 2.5rem 1rem;\n    text-align: center;\n  }\n\n  .empty-state-icon {\n    width: 2rem;\n    height: 2rem;\n    color: var(--ui-muted-foreground);\n  }\n\n  .empty-state-title {\n    margin: 0.25rem 0 0;\n    font-size: 1.0625rem;\n  }\n\n  .empty-state-description {\n    max-width: 28rem;\n    margin: 0;\n    color: var(--ui-muted-foreground);\n  }\n\n  .empty-state-actions {\n    display: flex;\n    flex-wrap: wrap;\n    justify-content: center;\n    gap: 0.5rem;\n    margin-top: 0.5rem;\n  }\n\n  .skeleton {\n    display: block;\n    width: 100%;\n    border-radius: var(--ui-radius);\n    background: linear-gradient(\n        90deg,\n        var(--ui-muted) 0 35%,\n        color-mix(in oklab, var(--ui-muted), var(--ui-foreground) 8%) 50%,\n        var(--ui-muted) 65% 100%\n      )\n      0 0 / 300% 100%;\n    animation: skeleton-wave 1.6s ease-in-out infinite;\n  }\n\n  .skeleton-text {\n    display: grid;\n    gap: 0.5rem;\n\n    .skeleton {\n      height: 0.75rem;\n    }\n  }\n\n  @keyframes skeleton-wave {\n    from {\n      background-position: 100% 0;\n    }\n    to {\n      background-position: 0 0;\n    }\n  }\n\n  .description-list {\n    display: grid;\n    margin: 0;\n\n    &[data-layout=\"columns\"] .description-item {\n      display: grid;\n      grid-template-columns: minmax(8rem, 1fr) 2fr;\n      gap: 1rem;\n    }\n\n    dt {\n      color: var(--ui-muted-foreground);\n    }\n\n    dd {\n      margin: 0;\n      min-width: 0;\n      overflow-wrap: anywhere;\n    }\n  }\n\n  .description-item {\n    padding-block: 0.625rem;\n    border-bottom: 1px solid var(--ui-border);\n\n    &:last-child {\n      border-bottom: 0;\n    }\n  }\n\n  .item-list {\n    display: grid;\n    margin: 0;\n    padding: 0;\n    list-style: none;\n  }\n\n  .item {\n    display: flex;\n    align-items: center;\n    gap: 0.75rem;\n    min-height: 3rem;\n    padding-block: 0.625rem;\n    border-bottom: 1px solid var(--ui-border);\n\n    &:last-child {\n      border-bottom: 0;\n    }\n  }\n\n  .item-text {\n    display: grid;\n    flex: 1;\n    min-width: 0;\n  }\n\n  .item-title {\n    overflow: hidden;\n    color: var(--ui-foreground);\n    font-weight: 500;\n    white-space: nowrap;\n    text-overflow: ellipsis;\n  }\n\n  a.item-title {\n    text-decoration: none;\n\n    &:hover {\n      text-decoration: underline;\n    }\n  }\n\n  .item-description,\n  .item-meta {\n    color: var(--ui-muted-foreground);\n    font-size: 0.8125rem;\n  }\n\n  .item-actions {\n    display: flex;\n    gap: 0.25rem;\n  }\n\n  .alert {\n    --alert-color: var(--tone-info);\n    display: grid;\n    grid-template-columns: auto minmax(0, 1fr) auto;\n    gap: 0.75rem;\n    align-items: start;\n    padding: 0.875rem 1rem;\n    position: relative;\n    overflow: hidden;\n    padding-inline-start: calc(1rem + 3px);\n    border: 1px solid color-mix(in oklab, var(--alert-color) 45%, var(--ui-border));\n    border-radius: calc(var(--ui-radius) + 4px);\n    background: color-mix(in oklab, var(--alert-color) 7%, var(--ui-background));\n\n    /* The accent is a straight bar the corners clip; a thick border would taper into them. */\n    &::before {\n      content: \"\";\n      position: absolute;\n      inset-block: 0;\n      inset-inline-start: 0;\n      inline-size: 4px;\n      background: var(--alert-color);\n    }\n\n    &[data-tone=\"success\"] {\n      --alert-color: var(--tone-success);\n    }\n\n    &[data-tone=\"warning\"] {\n      --alert-color: var(--tone-warning);\n    }\n\n    &[data-tone=\"danger\"] {\n      --alert-color: var(--tone-danger);\n    }\n  }\n\n  .alert-icon {\n    width: 1.25rem;\n    height: 1.25rem;\n    color: var(--alert-color);\n  }\n\n  .alert-body {\n    display: grid;\n    gap: 0.25rem;\n  }\n\n  .alert-title {\n    margin: 0;\n    font-weight: 600;\n  }\n\n  .alert-text {\n    color: var(--ui-foreground);\n  }\n\n  .alert-actions {\n    display: flex;\n    flex-wrap: wrap;\n    gap: 0.5rem;\n    margin-top: 0.375rem;\n  }\n\n  .alert-dismiss {\n    width: 2rem;\n    height: 2rem;\n    padding: 0;\n  }\n\n  /* Sized in its own em so a key sits inside a line of text, not below it. */\n  .kbd {\n    display: inline-flex;\n    align-items: center;\n    min-width: 1.75em;\n    height: 1.75em;\n    justify-content: center;\n    padding-inline: 0.4em;\n    vertical-align: 0.125em;\n    line-height: 1;\n    border: 1px solid var(--ui-input);\n    border-bottom-width: 2px;\n    border-radius: calc(var(--ui-radius) / 2 + 2px);\n    background: var(--ui-background);\n    color: var(--ui-foreground);\n    font-family: var(--ui-font-mono);\n    font-size: 0.75rem;\n  }\n\n  .spinner {\n    display: inline-block;\n    flex-shrink: 0;\n    border: 2px solid color-mix(in oklab, var(--ui-foreground) 18%, transparent);\n    border-top-color: var(--ui-primary);\n    border-radius: 50%;\n    animation: spinner-turn 0.8s linear infinite;\n  }\n\n  @keyframes spinner-turn {\n    to {\n      rotate: 1turn;\n    }\n  }\n\n  .stepper {\n    container-type: inline-size;\n  }\n\n  .stepper ol {\n    display: flex;\n    flex-wrap: wrap;\n    gap: 0.25rem 1rem;\n    margin: 0;\n    padding: 0;\n    list-style: none;\n  }\n\n  /* Marks line up across steps, whether a step has a description or not. */\n  .stepper-step {\n    align-items: flex-start;\n    gap: 0.625rem;\n    height: auto;\n    min-height: 2.75rem;\n    padding: 0.375rem 0.625rem 0.375rem 0.375rem;\n    text-align: start;\n  }\n\n  @container (max-width: 30rem) {\n    .stepper ol {\n      flex-direction: column;\n      flex-wrap: nowrap;\n    }\n  }\n\n  .stepper-mark {\n    box-sizing: border-box;\n    display: inline-grid;\n    place-items: center;\n    width: 1.75rem;\n    height: 1.75rem;\n    flex-shrink: 0;\n    border: 2px solid var(--ui-input);\n    border-radius: 50%;\n    font-size: 0.8125rem;\n    font-weight: 600;\n    font-variant-numeric: tabular-nums;\n  }\n\n  .stepper li[data-state=\"current\"] .stepper-mark {\n    border-color: var(--ui-primary);\n    color: var(--ui-primary);\n  }\n\n  .stepper li[data-state=\"complete\"] .stepper-mark {\n    border-color: var(--ui-primary);\n    background: var(--ui-primary);\n    color: var(--ui-primary-foreground);\n  }\n\n  /* The label's first line centers on the mark, whatever the page's line height. */\n  .stepper-text {\n    display: grid;\n    padding-block-start: max(0px, calc((1.75rem - 1lh) / 2));\n  }\n\n  .stepper-label {\n    font-weight: 600;\n  }\n\n  .stepper-description {\n    font-size: 0.75rem;\n    color: var(--ui-muted-foreground);\n  }\n\n  .search-field {\n    position: relative;\n    display: flex;\n    /* A row even as a UI SDK field (which stacks its parts), so the icon centers. */\n    flex-direction: row;\n    align-items: center;\n    width: 100%;\n\n    [data-slot=\"input\"] {\n      width: 100%;\n      padding-inline: 2.125rem 3rem;\n    }\n  }\n\n  .search-field-icon {\n    position: absolute;\n    inset-inline-start: 0.625rem;\n    color: var(--ui-muted-foreground);\n    pointer-events: none;\n  }\n\n  .search-field-clear {\n    position: absolute;\n    inset-inline-end: 0.25rem;\n    width: 1.75rem;\n    height: 1.75rem;\n    padding: 0;\n  }\n\n  /* The browser's own clear button would duplicate ours. */\n  .search-field input[type=\"search\"]::-webkit-search-cancel-button {\n    display: none;\n  }\n\n  .search-field-hint {\n    position: absolute;\n    inset-inline-end: 0.5rem;\n    pointer-events: none;\n  }\n\n  .copy-button {\n    gap: 0.375rem;\n  }\n\n  @media (prefers-reduced-motion: reduce) {\n    .skeleton,\n    .spinner {\n      animation-duration: 0s;\n    }\n\n    .spinner {\n      border-top-color: var(--ui-muted-foreground);\n    }\n  }\n\n  @media (forced-colors: active) {\n    .badge,\n    .alert,\n    .kbd {\n      border-color: CanvasText;\n    }\n\n    /* Shadows don't draw here, so the rings become real edges. */\n    .avatar-group > *,\n    .count-badge-count {\n      outline: 1px solid CanvasText;\n    }\n\n    .count-badge-count {\n      background: Canvas;\n      color: CanvasText;\n    }\n\n    .sidebar-link[aria-current=\"page\"] {\n      outline: 2px solid Highlight;\n    }\n\n    .stepper li[data-state=\"complete\"] .stepper-mark {\n      background: Highlight;\n      color: HighlightText;\n    }\n  }\n}\n",
      "type": "registry:file",
      "target": "@ui/shell/shell.css"
    },
    {
      "path": "registry/uiset/ui/shell/icons.tsx",
      "content": "import { iconPaths, type IconName } from \"./icon-paths\"\n\nfunction Icon({ name, className }: { name: IconName; className?: string }) {\n  return (\n    <svg\n      viewBox=\"0 0 24 24\"\n      aria-hidden=\"true\"\n      focusable=\"false\"\n      className={[\"uiset-icon\", className].filter(Boolean).join(\" \")}\n    >\n      <path d={iconPaths[name]} />\n    </svg>\n  )\n}\n\nexport { Icon }\nexport type { IconName }\n",
      "type": "registry:file",
      "target": "@ui/shell/icons.tsx"
    },
    {
      "path": "registry/uiset/ui/shell/icon-paths.ts",
      "content": "// UISet's icons as SVG path data on a 24×24 grid, stroked: framework-free, so the React\n// Icon and the web elements draw the same shapes.\nconst iconPaths = {\n  // Text editing (the rich text editor's toolbar).\n  bold: \"M7 5h6a3.5 3.5 0 0 1 0 7H7zM7 12h7a3.5 3.5 0 0 1 0 7H7z\",\n  italic: \"M10 5h8M6 19h8M14 5l-4 14\",\n  underline: \"M7 5v6a5 5 0 0 0 10 0V5M5 20h14\",\n  strike: \"M5 12h14M16 7a4 4 0 0 0-3.5-2h-1A3.5 3.5 0 0 0 8 8.5c0 1.4.8 2.4 2.5 3M8 17a4 4 0 0 0 3.5 2h1a3.5 3.5 0 0 0 3.5-3.5c0-.6-.1-1.1-.4-1.5\",\n  \"code-inline\": \"M9 8l-4 4 4 4M15 8l4 4-4 4\",\n  link: \"M10 14a4 4 0 0 0 5.7 0l3-3a4 4 0 0 0-5.7-5.7l-1 1M14 10a4 4 0 0 0-5.7 0l-3 3a4 4 0 0 0 5.7 5.7l1-1\",\n  \"list-bullet\": \"M9 6h11M9 12h11M9 18h11M4.5 6v.01M4.5 12v.01M4.5 18v.01\",\n  \"list-ordered\": \"M10 6h10M10 12h10M10 18h10M4 4.5l1.5-.5v4.5M4 15a1.3 1.3 0 0 1 2.4.6c0 .8-2.4 1.7-2.4 2.9h2.6\",\n  \"list-check\": \"M11 6h9M11 12h9M11 18h9M3.5 6l1.5 1.5L8 4.5M3.5 12l1.5 1.5 3-3M3.5 18l1.5 1.5 3-3\",\n  quote: \"M6 7h4v4c0 3-1.3 5-4 6M14 7h4v4c0 3-1.3 5-4 6\",\n  undo: \"M9 14L4 9l5-5M4 9h10a6 6 0 0 1 0 12h-3\",\n  redo: \"M15 14l5-5-5-5M20 9H10a6 6 0 0 0 0 12h3\",\n  image: \"M4 5h16v14H4zM4 16l5-5 4 4 3-3 4 4M15 9.5v.01\",\n  \"code-block\": \"M4 5h16v14H4zM9.5 10l-2 2 2 2M14.5 10l2 2-2 2\",\n  rule: \"M4 12h16M8 8h8M8 16h8\",\n  menu: \"M4 7h16M4 12h16M4 17h16\",\n  sidebar: \"M4 5h16v14H4zM9 5v14\",\n  chevron: \"M9 6l6 6-6 6\",\n  search: \"M11 18a7 7 0 1 1 0-14 7 7 0 0 1 0 14zM20 20l-4-4\",\n  close: \"M6 6l12 12M18 6L6 18\",\n  copy: \"M8 8h11v11H8zM5 16V5h11\",\n  check: \"M5 12.5l4.5 4.5L19 7.5\",\n  info: \"M12 11v6M12 7.5v.01M12 21a9 9 0 1 1 0-18 9 9 0 0 1 0 18z\",\n  success: \"M8 12.5l2.5 2.5L16 9.5M12 21a9 9 0 1 1 0-18 9 9 0 0 1 0 18z\",\n  warning:\n    \"M12 9v4M12 16.5v.01M10.3 4.2L2.6 18a2 2 0 0 0 1.7 3h15.4a2 2 0 0 0 1.7-3L13.7 4.2a2 2 0 0 0-3.4 0z\",\n  danger: \"M15 9l-6 6M9 9l6 6M12 21a9 9 0 1 1 0-18 9 9 0 0 1 0 18z\",\n  up: \"M7 14l5-5 5 5\",\n  down: \"M7 10l5 5 5-5\",\n  inbox: \"M4 13l2.5-7h11l2.5 7v6H4zM4 13h5l1 2h4l1-2h5\",\n  more: \"M4.8 12a1.2 1.2 0 1 0 2.4 0a1.2 1.2 0 1 0-2.4 0M10.8 12a1.2 1.2 0 1 0 2.4 0a1.2 1.2 0 1 0-2.4 0M16.8 12a1.2 1.2 0 1 0 2.4 0a1.2 1.2 0 1 0-2.4 0\",\n  columns: \"M4 5h16v14H4zM10 5v14M15 5v14\",\n  download: \"M12 4v11M7 10l5 5 5-5M5 20h14\",\n  upload: \"M12 15V4M7 9l5-5 5 5M5 20h14\",\n  retry: \"M20 12a8 8 0 1 1-8-8c2.2 0 4.3.9 5.9 2.4L20 8.5M20 4v4.5h-4.5\",\n  filter: \"M4 6h16M7 12h10M10 18h4\",\n  home: \"M4 11l8-7 8 7M6 9.5V20h12V9.5M10 20v-5h4v5\",\n  users: \"M9 11a3.5 3.5 0 1 0 0-7 3.5 3.5 0 0 0 0 7zM3 20c0-3.3 2.7-6 6-6s6 2.7 6 6M16 4.5a3.5 3.5 0 0 1 0 6.5M21 20c0-2.6-1.6-4.8-4-5.6\",\n  orders: \"M6 4h12l1 16H5zM9 8a3 3 0 0 0 6 0\",\n  reports: \"M5 20V10M12 20V4M19 20v-7\",\n  settings: \"M12 15a3 3 0 1 0 0-6 3 3 0 0 0 0 6zM19.4 13.5l1.6 1.2-2 3.4-1.9-.7a7 7 0 0 1-2 1.2l-.3 2h-4l-.3-2a7 7 0 0 1-2-1.2l-1.9.7-2-3.4 1.6-1.2a7 7 0 0 1 0-3l-1.6-1.2 2-3.4 1.9.7a7 7 0 0 1 2-1.2l.3-2h4l.3 2a7 7 0 0 1 2 1.2l1.9-.7 2 3.4-1.6 1.2a7 7 0 0 1 0 3z\",\n  mail: \"M4 6h16v12H4zM4 7l8 6 8-6\",\n  star: \"M12 4l2.5 5.2 5.5.8-4 3.9.9 5.6L12 16.8 7.1 19.5l.9-5.6-4-3.9 5.5-.8z\",\n  archive: \"M4 5h16v4H4zM6 9v10h12V9M10 13h4\",\n  trash: \"M5 7h14M10 7V5h4v2M7 7l1 13h8l1-13\",\n  plus: \"M12 5v14M5 12h14\",\n  minus: \"M5 12h14\",\n  fit: \"M4 9V4h5M15 4h5v5M20 15v5h-5M9 20H4v-5\",\n  folder: \"M3.5 6.5a1.5 1.5 0 0 1 1.5-1.5h4l2 2h8a1.5 1.5 0 0 1 1.5 1.5v9a1.5 1.5 0 0 1-1.5 1.5H5a1.5 1.5 0 0 1-1.5-1.5z\",\n  file: \"M6 3.5h8l4 4v13H6zM14 3.5v4h4\",\n  branch: \"M6 4v16M18 8a2 2 0 1 0 0-4 2 2 0 0 0 0 4zM18 8c0 5-6 5-12 8\",\n  grip: \"M9 6.5v.01M15 6.5v.01M9 12v.01M15 12v.01M9 17.5v.01M15 17.5v.01\",\n  edit: \"M5 19h4L19 9l-4-4L5 15zM14 6l4 4\",\n  send: \"M4 12l16-8-6 16-2-7z\",\n  card: \"M3 6h18v12H3zM3 10h18M7 15h4\",\n  shield: \"M12 3l7 3v5c0 4.5-3 8.5-7 10-4-1.5-7-5.5-7-10V6z\",\n  bell: \"M6 16V11a6 6 0 0 1 12 0v5l2 2H4zM10 20a2 2 0 0 0 4 0\",\n}\n\ntype IconName = keyof typeof iconPaths\n\n/** An icon as an SVG element, for code without React. */\nfunction iconElement(name: IconName, className?: string) {\n  const svg = document.createElementNS(\"http://www.w3.org/2000/svg\", \"svg\")\n  svg.setAttribute(\"viewBox\", \"0 0 24 24\")\n  svg.setAttribute(\"aria-hidden\", \"true\")\n  svg.setAttribute(\"focusable\", \"false\")\n  svg.setAttribute(\"class\", [\"uiset-icon\", className].filter(Boolean).join(\" \"))\n  const path = document.createElementNS(\"http://www.w3.org/2000/svg\", \"path\")\n  path.setAttribute(\"d\", iconPaths[name])\n  svg.append(path)\n  return svg\n}\n\nexport { iconElement, iconPaths }\nexport type { IconName }\n",
      "type": "registry:file",
      "target": "@ui/shell/icon-paths.ts"
    }
  ],
  "type": "registry:ui"
}