@super-calendar/core 2.17.0 → 2.18.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/README.md CHANGED
@@ -75,6 +75,14 @@ Use `resolveDraggedBounds` to commit a move or resize. Equal start and end delta
75
75
  move the event while preserving elapsed duration, including across daylight
76
76
  saving changes. For a resize, pass zero for the edge you want to keep fixed.
77
77
 
78
+ `eventDayKeys` and `groupEventsByDay` index every occupied local calendar day by
79
+ its start-of-day ISO value. Midnight clock changes do not shift later day keys.
80
+ An event ending at the start of a day excludes that day.
81
+
82
+ `monthCreateRange(anchor, hover)` returns the ordered all-day creation range.
83
+ Its exclusive end is the start of the day after the last selected date,
84
+ including when a clock change skips midnight.
85
+
78
86
  `CalendarEvent<T>` includes an optional `dragHandleColor: string` for the native
79
87
  renderer's time-grid and resource-timeline resize grips. When omitted, those
80
88
  grips use `theme.colors.eventText`. Core preserves the field without interpreting it.
package/dist/index.d.mts CHANGED
@@ -1,4 +1,4 @@
1
- import { $ as titleEllipsizeMode, $t as ICalendarEvent, A as isAllDayEvent, At as DaySelectionState, B as toICalendar, Bt as dayBadgeKind, C as backgroundBandsForDay, Ct as isWeekend, D as drawnEnd, Dt as CalendarSelection, E as compareDayEvents, Et as weekDaysCount, F as EventSourceOptions, Ft as isWithinDateRange, G as MonthEventCapacity, Gt as BusinessHours, H as EventAccessibilityLabeler, Ht as CalendarColors, I as loadEventSource, It as nextDateRange, J as eventTimeLabel, Jt as CalendarEvent, K as eventAccessibilityLabel, Kt as BusinessHoursBand, L as ICalEvent, Lt as DayBadgeKind, M as layoutDayEvents, Mt as daySelectionState, N as wallClockHours, Nt as isDateSelectable, O as eventDayKeys, Ot as DateRange, P as EventSource, Pt as isRangeEndpoint, Q as monthVisibleCount, Qt as EventKeyExtractor, R as ToICalendarOptions, Rt as RangeBandKind, S as PositionedEvent, St as isSameCalendarDay, T as closedHourBands, Tt as viewDayCount, U as EventChipLayout, Ut as darkColors, V as EventAccessibilityLabelContext, Vt as rangeBandKind, W as MIN_BOX_HEIGHT_FOR_TIME, Wt as lightColors, X as isTimeVisibleAtHeight, Xt as CalendarMode, Y as formatHour, Yt as CalendarHandle, Z as monthEventCapacity, Zt as CreateGhostArgs, _ as UseMonthGridOptions, _t as filterHiddenDays, a as MultiWeekGrid, at as cellRangeFromDrag, b as layoutMonthWeek, bt as getWeekDays, c as MultiWeekGridOptions, ct as monthCreateRange, d as MonthEventSegment, dt as overlapsOtherEvents, en as RecurrenceFrequency, et as titleNumberOfLines, f as MonthGrid, ft as pageStepDays, g as MonthWeekEvents, gt as buildMonthWeeks, h as MonthGridWeekday, ht as snapDeltaMinutes, i as expandRecurringEvents, in as WeekStartsOn, it as resolveCalendarLabels, j as isBackgroundEvent, jt as UseDateRangeOptions, k as groupEventsByDay, kt as DateSelectionConstraints, l as MultiWeekGridWeek, lt as monthDropBounds, m as MonthGridWeek, mt as shiftMinutes, n as toZonedTime, nn as ScrollToTimeOptions, nt as dayAccessibilityLabel, o as MultiWeekGridDay, ot as clampMoveStartMinutes, p as MonthGridDay, pt as resolveDraggedBounds, q as eventChipLayout, qt as BusinessHoursValue, r as zonedTimeToUtc, rn as TimeGridMode, rt as defaultCalendarLabels, s as MultiWeekGridInterval, st as eventsOverlap, t as eventsInTimeZone, tn as RecurrenceRule, tt as CalendarLabels, u as buildMultiWeekGrid, ut as movedClockSpan, v as WeekdayFormat, vt as getIsToday, w as clockHoursBetween, wt as minutesIntoDay, x as weekdayFormatToken, xt as getYearMonths, y as buildMonthGrid, yt as getViewDays, z as parseICalendar, zt as bandRounding } from "./timezone-vbd68uRS.mjs";
1
+ import { $ as eventAccessibilityLabel, $t as BusinessHoursBand, A as backgroundBandsForDay, At as isWeekend, B as wallClockHours, Bt as isDateSelectable, C as MonthWeekEvents, Ct as buildMonthWeeks, D as layoutMonthWeek, Dt as getWeekDays, E as buildMonthGrid, Et as getViewDays, F as eventDayKeys, Ft as DateRange, G as ToICalendarOptions, Gt as RangeBandKind, H as EventSourceOptions, Ht as isWithinDateRange, I as groupEventsByDay, It as DateSelectionConstraints, J as EventAccessibilityLabelContext, Jt as rangeBandKind, K as parseICalendar, Kt as bandRounding, L as isAllDayEvent, Lt as DaySelectionState, M as closedHourBands, Mt as viewDayCount, N as compareDayEvents, Nt as weekDaysCount, O as weekdayFormatToken, Ot as getYearMonths, P as drawnEnd, Pt as CalendarSelection, Q as MonthEventCapacity, Qt as BusinessHours, R as isBackgroundEvent, Rt as UseDateRangeOptions, S as MonthGridWeekday, St as snapDeltaMinutes, T as WeekdayFormat, Tt as getIsToday, U as loadEventSource, Ut as nextDateRange, V as EventSource, Vt as isRangeEndpoint, W as ICalEvent, Wt as DayBadgeKind, X as EventChipLayout, Xt as darkColors, Y as EventAccessibilityLabeler, Yt as CalendarColors, Z as MIN_BOX_HEIGHT_FOR_TIME, Zt as lightColors, _ as buildMultiWeekGrid, _t as movedClockSpan, a as nowInTimeZone, an as EventKeyExtractor, at as monthVisibleCount, b as MonthGridDay, bt as resolveDraggedBounds, c as zonedEventSource, cn as RecurrenceRule, ct as CalendarLabels, d as expandRecurringEvents, dn as WeekStartsOn, dt as resolveCalendarLabels, en as BusinessHoursValue, et as eventChipLayout, f as MultiWeekGrid, ft as cellRangeFromDrag, g as MultiWeekGridWeek, gt as monthDropBounds, h as MultiWeekGridOptions, ht as monthCreateRange, i as fromZonedTime, in as CreateGhostArgs, it as monthEventCapacity, j as clockHoursBetween, jt as minutesIntoDay, k as PositionedEvent, kt as isSameCalendarDay, l as zonedTimeToUtc, ln as ScrollToTimeOptions, lt as dayAccessibilityLabel, m as MultiWeekGridInterval, mt as eventsOverlap, n as eventsInTimeZone, nn as CalendarHandle, nt as formatHour, o as toZonedTime, on as ICalendarEvent, ot as titleEllipsizeMode, p as MultiWeekGridDay, pt as clampMoveStartMinutes, q as toICalendar, qt as dayBadgeKind, r as fromZonedRange, rn as CalendarMode, rt as isTimeVisibleAtHeight, s as zonedDragBounds, sn as RecurrenceFrequency, st as titleNumberOfLines, t as ZonedDragBoundsOptions, tn as CalendarEvent, tt as eventTimeLabel, u as ExpandRecurringEventsOptions, un as TimeGridMode, ut as defaultCalendarLabels, v as MonthEventSegment, vt as overlapsOtherEvents, w as UseMonthGridOptions, wt as filterHiddenDays, x as MonthGridWeek, xt as shiftMinutes, y as MonthGrid, yt as pageStepDays, z as layoutDayEvents, zt as daySelectionState } from "./timezone-BY2vQwRx.mjs";
2
2
  import { Dispatch, SetStateAction } from "react";
