@klinking/colander 3.1.0-alpha.4 → 3.1.0-alpha.6

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.
Files changed (55) hide show
  1. package/dist/formats/date.cjs +1 -1
  2. package/dist/formats/date.d.cts +1 -1
  3. package/dist/formats/date.d.mts +1 -1
  4. package/dist/formats/date.mjs +1 -1
  5. package/dist/formats/object.cjs +1 -1
  6. package/dist/formats/object.d.cts +1 -1
  7. package/dist/formats/object.d.mts +1 -1
  8. package/dist/formats/object.mjs +1 -1
  9. package/dist/formats/plain-date-time.cjs +1 -1
  10. package/dist/formats/plain-date-time.d.cts +1 -1
  11. package/dist/formats/plain-date-time.d.mts +1 -1
  12. package/dist/formats/plain-date-time.mjs +1 -1
  13. package/dist/formats/plain-date.cjs +1 -1
  14. package/dist/formats/plain-date.d.cts +1 -1
  15. package/dist/formats/plain-date.d.mts +1 -1
  16. package/dist/formats/plain-date.mjs +1 -1
  17. package/dist/formats/plain-month-day.cjs +1 -1
  18. package/dist/formats/plain-month-day.d.cts +1 -1
  19. package/dist/formats/plain-month-day.d.mts +1 -1
  20. package/dist/formats/plain-month-day.mjs +1 -1
  21. package/dist/formats/plain-year-month.cjs +1 -1
  22. package/dist/formats/plain-year-month.d.cts +1 -1
  23. package/dist/formats/plain-year-month.d.mts +1 -1
  24. package/dist/formats/plain-year-month.mjs +1 -1
  25. package/dist/formats/zoned-date-time.cjs +1 -1
  26. package/dist/formats/zoned-date-time.d.cts +1 -1
  27. package/dist/formats/zoned-date-time.d.mts +1 -1
  28. package/dist/formats/zoned-date-time.mjs +1 -1
  29. package/dist/{weeks-view-context-CUCy8njs.d.cts → index-DnFCKyyw.d.cts} +71 -8
  30. package/dist/{weeks-view-context-E1NwyNgQ.d.mts → index-q3cQKJdA.d.mts} +71 -8
  31. package/dist/index.cjs +1 -1
  32. package/dist/index.d.cts +2 -11
  33. package/dist/index.d.mts +2 -11
  34. package/dist/index.mjs +1 -1
  35. package/dist/{weeks-navigation-elCpdfQ3.mjs → weeks-navigation-Dn3UtG76.mjs} +578 -589
  36. package/dist/{weeks-navigation-DV538__x.cjs → weeks-navigation-SuKJZJCM.cjs} +578 -589
  37. package/package.json +1 -1
  38. package/src/calendar-provider.tsx +10 -55
  39. package/src/day-cell-state.test.ts +214 -0
  40. package/src/day-cell-state.ts +314 -0
  41. package/src/day-cell.tsx +29 -383
  42. package/src/month-view-navigation.ts +180 -0
  43. package/src/month-view-types.ts +3 -0
  44. package/src/month-view.bounds.test.tsx +136 -0
  45. package/src/month-view.tsx +37 -205
  46. package/src/month-window.test.ts +207 -0
  47. package/src/month-window.ts +93 -0
  48. package/src/navigation.tsx +15 -74
  49. package/src/range-preview.test.ts +120 -0
  50. package/src/root-selection.ts +99 -97
  51. package/src/weeks-navigation.tsx +7 -32
  52. package/src/weeks-view-state.ts +24 -81
  53. package/src/weeks-view-types.ts +4 -1
  54. package/src/weeks-window.test.ts +43 -0
  55. package/src/weeks-window.ts +64 -0
@@ -1546,6 +1546,13 @@ interface CalendarStateContextValue {
1546
1546
  baseRootState: BaseRootState;
1547
1547
  }
1548
1548
  //#endregion
1549
+ //#region src/calendar-provider.d.ts
1550
+ /**
1551
+ * Provides shared calendar state (selection, config, range preview) to all
1552
+ * descendant view components. Does NOT manage focus, navigation, or grid data.
1553
+ */
1554
+ declare function CalendarProvider<F extends ValueFormat = "PlainDate">(props: CalendarProviderProps<F>): _$react_jsx_runtime0.JSX.Element;
1555
+ //#endregion
1549
1556
  //#region src/out-of-range.d.ts
1550
1557
  /**
1551
1558
  * Controls how a {@link WeeksView} window behaves when navigation would move it
@@ -1596,6 +1603,33 @@ type OutOfRangeBehavior = "unbounded" | "stop" | "stop-shrink" | "snap" | "snap-
1596
1603
  */
1597
1604
  type MonthOutOfRangeBehavior = "unbounded" | "stop";
1598
1605
  //#endregion
1606
+ //#region src/month-window.d.ts
1607
+ /** An ISO year + month. */
1608
+ interface MonthRef {
1609
+ year: number;
1610
+ month: number;
1611
+ }
1612
+ /** One step of the visible month window. */
1613
+ interface MonthStep {
1614
+ /** The window's first month after the step. */
1615
+ start: MonthRef;
1616
+ /** The month that enters view (before the window for `prev`, after it for `next`). */
1617
+ entering: MonthRef;
1618
+ /** First day of `start`, the focus target when focus isn't already in `start`. */
1619
+ firstDay: Temporal.PlainDate;
1620
+ /** Whether `stop` forbids the step because `entering` lies beyond `min`/`max`. */
1621
+ blocked: boolean;
1622
+ }
1623
+ /** The one seam for moving the MonthView window. */
1624
+ interface MonthWindowPolicy {
1625
+ /** Steps the window one month towards `direction`. */
1626
+ step(start: MonthRef, direction: "prev" | "next"): MonthStep;
1627
+ /** Whether `target` is inside the window starting at `start`. */
1628
+ isVisible(start: MonthRef, target: MonthRef): boolean;
1629
+ /** The window start that reveals `target` with the smallest shift. */
1630
+ reveal(start: MonthRef, target: MonthRef): MonthRef;
1631
+ }
1632
+ //#endregion
1599
1633
  //#region src/month-view-types.d.ts
1600
1634
  /** Props accepted by `MonthView.Root`. */
