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

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 (66) hide show
  1. package/dist/formats/date.cjs +2 -3
  2. package/dist/formats/date.d.cts +10 -14
  3. package/dist/formats/date.d.mts +10 -14
  4. package/dist/formats/date.mjs +2 -3
  5. package/dist/formats/object.cjs +2 -3
  6. package/dist/formats/object.d.cts +10 -14
  7. package/dist/formats/object.d.mts +10 -14
  8. package/dist/formats/object.mjs +2 -3
  9. package/dist/formats/plain-date-time.cjs +2 -3
  10. package/dist/formats/plain-date-time.d.cts +10 -14
  11. package/dist/formats/plain-date-time.d.mts +10 -14
  12. package/dist/formats/plain-date-time.mjs +2 -3
  13. package/dist/formats/plain-date.cjs +2 -3
  14. package/dist/formats/plain-date.d.cts +10 -14
  15. package/dist/formats/plain-date.d.mts +10 -14
  16. package/dist/formats/plain-date.mjs +2 -3
  17. package/dist/formats/plain-month-day.cjs +2 -3
  18. package/dist/formats/plain-month-day.d.cts +10 -14
  19. package/dist/formats/plain-month-day.d.mts +10 -14
  20. package/dist/formats/plain-month-day.mjs +2 -3
  21. package/dist/formats/plain-year-month.cjs +2 -3
  22. package/dist/formats/plain-year-month.d.cts +10 -14
  23. package/dist/formats/plain-year-month.d.mts +10 -14
  24. package/dist/formats/plain-year-month.mjs +2 -3
  25. package/dist/formats/zoned-date-time.cjs +2 -3
  26. package/dist/formats/zoned-date-time.d.cts +10 -14
  27. package/dist/formats/zoned-date-time.d.mts +10 -14
  28. package/dist/formats/zoned-date-time.mjs +2 -3
  29. package/dist/{index-DnFCKyyw.d.cts → index-BqzrxYgn.d.cts} +106 -116
  30. package/dist/{index-q3cQKJdA.d.mts → index-CkhYFmf4.d.mts} +106 -116
  31. package/dist/index.cjs +1 -1
  32. package/dist/index.d.cts +2 -2
  33. package/dist/index.d.mts +2 -2
  34. package/dist/index.mjs +1 -2
  35. package/dist/{weeks-navigation-Dn3UtG76.mjs → weeks-navigation-BWB5OvqW.mjs} +151 -188
  36. package/dist/{weeks-navigation-SuKJZJCM.cjs → weeks-navigation-CatYJIKb.cjs} +153 -191
  37. package/package.json +17 -18
  38. package/src/calendar-provider.test.tsx +1 -1
  39. package/src/compute-weeks-in-window.test.ts +1 -1
  40. package/src/day-cell-state.test.ts +1 -1
  41. package/src/day-cell.test.tsx +1 -1
  42. package/src/formats/formats.test.ts +1 -1
  43. package/src/grid.event-perf.test.tsx +7 -1
  44. package/src/grid.perf.test.tsx +7 -1
  45. package/src/grid.tsx +1 -1
  46. package/src/keyboard.test.ts +1 -1
  47. package/src/month-separator.test.tsx +1 -1
  48. package/src/month-view.bounds.test.tsx +1 -1
  49. package/src/month-view.test.tsx +89 -1
  50. package/src/month-view.tsx +14 -5
  51. package/src/month-window.test.ts +1 -1
  52. package/src/out-of-range.test.ts +34 -54
  53. package/src/out-of-range.ts +47 -123
  54. package/src/range-preview.test.ts +1 -1
  55. package/src/resolve-first-week.test.ts +1 -1
  56. package/src/today.test.tsx +8 -1
  57. package/src/utils.bench.ts +158 -106
  58. package/src/utils.test.ts +1 -1
  59. package/src/view-context.test.tsx +1 -1
  60. package/src/weeks-keyboard.test.ts +1 -1
  61. package/src/weeks-navigation.tsx +15 -6
  62. package/src/weeks-view-state.ts +21 -12
  63. package/src/weeks-view.bounds.test.tsx +246 -0
  64. package/src/weeks-view.test.tsx +1 -1
  65. package/src/weeks-window.test.ts +110 -22
  66. package/src/weeks-window.ts +57 -19
@@ -1,9 +1,5 @@
1
- import * as _$react_jsx_runtime0 from "react/jsx-runtime";
2
1
  import { useRender } from "@base-ui/react/use-render";
3
- import * as _$react from "react";
4
2
  import React$1 from "react";
