@super-calendar/solid 0.0.0-stage → 2.16.0

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,574 @@
1
+ import { type JSX } from "@solidjs/web";
2
+ import type { CalendarHandle, CalendarLabels } from "@super-calendar/core/vanilla";
3
+ import {
4
+ type BusinessHours,
5
+ type BusinessHoursBand,
6
+ type CalendarEvent,
7
+ type CalendarMode,
8
+ type CreateGhostArgs,
9
+ type DateRange,
10
+ type DateSelectionConstraints,
11
+ type EventAccessibilityLabeler,
12
+ eventsInTimeZone,
13
+ expandRecurringEvents,
14
+ getViewDays,
15
+ type WeekdayFormat,
16
+ type WeekStartsOn,
17
+ } from "@super-calendar/core/vanilla";
18
+ import {
19
+ addDays,
20
+ addMonths,
21
+ addYears,
22
+ endOfDay,
23
+ endOfMonth,
24
+ endOfWeek,
25
+ endOfYear,
26
+ type Locale,
27
+ startOfDay,
28
+ startOfMonth,
29
+ startOfWeek,
30
+ startOfYear,
31
+ } from "date-fns";
32
+ import { type Component, createMemo, onSettled } from "solid-js";
33
+ import { Agenda, type AgendaSlot, type SolidAgendaEvent } from "./Agenda";
34
+ import { MonthView, type MonthViewSlot, type SolidMonthEvent } from "./MonthView";
35
+ import { withDefaults } from "./props";
36
+ import type { SlotStyleProps } from "./slots";
37
+ import { css, type CSSProperties, type DomKeyboardEvent, type ElementRef } from "./styles";
38
+ import type { SolidCalendarTheme } from "./theme";
39
+ import { type SolidRenderEvent, TimeGrid, type TimeGridSlot } from "./TimeGrid";
40
+ import { YearView, type YearViewSlot } from "./YearView";
41
+
42
+ /**
43
+ * Styleable parts across every view {@link Calendar} can render. Only the slots
44
+ * for the active `mode` apply; the rest are ignored. See {@link MonthViewSlot},
45
+ * {@link TimeGridSlot}, and {@link AgendaSlot}.
46
+ */
47
+ export type CalendarSlot = MonthViewSlot | TimeGridSlot | AgendaSlot | YearViewSlot;
48
+
49
+ /** Props for {@link Calendar}. */
50
+ export interface CalendarProps<T = unknown>
51
+ extends DateSelectionConstraints, SlotStyleProps<CalendarSlot> {
52
+ /**
53
+ * The view to render (default "week"). `month` renders a month grid, `schedule`
54
+ * a day-grouped agenda list, and the others a time grid.
55
+ */
56
+ mode?: CalendarMode;
57
+ /**
58
+ * Controlled anchor date, read in the device's local time zone; change it
59
+ * (e.g. from your own header) to navigate. Construct it as a local date
60
+ * (`new Date(2026, 7, 24)`), not a UTC instant:
61
+ * `new Date("2026-08-24T00:00:00Z")` is still Aug 23 on devices west of UTC
62
+ * and anchors the previous week.
63
+ */
64
+ date: Date;
65
+ /**
66
+ * Fires with the next/previous period's date when the user pages the focused
67
+ * calendar with **PageDown** / **PageUp** (a month in `month`, a week in
68
+ * `schedule`, else the view's day span). It's controlled, so update `date` in
69
+ * response. Omit it to leave paging to your own controls.
70
+ */
71
+ onChangeDate?: (date: Date) => void;
72
+ /** Your events. */
73
+ events?: CalendarEvent<T>[];
74
+ /** First day of the week. Sunday = 0 (default) … Saturday = 6. */
75
+ weekStartsOn?: WeekStartsOn;
76
+ /** Weekdays (0=Sunday…6=Saturday) hidden from the grid, e.g. `[0, 6]` for weekends off. */
77
+ hiddenDays?: number[];
78
+ /**
79
+ * Fixed "now" instant for the current-time indicator (doesn't tick), e.g. a
80
+ * server-synced clock. Defaults to the device clock, shifted into `timeZone`
81
+ * when one is set so the line matches the displayed events.
82
+ */
83
+ now?: Date;
84
+ /** Column count for `mode="custom"`. */
85
+ numberOfDays?: number;
86
+ /** date-fns locale for titles, headers, and time labels. */
87
+ locale?: Locale;
88
+ /**
89
+ * Display events in this IANA time zone (e.g. `"America/New_York"`), DST-correct
90
+ * and independent of the device zone. Display-only: it shifts the wall-clock the
91
+ * grid lays out from, it doesn't change your `Date`s. Uses `eventsInTimeZone`.
92
+ */
93
+ timeZone?: string;
94
+ /** Theme overrides; falls back to the default light theme. */
95
+ theme?: Partial<SolidCalendarTheme>;
96
+ /** Height of the scroll viewport, in px. */
97
+ height?: number | string;
98
+ /** Class applied to the root element. */
99
+ className?: string;
100
+ /** Inline styles applied to the root element. */
101
+ style?: CSSProperties;
102
+
103
+ /** Tap an event (both layouts). */
104
+ onPressEvent?: (event: CalendarEvent<T>) => void;
105
+ /**
106
+ * Override the screen-reader label for each event. Receives the event and a
107
+ * `{ mode, isAllDay, ampm }` context; return the full text to announce. Defaults
108
+ * to each view's built-in label.
109
+ */
110
+ eventAccessibilityLabel?: EventAccessibilityLabeler<T>;
111
+
112
+ // --- Time-grid modes (week / day / 3days / custom) ---
113
+ /** 12-hour AM/PM time labels (default false). */
114
+ ampm?: boolean;
115
+ /** Initial pixels per hour. */
116
+ hourHeight?: number;
117
+ /**
118
+ * Minimum pixel height of a timed event box, so short events stay legible and
119
+ * clickable. Also the floor of the `boxHeight` handed to `renderTimeEvent`.
120
+ * Default 14; pass 0 to size every box strictly by its duration.
121
+ */
122
+ minEventHeight?: number;
123
+ /**
124
+ * Inset in pixels between a timed event box and its column edges (each side).
125
+ * Default 1; pass 0 to let events fill their column.
126
+ */
127
+ eventGap?: number;
128
+ /** Vertical scroll, in minutes from midnight. Applied on mount and whenever it changes. */
129
+ scrollOffsetMinutes?: number;
130
+ /** Sub-divisions per hour for the grid lines. */
131
+ timeslots?: number;
132
+ /** First hour shown (0–23). Default 0. */
133
+ minHour?: number;
134
+ /** Last hour shown, exclusive (1–24). Default 24. */
135
+ maxHour?: number;
136
+ /** Hide the left hour-axis column (lines stay, labels/gutter go). Default false. */
137
+ hideHours?: boolean;
138
+ /** Show the ISO week number in the header gutter. Default false. */
139
+ showWeekNumber?: boolean;
140
+ /** Prefix for the week number, e.g. "W" → "W28". Default "W". */
141
+ weekNumberPrefix?: string;
142
+ /** Shade the hours outside business hours. */
143
+ businessHours?: BusinessHours;
144
+ /**
145
+ * Render a closed-hours band's content yourself (a label, icon, pattern).
146
+ * The grid keeps positioning the band; when set, the themed tint is dropped
147
+ * and your output fills the band instead. Decorative only: the
148
+ * band stays non-interactive and hidden from assistive tech.
149
+ */
150
+ renderBusinessHours?: (band: BusinessHoursBand) => JSX.Element;
151
+ /**
152
+ * A component that draws a `display: "background"` event's band in place of
153
+ * the themed shade; see `TimeGrid`'s prop of the same name.
154
+ */
155
+ renderBackgroundEvent?: SolidRenderEvent<T>;
156
+ /** Show the current-time indicator (default true). */
157
+ showNowIndicator?: boolean;
158
+ /** Show the all-day lane (default true). */
159
+ showAllDayEventCell?: boolean;
160
+ /** Show the "all-day" text beside the lane (default false). */
161
+ showAllDayLabel?: boolean;
162
+ /** Tint weekend columns (default true). Set false to treat weekends normally. */
163
+ highlightWeekends?: boolean;
164
+ /** Allow moving events by default (per-event `startEditable` overrides). Default true. */
165
+ eventStartEditable?: boolean;
166
+ /** Allow resizing events by default (per-event `durationEditable` overrides). Default true. */
167
+ eventDurationEditable?: boolean;
168
+ /** Reject drags/resizes that would overlap another event (default true = allowed). */
169
+ eventOverlap?: boolean;
170
+ /** Snap dragged/created events to this many minutes. */
171
+ dragStepMinutes?: number;
172
+ /** DOM touch/pen hold duration in ms (default 300). */
173
+ touchDragDelay?: number;
174
+ /** DOM touch/pen movement tolerance in px (default 8). */
175
+ touchDragThreshold?: number;
176
+ /**
177
+ * Tap empty space: the date+time pressed on the week/day grid, or the tapped
178
+ * day at midnight in `month` mode (where it fires alongside `onPressDay`).
179
+ */
180
+ onPressCell?: (date: Date) => void;
181
+ /**
182
+ * Drag empty space to create. On the week/day grid that sweeps out a time
183
+ * range; in `month` mode it sweeps out an **all-day** span across the days
184
+ * dragged (`start` at midnight of the first, `end` at midnight after the last).
185
+ */
186
+ onCreateEvent?: (start: Date, end: Date) => void;
187
+ /**
188
+ * A component that draws content inside the time-grid drag-to-create preview;
189
+ * see `TimeGrid`'s prop of the same name. Applies to the week/day grid only.
190
+ */
191
+ renderCreateGhost?: Component<CreateGhostArgs>;
192
+ /** Fires when an event drag begins. */
193
+ onDragStart?: (event: CalendarEvent<T>) => void;
194
+ /**
195
+ * Enables drag-to-move/resize; return `false` to reject the drop. In `month`
196
+ * mode an event chip can be dragged onto another day, shifting both ends by the
197
+ * days dragged so the time of day and duration are kept.
198
+ */
199
+ onDragEvent?: (event: CalendarEvent<T>, start: Date, end: Date) => void | boolean;
200
+ /** Stable, unique event identity for the web editing dialog across data refreshes. */
201
+ getEventId?: (event: CalendarEvent<T>) => string | number;
202
+ /** Tap a day's column header. */
203
+ onPressDateHeader?: (day: Date) => void;
204
+ /** Custom time-grid event renderer. */
205
+ renderTimeEvent?: SolidRenderEvent<T>;
206
+ /** Replace the hour-axis label. Receives the hour (0–23) and the `ampm` flag. */
207
+ hourComponent?: (hour: number, ampm: boolean) => JSX.Element;
208
+ /**
209
+ * Add arrow-key navigation between time-grid events (a convenience for sighted
210
+ * keyboard users; every event stays individually tabbable). Time-grid modes only.
211
+ */
212
+ keyboardEventNavigation?: boolean;
213
+
214
+ // --- Month mode ---
215
+ /** Max chips per day before a "+N more" row. */
216
+ maxVisibleEventCount?: number;
217
+ /** Month chip height in pixels; omit to keep the renderer default. */
218
+ chipHeight?: number;
219
+ /** Gap between month chip rows in pixels (default 2). */
220
+ chipGap?: number;
221
+ /** Overflow row template; `{moreCount}` is replaced. */
222
+ moreLabel?: string;
223
+ /** Translations for the screen-reader words and gutter text; omitted keys use English. */
224
+ labels?: Partial<CalendarLabels>;
225
+ /** Render neighbouring months' days in the leading/trailing cells (default true). */
226
+ showAdjacentMonths?: boolean;
227
+ /**
228
+ * Render the built-in "Month yyyy" title above the month grid. Default true. Set
229
+ * false when your own header already shows the month and year. Month mode only.
230
+ */
231
+ showTitle?: boolean;
232
+ /** Weekday header label width: `narrow` ("M"), `short` ("Mon", default), or `long` ("Monday"). */
233
+ weekdayFormat?: WeekdayFormat;
234
+ /** Fill the cell with the range background instead of the pill band. */
235
+ fillCellOnSelection?: boolean;
236
+ /** Selected span. */
237
+ selectedRange?: DateRange;
238
+ /** Discrete selected days. */
239
+ selectedDates?: Date[];
240
+ /**
241
+ * In month mode, make day cells keyboard-navigable (one roving tab stop, arrow
242
+ * keys, Enter to open the day). Default false: keyboard focus moves through
243
+ * events only. Has no effect on the time-grid modes.
244
+ */
245
+ keyboardDayNavigation?: boolean;
246
+ /** Tap a day cell. */
247
+ onPressDay?: (date: Date) => void;
248
+ /**
249
+ * Month and year modes: reports a create sweep's day span as it happens, as the
250
+ * ordered inclusive `[start, end]` days, so a selection highlight can follow the
251
+ * drag. Pair it with `createDateRange`'s `selectRange`. Enables the sweep on its
252
+ * own, so it works without `onCreateEvent`.
253
+ */
254
+ onSelectDrag?: (start: Date, end: Date) => void;
255
+ /** Tap a month's title in the year view, e.g. jump to that month. */
256
+ onPressMonth?: (month: Date) => void;
257
+ /** Tap the "+N more" overflow row. */
258
+ onPressMore?: (events: CalendarEvent<T>[], date: Date) => void;
259
+ /** Custom month chip renderer. */
260
+ renderMonthEvent?: SolidMonthEvent<T>;
261
+
262
+ // --- Schedule mode ---
263
+ /** Custom agenda row renderer (`mode="schedule"`). */
264
+ renderScheduleEvent?: SolidAgendaEvent<T>;
265
+ }
266
+
267
+ // Stable empty array so a missing `events` prop doesn't churn `displayEvents`
268
+ // identity when another input changes.
269
+ const EMPTY_EVENTS: CalendarEvent<never>[] = [];
270
+
271
+ // Recurrence is expanded over the range a mode renders: the month grid for
272
+ // `month`, the day columns for the time-grid modes, and a forward window for the
273
+ // `schedule` agenda (which has no bounded viewport of its own).
274
+ function expansionRange(
275
+ mode: CalendarMode,
276
+ date: Date,
277
+ weekStartsOn: WeekStartsOn,
278
+ numberOfDays: number | undefined,
279
+ ): [Date, Date] {
280
+ if (mode === "month") {
281
+ return [
282
+ startOfWeek(startOfMonth(date), {
283
+ weekStartsOn,
284
+ }),
285
+ endOfWeek(endOfMonth(date), {
286
+ weekStartsOn,
287
+ }),
288
+ ];
289
+ }
290
+ if (mode === "year") {
291
+ return [
292
+ startOfWeek(startOfYear(date), {
293
+ weekStartsOn,
294
+ }),
295
+ endOfWeek(endOfYear(date), {
296
+ weekStartsOn,
297
+ }),
298
+ ];
299
+ }
300
+ if (mode === "schedule") {
301
+ // The agenda lists forward from the anchor date; three months is a sensible
302
+ // default look-ahead. Pre-expand for a different window.
303
+ return [startOfDay(date), endOfDay(addMonths(date, 3))];
304
+ }
305
+ const days = getViewDays(mode, date, weekStartsOn, numberOfDays ?? 1);
306
+ return [startOfDay(days[0]), endOfDay(days[days.length - 1])];
307
+ }
308
+
309
+ // The date one page away in `direction` (+1 next, −1 previous): a year for
310
+ // `year`, a month for `month`, a week for `schedule`, else the view's day span.
311
+ function pageStep(
312
+ mode: CalendarMode,
313
+ date: Date,
314
+ direction: number,
315
+ weekStartsOn: WeekStartsOn,
316
+ numberOfDays: number | undefined,
317
+ ): Date {
318
+ if (mode === "year") return addYears(date, direction);
319
+ if (mode === "month") return addMonths(date, direction);
320
+ if (mode === "schedule") return addDays(date, direction * 7);
321
+ return addDays(date, direction * getViewDays(mode, date, weekStartsOn, numberOfDays ?? 1).length);
322
+ }
323
+
324
+ /**
325
+ * Main entry point for the Solid renderer: it picks the right
326
+ * view for `mode`. `month` renders a single {@link MonthView}; `schedule` renders
327
+ * an {@link Agenda}; the time-grid modes render a {@link TimeGrid}. For a
328
+ * scrolling month picker, use {@link MonthList} directly.
329
+ *
330
+ * @example
331
+ * ```tsx
332
+ * <Calendar mode="week" date={new Date()} events={events} />
333
+ * ```
334
+ */
335
+
336
+ export function Calendar<T = unknown>(
337
+ incoming: CalendarProps<T> & {
338
+ ref?: (handle: CalendarHandle) => void;
339
+ },
340
+ ): JSX.Element {
341
+ const props = withDefaults(
342
+ {
343
+ mode: "week",
344
+ weekStartsOn: 0,
345
+ } satisfies Partial<
346
+ CalendarProps<T> & {
347
+ ref?: (handle: CalendarHandle) => void;
348
+ }
349
+ >,
350
+ incoming,
351
+ );
352
+ const timeGridRef: ElementRef<CalendarHandle | null> = {
353
+ current: null,
354
+ };
355
+ onSettled(() => {
356
+ props.ref?.({
357
+ scrollToTime: (minutes, options) => timeGridRef.current?.scrollToTime(minutes, options),
358
+ });
359
+ });
360
+ // Materialise recurring events over the range this mode renders, then apply the
361
+ // display zone. Non-recurring and already-expanded events pass through
362
+ // untouched, so identity is preserved for the common (no-recurrence) case.
363
+ const displayEvents = createMemo(() => {
364
+ let out: CalendarEvent<T>[] = props.events ?? EMPTY_EVENTS;
365
+ if (out.some((e) => e.recurrence)) {
366
+ let [start, end] = expansionRange(
367
+ props.mode,
368
+ props.date,
369
+ props.weekStartsOn,
370
+ props.numberOfDays,
371
+ );
372
+ // A display zone shifts each occurrence's wall-clock by up to ~a day, which
373
+ // can move an edge occurrence into a visible column; widen so it's generated.
374
+ if (props.timeZone) {
375
+ start = addDays(start, -1);
376
+ end = addDays(end, 1);
377
+ }
378
+ out = expandRecurringEvents(out, start, end);
379
+ }
380
+ if (props.timeZone) out = eventsInTimeZone(out, props.timeZone);
381
+ return out;
382
+ // `date.getTime()`: recompute on the instant, not a re-created Date identity.
383
+ });
384
+
385
+ // PageDown / PageUp page the calendar when the consumer opts in with
386
+ // `onChangeDate`; keydowns bubble up from the focused grid to this handler.
387
+ const handlePageKeys = (e: DomKeyboardEvent) => {
388
+ if (!props.onChangeDate) return;
389
+ if (e.key === "PageDown")
390
+ props.onChangeDate(
391
+ pageStep(props.mode, props.date, 1, props.weekStartsOn, props.numberOfDays),
392
+ );
393
+ else if (e.key === "PageUp")
394
+ props.onChangeDate(
395
+ pageStep(props.mode, props.date, -1, props.weekStartsOn, props.numberOfDays),
396
+ );
397
+ else return;
398
+ e.preventDefault();
399
+ };
400
+ const currentMode = createMemo(() => props.mode);
401
+ const view = () => {
402
+ const mode = currentMode();
403
+ if (mode === "year") {
404
+ return (
405
+ <YearView<T>
406
+ date={props.date}
407
+ events={displayEvents()}
408
+ weekStartsOn={props.weekStartsOn}
409
+ hiddenDays={props.hiddenDays}
410
+ locale={props.locale}
411
+ labels={props.labels}
412
+ theme={props.theme}
413
+ className={props.className}
414
+ style={
415
+ props.height != null
416
+ ? {
417
+ height: props.height,
418
+ ...props.style,
419
+ }
420
+ : props.style
421
+ }
422
+ classNames={props.classNames}
423
+ styles={props.styles}
424
+ selectedRange={props.selectedRange}
425
+ selectedDates={props.selectedDates}
426
+ minDate={props.minDate}
427
+ maxDate={props.maxDate}
428
+ isDateDisabled={props.isDateDisabled}
429
+ onPressDay={props.onPressDay}
430
+ onPressMonth={props.onPressMonth}
431
+ onSelectDrag={props.onSelectDrag}
432
+ onCreateEvent={props.onCreateEvent}
433
+ />
434
+ );
435
+ } else if (mode === "schedule") {
436
+ return (
437
+ <Agenda<T>
438
+ events={displayEvents()}
439
+ locale={props.locale}
440
+ ampm={props.ampm}
441
+ theme={props.theme}
442
+ height={props.height}
443
+ activeDate={props.date}
444
+ className={props.className}
445
+ style={props.style}
446
+ classNames={props.classNames}
447
+ styles={props.styles}
448
+ renderEvent={props.renderScheduleEvent}
449
+ eventAccessibilityLabel={props.eventAccessibilityLabel}
450
+ onPressEvent={props.onPressEvent}
451
+ onPressDay={props.onPressDay}
452
+ />
453
+ );
454
+ } else if (mode === "month") {
455
+ return (
456
+ <MonthView<T>
457
+ date={props.date}
458
+ events={displayEvents()}
459
+ weekStartsOn={props.weekStartsOn}
460
+ hiddenDays={props.hiddenDays}
461
+ weekdayFormat={props.weekdayFormat}
462
+ highlightWeekends={props.highlightWeekends}
463
+ locale={props.locale}
464
+ labels={props.labels}
465
+ theme={props.theme}
466
+ className={props.className}
467
+ style={props.style}
468
+ classNames={props.classNames}
469
+ styles={props.styles}
470
+ maxVisibleEventCount={props.maxVisibleEventCount}
471
+ chipHeight={props.chipHeight}
472
+ chipGap={props.chipGap}
473
+ moreLabel={props.moreLabel}
474
+ showAdjacentMonths={props.showAdjacentMonths}
475
+ showTitle={props.showTitle}
476
+ fillCellOnSelection={props.fillCellOnSelection}
477
+ selectedRange={props.selectedRange}
478
+ selectedDates={props.selectedDates}
479
+ minDate={props.minDate}
480
+ maxDate={props.maxDate}
481
+ isDateDisabled={props.isDateDisabled}
482
+ keyboardDayNavigation={props.keyboardDayNavigation}
483
+ onPressDay={props.onPressDay}
484
+ onPressCell={props.onPressCell}
485
+ onCreateEvent={props.onCreateEvent}
486
+ onSelectDrag={props.onSelectDrag}
487
+ onDragEvent={props.onDragEvent}
488
+ onDragStart={props.onDragStart}
489
+ eventStartEditable={props.eventStartEditable}
490
+ eventOverlap={props.eventOverlap}
491
+ onPressEvent={props.onPressEvent}
492
+ onPressMore={props.onPressMore}
493
+ renderEvent={props.renderMonthEvent}
494
+ eventAccessibilityLabel={props.eventAccessibilityLabel}
495
+ />
496
+ );
497
+ } else {
498
+ return (
499
+ <TimeGrid<T>
500
+ ref={(el) => (timeGridRef.current = el)}
501
+ date={props.date}
502
+ mode={mode}
503
+ events={displayEvents()}
504
+ weekStartsOn={props.weekStartsOn}
505
+ hiddenDays={props.hiddenDays}
506
+ now={props.now}
507
+ timeZone={props.timeZone}
508
+ weekdayFormat={props.weekdayFormat}
509
+ numberOfDays={props.numberOfDays}
510
+ locale={props.locale}
511
+ labels={props.labels}
512
+ theme={props.theme}
513
+ height={props.height}
514
+ className={props.className}
515
+ style={props.style}
516
+ classNames={props.classNames}
517
+ styles={props.styles}
518
+ ampm={props.ampm}
519
+ hourHeight={props.hourHeight}
520
+ minEventHeight={props.minEventHeight}
521
+ eventGap={props.eventGap}
522
+ scrollOffsetMinutes={props.scrollOffsetMinutes}
523
+ timeslots={props.timeslots}
524
+ minHour={props.minHour}
525
+ maxHour={props.maxHour}
526
+ hideHours={props.hideHours}
527
+ showWeekNumber={props.showWeekNumber}
528
+ weekNumberPrefix={props.weekNumberPrefix}
529
+ businessHours={props.businessHours}
530
+ renderBusinessHours={props.renderBusinessHours}
531
+ renderBackgroundEvent={props.renderBackgroundEvent}
532
+ showNowIndicator={props.showNowIndicator}
533
+ showAllDayEventCell={props.showAllDayEventCell}
534
+ showAllDayLabel={props.showAllDayLabel}
535
+ highlightWeekends={props.highlightWeekends}
536
+ eventStartEditable={props.eventStartEditable}
537
+ eventDurationEditable={props.eventDurationEditable}
538
+ eventOverlap={props.eventOverlap}
539
+ dragStepMinutes={props.dragStepMinutes}
540
+ touchDragDelay={props.touchDragDelay}
541
+ touchDragThreshold={props.touchDragThreshold}
542
+ onPressEvent={props.onPressEvent}
543
+ onPressCell={props.onPressCell}
544
+ onCreateEvent={props.onCreateEvent}
545
+ renderCreateGhost={props.renderCreateGhost}
546
+ onDragStart={props.onDragStart}
547
+ onDragEvent={props.onDragEvent}
548
+ getEventId={props.getEventId}
549
+ onChangeDate={props.onChangeDate}
550
+ onPressDateHeader={props.onPressDateHeader}
551
+ renderEvent={props.renderTimeEvent}
552
+ eventAccessibilityLabel={props.eventAccessibilityLabel}
553
+ hourComponent={props.hourComponent}
554
+ keyboardEventNavigation={props.keyboardEventNavigation}
555
+ />
556
+ );
557
+ }
558
+
559
+ // `display: contents` adds no layout box, so the view renders exactly as before
560
+ // while keydowns from the focused grid still bubble to the paging handler (a
561
+ // no-op when `onChangeDate` is unset). Rendered unconditionally so toggling the
562
+ // handler never remounts the view subtree.
563
+ };
564
+ return (
565
+ <div
566
+ style={css({
567
+ display: "contents",
568
+ })}
569
+ onKeyDown={handlePageKeys}
570
+ >
571
+ {view()}
572
+ </div>
573
+ );
574
+ }