@super-calendar/native 2.8.2 → 2.9.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.
package/dist/index.d.mts CHANGED
@@ -1,15 +1,17 @@
1
- import { A as PartialCalendarTheme, C as RenderEvent, D as WeekdayFormat, E as WeekStartsOn, M as defaultTheme, N as mergeTheme, O as CalendarTheme, P as useCalendarTheme, S as RecurrenceRule, T as TimeGridMode, _ as EventAccessibilityLabelContext, a as MonthPager, b as ICalendarEvent, c as MonthViewProps, d as SlotDefault, f as SlotStyleProps, g as CalendarMode, h as CalendarEvent, i as MonthListSlot, j as darkTheme, k as CalendarThemeProvider, l as MonthViewSlot, m as BusinessHoursBand, n as MonthList, o as MonthPagerProps, p as BusinessHours, r as MonthListProps, s as MonthView, t as DefaultMonthEvent, u as ResolvedSlot, v as EventAccessibilityLabeler, w as RenderEventArgs, x as RecurrenceFrequency, y as EventKeyExtractor } from "./DefaultMonthEvent-Cewbec1K.mjs";
1
+ import { A as CalendarTheme, C as RecurrenceFrequency, D as TimeGridMode, E as RenderEventArgs, F as mergeTheme, I as useCalendarTheme, M as PartialCalendarTheme, N as darkTheme, O as WeekStartsOn, P as defaultTheme, S as ICalendarEvent, T as RenderEvent, _ as EventAccessibilityLabelContext, a as MonthPager, b as EventDragStartHandler, c as MonthViewProps, d as SlotDefault, f as SlotStyleProps, g as CalendarMode, h as CalendarEvent, i as MonthListSlot, j as CalendarThemeProvider, k as WeekdayFormat, l as MonthViewSlot, m as BusinessHoursBand, n as MonthList, o as MonthPagerProps, p as BusinessHours, r as MonthListProps, s as MonthView, t as DefaultMonthEvent, u as ResolvedSlot, v as EventAccessibilityLabeler, w as RecurrenceRule, x as EventKeyExtractor, y as EventDragHandler } from "./DefaultMonthEvent-BlnKHaq2.mjs";
2
2
  import { Locale } from "date-fns";
3
3
  import { ComponentType, ReactElement, ReactNode } from "react";
4
4
  import { SharedValue, useSharedValue } from "react-native-reanimated";
5
- import { BusinessHoursBand as BusinessHoursBand$1, BusinessHoursValue, CalendarEvent as CalendarEvent$1, DateRange, DateSelectionConstraints, DaySelectionState, EventAccessibilityLabeler as EventAccessibilityLabeler$1, ICalEvent, MonthEventSegment, MonthGrid, MonthGridDay, MonthGridWeek, MonthGridWeekday, MonthWeekEvents, PositionedEvent, ToICalendarOptions, UseDateRangeOptions, UseMonthGridOptions, WeekdayFormat as WeekdayFormat$1, backgroundBandsForDay, buildMonthGrid, buildMonthWeeks, daySelectionState, eventsInTimeZone, expandRecurringEvents, getIsToday, getViewDays, getWeekDays, isAllDayEvent, isBackgroundEvent, isDateSelectable, isRangeEndpoint, isSameCalendarDay, isWeekend, isWithinDateRange, layoutDayEvents, layoutMonthWeek, minutesIntoDay, nextDateRange, parseICalendar, toICalendar, toZonedTime, useDateRange, useEventSource, useMonthGrid, useNow, weekdayFormatToken } from "@super-calendar/core";
5
+ import { BusinessHoursBand as BusinessHoursBand$1, BusinessHoursValue, CalendarEvent as CalendarEvent$1, DateRange, DateRange as DateRange$1, DateSelectionConstraints, DaySelectionState, EventAccessibilityLabeler as EventAccessibilityLabeler$1, ICalEvent, MonthEventSegment, MonthGrid, MonthGridDay, MonthGridWeek, MonthGridWeekday, MonthWeekEvents, PositionedEvent, ToICalendarOptions, UseDateRangeOptions, UseMonthGridOptions, WeekdayFormat as WeekdayFormat$1, backgroundBandsForDay, buildMonthGrid, buildMonthWeeks, daySelectionState, eventsInTimeZone, expandRecurringEvents, getIsToday, getViewDays, getWeekDays, isAllDayEvent, isBackgroundEvent, isDateSelectable, isRangeEndpoint, isSameCalendarDay, isWeekend, isWithinDateRange, layoutDayEvents, layoutMonthWeek, minutesIntoDay, nextDateRange, parseICalendar, toICalendar, toZonedTime, useDateRange, useEventSource, useMonthGrid, useNow, weekdayFormatToken } from "@super-calendar/core";
6
6
  import { StyleProp, ViewStyle } from "react-native";
7
7
  //#region src/components/YearView.d.ts