5
-
6
- //#region ../node_modules/.pnpm/@js-temporal+polyfill@0.5.1/node_modules/@js-temporal/polyfill/index.d.ts
7
3
  declare namespace Temporal {
8
4
  export type ComparisonResult = -1 | 0 | 1;
9
5
  export type RoundingMode = 'ceil' | 'floor' | 'expand' | 'trunc' | 'halfCeil' | 'halfFloor' | 'halfExpand' | 'halfTrunc' | 'halfEven';
@@ -445,8 +441,10 @@ declare namespace Temporal {
445
441
  */
446
442
  export type TransitionDirection = 'next' | 'previous' | {
447
443
  direction: 'next' | 'previous';
448
- }; // Handle Intl.LocalesArgument regardless of whether the TS version has it yet
449
- type LocalesArgument = ConstructorParameters<typeof Intl$1.DateTimeFormat>[0]; // Provide a quick replacement for Intl.DurationFormatOptions if not in TS
444
+ };
445
+ // Handle Intl.LocalesArgument regardless of whether the TS version has it yet
446
+ type LocalesArgument = ConstructorParameters<typeof Intl$1.DateTimeFormat>[0];
447
+ // Provide a quick replacement for Intl.DurationFormatOptions if not in TS
450
448
  type DurationFormatOptions = typeof Intl$1 extends {
451
449
  DurationFormat: any;
452
450
  } ? ConstructorParameters<(typeof Intl$1)['DurationFormat']>[1] : Record<string, unknown>;
@@ -995,32 +993,30 @@ declare namespace Intl$1 {
995
993
  supportedLocalesOf(locales: string | string[], options?: globalThis.Intl.DateTimeFormatOptions): string[];
996
994
  };
997
995
  }
998
- //#endregion
999
- //#region src/context.d.ts
1000
996
  /** @internal Provides the days and index of the current week row to child components. */
1001
- declare const WeekDataContext: _$react.Context<{
997
+ declare const WeekDataContext: import("react").Context<{
1002
998
  days: Temporal.PlainDate[];
1003
- weekIndex: number; /** The year/month this week belongs to (for outsideMonth checks in multi-month). */
999
+ weekIndex: number;
1000
+ /** The year/month this week belongs to (for outsideMonth checks in multi-month). */
1004
1001
  gridMonth?: {
1005
1002
  year: number;
1006
1003
  month: number;
1007
- }; /** 1-based CSS grid row index for this week row (WeeksView only). */
1004
+ };
1005
+ /** 1-based CSS grid row index for this week row (WeeksView only). */
1008
1006
  gridRowIndex?: number;
1009
1007
  } | null>;
1010
1008
  /** Layout direction for the calendar grid. */
1011
1009
  type GridOrientation = "horizontal" | "vertical";
1012
1010
  /** @internal Provides the resolved grid orientation to descendant cells. */
