{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "calendar",
  "title": "Calendar",
  "description": "Primitives for calendars: a toolbar with today, previous, next and a view switch, a keyboard-navigable month grid with event chips, multi-day bars and \"+N more\", week and resource views on an hour axis with overlapping events side by side and a now line, an event list for narrow screens, inline event details, a legend that can filter calendars, and date helpers for weeks, event days and lanes.",
  "registryDependencies": [
    "button",
    "button-group",
    "tabs",
    "https://www.dashboardblocks.com/r/radix/schedule.json",
    "https://www.dashboardblocks.com/r/radix/team.json",
    "https://www.dashboardblocks.com/r/radix/format.json"
  ],
  "files": [
    {
      "path": "registry/components/dashboardblocks/calendar.tsx",
      "content": "'use client'\n\nimport {\n  type ScheduleEvent,\n  addDays,\n  formatTime,\n  formatTimeRange,\n  getDay,\n  getEventStyle,\n  getMonthWeeks,\n} from '@/registry/components/dashboardblocks/schedule'\nimport { PersonAvatar } from '@/registry/components/dashboardblocks/team'\nimport { IconPlaceholder } from '@/registry/icons/icon-placeholder'\nimport {\n  dayIn,\n  formatDate,\n  formatDateRange,\n  joinDetails,\n  zonedParts,\n} from '@/registry/lib/dashboardblocks/format'\nimport {\n  type CSSProperties,\n  type KeyboardEvent,\n  type ReactNode,\n  useEffect,\n  useId,\n  useRef,\n  useState,\n} from 'react'\n\nimport { Button } from '@/components/ui/button'\nimport { ButtonGroup } from '@/components/ui/button-group'\nimport { Tabs, TabsList, TabsTrigger } from '@/components/ui/tabs'\n\nimport { cn } from '@/lib/utils'\n\ninterface CalendarEvent extends ScheduleEvent {\n  attendees?: { avatar?: string; name: string }[]\n  description?: string\n  /** The `id` of the room or person the event is booked on, for `CalendarResourceView`. */\n  resource?: string\n}\n\nconst DAY = 86_400_000\n\nconst MIN_EVENT_MINUTES = 30\nconst SHORT_EVENT_MINUTES = 45\nconst LOCATION_EVENT_MINUTES = 90\nconst TEXT_LINE_MINUTES = 20\nconst TEXT_PADDING_MINUTES = 5\nconst HOUR_LABEL_OFFSET_PX = 12\nconst GUTTER = '4rem'\n\nconst toKey = (day: Date) => day.toISOString().slice(0, 10)\nconst getEnd = (event: ScheduleEvent) => (event.end ?? event.start).getTime()\nconst getMinutes = (event: ScheduleEvent) =>\n  (getEnd(event) - event.start.getTime()) / 60_000\nconst fitsLines = (lines: number, minutes: number) =>\n  minutes >= lines * TEXT_LINE_MINUTES + TEXT_PADDING_MINUTES\n\nfunction getWeekDays(day: Date, weekStartsOn: 0 | 1 = 0) {\n  const start = addDays(day, -((day.getUTCDay() - weekStartsOn + 7) % 7))\n  return Array.from({ length: 7 }, (_, index) => addDays(start, index))\n}\n\nfunction startOfMonth(day: Date, months = 0) {\n  return new Date(Date.UTC(day.getUTCFullYear(), day.getUTCMonth() + months, 1))\n}\n\nfunction formatDayRange(first: Date, last: Date) {\n  return formatDateRange({ end: last, start: first }, { year: true })\n}\n\nfunction getEventDays(event: ScheduleEvent, timeZone = 'UTC') {\n  const first = getDay(event.start, timeZone)\n  if (!event.end || event.end <= event.start) return { first, last: first }\n  const last = getDay(new Date(event.end.getTime() - 1), timeZone)\n  return { first, last: last < first ? first : last }\n}\n\nfunction spansDays(event: ScheduleEvent, timeZone = 'UTC') {\n  if (event.allDay) return true\n  const { first, last } = getEventDays(event, timeZone)\n  return first.getTime() !== last.getTime()\n}\n\n/** Events on a plain day in `timeZone`, including ones spanning it: those first, then by start. */\nfunction getEventsForDay<T extends ScheduleEvent>(\n  events: T[],\n  day: Date,\n  timeZone = 'UTC',\n) {\n  const time = day.getTime()\n  return events\n    .filter((event) => {\n      const { first, last } = getEventDays(event, timeZone)\n      return first.getTime() <= time && time <= last.getTime()\n    })\n    .sort(\n      (a, b) =>\n        Number(spansDays(b, timeZone)) - Number(spansDays(a, timeZone)) ||\n        a.start.getTime() - b.start.getTime() ||\n        getEnd(b) - getEnd(a),\n    )\n}\n\ninterface EventSegment<T extends ScheduleEvent = CalendarEvent> {\n  continuesAfter: boolean\n  continuesBefore: boolean\n  event: T\n  lane: number\n  span: number\n  start: number\n}\n\nfunction layoutSegments<T extends ScheduleEvent>(\n  events: T[],\n  days: Date[],\n  timeZone = 'UTC',\n): EventSegment<T>[] {\n  const firstDay = days[0].getTime()\n  const lastDay = days[days.length - 1].getTime()\n  const laneEnds: number[] = []\n  return events\n    .map((event) => {\n      const { first, last } = getEventDays(event, timeZone)\n      return { event, first: first.getTime(), last: last.getTime() }\n    })\n    .filter(({ first, last }) => first <= lastDay && last >= firstDay)\n    .sort(\n      (a, b) =>\n        a.first - b.first ||\n        b.last - a.last ||\n        a.event.start.getTime() - b.event.start.getTime(),\n    )\n    .map(({ event, first, last }) => {\n      const start = Math.round((Math.max(first, firstDay) - firstDay) / DAY)\n      const end = Math.round((Math.min(last, lastDay) - firstDay) / DAY)\n      let lane = laneEnds.findIndex((laneEnd) => laneEnd < start)\n      if (lane === -1) lane = laneEnds.length\n      laneEnds[lane] = end\n      return {\n        continuesAfter: last > lastDay,\n        continuesBefore: first < firstDay,\n        event,\n        lane,\n        span: end - start + 1,\n        start,\n      }\n    })\n}\n\ninterface EventLayout<T extends ScheduleEvent = CalendarEvent> {\n  event: T\n  lane: number\n  lanes: number\n  span: number\n  uncoveredMinutes: number\n}\n\nfunction layoutEvents<T extends ScheduleEvent>(events: T[]): EventLayout<T>[] {\n  const sorted = [...events].sort(\n    (a, b) => a.start.getTime() - b.start.getTime() || getEnd(b) - getEnd(a),\n  )\n  const result: EventLayout<T>[] = []\n  let group: { end: number; event: T; lane: number; start: number }[] = []\n  let laneEnds: number[] = []\n  let groupEnd = -Infinity\n\n  const flush = () => {\n    const lanes = laneEnds.length\n    for (const item of group) {\n      let span = 1\n      while (\n        item.lane + span < lanes &&\n        !group.some(\n          (other) =>\n            other.lane === item.lane + span &&\n            other.start < item.end &&\n            item.start < other.end &&\n            other.start < item.start + MIN_EVENT_MINUTES * 60_000,\n        )\n      ) {\n        span++\n      }\n      const covering = group\n        .filter(\n          (other) =>\n            other.lane > item.lane &&\n            other.lane < item.lane + span &&\n            other.start < item.end &&\n            item.start < other.end,\n        )\n        .map((other) => (other.start - item.start) / 60_000)\n      result.push({\n        event: item.event,\n        lane: item.lane,\n        lanes,\n        span,\n        uncoveredMinutes: Math.min(Infinity, ...covering),\n      })\n    }\n    group = []\n    laneEnds = []\n  }\n\n  for (const event of sorted) {\n    const start = event.start.getTime()\n    const end = Math.max(getEnd(event), start + MIN_EVENT_MINUTES * 60_000)\n    if (start >= groupEnd) flush()\n    let lane = laneEnds.findIndex((laneEnd) => laneEnd <= start)\n    if (lane === -1) lane = laneEnds.length\n    laneEnds[lane] = end\n    group.push({ end, event, lane, start })\n    groupEnd = group.length === 1 ? end : Math.max(groupEnd, end)\n  }\n  flush()\n  return result\n}\n\nfunction getEventWhen(\n  event: ScheduleEvent,\n  timeZone: string,\n  style: 'long' | 'short',\n): string[] {\n  const dayStyle = style === 'long' ? 'weekday-long-day' : 'weekday-day'\n  const { first, last } = getEventDays(event, timeZone)\n  if (first.getTime() === last.getTime()) {\n    return [\n      formatDate(first, dayStyle),\n      event.allDay ? 'All day' : formatTimeRange(event.start, event.end, timeZone),\n    ]\n  }\n  if (event.allDay)\n    return [`${formatDate(first, dayStyle)} – ${formatDate(last, dayStyle)}`]\n  return [\n    `${formatDate(first, dayStyle)}, ${formatTime(event.start, timeZone)} – ${formatDate(last, dayStyle)}, ${formatTime(new Date(getEnd(event)), timeZone)}`,\n  ]\n}\n\nfunction formatEventDate(\n  event: ScheduleEvent,\n  timeZone = 'UTC',\n  style: 'long' | 'short' = 'short',\n) {\n  return joinDetails(...getEventWhen(event, timeZone, style))\n}\n\nfunction getEventLabel(event: ScheduleEvent, timeZone = 'UTC') {\n  return [\n    event.title,\n    ...getEventWhen(event, timeZone, 'long'),\n    event.calendar,\n    event.location,\n  ]\n    .filter(Boolean)\n    .join(', ')\n}\n\nfunction EventName({ event, timeZone }: { event: ScheduleEvent; timeZone: string }) {\n  return <span className='sr-only'>{getEventLabel(event, timeZone)}</span>\n}\n\nfunction formatShortTime(date: Date, timeZone: string) {\n  const { hour, minute } = zonedParts(date, timeZone)\n  const time = `${hour % 12 || 12}${minute === 0 ? '' : `:${String(minute).padStart(2, '0')}`}`\n  return `${time}${hour < 12 ? 'a' : 'p'}`\n}\n\nconst SURFACE = 'var(--calendar-surface, var(--color-card))'\nconst SURFACE_BG = 'bg-[var(--calendar-surface,var(--color-card))]'\n\nconst eventStyle = (event: ScheduleEvent, ended = false) =>\n  getEventStyle(event, ended, SURFACE)\n\nconst eventFocus =\n  'outline-none focus-visible:z-20 focus-visible:ring-[3px] focus-visible:ring-ring/50'\n\ninterface CalendarToolbarProps {\n  children?: ReactNode\n  className?: string\n  description?: ReactNode\n  /** Turns Next off, such as at the last week with data. */\n  nextDisabled?: boolean\n  nextLabel?: string\n  onNext: () => void\n  onPrevious: () => void\n  onToday: () => void\n  onViewChange?: (view: string) => void\n  /** Turns Previous off, such as at the first week with data. */\n  previousDisabled?: boolean\n  previousLabel?: string\n  title: ReactNode\n  view?: string\n  views?: { label: string; value: string }[]\n}\n\nfunction CalendarToolbar({\n  children,\n  className,\n  description,\n  nextDisabled = false,\n  nextLabel = 'Next',\n  onNext,\n  onPrevious,\n  onToday,\n  onViewChange,\n  previousDisabled = false,\n  previousLabel = 'Previous',\n  title,\n  view,\n  views,\n}: CalendarToolbarProps) {\n  return (\n    <div\n      className={cn(\n        'flex flex-wrap items-start justify-between gap-x-4 gap-y-3',\n        className,\n      )}\n    >\n      <div className='flex min-w-0 flex-col gap-0.5'>\n        <h2 aria-live='polite' className='font-semibold tracking-tight'>\n          {title}\n        </h2>\n        {description && <p className='text-muted-foreground text-sm'>{description}</p>}\n      </div>\n      <div className='contents @md:flex @md:flex-wrap @md:items-center @md:gap-2'>\n        <div className='order-first flex basis-full flex-wrap items-center gap-2 @md:order-none @md:basis-auto'>\n          <Button variant='outline' size='sm' onClick={onToday}>\n            Today\n          </Button>\n          <ButtonGroup>\n            <Button\n              variant='outline'\n              size='icon-sm'\n              aria-label={previousLabel}\n              disabled={previousDisabled}\n              onClick={onPrevious}\n            >\n              <IconPlaceholder\n                lucide='ChevronLeftIcon'\n                tabler='IconChevronLeft'\n                hugeicons='ArrowLeft01Icon'\n                phosphor='CaretLeftIcon'\n                remixicon='RiArrowLeftSLine'\n              />\n            </Button>\n            <Button\n              variant='outline'\n              size='icon-sm'\n              aria-label={nextLabel}\n              disabled={nextDisabled}\n              onClick={onNext}\n            >\n              <IconPlaceholder\n                lucide='ChevronRightIcon'\n                tabler='IconChevronRight'\n                hugeicons='ArrowRight01Icon'\n                phosphor='CaretRightIcon'\n                remixicon='RiArrowRightSLine'\n              />\n            </Button>\n          </ButtonGroup>\n          {views && view !== undefined && (\n            <Tabs\n              className='ms-auto @md:ms-0'\n              value={view}\n              onValueChange={(next) => onViewChange?.(String(next))}\n            >\n              <TabsList aria-label='View'>\n                {views.map((option) => (\n                  <TabsTrigger key={option.value} value={option.value}>\n                    {option.label}\n                  </TabsTrigger>\n                ))}\n              </TabsList>\n            </Tabs>\n          )}\n        </div>\n        {children}\n      </div>\n    </div>\n  )\n}\n\ninterface EventBarProps {\n  continuesAfter?: boolean\n  continuesBefore?: boolean\n  event: ScheduleEvent\n  now?: Date\n  onSelect?: () => void\n  selected?: boolean\n  stickyTitle?: boolean\n  style?: CSSProperties\n  tabIndex?: number\n  className?: string\n  timeZone: string\n  /** Lets the title run onto a second line instead of cutting it, where the row can grow. */\n  wrap?: boolean\n}\n\nfunction EventBar({\n  className,\n  continuesAfter,\n  continuesBefore,\n  event,\n  now,\n  onSelect,\n  selected,\n  stickyTitle,\n  style,\n  tabIndex,\n  timeZone,\n  wrap = false,\n}: EventBarProps) {\n  const ended = now !== undefined && getEnd(event) <= now.getTime()\n  return (\n    <button\n      type='button'\n      data-event-id={event.id}\n      tabIndex={tabIndex}\n      aria-current={selected ? 'true' : undefined}\n      onClick={onSelect}\n      className={cn(\n        'flex w-full min-w-0 gap-1 rounded-sm px-1.5 text-left text-xs font-medium',\n        wrap ? 'min-h-5 items-start py-0.5 leading-4' : 'h-5 items-center',\n        continuesBefore && 'rounded-l-none',\n        continuesAfter && 'rounded-r-none',\n        ended && 'text-foreground/70',\n        selected && 'ring-primary ring-2',\n        eventFocus,\n        className,\n      )}\n      style={{ ...eventStyle(event, ended), ...style }}\n    >\n      {!event.allDay && !continuesBefore && (\n        <span aria-hidden className='text-foreground/70 shrink-0 tabular-nums'>\n          {formatShortTime(event.start, timeZone)}\n        </span>\n      )}\n      <span\n        aria-hidden\n        className={cn(\n          wrap ? 'line-clamp-2 break-words' : 'truncate',\n          stickyTitle && 'sticky left-[4.375rem]',\n        )}\n      >\n        {event.title}\n      </span>\n      <EventName event={event} timeZone={timeZone} />\n    </button>\n  )\n}\n\ninterface CalendarMonthViewProps<T extends ScheduleEvent = CalendarEvent> {\n  className?: string\n  events: T[]\n  label: string\n  /** Rows of events a day shows, counting \"+N more\". */\n  maxRows?: number\n  /** The month shown, as a plain day from `getDay`. */\n  month: Date\n  now: Date\n  onMonthChange: (month: Date) => void\n  onSelectDay?: (day: Date) => void\n  onSelectEvent?: (event: T) => void\n  onShowMore?: (day: Date) => void\n  selectedDay?: Date\n  selectedEventId?: string\n  /** @default 'UTC' */\n  timeZone?: string\n  /** 0 for Sunday, 1 for Monday. */\n  weekStartsOn?: 0 | 1\n}\n\ntype MonthSlot<T extends ScheduleEvent> =\n  | { segment: EventSegment<T>; type: 'bar' }\n  | { event: T; type: 'event' }\n  | { count: number; type: 'more' }\n\nfunction CalendarMonthView<T extends ScheduleEvent = CalendarEvent>({\n  className,\n  events,\n  label,\n  maxRows = 3,\n  month,\n  now,\n  onMonthChange,\n  onSelectDay,\n  onSelectEvent,\n  onShowMore = onSelectDay,\n  selectedDay,\n  selectedEventId,\n  timeZone = 'UTC',\n  weekStartsOn = 0,\n}: CalendarMonthViewProps<T>) {\n  const grid = useRef<HTMLDivElement>(null)\n  const [cursor, setCursor] = useState<Date | null>(null)\n  const shouldFocus = useRef(false)\n\n  const weeks = getMonthWeeks(month, weekStartsOn)\n  const today = getDay(now, timeZone).getTime()\n  const inMonth = (day: Date) =>\n    day.getUTCFullYear() === month.getUTCFullYear() &&\n    day.getUTCMonth() === month.getUTCMonth()\n  const fallback =\n    selectedDay && inMonth(selectedDay)\n      ? selectedDay\n      : inMonth(new Date(today))\n        ? new Date(today)\n        : startOfMonth(month)\n  const active = cursor && inMonth(cursor) ? cursor : fallback\n  const barRows = Math.max(0, maxRows - 1)\n\n  const spanning = events.filter((event) => spansDays(event, timeZone))\n  const timedByDay = new Map<string, T[]>()\n  for (const event of events) {\n    if (spansDays(event, timeZone)) continue\n    const key = dayIn(event.start, timeZone)\n    timedByDay.set(key, [...(timedByDay.get(key) ?? []), event])\n  }\n  for (const dayEvents of timedByDay.values()) {\n    dayEvents.sort((a, b) => a.start.getTime() - b.start.getTime())\n  }\n\n  useEffect(() => {\n    if (!shouldFocus.current) return\n    shouldFocus.current = false\n    grid.current\n      ?.querySelector<HTMLElement>(`[data-day=\"${toKey(active)}\"] [data-day-button]`)\n      ?.focus()\n  })\n\n  const moveTo = (day: Date) => {\n    setCursor(day)\n    shouldFocus.current = true\n    if (!inMonth(day)) onMonthChange(startOfMonth(day))\n  }\n\n  const moveMonths = (months: number) => {\n    const target = startOfMonth(active, months)\n    const lastDay = startOfMonth(target, 1).getTime() - DAY\n    moveTo(\n      new Date(Math.min(target.getTime() + (active.getUTCDate() - 1) * DAY, lastDay)),\n    )\n  }\n\n  const onKeyDown = (event: KeyboardEvent<HTMLDivElement>) => {\n    const weekday = (active.getUTCDay() - weekStartsOn + 7) % 7\n    switch (event.key) {\n      case 'ArrowRight':\n        moveTo(addDays(active, 1))\n        break\n      case 'ArrowLeft':\n        moveTo(addDays(active, -1))\n        break\n      case 'ArrowDown':\n        moveTo(addDays(active, 7))\n        break\n      case 'ArrowUp':\n        moveTo(addDays(active, -7))\n        break\n      case 'Home':\n        moveTo(addDays(active, -weekday))\n        break\n      case 'End':\n        moveTo(addDays(active, 6 - weekday))\n        break\n      case 'PageDown':\n        moveMonths(event.shiftKey ? 12 : 1)\n        break\n      case 'PageUp':\n        moveMonths(event.shiftKey ? -12 : -1)\n        break\n      default:\n        return\n    }\n    event.preventDefault()\n  }\n\n  return (\n    // oxlint-disable-next-line jsx-a11y/interactive-supports-focus -- focus roves over the cells inside, as the APG grid pattern does\n    <div\n      ref={grid}\n      role='grid'\n      aria-label={label}\n      onKeyDown={onKeyDown}\n      onFocus={(event) => {\n        const key = (event.target as HTMLElement).closest<HTMLElement>('[data-day]')\n          ?.dataset.day\n        if (key) setCursor(new Date(key))\n      }}\n      className={cn('@container flex flex-col border-b', className)}\n    >\n      <div role='row' className='grid grid-cols-7'>\n        {weeks[0].map((day) => (\n          <div\n            key={day.getTime()}\n            role='columnheader'\n            aria-label={formatDate(day, 'weekday-long')}\n            className='text-muted-foreground pb-2 text-center text-xs font-medium @2xl:px-1.5 @2xl:text-left'\n          >\n            <span className='@2xl:hidden'>{formatDate(day, 'weekday-narrow')}</span>\n            <span className='hidden @2xl:inline'>{formatDate(day, 'weekday')}</span>\n          </div>\n        ))}\n      </div>\n      {weeks.map((week) => {\n        const segments = layoutSegments(spanning, week, timeZone)\n        const activeColumn = week.findIndex((day) => day.getTime() === active.getTime())\n        return (\n          <div key={week[0].getTime()} role='row' className='grid grid-cols-7 border-t'>\n            {week.map((day, column) => {\n              const key = toKey(day)\n              const covering = segments.filter(\n                (segment) =>\n                  segment.start <= column && column < segment.start + segment.span,\n              )\n              const timed = timedByDay.get(key) ?? []\n              const count = covering.length + timed.length\n              const isToday = day.getTime() === today\n              const isSelected = selectedDay?.getTime() === day.getTime()\n              const isActive = active.getTime() === day.getTime()\n              const outside = !inMonth(day)\n              const dayName = formatDate(day, 'weekday-long-day')\n\n              const slots: (MonthSlot<T> | undefined)[] = []\n              for (const segment of covering) {\n                if (segment.lane < barRows) slots[segment.lane] = { segment, type: 'bar' }\n              }\n              const queue = [...timed]\n              const hidden = covering.filter((segment) => segment.lane >= barRows).length\n              for (let row = 0; row < maxRows; row++) {\n                if (slots[row]) continue\n                const remaining = queue.length + hidden\n                if (remaining === 0) break\n                if ((row === maxRows - 1 && remaining > 1) || queue.length === 0) {\n                  slots[row] = { count: remaining, type: 'more' }\n                  break\n                }\n                slots[row] = { event: queue.shift() as T, type: 'event' }\n              }\n              const tabIndex = isActive ? 0 : -1\n\n              return (\n                <div\n                  key={key}\n                  role='gridcell'\n                  aria-selected={isSelected}\n                  data-day={key}\n                  className='group/day relative flex min-h-12 min-w-0 flex-col items-center gap-0.5 border-l p-1 first:border-l-0 @2xl:min-h-28 @2xl:items-stretch'\n                >\n                  <button\n                    type='button'\n                    data-day-button\n                    tabIndex={tabIndex}\n                    aria-label={[\n                      dayName,\n                      isToday ? 'today' : '',\n                      count === 0\n                        ? 'no events'\n                        : `${count} ${count === 1 ? 'event' : 'events'}`,\n                    ]\n                      .filter(Boolean)\n                      .join(', ')}\n                    aria-current={isToday ? 'date' : undefined}\n                    onClick={() => {\n                      setCursor(day)\n                      onSelectDay?.(day)\n                    }}\n                    className={cn(\n                      'focus-visible:ring-ring/50 absolute inset-0 outline-none focus-visible:z-10 focus-visible:ring-[3px] focus-visible:ring-inset',\n                      outside ? 'bg-muted/30 hover:bg-muted' : 'hover:bg-muted/50',\n                    )}\n                  />\n                  <span\n                    aria-hidden\n                    className={cn(\n                      'pointer-events-none relative flex size-7 shrink-0 items-center justify-center rounded-full text-sm tabular-nums @2xl:size-6 @2xl:text-xs',\n                      outside && 'text-muted-foreground group-hover/day:text-foreground',\n                      isToday &&\n                        !isSelected &&\n                        'text-primary ring-primary font-semibold ring-1',\n                      isSelected && 'bg-primary text-primary-foreground font-semibold',\n                    )}\n                  >\n                    {day.getUTCDate()}\n                  </span>\n                  <span\n                    aria-hidden\n                    className='pointer-events-none relative flex h-1.5 items-center gap-0.5 @2xl:hidden'\n                  >\n                    {[...covering.map((segment) => segment.event), ...timed]\n                      .slice(0, 3)\n                      .map((event) => (\n                        <span\n                          key={event.id}\n                          className='size-1.5 rounded-full'\n                          style={{\n                            backgroundColor: event.color ?? 'var(--color-chart-2)',\n                          }}\n                        />\n                      ))}\n                  </span>\n                  {slots.length > 0 && (\n                    <ul className='hidden flex-col gap-0.5 @2xl:flex'>\n                      {Array.from(slots, (slot, row) => {\n                        if (\n                          !slot ||\n                          (slot.type === 'bar' && slot.segment.start !== column)\n                        ) {\n                          return <li key={row} aria-hidden className='h-5' />\n                        }\n                        if (slot.type === 'bar') {\n                          const { continuesAfter, continuesBefore, event, span, start } =\n                            slot.segment\n                          const covers =\n                            activeColumn >= start && activeColumn < start + span\n                          return (\n                            <li key={row} className='relative h-5'>\n                              <EventBar\n                                event={event}\n                                now={now}\n                                timeZone={timeZone}\n                                tabIndex={covers ? 0 : -1}\n                                selected={event.id === selectedEventId}\n                                continuesBefore={continuesBefore}\n                                continuesAfter={continuesAfter}\n                                onSelect={() => onSelectEvent?.(event)}\n                                className='absolute inset-y-0 left-0 z-10'\n                                style={{\n                                  width: `calc(${span} * 100% + ${span - 1} * (0.5rem + 1px))`,\n                                }}\n                              />\n                            </li>\n                          )\n                        }\n                        if (slot.type === 'more') {\n                          return (\n                            <li key={row} className='relative'>\n                              <button\n                                type='button'\n                                tabIndex={tabIndex}\n                                aria-label={`${slot.count} more ${slot.count === 1 ? 'event' : 'events'} on ${dayName}`}\n                                onClick={() => {\n                                  setCursor(day)\n                                  onShowMore?.(day)\n                                }}\n                                className={cn(\n                                  'text-muted-foreground hover:bg-muted hover:text-foreground flex h-5 w-full items-center rounded-sm px-1 text-xs font-medium',\n                                  outside && 'group-hover/day:text-foreground',\n                                  eventFocus,\n                                )}\n                              >\n                                +{slot.count} more\n                              </button>\n                            </li>\n                          )\n                        }\n                        const { event } = slot\n                        const ended = getEnd(event) <= now.getTime()\n                        const selected = event.id === selectedEventId\n                        return (\n                          <li key={row} className='relative'>\n                            <button\n                              type='button'\n                              data-event-id={event.id}\n                              tabIndex={tabIndex}\n                              aria-current={selected ? 'true' : undefined}\n                              onClick={() => onSelectEvent?.(event)}\n                              className={cn(\n                                'hover:bg-muted hover:text-foreground group flex h-5 w-full min-w-0 items-center gap-1 rounded-sm px-1 text-left text-xs',\n                                selected\n                                  ? 'bg-muted ring-primary ring-2'\n                                  : ended && 'text-muted-foreground',\n                                outside && 'group-hover/day:text-foreground',\n                                eventFocus,\n                              )}\n                            >\n                              <span\n                                aria-hidden\n                                className='size-1.5 shrink-0 rounded-full'\n                                style={{\n                                  backgroundColor: event.color ?? 'var(--color-chart-2)',\n                                }}\n                              />\n                              <span\n                                aria-hidden\n                                className={cn(\n                                  'shrink-0 tabular-nums',\n                                  !selected &&\n                                    'text-muted-foreground group-hover:text-foreground',\n                                  !selected &&\n                                    outside &&\n                                    'group-hover/day:text-foreground',\n                                )}\n                              >\n                                {formatShortTime(event.start, timeZone)}\n                              </span>\n                              <span aria-hidden className='truncate font-medium'>\n                                {event.title}\n                              </span>\n                              <EventName event={event} timeZone={timeZone} />\n                            </button>\n                          </li>\n                        )\n                      })}\n                    </ul>\n                  )}\n                </div>\n              )\n            })}\n          </div>\n        )\n      })}\n    </div>\n  )\n}\n\ninterface TimeGridColumn<T extends ScheduleEvent> {\n  day: Date\n  events: T[]\n  header: ReactNode\n  key: string\n  label: string\n}\n\ninterface CalendarTimeGridProps<T extends ScheduleEvent = CalendarEvent> {\n  /** Sets the height of the scrolling area. */\n  className?: string\n  /** Last hour shown, 1–24. */\n  endHour?: number\n  events: T[]\n  /** How narrow a column gets before the grid scrolls sideways. */\n  minColumnWidth?: string\n  now: Date\n  onSelectEvent?: (event: T) => void\n  scrollToHour?: number\n  selectedEventId?: string\n  /** First hour shown, 0–23. */\n  startHour?: number\n  /** @default 'UTC' */\n  timeZone?: string\n}\n\nfunction TimeGrid<T extends ScheduleEvent>({\n  allDay,\n  className,\n  columns,\n  endHour = 24,\n  minColumnWidth = '6rem',\n  now,\n  onSelectEvent,\n  scrollToHour = 8,\n  selectedEventId,\n  startHour = 0,\n  timeZone = 'UTC',\n}: Omit<CalendarTimeGridProps<T>, 'events'> & {\n  allDay: EventSegment<T>[]\n  columns: TimeGridColumn<T>[]\n}) {\n  const scroller = useRef<HTMLDivElement>(null)\n  const body = useRef<HTMLDivElement>(null)\n  const hours = endHour - startHour\n  const todayKey = dayIn(now, timeZone)\n  const nowParts = zonedParts(now, timeZone)\n  const nowMinutes = (nowParts.hour - startHour) * 60 + nowParts.minute\n  const showNow =\n    nowMinutes >= 0 &&\n    nowMinutes <= hours * 60 &&\n    columns.some((column) => toKey(column.day) === todayKey)\n  const template = `${GUTTER} repeat(${columns.length}, minmax(${minColumnWidth}, 1fr))`\n  const percent = (minutes: number) => `${(minutes / (hours * 60)) * 100}%`\n\n  useEffect(() => {\n    const element = scroller.current\n    const content = body.current\n    if (!element || !content) return\n    element.scrollTop =\n      (content.offsetHeight * (scrollToHour - startHour)) / hours - HOUR_LABEL_OFFSET_PX\n    const today = content.querySelector<HTMLElement>('[data-today]')\n    const gutter = content.firstElementChild as HTMLElement | null\n    if (today && gutter) element.scrollLeft = today.offsetLeft - gutter.offsetWidth\n  }, [hours, scrollToHour, startHour])\n\n  return (\n    <div\n      ref={scroller}\n      className={cn(\n        'relative h-[32rem] overflow-auto border-y [scrollbar-width:thin]',\n        className,\n      )}\n    >\n      <div\n        style={{\n          minWidth: `calc(${GUTTER} + ${columns.length} * ${minColumnWidth})`,\n        }}\n      >\n        <div\n          className={cn('sticky top-0 z-30 grid border-b', SURFACE_BG)}\n          style={{ gridTemplateColumns: template }}\n        >\n          <div className={cn('sticky left-0 z-10', SURFACE_BG)} />\n          {columns.map((column) => (\n            <div key={column.key} className='min-w-0 border-l px-1 py-2'>\n              {column.header}\n            </div>\n          ))}\n          {allDay.length > 0 && (\n            <>\n              <div\n                aria-hidden\n                className={cn(\n                  'text-muted-foreground sticky left-0 z-10 border-t py-1 pr-2 text-right text-xs',\n                  SURFACE_BG,\n                )}\n              >\n                All day\n              </div>\n              <ul\n                aria-label='All-day events'\n                className='grid gap-y-0.5 border-t py-1'\n                style={{\n                  gridColumn: `span ${columns.length}`,\n                  gridTemplateColumns: `repeat(${columns.length}, minmax(0, 1fr))`,\n                }}\n              >\n                {allDay.map(\n                  ({ continuesAfter, continuesBefore, event, lane, span, start }) => (\n                    <li\n                      key={event.id}\n                      className={cn(\n                        'min-w-0',\n                        !continuesBefore && 'pl-0.5',\n                        !continuesAfter && 'pr-0.5',\n                      )}\n                      style={{\n                        gridColumn: `${start + 1} / span ${span}`,\n                        gridRow: lane + 1,\n                      }}\n                    >\n                      <EventBar\n                        event={event}\n                        now={now}\n                        timeZone={timeZone}\n                        selected={event.id === selectedEventId}\n                        continuesBefore={continuesBefore}\n                        continuesAfter={continuesAfter}\n                        onSelect={() => onSelectEvent?.(event)}\n                        stickyTitle\n                        wrap\n                      />\n                    </li>\n                  ),\n                )}\n              </ul>\n            </>\n          )}\n        </div>\n        <div\n          ref={body}\n          className='relative grid'\n          style={{ gridTemplateColumns: template, height: `${hours * 3}rem` }}\n        >\n          <div aria-hidden className={cn('sticky left-0 z-20', SURFACE_BG)}>\n            {Array.from({ length: hours - 1 }, (_, index) => {\n              const hour = startHour + index + 1\n              const underNow = showNow && Math.abs(nowMinutes - (index + 1) * 60) < 15\n              return (\n                <span\n                  key={hour}\n                  className={cn(\n                    'text-muted-foreground absolute right-2 -translate-y-1/2 text-xs whitespace-nowrap tabular-nums',\n                    underNow && 'invisible',\n                  )}\n                  style={{ top: percent((index + 1) * 60) }}\n                >\n                  {hour % 12 || 12} {hour < 12 || hour === 24 ? 'AM' : 'PM'}\n                </span>\n              )\n            })}\n            {showNow && (\n              <span\n                className='absolute right-1 z-10 -translate-y-1/2 rounded-sm bg-red-600 px-1 text-xs font-medium text-white tabular-nums'\n                style={{ top: percent(nowMinutes) }}\n              >\n                {formatTime(now, timeZone).replace(' ', ' ')}\n              </span>\n            )}\n          </div>\n          {columns.map((column) => {\n            const isToday = toKey(column.day) === todayKey\n            return (\n              <div\n                key={column.key}\n                role='group'\n                aria-label={column.label}\n                data-today={isToday || undefined}\n                className='relative min-w-0 border-l'\n                style={{\n                  backgroundImage:\n                    'linear-gradient(to bottom, var(--color-border) 1px, transparent 1px)',\n                  backgroundSize: `100% ${100 / hours}%`,\n                }}\n              >\n                {column.events.length > 0 && (\n                  <ul>\n                    {layoutEvents(column.events).map(\n                      ({ event, lane, lanes, span, uncoveredMinutes }) => {\n                        const { hour, minute } = zonedParts(event.start, timeZone)\n                        const top = Math.max(0, (hour - startHour) * 60 + minute)\n                        const minutes = getMinutes(event)\n                        const bottom = Math.min(\n                          hours * 60,\n                          (hour - startHour) * 60 + minute + minutes,\n                        )\n                        if (bottom <= 0 || top >= hours * 60) return null\n                        const ended = getEnd(event) <= now.getTime()\n                        const selected = event.id === selectedEventId\n                        const short =\n                          minutes < SHORT_EVENT_MINUTES || !fitsLines(2, uncoveredMinutes)\n                        const showsLocation =\n                          minutes >= LOCATION_EVENT_MINUTES &&\n                          Boolean(event.location) &&\n                          fitsLines(3, uncoveredMinutes)\n                        return (\n                          <li\n                            key={event.id}\n                            className='absolute z-[2] px-px'\n                            style={{\n                              height: `max(1.5rem, ${percent(bottom - top)})`,\n                              left: `${(lane / lanes) * 100}%`,\n                              top: percent(top),\n                              width: `${(span / lanes) * 100}%`,\n                            }}\n                          >\n                            <button\n                              type='button'\n                              data-event-id={event.id}\n                              aria-current={selected ? 'true' : undefined}\n                              onClick={() => onSelectEvent?.(event)}\n                              className={cn(\n                                'flex size-full min-w-0 overflow-hidden rounded-sm px-1.5 py-0.5 text-left text-xs leading-4 ring-1 ring-[var(--calendar-surface,var(--color-card))]',\n                                short ? 'gap-1' : 'flex-col',\n                                short && minutes < SHORT_EVENT_MINUTES && 'items-center',\n                                ended && 'text-foreground/70',\n                                selected && 'ring-primary relative z-10 ring-2',\n                                eventFocus,\n                              )}\n                              style={eventStyle(event, ended)}\n                            >\n                              <span aria-hidden className='truncate font-medium'>\n                                {event.title}\n                              </span>\n                              <EventName event={event} timeZone={timeZone} />\n                              <span\n                                aria-hidden\n                                className='text-foreground/70 truncate tabular-nums'\n                              >\n                                {short\n                                  ? formatShortTime(event.start, timeZone)\n                                  : formatTimeRange(event.start, event.end, timeZone)}\n                              </span>\n                              {showsLocation && (\n                                <span aria-hidden className='text-foreground/70 truncate'>\n                                  {event.location}\n                                </span>\n                              )}\n                            </button>\n                          </li>\n                        )\n                      },\n                    )}\n                  </ul>\n                )}\n                {isToday && showNow && (\n                  <div\n                    aria-hidden\n                    className='pointer-events-none absolute inset-x-0 z-10 h-0.5 -translate-y-1/2 bg-red-600'\n                    style={{ top: percent(nowMinutes) }}\n                  >\n                    <span className='absolute top-1/2 -left-1 size-2 -translate-y-1/2 rounded-full bg-red-600' />\n                  </div>\n                )}\n              </div>\n            )\n          })}\n        </div>\n      </div>\n    </div>\n  )\n}\n\ninterface CalendarWeekViewProps<\n  T extends ScheduleEvent = CalendarEvent,\n> extends CalendarTimeGridProps<T> {\n  /** Consecutive plain days, such as `getWeekDays(day)`. */\n  days: Date[]\n}\n\nfunction CalendarWeekView<T extends ScheduleEvent = CalendarEvent>({\n  days,\n  events,\n  ...props\n}: CalendarWeekViewProps<T>) {\n  const { now, timeZone = 'UTC' } = props\n  const todayKey = dayIn(now, timeZone)\n  const timed = events.filter((event) => !spansDays(event, timeZone))\n  const columns = days.map((day) => {\n    const key = toKey(day)\n    const isToday = key === todayKey\n    const name = formatDate(day, 'weekday-long-day')\n    return {\n      day,\n      events: timed.filter((event) => dayIn(event.start, timeZone) === key),\n      header: (\n        <div className='flex flex-col items-center gap-0.5'>\n          <span aria-hidden className='text-muted-foreground text-xs'>\n            {formatDate(day, 'weekday')}\n          </span>\n          <span\n            aria-hidden\n            className={cn(\n              'flex size-7 items-center justify-center rounded-full text-sm font-medium tabular-nums',\n              isToday && 'bg-primary text-primary-foreground',\n            )}\n          >\n            {day.getUTCDate()}\n          </span>\n          <span className='sr-only'>\n            {name}\n            {isToday && ', today'}\n          </span>\n        </div>\n      ),\n      key,\n      label: isToday ? `${name}, today` : name,\n    }\n  })\n  const allDay = layoutSegments(\n    events.filter((event) => spansDays(event, timeZone)),\n    days,\n    timeZone,\n  )\n  return <TimeGrid allDay={allDay} columns={columns} {...props} />\n}\n\ninterface CalendarResource {\n  description?: ReactNode\n  id: string\n  name: string\n}\n\ninterface CalendarResourceViewProps<\n  T extends CalendarEvent = CalendarEvent,\n> extends CalendarTimeGridProps<T> {\n  /** The plain day shown. */\n  day: Date\n  resources: CalendarResource[]\n}\n\nfunction CalendarResourceView<T extends CalendarEvent = CalendarEvent>({\n  day,\n  events,\n  resources,\n  ...props\n}: CalendarResourceViewProps<T>) {\n  const { timeZone = 'UTC' } = props\n  const dayEvents = getEventsForDay(events, day, timeZone)\n  const allDay: EventSegment<T>[] = []\n  const columns = resources.map((resource, index) => {\n    const own = dayEvents.filter((event) => event.resource === resource.id)\n    own\n      .filter((event) => spansDays(event, timeZone))\n      .forEach((event, lane) => {\n        allDay.push({\n          continuesAfter: false,\n          continuesBefore: false,\n          event,\n          lane,\n          span: 1,\n          start: index,\n        })\n      })\n    return {\n      day,\n      events: own.filter((event) => !spansDays(event, timeZone)),\n      header: (\n        <div className='flex min-w-0 flex-col px-1'>\n          <span className='truncate text-sm font-medium'>{resource.name}</span>\n          {resource.description && (\n            <div className='text-muted-foreground truncate text-xs'>\n              {resource.description}\n            </div>\n          )}\n        </div>\n      ),\n      key: resource.id,\n      label: resource.name,\n    }\n  })\n  return <TimeGrid allDay={allDay} columns={columns} {...props} />\n}\n\ninterface CalendarEventListProps<T extends ScheduleEvent = CalendarEvent> {\n  className?: string\n  emptyLabel?: string\n  /** In order, such as from `getEventsForDay`. */\n  events: T[]\n  now?: Date\n  onSelectEvent: (event: T) => void\n  selectedEventId?: string\n  /** @default 'UTC' */\n  timeZone?: string\n}\n\nfunction CalendarEventList<T extends ScheduleEvent = CalendarEvent>({\n  className,\n  emptyLabel = 'Nothing scheduled.',\n  events,\n  now,\n  onSelectEvent,\n  selectedEventId,\n  timeZone = 'UTC',\n}: CalendarEventListProps<T>) {\n  if (events.length === 0) {\n    return <p className={cn('text-muted-foreground text-sm', className)}>{emptyLabel}</p>\n  }\n  return (\n    <ul className={cn('flex flex-col', className)}>\n      {events.map((event) => {\n        const ended = now !== undefined && getEnd(event) <= now.getTime()\n        const selected = event.id === selectedEventId\n        const meta = joinDetails(event.calendar, event.location)\n        return (\n          <li key={event.id}>\n            <button\n              type='button'\n              data-event-id={event.id}\n              aria-current={selected ? 'true' : undefined}\n              onClick={() => onSelectEvent(event)}\n              className={cn(\n                'hover:bg-muted group flex w-full items-stretch gap-3 rounded-md px-2 py-1.5 text-left text-sm',\n                selected && 'bg-muted',\n                eventFocus,\n              )}\n            >\n              <span\n                className={cn(\n                  'w-16 shrink-0 pt-px text-xs whitespace-nowrap tabular-nums',\n                  !selected && 'text-muted-foreground group-hover:text-foreground',\n                )}\n              >\n                {spansDays(event, timeZone)\n                  ? 'All day'\n                  : formatTime(event.start, timeZone)}\n              </span>\n              <span\n                aria-hidden\n                className={cn('w-1 shrink-0 rounded-full', ended && 'opacity-40')}\n                style={{ backgroundColor: event.color ?? 'var(--color-chart-2)' }}\n              />\n              <span className='flex min-w-0 flex-1 flex-col gap-0.5'>\n                <span\n                  className={cn(\n                    'font-medium',\n                    ended && !selected && 'text-muted-foreground',\n                  )}\n                >\n                  {event.title}\n                </span>\n                {meta && (\n                  <span\n                    className={cn(\n                      'truncate text-xs',\n                      !selected && 'text-muted-foreground group-hover:text-foreground',\n                    )}\n                  >\n                    {meta}\n                  </span>\n                )}\n              </span>\n            </button>\n          </li>\n        )\n      })}\n    </ul>\n  )\n}\n\ninterface CalendarEventDetailsProps {\n  actions?: ReactNode\n  className?: string\n  event: CalendarEvent\n  /** Adds a close button. */\n  onClose?: () => void\n  /** @default 'UTC' */\n  timeZone?: string\n}\n\nfunction CalendarEventDetails({\n  actions,\n  className,\n  event,\n  onClose,\n  timeZone = 'UTC',\n}: CalendarEventDetailsProps) {\n  const id = useId()\n  const color = event.color ?? 'var(--color-chart-2)'\n  return (\n    <section\n      aria-labelledby={id}\n      className={cn('flex flex-col gap-4 text-sm', className)}\n    >\n      <div className='flex items-start gap-3'>\n        <span\n          aria-hidden\n          className='mt-1.5 size-3 shrink-0 rounded-sm'\n          style={{ backgroundColor: color }}\n        />\n        <div className='flex min-w-0 flex-1 flex-col gap-0.5'>\n          <h3 id={id} className='leading-snug font-semibold tracking-tight break-words'>\n            {event.title}\n          </h3>\n          {getEventWhen(event, timeZone, 'long').map((line) => (\n            <p key={line} className='text-muted-foreground'>\n              {line}\n            </p>\n          ))}\n        </div>\n        {onClose && (\n          <Button\n            variant='ghost'\n            size='icon-sm'\n            aria-label='Close details'\n            onClick={onClose}\n            className='-mt-1'\n          >\n            <IconPlaceholder\n              lucide='XIcon'\n              tabler='IconX'\n              hugeicons='Cancel01Icon'\n              phosphor='XIcon'\n              remixicon='RiCloseLine'\n            />\n          </Button>\n        )}\n      </div>\n      <dl className='text-muted-foreground flex flex-col gap-2.5 [&_svg]:size-4 [&_svg]:shrink-0'>\n        {event.calendar && (\n          <div className='flex items-center gap-3'>\n            <dt className='flex'>\n              <IconPlaceholder\n                lucide='CalendarIcon'\n                tabler='IconCalendar'\n                hugeicons='CalendarIcon'\n                phosphor='CalendarBlankIcon'\n                remixicon='RiCalendarLine'\n                aria-hidden\n              />\n              <span className='sr-only'>Calendar</span>\n            </dt>\n            <dd className='text-foreground'>{event.calendar}</dd>\n          </div>\n        )}\n        {event.location && (\n          <div className='flex items-center gap-3'>\n            <dt className='flex'>\n              <IconPlaceholder\n                lucide='MapPinIcon'\n                tabler='IconMapPin'\n                hugeicons='Location01Icon'\n                phosphor='MapPinIcon'\n                remixicon='RiMapPinLine'\n                aria-hidden\n              />\n              <span className='sr-only'>Location</span>\n            </dt>\n            <dd className='text-foreground min-w-0 break-words'>{event.location}</dd>\n          </div>\n        )}\n        {event.attendees && event.attendees.length > 0 && (\n          <div className='flex items-start gap-3'>\n            <dt className='flex pt-1'>\n              <IconPlaceholder\n                lucide='UsersIcon'\n                tabler='IconUsers'\n                hugeicons='UserGroupIcon'\n                phosphor='UsersIcon'\n                remixicon='RiTeamLine'\n                aria-hidden\n              />\n              <span className='sr-only'>Attendees</span>\n            </dt>\n            <dd className='min-w-0 flex-1'>\n              <ul className='flex flex-col gap-1.5'>\n                {event.attendees.map((person) => (\n                  <li\n                    key={person.name}\n                    className='text-foreground flex items-center gap-2'\n                  >\n                    <PersonAvatar person={person} size='sm' />\n                    <span className='truncate'>{person.name}</span>\n                  </li>\n                ))}\n              </ul>\n            </dd>\n          </div>\n        )}\n      </dl>\n      {event.description && (\n        <p className='text-muted-foreground leading-relaxed'>{event.description}</p>\n      )}\n      {actions && <div className='flex flex-wrap gap-2'>{actions}</div>}\n    </section>\n  )\n}\n\ninterface CalendarLegendProps {\n  calendars: { color: string; name: string }[]\n  className?: string\n  hidden?: string[]\n  label?: string\n  /** Makes each calendar a toggle that shows or hides its events. */\n  onToggle?: (name: string) => void\n}\n\nfunction CalendarLegend({\n  calendars,\n  className,\n  hidden = [],\n  label = 'Calendars',\n  onToggle,\n}: CalendarLegendProps) {\n  return (\n    <ul\n      aria-label={label}\n      className={cn('flex flex-wrap gap-x-4 gap-y-1 text-xs', className)}\n    >\n      {calendars.map((calendar) => {\n        const shown = !hidden.includes(calendar.name)\n        if (!onToggle) {\n          return (\n            <li\n              key={calendar.name}\n              className='text-muted-foreground flex items-center gap-1.5'\n            >\n              <span\n                aria-hidden\n                className='size-2 shrink-0 rounded-full'\n                style={{ backgroundColor: calendar.color }}\n              />\n              {calendar.name}\n            </li>\n          )\n        }\n        return (\n          <li key={calendar.name}>\n            <button\n              type='button'\n              aria-pressed={shown}\n              onClick={() => onToggle(calendar.name)}\n              className='hover:bg-muted focus-visible:ring-ring/50 flex w-full items-center gap-2 rounded-md px-2 py-1.5 text-left text-sm outline-none focus-visible:ring-[3px]'\n            >\n              <span\n                aria-hidden\n                className='text-background flex size-4 shrink-0 items-center justify-center rounded-[4px] border-2 [&_svg]:size-3'\n                style={{\n                  backgroundColor: shown ? calendar.color : 'transparent',\n                  borderColor: calendar.color,\n                }}\n              >\n                {shown && (\n                  <IconPlaceholder\n                    lucide='CheckIcon'\n                    tabler='IconCheck'\n                    hugeicons='Tick02Icon'\n                    phosphor='CheckIcon'\n                    remixicon='RiCheckLine'\n                  />\n                )}\n              </span>\n              <span className={cn('truncate', !shown && 'text-muted-foreground')}>\n                {calendar.name}\n              </span>\n            </button>\n          </li>\n        )\n      })}\n    </ul>\n  )\n}\n\nexport {\n  CalendarEventDetails,\n  CalendarEventList,\n  CalendarLegend,\n  CalendarMonthView,\n  CalendarResourceView,\n  CalendarToolbar,\n  CalendarWeekView,\n  formatDayRange,\n  formatEventDate,\n  getEventDays,\n  getEventLabel,\n  getEventsForDay,\n  getWeekDays,\n  layoutEvents,\n  layoutSegments,\n  spansDays,\n  startOfMonth,\n}\n\nexport type {\n  CalendarEvent,\n  CalendarEventDetailsProps,\n  CalendarEventListProps,\n  CalendarLegendProps,\n  CalendarMonthViewProps,\n  CalendarResource,\n  CalendarResourceViewProps,\n  CalendarTimeGridProps,\n  CalendarToolbarProps,\n  CalendarWeekViewProps,\n  EventLayout,\n  EventSegment,\n}\n",
      "type": "registry:component",
      "target": "@components/dashboardblocks/calendar.tsx"
    }
  ],
  "type": "registry:component"
}