3
3
  /** Options for {@link useNow}. */
4
4
  export interface UseNowOptions {
@@ -91,4 +91,4 @@ export declare function useDateRange(options?: UseDateRangeOptions): UseDateRang
91
91
  * ```
92
92
  */
93
93
  export declare function useMonthGrid(month: Date, options?: UseMonthGridOptions): MonthGrid;
94
- export { BusinessHours, BusinessHoursBand, BusinessHoursValue, CalendarColors, CalendarEvent, CalendarHandle, CalendarLabels, CalendarMode, CalendarSelection, CreateGhostArgs, DateRange, DateSelectionConstraints, DayBadgeKind, DaySelectionState, EventAccessibilityLabelContext, EventAccessibilityLabeler, EventChipLayout, EventKeyExtractor, EventSource, EventSourceOptions, ICalEvent, ICalendarEvent, MIN_BOX_HEIGHT_FOR_TIME, MonthEventCapacity, MonthEventSegment, MonthGrid, MonthGridDay, MonthGridWeek, MonthGridWeekday, MonthWeekEvents, MultiWeekGrid, MultiWeekGridDay, MultiWeekGridInterval, MultiWeekGridOptions, MultiWeekGridWeek, PositionedEvent, RangeBandKind, RecurrenceFrequency, RecurrenceRule, ScrollToTimeOptions, TimeGridMode, ToICalendarOptions, UseDateRangeOptions, UseMonthGridOptions, WeekStartsOn, WeekdayFormat, backgroundBandsForDay, bandRounding, buildMonthGrid, buildMonthWeeks, buildMultiWeekGrid, cellRangeFromDrag, clampMoveStartMinutes, clockHoursBetween, closedHourBands, compareDayEvents, darkColors, dayAccessibilityLabel, dayBadgeKind, daySelectionState, defaultCalendarLabels, drawnEnd, eventAccessibilityLabel, eventChipLayout, eventDayKeys, eventTimeLabel, eventsInTimeZone, eventsOverlap, expandRecurringEvents, filterHiddenDays, formatHour, getIsToday, getViewDays, getWeekDays, getYearMonths, groupEventsByDay, isAllDayEvent, isBackgroundEvent, isDateSelectable, isRangeEndpoint, isSameCalendarDay, isTimeVisibleAtHeight, isWeekend, isWithinDateRange, layoutDayEvents, layoutMonthWeek, lightColors, loadEventSource, minutesIntoDay, monthCreateRange, monthDropBounds, monthEventCapacity, monthVisibleCount, movedClockSpan, nextDateRange, overlapsOtherEvents, pageStepDays, parseICalendar, rangeBandKind, resolveCalendarLabels, resolveDraggedBounds, shiftMinutes, snapDeltaMinutes, titleEllipsizeMode, titleNumberOfLines, toICalendar, toZonedTime, viewDayCount, wallClockHours, weekDaysCount, weekdayFormatToken, zonedTimeToUtc };
94
+ export { BusinessHours, BusinessHoursBand, BusinessHoursValue, CalendarColors, CalendarEvent, CalendarHandle, CalendarLabels, CalendarMode, CalendarSelection, CreateGhostArgs, DateRange, DateSelectionConstraints, DayBadgeKind, DaySelectionState, EventAccessibilityLabelContext, EventAccessibilityLabeler, EventChipLayout, EventKeyExtractor, EventSource, EventSourceOptions, ExpandRecurringEventsOptions, ICalEvent, ICalendarEvent, MIN_BOX_HEIGHT_FOR_TIME, MonthEventCapacity, MonthEventSegment, MonthGrid, MonthGridDay, MonthGridWeek, MonthGridWeekday, MonthWeekEvents, MultiWeekGrid, MultiWeekGridDay, MultiWeekGridInterval, MultiWeekGridOptions, MultiWeekGridWeek, PositionedEvent, RangeBandKind, RecurrenceFrequency, RecurrenceRule, ScrollToTimeOptions, TimeGridMode, ToICalendarOptions, UseDateRangeOptions, UseMonthGridOptions, WeekStartsOn, WeekdayFormat, ZonedDragBoundsOptions, backgroundBandsForDay, bandRounding, buildMonthGrid, buildMonthWeeks, buildMultiWeekGrid, cellRangeFromDrag, clampMoveStartMinutes, clockHoursBetween, closedHourBands, compareDayEvents, darkColors, dayAccessibilityLabel, dayBadgeKind, daySelectionState, defaultCalendarLabels, drawnEnd, eventAccessibilityLabel, eventChipLayout, eventDayKeys, eventTimeLabel, eventsInTimeZone, eventsOverlap, expandRecurringEvents, filterHiddenDays, formatHour, fromZonedRange, fromZonedTime, getIsToday, getViewDays, getWeekDays, getYearMonths, groupEventsByDay, isAllDayEvent, isBackgroundEvent, isDateSelectable, isRangeEndpoint, isSameCalendarDay, isTimeVisibleAtHeight, isWeekend, isWithinDateRange, layoutDayEvents, layoutMonthWeek, lightColors, loadEventSource, minutesIntoDay, monthCreateRange, monthDropBounds, monthEventCapacity, monthVisibleCount, movedClockSpan, nextDateRange, nowInTimeZone, overlapsOtherEvents, pageStepDays, parseICalendar, rangeBandKind, resolveCalendarLabels, resolveDraggedBounds, shiftMinutes, snapDeltaMinutes, titleEllipsizeMode, titleNumberOfLines, toICalendar, toZonedTime, viewDayCount, wallClockHours, weekDaysCount, weekdayFormatToken, zonedDragBounds, zonedEventSource, zonedTimeToUtc };
package/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { $ as titleEllipsizeMode, $t as ICalendarEvent, A as isAllDayEvent, At as DaySelectionState, B as toICalendar, Bt as dayBadgeKind, C as backgroundBandsForDay, Ct as isWeekend, D as drawnEnd, Dt as CalendarSelection, E as compareDayEvents, Et as weekDaysCount, F as EventSourceOptions, Ft as isWithinDateRange, G as MonthEventCapacity, Gt as BusinessHours, H as EventAccessibilityLabeler, Ht as CalendarColors, I as loadEventSource, It as nextDateRange, J as eventTimeLabel, Jt as CalendarEvent, K as eventAccessibilityLabel, Kt as BusinessHoursBand, L as ICalEvent, Lt as DayBadgeKind, M as layoutDayEvents, Mt as daySelectionState, N as wallClockHours, Nt as isDateSelectable, O as eventDayKeys, Ot as DateRange, P as EventSource, Pt as isRangeEndpoint, Q as monthVisibleCount, Qt as EventKeyExtractor, R as ToICalendarOptions, Rt as RangeBandKind, S as PositionedEvent, St as isSameCalendarDay, T as closedHourBands, Tt as viewDayCount, U as EventChipLayout, Ut as darkColors, V as EventAccessibilityLabelContext, Vt as rangeBandKind, W as MIN_BOX_HEIGHT_FOR_TIME, Wt as lightColors, X as isTimeVisibleAtHeight, Xt as CalendarMode, Y as formatHour, Yt as CalendarHandle, Z as monthEventCapacity, Zt as CreateGhostArgs, _ as UseMonthGridOptions, _t as filterHiddenDays, a as MultiWeekGrid, at as cellRangeFromDrag, b as layoutMonthWeek, bt as getWeekDays, c as MultiWeekGridOptions, ct as monthCreateRange, d as MonthEventSegment, dt as overlapsOtherEvents, en as RecurrenceFrequency, et as titleNumberOfLines, f as MonthGrid, ft as pageStepDays, g as MonthWeekEvents, gt as buildMonthWeeks, h as MonthGridWeekday, ht as snapDeltaMinutes, i as expandRecurringEvents, in as WeekStartsOn, it as resolveCalendarLabels, j as isBackgroundEvent, jt as UseDateRangeOptions, k as groupEventsByDay, kt as DateSelectionConstraints, l as MultiWeekGridWeek, lt as monthDropBounds, m as MonthGridWeek, mt as shiftMinutes, n as toZonedTime, nn as ScrollToTimeOptions, nt as dayAccessibilityLabel, o as MultiWeekGridDay, ot as clampMoveStartMinutes, p as MonthGridDay, pt as resolveDraggedBounds, q as eventChipLayout, qt as BusinessHoursValue, r as zonedTimeToUtc, rn as TimeGridMode, rt as defaultCalendarLabels, s as MultiWeekGridInterval, st as eventsOverlap, t as eventsInTimeZone, tn as RecurrenceRule, tt as CalendarLabels, u as buildMultiWeekGrid, ut as movedClockSpan, v as WeekdayFormat, vt as getIsToday, w as clockHoursBetween, wt as minutesIntoDay, x as weekdayFormatToken, xt as getYearMonths, y as buildMonthGrid, yt as getViewDays, z as parseICalendar, zt as bandRounding } from "./timezone-vbd68uRS.js";
1
+ import { $ as eventAccessibilityLabel, $t as BusinessHoursBand, A as backgroundBandsForDay, At as isWeekend, B as wallClockHours, Bt as isDateSelectable, C as MonthWeekEvents, Ct as buildMonthWeeks, D as layoutMonthWeek, Dt as getWeekDays, E as buildMonthGrid, Et as getViewDays, F as eventDayKeys, Ft as DateRange, G as ToICalendarOptions, Gt as RangeBandKind, H as EventSourceOptions, Ht as isWithinDateRange, I as groupEventsByDay, It as DateSelectionConstraints, J as EventAccessibilityLabelContext, Jt as rangeBandKind, K as parseICalendar, Kt as bandRounding, L as isAllDayEvent, Lt as DaySelectionState, M as closedHourBands, Mt as viewDayCount, N as compareDayEvents, Nt as weekDaysCount, O as weekdayFormatToken, Ot as getYearMonths, P as drawnEnd, Pt as CalendarSelection, Q as MonthEventCapacity, Qt as BusinessHours, R as isBackgroundEvent, Rt as UseDateRangeOptions, S as MonthGridWeekday, St as snapDeltaMinutes, T as WeekdayFormat, Tt as getIsToday, U as loadEventSource, Ut as nextDateRange, V as EventSource, Vt as isRangeEndpoint, W as ICalEvent, Wt as DayBadgeKind, X as EventChipLayout, Xt as darkColors, Y as EventAccessibilityLabeler, Yt as CalendarColors, Z as MIN_BOX_HEIGHT_FOR_TIME, Zt as lightColors, _ as buildMultiWeekGrid, _t as movedClockSpan, a as nowInTimeZone, an as EventKeyExtractor, at as monthVisibleCount, b as MonthGridDay, bt as resolveDraggedBounds, c as zonedEventSource, cn as RecurrenceRule, ct as CalendarLabels, d as expandRecurringEvents, dn as WeekStartsOn, dt as resolveCalendarLabels, en as BusinessHoursValue, et as eventChipLayout, f as MultiWeekGrid, ft as cellRangeFromDrag, g as MultiWeekGridWeek, gt as monthDropBounds, h as MultiWeekGridOptions, ht as monthCreateRange, i as fromZonedTime, in as CreateGhostArgs, it as monthEventCapacity, j as clockHoursBetween, jt as minutesIntoDay, k as PositionedEvent, kt as isSameCalendarDay, l as zonedTimeToUtc, ln as ScrollToTimeOptions, lt as dayAccessibilityLabel, m as MultiWeekGridInterval, mt as eventsOverlap, n as eventsInTimeZone, nn as CalendarHandle, nt as formatHour, o as toZonedTime, on as ICalendarEvent, ot as titleEllipsizeMode, p as MultiWeekGridDay, pt as clampMoveStartMinutes, q as toICalendar, qt as dayBadgeKind, r as fromZonedRange, rn as CalendarMode, rt as isTimeVisibleAtHeight, s as zonedDragBounds, sn as RecurrenceFrequency, st as titleNumberOfLines, t as ZonedDragBoundsOptions, tn as CalendarEvent, tt as eventTimeLabel, u as ExpandRecurringEventsOptions, un as TimeGridMode, ut as defaultCalendarLabels, v as MonthEventSegment, vt as overlapsOtherEvents, w as UseMonthGridOptions, wt as filterHiddenDays, x as MonthGridWeek, xt as shiftMinutes, y as MonthGrid, yt as pageStepDays, z as layoutDayEvents, zt as daySelectionState } from "./timezone-BY2vQwRx.js";
2
2
  import { Dispatch, SetStateAction } from "react";
3
3
  /** Options for {@link useNow}. */
4
4
  export interface UseNowOptions {
@@ -91,4 +91,4 @@ export declare function useDateRange(options?: UseDateRangeOptions): UseDateRang
91
91
  * ```
92
92
  */
93
93
  export declare function useMonthGrid(month: Date, options?: UseMonthGridOptions): MonthGrid;
94
- export { BusinessHours, BusinessHoursBand, BusinessHoursValue, CalendarColors, CalendarEvent, CalendarHandle, CalendarLabels, CalendarMode, CalendarSelection, CreateGhostArgs, DateRange, DateSelectionConstraints, DayBadgeKind, DaySelectionState, EventAccessibilityLabelContext, EventAccessibilityLabeler, EventChipLayout, EventKeyExtractor, EventSource, EventSourceOptions, ICalEvent, ICalendarEvent, MIN_BOX_HEIGHT_FOR_TIME, MonthEventCapacity, MonthEventSegment, MonthGrid, MonthGridDay, MonthGridWeek, MonthGridWeekday, MonthWeekEvents, MultiWeekGrid, MultiWeekGridDay, MultiWeekGridInterval, MultiWeekGridOptions, MultiWeekGridWeek, PositionedEvent, RangeBandKind, RecurrenceFrequency, RecurrenceRule, ScrollToTimeOptions, TimeGridMode, ToICalendarOptions, UseDateRangeOptions, UseMonthGridOptions, WeekStartsOn, WeekdayFormat, backgroundBandsForDay, bandRounding, buildMonthGrid, buildMonthWeeks, buildMultiWeekGrid, cellRangeFromDrag, clampMoveStartMinutes, clockHoursBetween, closedHourBands, compareDayEvents, darkColors, dayAccessibilityLabel, dayBadgeKind, daySelectionState, defaultCalendarLabels, drawnEnd, eventAccessibilityLabel, eventChipLayout, eventDayKeys, eventTimeLabel, eventsInTimeZone, eventsOverlap, expandRecurringEvents, filterHiddenDays, formatHour, getIsToday, getViewDays, getWeekDays, getYearMonths, groupEventsByDay, isAllDayEvent, isBackgroundEvent, isDateSelectable, isRangeEndpoint, isSameCalendarDay, isTimeVisibleAtHeight, isWeekend, isWithinDateRange, layoutDayEvents, layoutMonthWeek, lightColors, loadEventSource, minutesIntoDay, monthCreateRange, monthDropBounds, monthEventCapacity, monthVisibleCount, movedClockSpan, nextDateRange, overlapsOtherEvents, pageStepDays, parseICalendar, rangeBandKind, resolveCalendarLabels, resolveDraggedBounds, shiftMinutes, snapDeltaMinutes, titleEllipsizeMode, titleNumberOfLines, toICalendar, toZonedTime, viewDayCount, wallClockHours, weekDaysCount, weekdayFormatToken, zonedTimeToUtc };
94
+ export { BusinessHours, BusinessHoursBand, BusinessHoursValue, CalendarColors, CalendarEvent, CalendarHandle, CalendarLabels, CalendarMode, CalendarSelection, CreateGhostArgs, DateRange, DateSelectionConstraints, DayBadgeKind, DaySelectionState, EventAccessibilityLabelContext, EventAccessibilityLabeler, EventChipLayout, EventKeyExtractor, EventSource, EventSourceOptions, ExpandRecurringEventsOptions, ICalEvent, ICalendarEvent, MIN_BOX_HEIGHT_FOR_TIME, MonthEventCapacity, MonthEventSegment, MonthGrid, MonthGridDay, MonthGridWeek, MonthGridWeekday, MonthWeekEvents, MultiWeekGrid, MultiWeekGridDay, MultiWeekGridInterval, MultiWeekGridOptions, MultiWeekGridWeek, PositionedEvent, RangeBandKind, RecurrenceFrequency, RecurrenceRule, ScrollToTimeOptions, TimeGridMode, ToICalendarOptions, UseDateRangeOptions, UseMonthGridOptions, WeekStartsOn, WeekdayFormat, ZonedDragBoundsOptions, backgroundBandsForDay, bandRounding, buildMonthGrid, buildMonthWeeks, buildMultiWeekGrid, cellRangeFromDrag, clampMoveStartMinutes, clockHoursBetween, closedHourBands, compareDayEvents, darkColors, dayAccessibilityLabel, dayBadgeKind, daySelectionState, defaultCalendarLabels, drawnEnd, eventAccessibilityLabel, eventChipLayout, eventDayKeys, eventTimeLabel, eventsInTimeZone, eventsOverlap, expandRecurringEvents, filterHiddenDays, formatHour, fromZonedRange, fromZonedTime, getIsToday, getViewDays, getWeekDays, getYearMonths, groupEventsByDay, isAllDayEvent, isBackgroundEvent, isDateSelectable, isRangeEndpoint, isSameCalendarDay, isTimeVisibleAtHeight, isWeekend, isWithinDateRange, layoutDayEvents, layoutMonthWeek, lightColors, loadEventSource, minutesIntoDay, monthCreateRange, monthDropBounds, monthEventCapacity, monthVisibleCount, movedClockSpan, nextDateRange, nowInTimeZone, overlapsOtherEvents, pageStepDays, parseICalendar, rangeBandKind, resolveCalendarLabels, resolveDraggedBounds, shiftMinutes, snapDeltaMinutes, titleEllipsizeMode, titleNumberOfLines, toICalendar, toZonedTime, viewDayCount, wallClockHours, weekDaysCount, weekdayFormatToken, zonedDragBounds, zonedEventSource, zonedTimeToUtc };
package/dist/index.js CHANGED
@@ -1,26 +1,22 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- const require_recurrence = require("./recurrence-D_oJ7A9D.js");
2
+ const require_recurrence = require("./recurrence-M-rJQgqd.js");
3
3
  let date_fns = require("date-fns");
4
4
  let react = require("react");
5
5
  // src/utils/useNow.ts
6
6
  const MINUTE_MS = 6e4;
7
- const resolveNow = (now, timeZone) => {
8
- const instant = now ?? /* @__PURE__ */ new Date();
9
- return timeZone ? require_recurrence.toZonedTime(instant, timeZone) : instant;
10
- };
11
7
  /**
12
8
  * The current wall-clock time, re-read every `tickMs` while `enabled`, shifted
13
9
  * into `timeZone` when given, or pinned to a fixed `now` override. Drives the
14
10
  * now indicator on both renderers so it can't disagree with zone-shifted events.
15
11
  */
16
12
  function useNow(enabled, { now, timeZone, tickMs = MINUTE_MS } = {}) {
17
- const [value, setValue] = (0, react.useState)(() => resolveNow(now, timeZone));
13
+ const [value, setValue] = (0, react.useState)(() => require_recurrence.nowInTimeZone(now, timeZone));
18
14
  const nowMs = now?.getTime();
19
15
  (0, react.useEffect)(() => {
20
16
  if (!enabled) return;
21
- setValue(resolveNow(nowMs != null ? new Date(nowMs) : void 0, timeZone));
17
+ setValue(require_recurrence.nowInTimeZone(nowMs != null ? new Date(nowMs) : void 0, timeZone));
22
18
  if (nowMs != null) return;
23
- const id = setInterval(() => setValue(resolveNow(void 0, timeZone)), tickMs);
19
+ const id = setInterval(() => setValue(require_recurrence.nowInTimeZone(void 0, timeZone)), tickMs);
24
20
  return () => clearInterval(id);
25
21
  }, [
26
22
  enabled,
@@ -173,7 +169,8 @@ function useDateRange(options = {}) {
173
169
  * ```
174
170
  */
175
171
  function useMonthGrid(month, options = {}) {
176
- const { weekStartsOn, showSixWeeks, isRTL, selectedDates, selectedRange, minDate, maxDate, isDateDisabled, locale } = options;
172
+ const { weekStartsOn, showSixWeeks, isRTL, selectedDates, selectedRange, minDate, maxDate, isDateDisabled, locale, today } = options;
173
+ const todayKey = today ? (0, date_fns.startOfDay)(today).getTime() : void 0;
177
174
  return (0, react.useMemo)(() => require_recurrence.buildMonthGrid(month, options), [
178
175
  month,
179
176
  weekStartsOn,
@@ -184,7 +181,8 @@ function useMonthGrid(month, options = {}) {
184
181
  minDate,
185
182
  maxDate,
186
183
  isDateDisabled,
187
- locale
184
+ locale,
185
+ todayKey
188
186
  ]);
189
187
  }
190
188
  exports.CalendarSelectionProvider = CalendarSelectionProvider;
@@ -214,6 +212,8 @@ exports.eventsOverlap = require_recurrence.eventsOverlap;
214
212
  exports.expandRecurringEvents = require_recurrence.expandRecurringEvents;
215
213
  exports.filterHiddenDays = require_recurrence.filterHiddenDays;
216
214
  exports.formatHour = require_recurrence.formatHour;
215
+ exports.fromZonedRange = require_recurrence.fromZonedRange;
216
+ exports.fromZonedTime = require_recurrence.fromZonedTime;
217
217
  exports.getIsToday = require_recurrence.getIsToday;
218
218
  exports.getViewDays = require_recurrence.getViewDays;
219
219
  exports.getWeekDays = require_recurrence.getWeekDays;
@@ -238,6 +238,7 @@ exports.monthEventCapacity = require_recurrence.monthEventCapacity;
238
238
  exports.monthVisibleCount = require_recurrence.monthVisibleCount;
239
239
  exports.movedClockSpan = require_recurrence.movedClockSpan;
240
240
  exports.nextDateRange = require_recurrence.nextDateRange;
241
+ exports.nowInTimeZone = require_recurrence.nowInTimeZone;
241
242
  exports.overlapsOtherEvents = require_recurrence.overlapsOtherEvents;
242
243
  exports.pageStepDays = require_recurrence.pageStepDays;
243
244
  exports.parseICalendar = require_recurrence.parseICalendar;
@@ -259,4 +260,6 @@ exports.viewDayCount = require_recurrence.viewDayCount;
259
260
  exports.wallClockHours = require_recurrence.wallClockHours;
260
261
  exports.weekDaysCount = require_recurrence.weekDaysCount;
261
262
  exports.weekdayFormatToken = require_recurrence.weekdayFormatToken;
263
+ exports.zonedDragBounds = require_recurrence.zonedDragBounds;
264
+ exports.zonedEventSource = require_recurrence.zonedEventSource;
262
265
  exports.zonedTimeToUtc = require_recurrence.zonedTimeToUtc;
package/dist/index.mjs CHANGED
@@ -1,25 +1,21 @@
1
- import { $ as filterHiddenDays, A as movedClockSpan, B as drawnEnd, C as defaultCalendarLabels, D as eventsOverlap, E as clampMoveStartMinutes, F as snapDeltaMinutes, G as layoutDayEvents, H as groupEventsByDay, I as backgroundBandsForDay, J as isDateSelectable, K as wallClockHours, L as clockHoursBetween, M as pageStepDays, N as resolveDraggedBounds, O as monthCreateRange, P as shiftMinutes, Q as buildMonthWeeks, R as closedHourBands, S as dayAccessibilityLabel, T as cellRangeFromDrag, U as isAllDayEvent, V as eventDayKeys, W as isBackgroundEvent, X as isWithinDateRange, Y as isRangeEndpoint, Z as nextDateRange, _ as isTimeVisibleAtHeight, a as weekdayFormatToken, at as isWeekend, b as titleEllipsizeMode, c as toICalendar, ct as weekDaysCount, d as zonedTimeToUtc, dt as rangeBandKind, et as getIsToday, f as MIN_BOX_HEIGHT_FOR_TIME, ft as darkColors, g as formatHour, h as eventTimeLabel, i as layoutMonthWeek, it as isSameCalendarDay, j as overlapsOtherEvents, k as monthDropBounds, l as eventsInTimeZone, lt as bandRounding, m as eventChipLayout, n as buildMultiWeekGrid, nt as getWeekDays, o as loadEventSource, ot as minutesIntoDay, p as eventAccessibilityLabel, pt as lightColors, q as daySelectionState, r as buildMonthGrid, rt as getYearMonths, s as parseICalendar, st as viewDayCount, t as expandRecurringEvents, tt as getViewDays, u as toZonedTime, ut as dayBadgeKind, v as monthEventCapacity, w as resolveCalendarLabels, x as titleNumberOfLines, y as monthVisibleCount, z as compareDayEvents } from "./recurrence-CvIJfSMl.mjs";
1
+ import { $ as isDateSelectable, A as cellRangeFromDrag, B as snapDeltaMinutes, C as monthEventCapacity, D as dayAccessibilityLabel, E as titleNumberOfLines, F as movedClockSpan, G as drawnEnd, H as clockHoursBetween, I as overlapsOtherEvents, J as isAllDayEvent, K as eventDayKeys, L as pageStepDays, M as eventsOverlap, N as monthCreateRange, O as defaultCalendarLabels, P as monthDropBounds, Q as daySelectionState, R as resolveDraggedBounds, S as isTimeVisibleAtHeight, T as titleEllipsizeMode, U as closedHourBands, V as backgroundBandsForDay, W as compareDayEvents, X as layoutDayEvents, Y as isBackgroundEvent, Z as wallClockHours, _ as MIN_BOX_HEIGHT_FOR_TIME, _t as darkColors, a as weekdayFormatToken, at as getIsToday, b as eventTimeLabel, c as toICalendar, ct as getYearMonths, d as fromZonedTime, dt as minutesIntoDay, et as isRangeEndpoint, f as nowInTimeZone, ft as viewDayCount, g as zonedTimeToUtc, gt as rangeBandKind, h as zonedEventSource, ht as dayBadgeKind, i as layoutMonthWeek, it as filterHiddenDays, j as clampMoveStartMinutes, k as resolveCalendarLabels, l as eventsInTimeZone, lt as isSameCalendarDay, m as zonedDragBounds, mt as bandRounding, n as buildMultiWeekGrid, nt as nextDateRange, o as loadEventSource, ot as getViewDays, p as toZonedTime, pt as weekDaysCount, q as groupEventsByDay, r as buildMonthGrid, rt as buildMonthWeeks, s as parseICalendar, st as getWeekDays, t as expandRecurringEvents, tt as isWithinDateRange, u as fromZonedRange, ut as isWeekend, v as eventAccessibilityLabel, vt as lightColors, w as monthVisibleCount, x as formatHour, y as eventChipLayout, z as shiftMinutes } from "./recurrence-15B6fu6K.mjs";
2
2
  import { startOfDay } from "date-fns";
3
3
  import { createContext, useCallback, useContext, useEffect, useMemo, useRef, useState } from "react";
4
4
  // src/utils/useNow.ts
5
5
  const MINUTE_MS = 6e4;
6
- const resolveNow = (now, timeZone) => {
7
- const instant = now ?? /* @__PURE__ */ new Date();
8
- return timeZone ? toZonedTime(instant, timeZone) : instant;
9
- };
10
6
  /**
11
7
  * The current wall-clock time, re-read every `tickMs` while `enabled`, shifted
12
8
  * into `timeZone` when given, or pinned to a fixed `now` override. Drives the
13
9
  * now indicator on both renderers so it can't disagree with zone-shifted events.
14
10
  */
15
11
  function useNow(enabled, { now, timeZone, tickMs = MINUTE_MS } = {}) {
16
- const [value, setValue] = useState(() => resolveNow(now, timeZone));
12
+ const [value, setValue] = useState(() => nowInTimeZone(now, timeZone));
17
13
  const nowMs = now?.getTime();
18
14
  useEffect(() => {
19
15
  if (!enabled) return;
20
- setValue(resolveNow(nowMs != null ? new Date(nowMs) : void 0, timeZone));
16
+ setValue(nowInTimeZone(nowMs != null ? new Date(nowMs) : void 0, timeZone));
21
17
  if (nowMs != null) return;
22
- const id = setInterval(() => setValue(resolveNow(void 0, timeZone)), tickMs);
18
+ const id = setInterval(() => setValue(nowInTimeZone(void 0, timeZone)), tickMs);
23
19
  return () => clearInterval(id);
24
20
  }, [
25
21
  enabled,
@@ -172,7 +168,8 @@ function useDateRange(options = {}) {
172
168
  * ```
173
169
  */
174
170
  function useMonthGrid(month, options = {}) {
175
- const { weekStartsOn, showSixWeeks, isRTL, selectedDates, selectedRange, minDate, maxDate, isDateDisabled, locale } = options;
171
+ const { weekStartsOn, showSixWeeks, isRTL, selectedDates, selectedRange, minDate, maxDate, isDateDisabled, locale, today } = options;
172
+ const todayKey = today ? startOfDay(today).getTime() : void 0;
176
173
  return useMemo(() => buildMonthGrid(month, options), [
177
174
  month,
178
175
  weekStartsOn,
@@ -183,7 +180,8 @@ function useMonthGrid(month, options = {}) {
183
180
  minDate,
184
181
  maxDate,
185
182
  isDateDisabled,
186
- locale
183
+ locale,
184
+ todayKey
187
185
  ]);
188
186
  }
189
- export { CalendarSelectionProvider, MIN_BOX_HEIGHT_FOR_TIME, backgroundBandsForDay, bandRounding, buildMonthGrid, buildMonthWeeks, buildMultiWeekGrid, cellRangeFromDrag, clampMoveStartMinutes, clockHoursBetween, closedHourBands, compareDayEvents, darkColors, dayAccessibilityLabel, dayBadgeKind, daySelectionState, defaultCalendarLabels, drawnEnd, eventAccessibilityLabel, eventChipLayout, eventDayKeys, eventTimeLabel, eventsInTimeZone, eventsOverlap, expandRecurringEvents, filterHiddenDays, formatHour, getIsToday, getViewDays, getWeekDays, getYearMonths, groupEventsByDay, isAllDayEvent, isBackgroundEvent, isDateSelectable, isRangeEndpoint, isSameCalendarDay, isTimeVisibleAtHeight, isWeekend, isWithinDateRange, layoutDayEvents, layoutMonthWeek, lightColors, loadEventSource, minutesIntoDay, monthCreateRange, monthDropBounds, monthEventCapacity, monthVisibleCount, movedClockSpan, nextDateRange, overlapsOtherEvents, pageStepDays, parseICalendar, rangeBandKind, resolveCalendarLabels, resolveDraggedBounds, shiftMinutes, snapDeltaMinutes, titleEllipsizeMode, titleNumberOfLines, toICalendar, toZonedTime, useCalendarSelection, useDateRange, useEventSource, useMonthGrid, useNow, viewDayCount, wallClockHours, weekDaysCount, weekdayFormatToken, zonedTimeToUtc };
187
+ export { CalendarSelectionProvider, MIN_BOX_HEIGHT_FOR_TIME, backgroundBandsForDay, bandRounding, buildMonthGrid, buildMonthWeeks, buildMultiWeekGrid, cellRangeFromDrag, clampMoveStartMinutes, clockHoursBetween, closedHourBands, compareDayEvents, darkColors, dayAccessibilityLabel, dayBadgeKind, daySelectionState, defaultCalendarLabels, drawnEnd, eventAccessibilityLabel, eventChipLayout, eventDayKeys, eventTimeLabel, eventsInTimeZone, eventsOverlap, expandRecurringEvents, filterHiddenDays, formatHour, fromZonedRange, fromZonedTime, getIsToday, getViewDays, getWeekDays, getYearMonths, groupEventsByDay, isAllDayEvent, isBackgroundEvent, isDateSelectable, isRangeEndpoint, isSameCalendarDay, isTimeVisibleAtHeight, isWeekend, isWithinDateRange, layoutDayEvents, layoutMonthWeek, lightColors, loadEventSource, minutesIntoDay, monthCreateRange, monthDropBounds, monthEventCapacity, monthVisibleCount, movedClockSpan, nextDateRange, nowInTimeZone, overlapsOtherEvents, pageStepDays, parseICalendar, rangeBandKind, resolveCalendarLabels, resolveDraggedBounds, shiftMinutes, snapDeltaMinutes, titleEllipsizeMode, titleNumberOfLines, toICalendar, toZonedTime, useCalendarSelection, useDateRange, useEventSource, useMonthGrid, useNow, viewDayCount, wallClockHours, weekDaysCount, weekdayFormatToken, zonedDragBounds, zonedEventSource, zonedTimeToUtc };