1013
- declare const GridContext: _$react.Context<{
1011
+ declare const GridContext: import("react").Context<{
1014
1012
  orientation: GridOrientation;
1015
1013
  }>;
1016
1014
  /** @internal Provides the date and column index from a `DayCellTemplate` to its child `DayButton`. */
1017
- declare const DayCellDataContext: _$react.Context<{
1015
+ declare const DayCellDataContext: import("react").Context<{
1018
1016
  date: Temporal.PlainDate;
1019
1017
  columnIndex?: number | undefined;
1020
1018
  outsideDisabled?: boolean;
1021
1019
  } | null>;
1022
- //#endregion
1023
- //#region src/types.d.ts
1024
1020
  /** Day of the week represented as a number: `0` = Sunday through `6` = Saturday. */
1025
1021
  type WeekStartDay = 0 | 1 | 2 | 3 | 4 | 5 | 6;
1026
1022
  /**
@@ -1143,15 +1139,25 @@ interface MonthData {
1143
1139
  * use e.g. `selected?.toLocaleString(locale)` to display.
1144
1140
  */
1145
1141
  type RootState = {
1146
- /** `true` when at least one date is selected. */hasSelection: boolean; /** The primary selected date (the first committed date), or `undefined`. */
1147
- selected: Temporal.PlainDate | undefined; /** All currently selected dates (chronological in `multiple` mode). */
1148
- selectedDates: Temporal.PlainDate[]; /** Range start, or `undefined`. */
1149
- rangeStart: Temporal.PlainDate | undefined; /** Range end, or `undefined`. */
1150
- rangeEnd: Temporal.PlainDate | undefined; /** The currently focused `PlainDate` in the grid. */
1151
- focused: Temporal.PlainDate; /** The month/year currently being viewed. */
1152
- viewing: Temporal.PlainYearMonth; /** Resolved IANA time zone. */
1153
- timeZone: string; /** Resolved BCP 47 locale. */
1154
- locale: string; /** Whether the calendar is read-only. */
1142
+ /** `true` when at least one date is selected. */
1143
+ hasSelection: boolean;
1144
+ /** The primary selected date (the first committed date), or `undefined`. */
1145
+ selected: Temporal.PlainDate | undefined;
1146
+ /** All currently selected dates (chronological in `multiple` mode). */
1147
+ selectedDates: Temporal.PlainDate[];
1148
+ /** Range start, or `undefined`. */
1149
+ rangeStart: Temporal.PlainDate | undefined;
1150
+ /** Range end, or `undefined`. */
1151
+ rangeEnd: Temporal.PlainDate | undefined;
1152
+ /** The currently focused `PlainDate` in the grid. */
1153
+ focused: Temporal.PlainDate;
1154
+ /** The month/year currently being viewed. */
1155
+ viewing: Temporal.PlainYearMonth;
1156
+ /** Resolved IANA time zone. */
1157
+ timeZone: string;
1158
+ /** Resolved BCP 47 locale. */
1159
+ locale: string;
1160
+ /** Whether the calendar is read-only. */
1155
1161
  readOnly: boolean;
1156
1162
  };
1157
1163
  /**
@@ -1270,7 +1276,8 @@ type GridProps = useRender.ComponentProps<"table", GridState> & GridOwnProps;
1270
1276
  /** State exposed by the `WeekTemplate` component. */
1271
1277
  type WeekTemplateState = {
1272
1278
  root: RootState;
1273
- weekIndex: number; /** 1-based CSS grid row index for this week row (WeeksView only, undefined in MonthView). */
1279
+ weekIndex: number;
1280
+ /** 1-based CSS grid row index for this week row (WeeksView only, undefined in MonthView). */
1274
1281
  gridRowIndex: number | undefined;
1275
1282
  };
1276
1283
  /** Full props for the `WeekTemplate` component. */
@@ -1289,19 +1296,32 @@ type DayCellTemplateState = {
1289
1296
  focused: boolean;
1290
1297
  rangeStart: boolean;
1291
1298
  rangeEnd: boolean;
1292
- rangeBoundary: boolean; /** Whether this cell is within the committed range. */
1293
- inRange: boolean; /** 0-based index of this cell within the committed range, or `false` if not in range. */
1294
- rangeIndex: number | false; /** Total number of days in the committed range, or `false` if not in range. */
1295
- rangeLength: number | false; /** Whether the committed range has a defined start boundary. */
1296
- rangeHasStart: boolean; /** Whether the committed range has a defined end boundary. */
1297
- rangeHasEnd: boolean; /** Whether this cell is the start of the hover preview range. */
1298
- rangePreviewStart: boolean; /** Whether this cell is the end of the hover preview range. */
1299
- rangePreviewEnd: boolean; /** Whether this cell is a boundary of the hover preview range. */
1300
- rangePreviewBoundary: boolean; /** Whether this cell is within the hover preview range. */
1301
- rangePreviewInRange: boolean; /** 0-based index of this cell within the preview range, or `false` if not in preview range. */
1302
- rangePreviewIndex: number | false; /** Total number of days in the preview range, or `false` if not in preview range. */
1303
- rangePreviewLength: number | false; /** Whether the preview range has a defined start boundary. */
1304
- rangePreviewHasStart: boolean; /** Whether the preview range has a defined end boundary. */
1299
+ rangeBoundary: boolean;
1300
+ /** Whether this cell is within the committed range. */
1301
+ inRange: boolean;
1302
+ /** 0-based index of this cell within the committed range, or `false` if not in range. */
1303
+ rangeIndex: number | false;
1304
+ /** Total number of days in the committed range, or `false` if not in range. */
1305
+ rangeLength: number | false;
1306
+ /** Whether the committed range has a defined start boundary. */
1307
+ rangeHasStart: boolean;
1308
+ /** Whether the committed range has a defined end boundary. */
1309
+ rangeHasEnd: boolean;
1310
+ /** Whether this cell is the start of the hover preview range. */
1311
+ rangePreviewStart: boolean;
1312
+ /** Whether this cell is the end of the hover preview range. */
1313
+ rangePreviewEnd: boolean;
1314
+ /** Whether this cell is a boundary of the hover preview range. */
1315
+ rangePreviewBoundary: boolean;
1316
+ /** Whether this cell is within the hover preview range. */
1317
+ rangePreviewInRange: boolean;
1318
+ /** 0-based index of this cell within the preview range, or `false` if not in preview range. */
1319
+ rangePreviewIndex: number | false;
1320
+ /** Total number of days in the preview range, or `false` if not in preview range. */
1321
+ rangePreviewLength: number | false;
1322
+ /** Whether the preview range has a defined start boundary. */
1323
+ rangePreviewHasStart: boolean;
1324
+ /** Whether the preview range has a defined end boundary. */
1305
1325
  rangePreviewHasEnd: boolean;
1306
1326
  };
1307
1327
  /** State exposed by the `DayButton` component (same as `DayCellTemplateState`). */
@@ -1377,8 +1397,6 @@ type WeekNumberHeaderState = {
1377
1397
  };
1378
1398
  /** Full props for the `WeekNumberHeader` component. */
1379
1399
  type WeekNumberHeaderProps = useRender.ComponentProps<"th", WeekNumberHeaderState>;
1380
- //#endregion
1381
- //#region src/calendar-types.d.ts
1382
1400
  interface CalendarProviderPropsBase<F extends ValueFormat = ValueFormat> {
1383
1401
  /**
1384
1402
  * The value format used for date serialization. Determines the type of
@@ -1545,15 +1563,11 @@ interface CalendarStateContextValue {
1545
1563
  */
1546
1564
  baseRootState: BaseRootState;
1547
1565
  }
1548
- //#endregion
1549
- //#region src/calendar-provider.d.ts
1550
1566
  /**
1551
1567
  * Provides shared calendar state (selection, config, range preview) to all
1552
1568
  * descendant view components. Does NOT manage focus, navigation, or grid data.
1553
1569
  */
1554
- declare function CalendarProvider<F extends ValueFormat = "PlainDate">(props: CalendarProviderProps<F>): _$react_jsx_runtime0.JSX.Element;
1555
- //#endregion
1556
- //#region src/out-of-range.d.ts
1570
+ declare function CalendarProvider<F extends ValueFormat = "PlainDate">(props: CalendarProviderProps<F>): import("react").JSX.Element;
1557
1571
  /**
1558
1572
  * Controls how a {@link WeeksView} window behaves when navigation would move it
1559
1573
  * past the `min`/`max` bounds.
@@ -1565,7 +1579,8 @@ declare function CalendarProvider<F extends ValueFormat = "PlainDate">(props: Ca
1565
1579
  * - `"unbounded"` — Navigation is never restricted by `min`/`max`; any range of
1566
1580
  * weeks can be viewed. Out-of-range days simply render disabled. (Default.)
1567
1581
  * - `"stop"` — Navigation halts at the boundary: the Prev/Next button is
1568
- * disabled once the next step would show a window containing no in-range day.
1582
+ * disabled, and `goNext`/`goPrev`/`scrollToWeek` and keyboard paging do
1583
+ * nothing, once the next step would show a window containing no in-range day.
1569
1584
  * - `"stop-shrink"` — Like `"stop"`, but near the edge the window **shrinks** to
1570
1585
  * fewer week rows instead of showing rows that are entirely out of range.
1571
1586
  * - `"snap"` — A jump that would overshoot **snaps** the window so its edge
@@ -1573,6 +1588,8 @@ declare function CalendarProvider<F extends ValueFormat = "PlainDate">(props: Ca
1573
1588
  * - `"snap-shrink"` — Snap to the boundary, then **shrink** the window to just
1574
1589
  * the in-range weeks.
1575
1590
  *
1591
+ * A single bound (`min` only or `max` only) is honored; the missing side is unlimited.
1592
+ *
1576
1593
  * `"snap"` and `"snap-shrink"` are identical **unless the selectable range spans
1577
1594
  * fewer weeks than `weekCount`** — i.e. the window is taller than the range.
1578
1595
  * Snapping can only pin *one* edge to a bound; if the range is narrower than the
@@ -1602,8 +1619,6 @@ type OutOfRangeBehavior = "unbounded" | "stop" | "stop-shrink" | "snap" | "snap-
1602
1619
  * {@link OutOfRangeBehavior} offers for WeeksView's flexible window don't apply.
1603
1620
  */
1604
1621
  type MonthOutOfRangeBehavior = "unbounded" | "stop";
1605
- //#endregion
1606
- //#region src/month-window.d.ts
1607
1622
  /** An ISO year + month. */
1608
1623
  interface MonthRef {
1609
1624
  year: number;
@@ -1629,8 +1644,6 @@ interface MonthWindowPolicy {
1629
1644
  /** The window start that reveals `target` with the smallest shift. */
1630
1645
  reveal(start: MonthRef, target: MonthRef): MonthRef;
1631
1646
  }
1632
- //#endregion
1633
- //#region src/month-view-types.d.ts
1634
1647
  /** Props accepted by `MonthView.Root`. */
1635
1648
  interface MonthViewRootProps {
1636
1649
  /**
@@ -1720,16 +1733,12 @@ interface MonthViewStateContextValue {
1720
1733
  /** The root component's state object for render functions. */
1721
1734
  rootState: RootState;
1722
1735
  }
1723
- //#endregion
1724
- //#region src/month-view.d.ts
1725
- declare function MonthViewRoot(props: MonthViewRootProps): _$react_jsx_runtime0.JSX.Element;
1736
+ declare function MonthViewRoot(props: MonthViewRootProps): import("react").JSX.Element;
1726
1737
  type MonthViewProps<F extends ValueFormat = "PlainDate"> = CalendarProviderProps<F> & MonthViewRootProps;
1727
- declare function MonthView<F extends ValueFormat = "PlainDate">(props: MonthViewProps<F>): _$react_jsx_runtime0.JSX.Element;
1738
+ declare function MonthView<F extends ValueFormat = "PlainDate">(props: MonthViewProps<F>): import("react").JSX.Element;
1728
1739
  declare namespace MonthView {
1729
- var Root: typeof MonthViewRoot;
1740
+ export { MonthViewRoot as Root };
1730
1741
  }
1731
- //#endregion
1732
- //#region src/grid-header.d.ts
1733
1742
  /**
1734
1743
  * Renders weekday column headers (`<th>`). When no `index` is provided,
1735
1744
  * renders all 7 days (Sunday–Saturday). Each cell includes `abbr` and
@@ -1738,14 +1747,10 @@ declare namespace MonthView {
1738
1747
  declare const GridHeaderCell: (props: GridHeaderCellProps & React.RefAttributes<HTMLTableCellElement>) => React.ReactElement | null;
1739
1748
  /** Table header section (`<thead>`) wrapping a row of {@link GridHeaderCell}s. */
1740
1749
  declare const GridHeader: (props: GridHeaderProps & React.RefAttributes<HTMLTableSectionElement>) => React.ReactElement | null;
1741
- //#endregion
1742
- //#region src/day-cell-state.d.ts
1743
1750
  /** A day cell's state: the public {@link DayCellTemplateState} plus the roving-tabindex flag. */
1744
1751
  type DayCellState = DayCellTemplateState & {
1745
1752
  isTabTarget: boolean;
1746
1753
  };
1747
- //#endregion
1748
- //#region src/day-cell.d.ts
1749
1754
  /**
1750
1755
  * Renders one `<td role="gridcell">` per day. Exposes data-attributes for
1751
1756
  * `selected`, `today`, `disabled`, `outside-month`, `focused`,
@@ -1754,21 +1759,17 @@ type DayCellState = DayCellTemplateState & {
1754
1759
  * When used inside a {@link WeekTemplate}, iterates over that week's days.
1755
1760
  * An explicit `date` prop renders a single cell.
1756
1761
  */
1757
- declare function DayCellTemplate(props: DayCellTemplateProps): _$react_jsx_runtime0.JSX.Element;
1762
+ declare function DayCellTemplate(props: DayCellTemplateProps): import("react").JSX.Element;
1758
1763
  declare const DayButton: (props: DayButtonProps & {
1759
1764
  _derivedState?: DayCellState;
1760
1765
  } & React.RefAttributes<HTMLButtonElement>) => React.ReactElement | null;
1761
- //#endregion
1762
- //#region src/grid.d.ts
1763
1766
  declare const Grid: (props: GridProps & React.RefAttributes<HTMLTableElement>) => React.ReactElement | null;
1764
1767
  declare const GridBody: (props: GridBodyProps & React.RefAttributes<HTMLTableSectionElement>) => React.ReactElement | null;
1765
1768
  /**
1766
1769
  * Iterates over the weeks in the current month and renders one `<tr>` per week.
1767
1770
  * Each instance receives its week's days and index via {@link WeekDataContext}.
1768
1771
  */
1769
- declare function WeekTemplate(props: WeekTemplateProps): _$react_jsx_runtime0.JSX.Element;
1770
- //#endregion
1771
- //#region src/navigation.d.ts
1772
+ declare function WeekTemplate(props: WeekTemplateProps): import("react").JSX.Element;
1772
1773
  /**
1773
1774
  * Displays the currently selected (or current) date as localized text.
1774
1775
  * Renders a `<span>` with `aria-live="polite"`.
@@ -1803,8 +1804,6 @@ declare const PrevMonthButton: (props: PrevMonthButtonProps & React.RefAttribute
1803
1804
  * when the next month falls after `max`. Exposes `data-direction="next"`.
1804
1805
  */
1805
1806
  declare const NextMonthButton: (props: NextMonthButtonProps & React.RefAttributes<HTMLButtonElement>) => React.ReactElement | null;
1806
- //#endregion
1807
- //#region src/selected-range.d.ts
1808
1807
  /**
1809
1808
  * Visual overlay (`<td role="presentation">`) that highlights the selected
1810
1809
  * date range within a single week row. Exposes data-attributes for
@@ -1812,8 +1811,6 @@ declare const NextMonthButton: (props: NextMonthButtonProps & React.RefAttribute
1812
1811
  * `end-date`, `extends-before`, and `extends-after`.
1813
1812
  */
1814
1813
  declare const RangeSelected: (props: RangeSelectedProps & React.RefAttributes<HTMLTableCellElement>) => React.ReactElement | null;
1815
- //#endregion
1816
- //#region src/range-preview.d.ts
1817
1814
  /**
1818
1815
  * Visual overlay (`<td role="presentation">`) that highlights the hover
1819
1816
  * preview range within a single week row. Structurally identical to
@@ -1821,14 +1818,10 @@ declare const RangeSelected: (props: RangeSelectedProps & React.RefAttributes<HT
1821
1818
  * the committed range boundaries.
1822
1819
  */
1823
1820
  declare const RangePreview: (props: RangePreviewProps & React.RefAttributes<HTMLTableCellElement>) => React.ReactElement | null;
1824
- //#endregion
1825
- //#region src/drag-handle.d.ts
1826
1821
  /** Convenience wrapper for {@link RangeDragHandle} with `edge="start"`. */
1827
1822
  declare const RangeStartDragHandle: (props: RangeStartDragHandleProps & React.RefAttributes<HTMLSpanElement>) => React.ReactElement | null;
1828
1823
  /** Convenience wrapper for {@link RangeDragHandle} with `edge="end"`. */
1829
1824
  declare const RangeEndDragHandle: (props: RangeEndDragHandleProps & React.RefAttributes<HTMLSpanElement>) => React.ReactElement | null;
1830
- //#endregion
1831
- //#region src/week-number.d.ts
1832
1825
  /**
1833
1826
  * Renders the ISO 8601 week number for a week row. Must be used inside
1834
1827
  * a {@link WeekTemplate}. Renders a `<td>` with `role="rowheader"`.
@@ -1838,8 +1831,6 @@ declare const WeekNumberCell: (props: WeekNumberCellProps & React.RefAttributes<
1838
1831
  * Column header for the week number column. Renders a `<th scope="col">`.
1839
1832
  */
1840
1833
  declare const WeekNumberHeader: (props: WeekNumberHeaderProps & React.RefAttributes<HTMLTableCellElement>) => React.ReactElement | null;
1841
- //#endregion
1842
- //#region src/resolve-first-week.d.ts
1843
1834
  /**
1844
1835
  * A flexible specifier for a calendar week. Accepts a `Temporal.PlainDate`,
1845
1836
  * a native `Date`, an ISO week number, a week-of-year, or a month/day pair.
@@ -1880,8 +1871,6 @@ declare function resolveFirstWeekSpec(spec: FirstWeekSpec, weekStartDay: WeekSta
1880
1871
  declare function resolveFirstWeek(currentFirstWeek: Temporal.PlainDate, weekCount: number, target: Temporal.PlainDate, options?: {
1881
1872
  snap?: ScrollToWeekSnap;
1882
1873
  }): Temporal.PlainDate;
1883
- //#endregion
1884
- //#region src/compute-weeks-in-window.d.ts
1885
1874
  interface WeekDescriptor {
1886
1875
  startDate: Temporal.PlainDate;
1887
1876
  endDate: Temporal.PlainDate;
@@ -1894,23 +1883,30 @@ interface WeekDescriptor {
1894
1883
  * `firstWeek` is snapped back to the nearest `weekStartDay`.
1895
1884
  */
1896
1885
  declare function computeWeeksInWindow(firstWeek: Temporal.PlainDate, weekCount: number, weekStartDay: WeekStartDay, _T: TemporalNamespace): WeekDescriptor[];
1897
- //#endregion
1898
- //#region src/weeks-window.d.ts
1886
+ /** A window as shown: its first week and how many rows it has (≤ the prop). */
1887
+ interface EffectiveWindow {
1888
+ firstWeek: Temporal.PlainDate;
1889
+ weekCount: number;
1890
+ }
1899
1891
  /**
1900
1892
  * The rules for where a WeeksView window may sit. Built once from the bounds and
1901
1893
  * shared by every way of moving the window (buttons, keyboard, `scrollToWeek`).
1902
1894
  */
1903
1895
  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;
1896
+ /** The window that is shown for a requested first week. Never refuses. */
1897
+ resolve(requestedFirstWeek: Temporal.PlainDate): EffectiveWindow;
1898
+ /**
1899
+ * The window to move to for a requested first week, or `null` when the
1900
+ * behavior forbids the move (`stop`/`stop-shrink` with no in-range day in it).
1901
+ */
1902
+ moveTo(requestedFirstWeek: Temporal.PlainDate): EffectiveWindow | null;
1903
+ /**
1904
+ * Moves by `shiftBy` weeks (default: the rows currently shown) from the
1905
+ * window as shown. `null` when the move is forbidden or would not change
1906
+ * the window (`snap` already at the edge).
1907
+ */
1908
+ shift(current: EffectiveWindow, direction: 1 | -1, shiftBy?: number): EffectiveWindow | null;
1911
1909
  }
1912
- //#endregion
1913
- //#region src/weeks-view-types.d.ts
1914
1910
  /** Props accepted by `WeeksView.Root`. */
1915
1911
  interface WeeksViewRootProps {
1916
1912
  /** Number of week rows to display simultaneously. */
@@ -2009,8 +2005,6 @@ interface WeeksViewStateContextValue {
2009
2005
  /** Render-prop `RootState` exposed to components inside WeeksView. */
2010
2006
  rootState: RootState;
2011
2007
  }
2012
- //#endregion
2013
- //#region src/weeks-view.d.ts
2014
2008
  /** Imperative handle exposed by WeeksView.Root via ref. */
2015
2009
  interface WeeksViewRootHandle {
2016
2010
  scrollToWeek: (target: FirstWeekSpec, options?: {
@@ -2023,8 +2017,6 @@ declare const WeeksView: WeeksViewComponent;
2023
2017
  interface WeeksViewComponent extends React$1.ForwardRefExoticComponent<WeeksViewProps & React$1.RefAttributes<WeeksViewRootHandle>> {
2024
2018
  Root: typeof WeeksViewRoot;
2025
2019
  }
2026
- //#endregion
2027
- //#region src/weeks-navigation.d.ts
2028
2020
  /** State exposed by `PrevWeeksButton` and `NextWeeksButton`. */
2029
2021
  type WeeksNavButtonState = {
2030
2022
  root: RootState;
@@ -2064,33 +2056,42 @@ declare const NextWeeksButton: React$1.ForwardRefExoticComponent<Omit<NextWeeksB
2064
2056
  * out-of-range modes where the actual count may be less than the `weekCount` prop.
2065
2057
  */
2066
2058
  declare const WeekCount: React$1.ForwardRefExoticComponent<Omit<WeekCountProps, "ref"> & React$1.RefAttributes<HTMLSpanElement>>;
2067
- //#endregion
2068
- //#region src/month-separator.d.ts
2069
2059
  /** State exposed by the MonthSeparator component and its children. */
2070
2060
  type MonthSeparatorState = {
2071
- /** Calendar month (1-12). */month: number; /** Calendar year. */
2072
- year: number; /** True when this is the first month of a new year in the visible window. */
2073
- firstOfYear: boolean; /** True for the separator at the top of the visible window. */
2074
- firstVisible: boolean; /** Number of weeks of the previous month visible above this separator. */
2075
- weeksVisibleBefore: number; /** Number of weeks of this month visible below this separator. */
2061
+ /** Calendar month (1-12). */
2062
+ month: number;
2063
+ /** Calendar year. */
2064
+ year: number;
2065
+ /** True when this is the first month of a new year in the visible window. */
2066
+ firstOfYear: boolean;
2067
+ /** True for the separator at the top of the visible window. */
2068
+ firstVisible: boolean;
2069
+ /** Number of weeks of the previous month visible above this separator. */
2070
+ weeksVisibleBefore: number;
2071
+ /** Number of weeks of this month visible below this separator. */
2076
2072
  weeksVisibleAfter: number;
2077
2073
  /**
2078
2074
  * 0-based column index where the 1st of the month falls within the week row.
2079
2075
  * Accounts for week number column if present (column 0 = week number).
2080
2076
  */
2081
- firstDayColumn: number; /** Total number of columns (7 days + optional week number column). */
2082
- totalColumns: number; /** True when the 1st day of this month is visible in the weeks below. */
2077
+ firstDayColumn: number;
2078
+ /** Total number of columns (7 days + optional week number column). */
2079
+ totalColumns: number;
2080
+ /** True when the 1st day of this month is visible in the weeks below. */
2083
2081
  firstDayVisible: boolean;
2084
2082
  /**
2085
2083
  * Number of week rows between this separator and the next separator
2086
2084
  * (or end of window). Use this for CSS grid `gridRow: span N` to
2087
2085
  * avoid overlapping the next month's label.
2088
2086
  */
2089
- fullWeeksVisibleAfter: number; /** 1-based grid row index where this separator's weeks start. */
2087
+ fullWeeksVisibleAfter: number;
2088
+ /** 1-based grid row index where this separator's weeks start. */
2090
2089
  gridRowStart: number;
2091
2090
  };
2092
2091
  type MonthChildProps = useRender.ComponentProps<"span", MonthSeparatorState> & {
2093
- /** BCP 47 locale(s) for month name formatting. @default "en-US" */locale?: string; /** Month name format. @default "long" */
2092
+ /** BCP 47 locale(s) for month name formatting. @default "en-US" */
2093
+ locale?: string;
2094
+ /** Month name format. @default "long" */
2094
2095
  format?: "long" | "short" | "narrow";
2095
2096
  };
2096
2097
  declare const MonthSeparatorMonth: React$1.ForwardRefExoticComponent<Omit<MonthChildProps, "ref"> & React$1.RefAttributes<HTMLSpanElement>>;
@@ -2111,8 +2112,6 @@ type MonthSeparatorProps = useRender.ComponentProps<"tr", MonthSeparatorState>;
2111
2112
  * Default children: `<Month /> <Year />`.
2112
2113
  */
2113
2114
  declare const MonthSeparator: React$1.ForwardRefExoticComponent<Omit<MonthSeparatorProps, "ref"> & React$1.RefAttributes<HTMLTableRowElement>>;
2114
- //#endregion
2115
- //#region src/root-selection.d.ts
2116
2115
  /**
2117
2116
  * Pure utility that computes the preview range for a hovered date, using the
2118
2117
  * same logic as the built-in hover preview. Useful for deriving the preview in
@@ -2125,20 +2124,14 @@ declare function computePreviewRange(hoveredDate: Temporal.PlainDate, currentRan
2125
2124
  isDateDisabled?: (date: Temporal.PlainDate) => boolean;
2126
2125
  readOnly?: boolean;
2127
2126
  }): DateRange<"PlainDate"> | null;
2128
- //#endregion
2129
- //#region src/calendar-context.d.ts
2130
2127
  /** Returns the stable (callbacks/config) part of CalendarProvider context. */
2131
2128
  declare function useCalendarStable(): CalendarStableContextValue;
2132
2129
  /** Returns the volatile state part of CalendarProvider context. */
2133
2130
  declare function useCalendarState(): CalendarStateContextValue;
2134
- //#endregion
2135
- //#region src/month-view-context.d.ts
2136
2131
  /** Returns the MonthView stable context (config + callbacks). */
2137
2132
  declare function useMonthViewStable(): MonthViewStableContextValue;
2138
2133
  /** Returns the MonthView state context (volatile grid data). */
2139
2134
  declare function useMonthViewState(): MonthViewStateContextValue;
2140
- //#endregion
2141
- //#region src/view-context.d.ts
2142
2135
  /** Shared context provided by both MonthView.Root and WeeksView.Root. */
2143
2136
  interface ViewContextValue {
2144
2137
  /** Which view type is active. */
@@ -2156,11 +2149,8 @@ interface ViewContextValue {
2156
2149
  }
2157
2150
  /** Returns the nearest view context (MonthView or WeeksView). */
2158
2151
  declare function useViewContext(): ViewContextValue;
2159
- //#endregion
2160
- //#region src/weeks-view-context.d.ts
2161
2152
  /** Returns the WeeksView stable context (config + callbacks). */
2162
2153
  declare function useWeeksViewStable(): WeeksViewStableContextValue;
2163
2154
  /** Returns the WeeksView state context (volatile grid data). */
2164
2155
  declare function useWeeksViewState(): WeeksViewStateContextValue;
2165
- //#endregion
2166
2156
  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 };