calendar-components 0.0.0-stage → 0.7.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/time-grid/index.parts.ts","../src/time-grid/root/TimeGridRoot.tsx","../src/utils/useStore.ts","../src/time-grid/root/collection.ts","../src/time-grid/root/keyboardDelegate.ts","../src/time-grid/drag/useEventDragAndDrop.ts","../src/time-grid/event/useEventChange.ts","../src/time-grid/root/TimeGridRootContext.ts","../src/time-grid/drag/slots.ts","../src/time-grid/root/useHeadHeight.ts","../src/time-grid/root/TimeGridRootCssVars.ts","../src/time-grid/root/useScrollLock.ts","../src/time-grid/hours/TimeGridHours.tsx","../src/time-grid/offHours.ts","../src/time-grid/day-header/TimeGridDayHeader.tsx","../src/time-grid/column/useDayState.ts","../src/time-grid/all-day/TimeGridAllDay.tsx","../src/time-grid/all-day-event/TimeGridAllDayEvent.tsx","../src/time-grid/event/useEventRow.ts","../src/time-grid/column/TimeGridColumn.tsx","../src/time-grid/drag/TimeGridDropIndicator.tsx","../src/time-grid/column/TimeGridColumnContext.ts","../src/time-grid/lines/TimeGridLines.tsx","../src/time-grid/events/TimeGridEvents.tsx","../src/time-grid/event/TimeGridEvent.tsx","../src/utils/useDescription.ts","../src/time-grid/event/TimeGridEventContext.ts","../src/time-grid/event/useEventResize.ts","../src/utils/useEdgeScroll.ts","../src/time-grid/event/useEventPlacement.ts","../src/time-grid/event-resize-handle/TimeGridEventResizeHandle.tsx","../src/time-grid/now/TimeGridNow.tsx","../src/time-grid/useTimeGrid.ts","../src/time-grid/root/TimeGridRootDataAttributes.ts","../src/time-grid/column/TimeGridColumnDataAttributes.ts","../src/time-grid/day-header/TimeGridDayHeaderDataAttributes.ts","../src/time-grid/all-day/TimeGridAllDayDataAttributes.ts","../src/time-grid/event/TimeGridEventDataAttributes.ts","../src/time-grid/hours/TimeGridHoursDataAttributes.ts","../src/time-grid/hours/TimeGridHourDataAttributes.ts","../src/time-grid/lines/TimeGridLineDataAttributes.ts","../src/time-grid/all-day-event/TimeGridAllDayEventDataAttributes.ts","../src/time-grid/event-resize-handle/TimeGridEventResizeHandleDataAttributes.ts","../src/time-grid/now/TimeGridNowDataAttributes.ts"],"sourcesContent":["export { TimeGridRoot as Root } from \"./root/TimeGridRoot\";\nexport { TimeGridHour as Hour, TimeGridHours as Hours } from \"./hours/TimeGridHours\";\nexport { TimeGridDayHeader as DayHeader } from \"./day-header/TimeGridDayHeader\";\nexport { TimeGridAllDay as AllDay } from \"./all-day/TimeGridAllDay\";\nexport { TimeGridAllDayEvent as AllDayEvent } from \"./all-day-event/TimeGridAllDayEvent\";\nexport { TimeGridColumn as Column } from \"./column/TimeGridColumn\";\nexport { TimeGridLine as Line, TimeGridLines as Lines } from \"./lines/TimeGridLines\";\nexport { TimeGridEvents as Events } from \"./events/TimeGridEvents\";\nexport { TimeGridEvent as Event } from \"./event/TimeGridEvent\";\nexport { TimeGridEventResizeHandle as EventResizeHandle } from \"./event-resize-handle/TimeGridEventResizeHandle\";\nexport { TimeGridNow as Now } from \"./now/TimeGridNow\";\n","\"use client\";\n\nimport { createChangeDetails, createStore, compareEvents, getLocalTimeZone, labelsFor, localeInfo, nowOf, type CalendarDay, type CalendarLabels, type HourRange, type NavigationDay } from \"calendar-components-core\";\nimport * as React from \"react\";\nimport { I18nProvider, useLocale } from \"react-aria/I18nProvider\";\nimport { mergeRefs } from \"react-aria/mergeRefs\";\nimport { useCollator } from \"react-aria/useCollator\";\nimport { useGridList } from \"react-aria/useGridList\";\nimport { useListState } from \"react-stately/useListState\";\nimport type { Key } from \"@react-types/shared\";\nimport { mergePartProps } from \"../../internals/mergePartProps\";\nimport { renderElement, resolve } from \"../../internals/renderElement\";\nimport { TIME_GRID_SLOTS } from \"../../internals/slots\";\nimport type { CalendarComponentsPartElementProps } from \"../../internals/types\";\nimport { useChangeState } from \"../../utils/useChangeState\";\nimport { useLatest } from \"../../utils/useLatest\";\nimport { useStore } from \"../../utils/useStore\";\nimport { EventCollection } from \"./collection\";\nimport { timeGridKeyboardDelegate } from \"./keyboardDelegate\";\nimport { TimeGridDragContext, useEventDragAndDrop } from \"../drag/useEventDragAndDrop\";\nimport { useHeadHeight } from \"./useHeadHeight\";\nimport { useScrollLock } from \"./useScrollLock\";\nimport { TimeGridRootContext, type TimeGridEventChange, type TimeGridEventChangeDetails, type TimeGridRootContextValue, type TimeGridStoreState, type TimeGridValueChangeDetails } from \"./TimeGridRootContext\";\n\n/** Midnight to midnight: the same object each render. */\nconst WHOLE_DAY: HourRange = { from: 0, to: 24 };\n\nexport type TimeGridRootState = { editable: boolean; dragging: boolean; direction: \"ltr\" | \"rtl\" };\n\n/** Where to scroll to: a time of day in minutes past midnight, on a day shown (left out, the first day). */\nexport type TimeGridScrollTarget = { date?: string; minutes: number };\n\nexport interface TimeGridScrollOptions {\n /** @default \"auto\" */\n behavior?: ScrollBehavior;\n /**\n * Where in the scrolling area the time lands.\n * @default \"start\"\n */\n block?: ScrollLogicalPosition;\n /** Pixels kept clear over the time, for a header that stays put while the hours scroll. */\n offset?: number;\n}\n\nexport interface TimeGridRootActions {\n /**\n * Scrolls whatever the grid scrolls in (and across, to the day) so that a\n * time is in view. `\"now\"` is the time it is, in the grid's time zone, on\n * today when today is shown. A time outside the hours drawn goes to the\n * nearest that is. Returns false when there is no column to scroll to.\n */\n scrollToTime: (target: TimeGridScrollTarget | \"now\", options?: TimeGridScrollOptions) => boolean;\n /** Scrolls an event into view and gives it the keyboard. Returns false when it is not drawn. */\n scrollToEvent: (id: string, options?: Pick<TimeGridScrollOptions, \"behavior\" | \"block\">) => boolean;\n}\n\nexport interface TimeGridRootProps extends CalendarComponentsPartElementProps<TimeGridRootState, HTMLDivElement, \"defaultValue\"> {\n /** The days to draw, in order, each with its events. */\n days: readonly CalendarDay[];\n /** The selected event's id. Use with `onValueChange` to control it. */\n value?: string | null;\n /** The event selected at first, when uncontrolled. */\n defaultValue?: string | null;\n /** Called when the selected event changes. `details.cancel()` keeps the old one. */\n onValueChange?: (value: string | null, details: TimeGridValueChangeDetails) => void;\n /**\n * Called when an event is dragged to another time or day, resized, or\n * moved from the keyboard. Given, the grid is editable. The events are\n * yours: put the event where it says. `details.cancel()` skips the announcement.\n */\n onEventChange?: (change: TimeGridEventChange, details: TimeGridEventChangeDetails) => void;\n /** Whether events stay put even with `onEventChange`. */\n readOnly?: boolean;\n /**\n * Minutes a drag snaps to.\n * @default 15\n */\n step?: number;\n /**\n * What an hour is tall, in pixels.\n * @default 56\n */\n hourHeight?: number;\n /**\n * The hours to draw, to show part of the day: `{ from: 8, to: 18 }`.\n * @default the whole day, midnight to midnight\n */\n range?: HourRange;\n /**\n * The hours of a working day, for a theme that sets the rest apart (macOS\n * draws lighter lines outside them): `{ from: 8, to: 18 }`. Left out, no\n * hour is set apart.\n */\n workHours?: HourRange;\n /**\n * Where events overlap in time, how much of the next one's lane each runs under: 0 has them share the\n * width side by side (as Apple's calendars do), and 0.7 is Google Calendar's, each event over the one before.\n * @default 0\n */\n laneOverlap?: number;\n /**\n * The least an event is tall, however short it is.\n * @default 24\n */\n minEventHeight?: number;\n /**\n * What an event is tall, in pixels, below which its state is `short` (no room for a second line) and\n * from which it is `tall` (room for two lines of its name): set them to your type's sizes.\n * @default { short: 40, tall: 52 }\n */\n eventHeights?: { short: number; tall: number };\n /**\n * What a scroll comes to rest on: `\"days\"` on a day's start, `\"hours\"` on an hour's line, `\"both\"` on\n * both. Left out, it rests wherever it stops. The grid only says so, as `data-scroll-snap`: the\n * stylesheet (or yours) does the snapping, in whatever element scrolls.\n */\n scrollSnap?: \"days\" | \"hours\" | \"both\";\n /**\n * Whether a touch scrolls one way at a time: up and down, or between days, whichever the finger first\n * goes, and not both at once.\n * @default false\n */\n scrollLock?: boolean;\n /** A BCP 47 tag. Left out, it is the nearest React Aria `I18nProvider`'s, or the browser's. */\n locale?: string;\n /**\n * The IANA time zone \"today\" and the line for \"now\" are told in: the zone\n * the events happen in (\"Asia/Tokyo\"), wherever the grid is read.\n * @default this device's\n */\n timeZone?: string;\n /** Your words for \"all-day\" and for what is read aloud. */\n labels?: Partial<CalendarLabels>;\n /** A ref to the grid's actions: `actionsRef.current.scrollToTime(\"now\")`. */\n actionsRef?: React.RefObject<TimeGridRootActions | null>;\n}\n\n/**\n * Groups the parts of a time grid and holds its hours, its locale and what\n * is selected. It lays nothing out: put the parts in a grid or flex row.\n * Give it an `aria-label`. Renders a `<div>` with the grid role: React Aria's\n * grid list, with a row for each event.\n */\nconst EVENT_HEIGHTS = { short: 40, tall: 52 };\n\nexport const TimeGridRoot = React.forwardRef<HTMLDivElement, TimeGridRootProps>(function TimeGridRoot(props, ref) {\n const ambient = useLocale();\n // The grid's own keyboard and announcements, the parts, and anything of React Aria's inside read this locale, not one from further up.\n return (\n <I18nProvider locale={props.locale ?? ambient.locale}>\n <TimeGridRootInner {...props} ref={ref} />\n </I18nProvider>\n );\n});\n\nconst TimeGridRootInner = React.forwardRef<HTMLDivElement, TimeGridRootProps>(function TimeGridRootInner(\n {\n days,\n value,\n defaultValue = null,\n onValueChange,\n onEventChange,\n readOnly = false,\n step = 15,\n hourHeight = 56,\n range,\n workHours,\n minEventHeight = 24,\n eventHeights = EVENT_HEIGHTS,\n laneOverlap = 0,\n scrollSnap,\n scrollLock = false,\n locale,\n timeZone,\n labels,\n actionsRef,\n className,\n style,\n render,\n children,\n ...props\n },\n ref,\n) {\n const { locale: tag, direction } = useLocale();\n const collator = useCollator({ usage: \"search\", sensitivity: \"base\" });\n const info = React.useMemo(() => localeInfo(tag), [tag]);\n const zone = React.useMemo(() => timeZone ?? getLocalTimeZone(), [timeZone]);\n const words = React.useMemo(() => ({ ...labelsFor(tag), ...labels }), [tag, labels]);\n const fitted = range ?? WHOLE_DAY;\n\n // What is selected is React Stately's controlled state, with Base UI's cancellable change (utils/useChangeState).\n // What is dragged is in a store, so that only the event being dragged redraws.\n const [selected, setSelected] = useChangeState<string | null, TimeGridValueChangeDetails>(value, defaultValue, onValueChange);\n const [store] = React.useState(() => createStore<TimeGridStoreState>({ session: null, drag: null, allDay: [], disabled: [] }));\n const latest = useLatest({ onEventChange });\n const setValue = React.useCallback((next: string | null, details: TimeGridValueChangeDetails) => void setSelected(next, details), [setSelected]);\n const changeEvent = React.useCallback((change: TimeGridEventChange, details: TimeGridEventChangeDetails) => latest.current.onEventChange?.(change, details), [latest]);\n const editable = onEventChange != null && !readOnly;\n\n const registerAllDay = React.useCallback(\n (id: string, date: string) => {\n store.set({ allDay: [...store.getSnapshot().allDay, { id, date }] });\n return () => store.set({ allDay: store.getSnapshot().allDay.filter((each) => each.id !== id) });\n },\n [store],\n );\n const registerDisabled = React.useCallback(\n (id: string) => {\n store.set({ disabled: [...store.getSnapshot().disabled, id] });\n return () => store.set({ disabled: store.getSnapshot().disabled.filter((each) => each !== id) });\n },\n [store],\n );\n const disabledKeys = useStore(store, (s) => s.disabled);\n // The days as the keyboard goes through them: an all-day event is a child, so only those drawn can be gone to.\n const allDay = useStore(store, (s) => s.allDay);\n const drawn = React.useMemo(\n (): NavigationDay[] =>\n days.map((day) => {\n const here = allDay.filter((each) => each.date === day.date);\n // Given as data, that is their order; else it is the order they are drawn in.\n return { events: day.events, allDay: day.allDay ? day.allDay.filter((each) => here.some((one) => one.id === each.id)) : here };\n }),\n [days, allDay],\n );\n\n const root = React.useRef<HTMLDivElement>(null);\n const refs = React.useMemo(() => mergeRefs<HTMLDivElement>(root, ref), [ref]);\n const find = React.useCallback((id: string) => [...(root.current?.querySelectorAll<HTMLElement>(`[data-slot=\"${TIME_GRID_SLOTS.event}\"], [data-slot=\"${TIME_GRID_SLOTS.allDayEvent}\"]`) ?? [])].find((el) => el.dataset.value === id), []);\n\n // The events are one React Aria grid list: a row an event, one Tab stop for them all, and React Stately's\n // selection. Which event a key leads to is this grid's own (through a day by time, sideways to the nearest\n // in time), so it gives the list its keyboard delegate.\n const collection = React.useMemo(() => new EventCollection(drawn.flatMap((day) => [...(day.allDay ?? []), ...[...day.events].sort(compareEvents)].map((event) => event.id))), [drawn]);\n const selectedKeys = React.useMemo(() => (selected == null ? [] : [selected]), [selected]);\n const list = useListState<object>({\n collection,\n selectionMode: \"single\",\n selectedKeys,\n // A disabled event can be reached and read, and not picked.\n disabledKeys,\n disabledBehavior: \"selection\",\n onSelectionChange(keys) {\n const [next] = keys === \"all\" ? [] : keys;\n const id = next == null ? null : String(next);\n setValue(id, createChangeDetails(\"event-press\", find(id ?? selected ?? \"\")));\n },\n });\n const source = useLatest({ days: drawn, direction: direction, collection, collator, textOf: (key: Key) => find(String(key))?.getAttribute(\"aria-label\") ?? find(String(key))?.textContent ?? \"\" });\n const navigation = React.useMemo(() => timeGridKeyboardDelegate(() => source.current), [source]);\n const { gridProps } = useGridList(\n {\n \"aria-label\": props[\"aria-label\"],\n \"aria-labelledby\": props[\"aria-labelledby\"],\n keyboardDelegate: navigation,\n // As React Aria's own grid layout has it: every arrow is the list's (so left and right cross days), and Tab goes on.\n keyboardNavigationBehavior: \"tab\",\n shouldSelectOnPressUp: true,\n escapeKeyBehavior: \"none\",\n },\n list,\n root,\n );\n\n // Scrolling is left to the browser: a mark is put at the time, in its day's column, and scrolled into view,\n // so it works whatever scrolls the grid (the page, a panel, both ways). A stylesheet whose head stays put\n // over the hours says how tall it is in `--time-grid-scroll-inset`, and the time comes to rest under it.\n const scroll = useLatest({ range: fitted, hourHeight, zone });\n React.useImperativeHandle(\n actionsRef,\n () => ({\n scrollToTime(target, { behavior, block = \"start\", offset = 0 } = {}) {\n const { range: hours, hourHeight: tall, zone: timeZone } = scroll.current;\n const at = target === \"now\" ? nowOf(timeZone) : target;\n const columns = [...(root.current?.querySelectorAll<HTMLElement>(`[data-slot=\"${TIME_GRID_SLOTS.column}\"]`) ?? [])];\n const column = columns.find((el) => el.dataset.date === at.date) ?? columns[0];\n if (!column) return false;\n const mark = document.createElement(\"div\");\n const top = (Math.min(Math.max(at.minutes / 60, hours.from), hours.to) - hours.from) * tall;\n Object.assign(mark.style, { position: \"absolute\", top: `${top}px`, insetInline: \"0\", height: \"1px\", pointerEvents: \"none\", scrollMarginTop: `calc(var(--time-grid-scroll-inset, 0px) + ${offset}px)` });\n column.append(mark);\n mark.scrollIntoView({ behavior, block, inline: \"nearest\" });\n mark.remove();\n return true;\n },\n scrollToEvent(id, { behavior, block = \"nearest\" } = {}) {\n const event = find(id);\n if (!event) return false;\n event.scrollIntoView({ behavior, block, inline: \"nearest\" });\n // Focusing the row is enough: the list hears it and makes it its Tab stop.\n event.focus({ preventScroll: true });\n return true;\n },\n }),\n [find, scroll],\n );\n\n // Told inline, the hours are a new object each render: keep one while they say the same.\n const [workFrom, workTo] = [workHours?.from, workHours?.to];\n const work = React.useMemo(() => (workFrom == null || workTo == null ? undefined : { from: workFrom, to: workTo }), [workFrom, workTo]);\n const context = React.useMemo<TimeGridRootContextValue>(\n () => ({\n days,\n range: fitted,\n workHours: work,\n hourHeight,\n laneOverlap,\n minEventHeight,\n eventHeights,\n locale: info,\n timeZone: zone,\n labels: words,\n store,\n setValue,\n step,\n editable,\n changeEvent,\n list,\n registerAllDay,\n registerDisabled,\n direction,\n }),\n [days, fitted, work, hourHeight, laneOverlap, minEventHeight, eventHeights, info, zone, words, store, setValue, step, editable, changeEvent, list, registerAllDay, registerDisabled, direction],\n );\n // Moving an event is React Aria's drag and drop for collections: the events are dragged, and dropped on a time.\n const textOf = React.useCallback((key: Key) => find(String(key))?.getAttribute(\"aria-label\") ?? find(String(key))?.textContent ?? \"\", [find]);\n const dnd = useEventDragAndDrop({ ...context, textOf, find }, root);\n useHeadHeight(root, days.length);\n useScrollLock(root, scrollLock, () => store.getSnapshot().drag != null || store.getSnapshot().session != null);\n const dragging = useStore(store, (s) => s.drag != null);\n const state: TimeGridRootState = { editable, dragging, direction: direction };\n\n return (\n <TimeGridRootContext.Provider value={context}>\n <TimeGridDragContext.Provider value={dnd.context}>\n {renderElement(\n \"div\",\n {\n dir: direction,\n // React Aria's grid: a day is a group of rows in it, and an event a row.\n ...mergePartProps<React.HTMLAttributes<HTMLDivElement>>(props, gridProps, dnd.dropProps),\n ref: refs,\n \"data-slot\": TIME_GRID_SLOTS.root,\n \"data-scroll-snap\": scrollSnap,\n \"data-scroll-lock\": scrollLock ? \"\" : undefined,\n className,\n style: (s: TimeGridRootState) =>\n ({ \"--time-grid-hour-height\": `${hourHeight}px`, \"--time-grid-height\": `${(fitted.to - fitted.from) * hourHeight}px`, \"--time-grid-days\": days.length, ...resolve(style, s) }) as React.CSSProperties,\n render,\n children,\n },\n state,\n [\"editable\", \"dragging\"],\n )}\n </TimeGridDragContext.Provider>\n </TimeGridRootContext.Provider>\n );\n});\n\nexport declare namespace TimeGridRoot {\n type Actions = TimeGridRootActions;\n type ScrollTarget = TimeGridScrollTarget;\n type ScrollOptions = TimeGridScrollOptions;\n type Props = TimeGridRootProps;\n type State = TimeGridRootState;\n type ValueChangeDetails = TimeGridValueChangeDetails;\n type EventChange = TimeGridEventChange;\n type EventChangeDetails = TimeGridEventChangeDetails;\n}\n","\"use client\";\n\nimport { useSyncExternalStoreWithSelector } from \"use-sync-external-store/with-selector\";\n\ntype Source<S> = { subscribe(listener: () => void): () => void; getSnapshot(): S; getServerSnapshot?: () => S };\n\nconst identity = <T>(value: T) => value;\n\nexport function useStore<S>(store: Source<S>): S;\nexport function useStore<S, T>(store: Source<S>, select: (snapshot: S) => T, isEqual?: (a: T, b: T) => boolean): T;\nexport function useStore<S, T>(store: Source<S>, select: (snapshot: S) => T = identity as (snapshot: S) => T, isEqual?: (a: T, b: T) => boolean): T {\n return useSyncExternalStoreWithSelector(store.subscribe, store.getSnapshot, store.getServerSnapshot ?? store.getSnapshot, select, isEqual);\n}\n","import type { Collection, Key, Node } from \"@react-types/shared\";\n\nexport type EventNode = Node<object>;\n\n/** An event as React Aria's collection knows it: a row with a key. Its name is what it shows, so the node carries none. */\nexport const eventNode = (key: Key, index = -1): EventNode => ({ type: \"item\", key, value: null, level: 0, hasChildNodes: false, childNodes: [], rendered: null, textValue: \"\", index, parentKey: null, props: {} });\n\n/** The grid's events as React Aria's collection, in the order the keyboard reads them: day by day, a day's all-day events and then its timed ones by time. */\nexport class EventCollection implements Collection<EventNode> {\n readonly #nodes: EventNode[];\n readonly #index = new Map<Key, number>();\n\n constructor(ids: readonly string[]) {\n this.#nodes = ids.map(eventNode);\n for (const [i, id] of ids.entries()) this.#index.set(id, i);\n }\n\n get size() {\n return this.#nodes.length;\n }\n *[Symbol.iterator]() {\n yield* this.#nodes;\n }\n getKeys() {\n return this.#index.keys();\n }\n getItem(key: Key) {\n const i = this.#index.get(key);\n return i == null ? null : this.#nodes[i]!;\n }\n at(index: number) {\n return this.#nodes[index] ?? null;\n }\n getKeyBefore(key: Key) {\n const i = this.#index.get(key);\n return i ? this.#nodes[i - 1]!.key : null;\n }\n getKeyAfter(key: Key) {\n const i = this.#index.get(key);\n return i == null ? null : (this.#nodes[i + 1]?.key ?? null);\n }\n getFirstKey() {\n return this.#nodes[0]?.key ?? null;\n }\n getLastKey() {\n return this.#nodes.at(-1)?.key ?? null;\n }\n getChildren(): Iterable<EventNode> {\n return [];\n }\n getTextValue() {\n return \"\";\n }\n}\n","import { moveFrom, type Move, type NavigationDay } from \"calendar-components-core\";\nimport type { Collection, Key, KeyboardDelegate, Node } from \"@react-types/shared\";\n\ninterface DelegateSource {\n days: readonly NavigationDay[];\n direction: \"ltr\" | \"rtl\";\n collection: Collection<Node<object>>;\n /** React Aria's collator for a search: by the letters, whatever their case or accents. */\n collator: Intl.Collator;\n /** What an event is called, for finding one by typing. */\n textOf: (key: Key) => string;\n}\n\n/**\n * Core's navigation as React Aria's keyboard delegate: what `useGridList` asks for the key above, below or\n * beside one, and for the event a typed word finds.\n */\nexport function timeGridKeyboardDelegate(source: () => DelegateSource): KeyboardDelegate {\n const move = (key: Key | null | undefined, to: Move) => (key == null ? null : moveFrom(source().days, String(key), to));\n const sideways = (key: Key, right: boolean) => move(key, right === (source().direction === \"ltr\") ? \"next-day\" : \"previous-day\");\n return {\n getKeyAbove: (key) => move(key, \"previous\"),\n getKeyBelow: (key) => move(key, \"next\"),\n getKeyLeftOf: (key) => sideways(key, false),\n getKeyRightOf: (key) => sideways(key, true),\n getFirstKey: (key) => move(key, \"first\") ?? source().collection.getFirstKey(),\n getLastKey: (key) => move(key, \"last\") ?? source().collection.getLastKey(),\n getKeyForSearch(search, from) {\n const { collection, textOf, collator } = source();\n for (let key = from ?? collection.getFirstKey(); key != null; key = collection.getKeyAfter(key)) {\n if (collator.compare(textOf(key).trim().slice(0, search.length), search) === 0) return key;\n }\n return null;\n },\n };\n}\n","\"use client\";\n\nimport { moved, type CalendarEvent } from \"calendar-components-core\";\nimport type { DroppableCollectionDropEvent, DropTarget, DropTargetDelegate, Key } from \"@react-types/shared\";\nimport * as React from \"react\";\nimport { useDraggableCollection } from \"react-aria/useDraggableCollection\";\nimport { useDroppableCollection } from \"react-aria/useDroppableCollection\";\nimport { useDraggableCollectionState, type DraggableCollectionState } from \"react-stately/useDraggableCollectionState\";\nimport { useDroppableCollectionState, type DroppableCollectionState } from \"react-stately/useDroppableCollectionState\";\nimport { useListState, type ListState } from \"react-stately/useListState\";\nimport { TIME_GRID_SLOTS } from \"../../internals/slots\";\nimport { useLatest } from \"../../utils/useLatest\";\nimport { eventChange } from \"../event/useEventChange\";\nimport type { TimeGridRootContextValue } from \"../root/TimeGridRootContext\";\nimport { SlotCollection, slotKey, slotKeyboardDelegate, slotOf } from \"./slots\";\n\n/** What a dragged event is on the clipboard of a drag: only its own grid takes it. */\nexport const EVENT_DRAG_TYPE = \"application/x-calendar-components-event\";\n\n/** React Aria's state of a drag in the grid: what its events and its days' columns read. */\nexport interface TimeGridDragContextValue {\n drag: DraggableCollectionState;\n drop: DroppableCollectionState;\n}\nexport const TimeGridDragContext = React.createContext<TimeGridDragContextValue | null>(null);\n\ntype Grid = Pick<TimeGridRootContextValue, \"days\" | \"store\" | \"step\" | \"changeEvent\" | \"locale\" | \"labels\" | \"range\" | \"hourHeight\" | \"direction\" | \"editable\"> & {\n /** The grid's events as React Aria's list: what is dragged is one of its rows. */\n list: ListState<object>;\n /** What an event is called. */\n textOf: (key: Key) => string;\n find: (id: string) => HTMLElement | undefined;\n};\n\n/**\n * Moving an event, by React Aria's drag and drop for collections. The events are the draggable collection\n * and the times of the days drawn are the droppable one (`SlotCollection`), so React Aria does the rest: a\n * mouse drags at once and a finger after resting on the event; the keyboard picks an event up (Alt+Enter),\n * goes from time to time with the arrows and drops it with Enter; a screen reader is told each time by\n * name; Escape, or a drop anywhere else, puts it back; and the days scroll at an edge under a drag.\n *\n * What is this grid's own is where a pointer is in time (the drop target delegate) and drawing the event\n * at the time it would land on.\n */\nexport function useEventDragAndDrop(grid: Grid, root: React.RefObject<HTMLElement | null>) {\n const { days, store, step, range, locale, direction, editable, list } = grid;\n const latest = useLatest(grid);\n const drawn = { from: Math.max(0, range.from * 60), to: Math.min(24 * 60, range.to * 60) };\n const bounds = useLatest(drawn);\n\n // Told inline, the hours are a new object each render: the times are the same while the hours' numbers are.\n const [from, to] = [range.from, range.to];\n const slots = React.useMemo(\n () =>\n new SlotCollection(\n days.map((day) => day.date),\n { from, to },\n step,\n locale.locale,\n ),\n [days, from, to, step, locale.locale],\n );\n // The times are a list of their own, with nothing to select: React Aria keeps where the keyboard is among them.\n const times = useListState<object>({ collection: slots as never, selectionMode: \"none\" });\n\n const column = (date: string) => root.current?.querySelector<HTMLElement>(`[data-slot=\"${TIME_GRID_SLOTS.column}\"][data-date=\"${date}\"]`);\n const subjectOf = (id: string) => {\n for (const day of latest.current.days) {\n const event = day.events.find((each) => each.id === id);\n if (event) return { event: event as CalendarEvent, date: day.date, label: latest.current.textOf(id), element: latest.current.find(id) };\n }\n return null;\n };\n\n const dropping = React.useRef<DroppableCollectionState | null>(null);\n const drag = useDraggableCollectionState({\n collection: list.collection,\n selectionManager: list.selectionManager,\n isDisabled: !editable,\n getItems: (keys) => [...keys].map((key) => ({ [EVENT_DRAG_TYPE]: String(key), \"text/plain\": latest.current.textOf(key) })),\n getAllowedDropOperations: () => [\"move\"],\n onDragStart(e) {\n const [id] = [...e.keys].map(String);\n const subject = id == null ? null : subjectOf(id);\n if (!subject) return;\n // How far down the event the pointer took hold of it, in minutes: it stays under the pointer as it goes.\n const top = subject.element?.getBoundingClientRect().top ?? e.y;\n const grab = Math.max(0, ((e.y - top) / latest.current.hourHeight) * 60);\n store.set({ session: { ...subject, grab }, drag: { id: subject.event.id, start: 0, end: 0, days: 0, offset: 0 } });\n // The keyboard starts from the time the event is at: React Aria takes it to the time after the one it\n // was last on. A screen reader's drag is taken to no time, and there would be none to go to: once\n // React Aria has begun the drag (a frame on), the event's own time is made the target if nothing is.\n const at = slotKey({ date: subject.date, minutes: subject.event.start });\n times.selectionManager.setFocusedKey(slots.getKeyBefore(at));\n requestAnimationFrame(() =>\n requestAnimationFrame(() => {\n if (store.getSnapshot().session && !dropping.current?.target) dropping.current?.setTarget({ type: \"item\", key: at, dropPosition: \"on\" });\n }),\n );\n },\n onDragEnd(e) {\n // Dropped on a time, the drop has told the grid's owner already; given up, the event is put back.\n if (e.dropOperation === \"cancel\") store.set({ session: null, drag: null });\n },\n });\n useDraggableCollection({}, drag, root);\n\n // Whether the time the event is over was found by a pointer (and not come to by the keyboard).\n const byPointer = React.useRef(false);\n /** Where the dragged event would be, dropped at a time. */\n const landing = (target: DropTarget | null) => {\n const { session } = store.getSnapshot();\n if (!session || target?.type !== \"item\") return null;\n const { date, minutes } = slotOf(target.key);\n const to = { id: session.event.id, date, start: minutes, end: minutes + (session.event.end - session.event.start) };\n return { session, to };\n };\n\n // Where a pointer is in time: the day whose column it is over, and the time under it, to the step. The\n // pointer keeps hold of the event where it took it.\n const pointer = React.useMemo<DropTargetDelegate>(\n () => ({\n getDropTargetFromPoint(x, y, isValid) {\n byPointer.current = true;\n const { session } = store.getSnapshot();\n const box = root.current?.getBoundingClientRect();\n if (!session || !box) return null;\n const [across, down] = [box.left + x, box.top + y];\n const over = [...(root.current?.querySelectorAll<HTMLElement>(`[data-slot=\"${TIME_GRID_SLOTS.column}\"]`) ?? [])].find((each) => across >= each.getBoundingClientRect().left && across < each.getBoundingClientRect().right);\n const date = over?.dataset.date;\n if (!over || !date) return null;\n const { range: hours, hourHeight, step: by } = latest.current;\n const start = hours.from * 60 + ((down - over.getBoundingClientRect().top) / hourHeight) * 60 - session.grab;\n const target: DropTarget = { type: \"item\", key: slotKey({ date, minutes: moved(session.event, start - session.event.start, by, bounds.current).start }), dropPosition: \"on\" };\n return isValid(target) ? target : null;\n },\n }),\n [store, root, latest, bounds],\n );\n // The state and the hook are given the same drop, as React Aria's own collections give them: the state takes a drop only where there is one.\n const onDrop = (e: DroppableCollectionDropEvent) => {\n // A pointer drops the event where it let go, which the browser may not have said it was over yet: React\n // Aria's target is where it last said. The keyboard's target is the time it is on.\n const land = landing((byPointer.current ? pointer.getDropTargetFromPoint(e.x, e.y, () => true) : null) ?? e.target);\n store.set({ session: null });\n if (land) eventChange(latest.current).commit(land.session, land.to, \"drag\");\n else store.set({ drag: null });\n // The keyboard was on the time: it goes back to the event, where it now is. React Aria's list keeps\n // focus on the row whose key has it, wherever the row is drawn.\n if (land && !byPointer.current) {\n latest.current.list.selectionManager.setFocusedKey(land.session.event.id);\n latest.current.list.selectionManager.setFocused(true);\n }\n };\n const drop = useDroppableCollectionState({\n onDrop,\n collection: slots as never,\n selectionManager: times.selectionManager,\n isDisabled: !editable,\n // Only an event of this grid, on a time it fits at before the day's end: nothing else is this grid's to take.\n getDropOperation(target, types) {\n const land = types.has(EVENT_DRAG_TYPE) && target.type === \"item\" && target.dropPosition === \"on\" ? landing(target) : null;\n return land && land.to.end <= Math.max(bounds.current.to, land.session.event.end) ? \"move\" : \"cancel\";\n },\n });\n\n const keys = useLatest({ slots, step, direction });\n const keyboard = React.useMemo(() => slotKeyboardDelegate(() => ((byPointer.current = false), keys.current)), [keys]);\n\n const { collectionProps } = useDroppableCollection(\n {\n keyboardDelegate: keyboard,\n dropTargetDelegate: pointer,\n onDrop,\n },\n drop,\n root,\n );\n\n dropping.current = drop;\n\n // The event is drawn at the time it would land on, as the pointer or the keyboard goes from one to another.\n const target = drop.target;\n // biome-ignore lint/correctness/useExhaustiveDependencies: `landing` and `column` read what is there when the target changes.\n React.useEffect(() => {\n const land = landing(target);\n if (!land) return;\n const { session, to } = land;\n const [here, over] = [column(session.date), column(to.date)];\n const dates = latest.current.days.map((day) => day.date);\n store.set({\n drag: {\n id: session.event.id,\n start: to.start - session.event.start,\n end: to.end - session.event.end,\n days: dates.indexOf(to.date) - dates.indexOf(session.date),\n offset: here && over ? over.getBoundingClientRect().left - here.getBoundingClientRect().left : 0,\n },\n });\n }, [target]);\n\n // The grid has its own id (its list's), and names nothing by the drop's.\n const { id: _id, \"aria-describedby\": _described, ...dropProps } = collectionProps as React.HTMLAttributes<HTMLElement> & { \"aria-describedby\"?: unknown };\n const context = React.useMemo<TimeGridDragContextValue>(() => ({ drag, drop }), [drag, drop]);\n return { dropProps, context };\n}\n","\"use client\";\n\nimport { announce } from \"@react-aria/live-announcer\";\nimport { createChangeDetails, dayAt, formatDay, formatTime, moved, resized, toLocalDate, type CalendarEvent } from \"calendar-components-core\";\nimport { useTimeGridRootContext, type TimeGridEventChange, type TimeGridEventChangeReason, type TimeGridRootContextValue } from \"../root/TimeGridRootContext\";\n\n/** The event a change is made to: what it is, the day it is on, and what it is called when the change is announced. */\nexport interface ChangeSubject {\n event: CalendarEvent;\n date: string;\n label: string;\n element?: HTMLElement | null;\n}\n\n/**\n * Where an event would be after a move or a resize, and telling the grid's owner where it was put. The\n * pointer's drag, the resize handle and the keyboard all end here, so each is announced the same way.\n */\nexport function useEventChange() {\n return eventChange(useTimeGridRootContext(\"Event\"));\n}\n\n/** The same, for the grid itself, which has what its parts read from it. */\nexport function eventChange({ days, store, step, changeEvent, locale, labels, range }: Pick<TimeGridRootContextValue, \"days\" | \"store\" | \"step\" | \"changeEvent\" | \"locale\" | \"labels\" | \"range\">) {\n // An event cannot be put outside the hours that are drawn, where it could not be seen or dragged back.\n const drawn = { from: Math.max(0, range.from * 60), to: Math.min(24 * 60, range.to * 60) };\n\n /** Where the event would be, moved or resized by this many minutes and, moved, this many days. */\n const at = ({ event, date }: ChangeSubject, kind: \"move\" | \"resize\", minutes: number, daysOn = 0): TimeGridEventChange => {\n const span = kind === \"move\" ? moved(event, minutes, step, drawn) : resized(event, minutes, step, drawn);\n const index = Math.max(\n 0,\n days.findIndex((day) => day.date === date),\n );\n return { id: event.id, date: days[dayAt(index, kind === \"move\" ? daysOn : 0, days.length)]?.date ?? date, ...span };\n };\n\n const commit = ({ event, date, label, element }: ChangeSubject, to: TimeGridEventChange, reason: TimeGridEventChangeReason) => {\n store.set({ drag: null });\n const time = (minutes: number) => formatTime(locale.locale, minutes);\n const stayed = to.start === event.start && to.end === event.end && to.date === date;\n if (stayed) {\n // Nowhere further to go (the day's end, the first or last day): say where it still is.\n if (reason === \"keyboard\") announce(labels.event(label, time(event.start), time(event.end)), \"polite\");\n return;\n }\n const details = createChangeDetails(reason, element ?? undefined);\n changeEvent(to, details);\n if (details.isCanceled) return;\n announce(labels.changed(label, formatDay(locale.locale, toLocalDate(to.date)).full, time(to.start), time(to.end)), \"assertive\");\n };\n\n return { at, commit };\n}\n","\"use client\";\n\nimport type { CalendarDay, CalendarLabels, ChangeDetails, Drag, HourRange, LocaleInfo, Store } from \"calendar-components-core\";\nimport * as React from \"react\";\nimport type { ListState } from \"react-stately/useListState\";\nimport type { ChangeSubject } from \"../event/useEventChange\";\n\n/** What is dragged, and what the grid needs told by its children: a store, so only the events that change redraw. */\nexport interface TimeGridStoreState {\n /** The all-day events drawn and the day each is on, in the order they were drawn: they are children, so they say they are there. */\n allDay: readonly { id: string; date: string }[];\n /** The events that cannot be picked: an event says so itself, and the list is told. */\n disabled: readonly string[];\n /** The event a pointer is dragging, from the pointer taking it to its letting go: a day's column reads it to know what is over it. */\n session: (ChangeSubject & { grab: number }) | null;\n /** The event being dragged, how far, and how far across in pixels its new day is. */\n drag: (Drag & { id: string; offset: number }) | null;\n}\n\n/** An event moved or resized: where it is now. The caller owns the events, and puts it there. */\nexport interface TimeGridEventChange {\n id: string;\n /** The day it is on now. */\n date: string;\n start: number;\n end: number;\n}\n\nexport type TimeGridValueChangeReason = \"event-press\";\nexport type TimeGridValueChangeDetails = ChangeDetails<TimeGridValueChangeReason>;\nexport type TimeGridEventChangeReason = \"drag\" | \"resize\" | \"keyboard\";\nexport type TimeGridEventChangeDetails = ChangeDetails<TimeGridEventChangeReason>;\n\nexport interface TimeGridRootContextValue {\n days: readonly CalendarDay[];\n range: HourRange;\n /** The hours of a working day, when the grid was told them. */\n workHours: HourRange | undefined;\n hourHeight: number;\n /** How much of the next lane an event runs under, where events overlap in time. */\n laneOverlap: number;\n minEventHeight: number;\n /** What an event is tall, in pixels, below which it is `short` and from which it is `tall`. */\n eventHeights: { short: number; tall: number };\n locale: LocaleInfo;\n /** Which way the grid reads: React Aria's, for its locale. */\n direction: \"ltr\" | \"rtl\";\n /** The IANA zone \"today\" and \"now\" are told in. */\n timeZone: string;\n labels: CalendarLabels;\n store: Store<TimeGridStoreState>;\n setValue: (value: string | null, details: TimeGridValueChangeDetails) => void;\n /** Minutes a drag snaps to. */\n step: number;\n /** Whether events can be moved and resized. */\n editable: boolean;\n changeEvent: (change: TimeGridEventChange, details: TimeGridEventChangeDetails) => void;\n /** React Stately's list of the events: what is selected and where the keyboard is. */\n list: ListState<object>;\n /** Says an all-day event is drawn; returns what takes that back. */\n registerAllDay: (id: string, date: string) => () => void;\n /** Says an event cannot be picked; returns what takes that back. */\n registerDisabled: (id: string) => () => void;\n}\n\nexport const TimeGridRootContext = React.createContext<TimeGridRootContextValue | null>(null);\n\nexport function useTimeGridRootContext(part = \"useTimeGrid\"): TimeGridRootContextValue {\n const context = React.useContext(TimeGridRootContext);\n if (!context) throw new Error(`${part.startsWith(\"use\") ? part : `TimeGrid.${part}`} must be inside TimeGrid.Root.`);\n return context;\n}\n","import { addDays, formatDay, formatTime, toLocalDate, type DateString, type HourRange } from \"calendar-components-core\";\nimport type { Collection, Key, KeyboardDelegate, Node } from \"@react-types/shared\";\n\n/** A time on a day that an event can be dropped at: a step of the grid. */\nexport interface Slot {\n date: DateString;\n /** Minutes past the day's midnight. */\n minutes: number;\n}\n\nexport const slotKey = ({ date, minutes }: Slot): string => `${date}/${minutes}`;\nexport const slotOf = (key: Key): Slot => {\n const [date, minutes] = String(key).split(\"/\");\n return { date: date!, minutes: Number(minutes) };\n};\n\ntype SlotNode = Node<Slot>;\n\n/**\n * The times an event can be dropped at, as React Aria's collection: every step of every day drawn, day by\n * day. React Aria's drag and drop takes its drop targets from a collection's items, so a time is one: the\n * pointer finds it through the drop target delegate, the keyboard goes from one to the next, and a screen\n * reader hears its name (\"Monday, November 23, 9:15 AM\").\n */\nexport class SlotCollection implements Collection<SlotNode> {\n readonly #keys: string[] = [];\n readonly #index = new Map<Key, number>();\n readonly #locale: string;\n\n constructor(dates: readonly DateString[], range: HourRange, step: number, locale: string) {\n this.#locale = locale;\n const [from, to] = [Math.ceil((range.from * 60) / step) * step, Math.min(24, range.to) * 60];\n for (const date of dates) for (let minutes = from; minutes < to; minutes += step) this.#index.set(slotKey({ date, minutes }), this.#keys.push(slotKey({ date, minutes })) - 1);\n }\n\n get size() {\n return this.#keys.length;\n }\n *[Symbol.iterator]() {\n for (const key of this.#keys) yield this.getItem(key)!;\n }\n getKeys() {\n return this.#keys.values();\n }\n getItem(key: Key): SlotNode | null {\n const index = this.#index.get(key);\n if (index == null) return null;\n return {\n type: \"item\",\n key,\n value: slotOf(key),\n level: 0,\n hasChildNodes: false,\n childNodes: [],\n rendered: null,\n textValue: this.getTextValue(key),\n index,\n parentKey: null,\n prevKey: this.#keys[index - 1] ?? null,\n nextKey: this.#keys[index + 1] ?? null,\n props: {},\n };\n }\n at(index: number) {\n return this.#keys[index] == null ? null : this.getItem(this.#keys[index]);\n }\n getKeyBefore(key: Key) {\n const index = this.#index.get(key);\n return index ? this.#keys[index - 1]! : null;\n }\n getKeyAfter(key: Key) {\n const index = this.#index.get(key);\n return index == null ? null : (this.#keys[index + 1] ?? null);\n }\n getFirstKey() {\n return this.#keys[0] ?? null;\n }\n getLastKey() {\n return this.#keys.at(-1) ?? null;\n }\n getChildren(): Iterable<SlotNode> {\n return [];\n }\n /** A time's name, for a screen reader: the day and the time, in the locale's words. */\n getTextValue(key: Key) {\n const { date, minutes } = slotOf(key);\n return `${formatDay(this.#locale, toLocalDate(date)).full}, ${formatTime(this.#locale, minutes)}`;\n }\n}\n\n/**\n * How the keyboard goes from one time to another while it carries an event: up and down a step, a page an\n * hour, and sideways a day at the same time.\n */\nexport function slotKeyboardDelegate(source: () => { slots: SlotCollection; step: number; direction: \"ltr\" | \"rtl\" }): KeyboardDelegate {\n const to = (key: Key, by: { minutes?: number; days?: number }) => {\n const { slots } = source();\n const { date, minutes } = slotOf(key);\n const next = slotKey({ date: by.days ? addDays(date, by.days) : date, minutes: minutes + (by.minutes ?? 0) });\n return slots.getItem(next) ? next : null;\n };\n const sideways = (key: Key, right: boolean) => to(key, { days: right === (source().direction === \"ltr\") ? 1 : -1 });\n return {\n getKeyBelow: (key) => to(key, { minutes: source().step }),\n getKeyAbove: (key) => to(key, { minutes: -source().step }),\n getKeyPageBelow: (key) => to(key, { minutes: 60 }),\n getKeyPageAbove: (key) => to(key, { minutes: -60 }),\n getKeyRightOf: (key) => sideways(key, true),\n getKeyLeftOf: (key) => sideways(key, false),\n getFirstKey: () => source().slots.getFirstKey(),\n getLastKey: () => source().slots.getLastKey(),\n };\n}\n","import * as React from \"react\";\nimport { TIME_GRID_SLOTS } from \"../../internals/slots\";\nimport * as vars from \"./TimeGridRootCssVars\";\n\n/**\n * Tells the grid's stylesheet how tall its head is: the days' names, and those with the all-day row under\n * them. CSS cannot ask one row's height from another, and the all-day row stays put under the names only\n * if it knows theirs.\n */\nexport function useHeadHeight(root: React.RefObject<HTMLElement | null>, days: number) {\n // biome-ignore lint/correctness/useExhaustiveDependencies: the days' names are other elements when the days are.\n React.useLayoutEffect(() => {\n const grid = root.current;\n const name = grid?.querySelector<HTMLElement>(`[data-slot=\"${TIME_GRID_SLOTS.dayHeader}\"]`);\n if (!grid || !name) return;\n const allDay = grid.querySelector<HTMLElement>(`[data-slot=\"${TIME_GRID_SLOTS.allDay}\"]`);\n const measure = () => {\n grid.style.setProperty(vars.dayHeaderHeight, `${name.offsetHeight}px`);\n grid.style.setProperty(vars.headHeight, `${name.offsetHeight + (allDay?.offsetHeight ?? 0)}px`);\n };\n measure();\n if (typeof ResizeObserver === \"undefined\") return;\n const observer = new ResizeObserver(measure);\n observer.observe(name);\n if (allDay) observer.observe(allDay);\n return () => observer.disconnect();\n }, [root, days]);\n}\n","/**\n * What an hour is tall.\n * @type {length}\n * @default 56px\n */\nexport const hourHeight = \"--time-grid-hour-height\";\n/**\n * The height of the hours drawn: every column's height.\n * @type {length}\n */\nexport const height = \"--time-grid-height\";\n/**\n * How many days the grid has.\n * @type {number}\n */\nexport const days = \"--time-grid-days\";\n/**\n * What the days' names are tall, measured: where the all-day row stays put under them.\n * @type {length}\n */\nexport const dayHeaderHeight = \"--time-grid-day-header-height\";\n/**\n * What the names and the all-day row are tall together, measured: what stays put over the hours.\n * @type {length}\n */\nexport const headHeight = \"--time-grid-head-height\";\n","import * as React from \"react\";\nimport { TIME_GRID_SLOTS } from \"../../internals/slots\";\n\n/** A swipe this fast, in pixels a millisecond, goes on to the next day however short it was. */\nconst FLICK = 0.3;\n\n/**\n * Keeps a touch scroll to one axis, as `UIScrollView`'s directional lock does: a finger going up or down\n * scrolls the hours and nothing else, and one going sideways moves the days and nothing else.\n *\n * A browser decides which ways a touch may scroll when the finger lands, so nothing done once it is known\n * which way it is going can stop the other. So the grid is given `data-scroll-lock`, for which the\n * stylesheet lets a touch scroll it up and down only (`touch-action: pan-y`), and a touch that sets out\n * sideways is taken from the browser and followed here instead: the days go with the finger, and come to\n * rest on a day when the grid snaps to days. While they do, the grid has `data-scroll-axis=\"x\"`.\n *\n * It is not React Aria's `useMove`: on the grid that would take every pointer and the arrow keys, which\n * are the events' to press, to drag and to move between.\n */\nexport function useScrollLock(ref: React.RefObject<HTMLElement | null>, enabled: boolean, busy: () => boolean) {\n const isBusy = React.useRef(busy);\n isBusy.current = busy;\n React.useEffect(() => {\n const grid = ref.current;\n if (!grid || !enabled) return;\n const stop = new AbortController();\n const options = { signal: stop.signal };\n let pan: { id: number; x: number; y: number; speed: number; at: number; following: boolean | null } | null = null;\n let resting = 0;\n const release = () => {\n clearTimeout(resting);\n delete grid.dataset.scrollAxis;\n };\n const touchOf = (event: TouchEvent) => [...event.changedTouches].find((touch) => touch.identifier === pan?.id);\n\n /** How far each day's start is from where a day rests: the grid's start, after what it keeps clear for the hours. */\n const starts = () => {\n const style = getComputedStyle(grid);\n const clear = Number.parseFloat(style.scrollPaddingInlineStart) || 0;\n const box = grid.getBoundingClientRect();\n return [...grid.querySelectorAll<HTMLElement>(`[data-slot=\"${TIME_GRID_SLOTS.column}\"]`)].map((column) => {\n const day = column.getBoundingClientRect();\n return style.direction === \"rtl\" ? day.right - (box.right - clear) : day.left - (box.left + clear);\n });\n };\n const rest = (flick: number) => {\n const snaps = grid.dataset.scrollSnap === \"days\" || grid.dataset.scrollSnap === \"both\";\n const offsets = snaps ? starts() : [];\n // The nearest day; or, after a flick, the nearest of those the days were going towards.\n const towards = offsets.filter((offset) => (flick > 0 ? offset < 0 : flick < 0 ? offset > 0 : true));\n const [to] = (towards.length ? towards : offsets).sort((one, other) => Math.abs(one) - Math.abs(other));\n if (to) grid.scrollBy({ left: to, behavior: \"smooth\" });\n else release();\n };\n // The grid snaps again once it has come to rest, by when it is on a day.\n grid.addEventListener(\n \"scroll\",\n () => {\n if (pan?.following || !grid.dataset.scrollAxis) return;\n clearTimeout(resting);\n resting = window.setTimeout(release, 100);\n },\n { ...options, passive: true },\n );\n\n grid.addEventListener(\n \"touchstart\",\n (event) => {\n const [touch] = event.touches;\n pan = event.touches.length === 1 && touch ? { id: touch.identifier, x: touch.clientX, y: touch.clientY, speed: 0, at: event.timeStamp, following: null } : null;\n },\n { ...options, passive: true },\n );\n grid.addEventListener(\n \"touchmove\",\n (event) => {\n const touch = touchOf(event);\n if (!pan || !touch) return;\n const by = touch.clientX - pan.x;\n // Which way it set out is which way it goes: up or down is left to the browser, which scrolls the hours.\n if (pan.following === null) {\n pan.following = !isBusy.current() && event.cancelable && Math.abs(by) > Math.abs(touch.clientY - pan.y);\n if (pan.following) {\n release();\n grid.dataset.scrollAxis = \"x\";\n }\n }\n if (!pan.following) return;\n event.preventDefault();\n pan.speed = by / Math.max(1, event.timeStamp - pan.at);\n pan.x = touch.clientX;\n pan.at = event.timeStamp;\n grid.scrollLeft -= by;\n },\n { ...options, passive: false },\n );\n const end = (event: TouchEvent) => {\n if (!pan || !touchOf(event)) return;\n const { following, speed } = pan;\n pan = null;\n if (following) rest(Math.abs(speed) > FLICK ? speed : 0);\n };\n grid.addEventListener(\"touchend\", end, options);\n grid.addEventListener(\"touchcancel\", end, options);\n return () => {\n stop.abort();\n release();\n };\n }, [ref, enabled]);\n}\n","\"use client\";\n\nimport { formatHour, formatHourParts, formatTimeParts, offsetOf } from \"calendar-components-core\";\nimport * as React from \"react\";\nimport { renderElement, resolve } from \"../../internals/renderElement\";\nimport { TIME_GRID_SLOTS } from \"../../internals/slots\";\nimport type { CalendarComponentsPartElementProps, CalendarComponentsPartProps } from \"../../internals/types\";\nimport { isOffHours } from \"../offHours\";\nimport { useStore } from \"../../utils/useStore\";\nimport { useTimeGridRootContext } from \"../root/TimeGridRootContext\";\n\nexport type TimeGridHoursState = { from: number; to: number };\n\nexport interface TimeGridHoursProps extends Omit<React.HTMLAttributes<HTMLDivElement>, \"className\" | \"style\" | \"children\">, CalendarComponentsPartProps<TimeGridHoursState, HTMLDivElement> {\n /** Draws one hour: return a `TimeGrid.Hour`. Left out, each is a plain `TimeGrid.Hour`. */\n children?: (hour: number) => React.ReactNode;\n}\n\n/**\n * The hours down the side: as tall as the columns, holding a `TimeGrid.Hour`\n * at each hour's line. Hidden from screen readers, which hear each event's\n * times. Renders a `<div>`.\n */\nexport const TimeGridHours = React.forwardRef<HTMLDivElement, TimeGridHoursProps>(function TimeGridHours({ className, style, render, children, ...props }, ref) {\n const { range, hourHeight } = useTimeGridRootContext(\"Hours\");\n const state: TimeGridHoursState = { from: range.from, to: range.to };\n return renderElement(\n \"div\",\n {\n \"aria-hidden\": true,\n ...props,\n ref,\n \"data-slot\": TIME_GRID_SLOTS.hours,\n className,\n // Its hours are placed against it. A stylesheet that keeps it in view while the days scroll sets `--time-grid-hours-position: sticky`.\n style: (s: TimeGridHoursState) => ({ position: \"var(--time-grid-hours-position, relative)\" as React.CSSProperties[\"position\"], height: (range.to - range.from) * hourHeight, ...resolve(style, s) }),\n render,\n children: (\n <>\n {Array.from({ length: range.to - range.from }, (_, i) => (\n <React.Fragment key={i}>{children ? children(range.from + i) : <TimeGridHour hour={range.from + i} />}</React.Fragment>\n ))}\n <DragTime />\n </>\n ),\n },\n state,\n );\n});\n\n/**\n * The time a drag has an event at, written among the hours at that time: where a moved event would start, or\n * where a pulled one would end. There only during a drag, and for a theme to show: Google Calendar's app\n * writes it, in blue.\n */\nfunction DragTime() {\n const { store, days, range, hourHeight, locale } = useTimeGridRootContext(\"Hours\");\n const minutes = useStore(store, ({ drag, session }) => {\n if (!drag) return null;\n const event = session?.event ?? days.flatMap((day) => day.events).find((each) => each.id === drag.id);\n if (!event) return null;\n // A move takes the start with it; a pull moves the end alone.\n return drag.start !== 0 || session ? event.start + drag.start : event.end + drag.end;\n });\n if (minutes == null) return null;\n // On the hour it is written as an hour is (\"7\", \"AM\"), and between hours as a time (\"6:45\", \"AM\").\n const onHour = minutes % 60 === 0;\n const time = onHour ? formatHourParts(locale.locale, minutes / 60).hour : formatTimeParts(locale.locale, minutes).time;\n const { dayPeriod } = formatTimeParts(locale.locale, minutes);\n return (\n <div aria-hidden data-slot={TIME_GRID_SLOTS.dragTime} data-on-hour={onHour ? \"\" : undefined} style={{ position: \"absolute\", insetInline: 0, top: offsetOf(minutes, range, hourHeight) }}>\n <span>{time}</span>\n <span>{dayPeriod}</span>\n </div>\n );\n}\n\n/**\n * One hour's label: the hour (0 to 23, past 24 for the day after), its words\n * in the locale (\"7 AM\"), and those words in parts (\"7\", \"AM\") for a label\n * that sets them apart. `noon` is true at midday when the grid's labels name it,\n * and `offHours` outside the working day when the grid was given one.\n */\nexport type TimeGridHourState = { hour: number; label: string; hourLabel: string; dayPeriodLabel: string; noon: boolean; offHours: boolean };\n\nexport interface TimeGridHourProps extends CalendarComponentsPartElementProps<TimeGridHourState> {\n /** The hour, from `TimeGrid.Hours`. */\n hour: number;\n}\n\n/** An hour's label, placed at its line. Its children default to the hour in the locale's words. Renders a `<div>`. */\nexport const TimeGridHour = React.forwardRef<HTMLDivElement, TimeGridHourProps>(function TimeGridHour({ hour, className, style, render, children, ...props }, ref) {\n const { range, hourHeight, locale, labels, workHours } = useTimeGridRootContext(\"Hour\");\n const noon = hour === 12 && labels.noon != null;\n const label = noon ? labels.noon! : formatHour(locale.locale, hour);\n const parts = formatHourParts(locale.locale, hour);\n const state: TimeGridHourState = { hour, label, hourLabel: parts.hour, dayPeriodLabel: parts.dayPeriod, noon, offHours: isOffHours(hour, workHours) };\n return renderElement(\n \"div\",\n {\n ...props,\n ref,\n \"data-slot\": TIME_GRID_SLOTS.hour,\n className,\n style: (s: TimeGridHourState) => ({ position: \"absolute\", insetInline: 0, top: (hour - range.from) * hourHeight, ...resolve(style, s) }),\n render,\n children: children ?? label,\n },\n state,\n [\"hour\", \"noon\", \"offHours\"],\n );\n});\n\nexport declare namespace TimeGridHours {\n type Props = TimeGridHoursProps;\n type State = TimeGridHoursState;\n}\nexport declare namespace TimeGridHour {\n type Props = TimeGridHourProps;\n type State = TimeGridHourState;\n}\n","import type { HourRange } from \"calendar-components-core\";\n\n/**\n * Whether a line or a label at this hour is outside the working day. The\n * lines the day starts and ends on are its own: `{ from: 8, to: 18 }` sets\n * apart what is before 8 and after 18.\n */\nexport const isOffHours = (hour: number, workHours: HourRange | undefined): boolean => workHours != null && (hour < workHours.from || hour > workHours.to);\n","\"use client\";\n\nimport { formatDay, toLocalDate, type CalendarDay } from \"calendar-components-core\";\nimport * as React from \"react\";\nimport { renderElement } from \"../../internals/renderElement\";\nimport { TIME_GRID_SLOTS } from \"../../internals/slots\";\nimport type { CalendarComponentsPartElementProps } from \"../../internals/types\";\nimport { DAY_ATTRIBUTES, useDayState, type TimeGridDayState } from \"../column/useDayState\";\nimport { useTimeGridRootContext } from \"../root/TimeGridRootContext\";\n\n/** The day, and its words in the locale: \"Sun\" and \"22\". */\nexport type TimeGridDayHeaderState = TimeGridDayState & { weekdayLabel: string; dayLabel: string };\n\nexport interface TimeGridDayHeaderProps extends CalendarComponentsPartElementProps<TimeGridDayHeaderState> {\n /** The day this heads. */\n day: CalendarDay;\n}\n\n/**\n * A day's heading, for the eye. Its children are given the weekday and the\n * date in the locale's words. A screen reader hears the day from its\n * `TimeGrid.Column`, which is named for it, so this is hidden from one:\n * give it `aria-hidden={false}` if you draw it as a button or a link.\n * Renders a `<div>`.\n */\nexport const TimeGridDayHeader = React.forwardRef<HTMLDivElement, TimeGridDayHeaderProps>(function TimeGridDayHeader({ day, className, style, render, children, ...props }, ref) {\n const { locale } = useTimeGridRootContext(\"DayHeader\");\n const words = formatDay(locale.locale, toLocalDate(day.date));\n const state: TimeGridDayHeaderState = { ...useDayState(day, \"DayHeader\"), weekdayLabel: words.weekday, dayLabel: words.day };\n return renderElement(\"div\", { \"aria-hidden\": true, ...props, ref, \"data-slot\": TIME_GRID_SLOTS.dayHeader, className, style, render, children: children ?? `${words.weekday} ${words.day}` }, state, DAY_ATTRIBUTES);\n});\n\nexport declare namespace TimeGridDayHeader {\n type Props = TimeGridDayHeaderProps;\n type State = TimeGridDayHeaderState;\n}\n","\"use client\";\n\nimport { formatDay, toLocalDate, weekdayOf, type CalendarDay } from \"calendar-components-core\";\nimport { useToday } from \"../../utils/useNow\";\nimport { useTimeGridRootContext } from \"../root/TimeGridRootContext\";\n\n/** What every part of a day says about it. */\nexport type TimeGridDayState = { date: string; today: boolean; weekend: boolean };\n\nexport const DAY_ATTRIBUTES = [\"date\", \"today\", \"weekend\"] as const;\n\nexport function useDayState(day: CalendarDay, part: string): TimeGridDayState {\n const { locale, timeZone } = useTimeGridRootContext(part);\n const today = useToday(timeZone);\n return { date: day.date, today: day.date === today, weekend: locale.weekend.includes(weekdayOf(day.date)) };\n}\n\n/** A day's name for a screen reader, in full, saying when it is today: \"Monday, November 23, today\". */\nexport function useDayLabel(day: CalendarDay, part: string): string {\n const { locale, timeZone, labels } = useTimeGridRootContext(part);\n const today = useToday(timeZone);\n const full = formatDay(locale.locale, toLocalDate(day.date)).full;\n return day.date === today ? labels.dayToday(full) : full;\n}\n","\"use client\";\n\nimport type { CalendarDay } from \"calendar-components-core\";\nimport * as React from \"react\";\nimport { renderElement } from \"../../internals/renderElement\";\nimport { TIME_GRID_SLOTS } from \"../../internals/slots\";\nimport type { CalendarComponentsPartElementProps } from \"../../internals/types\";\nimport { formatDay, toLocalDate } from \"calendar-components-core\";\nimport { DAY_ATTRIBUTES, useDayState, type TimeGridDayState } from \"../column/useDayState\";\nimport { useTimeGridRootContext } from \"../root/TimeGridRootContext\";\n\n/** The day an all-day cell is for, for the events in it. */\nexport const TimeGridAllDayContext = React.createContext<string | null>(null);\n\nexport type TimeGridAllDayState = TimeGridDayState;\n\nexport interface TimeGridAllDayProps extends CalendarComponentsPartElementProps<TimeGridAllDayState> {\n /** The day this cell is for. */\n day: CalendarDay;\n}\n\n/** A day's cell in the all-day row: what is on that day at no set time. Renders a `<div>`. */\nexport const TimeGridAllDay = React.forwardRef<HTMLDivElement, TimeGridAllDayProps>(function TimeGridAllDay({ day, className, style, render, children, ...props }, ref) {\n const { locale, labels } = useTimeGridRootContext(\"AllDay\");\n const label = labels.allDayOf(formatDay(locale.locale, toLocalDate(day.date)).full);\n const state = useDayState(day, \"AllDay\");\n return (\n <TimeGridAllDayContext.Provider value={day.date}>\n {renderElement(\"div\", { role: \"rowgroup\", \"aria-label\": label, ...props, ref, \"data-slot\": TIME_GRID_SLOTS.allDay, className, style, render, children }, state, DAY_ATTRIBUTES)}\n </TimeGridAllDayContext.Provider>\n );\n});\n\nexport declare namespace TimeGridAllDay {\n type Props = TimeGridAllDayProps;\n type State = TimeGridAllDayState;\n}\n","\"use client\";\n\nimport * as React from \"react\";\nimport { mergeRefs } from \"react-aria/mergeRefs\";\nimport { mergePartProps } from \"../../internals/mergePartProps\";\nimport { renderElement, resolve } from \"../../internals/renderElement\";\nimport { TIME_GRID_SLOTS } from \"../../internals/slots\";\nimport type { CalendarComponentsInteractionState, CalendarComponentsPartElementProps } from \"../../internals/types\";\nimport { TimeGridAllDayContext } from \"../all-day/TimeGridAllDay\";\nimport { useEventRow } from \"../event/useEventRow\";\nimport { useTimeGridRootContext } from \"../root/TimeGridRootContext\";\n\nexport type TimeGridAllDayEventState<E extends { id: string } = { id: string }> = CalendarComponentsInteractionState & {\n /** The event you gave. */\n event: E;\n selected: boolean;\n};\n\nexport interface TimeGridAllDayEventProps<E extends { id: string } = { id: string }> extends CalendarComponentsPartElementProps<TimeGridAllDayEventState<E>> {\n /** The event, as every event part takes it: its id is what `value` is when it is selected. */\n event: E;\n /** The event's name: what it shows when it has no children. */\n label?: string;\n /** Whether it ignores presses. */\n disabled?: boolean;\n}\n\n/**\n * An all-day event. Pressed, it is selected, as a timed one is. It is a row of\n * the grid's list with them: the arrows go between the all-day events of a day\n * and across days, and down from the last is the day's first timed event.\n * Renders a `<div>` with the row role, and its content in a cell.\n */\nexport const TimeGridAllDayEvent = React.forwardRef<HTMLDivElement, TimeGridAllDayEventProps>(function TimeGridAllDayEvent({ event, label, disabled = false, className, style, render, children, ...props }, forwardedRef) {\n const { registerAllDay } = useTimeGridRootContext(\"AllDayEvent\");\n const date = React.useContext(TimeGridAllDayContext);\n if (date == null) throw new Error(\"TimeGrid.AllDayEvent must be inside TimeGrid.AllDay.\");\n // It is a child, so it says when it is drawn: from then it is a row of the grid's list, with the timed events.\n React.useEffect(() => registerAllDay(event.id, date), [registerAllDay, event.id, date]);\n\n const ref = React.useRef<HTMLDivElement>(null);\n const refs = React.useMemo(() => mergeRefs<HTMLDivElement>(ref, forwardedRef), [forwardedRef]);\n const row = useEventRow(event.id, ref, { disabled, part: \"AllDayEvent\" });\n const state: TimeGridAllDayEventState = { ...row.state, event };\n return renderElement(\n \"div\",\n {\n ...mergePartProps<React.HTMLAttributes<HTMLDivElement>>(props, row.rowProps),\n ref: refs,\n \"data-slot\": TIME_GRID_SLOTS.allDayEvent,\n \"data-value\": event.id,\n className,\n style,\n render,\n children: (s: TimeGridAllDayEventState) => (\n <div {...row.gridCellProps} data-slot={TIME_GRID_SLOTS.eventContent}>\n {resolve(children, s) ?? label}\n </div>\n ),\n },\n state,\n [\"selected\"],\n );\n});\n\nexport declare namespace TimeGridAllDayEvent {\n type Props = TimeGridAllDayEventProps;\n type State = TimeGridAllDayEventState;\n}\n","\"use client\";\n\nimport * as React from \"react\";\nimport { mergeProps } from \"react-aria/mergeProps\";\nimport { useFocusRing } from \"react-aria/useFocusRing\";\nimport { useGridListItem } from \"react-aria/useGridList\";\nimport { useHover } from \"react-aria/useHover\";\nimport { stateAttributes } from \"../../internals/renderElement\";\nimport type { CalendarComponentsInteractionState } from \"../../internals/types\";\nimport { eventNode } from \"../root/collection\";\nimport { useTimeGridRootContext } from \"../root/TimeGridRootContext\";\n\nconst ATTRIBUTES = [\"hovered\", \"pressed\", \"focusVisible\", \"disabled\"] as const;\n\n/**\n * An event as a row of the grid's React Aria grid list: its place in the one Tab stop, its selection, its\n * presses, and the cell its content goes in. A timed event and an all-day one are both this.\n */\nexport function useEventRow(id: string, ref: React.RefObject<HTMLElement | null>, { disabled = false, part = \"Event\" } = {}) {\n const { list, registerDisabled } = useTimeGridRootContext(part);\n // Disabled, it is one of the list's `disabledKeys`: React Aria keeps it reachable and readable, and not picked.\n React.useLayoutEffect(() => (disabled ? registerDisabled(id) : undefined), [disabled, id, registerDisabled]);\n // An all-day event is a child, drawn before the grid has heard of it: until then it is a row of its own.\n const node = list.collection.getItem(id) ?? eventNode(id);\n const item = useGridListItem({ node, shouldSelectOnPressUp: true }, list, ref);\n const { hoverProps, isHovered } = useHover({ isDisabled: disabled });\n const { focusProps, isFocusVisible } = useFocusRing();\n\n const state: CalendarComponentsInteractionState & { selected: boolean } = {\n hovered: isHovered,\n focused: item.isFocused,\n focusVisible: isFocusVisible,\n pressed: item.isPressed,\n disabled,\n selected: item.isSelected,\n };\n const rowProps: React.HTMLAttributes<HTMLElement> = mergeProps(item.rowProps, hoverProps, focusProps, stateAttributes(state, ATTRIBUTES), { \"aria-disabled\": disabled || undefined });\n return { rowProps, gridCellProps: item.gridCellProps, state };\n}\n","\"use client\";\n\nimport type { CalendarDay } from \"calendar-components-core\";\nimport * as React from \"react\";\nimport { mergeRefs } from \"react-aria/mergeRefs\";\nimport { mergePartProps } from \"../../internals/mergePartProps\";\nimport { renderElement, resolve } from \"../../internals/renderElement\";\nimport { TIME_GRID_SLOTS } from \"../../internals/slots\";\nimport type { CalendarComponentsPartElementProps } from \"../../internals/types\";\nimport { TimeGridDropIndicator } from \"../drag/TimeGridDropIndicator\";\nimport { useTimeGridRootContext } from \"../root/TimeGridRootContext\";\nimport { TimeGridColumnContext } from \"./TimeGridColumnContext\";\nimport { DAY_ATTRIBUTES, useDayLabel, useDayState, type TimeGridDayState } from \"./useDayState\";\n\nexport type TimeGridColumnState = TimeGridDayState;\n\nexport interface TimeGridColumnProps extends CalendarComponentsPartElementProps<TimeGridColumnState> {\n /** The day this column is. */\n day: CalendarDay;\n}\n\n/**\n * One day's column: as tall as the hours drawn, and what its events, lines\n * and \"now\" are placed against. A screen reader hears it as a group of the\n * grid's rows, named for the day. Renders a `<div>`.\n */\nexport const TimeGridColumn = React.forwardRef<HTMLDivElement, TimeGridColumnProps>(function TimeGridColumn({ day, className, style, render, children, ...props }, forwardedRef) {\n const { range, hourHeight } = useTimeGridRootContext(\"Column\");\n const state = useDayState(day, \"Column\");\n const label = useDayLabel(day, \"Column\");\n const ref = React.useRef<HTMLDivElement>(null);\n const refs = React.useMemo(() => mergeRefs<HTMLDivElement>(ref, forwardedRef), [forwardedRef]);\n return (\n <TimeGridColumnContext.Provider value={day}>\n {renderElement(\n \"div\",\n {\n role: \"rowgroup\",\n \"aria-label\": label,\n ...mergePartProps<React.HTMLAttributes<HTMLDivElement>>(props),\n ref: refs,\n \"data-slot\": TIME_GRID_SLOTS.column,\n className,\n style: (s: TimeGridColumnState) => ({ position: \"relative\", height: (range.to - range.from) * hourHeight, ...resolve(style, s) }),\n render,\n // The time a dragged event would be dropped at is one of the day's rows while it is this day's.\n children: (s: TimeGridColumnState) => (\n <>\n {resolve(children, s)}\n <TimeGridDropIndicator date={day.date} />\n </>\n ),\n },\n state,\n DAY_ATTRIBUTES,\n )}\n </TimeGridColumnContext.Provider>\n );\n});\n\nexport declare namespace TimeGridColumn {\n type Props = TimeGridColumnProps;\n type State = TimeGridColumnState;\n}\n","\"use client\";\n\nimport { offsetOf } from \"calendar-components-core\";\nimport * as React from \"react\";\nimport { useDropIndicator } from \"react-aria/useDroppableCollection\";\nimport type { ItemDropTarget } from \"@react-types/shared\";\nimport { useTimeGridRootContext } from \"../root/TimeGridRootContext\";\nimport { slotOf } from \"./slots\";\nimport { TimeGridDragContext } from \"./useEventDragAndDrop\";\n\n/**\n * The time a dragged event would be dropped at, as React Aria's drop indicator: what the keyboard is on\n * while it carries an event, and what a screen reader hears (\"Drop on Monday, November 23, 9:15 AM\"). It\n * is at the time in the day's column and takes no room, so coming to it scrolls the time into view. A\n * day's column draws it while the time is one of its own.\n */\nexport function TimeGridDropIndicator({ date }: { date: string }) {\n const target = React.useContext(TimeGridDragContext)?.drop.target;\n return target?.type === \"item\" && slotOf(target.key).date === date ? <Indicator target={target} /> : null;\n}\n\nfunction Indicator({ target }: { target: ItemDropTarget }) {\n const { drop } = React.useContext(TimeGridDragContext)!;\n const { range, hourHeight } = useTimeGridRootContext(\"Column\");\n const ref = React.useRef<HTMLDivElement>(null);\n const { dropIndicatorProps, isHidden } = useDropIndicator({ target }, drop, ref);\n if (isHidden) return null;\n // A row of the grid, as an event is: the grid's rows are what a screen reader goes through.\n return (\n <div role=\"row\" style={{ position: \"absolute\", insetInline: 0, top: offsetOf(slotOf(target.key).minutes, range, hourHeight), height: 1, pointerEvents: \"none\" }}>\n <div role=\"gridcell\">\n <div {...dropIndicatorProps} role=\"button\" ref={ref} style={{ outline: \"none\" }} />\n </div>\n </div>\n );\n}\n","\"use client\";\n\nimport type { CalendarDay } from \"calendar-components-core\";\nimport * as React from \"react\";\n\nexport const TimeGridColumnContext = React.createContext<CalendarDay | null>(null);\n\nexport function useTimeGridColumnContext(part = \"useTimeGridColumn\"): CalendarDay {\n const day = React.useContext(TimeGridColumnContext);\n if (!day) throw new Error(`${part.startsWith(\"use\") ? part : `TimeGrid.${part}`} must be inside TimeGrid.Column.`);\n return day;\n}\n","\"use client\";\n\nimport * as React from \"react\";\nimport { renderElement, resolve } from \"../../internals/renderElement\";\nimport { TIME_GRID_SLOTS } from \"../../internals/slots\";\nimport type { CalendarComponentsPartElementProps } from \"../../internals/types\";\nimport { isOffHours } from \"../offHours\";\nimport { useTimeGridRootContext } from \"../root/TimeGridRootContext\";\n\nexport interface TimeGridLinesProps {\n /** Draws one hour's line: return a `TimeGrid.Line`. Left out, each is a plain `TimeGrid.Line` with these props. */\n children?: (hour: number) => React.ReactNode;\n /** Given to each line when `children` is left out. */\n className?: string;\n style?: React.CSSProperties;\n}\n\n/** A `TimeGrid.Line` across the column at each hour. Renders nothing itself. */\nexport function TimeGridLines({ children, className, style }: TimeGridLinesProps) {\n const { range } = useTimeGridRootContext(\"Lines\");\n return (\n <>\n {Array.from({ length: range.to - range.from }, (_, i) => (\n <React.Fragment key={i}>{children ? children(range.from + i) : <TimeGridLine hour={range.from + i} className={className} style={style} />}</React.Fragment>\n ))}\n </>\n );\n}\n\nexport type TimeGridLineState = {\n hour: number;\n /** Outside the working day, when the grid was given `workHours`. */\n offHours: boolean;\n};\n\nexport interface TimeGridLineProps extends CalendarComponentsPartElementProps<TimeGridLineState> {\n /**\n * The time the line is at, in hours: 9 for nine o'clock, 9.5 for half past,\n * so a column can have lines of its own between the hours.\n */\n hour: number;\n}\n\n/** A line across the column at a time. Renders a `<div>`. */\nexport const TimeGridLine = React.forwardRef<HTMLDivElement, TimeGridLineProps>(function TimeGridLine({ hour, className, style, render, children, ...props }, ref) {\n const { range, hourHeight, workHours } = useTimeGridRootContext(\"Line\");\n return renderElement(\n \"div\",\n {\n \"aria-hidden\": true,\n ...props,\n ref,\n \"data-slot\": TIME_GRID_SLOTS.line,\n className,\n style: (s: TimeGridLineState) => ({ position: \"absolute\", insetInline: 0, top: (hour - range.from) * hourHeight, ...resolve(style, s) }),\n render,\n children,\n },\n { hour, offHours: isOffHours(hour, workHours) },\n [\"hour\", \"offHours\"],\n );\n});\n\nexport declare namespace TimeGridLines {\n type Props = TimeGridLinesProps;\n}\nexport declare namespace TimeGridLine {\n type Props = TimeGridLineProps;\n type State = TimeGridLineState;\n}\n","\"use client\";\n\nimport { lanesOf, type CalendarDay, type CalendarEvent } from \"calendar-components-core\";\nimport * as React from \"react\";\nimport { useTimeGridColumnContext } from \"../column/TimeGridColumnContext\";\n\n/** An event and where it sits among those it overlaps: lane 0 is the leading one, of `lanes`. */\nexport interface TimeGridEventsItem<E extends CalendarEvent = CalendarEvent> {\n event: E;\n lane: number;\n lanes: number;\n}\n\nexport interface TimeGridEventsProps<E extends CalendarEvent = CalendarEvent> {\n /** Draws one event: return a `TimeGrid.Event`, given the item's `event`, `lane` and `lanes`. */\n children: (item: TimeGridEventsItem<E>) => React.ReactNode;\n}\n\n/** The column's events, in time order, each with its lane: events that overlap share the width. Renders nothing itself. */\nexport function TimeGridEvents<E extends CalendarEvent = CalendarEvent>({ children }: TimeGridEventsProps<E>) {\n const day = useTimeGridColumnContext(\"Events\") as CalendarDay<E>;\n const placed = React.useMemo(() => lanesOf(day.events), [day.events]);\n return (\n <>\n {placed.map((item) => (\n <React.Fragment key={item.event.id}>{children(item)}</React.Fragment>\n ))}\n </>\n );\n}\n\nexport declare namespace TimeGridEvents {\n type Props<E extends CalendarEvent = CalendarEvent> = TimeGridEventsProps<E>;\n type Item<E extends CalendarEvent = CalendarEvent> = TimeGridEventsItem<E>;\n}\n","\"use client\";\n\nimport { formatTime, formatTimeParts, offsetOf, type CalendarEvent } from \"calendar-components-core\";\nimport * as React from \"react\";\nimport { mergeRefs } from \"react-aria/mergeRefs\";\nimport { useDraggableItem } from \"react-aria/useDraggableCollection\";\nimport { useFocusVisible } from \"react-aria/useFocusVisible\";\nimport { useKeyboard } from \"react-aria/useKeyboard\";\nimport { mergePartProps } from \"../../internals/mergePartProps\";\nimport { renderElement, resolve } from \"../../internals/renderElement\";\nimport { TIME_GRID_SLOTS } from \"../../internals/slots\";\nimport type { CalendarComponentsInteractionState, CalendarComponentsPartElementProps } from \"../../internals/types\";\nimport { useDescription } from \"../../utils/useDescription\";\nimport { useStore } from \"../../utils/useStore\";\nimport { useTimeGridColumnContext } from \"../column/TimeGridColumnContext\";\nimport { TimeGridDragContext } from \"../drag/useEventDragAndDrop\";\nimport { useTimeGridRootContext } from \"../root/TimeGridRootContext\";\nimport { TimeGridEventContext } from \"./TimeGridEventContext\";\nimport { useEventResize } from \"./useEventResize\";\nimport { useEventRow } from \"./useEventRow\";\nimport { laneStyle } from \"./useEventPlacement\";\n\nexport type TimeGridEventState = CalendarComponentsInteractionState & {\n event: CalendarEvent;\n /** Its start and end as drawn: where a drag has it, while it is dragged. */\n start: number;\n end: number;\n /** Its times in the locale's words: \"9:30 AM\". */\n startLabel: string;\n endLabel: string;\n /** The same times in parts, to set the day period apart: `{ time: \"9:30\", dayPeriod: \"AM\" }`. */\n startParts: { time: string; dayPeriod: string };\n endParts: { time: string; dayPeriod: string };\n selected: boolean;\n dragging: boolean;\n /** Too short for a second line. */\n short: boolean;\n /** Tall enough for a line under its name. */\n tall: boolean;\n lane: number;\n lanes: number;\n};\n\nexport interface TimeGridEventProps extends CalendarComponentsPartElementProps<TimeGridEventState> {\n /** The event, from `TimeGrid.Events`. */\n event: CalendarEvent;\n /** Its lane among the events it overlaps, from `TimeGrid.Events`. */\n lane?: number;\n lanes?: number;\n /** The event's name: what it shows when it has no children, and what is announced when it is moved. */\n label: string;\n /** Whether it ignores presses and stays put. */\n disabled?: boolean;\n}\n\n/**\n * An event, placed in its column by its times and its lane. One event in the\n * grid takes Tab; the arrows move between them (through a day in time order,\n * sideways to the nearest in time on the next day), Home and End go to a\n * day's first and last, and Enter or Space selects.\n *\n * In an editable grid it can be dragged to another time or day, by a pointer\n * or from the keyboard (React Aria's drag and drop: Alt+Enter picks it up,\n * the arrows go from time to time, Enter drops it), and its end pulled from\n * `TimeGrid.EventResizeHandle`. What happened is announced.\n *\n * Renders a `<div>` with the row role, and its content in a cell.\n */\nexport const TimeGridEvent = React.forwardRef<HTMLDivElement, TimeGridEventProps>(function TimeGridEvent({ event, lane = 0, lanes = 1, label, disabled = false, className, style, render, children, ...props }, forwardedRef) {\n const { store, locale, labels, range, hourHeight, minEventHeight, step, laneOverlap, eventHeights, editable: canEdit } = useTimeGridRootContext(\"Event\");\n const day = useTimeGridColumnContext(\"Event\");\n const dragged = useStore(store, (s) => (s.drag?.id === event.id ? s.drag : null));\n const ref = React.useRef<HTMLDivElement>(null);\n const refs = React.useMemo(() => mergeRefs<HTMLDivElement>(ref, forwardedRef), [forwardedRef]);\n const editable = canEdit && !disabled;\n // What a change is made to, however it is made: the pointer's drag, the handle's pull, the keyboard.\n const subject = { event, date: day.date, label, element: ref.current };\n // Dragged as a row of React Aria's draggable collection: by a mouse at once, by a finger after resting on it, and\n // by the keyboard with Alt+Enter (Enter alone is the row's own, to pick it).\n const { dragProps: moveProps } = useDraggableItem({ key: event.id, hasAction: true }, React.useContext(TimeGridDragContext)!.drag);\n const { resizeProps: pullProps } = useEventResize(subject, ref);\n\n // Whether the keyboard (or a screen reader) is what is in use, and not a pointer: React Aria's own reading of it.\n const { isFocusVisible: byKeyboard } = useFocusVisible();\n // A row of the grid's list: React Aria's presses, selection and place in the one Tab stop.\n const row = useEventRow(event.id, ref, { disabled });\n\n const { keyboardProps } = useKeyboard({\n onKeyDown(e) {\n // Any other key is the list's: the arrows, Home and End go to another event, and typing finds one.\n // Home and End are not also the page's, to scroll by.\n if (e.key === \"Home\" || e.key === \"End\") e.preventDefault();\n e.continuePropagation();\n },\n });\n\n // Dragged, it is drawn where it would land: out of its lane, over the others.\n const start = event.start + (dragged?.start ?? 0);\n const end = event.end + (dragged?.end ?? 0);\n const height = Math.max(minEventHeight, ((end - start) / 60) * hourHeight);\n const placed: React.CSSProperties = {\n position: \"absolute\",\n top: offsetOf(start, range, hourHeight),\n height,\n ...laneStyle(dragged ? 0 : lane, dragged ? 1 : lanes, laneOverlap),\n ...(dragged ? { transform: `translateX(${dragged.offset}px)`, zIndex: 3 } : {}),\n // A finger on it can still scroll what it is in; rested on it, the event is picked up (React Aria's drag).\n ...(editable ? { userSelect: \"none\" } : {}),\n };\n\n const startLabel = formatTime(locale.locale, start);\n const endLabel = formatTime(locale.locale, end);\n const state: TimeGridEventState = {\n ...row.state,\n event,\n start,\n end,\n startLabel,\n endLabel,\n startParts: formatTimeParts(locale.locale, start),\n endParts: formatTimeParts(locale.locale, end),\n dragging: dragged != null,\n short: height < eventHeights.short,\n tall: height >= eventHeights.tall,\n lane,\n lanes,\n };\n const description = useDescription(labels.timeRange(startLabel, endLabel));\n // The handle at its foot is a slider of when it ends: Tab from the event comes to it, and up and down\n // move the end a step (React Aria's `useMove`). It is one only while its event has the keyboard: a\n // browser takes a finger near anything focusable to be on it, and a swipe over a short event would\n // pull its end and not scroll.\n const slider = row.state.focused && byKeyboard;\n const resizeProps: React.HTMLAttributes<HTMLElement> | null = editable\n ? {\n ...pullProps,\n ...(slider\n ? {\n role: \"slider\",\n tabIndex: 0,\n \"aria-orientation\": \"vertical\",\n \"aria-label\": labels.resize || labels.timeRange(startLabel, endLabel),\n \"aria-valuenow\": end,\n \"aria-valuemin\": event.start + step,\n \"aria-valuemax\": Math.min(24, range.to) * 60,\n \"aria-valuetext\": endLabel,\n }\n : { \"aria-hidden\": true }),\n }\n : null;\n const context = React.useMemo(() => ({ resizeProps }), [resizeProps]);\n\n // While a pointer has it, it is also drawn where it was, for a theme to fade: where it would go back to.\n const lifted = useStore(store, (s) => s.session?.event.id === event.id);\n const origin: TimeGridEventState = { ...state, start: event.start, end: event.end, startLabel: formatTime(locale.locale, event.start), endLabel: formatTime(locale.locale, event.end), dragging: false, lane, lanes };\n const originHeight = Math.max(minEventHeight, ((event.end - event.start) / 60) * hourHeight);\n\n return (\n <TimeGridEventContext.Provider value={context}>\n {lifted && (\n <div\n aria-hidden\n data-slot={TIME_GRID_SLOTS.event}\n data-origin=\"\"\n className={resolve(className, origin)}\n style={{ position: \"absolute\", top: offsetOf(event.start, range, hourHeight), height: originHeight, ...laneStyle(lane, lanes, laneOverlap), pointerEvents: \"none\", ...resolve(style, origin) }}\n >\n <div data-slot={TIME_GRID_SLOTS.eventContent}>{resolve(children, origin) ?? label}</div>\n </div>\n )}\n {renderElement(\n \"div\",\n {\n // Its name is what it shows (so what is seen is what is said); when it is follows, as its description.\n ...description,\n // Its own keys first: what it lets by is the list's.\n ...mergePartProps<React.HTMLAttributes<HTMLDivElement>>(props, keyboardProps, row.rowProps, editable ? moveProps : null),\n // When it is, and then how to pick it up (React Aria's words, for how it is being used: a mouse, a finger, the keyboard).\n \"aria-describedby\": [description[\"aria-describedby\"], editable ? moveProps[\"aria-describedby\"] : undefined].filter(Boolean).join(\" \") || undefined,\n ref: refs,\n \"data-slot\": TIME_GRID_SLOTS.event,\n \"data-value\": event.id,\n className,\n style: (s: TimeGridEventState) => ({ ...placed, \"--time-grid-event-height\": `${height}px`, ...resolve(style, s) }) as React.CSSProperties,\n render,\n // A row holds cells: the event's content is its one cell.\n children: (s: TimeGridEventState) => (\n <div {...row.gridCellProps} data-slot={TIME_GRID_SLOTS.eventContent}>\n {resolve(children, s) ?? label}\n </div>\n ),\n },\n state,\n [\"selected\", \"dragging\", \"short\", \"tall\", \"lane\", \"lanes\"],\n )}\n </TimeGridEventContext.Provider>\n );\n});\n\nexport declare namespace TimeGridEvent {\n type Props = TimeGridEventProps;\n type State = TimeGridEventState;\n}\n","\"use client\";\n\nimport * as React from \"react\";\n\nconst nodes = new Map<string, { element: HTMLElement; uses: number }>();\nlet count = 0;\n\n/**\n * `aria-describedby` for a description in words, as React Aria's own\n * (unexported) `useDescription`: one hidden element for each text, shared by\n * everything it describes and removed with the last of them. Read where\n * `aria-description` is not yet.\n */\nexport function useDescription(description: string | undefined): { \"aria-describedby\"?: string } {\n const [id, setId] = React.useState<string>();\n React.useLayoutEffect(() => {\n if (!description) return void setId(undefined);\n let node = nodes.get(description);\n if (!node) {\n const element = document.createElement(\"div\");\n element.id = `calendar-components-description-${count++}`;\n element.style.display = \"none\";\n element.textContent = description;\n document.body.append(element);\n node = { element, uses: 0 };\n nodes.set(description, node);\n }\n const held = node;\n held.uses++;\n setId(held.element.id);\n return () => {\n if (--held.uses === 0) {\n held.element.remove();\n nodes.delete(description);\n }\n };\n }, [description]);\n return { \"aria-describedby\": description ? id : undefined };\n}\n","\"use client\";\n\nimport * as React from \"react\";\n\n/** What an event's own parts need of it: here, the handle that resizes it. */\nexport interface TimeGridEventContextValue {\n /** The handle's handlers and what it says of itself (a slider of when the event ends). Null where the event cannot be resized. */\n resizeProps: React.HTMLAttributes<HTMLElement> | null;\n}\n\nexport const TimeGridEventContext = React.createContext<TimeGridEventContextValue | null>(null);\n\n/** For a part of your own inside `TimeGrid.Event`: a resize handle drawn your own way puts `resizeProps` on what is pulled. */\nexport function useTimeGridEvent(): TimeGridEventContextValue {\n const context = React.useContext(TimeGridEventContext);\n if (!context) throw new Error(\"useTimeGridEvent must be inside TimeGrid.Event.\");\n return context;\n}\n","\"use client\";\n\nimport * as React from \"react\";\nimport { useMove } from \"react-aria/useMove\";\nimport { useEdgeScroll } from \"../../utils/useEdgeScroll\";\nimport { useLatest } from \"../../utils/useLatest\";\nimport { useTimeGridRootContext } from \"../root/TimeGridRootContext\";\nimport { useEventChange, type ChangeSubject } from \"./useEventChange\";\n\n/**\n * Pulling an event's end, by React Aria's `useMove`: a pointer on the handle, or the arrow keys with the\n * handle focused (a step a key, as a slider's thumb moves). A pointer's pull as it stands goes in the\n * grid's store (so the event redraws, not the grid); letting go tells the grid's owner, and Escape puts the\n * end back.\n */\nexport function useEventResize(subject: ChangeSubject, ref: React.RefObject<HTMLElement | null>) {\n const { store, hourHeight, step } = useTimeGridRootContext(\"Event\");\n const { at, commit } = useEventChange();\n const pull = React.useRef({ y: 0, given: false });\n const latest = useLatest({ subject, at, commit });\n /** The end as pulled so far: by the pointer, and by what the hours have scrolled under it. */\n const pulled = () => {\n const { subject: now, at: where } = latest.current;\n return where(now, \"resize\", ((pull.current.y + edge.scrolled().y) / hourHeight) * 60);\n };\n const draw = () => {\n if (pull.current.given) return;\n const { subject: now } = latest.current;\n store.set({ drag: { id: now.event.id, start: 0, end: pulled().end - now.event.end, days: 0, offset: 0 } });\n };\n // Held near the top or the bottom, the hours scroll and the end goes with them.\n const edge = useEdgeScroll(ref, draw);\n\n const { moveProps } = useMove({\n onMoveStart() {\n pull.current = { y: 0, given: false };\n edge.start();\n },\n onMove(e) {\n if (pull.current.given) return;\n // An arrow key is a step; a pointer is as far as it has gone.\n pull.current.y += e.pointerType === \"keyboard\" ? e.deltaY * (step / 60) * hourHeight : e.deltaY;\n if (e.pointerType !== \"keyboard\") draw();\n },\n onMoveEnd(e) {\n edge.stop();\n if (pull.current.given) return;\n latest.current.commit(latest.current.subject, pulled(), e.pointerType === \"keyboard\" ? \"keyboard\" : \"resize\");\n },\n });\n\n // Escape gives the pull up, for as long as the pointer is down.\n const onPointerDown = (e: React.PointerEvent<HTMLElement>) => {\n const press = new AbortController();\n const onKeyDown = (key: KeyboardEvent) => {\n if (key.key !== \"Escape\") return;\n key.preventDefault();\n pull.current.given = true;\n edge.stop();\n store.set({ drag: null });\n };\n document.addEventListener(\"keydown\", onKeyDown, { capture: true, signal: press.signal });\n document.addEventListener(\"pointermove\", (move) => pull.current.given || edge.near(move.clientX, move.clientY), { signal: press.signal });\n document.addEventListener(\"pointerup\", () => press.abort(), { signal: press.signal });\n document.addEventListener(\"pointercancel\", () => press.abort(), { signal: press.signal });\n moveProps.onPointerDown?.(e);\n };\n\n // Up and down only: left and right stay the list's, to go to another day's events.\n const onKeyDown = (e: React.KeyboardEvent<HTMLElement>) => (e.key === \"ArrowUp\" || e.key === \"ArrowDown\") && moveProps.onKeyDown?.(e);\n const resizeProps: React.HTMLAttributes<HTMLElement> = { onMouseDown: moveProps.onMouseDown, onTouchStart: moveProps.onTouchStart, onPointerDown, onKeyDown };\n return { resizeProps };\n}\n","import * as React from \"react\";\nimport { useLatest } from \"./useLatest\";\n\n/** How near an edge the pointer has to be, in pixels, for what it is in to scroll. */\nconst ZONE = 48;\n/** The most it scrolls in a frame, with the pointer at the very edge. */\nconst FASTEST = 16;\n\n/** What scrolls an element along an axis: the nearest thing round it that can, or the page. */\nfunction scrollerOf(element: HTMLElement, axis: \"x\" | \"y\") {\n for (let each: HTMLElement | null = element; each; each = each.parentElement) {\n const style = getComputedStyle(each);\n const scrolls = /(auto|scroll)/.test(axis === \"x\" ? style.overflowX : style.overflowY);\n if (scrolls && (axis === \"x\" ? each.scrollWidth > each.clientWidth : each.scrollHeight > each.clientHeight)) return each;\n }\n return (document.scrollingElement as HTMLElement | null) ?? document.documentElement;\n}\n\n/**\n * Scrolls whatever an element scrolls in while a pointer is held near its edge, faster the nearer it is:\n * what a drag does at the edge of a list. Say where the pointer is with `near`, and `stop` when it is let\n * go; `scrolled` is how far it has scrolled since `start`, for a drag that counts the pointer's own moves.\n * `onScroll` is called as it scrolls, when what is dragged has to be drawn again under a still pointer.\n *\n * React Aria has this for its collections' drops, and does not export it.\n */\nexport function useEdgeScroll(ref: React.RefObject<HTMLElement | null>, onScroll?: () => void) {\n const heard = useLatest(onScroll);\n const state = React.useRef({ x: null as HTMLElement | null, y: null as HTMLElement | null, from: { x: 0, y: 0 }, by: { x: 0, y: 0 }, frame: 0 }).current;\n\n return React.useMemo(() => {\n const stop = () => {\n cancelAnimationFrame(state.frame);\n state.frame = 0;\n };\n const start = () => {\n if (!ref.current) return;\n state.x = scrollerOf(ref.current, \"x\");\n state.y = scrollerOf(ref.current, \"y\");\n state.from = { x: state.x.scrollLeft, y: state.y.scrollTop };\n };\n const step = () => {\n const [left, top] = [state.x?.scrollLeft, state.y?.scrollTop];\n // At once, whatever the page says of how its scrolling is to look.\n if (state.by.x) state.x?.scrollBy({ left: state.by.x, behavior: \"instant\" });\n if (state.by.y) state.y?.scrollBy({ top: state.by.y, behavior: \"instant\" });\n // At its end there is no further to go, and nothing to draw again.\n if (left === state.x?.scrollLeft && top === state.y?.scrollTop) return stop();\n heard.current?.();\n state.frame = requestAnimationFrame(step);\n };\n /** How fast to scroll along an axis with the pointer here: back near the start edge, on near the end. */\n const pace = (scroller: HTMLElement, axis: \"x\" | \"y\", pointer: number) => {\n const box = scroller === document.scrollingElement ? { left: 0, top: 0, right: window.innerWidth, bottom: window.innerHeight } : scroller.getBoundingClientRect();\n const [from, to] = axis === \"x\" ? [box.left, box.right] : [box.top, box.bottom];\n const into = Math.max(from + ZONE - pointer, pointer - (to - ZONE));\n if (into <= 0) return 0;\n return Math.ceil(Math.min(1, into / ZONE) * FASTEST) * (pointer < (from + to) / 2 ? -1 : 1);\n };\n const near = (x: number, y: number) => {\n if (!state.x || !state.y) start();\n if (!state.x || !state.y) return;\n state.by = { x: pace(state.x, \"x\", x), y: pace(state.y, \"y\", y) };\n if (!state.by.x && !state.by.y) return stop();\n state.frame ||= requestAnimationFrame(step);\n };\n const scrolled = () => ({ x: (state.x?.scrollLeft ?? 0) - state.from.x, y: (state.y?.scrollTop ?? 0) - state.from.y });\n return { start, near, scrolled, stop };\n }, [ref, state, heard]);\n}\n","\"use client\";\n\nimport { laneBox, offsetOf, type Span } from \"calendar-components-core\";\nimport type * as React from \"react\";\nimport { useTimeGridRootContext } from \"../root/TimeGridRootContext\";\n\n/**\n * A fraction of the day's width, less what a theme keeps clear at its far\n * edge (`--time-grid-lane-inset`, as Google Calendar keeps 13px to press on\n * the day itself): so lanes divide what is left, not the whole column.\n */\nexport const acrossDay = (fraction: number): string => (fraction === 0 ? \"0px\" : `calc((100% - var(--time-grid-lane-inset, 0px)) * ${Math.round(fraction * 1e6) / 1e6})`);\n\n/** Where an event is across its day, in its lane among those it overlaps. */\nexport function laneStyle(lane: number, lanes: number, overlap: number): React.CSSProperties {\n const { start, width } = laneBox(lane, lanes, overlap);\n // Where they overlap, a later lane is over an earlier one.\n return { insetInlineStart: acrossDay(start), width: acrossDay(width), ...(overlap > 0 && lanes > 1 ? { zIndex: lane + 1 } : {}) };\n}\n\n/**\n * Where something with a start and an end sits in its column, as\n * `TimeGrid.Event` places itself: for a part of your own that is not an\n * event (a block of travel time, a shaded stretch of working hours).\n */\nexport function useEventPlacement(span: Span, lane = 0, lanes = 1): { style: React.CSSProperties; height: number } {\n const { range, hourHeight, minEventHeight, laneOverlap } = useTimeGridRootContext(\"useEventPlacement\");\n const height = Math.max(minEventHeight, ((span.end - span.start) / 60) * hourHeight);\n return { height, style: { position: \"absolute\", top: offsetOf(span.start, range, hourHeight), height, ...laneStyle(lane, lanes, laneOverlap) } };\n}\n","\"use client\";\n\nimport * as React from \"react\";\nimport { mergePartProps } from \"../../internals/mergePartProps\";\nimport { renderElement, resolve } from \"../../internals/renderElement\";\nimport { TIME_GRID_SLOTS } from \"../../internals/slots\";\nimport type { CalendarComponentsPartElementProps } from \"../../internals/types\";\nimport { TimeGridEventContext } from \"../event/TimeGridEventContext\";\nimport { useTimeGridRootContext } from \"../root/TimeGridRootContext\";\n\nexport type TimeGridEventResizeHandleState = Record<string, never>;\n\nexport interface TimeGridEventResizeHandleProps extends CalendarComponentsPartElementProps<TimeGridEventResizeHandleState> {}\n\n// A pull on the handle is not a press on the event, nor the start of moving it: it goes no further up.\nconst stop = (e: React.SyntheticEvent) => e.stopPropagation();\n// (No click handler: React gives an element with one an `onclick` of its own, and a browser takes a finger near\n// anything that can be clicked to be on it, so a swipe over a short event would pull its end and not scroll.)\nconst CONTAINED = { onPointerDown: stop, onMouseDown: stop, onTouchStart: stop };\n\n/**\n * The foot of an event, pulled to change when it ends: by a pointer, or by\n * the keyboard as a slider is (Tab from the event comes to it, and up and\n * down move the end a step). Nothing in a grid that is not editable, or in\n * an event that is disabled. Renders a `<div>` with the slider role.\n */\nexport const TimeGridEventResizeHandle = React.forwardRef<HTMLDivElement, TimeGridEventResizeHandleProps>(function TimeGridEventResizeHandle({ className, style, render, children, ...props }, ref) {\n const inside = React.useContext(TimeGridEventContext);\n if (!inside) throw new Error(\"TimeGrid.EventResizeHandle must be inside TimeGrid.Event.\");\n const { labels } = useTimeGridRootContext(\"EventResizeHandle\");\n if (!inside.resizeProps) return null;\n return renderElement(\n \"div\",\n {\n title: labels.resize || undefined,\n ...mergePartProps<React.HTMLAttributes<HTMLDivElement>>(props, inside.resizeProps, CONTAINED),\n ref,\n \"data-slot\": TIME_GRID_SLOTS.eventResizeHandle,\n className,\n style: (s: TimeGridEventResizeHandleState) => ({ position: \"absolute\", insetInline: 0, bottom: 0, cursor: \"ns-resize\", touchAction: \"none\", ...resolve(style, s) }),\n render,\n children,\n },\n {},\n );\n});\n\nexport declare namespace TimeGridEventResizeHandle {\n type Props = TimeGridEventResizeHandleProps;\n type State = TimeGridEventResizeHandleState;\n}\n","\"use client\";\n\nimport { formatTime, offsetOf } from \"calendar-components-core\";\nimport * as React from \"react\";\nimport { renderElement, resolve } from \"../../internals/renderElement\";\nimport { TIME_GRID_SLOTS } from \"../../internals/slots\";\nimport type { CalendarComponentsPartElementProps } from \"../../internals/types\";\nimport { useTimeGridColumnContext } from \"../column/TimeGridColumnContext\";\nimport { useNow } from \"../../utils/useNow\";\nimport { useTimeGridRootContext } from \"../root/TimeGridRootContext\";\n\n/** The time it is: minutes past midnight, and in the locale's words. */\nexport type TimeGridNowState = { minutes: number; label: string };\n\nexport interface TimeGridNowProps extends CalendarComponentsPartElementProps<TimeGridNowState> {}\n\n/**\n * Placed across today's column at the time it is now, and kept there. Renders\n * nothing on any other day, or outside the hours drawn. Renders a `<div>`.\n */\nexport const TimeGridNow = React.forwardRef<HTMLDivElement, TimeGridNowProps>(function TimeGridNow({ className, style, render, children, ...props }, ref) {\n const { range, hourHeight, locale, timeZone } = useTimeGridRootContext(\"Now\");\n const day = useTimeGridColumnContext(\"Now\");\n const now = useNow(timeZone);\n if (!now || day.date !== now.date || now.minutes < range.from * 60 || now.minutes > range.to * 60) return null;\n const state: TimeGridNowState = { minutes: now.minutes, label: formatTime(locale.locale, now.minutes) };\n return renderElement(\n \"div\",\n {\n \"aria-hidden\": true,\n ...props,\n ref,\n \"data-slot\": TIME_GRID_SLOTS.now,\n className,\n style: (s: TimeGridNowState) => ({ position: \"absolute\", insetInline: 0, top: offsetOf(now.minutes, range, hourHeight), ...resolve(style, s) }),\n render,\n children,\n },\n state,\n );\n});\n\nexport declare namespace TimeGridNow {\n type Props = TimeGridNowProps;\n type State = TimeGridNowState;\n}\n","\"use client\";\n\nimport type { CalendarDay, CalendarLabels, HourRange, LocaleInfo } from \"calendar-components-core\";\nimport * as React from \"react\";\nimport { useTimeGridRootContext } from \"./root/TimeGridRootContext\";\n\n/** What a part of your own can know of the grid it is in: what it draws and in whose words, and nothing of how it keeps focus or a drag. */\nexport interface TimeGridContextValue {\n days: readonly CalendarDay[];\n /** The hours drawn. */\n range: HourRange;\n workHours: HourRange | undefined;\n hourHeight: number;\n laneOverlap: number;\n minEventHeight: number;\n eventHeights: { short: number; tall: number };\n locale: LocaleInfo;\n /** The IANA zone \"today\" and \"now\" are told in. */\n timeZone: string;\n labels: CalendarLabels;\n /** Minutes a drag snaps to. */\n step: number;\n /** Whether events can be moved and resized. */\n editable: boolean;\n}\n\n/** For a part of your own inside `TimeGrid.Root`. To place it by its times, use `useEventPlacement`. */\nexport function useTimeGrid(): TimeGridContextValue {\n const { days, range, workHours, hourHeight, laneOverlap, minEventHeight, eventHeights, locale, timeZone, labels, step, editable } = useTimeGridRootContext(\"useTimeGrid\");\n return React.useMemo(\n () => ({ days, range, workHours, hourHeight, laneOverlap, minEventHeight, eventHeights, locale, timeZone, labels, step, editable }),\n [days, range, workHours, hourHeight, laneOverlap, minEventHeight, eventHeights, locale, timeZone, labels, step, editable],\n );\n}\n","/**\n * Identifies the grid.\n * @type {'time-grid'}\n */\nexport const slot = \"data-slot\";\n/**\n * Present when events can be moved and resized.\n */\nexport const editable = \"data-editable\";\n/**\n * Present while an event is being dragged.\n */\nexport const dragging = \"data-dragging\";\n/**\n * What a scroll comes to rest on, when `scrollSnap` is given.\n * @type {'days' | 'hours' | 'both'}\n */\nexport const scrollSnap = \"data-scroll-snap\";\n/**\n * Present when `scrollLock` is on: a touch scrolls one way at a time.\n */\nexport const scrollLock = \"data-scroll-lock\";\n/**\n * Present while a finger moves the days, when `scrollLock` is on.\n * @type {'x'}\n */\nexport const scrollAxis = \"data-scroll-axis\";\n","/**\n * Identifies a day's column.\n * @type {'time-grid-column'}\n */\nexport const slot = \"data-slot\";\n/**\n * The day, as YYYY-MM-DD.\n * @type {string}\n */\nexport const date = \"data-date\";\n/**\n * Present on today's column.\n */\nexport const today = \"data-today\";\n/**\n * Present on a day of the locale's weekend.\n */\nexport const weekend = \"data-weekend\";\n","/**\n * Identifies a day's heading.\n * @type {'time-grid-day-header'}\n */\nexport const slot = \"data-slot\";\n/**\n * The day, as YYYY-MM-DD.\n * @type {string}\n */\nexport const date = \"data-date\";\n/**\n * Present on today's heading.\n */\nexport const today = \"data-today\";\n/**\n * Present on a day of the locale's weekend.\n */\nexport const weekend = \"data-weekend\";\n","/**\n * Identifies a day's cell in the all-day row.\n * @type {'time-grid-all-day'}\n */\nexport const slot = \"data-slot\";\n/**\n * The day, as YYYY-MM-DD.\n * @type {string}\n */\nexport const date = \"data-date\";\n/**\n * Present on today's cell.\n */\nexport const today = \"data-today\";\n/**\n * Present on a day of the locale's weekend.\n */\nexport const weekend = \"data-weekend\";\n","import * as InteractionDataAttributes from \"../../internals/InteractionDataAttributes\";\n\n/**\n * Identifies an event.\n * @type {'time-grid-event'}\n */\nexport const slot = \"data-slot\";\n/**\n * The event's id.\n * @type {string}\n */\nexport const value = \"data-value\";\n/**\n * Present on the selected event.\n */\nexport const selected = \"data-selected\";\n/**\n * Present while the event is being dragged or resized.\n */\nexport const dragging = \"data-dragging\";\n/**\n * Present on an event too short for a second line.\n */\nexport const short = \"data-short\";\n/**\n * Present on an event tall enough for a line under its name.\n */\nexport const tall = \"data-tall\";\n/**\n * Which lane it is in among the events it overlaps; 0 is the leading one.\n * @type {number}\n */\nexport const lane = \"data-lane\";\n/**\n * How many lanes there are among the events it overlaps; 1 when it overlaps none.\n * @type {number}\n */\nexport const lanes = \"data-lanes\";\n/**\n * Present while it is pressed.\n */\nexport const pressed = InteractionDataAttributes.pressed;\n/**\n * Present while the pointer is over it (never on touch).\n */\nexport const hovered = InteractionDataAttributes.hovered;\n/**\n * Present while it has keyboard focus.\n */\nexport const focusVisible = InteractionDataAttributes.focusVisible;\n/**\n * Present when it is disabled.\n */\nexport const disabled = InteractionDataAttributes.disabled;\n","/**\n * Identifies the hours down the side.\n * @type {'time-grid-hours'}\n */\nexport const slot = \"data-slot\";\n","/**\n * Identifies an hour's label.\n * @type {'time-grid-hour'}\n */\nexport const slot = \"data-slot\";\n/**\n * The hour, 0 to 23.\n * @type {number}\n */\nexport const hour = \"data-hour\";\n/** Present at midday, when the grid's labels name it. */\nexport const noon = \"data-noon\";\n/** Present outside the working day, when the grid was given `workHours`. */\nexport const offHours = \"data-off-hours\";\n","/**\n * Identifies a line across a day.\n * @type {'time-grid-line'}\n */\nexport const slot = \"data-slot\";\n/**\n * The time it is at, in hours: 9.5 is half past nine.\n * @type {number}\n */\nexport const hour = \"data-hour\";\n/** Present outside the working day, when the grid was given `workHours`. */\nexport const offHours = \"data-off-hours\";\n","import * as InteractionDataAttributes from \"../../internals/InteractionDataAttributes\";\n\n/**\n * Identifies an all-day event.\n * @type {'time-grid-all-day-event'}\n */\nexport const slot = \"data-slot\";\n/**\n * The event's id.\n * @type {string}\n */\nexport const value = \"data-value\";\n/** Present on the selected event. */\nexport const selected = \"data-selected\";\n/** Present while it is pressed. */\nexport const pressed = InteractionDataAttributes.pressed;\n/** Present while the pointer is over it (never on touch). */\nexport const hovered = InteractionDataAttributes.hovered;\n/** Present while it has keyboard focus. */\nexport const focusVisible = InteractionDataAttributes.focusVisible;\n/** Present when it is disabled. */\nexport const disabled = InteractionDataAttributes.disabled;\n","/**\n * Identifies the foot of an event that is pulled to resize it.\n * @type {'time-grid-event-resize-handle'}\n */\nexport const slot = \"data-slot\";\n","/**\n * Identifies the line at the time it is.\n * @type {'time-grid-now'}\n */\nexport const slot = \"data-slot\";\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACEA,SAAS,uBAAAA,sBAAqB,aAAa,eAAe,kBAAkB,WAAW,YAAY,aAAwF;AAC3L,YAAYC,YAAW;AACvB,SAAS,cAAc,iBAAiB;AACxC,SAAS,iBAAiB;AAC1B,SAAS,mBAAmB;AAC5B,SAAS,mBAAmB;AAC5B,SAAS,gBAAAC,qBAAoB;;;ACN7B,SAAS,wCAAwC;AAIjD,IAAM,WAAW,CAAIC,WAAaA;AAI3B,SAAS,SAAe,OAAkB,SAA6B,UAAgC,SAAsC;AAClJ,SAAO,iCAAiC,MAAM,WAAW,MAAM,aAAa,MAAM,qBAAqB,MAAM,aAAa,QAAQ,OAAO;AAC3I;;;ACPO,IAAM,YAAY,CAAC,KAAU,QAAQ,QAAmB,EAAE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A,YAAAC;AAAA;AAIO,IAAMA,QAAO;AAKb,IAAMF,QAAO;AAEb,IAAMC,YAAW;;;ACXxB;AAAA;AAAA,kBAAAE;AAAA,EAAA,oBAAAC;AAAA,EAAA,eAAAC;AAAA,EAAA,eAAAC;AAAA,EAAA,gBAAAC;AAAA,EAAA,YAAAC;AAAA,EAAA,aAAAC;AAAA;AAMO,IAAMC,QAAO;AAKb,IAAMC,SAAQ;AAEd,IAAMC,YAAW;AAEjB,IAAMC,WAAoC;AAE1C,IAAMC,WAAoC;AAE1C,IAAMC,gBAAyC;AAE/C,IAAMC,YAAqC;;;ACrBlD;AAAA;AAAA,cAAAC;AAAA;AAIO,IAAMA,SAAO;;;ACJpB;AAAA;AAAA,cAAAC;AAAA;AAIO,IAAMA,SAAO;","names":["createChangeDetails","React","useListState","value","moved","React","days","date","formatDay","formatTime","toLocalDate","date","days","editable","date","keys","target","to","hourHeight","moved","React","days","React","stop","TimeGridRoot","TimeGridRootInner","days","value","hourHeight","scrollSnap","scrollLock","selected","editable","date","useListState","createChangeDetails","tall","timeZone","dragging","React","hour","Fragment","jsx","TimeGridHours","hourHeight","days","TimeGridHour","hour","noon","formatDay","toLocalDate","React","formatDay","toLocalDate","today","formatDay","toLocalDate","TimeGridDayHeader","formatDay","toLocalDate","React","formatDay","toLocalDate","jsx","TimeGridAllDay","formatDay","toLocalDate","React","mergeRefs","React","disabled","jsx","TimeGridAllDayEvent","disabled","date","mergeRefs","React","mergeRefs","offsetOf","React","jsx","date","hourHeight","offsetOf","React","Fragment","jsx","jsxs","TimeGridColumn","hourHeight","mergeRefs","React","Fragment","jsx","TimeGridLine","hour","hourHeight","React","Fragment","jsx","formatTime","formatTimeParts","offsetOf","React","mergeRefs","React","React","React","React","stop","hourHeight","onKeyDown","offsetOf","lane","lanes","hourHeight","height","offsetOf","jsx","jsxs","TimeGridEvent","lane","lanes","disabled","hourHeight","mergeRefs","editable","height","offsetOf","formatTime","formatTimeParts","React","TimeGridEventResizeHandle","formatTime","offsetOf","React","TimeGridNow","hourHeight","formatTime","offsetOf","React","days","hourHeight","editable","slot","date","slot","today","weekend","date","slot","today","weekend","disabled","dragging","focusVisible","hovered","pressed","slot","slot","dragging","pressed","hovered","focusVisible","disabled","slot","slot","hour","offHours","slot","disabled","focusVisible","hovered","pressed","selected","slot","value","slot","value","selected","pressed","hovered","focusVisible","disabled","slot","slot"]}