@allhailai/tempusmachina-react 1.0.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,1275 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+ import * as React$1 from 'react';
3
+ import React__default from 'react';
4
+ import * as temporal_polyfill from 'temporal-polyfill';
5
+ import { Temporal } from 'temporal-polyfill';
6
+ import * as _tempus_machina_core from '@allhailai/tempusmachina-core';
7
+ import { EventInput, PluginDef, ViewPreset, Resource, BusinessHoursInput, EventDefaults, TemporalDateRange, NormalizedEvent, ViewLayout, PositionedEvent, DayCell as DayCell$1, BackgroundEvent as BackgroundEvent$1, TimeSlot as TimeSlot$1, ResourceLane as ResourceLane$1, ViewConfig, EventSourceDef, EventSourceInput, NormalizedEventSource } from '@allhailai/tempusmachina-core';
8
+ import * as _allhailai_tempusmachina_core from '@allhailai/tempusmachina-core';
9
+ import { ClassValue } from 'clsx';
10
+ import * as class_variance_authority_types from 'class-variance-authority/types';
11
+ import { VariantProps } from 'class-variance-authority';
12
+ import { Button as Button$1 } from '@base-ui/react/button';
13
+ import { Toggle as Toggle$1 } from '@base-ui/react/toggle';
14
+ import { ToggleGroup as ToggleGroup$1 } from '@base-ui/react/toggle-group';
15
+
16
+ interface UseCalendarOptions {
17
+ events: EventInput[];
18
+ plugins: PluginDef[];
19
+ defaultDate?: Temporal.PlainDate;
20
+ date?: Temporal.PlainDate;
21
+ onDateChange?: (date: Temporal.PlainDate) => void;
22
+ defaultView?: ViewPreset;
23
+ view?: ViewPreset;
24
+ onViewChange?: (view: ViewPreset) => void;
25
+ timezone?: string;
26
+ locale?: string;
27
+ firstDayOfWeek?: 0 | 1 | 2 | 3 | 4 | 5 | 6;
28
+ slotDuration?: Temporal.Duration;
29
+ slotMinTime?: Temporal.PlainTime;
30
+ slotMaxTime?: Temporal.PlainTime;
31
+ resources?: Resource[];
32
+ businessHours?: BusinessHoursInput;
33
+ editable?: boolean;
34
+ selectable?: boolean;
35
+ eventMaxStack?: number;
36
+ eventDefaults?: EventDefaults;
37
+ validRange?: TemporalDateRange;
38
+ titleFormat?: Intl.DateTimeFormatOptions;
39
+ titleRangeSeparator?: string;
40
+ onDatesSet?: (info: {
41
+ start: Temporal.PlainDate;
42
+ end: Temporal.PlainDate;
43
+ view: ViewPreset;
44
+ }) => void;
45
+ onEventAdd?: (info: {
46
+ event: NormalizedEvent;
47
+ }) => void;
48
+ onEventChange?: (info: {
49
+ event: NormalizedEvent;
50
+ oldEvent: NormalizedEvent;
51
+ }) => void;
52
+ onEventRemove?: (info: {
53
+ event: NormalizedEvent;
54
+ }) => void;
55
+ onEventsSet?: (events: NormalizedEvent[]) => void;
56
+ }
57
+ interface UseCalendarReturn {
58
+ currentDate: Temporal.PlainDate;
59
+ currentView: ViewPreset;
60
+ viewLayout: ViewLayout | null;
61
+ visibleRange: TemporalDateRange;
62
+ events: NormalizedEvent[];
63
+ next: () => void;
64
+ prev: () => void;
65
+ today: () => void;
66
+ goToDate: (date: Temporal.PlainDate) => void;
67
+ changeView: (view: ViewPreset) => void;
68
+ title: string;
69
+ addEvent: (event: EventInput) => void;
70
+ updateEvent: (id: string, patch: Partial<EventInput>) => void;
71
+ removeEvent: (id: string) => void;
72
+ }
73
+ /**
74
+ * Primary orchestration hook — wires the headless core engine to React state.
75
+ */
76
+ declare function useCalendar(options: UseCalendarOptions): UseCalendarReturn;
77
+
78
+ /**
79
+ * Calendar slots — render prop overrides for every visual element.
80
+ */
81
+ interface CalendarSlots {
82
+ eventContent?: (props: EventContentProps) => React.ReactNode;
83
+ dayCellContent?: (props: DayCellContentProps) => React.ReactNode;
84
+ slotContent?: (props: SlotContentProps) => React.ReactNode;
85
+ headerContent?: (props: HeaderContentProps) => React.ReactNode;
86
+ moreLinkContent?: (props: MoreLinkContentProps) => React.ReactNode;
87
+ resourceLabelContent?: (props: ResourceLabelContentProps) => React.ReactNode;
88
+ nowIndicatorContent?: () => React.ReactNode;
89
+ /** Additional CSS class names for events (string or function) */
90
+ eventClassNames?: string | ((props: EventContentProps) => string);
91
+ /** Called after an event DOM element is mounted */
92
+ eventDidMount?: (info: {
93
+ el: HTMLElement;
94
+ event: _tempus_machina_core.NormalizedEvent;
95
+ view: _tempus_machina_core.ViewPreset;
96
+ }) => void;
97
+ /** Called before an event DOM element is unmounted */
98
+ eventWillUnmount?: (info: {
99
+ el: HTMLElement;
100
+ event: _tempus_machina_core.NormalizedEvent;
101
+ view: _tempus_machina_core.ViewPreset;
102
+ }) => void;
103
+ /** Called after a day cell DOM element is mounted */
104
+ dayCellDidMount?: (info: {
105
+ el: HTMLElement;
106
+ date: temporal_polyfill.Temporal.PlainDate;
107
+ }) => void;
108
+ /** Called after the view container is mounted */
109
+ viewDidMount?: (info: {
110
+ el: HTMLElement;
111
+ view: _tempus_machina_core.ViewPreset;
112
+ }) => void;
113
+ /** Called before the view container is unmounted */
114
+ viewWillUnmount?: (info: {
115
+ el: HTMLElement;
116
+ view: _tempus_machina_core.ViewPreset;
117
+ }) => void;
118
+ }
119
+ interface EventContentProps {
120
+ event: NormalizedEvent;
121
+ view: ViewPreset;
122
+ isStart: boolean;
123
+ isEnd: boolean;
124
+ isDragging: boolean;
125
+ timeText: string;
126
+ }
127
+ interface DayCellContentProps {
128
+ date: Temporal.PlainDate;
129
+ isToday: boolean;
130
+ isCurrentMonth: boolean;
131
+ isWeekend: boolean;
132
+ dayNumberText: string;
133
+ events: NormalizedEvent[];
134
+ }
135
+ interface SlotContentProps {
136
+ start: Temporal.PlainDateTime;
137
+ end: Temporal.PlainDateTime;
138
+ isBusinessHour: boolean;
139
+ }
140
+ interface HeaderContentProps {
141
+ title: string;
142
+ currentView: ViewPreset;
143
+ currentDate: Temporal.PlainDate;
144
+ }
145
+ interface MoreLinkContentProps {
146
+ count: number;
147
+ date: Temporal.PlainDate;
148
+ }
149
+ interface ResourceLabelContentProps {
150
+ resource: Resource;
151
+ }
152
+ /**
153
+ * The shape of the calendar context value.
154
+ */
155
+ interface CalendarContextValue {
156
+ currentDate: Temporal.PlainDate;
157
+ currentView: ViewPreset;
158
+ viewLayout: ViewLayout | null;
159
+ visibleRange: TemporalDateRange;
160
+ events: NormalizedEvent[];
161
+ resources: Resource[];
162
+ timezone: string;
163
+ locale: string;
164
+ firstDayOfWeek: number;
165
+ editable: boolean;
166
+ selectable: boolean;
167
+ eventDefaults?: EventDefaults;
168
+ selectedRange: {
169
+ start: Temporal.ZonedDateTime;
170
+ end: Temporal.ZonedDateTime;
171
+ } | null;
172
+ select: (start: Temporal.ZonedDateTime, end: Temporal.ZonedDateTime) => void;
173
+ unselect: () => void;
174
+ next: () => void;
175
+ prev: () => void;
176
+ today: () => void;
177
+ goToDate: (date: Temporal.PlainDate) => void;
178
+ changeView: (view: ViewPreset) => void;
179
+ addEvent: (event: EventInput) => void;
180
+ updateEvent: (id: string, patch: Partial<EventInput>) => void;
181
+ removeEvent: (id: string) => void;
182
+ title: string;
183
+ slots: CalendarSlots;
184
+ onEventClick?: (event: NormalizedEvent) => void;
185
+ onEventDrop?: (info: {
186
+ event: NormalizedEvent;
187
+ newStart: Temporal.ZonedDateTime;
188
+ newEnd: Temporal.ZonedDateTime;
189
+ newResourceId?: string;
190
+ }) => void;
191
+ onDateSelect?: (range: {
192
+ start: Temporal.PlainDateTime;
193
+ end: Temporal.PlainDateTime;
194
+ resourceId?: string;
195
+ }) => void;
196
+ onEventResize?: (info: {
197
+ event: NormalizedEvent;
198
+ newStart: Temporal.ZonedDateTime;
199
+ newEnd: Temporal.ZonedDateTime;
200
+ }) => void;
201
+ onDateClick?: (info: {
202
+ date: Temporal.PlainDate;
203
+ dateStr: string;
204
+ view: ViewPreset;
205
+ resourceId?: string;
206
+ }) => void;
207
+ onDatesSet?: (info: {
208
+ start: Temporal.PlainDate;
209
+ end: Temporal.PlainDate;
210
+ view: ViewPreset;
211
+ }) => void;
212
+ onUnselect?: () => void;
213
+ onEventMouseEnter?: (info: {
214
+ event: NormalizedEvent;
215
+ el: HTMLElement;
216
+ }) => void;
217
+ onEventMouseLeave?: (info: {
218
+ event: NormalizedEvent;
219
+ el: HTMLElement;
220
+ }) => void;
221
+ onEventDragStart?: (info: {
222
+ event: NormalizedEvent;
223
+ }) => void;
224
+ onEventDragStop?: (info: {
225
+ event: NormalizedEvent;
226
+ }) => void;
227
+ onEventResizeStart?: (info: {
228
+ event: NormalizedEvent;
229
+ }) => void;
230
+ onEventResizeStop?: (info: {
231
+ event: NormalizedEvent;
232
+ }) => void;
233
+ onEventAdd?: (info: {
234
+ event: NormalizedEvent;
235
+ }) => void;
236
+ onEventChange?: (info: {
237
+ event: NormalizedEvent;
238
+ oldEvent: NormalizedEvent;
239
+ }) => void;
240
+ onEventRemove?: (info: {
241
+ event: NormalizedEvent;
242
+ }) => void;
243
+ onEventsSet?: (events: NormalizedEvent[]) => void;
244
+ onLoading?: (isLoading: boolean) => void;
245
+ onWindowResize?: (info: {
246
+ view: ViewPreset;
247
+ }) => void;
248
+ }
249
+ declare const CalendarContext: React$1.Context<CalendarContextValue | null>;
250
+ /**
251
+ * Hook to consume the calendar context.
252
+ * Must be used within a <Calendar> provider.
253
+ */
254
+ declare function useCalendarContext(): CalendarContextValue;
255
+
256
+ interface CalendarProps extends UseCalendarOptions {
257
+ className?: string;
258
+ children?: React__default.ReactNode;
259
+ slots?: CalendarSlots;
260
+ /** Text direction: 'ltr' | 'rtl'. Auto-detected from locale if not set. */
261
+ direction?: 'ltr' | 'rtl';
262
+ /** Calendar height (e.g., '600px', 'auto') */
263
+ height?: string | number;
264
+ /** Calendar content height */
265
+ contentHeight?: string | number;
266
+ /** Aspect ratio for auto-sizing */
267
+ aspectRatio?: number;
268
+ onEventClick?: (event: NormalizedEvent) => void;
269
+ onEventDrop?: (info: {
270
+ event: NormalizedEvent;
271
+ newStart: Temporal.ZonedDateTime;
272
+ newEnd: Temporal.ZonedDateTime;
273
+ newResourceId?: string;
274
+ }) => void;
275
+ onDateSelect?: (range: {
276
+ start: Temporal.PlainDateTime;
277
+ end: Temporal.PlainDateTime;
278
+ resourceId?: string;
279
+ }) => void;
280
+ onEventResize?: (info: {
281
+ event: NormalizedEvent;
282
+ newStart: Temporal.ZonedDateTime;
283
+ newEnd: Temporal.ZonedDateTime;
284
+ }) => void;
285
+ /** Mouse enter on event */
286
+ onEventMouseEnter?: (info: {
287
+ event: NormalizedEvent;
288
+ el: HTMLElement;
289
+ }) => void;
290
+ /** Mouse leave from event */
291
+ onEventMouseLeave?: (info: {
292
+ event: NormalizedEvent;
293
+ el: HTMLElement;
294
+ }) => void;
295
+ /** Date click handler */
296
+ onDateClick?: (info: {
297
+ date: Temporal.PlainDate;
298
+ dateStr: string;
299
+ view: ViewPreset;
300
+ resourceId?: string;
301
+ }) => void;
302
+ }
303
+ /**
304
+ * <Calendar /> — Root compound component.
305
+ * Provides CalendarContext and renders children or default layout.
306
+ * Activates PDND drag-and-drop monitor when `editable` is true.
307
+ */
308
+ declare function Calendar({ className, children, slots, direction, height, contentHeight, aspectRatio, onEventClick, onEventDrop, onDateSelect, onEventResize, onEventMouseEnter, onEventMouseLeave, onDateClick, ...options }: CalendarProps): react_jsx_runtime.JSX.Element;
309
+ declare namespace Calendar {
310
+ var Header: typeof CalendarHeaderSlot;
311
+ var View: typeof CalendarViewSlot;
312
+ var NavPrev: typeof CalendarNavPrev;
313
+ var NavNext: typeof CalendarNavNext;
314
+ var NavToday: typeof CalendarNavToday;
315
+ var Title: typeof CalendarTitle;
316
+ var ViewSwitcher: typeof CalendarViewSwitcher;
317
+ }
318
+ declare function CalendarHeaderSlot({ className }: {
319
+ className?: string;
320
+ }): react_jsx_runtime.JSX.Element;
321
+ declare namespace CalendarHeaderSlot {
322
+ var displayName: string;
323
+ }
324
+ declare function CalendarViewSlot({ className }: {
325
+ className?: string;
326
+ }): react_jsx_runtime.JSX.Element;
327
+ declare namespace CalendarViewSlot {
328
+ var displayName: string;
329
+ }
330
+ declare function CalendarNavPrev({ className }: {
331
+ className?: string;
332
+ }): react_jsx_runtime.JSX.Element;
333
+ declare namespace CalendarNavPrev {
334
+ var displayName: string;
335
+ }
336
+ declare function CalendarNavNext({ className }: {
337
+ className?: string;
338
+ }): react_jsx_runtime.JSX.Element;
339
+ declare namespace CalendarNavNext {
340
+ var displayName: string;
341
+ }
342
+ declare function CalendarNavToday({ className }: {
343
+ className?: string;
344
+ }): react_jsx_runtime.JSX.Element;
345
+ declare namespace CalendarNavToday {
346
+ var displayName: string;
347
+ }
348
+ declare function CalendarTitle({ className }: {
349
+ className?: string;
350
+ }): react_jsx_runtime.JSX.Element;
351
+ declare namespace CalendarTitle {
352
+ var displayName: string;
353
+ }
354
+ declare function CalendarViewSwitcher({ views, className }: {
355
+ views?: ViewPreset[];
356
+ className?: string;
357
+ }): react_jsx_runtime.JSX.Element;
358
+ declare namespace CalendarViewSwitcher {
359
+ var displayName: string;
360
+ }
361
+
362
+ interface ToolbarConfig {
363
+ left?: string;
364
+ center?: string;
365
+ right?: string;
366
+ }
367
+ interface CustomButton {
368
+ text: string;
369
+ click: () => void;
370
+ icon?: React__default.ReactNode;
371
+ }
372
+ interface CalendarHeaderProps {
373
+ className?: string;
374
+ children?: React__default.ReactNode;
375
+ /** Config-driven toolbar: { left: 'prev,next today', center: 'title', right: 'dayGridMonth,timeGridWeek,timeGridDay' } */
376
+ toolbar?: ToolbarConfig;
377
+ /** Override button text labels */
378
+ buttonText?: Partial<Record<string, string>>;
379
+ /** Custom buttons registry */
380
+ customButtons?: Record<string, CustomButton>;
381
+ /** Whether to use sticky positioning */
382
+ sticky?: boolean;
383
+ }
384
+ /**
385
+ * <CalendarHeader /> — Config-driven toolbar with prev/next, title, view switcher, and custom buttons.
386
+ *
387
+ * When `toolbar` prop is provided, renders from config tokens.
388
+ * Otherwise falls back to children, slots, or default layout.
389
+ */
390
+ declare function CalendarHeader({ className, children, toolbar, buttonText, customButtons, sticky, }: CalendarHeaderProps): react_jsx_runtime.JSX.Element;
391
+
392
+ interface CalendarFooterProps {
393
+ className?: string;
394
+ /** Config-driven footer toolbar — same token format as headerToolbar */
395
+ toolbar?: ToolbarConfig;
396
+ /** Override button text labels */
397
+ buttonText?: Partial<Record<string, string>>;
398
+ /** Custom buttons registry */
399
+ customButtons?: Record<string, CustomButton>;
400
+ }
401
+ /**
402
+ * <CalendarFooter /> — Optional footer toolbar mirroring the header's config-driven rendering.
403
+ *
404
+ * Usage:
405
+ * ```tsx
406
+ * <CalendarFooter toolbar={{ left: 'prev,next', center: '', right: 'dayGridMonth,timeGridWeek' }} />
407
+ * ```
408
+ */
409
+ declare function CalendarFooter({ className, toolbar, buttonText, customButtons, }: CalendarFooterProps): react_jsx_runtime.JSX.Element | null;
410
+
411
+ interface DayGridProps {
412
+ className?: string;
413
+ /** Always show 6 weeks (default: false) */
414
+ fixedWeekCount?: boolean;
415
+ /** Show dates from adjacent months (default: true) */
416
+ showNonCurrentDates?: boolean;
417
+ /** Show week numbers column (default: false) */
418
+ weekNumbers?: boolean;
419
+ }
420
+ /**
421
+ * <DayGrid /> — Month view renderer.
422
+ * Renders a grid of weeks × days from viewLayout.weeks.
423
+ * Supports fixedWeekCount, showNonCurrentDates, and weekNumbers.
424
+ */
425
+ declare function DayGrid({ className, fixedWeekCount, showNonCurrentDates, weekNumbers, }: DayGridProps): react_jsx_runtime.JSX.Element | null;
426
+
427
+ type MoreLinkClick = 'popover' | 'day' | ((info: MoreLinkInfo) => void);
428
+ interface MoreLinkInfo {
429
+ date: string;
430
+ allEvents: PositionedEvent[];
431
+ hiddenEvents: PositionedEvent[];
432
+ }
433
+
434
+ interface DayCellProps {
435
+ cell: DayCell$1;
436
+ /** How to handle "+N more" clicks */
437
+ moreLinkClick?: MoreLinkClick;
438
+ /** Enable clicking day number to navigate to day view */
439
+ navLinkDayClick?: boolean | ((date: Temporal.PlainDate) => void);
440
+ }
441
+ /**
442
+ * <DayCell /> — Individual day cell in the month grid.
443
+ * Supports dateClick, navLinkDayClick, moreLinkClick, and PDND drop targets.
444
+ */
445
+ declare function DayCell({ cell, moreLinkClick, navLinkDayClick }: DayCellProps): react_jsx_runtime.JSX.Element;
446
+
447
+ interface EventCardProps {
448
+ positionedEvent: PositionedEvent;
449
+ compact?: boolean;
450
+ /** Custom event time format */
451
+ eventTimeFormat?: Intl.DateTimeFormatOptions;
452
+ /** Whether to show event time (default: true) */
453
+ displayEventTime?: boolean;
454
+ /** Whether to show event end time (default: false) */
455
+ displayEventEnd?: boolean;
456
+ }
457
+ /**
458
+ * <EventCard /> — Renders a single event.
459
+ * Supports display modes: auto, block, list-item, none.
460
+ * When editable, integrates Pragmatic Drag and Drop for native drag behavior.
461
+ */
462
+ declare function EventCard({ positionedEvent, compact, eventTimeFormat, displayEventTime, displayEventEnd, }: EventCardProps): react_jsx_runtime.JSX.Element | null;
463
+
464
+ interface BackgroundEventProps {
465
+ /** Background event with positioning data */
466
+ backgroundEvent: BackgroundEvent$1;
467
+ /** Whether this is in a time-grid (uses top/height) or day-grid (full cell) */
468
+ variant?: 'timeGrid' | 'dayGrid';
469
+ }
470
+ /**
471
+ * <BackgroundEvent /> — Renders a translucent background overlay for events
472
+ * with display: 'background'. These appear behind regular events.
473
+ */
474
+ declare function BackgroundEvent({ backgroundEvent, variant }: BackgroundEventProps): react_jsx_runtime.JSX.Element;
475
+
476
+ interface TimeGridProps {
477
+ className?: string;
478
+ /** Initial scroll position (e.g., '06:00:00') */
479
+ scrollTime?: string;
480
+ /** Reset scroll on view change */
481
+ scrollTimeReset?: boolean;
482
+ /** Sticky header dates */
483
+ stickyHeaderDates?: boolean;
484
+ /** Slot label format override */
485
+ slotLabelFormat?: Intl.DateTimeFormatOptions;
486
+ /** Sticky footer scrollbar */
487
+ stickyFooterScrollbar?: boolean;
488
+ }
489
+ /**
490
+ * <TimeGrid /> — Week/day time view renderer.
491
+ * Renders time axis + day columns with positioned events.
492
+ * Supports scrollTime, stickyHeaderDates, and slot label formatting.
493
+ */
494
+ declare function TimeGrid({ className, scrollTime, scrollTimeReset, stickyHeaderDates, slotLabelFormat, stickyFooterScrollbar, }: TimeGridProps): react_jsx_runtime.JSX.Element | null;
495
+
496
+ interface TimeSlotProps {
497
+ slot: TimeSlot$1;
498
+ /** The date this slot belongs to (for drop target registration) */
499
+ date?: Temporal.PlainDate;
500
+ /** Resource ID (for resource views) */
501
+ resourceId?: string;
502
+ }
503
+ /**
504
+ * <TimeSlot /> — Individual time cell in the time-grid view.
505
+ * Acts as a PDND drop target when the calendar is editable.
506
+ */
507
+ declare function TimeSlot({ slot, date, resourceId }: TimeSlotProps): react_jsx_runtime.JSX.Element;
508
+
509
+ interface NowIndicatorProps {
510
+ position: number;
511
+ }
512
+ /**
513
+ * <NowIndicator /> — Current time line in time-grid views.
514
+ */
515
+ declare function NowIndicator({ position }: NowIndicatorProps): react_jsx_runtime.JSX.Element;
516
+
517
+ interface AllDayRowProps {
518
+ events: PositionedEvent[];
519
+ className?: string;
520
+ }
521
+ /**
522
+ * <AllDayRow /> — All-day event strip at the top of time-grid views.
523
+ */
524
+ declare function AllDayRow({ events, className }: AllDayRowProps): react_jsx_runtime.JSX.Element | null;
525
+
526
+ interface TimelineProps {
527
+ className?: string;
528
+ }
529
+ /**
530
+ * <Timeline /> — Horizontal resource timeline renderer.
531
+ */
532
+ declare function Timeline({ className }: TimelineProps): react_jsx_runtime.JSX.Element | null;
533
+
534
+ interface ResourceLaneProps {
535
+ lane: ResourceLane$1;
536
+ slotCount: number;
537
+ }
538
+ /**
539
+ * <ResourceLane /> — A single resource row in the timeline view.
540
+ */
541
+ declare function ResourceLane({ lane, slotCount }: ResourceLaneProps): react_jsx_runtime.JSX.Element;
542
+
543
+ interface AgendaProps {
544
+ className?: string;
545
+ }
546
+ /**
547
+ * <Agenda /> — List/agenda view renderer.
548
+ * Groups events by date in a flat list format.
549
+ */
550
+ declare function Agenda({ className }: AgendaProps): react_jsx_runtime.JSX.Element | null;
551
+
552
+ interface MultiMonthProps {
553
+ className?: string;
554
+ }
555
+ /**
556
+ * <MultiMonth /> — Renders multiple months in a stacked or grid layout.
557
+ *
558
+ * Used by multiMonthStack and multiMonthGrid view presets.
559
+ */
560
+ declare function MultiMonth({ className }: MultiMonthProps): react_jsx_runtime.JSX.Element | null;
561
+
562
+ interface ResourceTimeGridProps {
563
+ className?: string;
564
+ }
565
+ /**
566
+ * <ResourceTimeGrid /> — Renders a time grid where columns represent resources.
567
+ *
568
+ * Used by resourceTimeGridDay and resourceTimeGridWeek view presets.
569
+ */
570
+ declare function ResourceTimeGrid({ className }: ResourceTimeGridProps): react_jsx_runtime.JSX.Element | null;
571
+
572
+ /**
573
+ * Hook for date navigation controls.
574
+ */
575
+ declare function useNavigation(): {
576
+ next: () => void;
577
+ prev: () => void;
578
+ today: () => void;
579
+ goToDate: (date: temporal_polyfill.Temporal.PlainDate) => void;
580
+ currentDate: temporal_polyfill.Temporal.PlainDate;
581
+ title: string;
582
+ };
583
+
584
+ /**
585
+ * Hook for event store operations.
586
+ */
587
+ declare function useEvents(): {
588
+ events: NormalizedEvent[];
589
+ addEvent: (event: _tempus_machina_core.EventInput) => void;
590
+ updateEvent: (id: string, patch: Partial<_tempus_machina_core.EventInput>) => void;
591
+ removeEvent: (id: string) => void;
592
+ };
593
+
594
+ /**
595
+ * Hook for view switching.
596
+ */
597
+ declare function useView(): {
598
+ currentView: _allhailai_tempusmachina_core.ViewPreset;
599
+ changeView: (view: _allhailai_tempusmachina_core.ViewPreset) => void;
600
+ viewLayout: _allhailai_tempusmachina_core.ViewLayout | null;
601
+ };
602
+
603
+ /**
604
+ * Hook for time slot generation in the current view.
605
+ */
606
+ declare function useSlots(): {
607
+ timeSlots: _tempus_machina_core.TimeSlot[];
608
+ columns: _tempus_machina_core.TimeGridColumn[];
609
+ };
610
+
611
+ type InteractionMode = 'idle' | 'dragging' | 'resizing' | 'selecting';
612
+ interface InteractionState {
613
+ mode: InteractionMode;
614
+ activeEvent: NormalizedEvent | null;
615
+ ghostEvent: NormalizedEvent | null;
616
+ previewStart: Temporal.ZonedDateTime | null;
617
+ previewEnd: Temporal.ZonedDateTime | null;
618
+ /** The drop target currently being hovered */
619
+ dropTargetDate: string | null;
620
+ dropTargetTime: string | null;
621
+ dropTargetResourceId: string | null;
622
+ }
623
+ interface UseInteractionOptions {
624
+ /** All events for overlap checking */
625
+ events?: NormalizedEvent[];
626
+ /** View config for time resolution */
627
+ viewConfig?: ViewConfig;
628
+ /** Timezone */
629
+ timezone?: string;
630
+ /** Duration of revert animation on failed drop (ms) */
631
+ dragRevertDuration?: number;
632
+ /** When dragging between timed and all-day, maintain original duration */
633
+ allDayMaintainDuration?: boolean;
634
+ /** Whether events can be dragged between resources */
635
+ eventResourceEditable?: boolean;
636
+ /** Callback when event drag starts */
637
+ onEventDragStart?: (info: {
638
+ event: NormalizedEvent;
639
+ }) => void;
640
+ /** Callback when event drag stops */
641
+ onEventDragStop?: (info: {
642
+ event: NormalizedEvent;
643
+ }) => void;
644
+ /** Callback when event is dropped */
645
+ onEventDrop?: (info: {
646
+ event: NormalizedEvent;
647
+ newStart: Temporal.ZonedDateTime;
648
+ newEnd: Temporal.ZonedDateTime;
649
+ newResourceId?: string;
650
+ oldResourceId?: string;
651
+ revert: () => void;
652
+ }) => void;
653
+ /** Callback when event is resized */
654
+ onEventResize?: (info: {
655
+ event: NormalizedEvent;
656
+ newStart: Temporal.ZonedDateTime;
657
+ newEnd: Temporal.ZonedDateTime;
658
+ revert: () => void;
659
+ }) => void;
660
+ }
661
+ interface UseInteractionReturn {
662
+ state: InteractionState;
663
+ startDrag: (event: NormalizedEvent, position: {
664
+ x: number;
665
+ y: number;
666
+ }) => void;
667
+ startResize: (event: NormalizedEvent, edge: 'start' | 'end', position: {
668
+ x: number;
669
+ y: number;
670
+ }) => void;
671
+ startSelect: (position: {
672
+ x: number;
673
+ y: number;
674
+ }) => void;
675
+ updatePosition: (position: {
676
+ x: number;
677
+ y: number;
678
+ }) => void;
679
+ endInteraction: () => InteractionResult | null;
680
+ cancel: () => void;
681
+ }
682
+ interface InteractionResult {
683
+ type: 'move' | 'resize' | 'create' | 'select';
684
+ event?: NormalizedEvent;
685
+ newStart?: Temporal.ZonedDateTime;
686
+ newEnd?: Temporal.ZonedDateTime;
687
+ newResourceId?: string;
688
+ }
689
+ /**
690
+ * Drag/drop/resize state machine hook.
691
+ * Uses PDND's monitorForElements at the calendar root level for global drag awareness.
692
+ * Individual elements use useDragEvent/useDropSlot for PDND binding.
693
+ *
694
+ * This hook orchestrates the high-level interaction state (ghost events, previews)
695
+ * while PDND handles the browser-native drag mechanics.
696
+ */
697
+ declare function useInteraction(options?: UseInteractionOptions): UseInteractionReturn;
698
+
699
+ /**
700
+ * PDND data key for identifying calendar event drags.
701
+ */
702
+ declare const CALENDAR_EVENT_TYPE = "tempus-machina/event";
703
+ interface UseDragEventOptions {
704
+ /** The event being made draggable */
705
+ event: NormalizedEvent;
706
+ /** Whether this event is editable (default: true) */
707
+ editable?: boolean;
708
+ /** Whether the start time can be changed via drag */
709
+ startEditable?: boolean;
710
+ /** Minimum distance before drag activates (pixels) */
711
+ dragMinDistance?: number;
712
+ /** Callback when drag starts */
713
+ onDragStart?: (event: NormalizedEvent) => void;
714
+ /** Callback when drag ends (regardless of outcome) */
715
+ onDragEnd?: (event: NormalizedEvent) => void;
716
+ }
717
+ interface UseDragEventReturn {
718
+ /** Ref to attach to the draggable element */
719
+ dragRef: React.RefObject<HTMLElement | null>;
720
+ /** Ref to attach to a specific drag handle (optional) */
721
+ dragHandleRef: React.RefObject<HTMLElement | null>;
722
+ /** Whether this element is currently being dragged */
723
+ isDragging: boolean;
724
+ }
725
+ /**
726
+ * Hook to make an event card draggable using Pragmatic Drag and Drop.
727
+ *
728
+ * Usage:
729
+ * ```tsx
730
+ * const { dragRef, isDragging } = useDragEvent({ event });
731
+ * return <div ref={dragRef} style={{ opacity: isDragging ? 0.5 : 1 }}>...</div>;
732
+ * ```
733
+ */
734
+ declare function useDragEvent(options: UseDragEventOptions): UseDragEventReturn;
735
+
736
+ interface UseDropSlotOptions {
737
+ /** The date this slot represents */
738
+ date: Temporal.PlainDate;
739
+ /** Time position within the day (for time-grid slots) */
740
+ time?: Temporal.PlainTime;
741
+ /** Resource ID (for resource views) */
742
+ resourceId?: string;
743
+ /** View config for time resolution */
744
+ viewConfig: ViewConfig;
745
+ /** Timezone */
746
+ timezone: string;
747
+ /** Called when a valid drop occurs */
748
+ onEventDrop?: (info: {
749
+ event: {
750
+ id: string;
751
+ title: string;
752
+ };
753
+ newStart: Temporal.ZonedDateTime;
754
+ newEnd: Temporal.ZonedDateTime;
755
+ newResourceId?: string;
756
+ }) => void;
757
+ /** Called when drag enters this slot */
758
+ onDragEnter?: () => void;
759
+ /** Called when drag leaves this slot */
760
+ onDragLeave?: () => void;
761
+ }
762
+ interface UseDropSlotReturn {
763
+ /** Ref to attach to the drop target element */
764
+ dropRef: React.RefObject<HTMLElement | null>;
765
+ /** Whether something is currently dragging over this slot */
766
+ isDragOver: boolean;
767
+ /** Whether this slot can accept the current drag */
768
+ canDrop: boolean;
769
+ }
770
+ /**
771
+ * Hook to make a time slot or day cell a PDND drop target.
772
+ *
773
+ * Usage:
774
+ * ```tsx
775
+ * const { dropRef, isDragOver } = useDropSlot({
776
+ * date, time, viewConfig, timezone,
777
+ * onEventDrop: (info) => updateEvent(info.event.id, { start: info.newStart }),
778
+ * });
779
+ * return <div ref={dropRef} className={isDragOver ? 'bg-blue-100' : ''}>...</div>;
780
+ * ```
781
+ */
782
+ declare function useDropSlot(options: UseDropSlotOptions): UseDropSlotReturn;
783
+
784
+ interface UseSelectionOptions {
785
+ /** Whether selection is enabled */
786
+ selectable?: boolean;
787
+ /** Minimum distance in pixels before selection starts */
788
+ selectMinDistance?: number;
789
+ /** Whether to show a mirror overlay during selection */
790
+ selectMirror?: boolean;
791
+ /** Automatically unselect when clicking elsewhere */
792
+ unselectAuto?: boolean;
793
+ /** CSS selector for elements that should NOT trigger unselect */
794
+ unselectCancel?: string;
795
+ /** Timezone for time calculations */
796
+ timezone?: string;
797
+ /** Called when a date/time range is selected */
798
+ onSelect?: (info: SelectionInfo) => void;
799
+ /** Called when selection is cleared */
800
+ onUnselect?: () => void;
801
+ /** Called on single date click */
802
+ onDateClick?: (info: DateClickInfo) => void;
803
+ }
804
+ interface SelectionInfo {
805
+ start: Temporal.ZonedDateTime;
806
+ end: Temporal.ZonedDateTime;
807
+ allDay: boolean;
808
+ resourceId?: string;
809
+ }
810
+ interface DateClickInfo {
811
+ date: Temporal.PlainDate;
812
+ dateStr: string;
813
+ allDay: boolean;
814
+ resourceId?: string;
815
+ }
816
+ interface SelectionState {
817
+ /** Whether a selection is currently in progress (dragging) */
818
+ isSelecting: boolean;
819
+ /** Current selection range */
820
+ selection: SelectionInfo | null;
821
+ /** Mirror preview during drag-select */
822
+ previewStart: Temporal.ZonedDateTime | null;
823
+ previewEnd: Temporal.ZonedDateTime | null;
824
+ }
825
+ interface UseSelectionReturn {
826
+ /** Current selection state */
827
+ state: SelectionState;
828
+ /** Begin a selection at a given position */
829
+ startSelection: (info: {
830
+ date: Temporal.PlainDate;
831
+ time?: Temporal.PlainTime;
832
+ resourceId?: string;
833
+ allDay?: boolean;
834
+ }) => void;
835
+ /** Update the selection end as the pointer moves */
836
+ updateSelection: (info: {
837
+ date: Temporal.PlainDate;
838
+ time?: Temporal.PlainTime;
839
+ }) => void;
840
+ /** Finalize the selection */
841
+ endSelection: () => void;
842
+ /** Clear the current selection */
843
+ clearSelection: () => void;
844
+ /** Programmatically set a selection */
845
+ select: (start: Temporal.ZonedDateTime, end: Temporal.ZonedDateTime) => void;
846
+ }
847
+ /**
848
+ * Pointer-event-based selection hook for calendar date/time range selection.
849
+ * Uses pointer events (not PDND) because selection ≠ drag-and-drop.
850
+ *
851
+ * Supports:
852
+ * - Click-to-select-slot (single cell)
853
+ * - Drag-to-select-range (multiple cells)
854
+ * - selectMirror ghost preview
855
+ * - unselectAuto click-away
856
+ * - selectMinDistance threshold
857
+ */
858
+ declare function useSelection(options?: UseSelectionOptions): UseSelectionReturn;
859
+
860
+ /**
861
+ * Reactive current time hook.
862
+ * Updates on an interval for now-indicator positioning.
863
+ *
864
+ * @param intervalMs - Update interval in milliseconds (default: 60000 = 1 minute)
865
+ * @param timezone - IANA timezone string (default: local)
866
+ */
867
+ declare function useTemporalNow(intervalMs?: number, timezone?: string): Temporal.ZonedDateTime;
868
+
869
+ interface UseEventSourcesOptions {
870
+ /** Event source definitions */
871
+ eventSources: (EventSourceDef | EventSourceInput)[];
872
+ /** Current visible range — triggers refetch on change */
873
+ visibleRange: TemporalDateRange;
874
+ /** Timezone */
875
+ timezone: string;
876
+ /** Event defaults for normalization */
877
+ eventDefaults?: EventDefaults;
878
+ /** Whether to render events progressively as sources resolve */
879
+ progressiveEventRendering?: boolean;
880
+ /** Called when loading state changes */
881
+ onLoading?: (isLoading: boolean) => void;
882
+ /** Called when a source fails */
883
+ onSourceError?: (sourceId: string, error: Error) => void;
884
+ }
885
+ interface UseEventSourcesReturn {
886
+ /** All resolved events from all sources */
887
+ events: NormalizedEvent[];
888
+ /** Whether any source is currently loading */
889
+ isLoading: boolean;
890
+ /** Individual source states */
891
+ sources: NormalizedEventSource[];
892
+ /** Force refetch all sources */
893
+ refetchAll: () => void;
894
+ /** Force refetch a specific source */
895
+ refetch: (sourceId: string) => void;
896
+ }
897
+ /**
898
+ * Hook to manage multiple event sources with automatic refetching on range change.
899
+ *
900
+ * Supports:
901
+ * - Static arrays, JSON feed URLs, and async functions
902
+ * - Parallel fetching with error isolation
903
+ * - Progressive rendering (show events as they arrive)
904
+ * - Loading state callbacks
905
+ * - Manual refetch control
906
+ */
907
+ declare function useEventSources(options: UseEventSourcesOptions): UseEventSourcesReturn;
908
+
909
+ /**
910
+ * Data carried by an external draggable element.
911
+ */
912
+ interface ExternalDragData {
913
+ /** Type identifier for filtering */
914
+ type: string;
915
+ /** Event data to create on drop */
916
+ eventData?: Partial<EventInput>;
917
+ /** Raw data from external source */
918
+ raw?: unknown;
919
+ }
920
+ interface ExternalDropInfo {
921
+ /** The slot date/time where the drop occurred */
922
+ date: Temporal.PlainDate;
923
+ time?: Temporal.PlainTime;
924
+ /** Resource ID if applicable */
925
+ resourceId?: string;
926
+ /** The external drag data */
927
+ dragData: ExternalDragData;
928
+ /** Whether the drop was on an all-day area */
929
+ allDay: boolean;
930
+ }
931
+ interface UseExternalDropOptions {
932
+ /** Whether the calendar accepts external drops */
933
+ droppable?: boolean;
934
+ /** Filter function for accepted drop types */
935
+ dropAccept?: string | string[] | ((type: string) => boolean);
936
+ /** Called when an external element is dropped onto the calendar */
937
+ onDrop?: (info: ExternalDropInfo) => void;
938
+ /** Called when an event is received from an external source */
939
+ onEventReceive?: (event: EventInput) => void;
940
+ }
941
+ interface UseExternalDropReturn {
942
+ /** Ref to attach to the calendar container for external drops */
943
+ dropRef: React.RefObject<HTMLElement | null>;
944
+ /** Whether an external element is currently being dragged over */
945
+ isDraggingOver: boolean;
946
+ /** Whether an external drag is currently active */
947
+ isExternalDragActive: boolean;
948
+ }
949
+ /**
950
+ * useExternalDrop — Accepts drops from external sources onto the calendar.
951
+ *
952
+ * Uses PDND's external adapter to handle files, text, and external HTML elements
953
+ * dragged from outside the calendar. External elements must attach PDND data
954
+ * via the consuming app's `draggable()` configuration.
955
+ *
956
+ * @example
957
+ * ```tsx
958
+ * const { dropRef, isDraggingOver } = useExternalDrop({
959
+ * droppable: true,
960
+ * dropAccept: 'task',
961
+ * onDrop: (info) => console.log('Dropped:', info),
962
+ * onEventReceive: (event) => addEvent(event),
963
+ * });
964
+ * ```
965
+ */
966
+ declare function useExternalDrop(options: UseExternalDropOptions): UseExternalDropReturn;
967
+
968
+ /** Data key used to identify calendar events in PDND data */
969
+ declare const CALENDAR_BRIDGE_TYPE = "tempus-machina-bridge";
970
+ interface UseCalendarBridgeOptions {
971
+ /** Unique ID for this calendar instance */
972
+ calendarId: string;
973
+ /** Called when an event leaves this calendar during drag */
974
+ onEventLeave?: (event: NormalizedEvent) => void;
975
+ /** Called when an event is received from another calendar */
976
+ onEventReceive?: (event: NormalizedEvent, sourceCalendarId: string) => void;
977
+ /** Called when an event is dropped back on its original calendar (no-op) */
978
+ onEventReturn?: (event: NormalizedEvent) => void;
979
+ /** Whether inter-calendar transfer is enabled */
980
+ enabled?: boolean;
981
+ }
982
+ interface UseCalendarBridgeReturn {
983
+ /** Unique calendar ID */
984
+ calendarId: string;
985
+ /** Ref to attach PDND bridge data to draggable events */
986
+ getBridgeData: (event: NormalizedEvent) => Record<string, unknown>;
987
+ /** Check if a drag source is from another calendar */
988
+ isFromOtherCalendar: (data: Record<string, unknown>) => boolean;
989
+ }
990
+ /**
991
+ * useCalendarBridge — Enables cross-calendar event transfer via PDND.
992
+ *
993
+ * Calendar A's monitor detects when an event drag leaves → fires `onEventLeave`.
994
+ * Calendar B's drop target receives the event → fires `onEventReceive`.
995
+ * Events carry source calendar identity via PDND's `getInitialData()` flow.
996
+ *
997
+ * No shared state needed — PDND's browser-native DnD handles cross-component transfer.
998
+ *
999
+ * @example
1000
+ * ```tsx
1001
+ * // Calendar A
1002
+ * const bridgeA = useCalendarBridge({
1003
+ * calendarId: 'calendar-a',
1004
+ * onEventLeave: (event) => removeEvent(event.id),
1005
+ * });
1006
+ *
1007
+ * // Calendar B
1008
+ * const bridgeB = useCalendarBridge({
1009
+ * calendarId: 'calendar-b',
1010
+ * onEventReceive: (event, sourceId) => addEvent(event),
1011
+ * });
1012
+ * ```
1013
+ */
1014
+ declare function useCalendarBridge(options: UseCalendarBridgeOptions): UseCalendarBridgeReturn;
1015
+
1016
+ interface KeyboardNavHints {
1017
+ /** Accessible hint for navigation buttons */
1018
+ buttonHints?: {
1019
+ prev?: string;
1020
+ next?: string;
1021
+ today?: string;
1022
+ };
1023
+ /** Hint for view switcher buttons */
1024
+ viewHint?: (viewName: string) => string;
1025
+ /** Hint for day number nav links */
1026
+ navLinkHint?: string;
1027
+ /** Hint for time slots */
1028
+ timeHint?: (timeText: string) => string;
1029
+ /** Hint for events */
1030
+ eventHint?: (title: string) => string;
1031
+ /** Hint for close buttons */
1032
+ closeHint?: string;
1033
+ }
1034
+ interface UseKeyboardNavOptions {
1035
+ /** Container ref — keyboard events are scoped to this element */
1036
+ containerRef: React.RefObject<HTMLElement | null>;
1037
+ /** Whether keyboard navigation is enabled */
1038
+ enabled?: boolean;
1039
+ /** Callback when a date is navigated to via keyboard */
1040
+ onDateNav?: (direction: 'up' | 'down' | 'left' | 'right') => void;
1041
+ /** Callback when Enter/Space is pressed on a focused date */
1042
+ onDateSelect?: () => void;
1043
+ /** Callback when Escape is pressed */
1044
+ onCancel?: () => void;
1045
+ /** Callback when Tab key cycles through events */
1046
+ onEventFocus?: (eventId: string) => void;
1047
+ /** Current view for determining navigation behavior */
1048
+ currentView?: ViewPreset;
1049
+ /** Accessible hints */
1050
+ hints?: KeyboardNavHints;
1051
+ }
1052
+ interface UseKeyboardNavReturn {
1053
+ /** Props to spread on the calendar container */
1054
+ containerProps: {
1055
+ role: 'grid';
1056
+ tabIndex: number;
1057
+ 'aria-label': string;
1058
+ onKeyDown: (e: React.KeyboardEvent) => void;
1059
+ };
1060
+ /** Props to spread on each grid cell */
1061
+ getCellProps: (opts: {
1062
+ date: string;
1063
+ isSelected?: boolean;
1064
+ }) => {
1065
+ role: 'gridcell';
1066
+ tabIndex: number;
1067
+ 'aria-selected': boolean;
1068
+ 'aria-label': string;
1069
+ };
1070
+ /** Props to spread on each event element */
1071
+ getEventProps: (opts: {
1072
+ id: string;
1073
+ title: string;
1074
+ timeText: string;
1075
+ }) => {
1076
+ role: 'button';
1077
+ tabIndex: number;
1078
+ 'aria-label': string;
1079
+ 'aria-grabbed'?: boolean;
1080
+ };
1081
+ }
1082
+ /**
1083
+ * useKeyboardNav — Full keyboard navigation for the calendar.
1084
+ *
1085
+ * Arrow keys navigate between dates/events, Enter/Space selects,
1086
+ * Escape cancels, Tab cycles through interactive events.
1087
+ *
1088
+ * @example
1089
+ * ```tsx
1090
+ * const { containerProps, getCellProps, getEventProps } = useKeyboardNav({
1091
+ * containerRef,
1092
+ * onDateNav: (dir) => navigateDate(dir),
1093
+ * onDateSelect: () => selectDate(),
1094
+ * });
1095
+ * ```
1096
+ */
1097
+ declare function useKeyboardNav(options: UseKeyboardNavOptions): UseKeyboardNavReturn;
1098
+
1099
+ interface UseTouchOptions {
1100
+ /** Element ref for touch event binding */
1101
+ elementRef: React.RefObject<HTMLElement | null>;
1102
+ /** Whether touch interactions are enabled */
1103
+ enabled?: boolean;
1104
+ /** Long press delay for initiating drag (ms) */
1105
+ longPressDelay?: number;
1106
+ /** Long press delay specifically for events (ms) */
1107
+ eventLongPressDelay?: number;
1108
+ /** Long press delay specifically for selection (ms) */
1109
+ selectLongPressDelay?: number;
1110
+ /** Called when a long press is detected on an event */
1111
+ onEventLongPress?: (info: TouchEventInfo) => void;
1112
+ /** Called when a long press is detected on a slot (for selection) */
1113
+ onSlotLongPress?: (info: TouchEventInfo) => void;
1114
+ /** Called when a tap is detected */
1115
+ onTap?: (info: TouchEventInfo) => void;
1116
+ /** Called when a swipe gesture is detected */
1117
+ onSwipe?: (direction: 'left' | 'right' | 'up' | 'down') => void;
1118
+ }
1119
+ interface TouchEventInfo {
1120
+ /** Touch position relative to viewport */
1121
+ clientX: number;
1122
+ clientY: number;
1123
+ /** The target element */
1124
+ target: HTMLElement;
1125
+ /** Data attributes from the target element */
1126
+ date?: string;
1127
+ time?: string;
1128
+ eventId?: string;
1129
+ resourceId?: string;
1130
+ }
1131
+ interface UseTouchReturn {
1132
+ /** Whether a long press is currently active */
1133
+ isLongPressing: boolean;
1134
+ }
1135
+ /**
1136
+ * useTouch — Touch interaction support for the calendar.
1137
+ *
1138
+ * Provides long-press detection for drag initiation on touch devices,
1139
+ * tap detection, and swipe gestures for navigation.
1140
+ *
1141
+ * @example
1142
+ * ```tsx
1143
+ * const { isLongPressing } = useTouch({
1144
+ * elementRef: calendarRef,
1145
+ * onEventLongPress: (info) => startDrag(info),
1146
+ * onSwipe: (dir) => dir === 'left' ? next() : prev(),
1147
+ * });
1148
+ * ```
1149
+ */
1150
+ declare function useTouch(options: UseTouchOptions): UseTouchReturn;
1151
+
1152
+ type ResourceSourceInput = Resource[] | string | ((fetchInfo: ResourceFetchInfo) => Promise<Resource[]>);
1153
+ interface ResourceFetchInfo {
1154
+ start: string;
1155
+ end: string;
1156
+ }
1157
+ interface UseResourcesOptions {
1158
+ /** Initial resources or resource source */
1159
+ resources?: ResourceSourceInput;
1160
+ /** Sort function for resource ordering */
1161
+ resourceOrder?: string | ((a: Resource, b: Resource) => number);
1162
+ /** Width of the resource area in pixels */
1163
+ resourceAreaWidth?: number;
1164
+ /** Whether to refetch resources on date navigation */
1165
+ refetchResourcesOnNavigate?: boolean;
1166
+ /** Lifecycle callbacks */
1167
+ onResourceAdd?: (resource: Resource) => void;
1168
+ onResourceChange?: (resource: Resource) => void;
1169
+ onResourceRemove?: (resource: Resource) => void;
1170
+ onResourcesSet?: (resources: Resource[]) => void;
1171
+ }
1172
+ interface UseResourcesReturn {
1173
+ /** Current list of resources */
1174
+ resources: Resource[];
1175
+ /** Whether resources are loading */
1176
+ isLoading: boolean;
1177
+ /** Add a resource */
1178
+ addResource: (resource: Resource | (Omit<Resource, 'id'> & {
1179
+ id?: string;
1180
+ })) => void;
1181
+ /** Remove a resource by ID */
1182
+ removeResource: (resourceId: string) => void;
1183
+ /** Update a resource */
1184
+ updateResource: (resourceId: string, updates: Partial<Resource>) => void;
1185
+ /** Replace all resources */
1186
+ setResources: (resources: Resource[]) => void;
1187
+ /** Trigger resource refetch (for function/URL sources) */
1188
+ refetchResources: () => void;
1189
+ /** Resource area width */
1190
+ resourceAreaWidth: number;
1191
+ }
1192
+ /**
1193
+ * useResources — Resource CRUD and data sourcing hook.
1194
+ *
1195
+ * Manages calendar resources with immutable state updates.
1196
+ * Supports static arrays, JSON feed URLs, and async functions.
1197
+ *
1198
+ * @example
1199
+ * ```tsx
1200
+ * const { resources, addResource, removeResource } = useResources({
1201
+ * resources: [
1202
+ * { id: 'room-a', title: 'Room A' },
1203
+ * { id: 'room-b', title: 'Room B' },
1204
+ * ],
1205
+ * resourceOrder: 'title',
1206
+ * onResourceAdd: (r) => console.log('Added:', r),
1207
+ * });
1208
+ * ```
1209
+ */
1210
+ declare function useResources(options?: UseResourcesOptions): UseResourcesReturn;
1211
+
1212
+ interface ThemeContextValue {
1213
+ theme: 'light' | 'dark';
1214
+ setTheme: (theme: 'light' | 'dark') => void;
1215
+ toggleTheme: () => void;
1216
+ }
1217
+ declare function useTheme(): ThemeContextValue;
1218
+ interface CalendarThemeProviderProps {
1219
+ children: React__default.ReactNode;
1220
+ defaultTheme?: 'light' | 'dark';
1221
+ }
1222
+ declare function CalendarThemeProvider({ children, defaultTheme, }: CalendarThemeProviderProps): react_jsx_runtime.JSX.Element;
1223
+
1224
+ /**
1225
+ * Utility for merging Tailwind CSS classes with proper conflict resolution.
1226
+ * Combines clsx for conditional classes with tailwind-merge for deduplication.
1227
+ */
1228
+ declare function cn(...inputs: ClassValue[]): string;
1229
+
1230
+ /**
1231
+ * Event card variants.
1232
+ * Styled pill-shaped cards with hover elevation and active feedback.
1233
+ */
1234
+ declare const eventCardVariants: (props?: ({
1235
+ variant?: "default" | "outline" | "ghost" | null | undefined;
1236
+ size?: "default" | "sm" | "lg" | null | undefined;
1237
+ state?: "idle" | "dragging" | "resizing" | "selected" | "focused" | null | undefined;
1238
+ } & class_variance_authority_types.ClassProp) | undefined) => string;
1239
+ type EventCardVariants = VariantProps<typeof eventCardVariants>;
1240
+ /**
1241
+ * Day cell variants for the month grid.
1242
+ * Includes hover highlight for interactivity feedback.
1243
+ */
1244
+ declare const dayCellVariants: (props?: ({
1245
+ variant?: "default" | "today" | "weekend" | "otherMonth" | null | undefined;
1246
+ } & class_variance_authority_types.ClassProp) | undefined) => string;
1247
+ type DayCellVariants = VariantProps<typeof dayCellVariants>;
1248
+ /**
1249
+ * Time slot variants.
1250
+ * Alternating backgrounds for readability + hover state.
1251
+ */
1252
+ declare const timeSlotVariants: (props?: ({
1253
+ variant?: "default" | "odd" | "business" | "nonBusiness" | null | undefined;
1254
+ } & class_variance_authority_types.ClassProp) | undefined) => string;
1255
+ type TimeSlotVariants = VariantProps<typeof timeSlotVariants>;
1256
+
1257
+ declare const buttonVariants: (props?: ({
1258
+ variant?: "default" | "outline" | "secondary" | "ghost" | "destructive" | "link" | null | undefined;
1259
+ size?: "default" | "xs" | "sm" | "lg" | "icon" | "icon-xs" | "icon-sm" | "icon-lg" | null | undefined;
1260
+ } & class_variance_authority_types.ClassProp) | undefined) => string;
1261
+ declare function Button({ className, variant, size, ...props }: Button$1.Props & VariantProps<typeof buttonVariants>): react_jsx_runtime.JSX.Element;
1262
+
1263
+ declare const toggleVariants: (props?: ({
1264
+ variant?: "default" | "outline" | null | undefined;
1265
+ size?: "default" | "sm" | "lg" | null | undefined;
1266
+ } & class_variance_authority_types.ClassProp) | undefined) => string;
1267
+ declare function Toggle({ className, variant, size, ...props }: Toggle$1.Props & VariantProps<typeof toggleVariants>): react_jsx_runtime.JSX.Element;
1268
+
1269
+ declare function ToggleGroup({ className, variant, size, spacing, orientation, children, ...props }: ToggleGroup$1.Props & VariantProps<typeof toggleVariants> & {
1270
+ spacing?: number;
1271
+ orientation?: 'horizontal' | 'vertical';
1272
+ }): react_jsx_runtime.JSX.Element;
1273
+ declare function ToggleGroupItem({ className, children, variant, size, ...props }: Toggle$1.Props & VariantProps<typeof toggleVariants>): react_jsx_runtime.JSX.Element;
1274
+
1275
+ export { Agenda, type AgendaProps, AllDayRow, type AllDayRowProps, BackgroundEvent, type BackgroundEventProps, Button, CALENDAR_BRIDGE_TYPE, CALENDAR_EVENT_TYPE, Calendar, CalendarContext, type CalendarContextValue, CalendarFooter, type CalendarFooterProps, CalendarHeader, type CalendarHeaderProps, type CalendarProps, type CalendarSlots, CalendarThemeProvider, type CalendarThemeProviderProps, type CustomButton, type DateClickInfo, DayCell, type DayCellContentProps, type DayCellProps, type DayCellVariants, DayGrid, type DayGridProps, EventCard, type EventCardProps, type EventCardVariants, type EventContentProps, type ExternalDropInfo, type HeaderContentProps, type InteractionMode, type InteractionResult, type InteractionState, type KeyboardNavHints, type MoreLinkContentProps, MultiMonth, type MultiMonthProps, NowIndicator, type NowIndicatorProps, type ResourceLabelContentProps, ResourceLane, type ResourceLaneProps, type ResourceSourceInput, ResourceTimeGrid, type ResourceTimeGridProps, type SelectionInfo, type SelectionState, type SlotContentProps, type ThemeContextValue, TimeGrid, type TimeGridProps, TimeSlot, type TimeSlotProps, type TimeSlotVariants, Timeline, type TimelineProps, Toggle, ToggleGroup, ToggleGroupItem, type ToolbarConfig, type TouchEventInfo, type UseCalendarBridgeOptions, type UseCalendarBridgeReturn, type UseCalendarOptions, type UseCalendarReturn, type UseDragEventOptions, type UseDragEventReturn, type UseDropSlotOptions, type UseDropSlotReturn, type UseEventSourcesOptions, type UseEventSourcesReturn, type UseExternalDropOptions, type UseExternalDropReturn, type UseInteractionOptions, type UseInteractionReturn, type UseKeyboardNavOptions, type UseKeyboardNavReturn, type UseResourcesOptions, type UseResourcesReturn, type UseSelectionOptions, type UseSelectionReturn, type UseTouchOptions, type UseTouchReturn, buttonVariants, cn, dayCellVariants, eventCardVariants, timeSlotVariants, toggleVariants, useCalendar, useCalendarBridge, useCalendarContext, useDragEvent, useDropSlot, useEventSources, useEvents, useExternalDrop, useInteraction, useKeyboardNav, useNavigation, useResources, useSelection, useSlots, useTemporalNow, useTheme, useTouch, useView };