8
8
  /**
9
9
  * The styleable parts of {@link YearView}. `dayText` and `eventDot` are the
10
- * text/marker inside a day cell (React Native text colour doesn't inherit).
10
+ * text/marker inside a day cell (React Native text colour doesn't inherit);
11
+ * `dayBadge` is the round highlight behind the number and `rangeBand` the
12
+ * selection strip behind it.
11
13
  */
12
- type YearViewSlot = "grid" | "month" | "monthTitle" | "weekdays" | "weekday" | "week" | "day" | "dayText" | "eventDot";
14
+ type YearViewSlot = "grid" | "month" | "monthTitle" | "weekdays" | "weekday" | "week" | "day" | "dayBadge" | "dayText" | "rangeBand" | "eventDot";
13
15
  /** Props for {@link YearView}, the twelve mini-month year grid. */
14
16
  type YearViewProps<T = unknown> = SlotStyleProps<YearViewSlot> & {
15
17
  /** Any date inside the year to render. */
@@ -22,6 +24,16 @@ type YearViewProps<T = unknown> = SlotStyleProps<YearViewSlot> & {
22
24
  locale?: Locale;
23
25
  /** Highlight this date instead of the real "today". */
24
26
  activeDate?: Date;
27
+ /** A selected span: endpoints get a filled badge, the days between get the range band. */
28
+ selectedRange?: DateRange$1;
29
+ /** Discrete selected days, drawn with a filled badge. */
30
+ selectedDates?: Date[];
31
+ /** Earliest selectable day (inclusive); earlier days render disabled. */
32
+ minDate?: Date;
33
+ /** Latest selectable day (inclusive); later days render disabled. */
34
+ maxDate?: Date;
35
+ /** Return true to render a specific day disabled (dimmed, taps ignored). */
36
+ isDateDisabled?: (date: Date) => boolean;
25
37
  /**
26
38
  * Smallest width a mini month may take before the grid drops a column
27
39
  * (default 150). The grid fits 2–4 columns from the measured width.
@@ -31,13 +43,29 @@ type YearViewProps<T = unknown> = SlotStyleProps<YearViewSlot> & {
31
43
  onPressDay?: (date: Date) => void;
32
44
  /** Tap a month's title (e.g. to jump to that month's view). */
33
45
  onPressMonth?: (month: Date) => void;
46
+ /**
47
+ * Enables drag-to-select and reports the swept span live, as the ordered
48
+ * inclusive `[start, end]` days (both at midnight). Pair it with
49
+ * `useDateRange`'s `selectRange` to drive `selectedRange`. Fires on every day the
50
+ * drag crosses, so the highlight follows it; `onCreateEvent` (when also set)
51
+ * fires once on release. Either handler enables the same sweep: hold a day and
52
+ * drag on a device, press and drag on the web. On a device a sweep stays inside
53
+ * the mini month it started in; on the web it can run across months.
54
+ */
55
+ onSelectDrag?: (start: Date, end: Date) => void;
56
+ /**
57
+ * Enables drag-to-create: sweep across days and release to fire this with the
58
+ * all-day range (`start` at midnight of the first day, `end` at midnight after
59
+ * the last, exclusive). A plain tap still fires `onPressDay`, not this.
60
+ */
61
+ onCreateEvent?: (start: Date, end: Date) => void;
34
62
  };
35
- declare function YearViewInner<T>({ date, events, weekStartsOn, hiddenDays, locale, activeDate, minMonthWidth, onPressDay, onPressMonth, classNames, styles: styleOverrides }: YearViewProps<T>): ReactElement;
63
+ declare function YearViewInner<T>({ date, events, weekStartsOn, hiddenDays, locale, activeDate, selectedRange, selectedDates, minDate, maxDate, isDateDisabled, minMonthWidth, onPressDay, onPressMonth, onSelectDrag, onCreateEvent, classNames, styles: styleOverrides }: YearViewProps<T>): ReactElement;
36
64
  /**
37
65
  * A year at a glance: the twelve months as compact mini grids, with today
38
66
  * highlighted and a dot under days that hold events. Tap a day or a month
39
- * title to drill into a denser view. It's the view `Calendar` renders for
40
- * `mode="year"`.
67
+ * title to drill into a denser view, or hold and drag to sweep out a date
68
+ * range. It's the view `Calendar` renders for `mode="year"`.
41
69
  *
42
70
  * @example
43
71
  * ```tsx
@@ -83,19 +111,6 @@ declare function Agenda<T>({ events, locale, renderEvent, keyExtractor, onPressE
83
111
  //#region src/components/TimeGrid.d.ts
84
112
  /** Default height in pixels of one hour row on the time grid. */
85
113
  declare const DEFAULT_HOUR_HEIGHT = 48;
86
- /**
87
- * Called when an event is dragged (moved or resized) to new start/end times.
88
- * Return `false` to reject the drop — the event snaps back to where it started
89
- * (e.g. to forbid overlaps or out-of-bounds slots). Any other return accepts it.
90
- */
91
- type EventDragHandler<T> = (event: CalendarEvent<T>, start: Date, end: Date) => void | boolean;
92
- /**
93
- * Called when a move or resize gesture begins, before any change is committed:
94
- * on grab for a move (after the long-press), and when the resize drag starts.
95
- * Handy for haptic feedback (e.g. `expo-haptics`). Requires drag to be enabled
96
- * via `onDragEvent`.
97
- */
98
- type EventDragStartHandler<T> = (event: CalendarEvent<T>) => void;
99
114
  /** Replace the hour-axis label. Receives the hour (0–23) and the `ampm` flag. */
100
115
  type HourRenderer = (hour: number, ampm: boolean) => React.ReactNode;
101
116
  /**
@@ -267,19 +282,20 @@ type CalendarProps<T> = SlotStyleProps<CalendarSlot> & {
267
282
  /** Long-press an event (month/week/day). */
268
283
  onLongPressEvent?: (event: CalendarEvent<T>) => void;
269
284
  /**
270
- * Enable drag-to-move and drag-to-resize on the week/day grid. Called with the
271
- * dragged event and its new start/end (snapped to `dragStepMinutes`); update
272
- * your own event state in response. Long-press an event to move it (drag
273
- * horizontally to change the day too); drag its bottom grip to resize. Return
274
- * `false` to reject the drop (e.g. an overlap) and snap the event back.
285
+ * Enable drag-to-move and drag-to-resize. Called with the dragged event and its
286
+ * new start/end; update your own event state in response. On the week/day grid,
287
+ * long-press an event to move it (drag horizontally to change the day too) or
288
+ * drag its bottom grip to resize, snapped to `dragStepMinutes`. In `month` mode,
289
+ * long-press an event bar and drop it on another day: both ends shift by the
290
+ * days dragged, so the time of day and duration are kept. Return `false` to
291
+ * reject the drop (e.g. an overlap) and snap the event back.
275
292
  */
276
293
  onDragEvent?: EventDragHandler<T>;
277
294
  /**
278
- * Fired when a move or resize gesture begins on the week/day grid, before any
279
- * change is committed: on grab for a move (after the long-press), and when a
280
- * resize drag starts. Use it to trigger haptic feedback, e.g.
281
- * `Haptics.impactAsync()` from `expo-haptics`. Native-only and inert unless
282
- * `onDragEvent` is also set.
295
+ * Fired when a drag gesture begins, before any change is committed: on grab for
296
+ * a move (after the long-press), and when a week/day resize drag starts. Use it
297
+ * to trigger haptic feedback, e.g. `Haptics.impactAsync()` from `expo-haptics`.
298
+ * Native-only and inert unless `onDragEvent` is also set.
283
299
  */
284
300
  onDragStart?: EventDragStartHandler<T>;
285
301
  /** Minutes a drag-to-move/resize snaps to. Default 15. */
@@ -297,20 +313,47 @@ type CalendarProps<T> = SlotStyleProps<CalendarSlot> & {
297
313
  onLongPressDay?: (date: Date) => void;
298
314
  /** Tap the "+N more" overflow label in a month cell. */
299
315
  onPressMore?: (events: CalendarEvent<T>[], date: Date) => void;
300
- /** Tap empty space on the week/day grid; receives the date+time pressed. */
316
+ /**
317
+ * Tap empty space; receives the date+time pressed on the week/day grid, or the
318
+ * tapped day at midnight in `month` mode (where it fires alongside `onPressDay`).
319
+ */
301
320
  onPressCell?: (date: Date) => void;
302
321
  /** After an empty-cell press, snap the pager back to the active page. Default false. */
303
322
  resetPageOnPressCell?: boolean;
304
323
  /** Long-press empty space on the week/day grid; receives the date+time. */
305
324
  onLongPressCell?: (date: Date) => void;
306
325
  /**
307
- * Enable drag-to-create on the week/day grid: long-press empty space and drag
308
- * to sweep out a new event's time range. Called on release with the snapped
309
- * `start`/`end` (to `dragStepMinutes`); create your own event in response. A
310
- * stationary press yields a one-step range. Native-only; supersedes
311
- * `onLongPressCell` on empty space when set.
326
+ * Enable drag-to-create: long-press empty space and drag to sweep out a new
327
+ * event, then release. On the week/day grid that is a time range snapped to
328
+ * `dragStepMinutes` (a stationary press yields a one-step range); in `month`
329
+ * mode it is an **all-day** span across the days swept — `start` at midnight of
330
+ * the first day, `end` at midnight after the last. Create your own event in
331
+ * response. Supersedes `onLongPressCell` (and, in month mode, `onLongPressDay`)
332
+ * on empty space when set.
312
333
  */
313
334
  onCreateEvent?: (start: Date, end: Date) => void;
335
+ /**
336
+ * Month and year modes: reports a create sweep's day span as it happens, as the
337
+ * ordered inclusive `[start, end]` days, so a selection highlight can follow the
338
+ * drag. Pair it with `useDateRange`'s `selectRange` to drive `selectedRange`.
339
+ * Enables the sweep on its own, so it works without `onCreateEvent`.
340
+ */
341
+ onSelectDrag?: (start: Date, end: Date) => void;
342
+ /** Days drawn as selected (a filled badge) in month and year modes. */
343
+ selectedDates?: Date[];
344
+ /** A selected span: endpoints get a filled badge, the span gets the range band. */
345
+ selectedRange?: DateRange$1;
346
+ /**
347
+ * Fill the whole month cell with the range band instead of the default centered
348
+ * rounded "pill" strip. Default false.
349
+ */
350
+ fillCellOnSelection?: boolean;
351
+ /** Earliest selectable day (inclusive); earlier days render disabled. */
352
+ minDate?: Date;
353
+ /** Latest selectable day (inclusive); later days render disabled. */
354
+ maxDate?: Date;
355
+ /** Return true to render a specific day disabled (dimmed, taps ignored). */
356
+ isDateDisabled?: (date: Date) => boolean;
314
357
  /** Tap a day's column header on the week/day grid (default header only). */
315
358
  onPressDateHeader?: (date: Date) => void;
316
359
  /**
@@ -409,6 +452,11 @@ type CalendarProps<T> = SlotStyleProps<CalendarSlot> & {
409
452
  hourComponent?: HourRenderer;
410
453
  /** Always render six week rows in month view, for a fixed-height grid. Default false. */
411
454
  showSixWeeks?: boolean;
455
+ /**
456
+ * Render the built-in "MMMM yyyy" title above the month grid. Default true. Set
457
+ * false when your own header already shows the month and year. Month mode only.
458
+ */
459
+ showTitle?: boolean;
412
460
  /** Allow swiping between pages (all modes). Default true. */
413
461
  swipeEnabled?: boolean;
414
462
  /** Show the vertical scroll indicator on the week/day grid. Default true. */
@@ -494,7 +542,7 @@ type CalendarProps<T> = SlotStyleProps<CalendarSlot> & {
494
542
  * }
495
543
  * ```
496
544
  */
497
- declare function Calendar<T>({ events, mode, date, onChangeDate, onChangeDateRange, onPressEvent, onLongPressEvent, onDragEvent, onDragStart, dragStepMinutes, showDragHandle, onPressDay, onPressMonth, onLongPressDay, onPressMore, onPressCell, resetPageOnPressCell, onLongPressCell, onCreateEvent, onPressDateHeader, maxVisibleEventCount, sortedMonthView, moreLabel, showAdjacentMonths, disableMonthEventCellPress, weekStartsOn, hiddenDays, now, weekdayFormat, numberOfDays, weekEndsOn, renderEvent, eventAccessibilityLabel, eventCellStyle, calendarCellStyle, businessHours, renderBusinessHours, keyExtractor, theme, cellHeight: cellHeightProp, hourHeight, minHourHeight, maxHourHeight, hourColumnWidth, hideHours, timeslots, showAllDayEventCell, highlightWeekends, eventStartEditable, eventDurationEditable, eventOverlap, showWeekNumber, weekNumberPrefix, hourComponent, showSixWeeks, swipeEnabled, showVerticalScrollIndicator, verticalScrollEnabled, headerComponent, minHour, maxHour, ampm, showTime, ellipsizeTitle, allDayLabel, scrollOffsetMinutes, showNowIndicator, locale, timeZone, activeDate, isRTL, freeSwipe, renderTimeGridHeader, renderHeaderForMonthView, renderCustomDateForMonth, itemSeparatorComponent, classNames, styles: styleOverrides }: CalendarProps<T>): ReactElement;
545
+ declare function Calendar<T>({ events, mode, date, onChangeDate, onChangeDateRange, onPressEvent, onLongPressEvent, onDragEvent, onDragStart, dragStepMinutes, showDragHandle, onPressDay, onPressMonth, onLongPressDay, onPressMore, onPressCell, resetPageOnPressCell, onLongPressCell, onCreateEvent, onSelectDrag, selectedDates, selectedRange, fillCellOnSelection, minDate, maxDate, isDateDisabled, onPressDateHeader, maxVisibleEventCount, sortedMonthView, moreLabel, showAdjacentMonths, disableMonthEventCellPress, weekStartsOn, hiddenDays, now, weekdayFormat, numberOfDays, weekEndsOn, renderEvent, eventAccessibilityLabel, eventCellStyle, calendarCellStyle, businessHours, renderBusinessHours, keyExtractor, theme, cellHeight: cellHeightProp, hourHeight, minHourHeight, maxHourHeight, hourColumnWidth, hideHours, timeslots, showAllDayEventCell, highlightWeekends, eventStartEditable, eventDurationEditable, eventOverlap, showWeekNumber, weekNumberPrefix, hourComponent, showSixWeeks, showTitle, swipeEnabled, showVerticalScrollIndicator, verticalScrollEnabled, headerComponent, minHour, maxHour, ampm, showTime, ellipsizeTitle, allDayLabel, scrollOffsetMinutes, showNowIndicator, locale, timeZone, activeDate, isRTL, freeSwipe, renderTimeGridHeader, renderHeaderForMonthView, renderCustomDateForMonth, itemSeparatorComponent, classNames, styles: styleOverrides }: CalendarProps<T>): ReactElement;
498
546
  //#endregion
499
547
  //#region src/components/DefaultEvent.d.ts
500
548
  /**
package/dist/index.d.ts CHANGED
@@ -1,15 +1,17 @@
1
- import { A as PartialCalendarTheme, C as RenderEvent, D as WeekdayFormat, E as WeekStartsOn, M as defaultTheme, N as mergeTheme, O as CalendarTheme, P as useCalendarTheme, S as RecurrenceRule, T as TimeGridMode, _ as EventAccessibilityLabelContext, a as MonthPager, b as ICalendarEvent, c as MonthViewProps, d as SlotDefault, f as SlotStyleProps, g as CalendarMode, h as CalendarEvent, i as MonthListSlot, j as darkTheme, k as CalendarThemeProvider, l as MonthViewSlot, m as BusinessHoursBand, n as MonthList, o as MonthPagerProps, p as BusinessHours, r as MonthListProps, s as MonthView, t as DefaultMonthEvent, u as ResolvedSlot, v as EventAccessibilityLabeler, w as RenderEventArgs, x as RecurrenceFrequency, y as EventKeyExtractor } from "./DefaultMonthEvent-C_T4thzu.js";
1
+ import { A as CalendarTheme, C as RecurrenceFrequency, D as TimeGridMode, E as RenderEventArgs, F as mergeTheme, I as useCalendarTheme, M as PartialCalendarTheme, N as darkTheme, O as WeekStartsOn, P as defaultTheme, S as ICalendarEvent, T as RenderEvent, _ as EventAccessibilityLabelContext, a as MonthPager, b as EventDragStartHandler, c as MonthViewProps, d as SlotDefault, f as SlotStyleProps, g as CalendarMode, h as CalendarEvent, i as MonthListSlot, j as CalendarThemeProvider, k as WeekdayFormat, l as MonthViewSlot, m as BusinessHoursBand, n as MonthList, o as MonthPagerProps, p as BusinessHours, r as MonthListProps, s as MonthView, t as DefaultMonthEvent, u as ResolvedSlot, v as EventAccessibilityLabeler, w as RecurrenceRule, x as EventKeyExtractor, y as EventDragHandler } from "./DefaultMonthEvent--9Jg6w-x.js";
2
2
  import { Locale } from "date-fns";
3
3
  import { ComponentType, ReactElement, ReactNode } from "react";
4
4
  import { StyleProp, ViewStyle } from "react-native";
5
5
  import { SharedValue, useSharedValue } from "react-native-reanimated";
6
- import { BusinessHoursBand as BusinessHoursBand$1, BusinessHoursValue, CalendarEvent as CalendarEvent$1, DateRange, DateSelectionConstraints, DaySelectionState, EventAccessibilityLabeler as EventAccessibilityLabeler$1, ICalEvent, MonthEventSegment, MonthGrid, MonthGridDay, MonthGridWeek, MonthGridWeekday, MonthWeekEvents, PositionedEvent, ToICalendarOptions, UseDateRangeOptions, UseMonthGridOptions, WeekdayFormat as WeekdayFormat$1, backgroundBandsForDay, buildMonthGrid, buildMonthWeeks, daySelectionState, eventsInTimeZone, expandRecurringEvents, getIsToday, getViewDays, getWeekDays, isAllDayEvent, isBackgroundEvent, isDateSelectable, isRangeEndpoint, isSameCalendarDay, isWeekend, isWithinDateRange, layoutDayEvents, layoutMonthWeek, minutesIntoDay, nextDateRange, parseICalendar, toICalendar, toZonedTime, useDateRange, useEventSource, useMonthGrid, useNow, weekdayFormatToken } from "@super-calendar/core";
6
+ import { BusinessHoursBand as BusinessHoursBand$1, BusinessHoursValue, CalendarEvent as CalendarEvent$1, DateRange, DateRange as DateRange$1, DateSelectionConstraints, DaySelectionState, EventAccessibilityLabeler as EventAccessibilityLabeler$1, ICalEvent, MonthEventSegment, MonthGrid, MonthGridDay, MonthGridWeek, MonthGridWeekday, MonthWeekEvents, PositionedEvent, ToICalendarOptions, UseDateRangeOptions, UseMonthGridOptions, WeekdayFormat as WeekdayFormat$1, backgroundBandsForDay, buildMonthGrid, buildMonthWeeks, daySelectionState, eventsInTimeZone, expandRecurringEvents, getIsToday, getViewDays, getWeekDays, isAllDayEvent, isBackgroundEvent, isDateSelectable, isRangeEndpoint, isSameCalendarDay, isWeekend, isWithinDateRange, layoutDayEvents, layoutMonthWeek, minutesIntoDay, nextDateRange, parseICalendar, toICalendar, toZonedTime, useDateRange, useEventSource, useMonthGrid, useNow, weekdayFormatToken } from "@super-calendar/core";
7
7
  //#region src/components/YearView.d.ts
8
8
  /**
9
9
  * The styleable parts of {@link YearView}. `dayText` and `eventDot` are the
10
- * text/marker inside a day cell (React Native text colour doesn't inherit).
10
+ * text/marker inside a day cell (React Native text colour doesn't inherit);
11
+ * `dayBadge` is the round highlight behind the number and `rangeBand` the
12
+ * selection strip behind it.
11
13
  */
12
- type YearViewSlot = "grid" | "month" | "monthTitle" | "weekdays" | "weekday" | "week" | "day" | "dayText" | "eventDot";
14
+ type YearViewSlot = "grid" | "month" | "monthTitle" | "weekdays" | "weekday" | "week" | "day" | "dayBadge" | "dayText" | "rangeBand" | "eventDot";
13
15
  /** Props for {@link YearView}, the twelve mini-month year grid. */
14
16
  type YearViewProps<T = unknown> = SlotStyleProps<YearViewSlot> & {
15
17
  /** Any date inside the year to render. */
@@ -22,6 +24,16 @@ type YearViewProps<T = unknown> = SlotStyleProps<YearViewSlot> & {
22
24
  locale?: Locale;
23
25
  /** Highlight this date instead of the real "today". */
24
26
  activeDate?: Date;
27
+ /** A selected span: endpoints get a filled badge, the days between get the range band. */
28
+ selectedRange?: DateRange$1;
29
+ /** Discrete selected days, drawn with a filled badge. */
30
+ selectedDates?: Date[];
31
+ /** Earliest selectable day (inclusive); earlier days render disabled. */
32
+ minDate?: Date;
33
+ /** Latest selectable day (inclusive); later days render disabled. */
34
+ maxDate?: Date;
35
+ /** Return true to render a specific day disabled (dimmed, taps ignored). */
36
+ isDateDisabled?: (date: Date) => boolean;
25
37
  /**
26
38
  * Smallest width a mini month may take before the grid drops a column
27
39
  * (default 150). The grid fits 2–4 columns from the measured width.
@@ -31,13 +43,29 @@ type YearViewProps<T = unknown> = SlotStyleProps<YearViewSlot> & {
31
43
  onPressDay?: (date: Date) => void;
32
44
  /** Tap a month's title (e.g. to jump to that month's view). */
33
45
  onPressMonth?: (month: Date) => void;
46
+ /**
47
+ * Enables drag-to-select and reports the swept span live, as the ordered
48
+ * inclusive `[start, end]` days (both at midnight). Pair it with
49
+ * `useDateRange`'s `selectRange` to drive `selectedRange`. Fires on every day the
50
+ * drag crosses, so the highlight follows it; `onCreateEvent` (when also set)
51
+ * fires once on release. Either handler enables the same sweep: hold a day and
52
+ * drag on a device, press and drag on the web. On a device a sweep stays inside
53
+ * the mini month it started in; on the web it can run across months.
54
+ */
55
+ onSelectDrag?: (start: Date, end: Date) => void;
56
+ /**
57
+ * Enables drag-to-create: sweep across days and release to fire this with the
58
+ * all-day range (`start` at midnight of the first day, `end` at midnight after
59
+ * the last, exclusive). A plain tap still fires `onPressDay`, not this.
60
+ */
61
+ onCreateEvent?: (start: Date, end: Date) => void;
34
62
  };
35
- declare function YearViewInner<T>({ date, events, weekStartsOn, hiddenDays, locale, activeDate, minMonthWidth, onPressDay, onPressMonth, classNames, styles: styleOverrides }: YearViewProps<T>): ReactElement;
63
+ declare function YearViewInner<T>({ date, events, weekStartsOn, hiddenDays, locale, activeDate, selectedRange, selectedDates, minDate, maxDate, isDateDisabled, minMonthWidth, onPressDay, onPressMonth, onSelectDrag, onCreateEvent, classNames, styles: styleOverrides }: YearViewProps<T>): ReactElement;
36
64
  /**
37
65
  * A year at a glance: the twelve months as compact mini grids, with today
38
66
  * highlighted and a dot under days that hold events. Tap a day or a month
39
- * title to drill into a denser view. It's the view `Calendar` renders for
40
- * `mode="year"`.
67
+ * title to drill into a denser view, or hold and drag to sweep out a date
68
+ * range. It's the view `Calendar` renders for `mode="year"`.
41
69
  *
42
70
  * @example
43
71
  * ```tsx
@@ -83,19 +111,6 @@ declare function Agenda<T>({ events, locale, renderEvent, keyExtractor, onPressE
83
111
  //#region src/components/TimeGrid.d.ts
84
112
  /** Default height in pixels of one hour row on the time grid. */
85
113
  declare const DEFAULT_HOUR_HEIGHT = 48;
86
- /**
87
- * Called when an event is dragged (moved or resized) to new start/end times.
88
- * Return `false` to reject the drop — the event snaps back to where it started
89
- * (e.g. to forbid overlaps or out-of-bounds slots). Any other return accepts it.
90
- */
91
- type EventDragHandler<T> = (event: CalendarEvent<T>, start: Date, end: Date) => void | boolean;
92
- /**
93
- * Called when a move or resize gesture begins, before any change is committed:
94
- * on grab for a move (after the long-press), and when the resize drag starts.
95
- * Handy for haptic feedback (e.g. `expo-haptics`). Requires drag to be enabled
96
- * via `onDragEvent`.
97
- */
98
- type EventDragStartHandler<T> = (event: CalendarEvent<T>) => void;
99
114
  /** Replace the hour-axis label. Receives the hour (0–23) and the `ampm` flag. */
100
115
  type HourRenderer = (hour: number, ampm: boolean) => React.ReactNode;
101
116
  /**
@@ -267,19 +282,20 @@ type CalendarProps<T> = SlotStyleProps<CalendarSlot> & {
267
282
  /** Long-press an event (month/week/day). */
268
283
  onLongPressEvent?: (event: CalendarEvent<T>) => void;
269
284
  /**
270
- * Enable drag-to-move and drag-to-resize on the week/day grid. Called with the
271
- * dragged event and its new start/end (snapped to `dragStepMinutes`); update
272
- * your own event state in response. Long-press an event to move it (drag
273
- * horizontally to change the day too); drag its bottom grip to resize. Return
274
- * `false` to reject the drop (e.g. an overlap) and snap the event back.
285
+ * Enable drag-to-move and drag-to-resize. Called with the dragged event and its
286
+ * new start/end; update your own event state in response. On the week/day grid,
287
+ * long-press an event to move it (drag horizontally to change the day too) or
288
+ * drag its bottom grip to resize, snapped to `dragStepMinutes`. In `month` mode,
289
+ * long-press an event bar and drop it on another day: both ends shift by the
290
+ * days dragged, so the time of day and duration are kept. Return `false` to
291
+ * reject the drop (e.g. an overlap) and snap the event back.
275
292
  */
276
293
  onDragEvent?: EventDragHandler<T>;
277
294
  /**
278
- * Fired when a move or resize gesture begins on the week/day grid, before any
279
- * change is committed: on grab for a move (after the long-press), and when a
280
- * resize drag starts. Use it to trigger haptic feedback, e.g.
281
- * `Haptics.impactAsync()` from `expo-haptics`. Native-only and inert unless
282
- * `onDragEvent` is also set.
295
+ * Fired when a drag gesture begins, before any change is committed: on grab for
296
+ * a move (after the long-press), and when a week/day resize drag starts. Use it
297
+ * to trigger haptic feedback, e.g. `Haptics.impactAsync()` from `expo-haptics`.
298
+ * Native-only and inert unless `onDragEvent` is also set.
283
299
  */
284
300
  onDragStart?: EventDragStartHandler<T>;
285
301
  /** Minutes a drag-to-move/resize snaps to. Default 15. */
@@ -297,20 +313,47 @@ type CalendarProps<T> = SlotStyleProps<CalendarSlot> & {
297
313
  onLongPressDay?: (date: Date) => void;
298
314
  /** Tap the "+N more" overflow label in a month cell. */
299
315
  onPressMore?: (events: CalendarEvent<T>[], date: Date) => void;
300
- /** Tap empty space on the week/day grid; receives the date+time pressed. */
316
+ /**
317
+ * Tap empty space; receives the date+time pressed on the week/day grid, or the
318
+ * tapped day at midnight in `month` mode (where it fires alongside `onPressDay`).
319
+ */
301
320
  onPressCell?: (date: Date) => void;
302
321
  /** After an empty-cell press, snap the pager back to the active page. Default false. */
303
322
  resetPageOnPressCell?: boolean;
304
323
  /** Long-press empty space on the week/day grid; receives the date+time. */
305
324
  onLongPressCell?: (date: Date) => void;
306
325
  /**
307
- * Enable drag-to-create on the week/day grid: long-press empty space and drag
308
- * to sweep out a new event's time range. Called on release with the snapped
309
- * `start`/`end` (to `dragStepMinutes`); create your own event in response. A
310
- * stationary press yields a one-step range. Native-only; supersedes
311
- * `onLongPressCell` on empty space when set.
326
+ * Enable drag-to-create: long-press empty space and drag to sweep out a new
327
+ * event, then release. On the week/day grid that is a time range snapped to
328
+ * `dragStepMinutes` (a stationary press yields a one-step range); in `month`
329
+ * mode it is an **all-day** span across the days swept — `start` at midnight of
330
+ * the first day, `end` at midnight after the last. Create your own event in
331
+ * response. Supersedes `onLongPressCell` (and, in month mode, `onLongPressDay`)
332
+ * on empty space when set.
312
333
  */
313
334
  onCreateEvent?: (start: Date, end: Date) => void;
335
+ /**
336
+ * Month and year modes: reports a create sweep's day span as it happens, as the
337
+ * ordered inclusive `[start, end]` days, so a selection highlight can follow the
338
+ * drag. Pair it with `useDateRange`'s `selectRange` to drive `selectedRange`.
339
+ * Enables the sweep on its own, so it works without `onCreateEvent`.
340
+ */
341
+ onSelectDrag?: (start: Date, end: Date) => void;
342
+ /** Days drawn as selected (a filled badge) in month and year modes. */
343
+ selectedDates?: Date[];
344
+ /** A selected span: endpoints get a filled badge, the span gets the range band. */
345
+ selectedRange?: DateRange$1;
346
+ /**
347
+ * Fill the whole month cell with the range band instead of the default centered
348
+ * rounded "pill" strip. Default false.
349
+ */
350
+ fillCellOnSelection?: boolean;
351
+ /** Earliest selectable day (inclusive); earlier days render disabled. */
352
+ minDate?: Date;
353
+ /** Latest selectable day (inclusive); later days render disabled. */
354
+ maxDate?: Date;
355
+ /** Return true to render a specific day disabled (dimmed, taps ignored). */
356
+ isDateDisabled?: (date: Date) => boolean;
314
357
  /** Tap a day's column header on the week/day grid (default header only). */
315
358
  onPressDateHeader?: (date: Date) => void;
316
359
  /**
@@ -409,6 +452,11 @@ type CalendarProps<T> = SlotStyleProps<CalendarSlot> & {
409
452
  hourComponent?: HourRenderer;
410
453
  /** Always render six week rows in month view, for a fixed-height grid. Default false. */
411
454
  showSixWeeks?: boolean;
455
+ /**
456
+ * Render the built-in "MMMM yyyy" title above the month grid. Default true. Set
457
+ * false when your own header already shows the month and year. Month mode only.
458
+ */
459
+ showTitle?: boolean;
412
460
  /** Allow swiping between pages (all modes). Default true. */
413
461
  swipeEnabled?: boolean;
414
462
  /** Show the vertical scroll indicator on the week/day grid. Default true. */
@@ -494,7 +542,7 @@ type CalendarProps<T> = SlotStyleProps<CalendarSlot> & {
494
542
  * }
495
543
  * ```
496
544
  */
497
- declare function Calendar<T>({ events, mode, date, onChangeDate, onChangeDateRange, onPressEvent, onLongPressEvent, onDragEvent, onDragStart, dragStepMinutes, showDragHandle, onPressDay, onPressMonth, onLongPressDay, onPressMore, onPressCell, resetPageOnPressCell, onLongPressCell, onCreateEvent, onPressDateHeader, maxVisibleEventCount, sortedMonthView, moreLabel, showAdjacentMonths, disableMonthEventCellPress, weekStartsOn, hiddenDays, now, weekdayFormat, numberOfDays, weekEndsOn, renderEvent, eventAccessibilityLabel, eventCellStyle, calendarCellStyle, businessHours, renderBusinessHours, keyExtractor, theme, cellHeight: cellHeightProp, hourHeight, minHourHeight, maxHourHeight, hourColumnWidth, hideHours, timeslots, showAllDayEventCell, highlightWeekends, eventStartEditable, eventDurationEditable, eventOverlap, showWeekNumber, weekNumberPrefix, hourComponent, showSixWeeks, swipeEnabled, showVerticalScrollIndicator, verticalScrollEnabled, headerComponent, minHour, maxHour, ampm, showTime, ellipsizeTitle, allDayLabel, scrollOffsetMinutes, showNowIndicator, locale, timeZone, activeDate, isRTL, freeSwipe, renderTimeGridHeader, renderHeaderForMonthView, renderCustomDateForMonth, itemSeparatorComponent, classNames, styles: styleOverrides }: CalendarProps<T>): ReactElement;
545
+ declare function Calendar<T>({ events, mode, date, onChangeDate, onChangeDateRange, onPressEvent, onLongPressEvent, onDragEvent, onDragStart, dragStepMinutes, showDragHandle, onPressDay, onPressMonth, onLongPressDay, onPressMore, onPressCell, resetPageOnPressCell, onLongPressCell, onCreateEvent, onSelectDrag, selectedDates, selectedRange, fillCellOnSelection, minDate, maxDate, isDateDisabled, onPressDateHeader, maxVisibleEventCount, sortedMonthView, moreLabel, showAdjacentMonths, disableMonthEventCellPress, weekStartsOn, hiddenDays, now, weekdayFormat, numberOfDays, weekEndsOn, renderEvent, eventAccessibilityLabel, eventCellStyle, calendarCellStyle, businessHours, renderBusinessHours, keyExtractor, theme, cellHeight: cellHeightProp, hourHeight, minHourHeight, maxHourHeight, hourColumnWidth, hideHours, timeslots, showAllDayEventCell, highlightWeekends, eventStartEditable, eventDurationEditable, eventOverlap, showWeekNumber, weekNumberPrefix, hourComponent, showSixWeeks, showTitle, swipeEnabled, showVerticalScrollIndicator, verticalScrollEnabled, headerComponent, minHour, maxHour, ampm, showTime, ellipsizeTitle, allDayLabel, scrollOffsetMinutes, showNowIndicator, locale, timeZone, activeDate, isRTL, freeSwipe, renderTimeGridHeader, renderHeaderForMonthView, renderCustomDateForMonth, itemSeparatorComponent, classNames, styles: styleOverrides }: CalendarProps<T>): ReactElement;
498
546
  //#endregion
499
547
  //#region src/components/DefaultEvent.d.ts
500
548
  /**