1601
1635
  interface MonthViewRootProps {
@@ -1657,6 +1691,8 @@ interface MonthViewStableContextValue {
1657
1691
  outsideDays: OutsideDays;
1658
1692
  /** How month navigation behaves at bounds. */
1659
1693
  outOfRangeBehavior: MonthOutOfRangeBehavior;
1694
+ /** Steps and reveals the visible month window. */
1695
+ windowPolicy: MonthWindowPolicy;
1660
1696
  /** Navigate to the next month(s). */
1661
1697
  goNextMonth: () => void;
1662
1698
  /** Navigate to the previous month(s). */
@@ -1703,6 +1739,12 @@ declare const GridHeaderCell: (props: GridHeaderCellProps & React.RefAttributes<
1703
1739
  /** Table header section (`<thead>`) wrapping a row of {@link GridHeaderCell}s. */
1704
1740
  declare const GridHeader: (props: GridHeaderProps & React.RefAttributes<HTMLTableSectionElement>) => React.ReactElement | null;
1705
1741
  //#endregion
1742
+ //#region src/day-cell-state.d.ts
1743
+ /** A day cell's state: the public {@link DayCellTemplateState} plus the roving-tabindex flag. */
1744
+ type DayCellState = DayCellTemplateState & {
1745
+ isTabTarget: boolean;
1746
+ };
1747
+ //#endregion
1706
1748
  //#region src/day-cell.d.ts
1707
1749
  /**
1708
1750
  * Renders one `<td role="gridcell">` per day. Exposes data-attributes for
@@ -1714,9 +1756,7 @@ declare const GridHeader: (props: GridHeaderProps & React.RefAttributes<HTMLTabl
1714
1756
  */
1715
1757
  declare function DayCellTemplate(props: DayCellTemplateProps): _$react_jsx_runtime0.JSX.Element;
1716
1758
  declare const DayButton: (props: DayButtonProps & {
1717
- _derivedState?: DayCellTemplateState & {
1718
- isTabTarget: boolean;
1719
- };
1759
+ _derivedState?: DayCellState;
1720
1760
  } & React.RefAttributes<HTMLButtonElement>) => React.ReactElement | null;
1721
1761
  //#endregion
1722
1762
  //#region src/grid.d.ts
@@ -1855,6 +1895,21 @@ interface WeekDescriptor {
1855
1895
  */
1856
1896
  declare function computeWeeksInWindow(firstWeek: Temporal.PlainDate, weekCount: number, weekStartDay: WeekStartDay, _T: TemporalNamespace): WeekDescriptor[];
1857
1897
  //#endregion
1898
+ //#region src/weeks-window.d.ts
1899
+ /**
1900
+ * The rules for where a WeeksView window may sit. Built once from the bounds and
1901
+ * shared by every way of moving the window (buttons, keyboard, `scrollToWeek`).
1902
+ */
1903
+ interface WeekWindowPolicy {
1904
+ /** Applies the out-of-range behavior to a requested first week. */
1905
+ resolve(requestedFirstWeek: Temporal.PlainDate): {
1906
+ firstWeek: Temporal.PlainDate;
1907
+ weekCount: number;
1908
+ };
1909
+ /** Whether a Prev/Next step of `shiftBy` weeks (default `weekCount`) is allowed. */
1910
+ canShift(currentFirstWeek: Temporal.PlainDate, direction: 1 | -1, shiftBy?: number): boolean;
1911
+ }
1912
+ //#endregion
1858
1913
  //#region src/weeks-view-types.d.ts
1859
1914
  /** Props accepted by `WeeksView.Root`. */
1860
1915
  interface WeeksViewRootProps {
@@ -1905,7 +1960,7 @@ interface WindowInfo {
1905
1960
  windowStart: Temporal.PlainDate;
1906
1961
  /** The last date of the visible window. */
1907
1962
  windowEnd: Temporal.PlainDate;
1908
- /** Number of week rows in the window (the prop value, not actual when shrunk). */
1963
+ /** Number of week rows actually shown (fewer than the `weekCount` prop when shrunk). */
1909
1964
  weekCount: number;
1910
1965
  /** Total number of calendar days in the window. */
1911
1966
  dayCount: number;
@@ -1924,6 +1979,8 @@ interface WeeksViewStableContextValue {
1924
1979
  scrollBy: "row" | "page";
1925
1980
  /** How navigation behaves at bounds. */
1926
1981
  outOfRangeBehavior: OutOfRangeBehavior;
1982
+ /** Where the window may sit given `min`/`max` and `outOfRangeBehavior`. */
1983
+ windowPolicy: WeekWindowPolicy;
1927
1984
  /** Navigate to the next week(s). Optionally override the shift amount (in weeks). */
1928
1985
  goNext: (shiftBy?: number) => void;
1929
1986
  /** Navigate to the previous week(s). Optionally override the shift amount (in weeks). */
@@ -2058,10 +2115,16 @@ declare const MonthSeparator: React$1.ForwardRefExoticComponent<Omit<MonthSepara
2058
2115
  //#region src/root-selection.d.ts
2059
2116
  /**
2060
2117
  * Pure utility that computes the preview range for a hovered date, using the
2061
- * same logic as the internal hook. Useful for deriving the preview in an
2062
- * `onHoveredDateChange` handler without needing a controlled `previewRange`.
2118
+ * same logic as the built-in hover preview. Useful for deriving the preview in
2119
+ * an `onHoveredDateChange` handler without needing a controlled `previewRange`.
2120
+ *
2121
+ * Pass `options.isDateDisabled` and `options.readOnly` to match a calendar that
2122
+ * disables dates or is read-only; by default every date is selectable.
2063
2123
  */
2064
- declare function computePreviewRange(hoveredDate: Temporal.PlainDate, currentRange: DateRange | null, rangeMode: RangeMode, preventRangeReversal?: boolean, T?: TemporalNamespace): DateRange<"PlainDate"> | null;
2124
+ declare function computePreviewRange(hoveredDate: Temporal.PlainDate, currentRange: DateRange | null, rangeMode: RangeMode, preventRangeReversal?: boolean, T?: TemporalNamespace, options?: {
2125
+ isDateDisabled?: (date: Temporal.PlainDate) => boolean;
2126
+ readOnly?: boolean;
2127
+ }): DateRange<"PlainDate"> | null;
2065
2128
  //#endregion
2066
2129
  //#region src/calendar-context.d.ts
2067
2130
  /** Returns the stable (callbacks/config) part of CalendarProvider context. */
@@ -2100,4 +2163,4 @@ declare function useWeeksViewStable(): WeeksViewStableContextValue;
2100
2163
  /** Returns the WeeksView state context (volatile grid data). */
2101
2164
  declare function useWeeksViewState(): WeeksViewStateContextValue;
2102
2165
  //#endregion
2103
- export { GridBody as $, TimeStringState as $t, VisibleMonth as A, GridHeaderProps as At, resolveFirstWeekSpec as B, PlainDateObject as Bt, WeekCountState as C, DayCellTemplateState as Ct, WeeksViewProps as D, GridBodyState as Dt, WeeksView as E, GridBodyProps as Et, WeekDescriptor as F, MonthYearStringProps as Ft, RangePreview as G, RangePreviewState as Gt, WeekNumberHeader as H, RangeEndDragHandleProps as Ht, computeWeeksInWindow as I, MonthYearStringState as It, MonthYearString as J, RangeStartDragHandleProps as Jt, RangeSelected as K, RangeSelectedProps as Kt, FirstWeekSpec as L, NavButtonState as Lt, WeeksViewStableContextValue as M, GridProps as Mt, WeeksViewStateContextValue as N, GridState as Nt, WeeksViewRoot as O, GridHeaderCellProps as Ot, WindowInfo as P, MonthData as Pt, Grid as Q, TimeStringProps as Qt, ScrollToWeekSnap as R, NextMonthButtonProps as Rt, WeekCountProps as S, DayCellTemplateProps as St, WeeksNavButtonState as T, DragHandleState as Tt, RangeEndDragHandle as U, RangeMode as Ut, WeekNumberCell as V, PrevMonthButtonProps as Vt, RangeStartDragHandle as W, RangePreviewProps as Wt, PrevMonthButton as X, RootState as Xt, NextMonthButton as Y, RawValueForFormat as Yt, TimeString as Z, TemporalNamespace as Zt, NextWeeksButton as _, DateStringProps as _t, useMonthViewStable as a, WeekNumberHeaderProps as an, MonthView as at, PrevWeeksButtonProps as b, DayButtonProps as bt, useCalendarState as c, WeekTemplateProps as cn, MonthViewRootProps as ct, MonthSeparatorCell as d, GridContext as dn, MonthOutOfRangeBehavior as dt, ValueChangeMeta as en, WeekTemplate as et, MonthSeparatorMonth as f, WeekDataContext as fn, OutOfRangeBehavior as ft, MonthSeparatorYear as g, DateRange as gt, MonthSeparatorWeekCount as h, CalendarStateContextValue as ht, useViewContext as i, WeekNumberCellState as in, GridHeaderCell as it, WeeksViewRootProps as j, GridHeaderState as jt, WeeksViewRootHandle as k, GridHeaderCellState as kt, computePreviewRange as l, WeekTemplateState as ln, MonthViewStableContextValue as lt, MonthSeparatorState as m, CalendarStableContextValue as mt, useWeeksViewState as n, ValueFormat as nn, DayCellTemplate as nt, useMonthViewState as o, WeekNumberHeaderState as on, MonthViewProps as ot, MonthSeparatorRow as p, CalendarProviderProps as pt, DateString as q, RangeSelectedState as qt, ViewContextValue as r, WeekNumberCellProps as rn, GridHeader as rt, useCalendarStable as s, WeekStartDay as sn, MonthViewRoot as st, useWeeksViewStable as t, ValueForFormat as tn, DayButton as tt, MonthSeparator as u, DayCellDataContext as un, MonthViewStateContextValue as ut, NextWeeksButtonProps as v, DateStringState as vt, WeeksNavButtonOwnProps as w, DragHandleOwnProps as wt, WeekCount as x, DayButtonState as xt, PrevWeeksButton as y, DateValueObject as yt, resolveFirstWeek as z, OutsideDays as zt };
2166
+ export { GridBody as $, TimeStringProps as $t, VisibleMonth as A, GridHeaderCellState as At, resolveFirstWeekSpec as B, OutsideDays as Bt, WeekCountState as C, DayCellTemplateProps as Ct, WeeksViewProps as D, GridBodyProps as Dt, WeeksView as E, DragHandleState as Et, WeekDescriptor as F, MonthData as Ft, RangePreview as G, RangePreviewProps as Gt, WeekNumberHeader as H, PrevMonthButtonProps as Ht, computeWeeksInWindow as I, MonthYearStringProps as It, MonthYearString as J, RangeSelectedState as Jt, RangeSelected as K, RangePreviewState as Kt, FirstWeekSpec as L, MonthYearStringState as Lt, WeeksViewStableContextValue as M, GridHeaderState as Mt, WeeksViewStateContextValue as N, GridProps as Nt, WeeksViewRoot as O, GridBodyState as Ot, WindowInfo as P, GridState as Pt, Grid as Q, TemporalNamespace as Qt, ScrollToWeekSnap as R, NavButtonState as Rt, WeekCountProps as S, DayButtonState as St, WeeksNavButtonState as T, DragHandleOwnProps as Tt, RangeEndDragHandle as U, RangeEndDragHandleProps as Ut, WeekNumberCell as V, PlainDateObject as Vt, RangeStartDragHandle as W, RangeMode as Wt, PrevMonthButton as X, RawValueForFormat as Xt, NextMonthButton as Y, RangeStartDragHandleProps as Yt, TimeString as Z, RootState as Zt, NextWeeksButton as _, DateRange as _t, useMonthViewStable as a, WeekNumberCellState as an, MonthView as at, PrevWeeksButtonProps as b, DateValueObject as bt, useCalendarState as c, WeekStartDay as cn, MonthViewRootProps as ct, MonthSeparatorCell as d, DayCellDataContext as dn, MonthOutOfRangeBehavior as dt, TimeStringState as en, WeekTemplate as et, MonthSeparatorMonth as f, GridContext as fn, OutOfRangeBehavior as ft, MonthSeparatorYear as g, CalendarStateContextValue as gt, MonthSeparatorWeekCount as h, CalendarStableContextValue as ht, useViewContext as i, WeekNumberCellProps as in, GridHeaderCell as it, WeeksViewRootProps as j, GridHeaderProps as jt, WeeksViewRootHandle as k, GridHeaderCellProps as kt, computePreviewRange as l, WeekTemplateProps as ln, MonthViewStableContextValue as lt, MonthSeparatorState as m, CalendarProviderProps as mt, useWeeksViewState as n, ValueForFormat as nn, DayCellTemplate as nt, useMonthViewState as o, WeekNumberHeaderProps as on, MonthViewProps as ot, MonthSeparatorRow as p, WeekDataContext as pn, CalendarProvider as pt, DateString as q, RangeSelectedProps as qt, ViewContextValue as r, ValueFormat as rn, GridHeader as rt, useCalendarStable as s, WeekNumberHeaderState as sn, MonthViewRoot as st, useWeeksViewStable as t, ValueChangeMeta as tn, DayButton as tt, MonthSeparator as u, WeekTemplateState as un, MonthViewStateContextValue as ut, NextWeeksButtonProps as v, DateStringProps as vt, WeeksNavButtonOwnProps as w, DayCellTemplateState as wt, WeekCount as x, DayButtonProps as xt, PrevWeeksButton as y, DateStringState as yt, resolveFirstWeek as z, NextMonthButtonProps as zt };
@@ -1546,6 +1546,13 @@ interface CalendarStateContextValue {
1546
1546
  baseRootState: BaseRootState;
1547
1547
  }
1548
1548
  //#endregion
1549
+ //#region src/calendar-provider.d.ts
1550
+ /**
1551
+ * Provides shared calendar state (selection, config, range preview) to all
1552
+ * descendant view components. Does NOT manage focus, navigation, or grid data.
1553
+ */
1554
+ declare function CalendarProvider<F extends ValueFormat = "PlainDate">(props: CalendarProviderProps<F>): _$react_jsx_runtime0.JSX.Element;
1555
+ //#endregion
1549
1556
  //#region src/out-of-range.d.ts
1550
1557
  /**
1551
1558
  * Controls how a {@link WeeksView} window behaves when navigation would move it
@@ -1596,6 +1603,33 @@ type OutOfRangeBehavior = "unbounded" | "stop" | "stop-shrink" | "snap" | "snap-
1596
1603
  */
1597
1604
  type MonthOutOfRangeBehavior = "unbounded" | "stop";
1598
1605
  //#endregion
1606
+ //#region src/month-window.d.ts
1607
+ /** An ISO year + month. */
1608
+ interface MonthRef {
1609
+ year: number;
1610
+ month: number;
1611
+ }
1612
+ /** One step of the visible month window. */
1613
+ interface MonthStep {
1614
+ /** The window's first month after the step. */
1615
+ start: MonthRef;
1616
+ /** The month that enters view (before the window for `prev`, after it for `next`). */
1617
+ entering: MonthRef;
1618
+ /** First day of `start`, the focus target when focus isn't already in `start`. */
1619
+ firstDay: Temporal.PlainDate;
1620
+ /** Whether `stop` forbids the step because `entering` lies beyond `min`/`max`. */
1621
+ blocked: boolean;
1622
+ }
1623
+ /** The one seam for moving the MonthView window. */
1624
+ interface MonthWindowPolicy {
1625
+ /** Steps the window one month towards `direction`. */
1626
+ step(start: MonthRef, direction: "prev" | "next"): MonthStep;
1627
+ /** Whether `target` is inside the window starting at `start`. */
1628
+ isVisible(start: MonthRef, target: MonthRef): boolean;
1629
+ /** The window start that reveals `target` with the smallest shift. */
1630
+ reveal(start: MonthRef, target: MonthRef): MonthRef;
1631
+ }
1632
+ //#endregion
1599
1633
  //#region src/month-view-types.d.ts
1600
1634
  /** Props accepted by `MonthView.Root`. */
1601
1635
  interface MonthViewRootProps {
@@ -1657,6 +1691,8 @@ interface MonthViewStableContextValue {
1657
1691
  outsideDays: OutsideDays;
1658
1692
  /** How month navigation behaves at bounds. */
1659
1693
  outOfRangeBehavior: MonthOutOfRangeBehavior;
1694
+ /** Steps and reveals the visible month window. */
1695
+ windowPolicy: MonthWindowPolicy;
1660
1696
  /** Navigate to the next month(s). */
1661
1697
  goNextMonth: () => void;
1662
1698
  /** Navigate to the previous month(s). */
@@ -1703,6 +1739,12 @@ declare const GridHeaderCell: (props: GridHeaderCellProps & React.RefAttributes<
1703
1739
  /** Table header section (`<thead>`) wrapping a row of {@link GridHeaderCell}s. */
1704
1740
  declare const GridHeader: (props: GridHeaderProps & React.RefAttributes<HTMLTableSectionElement>) => React.ReactElement | null;
1705
1741
  //#endregion
1742
+ //#region src/day-cell-state.d.ts
1743
+ /** A day cell's state: the public {@link DayCellTemplateState} plus the roving-tabindex flag. */
1744
+ type DayCellState = DayCellTemplateState & {
1745
+ isTabTarget: boolean;
1746
+ };
1747
+ //#endregion
1706
1748
  //#region src/day-cell.d.ts
1707
1749
  /**
1708
1750
  * Renders one `<td role="gridcell">` per day. Exposes data-attributes for
@@ -1714,9 +1756,7 @@ declare const GridHeader: (props: GridHeaderProps & React.RefAttributes<HTMLTabl
1714
1756
  */
1715
1757
  declare function DayCellTemplate(props: DayCellTemplateProps): _$react_jsx_runtime0.JSX.Element;
1716
1758
  declare const DayButton: (props: DayButtonProps & {
1717
- _derivedState?: DayCellTemplateState & {
1718
- isTabTarget: boolean;
1719
- };
1759
+ _derivedState?: DayCellState;
1720
1760
  } & React.RefAttributes<HTMLButtonElement>) => React.ReactElement | null;
1721
1761
  //#endregion
1722
1762
  //#region src/grid.d.ts
@@ -1855,6 +1895,21 @@ interface WeekDescriptor {
1855
1895
  */
1856
1896
  declare function computeWeeksInWindow(firstWeek: Temporal.PlainDate, weekCount: number, weekStartDay: WeekStartDay, _T: TemporalNamespace): WeekDescriptor[];
1857
1897
  //#endregion
1898
+ //#region src/weeks-window.d.ts
1899
+ /**
1900
+ * The rules for where a WeeksView window may sit. Built once from the bounds and
1901
+ * shared by every way of moving the window (buttons, keyboard, `scrollToWeek`).
1902
+ */
1903
+ interface WeekWindowPolicy {
1904
+ /** Applies the out-of-range behavior to a requested first week. */
1905
+ resolve(requestedFirstWeek: Temporal.PlainDate): {
1906
+ firstWeek: Temporal.PlainDate;
1907
+ weekCount: number;
1908
+ };
1909
+ /** Whether a Prev/Next step of `shiftBy` weeks (default `weekCount`) is allowed. */
1910
+ canShift(currentFirstWeek: Temporal.PlainDate, direction: 1 | -1, shiftBy?: number): boolean;
1911
+ }
1912
+ //#endregion
1858
1913
  //#region src/weeks-view-types.d.ts
1859
1914
  /** Props accepted by `WeeksView.Root`. */
1860
1915
  interface WeeksViewRootProps {
@@ -1905,7 +1960,7 @@ interface WindowInfo {
1905
1960
  windowStart: Temporal.PlainDate;
1906
1961
  /** The last date of the visible window. */
1907
1962
  windowEnd: Temporal.PlainDate;
1908
- /** Number of week rows in the window (the prop value, not actual when shrunk). */
1963
+ /** Number of week rows actually shown (fewer than the `weekCount` prop when shrunk). */
1909
1964
  weekCount: number;
1910
1965
  /** Total number of calendar days in the window. */
1911
1966
  dayCount: number;
@@ -1924,6 +1979,8 @@ interface WeeksViewStableContextValue {
1924
1979
  scrollBy: "row" | "page";
1925
1980
  /** How navigation behaves at bounds. */
1926
1981
  outOfRangeBehavior: OutOfRangeBehavior;
1982
+ /** Where the window may sit given `min`/`max` and `outOfRangeBehavior`. */
1983
+ windowPolicy: WeekWindowPolicy;
1927
1984
  /** Navigate to the next week(s). Optionally override the shift amount (in weeks). */
1928
1985
  goNext: (shiftBy?: number) => void;
1929
1986
  /** Navigate to the previous week(s). Optionally override the shift amount (in weeks). */
@@ -2058,10 +2115,16 @@ declare const MonthSeparator: React$1.ForwardRefExoticComponent<Omit<MonthSepara
2058
2115
  //#region src/root-selection.d.ts
2059
2116
  /**
2060
2117
  * Pure utility that computes the preview range for a hovered date, using the
2061
- * same logic as the internal hook. Useful for deriving the preview in an
2062
- * `onHoveredDateChange` handler without needing a controlled `previewRange`.
2118
+ * same logic as the built-in hover preview. Useful for deriving the preview in
2119
+ * an `onHoveredDateChange` handler without needing a controlled `previewRange`.
2120
+ *
2121
+ * Pass `options.isDateDisabled` and `options.readOnly` to match a calendar that
2122
+ * disables dates or is read-only; by default every date is selectable.
2063
2123
  */
2064
- declare function computePreviewRange(hoveredDate: Temporal.PlainDate, currentRange: DateRange | null, rangeMode: RangeMode, preventRangeReversal?: boolean, T?: TemporalNamespace): DateRange<"PlainDate"> | null;
2124
+ declare function computePreviewRange(hoveredDate: Temporal.PlainDate, currentRange: DateRange | null, rangeMode: RangeMode, preventRangeReversal?: boolean, T?: TemporalNamespace, options?: {
2125
+ isDateDisabled?: (date: Temporal.PlainDate) => boolean;
2126
+ readOnly?: boolean;
2127
+ }): DateRange<"PlainDate"> | null;
2065
2128
  //#endregion
2066
2129
  //#region src/calendar-context.d.ts
2067
2130
  /** Returns the stable (callbacks/config) part of CalendarProvider context. */
@@ -2100,4 +2163,4 @@ declare function useWeeksViewStable(): WeeksViewStableContextValue;
2100
2163
  /** Returns the WeeksView state context (volatile grid data). */
2101
2164
  declare function useWeeksViewState(): WeeksViewStateContextValue;
2102
2165
  //#endregion
2103
- export { GridBody as $, TimeStringState as $t, VisibleMonth as A, GridHeaderProps as At, resolveFirstWeekSpec as B, PlainDateObject as Bt, WeekCountState as C, DayCellTemplateState as Ct, WeeksViewProps as D, GridBodyState as Dt, WeeksView as E, GridBodyProps as Et, WeekDescriptor as F, MonthYearStringProps as Ft, RangePreview as G, RangePreviewState as Gt, WeekNumberHeader as H, RangeEndDragHandleProps as Ht, computeWeeksInWindow as I, MonthYearStringState as It, MonthYearString as J, RangeStartDragHandleProps as Jt, RangeSelected as K, RangeSelectedProps as Kt, FirstWeekSpec as L, NavButtonState as Lt, WeeksViewStableContextValue as M, GridProps as Mt, WeeksViewStateContextValue as N, GridState as Nt, WeeksViewRoot as O, GridHeaderCellProps as Ot, WindowInfo as P, MonthData as Pt, Grid as Q, TimeStringProps as Qt, ScrollToWeekSnap as R, NextMonthButtonProps as Rt, WeekCountProps as S, DayCellTemplateProps as St, WeeksNavButtonState as T, DragHandleState as Tt, RangeEndDragHandle as U, RangeMode as Ut, WeekNumberCell as V, PrevMonthButtonProps as Vt, RangeStartDragHandle as W, RangePreviewProps as Wt, PrevMonthButton as X, RootState as Xt, NextMonthButton as Y, RawValueForFormat as Yt, TimeString as Z, TemporalNamespace as Zt, NextWeeksButton as _, DateStringProps as _t, useMonthViewStable as a, WeekNumberHeaderProps as an, MonthView as at, PrevWeeksButtonProps as b, DayButtonProps as bt, useCalendarState as c, WeekTemplateProps as cn, MonthViewRootProps as ct, MonthSeparatorCell as d, GridContext as dn, MonthOutOfRangeBehavior as dt, ValueChangeMeta as en, WeekTemplate as et, MonthSeparatorMonth as f, WeekDataContext as fn, OutOfRangeBehavior as ft, MonthSeparatorYear as g, DateRange as gt, MonthSeparatorWeekCount as h, CalendarStateContextValue as ht, useViewContext as i, WeekNumberCellState as in, GridHeaderCell as it, WeeksViewRootProps as j, GridHeaderState as jt, WeeksViewRootHandle as k, GridHeaderCellState as kt, computePreviewRange as l, WeekTemplateState as ln, MonthViewStableContextValue as lt, MonthSeparatorState as m, CalendarStableContextValue as mt, useWeeksViewState as n, ValueFormat as nn, DayCellTemplate as nt, useMonthViewState as o, WeekNumberHeaderState as on, MonthViewProps as ot, MonthSeparatorRow as p, CalendarProviderProps as pt, DateString as q, RangeSelectedState as qt, ViewContextValue as r, WeekNumberCellProps as rn, GridHeader as rt, useCalendarStable as s, WeekStartDay as sn, MonthViewRoot as st, useWeeksViewStable as t, ValueForFormat as tn, DayButton as tt, MonthSeparator as u, DayCellDataContext as un, MonthViewStateContextValue as ut, NextWeeksButtonProps as v, DateStringState as vt, WeeksNavButtonOwnProps as w, DragHandleOwnProps as wt, WeekCount as x, DayButtonState as xt, PrevWeeksButton as y, DateValueObject as yt, resolveFirstWeek as z, OutsideDays as zt };
2166
+ export { GridBody as $, TimeStringProps as $t, VisibleMonth as A, GridHeaderCellState as At, resolveFirstWeekSpec as B, OutsideDays as Bt, WeekCountState as C, DayCellTemplateProps as Ct, WeeksViewProps as D, GridBodyProps as Dt, WeeksView as E, DragHandleState as Et, WeekDescriptor as F, MonthData as Ft, RangePreview as G, RangePreviewProps as Gt, WeekNumberHeader as H, PrevMonthButtonProps as Ht, computeWeeksInWindow as I, MonthYearStringProps as It, MonthYearString as J, RangeSelectedState as Jt, RangeSelected as K, RangePreviewState as Kt, FirstWeekSpec as L, MonthYearStringState as Lt, WeeksViewStableContextValue as M, GridHeaderState as Mt, WeeksViewStateContextValue as N, GridProps as Nt, WeeksViewRoot as O, GridBodyState as Ot, WindowInfo as P, GridState as Pt, Grid as Q, TemporalNamespace as Qt, ScrollToWeekSnap as R, NavButtonState as Rt, WeekCountProps as S, DayButtonState as St, WeeksNavButtonState as T, DragHandleOwnProps as Tt, RangeEndDragHandle as U, RangeEndDragHandleProps as Ut, WeekNumberCell as V, PlainDateObject as Vt, RangeStartDragHandle as W, RangeMode as Wt, PrevMonthButton as X, RawValueForFormat as Xt, NextMonthButton as Y, RangeStartDragHandleProps as Yt, TimeString as Z, RootState as Zt, NextWeeksButton as _, DateRange as _t, useMonthViewStable as a, WeekNumberCellState as an, MonthView as at, PrevWeeksButtonProps as b, DateValueObject as bt, useCalendarState as c, WeekStartDay as cn, MonthViewRootProps as ct, MonthSeparatorCell as d, DayCellDataContext as dn, MonthOutOfRangeBehavior as dt, TimeStringState as en, WeekTemplate as et, MonthSeparatorMonth as f, GridContext as fn, OutOfRangeBehavior as ft, MonthSeparatorYear as g, CalendarStateContextValue as gt, MonthSeparatorWeekCount as h, CalendarStableContextValue as ht, useViewContext as i, WeekNumberCellProps as in, GridHeaderCell as it, WeeksViewRootProps as j, GridHeaderProps as jt, WeeksViewRootHandle as k, GridHeaderCellProps as kt, computePreviewRange as l, WeekTemplateProps as ln, MonthViewStableContextValue as lt, MonthSeparatorState as m, CalendarProviderProps as mt, useWeeksViewState as n, ValueForFormat as nn, DayCellTemplate as nt, useMonthViewState as o, WeekNumberHeaderProps as on, MonthViewProps as ot, MonthSeparatorRow as p, WeekDataContext as pn, CalendarProvider as pt, DateString as q, RangeSelectedProps as qt, ViewContextValue as r, ValueFormat as rn, GridHeader as rt, useCalendarStable as s, WeekNumberHeaderState as sn, MonthViewRoot as st, useWeeksViewStable as t, ValueChangeMeta as tn, DayButton as tt, MonthSeparator as u, WeekTemplateState as un, MonthViewStateContextValue as ut, NextWeeksButtonProps as v, DateStringProps as vt, WeeksNavButtonOwnProps as w, DayCellTemplateState as wt, WeekCount as x, DayButtonProps as xt, PrevWeeksButton as y, DateStringState as yt, resolveFirstWeek as z, NextMonthButtonProps as zt };
package/dist/index.cjs CHANGED
@@ -1,5 +1,5 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- const require_weeks_navigation = require("./weeks-navigation-DV538__x.cjs");
2
+ const require_weeks_navigation = require("./weeks-navigation-SuKJZJCM.cjs");
3
3
  exports.CalendarProvider = require_weeks_navigation.CalendarProvider;
4
4
  exports.DateString = require_weeks_navigation.DateString;
5
5
  exports.DayButton = require_weeks_navigation.DayButton;
package/dist/index.d.cts CHANGED
@@ -1,11 +1,2 @@
1
- import { $ as GridBody, $t as TimeStringState, A as VisibleMonth, At as GridHeaderProps, B as resolveFirstWeekSpec, Bt as PlainDateObject, C as WeekCountState, Ct as DayCellTemplateState, D as WeeksViewProps, Dt as GridBodyState, E as WeeksView, Et as GridBodyProps, F as WeekDescriptor, Ft as MonthYearStringProps, G as RangePreview, Gt as RangePreviewState, H as WeekNumberHeader, Ht as RangeEndDragHandleProps, I as computeWeeksInWindow, It as MonthYearStringState, J as MonthYearString, Jt as RangeStartDragHandleProps, K as RangeSelected, Kt as RangeSelectedProps, L as FirstWeekSpec, Lt as NavButtonState, M as WeeksViewStableContextValue, Mt as GridProps, N as WeeksViewStateContextValue, Nt as GridState, O as WeeksViewRoot, Ot as GridHeaderCellProps, P as WindowInfo, Pt as MonthData, Q as Grid, Qt as TimeStringProps, R as ScrollToWeekSnap, Rt as NextMonthButtonProps, S as WeekCountProps, St as DayCellTemplateProps, T as WeeksNavButtonState, Tt as DragHandleState, U as RangeEndDragHandle, Ut as RangeMode, V as WeekNumberCell, Vt as PrevMonthButtonProps, W as RangeStartDragHandle, Wt as RangePreviewProps, X as PrevMonthButton, Xt as RootState, Y as NextMonthButton, Yt as RawValueForFormat, Z as TimeString, Zt as TemporalNamespace, _ as NextWeeksButton, _t as DateStringProps, a as useMonthViewStable, an as WeekNumberHeaderProps, at as MonthView, b as PrevWeeksButtonProps, bt as DayButtonProps, c as useCalendarState, cn as WeekTemplateProps, ct as MonthViewRootProps, d as MonthSeparatorCell, dn as GridContext, dt as MonthOutOfRangeBehavior, en as ValueChangeMeta, et as WeekTemplate, f as MonthSeparatorMonth, fn as WeekDataContext, ft as OutOfRangeBehavior, g as MonthSeparatorYear, gt as DateRange, h as MonthSeparatorWeekCount, ht as CalendarStateContextValue, i as useViewContext, in as WeekNumberCellState, it as GridHeaderCell, j as WeeksViewRootProps, jt as GridHeaderState, k as WeeksViewRootHandle, kt as GridHeaderCellState, l as computePreviewRange, ln as WeekTemplateState, lt as MonthViewStableContextValue, m as MonthSeparatorState, mt as CalendarStableContextValue, n as useWeeksViewState, nn as ValueFormat, nt as DayCellTemplate, o as useMonthViewState, on as WeekNumberHeaderState, ot as MonthViewProps, p as MonthSeparatorRow, pt as CalendarProviderProps, q as DateString, qt as RangeSelectedState, r as ViewContextValue, rn as WeekNumberCellProps, rt as GridHeader, s as useCalendarStable, sn as WeekStartDay, st as MonthViewRoot, t as useWeeksViewStable, tn as ValueForFormat, tt as DayButton, u as MonthSeparator, un as DayCellDataContext, ut as MonthViewStateContextValue, v as NextWeeksButtonProps, vt as DateStringState, w as WeeksNavButtonOwnProps, wt as DragHandleOwnProps, x as WeekCount, xt as DayButtonState, y as PrevWeeksButton, yt as DateValueObject, z as resolveFirstWeek, zt as OutsideDays } from "./weeks-view-context-CUCy8njs.cjs";
2
- import * as _$react_jsx_runtime0 from "react/jsx-runtime";
3
-
4
- //#region src/calendar-provider.d.ts
5
- /**
6
- * Provides shared calendar state (selection, config, range preview) to all
7
- * descendant view components. Does NOT manage focus, navigation, or grid data.
8
- */
9
- declare function CalendarProvider<F extends ValueFormat = "PlainDate">(props: CalendarProviderProps<F>): _$react_jsx_runtime0.JSX.Element;
10
- //#endregion
11
- export { CalendarProvider, type CalendarProviderProps, type CalendarStableContextValue, type CalendarStateContextValue, type DateRange, DateString, type DateStringProps, type DateStringState, type DateValueObject, DayButton, type DayButtonProps, type DayButtonState, DayCellDataContext, DayCellTemplate, type DayCellTemplateProps, type DayCellTemplateState, type DragHandleOwnProps, type DragHandleState, type FirstWeekSpec, Grid, GridBody, type GridBodyProps, type GridBodyState, GridContext, GridHeader, GridHeaderCell, type GridHeaderCellProps, type GridHeaderCellState, type GridHeaderProps, type GridHeaderState, type GridProps, type GridState, type MonthData, type MonthOutOfRangeBehavior, MonthSeparator, MonthSeparatorCell, MonthSeparatorMonth, MonthSeparatorRow, type MonthSeparatorState, MonthSeparatorWeekCount, MonthSeparatorYear, MonthView, type MonthViewProps, MonthViewRoot, type MonthViewRootProps, type MonthViewStableContextValue, type MonthViewStateContextValue, MonthYearString, type MonthYearStringProps, type MonthYearStringState, type NavButtonState, NextMonthButton, type NextMonthButtonProps, NextWeeksButton, type NextWeeksButtonProps, type OutOfRangeBehavior, type OutsideDays, type PlainDateObject, PrevMonthButton, type PrevMonthButtonProps, PrevWeeksButton, type PrevWeeksButtonProps, RangeEndDragHandle, type RangeEndDragHandleProps, type RangeMode, RangePreview, type RangePreviewProps, type RangePreviewState, RangeSelected, type RangeSelectedProps, type RangeSelectedState, RangeStartDragHandle, type RangeStartDragHandleProps, type RawValueForFormat, type RootState, type ScrollToWeekSnap, type TemporalNamespace, TimeString, type TimeStringProps, type TimeStringState, type ValueChangeMeta, type ValueForFormat, type ValueFormat, type ViewContextValue, type VisibleMonth, WeekCount, type WeekCountProps, type WeekCountState, WeekDataContext, type WeekDescriptor, WeekNumberCell, type WeekNumberCellProps, type WeekNumberCellState, WeekNumberHeader, type WeekNumberHeaderProps, type WeekNumberHeaderState, type WeekStartDay, WeekTemplate, type WeekTemplateProps, type WeekTemplateState, type WeeksNavButtonOwnProps, type WeeksNavButtonState, WeeksView, type WeeksViewProps, WeeksViewRoot, type WeeksViewRootHandle, type WeeksViewRootProps, type WeeksViewStableContextValue, type WeeksViewStateContextValue, type WindowInfo, computePreviewRange, computeWeeksInWindow, resolveFirstWeek, resolveFirstWeekSpec, useCalendarStable, useCalendarState, useMonthViewStable, useMonthViewState, useViewContext, useWeeksViewStable, useWeeksViewState };
1
+ import { $ as GridBody, $t as TimeStringProps, A as VisibleMonth, At as GridHeaderCellState, B as resolveFirstWeekSpec, Bt as OutsideDays, C as WeekCountState, Ct as DayCellTemplateProps, D as WeeksViewProps, Dt as GridBodyProps, E as WeeksView, Et as DragHandleState, F as WeekDescriptor, Ft as MonthData, G as RangePreview, Gt as RangePreviewProps, H as WeekNumberHeader, Ht as PrevMonthButtonProps, I as computeWeeksInWindow, It as MonthYearStringProps, J as MonthYearString, Jt as RangeSelectedState, K as RangeSelected, Kt as RangePreviewState, L as FirstWeekSpec, Lt as MonthYearStringState, M as WeeksViewStableContextValue, Mt as GridHeaderState, N as WeeksViewStateContextValue, Nt as GridProps, O as WeeksViewRoot, Ot as GridBodyState, P as WindowInfo, Pt as GridState, Q as Grid, Qt as TemporalNamespace, R as ScrollToWeekSnap, Rt as NavButtonState, S as WeekCountProps, St as DayButtonState, T as WeeksNavButtonState, Tt as DragHandleOwnProps, U as RangeEndDragHandle, Ut as RangeEndDragHandleProps, V as WeekNumberCell, Vt as PlainDateObject, W as RangeStartDragHandle, Wt as RangeMode, X as PrevMonthButton, Xt as RawValueForFormat, Y as NextMonthButton, Yt as RangeStartDragHandleProps, Z as TimeString, Zt as RootState, _ as NextWeeksButton, _t as DateRange, a as useMonthViewStable, an as WeekNumberCellState, at as MonthView, b as PrevWeeksButtonProps, bt as DateValueObject, c as useCalendarState, cn as WeekStartDay, ct as MonthViewRootProps, d as MonthSeparatorCell, dn as DayCellDataContext, dt as MonthOutOfRangeBehavior, en as TimeStringState, et as WeekTemplate, f as MonthSeparatorMonth, fn as GridContext, ft as OutOfRangeBehavior, g as MonthSeparatorYear, gt as CalendarStateContextValue, h as MonthSeparatorWeekCount, ht as CalendarStableContextValue, i as useViewContext, in as WeekNumberCellProps, it as GridHeaderCell, j as WeeksViewRootProps, jt as GridHeaderProps, k as WeeksViewRootHandle, kt as GridHeaderCellProps, l as computePreviewRange, ln as WeekTemplateProps, lt as MonthViewStableContextValue, m as MonthSeparatorState, mt as CalendarProviderProps, n as useWeeksViewState, nn as ValueForFormat, nt as DayCellTemplate, o as useMonthViewState, on as WeekNumberHeaderProps, ot as MonthViewProps, p as MonthSeparatorRow, pn as WeekDataContext, pt as CalendarProvider, q as DateString, qt as RangeSelectedProps, r as ViewContextValue, rn as ValueFormat, rt as GridHeader, s as useCalendarStable, sn as WeekNumberHeaderState, st as MonthViewRoot, t as useWeeksViewStable, tn as ValueChangeMeta, tt as DayButton, u as MonthSeparator, un as WeekTemplateState, ut as MonthViewStateContextValue, v as NextWeeksButtonProps, vt as DateStringProps, w as WeeksNavButtonOwnProps, wt as DayCellTemplateState, x as WeekCount, xt as DayButtonProps, y as PrevWeeksButton, yt as DateStringState, z as resolveFirstWeek, zt as NextMonthButtonProps } from "./index-DnFCKyyw.cjs";
2
+ export { CalendarProvider, CalendarProviderProps, CalendarStableContextValue, CalendarStateContextValue, DateRange, DateString, DateStringProps, DateStringState, DateValueObject, DayButton, DayButtonProps, DayButtonState, DayCellDataContext, DayCellTemplate, DayCellTemplateProps, DayCellTemplateState, DragHandleOwnProps, DragHandleState, FirstWeekSpec, Grid, GridBody, GridBodyProps, GridBodyState, GridContext, GridHeader, GridHeaderCell, GridHeaderCellProps, GridHeaderCellState, GridHeaderProps, GridHeaderState, GridProps, GridState, MonthData, MonthOutOfRangeBehavior, MonthSeparator, MonthSeparatorCell, MonthSeparatorMonth, MonthSeparatorRow, MonthSeparatorState, MonthSeparatorWeekCount, MonthSeparatorYear, MonthView, MonthViewProps, MonthViewRoot, MonthViewRootProps, MonthViewStableContextValue, MonthViewStateContextValue, MonthYearString, MonthYearStringProps, MonthYearStringState, NavButtonState, NextMonthButton, NextMonthButtonProps, NextWeeksButton, NextWeeksButtonProps, OutOfRangeBehavior, OutsideDays, PlainDateObject, PrevMonthButton, PrevMonthButtonProps, PrevWeeksButton, PrevWeeksButtonProps, RangeEndDragHandle, RangeEndDragHandleProps, RangeMode, RangePreview, RangePreviewProps, RangePreviewState, RangeSelected, RangeSelectedProps, RangeSelectedState, RangeStartDragHandle, RangeStartDragHandleProps, RawValueForFormat, RootState, ScrollToWeekSnap, TemporalNamespace, TimeString, TimeStringProps, TimeStringState, ValueChangeMeta, ValueForFormat, ValueFormat, ViewContextValue, VisibleMonth, WeekCount, WeekCountProps, WeekCountState, WeekDataContext, WeekDescriptor, WeekNumberCell, WeekNumberCellProps, WeekNumberCellState, WeekNumberHeader, WeekNumberHeaderProps, WeekNumberHeaderState, WeekStartDay, WeekTemplate, WeekTemplateProps, WeekTemplateState, WeeksNavButtonOwnProps, WeeksNavButtonState, WeeksView, WeeksViewProps, WeeksViewRoot, WeeksViewRootHandle, WeeksViewRootProps, WeeksViewStableContextValue, WeeksViewStateContextValue, WindowInfo, computePreviewRange, computeWeeksInWindow, resolveFirstWeek, resolveFirstWeekSpec, useCalendarStable, useCalendarState, useMonthViewStable, useMonthViewState, useViewContext, useWeeksViewStable, useWeeksViewState };
package/dist/index.d.mts CHANGED
@@ -1,11 +1,2 @@
1
- import { $ as GridBody, $t as TimeStringState, A as VisibleMonth, At as GridHeaderProps, B as resolveFirstWeekSpec, Bt as PlainDateObject, C as WeekCountState, Ct as DayCellTemplateState, D as WeeksViewProps, Dt as GridBodyState, E as WeeksView, Et as GridBodyProps, F as WeekDescriptor, Ft as MonthYearStringProps, G as RangePreview, Gt as RangePreviewState, H as WeekNumberHeader, Ht as RangeEndDragHandleProps, I as computeWeeksInWindow, It as MonthYearStringState, J as MonthYearString, Jt as RangeStartDragHandleProps, K as RangeSelected, Kt as RangeSelectedProps, L as FirstWeekSpec, Lt as NavButtonState, M as WeeksViewStableContextValue, Mt as GridProps, N as WeeksViewStateContextValue, Nt as GridState, O as WeeksViewRoot, Ot as GridHeaderCellProps, P as WindowInfo, Pt as MonthData, Q as Grid, Qt as TimeStringProps, R as ScrollToWeekSnap, Rt as NextMonthButtonProps, S as WeekCountProps, St as DayCellTemplateProps, T as WeeksNavButtonState, Tt as DragHandleState, U as RangeEndDragHandle, Ut as RangeMode, V as WeekNumberCell, Vt as PrevMonthButtonProps, W as RangeStartDragHandle, Wt as RangePreviewProps, X as PrevMonthButton, Xt as RootState, Y as NextMonthButton, Yt as RawValueForFormat, Z as TimeString, Zt as TemporalNamespace, _ as NextWeeksButton, _t as DateStringProps, a as useMonthViewStable, an as WeekNumberHeaderProps, at as MonthView, b as PrevWeeksButtonProps, bt as DayButtonProps, c as useCalendarState, cn as WeekTemplateProps, ct as MonthViewRootProps, d as MonthSeparatorCell, dn as GridContext, dt as MonthOutOfRangeBehavior, en as ValueChangeMeta, et as WeekTemplate, f as MonthSeparatorMonth, fn as WeekDataContext, ft as OutOfRangeBehavior, g as MonthSeparatorYear, gt as DateRange, h as MonthSeparatorWeekCount, ht as CalendarStateContextValue, i as useViewContext, in as WeekNumberCellState, it as GridHeaderCell, j as WeeksViewRootProps, jt as GridHeaderState, k as WeeksViewRootHandle, kt as GridHeaderCellState, l as computePreviewRange, ln as WeekTemplateState, lt as MonthViewStableContextValue, m as MonthSeparatorState, mt as CalendarStableContextValue, n as useWeeksViewState, nn as ValueFormat, nt as DayCellTemplate, o as useMonthViewState, on as WeekNumberHeaderState, ot as MonthViewProps, p as MonthSeparatorRow, pt as CalendarProviderProps, q as DateString, qt as RangeSelectedState, r as ViewContextValue, rn as WeekNumberCellProps, rt as GridHeader, s as useCalendarStable, sn as WeekStartDay, st as MonthViewRoot, t as useWeeksViewStable, tn as ValueForFormat, tt as DayButton, u as MonthSeparator, un as DayCellDataContext, ut as MonthViewStateContextValue, v as NextWeeksButtonProps, vt as DateStringState, w as WeeksNavButtonOwnProps, wt as DragHandleOwnProps, x as WeekCount, xt as DayButtonState, y as PrevWeeksButton, yt as DateValueObject, z as resolveFirstWeek, zt as OutsideDays } from "./weeks-view-context-E1NwyNgQ.mjs";
2
- import * as _$react_jsx_runtime0 from "react/jsx-runtime";
3
-
4
- //#region src/calendar-provider.d.ts
5
- /**
6
- * Provides shared calendar state (selection, config, range preview) to all
7
- * descendant view components. Does NOT manage focus, navigation, or grid data.
8
- */
9
- declare function CalendarProvider<F extends ValueFormat = "PlainDate">(props: CalendarProviderProps<F>): _$react_jsx_runtime0.JSX.Element;
10
- //#endregion
11
- export { CalendarProvider, type CalendarProviderProps, type CalendarStableContextValue, type CalendarStateContextValue, type DateRange, DateString, type DateStringProps, type DateStringState, type DateValueObject, DayButton, type DayButtonProps, type DayButtonState, DayCellDataContext, DayCellTemplate, type DayCellTemplateProps, type DayCellTemplateState, type DragHandleOwnProps, type DragHandleState, type FirstWeekSpec, Grid, GridBody, type GridBodyProps, type GridBodyState, GridContext, GridHeader, GridHeaderCell, type GridHeaderCellProps, type GridHeaderCellState, type GridHeaderProps, type GridHeaderState, type GridProps, type GridState, type MonthData, type MonthOutOfRangeBehavior, MonthSeparator, MonthSeparatorCell, MonthSeparatorMonth, MonthSeparatorRow, type MonthSeparatorState, MonthSeparatorWeekCount, MonthSeparatorYear, MonthView, type MonthViewProps, MonthViewRoot, type MonthViewRootProps, type MonthViewStableContextValue, type MonthViewStateContextValue, MonthYearString, type MonthYearStringProps, type MonthYearStringState, type NavButtonState, NextMonthButton, type NextMonthButtonProps, NextWeeksButton, type NextWeeksButtonProps, type OutOfRangeBehavior, type OutsideDays, type PlainDateObject, PrevMonthButton, type PrevMonthButtonProps, PrevWeeksButton, type PrevWeeksButtonProps, RangeEndDragHandle, type RangeEndDragHandleProps, type RangeMode, RangePreview, type RangePreviewProps, type RangePreviewState, RangeSelected, type RangeSelectedProps, type RangeSelectedState, RangeStartDragHandle, type RangeStartDragHandleProps, type RawValueForFormat, type RootState, type ScrollToWeekSnap, type TemporalNamespace, TimeString, type TimeStringProps, type TimeStringState, type ValueChangeMeta, type ValueForFormat, type ValueFormat, type ViewContextValue, type VisibleMonth, WeekCount, type WeekCountProps, type WeekCountState, WeekDataContext, type WeekDescriptor, WeekNumberCell, type WeekNumberCellProps, type WeekNumberCellState, WeekNumberHeader, type WeekNumberHeaderProps, type WeekNumberHeaderState, type WeekStartDay, WeekTemplate, type WeekTemplateProps, type WeekTemplateState, type WeeksNavButtonOwnProps, type WeeksNavButtonState, WeeksView, type WeeksViewProps, WeeksViewRoot, type WeeksViewRootHandle, type WeeksViewRootProps, type WeeksViewStableContextValue, type WeeksViewStateContextValue, type WindowInfo, computePreviewRange, computeWeeksInWindow, resolveFirstWeek, resolveFirstWeekSpec, useCalendarStable, useCalendarState, useMonthViewStable, useMonthViewState, useViewContext, useWeeksViewStable, useWeeksViewState };
1
+ import { $ as GridBody, $t as TimeStringProps, A as VisibleMonth, At as GridHeaderCellState, B as resolveFirstWeekSpec, Bt as OutsideDays, C as WeekCountState, Ct as DayCellTemplateProps, D as WeeksViewProps, Dt as GridBodyProps, E as WeeksView, Et as DragHandleState, F as WeekDescriptor, Ft as MonthData, G as RangePreview, Gt as RangePreviewProps, H as WeekNumberHeader, Ht as PrevMonthButtonProps, I as computeWeeksInWindow, It as MonthYearStringProps, J as MonthYearString, Jt as RangeSelectedState, K as RangeSelected, Kt as RangePreviewState, L as FirstWeekSpec, Lt as MonthYearStringState, M as WeeksViewStableContextValue, Mt as GridHeaderState, N as WeeksViewStateContextValue, Nt as GridProps, O as WeeksViewRoot, Ot as GridBodyState, P as WindowInfo, Pt as GridState, Q as Grid, Qt as TemporalNamespace, R as ScrollToWeekSnap, Rt as NavButtonState, S as WeekCountProps, St as DayButtonState, T as WeeksNavButtonState, Tt as DragHandleOwnProps, U as RangeEndDragHandle, Ut as RangeEndDragHandleProps, V as WeekNumberCell, Vt as PlainDateObject, W as RangeStartDragHandle, Wt as RangeMode, X as PrevMonthButton, Xt as RawValueForFormat, Y as NextMonthButton, Yt as RangeStartDragHandleProps, Z as TimeString, Zt as RootState, _ as NextWeeksButton, _t as DateRange, a as useMonthViewStable, an as WeekNumberCellState, at as MonthView, b as PrevWeeksButtonProps, bt as DateValueObject, c as useCalendarState, cn as WeekStartDay, ct as MonthViewRootProps, d as MonthSeparatorCell, dn as DayCellDataContext, dt as MonthOutOfRangeBehavior, en as TimeStringState, et as WeekTemplate, f as MonthSeparatorMonth, fn as GridContext, ft as OutOfRangeBehavior, g as MonthSeparatorYear, gt as CalendarStateContextValue, h as MonthSeparatorWeekCount, ht as CalendarStableContextValue, i as useViewContext, in as WeekNumberCellProps, it as GridHeaderCell, j as WeeksViewRootProps, jt as GridHeaderProps, k as WeeksViewRootHandle, kt as GridHeaderCellProps, l as computePreviewRange, ln as WeekTemplateProps, lt as MonthViewStableContextValue, m as MonthSeparatorState, mt as CalendarProviderProps, n as useWeeksViewState, nn as ValueForFormat, nt as DayCellTemplate, o as useMonthViewState, on as WeekNumberHeaderProps, ot as MonthViewProps, p as MonthSeparatorRow, pn as WeekDataContext, pt as CalendarProvider, q as DateString, qt as RangeSelectedProps, r as ViewContextValue, rn as ValueFormat, rt as GridHeader, s as useCalendarStable, sn as WeekNumberHeaderState, st as MonthViewRoot, t as useWeeksViewStable, tn as ValueChangeMeta, tt as DayButton, u as MonthSeparator, un as WeekTemplateState, ut as MonthViewStateContextValue, v as NextWeeksButtonProps, vt as DateStringProps, w as WeeksNavButtonOwnProps, wt as DayCellTemplateState, x as WeekCount, xt as DayButtonProps, y as PrevWeeksButton, yt as DateStringState, z as resolveFirstWeek, zt as NextMonthButtonProps } from "./index-q3cQKJdA.mjs";
2
+ export { CalendarProvider, CalendarProviderProps, CalendarStableContextValue, CalendarStateContextValue, DateRange, DateString, DateStringProps, DateStringState, DateValueObject, DayButton, DayButtonProps, DayButtonState, DayCellDataContext, DayCellTemplate, DayCellTemplateProps, DayCellTemplateState, DragHandleOwnProps, DragHandleState, FirstWeekSpec, Grid, GridBody, GridBodyProps, GridBodyState, GridContext, GridHeader, GridHeaderCell, GridHeaderCellProps, GridHeaderCellState, GridHeaderProps, GridHeaderState, GridProps, GridState, MonthData, MonthOutOfRangeBehavior, MonthSeparator, MonthSeparatorCell, MonthSeparatorMonth, MonthSeparatorRow, MonthSeparatorState, MonthSeparatorWeekCount, MonthSeparatorYear, MonthView, MonthViewProps, MonthViewRoot, MonthViewRootProps, MonthViewStableContextValue, MonthViewStateContextValue, MonthYearString, MonthYearStringProps, MonthYearStringState, NavButtonState, NextMonthButton, NextMonthButtonProps, NextWeeksButton, NextWeeksButtonProps, OutOfRangeBehavior, OutsideDays, PlainDateObject, PrevMonthButton, PrevMonthButtonProps, PrevWeeksButton, PrevWeeksButtonProps, RangeEndDragHandle, RangeEndDragHandleProps, RangeMode, RangePreview, RangePreviewProps, RangePreviewState, RangeSelected, RangeSelectedProps, RangeSelectedState, RangeStartDragHandle, RangeStartDragHandleProps, RawValueForFormat, RootState, ScrollToWeekSnap, TemporalNamespace, TimeString, TimeStringProps, TimeStringState, ValueChangeMeta, ValueForFormat, ValueFormat, ViewContextValue, VisibleMonth, WeekCount, WeekCountProps, WeekCountState, WeekDataContext, WeekDescriptor, WeekNumberCell, WeekNumberCellProps, WeekNumberCellState, WeekNumberHeader, WeekNumberHeaderProps, WeekNumberHeaderState, WeekStartDay, WeekTemplate, WeekTemplateProps, WeekTemplateState, WeeksNavButtonOwnProps, WeeksNavButtonState, WeeksView, WeeksViewProps, WeeksViewRoot, WeeksViewRootHandle, WeeksViewRootProps, WeeksViewStableContextValue, WeeksViewStateContextValue, WindowInfo, computePreviewRange, computeWeeksInWindow, resolveFirstWeek, resolveFirstWeekSpec, useCalendarStable, useCalendarState, useMonthViewStable, useMonthViewState, useViewContext, useWeeksViewStable, useWeeksViewState };
package/dist/index.mjs CHANGED
@@ -1,2 +1,2 @@
1
- import { A as MonthSeparatorRow, B as useViewContext, C as DayButton, D as MonthSeparator, E as useWeeksViewState, F as DayCellDataContext, G as useCalendarStable, H as useMonthViewState, I as GridContext, K as useCalendarState, L as WeekDataContext, M as MonthSeparatorYear, N as GridHeader, O as MonthSeparatorCell, P as GridHeaderCell, R as MonthView, S as WeekTemplate, T as useWeeksViewStable, U as CalendarProvider, V as useMonthViewStable, W as computePreviewRange, _ as NextMonthButton, a as WeeksViewRoot, b as Grid, c as computeWeeksInWindow, d as RangeEndDragHandle, f as RangeStartDragHandle, g as MonthYearString, h as DateString, i as WeeksView, j as MonthSeparatorWeekCount, k as MonthSeparatorMonth, l as WeekNumberCell, m as RangeSelected, n as PrevWeeksButton, o as resolveFirstWeek, p as RangePreview, r as WeekCount, s as resolveFirstWeekSpec, t as NextWeeksButton, u as WeekNumberHeader, v as PrevMonthButton, w as DayCellTemplate, x as GridBody, y as TimeString, z as MonthViewRoot } from "./weeks-navigation-elCpdfQ3.mjs";
1
+ import { A as MonthSeparatorRow, B as useViewContext, C as DayButton, D as MonthSeparator, E as useWeeksViewState, F as DayCellDataContext, G as useCalendarStable, H as useMonthViewState, I as GridContext, K as useCalendarState, L as WeekDataContext, M as MonthSeparatorYear, N as GridHeader, O as MonthSeparatorCell, P as GridHeaderCell, R as MonthView, S as WeekTemplate, T as useWeeksViewStable, U as CalendarProvider, V as useMonthViewStable, W as computePreviewRange, _ as NextMonthButton, a as WeeksViewRoot, b as Grid, c as computeWeeksInWindow, d as RangeEndDragHandle, f as RangeStartDragHandle, g as MonthYearString, h as DateString, i as WeeksView, j as MonthSeparatorWeekCount, k as MonthSeparatorMonth, l as WeekNumberCell, m as RangeSelected, n as PrevWeeksButton, o as resolveFirstWeek, p as RangePreview, r as WeekCount, s as resolveFirstWeekSpec, t as NextWeeksButton, u as WeekNumberHeader, v as PrevMonthButton, w as DayCellTemplate, x as GridBody, y as TimeString, z as MonthViewRoot } from "./weeks-navigation-Dn3UtG76.mjs";
2
2
  export { CalendarProvider, DateString, DayButton, DayCellDataContext, DayCellTemplate, Grid, GridBody, GridContext, GridHeader, GridHeaderCell, MonthSeparator, MonthSeparatorCell, MonthSeparatorMonth, MonthSeparatorRow, MonthSeparatorWeekCount, MonthSeparatorYear, MonthView, MonthViewRoot, MonthYearString, NextMonthButton, NextWeeksButton, PrevMonthButton, PrevWeeksButton, RangeEndDragHandle, RangePreview, RangeSelected, RangeStartDragHandle, TimeString, WeekCount, WeekDataContext, WeekNumberCell, WeekNumberHeader, WeekTemplate, WeeksView, WeeksViewRoot, computePreviewRange, computeWeeksInWindow, resolveFirstWeek, resolveFirstWeekSpec, useCalendarStable, useCalendarState, useMonthViewStable, useMonthViewState, useViewContext, useWeeksViewStable, useWeeksViewState };