forty-cdk 0.34.0 → 0.35.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.
Files changed (206) hide show
  1. package/README.md +4 -3
  2. package/calendar/README.md +2 -2
  3. package/carousel/README.md +11 -6
  4. package/checkbox/README.md +17 -2
  5. package/fesm2022/forty-cdk-accordion.mjs +502 -378
  6. package/fesm2022/forty-cdk-accordion.mjs.map +1 -1
  7. package/fesm2022/forty-cdk-aspect-ratio.mjs +61 -69
  8. package/fesm2022/forty-cdk-aspect-ratio.mjs.map +1 -1
  9. package/fesm2022/forty-cdk-avatar.mjs +314 -350
  10. package/fesm2022/forty-cdk-avatar.mjs.map +1 -1
  11. package/fesm2022/forty-cdk-breadcrumbs.mjs +152 -119
  12. package/fesm2022/forty-cdk-breadcrumbs.mjs.map +1 -1
  13. package/fesm2022/forty-cdk-breakpoints.mjs +44 -80
  14. package/fesm2022/forty-cdk-breakpoints.mjs.map +1 -1
  15. package/fesm2022/forty-cdk-button.mjs +235 -337
  16. package/fesm2022/forty-cdk-button.mjs.map +1 -1
  17. package/fesm2022/forty-cdk-calendar.mjs +2087 -1950
  18. package/fesm2022/forty-cdk-calendar.mjs.map +1 -1
  19. package/fesm2022/forty-cdk-carousel.mjs +1246 -1031
  20. package/fesm2022/forty-cdk-carousel.mjs.map +1 -1
  21. package/fesm2022/forty-cdk-checkbox.mjs +233 -241
  22. package/fesm2022/forty-cdk-checkbox.mjs.map +1 -1
  23. package/fesm2022/forty-cdk-combobox.mjs +2862 -3190
  24. package/fesm2022/forty-cdk-combobox.mjs.map +1 -1
  25. package/fesm2022/forty-cdk-context-menu.mjs +532 -530
  26. package/fesm2022/forty-cdk-context-menu.mjs.map +1 -1
  27. package/fesm2022/forty-cdk-core-overlay.mjs +3307 -5194
  28. package/fesm2022/forty-cdk-core-overlay.mjs.map +1 -1
  29. package/fesm2022/forty-cdk-core.mjs +4453 -8427
  30. package/fesm2022/forty-cdk-core.mjs.map +1 -1
  31. package/fesm2022/forty-cdk-date-adapter.mjs +129 -175
  32. package/fesm2022/forty-cdk-date-adapter.mjs.map +1 -1
  33. package/fesm2022/forty-cdk-date-field.mjs +1114 -1086
  34. package/fesm2022/forty-cdk-date-field.mjs.map +1 -1
  35. package/fesm2022/forty-cdk-date-picker.mjs +1390 -1548
  36. package/fesm2022/forty-cdk-date-picker.mjs.map +1 -1
  37. package/fesm2022/forty-cdk-defaults.mjs +537 -1359
  38. package/fesm2022/forty-cdk-defaults.mjs.map +1 -1
  39. package/fesm2022/forty-cdk-dialog.mjs +901 -694
  40. package/fesm2022/forty-cdk-dialog.mjs.map +1 -1
  41. package/fesm2022/forty-cdk-disclosure.mjs +254 -182
  42. package/fesm2022/forty-cdk-disclosure.mjs.map +1 -1
  43. package/fesm2022/forty-cdk-drag-drop.mjs +1776 -1768
  44. package/fesm2022/forty-cdk-drag-drop.mjs.map +1 -1
  45. package/fesm2022/forty-cdk-drawer.mjs +1835 -2105
  46. package/fesm2022/forty-cdk-drawer.mjs.map +1 -1
  47. package/fesm2022/forty-cdk-dropdown-menu.mjs +451 -375
  48. package/fesm2022/forty-cdk-dropdown-menu.mjs.map +1 -1
  49. package/fesm2022/forty-cdk-field.mjs +563 -669
  50. package/fesm2022/forty-cdk-field.mjs.map +1 -1
  51. package/fesm2022/forty-cdk-fieldset.mjs +162 -203
  52. package/fesm2022/forty-cdk-fieldset.mjs.map +1 -1
  53. package/fesm2022/forty-cdk-file-upload.mjs +383 -316
  54. package/fesm2022/forty-cdk-file-upload.mjs.map +1 -1
  55. package/fesm2022/forty-cdk-hover-card.mjs +600 -612
  56. package/fesm2022/forty-cdk-hover-card.mjs.map +1 -1
  57. package/fesm2022/forty-cdk-input.mjs +230 -277
  58. package/fesm2022/forty-cdk-input.mjs.map +1 -1
  59. package/fesm2022/forty-cdk-internationalized-date.mjs +183 -247
  60. package/fesm2022/forty-cdk-internationalized-date.mjs.map +1 -1
  61. package/fesm2022/forty-cdk-listbox.mjs +1486 -1586
  62. package/fesm2022/forty-cdk-listbox.mjs.map +1 -1
  63. package/fesm2022/forty-cdk-menu.mjs +1924 -1744
  64. package/fesm2022/forty-cdk-menu.mjs.map +1 -1
  65. package/fesm2022/forty-cdk-menubar.mjs +789 -910
  66. package/fesm2022/forty-cdk-menubar.mjs.map +1 -1
  67. package/fesm2022/forty-cdk-meter.mjs +312 -210
  68. package/fesm2022/forty-cdk-meter.mjs.map +1 -1
  69. package/fesm2022/forty-cdk-navigation-menu.mjs +1231 -1325
  70. package/fesm2022/forty-cdk-navigation-menu.mjs.map +1 -1
  71. package/fesm2022/forty-cdk-number-input.mjs +694 -843
  72. package/fesm2022/forty-cdk-number-input.mjs.map +1 -1
  73. package/fesm2022/forty-cdk-otp-input.mjs +554 -561
  74. package/fesm2022/forty-cdk-otp-input.mjs.map +1 -1
  75. package/fesm2022/forty-cdk-pagination.mjs +493 -362
  76. package/fesm2022/forty-cdk-pagination.mjs.map +1 -1
  77. package/fesm2022/forty-cdk-pane-resizer.mjs +470 -416
  78. package/fesm2022/forty-cdk-pane-resizer.mjs.map +1 -1
  79. package/fesm2022/forty-cdk-popover.mjs +846 -720
  80. package/fesm2022/forty-cdk-popover.mjs.map +1 -1
  81. package/fesm2022/forty-cdk-progress.mjs +265 -223
  82. package/fesm2022/forty-cdk-progress.mjs.map +1 -1
  83. package/fesm2022/forty-cdk-radio-group.mjs +468 -431
  84. package/fesm2022/forty-cdk-radio-group.mjs.map +1 -1
  85. package/fesm2022/forty-cdk-scroll-area.mjs +860 -934
  86. package/fesm2022/forty-cdk-scroll-area.mjs.map +1 -1
  87. package/fesm2022/forty-cdk-search.mjs +281 -328
  88. package/fesm2022/forty-cdk-search.mjs.map +1 -1
  89. package/fesm2022/forty-cdk-select.mjs +1872 -1874
  90. package/fesm2022/forty-cdk-select.mjs.map +1 -1
  91. package/fesm2022/forty-cdk-separator.mjs +92 -67
  92. package/fesm2022/forty-cdk-separator.mjs.map +1 -1
  93. package/fesm2022/forty-cdk-shared.mjs +4 -8
  94. package/fesm2022/forty-cdk-slider.mjs +881 -877
  95. package/fesm2022/forty-cdk-slider.mjs.map +1 -1
  96. package/fesm2022/forty-cdk-stepper.mjs +1160 -919
  97. package/fesm2022/forty-cdk-stepper.mjs.map +1 -1
  98. package/fesm2022/forty-cdk-switch.mjs +140 -146
  99. package/fesm2022/forty-cdk-switch.mjs.map +1 -1
  100. package/fesm2022/forty-cdk-table-virtualization.mjs +258 -375
  101. package/fesm2022/forty-cdk-table-virtualization.mjs.map +1 -1
  102. package/fesm2022/forty-cdk-table.mjs +4718 -4851
  103. package/fesm2022/forty-cdk-table.mjs.map +1 -1
  104. package/fesm2022/forty-cdk-tabs.mjs +566 -403
  105. package/fesm2022/forty-cdk-tabs.mjs.map +1 -1
  106. package/fesm2022/forty-cdk-testing.mjs +233 -385
  107. package/fesm2022/forty-cdk-testing.mjs.map +1 -1
  108. package/fesm2022/forty-cdk-time-field.mjs +1148 -1143
  109. package/fesm2022/forty-cdk-time-field.mjs.map +1 -1
  110. package/fesm2022/forty-cdk-time-picker.mjs +1303 -1190
  111. package/fesm2022/forty-cdk-time-picker.mjs.map +1 -1
  112. package/fesm2022/forty-cdk-toast.mjs +1473 -1562
  113. package/fesm2022/forty-cdk-toast.mjs.map +1 -1
  114. package/fesm2022/forty-cdk-toggle.mjs +555 -536
  115. package/fesm2022/forty-cdk-toggle.mjs.map +1 -1
  116. package/fesm2022/forty-cdk-toolbar.mjs +503 -388
  117. package/fesm2022/forty-cdk-toolbar.mjs.map +1 -1
  118. package/fesm2022/forty-cdk-tooltip.mjs +602 -600
  119. package/fesm2022/forty-cdk-tooltip.mjs.map +1 -1
  120. package/fesm2022/forty-cdk-tree.mjs +2427 -2644
  121. package/fesm2022/forty-cdk-tree.mjs.map +1 -1
  122. package/fesm2022/forty-cdk-virtual-reorder.mjs +399 -487
  123. package/fesm2022/forty-cdk-virtual-reorder.mjs.map +1 -1
  124. package/fesm2022/forty-cdk-virtualization.mjs +552 -603
  125. package/fesm2022/forty-cdk-virtualization.mjs.map +1 -1
  126. package/fesm2022/forty-cdk-visually-hidden.mjs +1 -6
  127. package/fesm2022/forty-cdk.mjs +0 -4
  128. package/input/README.md +1 -1
  129. package/navigation-menu/README.md +19 -9
  130. package/number-input/README.md +1 -1
  131. package/package.json +7 -6
  132. package/separator/README.md +4 -4
  133. package/shared/README.md +80 -1
  134. package/slider/README.md +19 -12
  135. package/table/README.md +22 -20
  136. package/table-virtualization/README.md +29 -7
  137. package/toast/README.md +2 -1
  138. package/toolbar/README.md +4 -4
  139. package/tree/README.md +44 -23
  140. package/types/forty-cdk-accordion.d.ts +210 -167
  141. package/types/forty-cdk-aspect-ratio.d.ts +23 -20
  142. package/types/forty-cdk-avatar.d.ts +73 -58
  143. package/types/forty-cdk-breadcrumbs.d.ts +43 -35
  144. package/types/forty-cdk-breakpoints.d.ts +42 -47
  145. package/types/forty-cdk-button.d.ts +47 -42
  146. package/types/forty-cdk-calendar.d.ts +712 -590
  147. package/types/forty-cdk-carousel.d.ts +497 -392
  148. package/types/forty-cdk-checkbox.d.ts +55 -46
  149. package/types/forty-cdk-combobox.d.ts +1254 -1059
  150. package/types/forty-cdk-context-menu.d.ts +322 -258
  151. package/types/forty-cdk-core-overlay.d.ts +2758 -2429
  152. package/types/forty-cdk-core.d.ts +2974 -2732
  153. package/types/forty-cdk-date-adapter.d.ts +195 -200
  154. package/types/forty-cdk-date-field.d.ts +472 -335
  155. package/types/forty-cdk-date-picker.d.ts +617 -475
  156. package/types/forty-cdk-defaults.d.ts +1495 -1251
  157. package/types/forty-cdk-dialog.d.ts +367 -338
  158. package/types/forty-cdk-disclosure.d.ts +78 -61
  159. package/types/forty-cdk-drag-drop.d.ts +570 -483
  160. package/types/forty-cdk-drawer.d.ts +711 -633
  161. package/types/forty-cdk-dropdown-menu.d.ts +236 -177
  162. package/types/forty-cdk-field.d.ts +194 -178
  163. package/types/forty-cdk-fieldset.d.ts +84 -83
  164. package/types/forty-cdk-file-upload.d.ts +152 -126
  165. package/types/forty-cdk-hover-card.d.ts +245 -210
  166. package/types/forty-cdk-input.d.ts +36 -36
  167. package/types/forty-cdk-internationalized-date.d.ts +81 -85
  168. package/types/forty-cdk-listbox.d.ts +570 -485
  169. package/types/forty-cdk-menu.d.ts +673 -543
  170. package/types/forty-cdk-menubar.d.ts +529 -462
  171. package/types/forty-cdk-meter.d.ts +130 -88
  172. package/types/forty-cdk-navigation-menu.d.ts +453 -379
  173. package/types/forty-cdk-number-input.d.ts +243 -199
  174. package/types/forty-cdk-otp-input.d.ts +194 -129
  175. package/types/forty-cdk-pagination.d.ts +239 -168
  176. package/types/forty-cdk-pane-resizer.d.ts +195 -133
  177. package/types/forty-cdk-popover.d.ts +381 -327
  178. package/types/forty-cdk-progress.d.ts +114 -87
  179. package/types/forty-cdk-radio-group.d.ts +189 -135
  180. package/types/forty-cdk-scroll-area.d.ts +329 -297
  181. package/types/forty-cdk-search.d.ts +103 -99
  182. package/types/forty-cdk-select.d.ts +874 -716
  183. package/types/forty-cdk-separator.d.ts +30 -22
  184. package/types/forty-cdk-shared.d.ts +4 -3
  185. package/types/forty-cdk-slider.d.ts +335 -278
  186. package/types/forty-cdk-stepper.d.ts +588 -505
  187. package/types/forty-cdk-switch.d.ts +26 -22
  188. package/types/forty-cdk-table-virtualization.d.ts +88 -70
  189. package/types/forty-cdk-table.d.ts +1970 -1356
  190. package/types/forty-cdk-tabs.d.ts +245 -191
  191. package/types/forty-cdk-testing.d.ts +38 -46
  192. package/types/forty-cdk-time-field.d.ts +508 -366
  193. package/types/forty-cdk-time-picker.d.ts +552 -432
  194. package/types/forty-cdk-toast.d.ts +643 -479
  195. package/types/forty-cdk-toggle.d.ts +212 -167
  196. package/types/forty-cdk-toolbar.d.ts +188 -142
  197. package/types/forty-cdk-tooltip.d.ts +301 -257
  198. package/types/forty-cdk-tree.d.ts +797 -650
  199. package/types/forty-cdk-virtual-reorder.d.ts +36 -27
  200. package/types/forty-cdk-virtualization.d.ts +295 -218
  201. package/types/forty-cdk-visually-hidden.d.ts +2 -1
  202. package/types/forty-cdk.d.ts +1 -2
  203. package/virtualization/README.md +20 -11
  204. package/fesm2022/forty-cdk-shared.mjs.map +0 -1
  205. package/fesm2022/forty-cdk-visually-hidden.mjs.map +0 -1
  206. package/fesm2022/forty-cdk.mjs.map +0 -1
@@ -1,6 +1,5 @@
1
- import * as i0 from '@angular/core';
2
- import { InjectionToken, Provider } from '@angular/core';
3
-
1
+ import * as i0 from "@angular/core";
2
+ import { InjectionToken, Provider } from "@angular/core";
4
3
  /**
5
4
  * Pluggable, date-library-agnostic seam for `ForCalendar`. Every internal
6
5
  * algorithm (paging, the day matrix, comparison, formatting) goes through a
@@ -33,157 +32,157 @@ import { InjectionToken, Provider } from '@angular/core';
33
32
  * @typeParam D The immutable date representation the adapter operates on.
34
33
  */
35
34
  interface DateAdapter<D> {
36
- /**
37
- * Today's date in the runtime time zone.
38
- *
39
- * **SSR / hydration caveat.** The result depends on the runtime time zone, so
40
- * a server render and a client hydration can disagree by up to a day near
41
- * midnight — the server may compute a different calendar day than the
42
- * browser. `ForCalendar` reads this on each render to mark the `data-today` /
43
- * `aria-current="date"` cell, so a mismatch surfaces there as a hydration
44
- * error and a flicker on the highlighted "today" cell.
45
- *
46
- * **SSR-safe pattern.** Have the consumer supply a fixed "today" (or pin a
47
- * time zone) for the server render, or defer the today-highlight to
48
- * `afterNextRender` so `today()` is only computed client-side. See the
49
- * calendar README's "SSR / hydration" section.
50
- */
51
- today(): D;
52
- /**
53
- * Creates a date from its parts.
54
- *
55
- * @param year Full year (e.g. `2026`).
56
- * @param month Month of year, **1-12**.
57
- * @param day Day of month, **1-31** (constrained to the month's length).
58
- */
59
- createDate(year: number, month: number, day: number): D;
60
- /** The full year of `date` (e.g. `2026`). */
61
- getYear(date: D): number;
62
- /** The month of `date`, **1-12**. */
63
- getMonth(date: D): number;
64
- /** The day of month of `date`, **1-31**. */
65
- getDate(date: D): number;
66
- /** The day of week of `date`, **0-6** where `0` is Sunday and `6` is Saturday. */
67
- getDayOfWeek(date: D): number;
68
- /** The number of days in `date`'s month. */
69
- getDaysInMonth(date: D): number;
70
- /**
71
- * The first day of the week as a **0-6** index (`0` = Sunday). Used as the
72
- * default when `ForCalendar`'s `firstDayOfWeek` input is `null`. Adapters
73
- * return a locale-independent default (`0`); consumers localise it through
74
- * the `firstDayOfWeek` input or `provideForCalendarDefaults`.
75
- */
76
- getFirstDayOfWeek(): number;
77
- /** Returns a new date `n` days after `date` (negative goes backwards). */
78
- addDays(date: D, n: number): D;
79
- /**
80
- * Returns a new date `n` months after `date` (negative goes backwards). The
81
- * day of month is constrained to the target month's length (e.g. Jan 31 + 1
82
- * month is Feb 28/29, never Mar 3).
83
- */
84
- addMonths(date: D, n: number): D;
85
- /**
86
- * Returns a new date `n` years after `date` (negative goes backwards). The
87
- * day of month is constrained (e.g. Feb 29 + 1 year is Feb 28 in a common
88
- * year).
89
- */
90
- addYears(date: D, n: number): D;
91
- /**
92
- * Compares two dates by their natural ordering — **the full instant**,
93
- * including any time component the adapter's `D` carries. Returns a negative
94
- * number when `a` is before `b`, `0` when they are equal, and a positive
95
- * number when `a` is after `b`.
96
- *
97
- * This is the canonical comparator and the only one an adapter must
98
- * implement. Time-capable adapters (`Date`, `@internationalized/date`'s
99
- * `CalendarDateTime`) order by day *and* time; day-only adapters
100
- * (`CalendarDate`) order by day alone because that is all their `D` carries.
101
- *
102
- * **Bounds granularity.** `minDate` / `maxDate` clamping in the date
103
- * primitives compares the full instant through `compare`, so a date-time
104
- * `min`/`max` clamps identically on every time-capable adapter (e.g. native
105
- * `Date` and `CalendarDateTime` produce the same result for the same input).
106
- * For the *calendar grid*, where availability is day-granular so the boundary
107
- * day of a date-time `min`/`max` stays selectable, the primitives compare
108
- * calendar days instead, through {@link compareDate} when present and
109
- * otherwise from the y/m/d getters.
110
- */
111
- compare(a: D, b: D): number;
112
- /**
113
- * Optionally compares two dates by calendar day only, ignoring any time
114
- * component. Returns a negative number when `a`'s day is before `b`'s, `0`
115
- * when they fall on the same calendar day, and a positive number when `a`'s
116
- * day is after `b`'s.
117
- *
118
- * Adapters may **omit** this method: the primitives then derive the
119
- * day-only comparison from the {@link getYear} / {@link getMonth} /
120
- * {@link getDate} getters, which is correct for any adapter. Implement it only
121
- * to override that default (e.g. a bespoke day-granular ordering). This
122
- * overrides day-only *ordering* only — it does not change the Gregorian month
123
- * structure the grid assumes (see the *Calendar system* note on the interface).
124
- * Day-only adapters whose {@link compare} already ignores time need not
125
- * implement it.
126
- */
127
- compareDate?(a: D, b: D): number;
128
- /** Whether `a` and `b` fall on the same calendar day. */
129
- isSameDay(a: D, b: D): boolean;
130
- /** Whether `date` is a valid date of this adapter's type. */
131
- isValid(date: D): boolean;
132
- /**
133
- * The locale this adapter formats in, or `null` for the runtime default. A
134
- * segmented date / time field with no `[locale]` of its own takes its segment
135
- * order, separators, hour cycle and AM/PM names from it, so they match what
136
- * {@link format} produces. Reading a signal here makes every field and
137
- * formatted value follow a runtime language switch.
138
- */
139
- locale?(): string | null;
140
- /**
141
- * Formats `date` for display. When `locale` is omitted the adapter's own
142
- * {@link locale} is used, else the runtime's default locale; pass one to
143
- * force a specific locale for month / weekday / day-period names.
144
- *
145
- * **SSR / hydration caveat.** With no `locale` the result resolves against the
146
- * runtime's default locale, so a server render and a client hydration can
147
- * produce different strings when the server and browser locales differ —
148
- * surfacing as a hydration mismatch on every formatted value (heading, weekday
149
- * headers, cell labels). The runtime time zone applies too for adapters that
150
- * format through a wall-clock instant.
151
- *
152
- * **SSR-safe pattern.** Pin a `locale` (or format client-side) for the server
153
- * render so both environments resolve the same locale. See the calendar
154
- * README's "SSR / hydration" section.
155
- *
156
- * @param options Standard `Intl.DateTimeFormat` options (e.g.
157
- * `{ month: 'long', year: 'numeric' }` for a calendar heading,
158
- * `{ weekday: 'short' }` for a column header).
159
- * @param locale Optional BCP 47 locale tag governing the formatted names;
160
- * falls back to {@link locale}, then the runtime's default locale, when
161
- * omitted.
162
- */
163
- format(date: D, options: Intl.DateTimeFormatOptions, locale?: string): string;
164
- /**
165
- * Whether this adapter's `D` can carry a wall-clock time component (hour /
166
- * minute / second). Day-only adapters omit the optional time accessors below
167
- * and return `false` (or omit this method); time-capable adapters implement
168
- * them and return `true`. `ForTimeField` — and the time granularity of the
169
- * date primitives — require a time-capable adapter.
170
- */
171
- supportsTime?(): boolean;
172
- /** The hour of `date`, **0-23** (24-hour clock). Time-capable adapters only. */
173
- getHours?(date: D): number;
174
- /** The minute of `date`, **0-59**. Time-capable adapters only. */
175
- getMinutes?(date: D): number;
176
- /** The second of `date`, **0-59**. Time-capable adapters only. */
177
- getSeconds?(date: D): number;
178
- /**
179
- * Returns a new date with its time set to the given parts, preserving the
180
- * calendar day. Time-capable adapters only.
181
- *
182
- * @param hours Hour of day, **0-23**.
183
- * @param minutes Minute of hour, **0-59**.
184
- * @param seconds Second of minute, **0-59**.
185
- */
186
- setTime?(date: D, hours: number, minutes: number, seconds: number): D;
35
+ /**
36
+ * Today's date in the runtime time zone.
37
+ *
38
+ * **SSR / hydration caveat.** The result depends on the runtime time zone, so
39
+ * a server render and a client hydration can disagree by up to a day near
40
+ * midnight — the server may compute a different calendar day than the
41
+ * browser. `ForCalendar` reads this on each render to mark the `data-today` /
42
+ * `aria-current="date"` cell, so a mismatch surfaces there as a hydration
43
+ * error and a flicker on the highlighted "today" cell.
44
+ *
45
+ * **SSR-safe pattern.** Have the consumer supply a fixed "today" (or pin a
46
+ * time zone) for the server render, or defer the today-highlight to
47
+ * `afterNextRender` so `today()` is only computed client-side. See the
48
+ * calendar README's "SSR / hydration" section.
49
+ */
50
+ today(): D;
51
+ /**
52
+ * Creates a date from its parts.
53
+ *
54
+ * @param year Full year (e.g. `2026`).
55
+ * @param month Month of year, **1-12**.
56
+ * @param day Day of month, **1-31** (constrained to the month's length).
57
+ */
58
+ createDate(year: number, month: number, day: number): D;
59
+ /** The full year of `date` (e.g. `2026`). */
60
+ getYear(date: D): number;
61
+ /** The month of `date`, **1-12**. */
62
+ getMonth(date: D): number;
63
+ /** The day of month of `date`, **1-31**. */
64
+ getDate(date: D): number;
65
+ /** The day of week of `date`, **0-6** where `0` is Sunday and `6` is Saturday. */
66
+ getDayOfWeek(date: D): number;
67
+ /** The number of days in `date`'s month. */
68
+ getDaysInMonth(date: D): number;
69
+ /**
70
+ * The first day of the week as a **0-6** index (`0` = Sunday). Used as the
71
+ * default when `ForCalendar`'s `firstDayOfWeek` input is `null`. Adapters
72
+ * return a locale-independent default (`0`); consumers localise it through
73
+ * the `firstDayOfWeek` input or `provideForCalendarDefaults`.
74
+ */
75
+ getFirstDayOfWeek(): number;
76
+ /** Returns a new date `n` days after `date` (negative goes backwards). */
77
+ addDays(date: D, n: number): D;
78
+ /**
79
+ * Returns a new date `n` months after `date` (negative goes backwards). The
80
+ * day of month is constrained to the target month's length (e.g. Jan 31 + 1
81
+ * month is Feb 28/29, never Mar 3).
82
+ */
83
+ addMonths(date: D, n: number): D;
84
+ /**
85
+ * Returns a new date `n` years after `date` (negative goes backwards). The
86
+ * day of month is constrained (e.g. Feb 29 + 1 year is Feb 28 in a common
87
+ * year).
88
+ */
89
+ addYears(date: D, n: number): D;
90
+ /**
91
+ * Compares two dates by their natural ordering — **the full instant**,
92
+ * including any time component the adapter's `D` carries. Returns a negative
93
+ * number when `a` is before `b`, `0` when they are equal, and a positive
94
+ * number when `a` is after `b`.
95
+ *
96
+ * This is the canonical comparator and the only one an adapter must
97
+ * implement. Time-capable adapters (`Date`, `@internationalized/date`'s
98
+ * `CalendarDateTime`) order by day *and* time; day-only adapters
99
+ * (`CalendarDate`) order by day alone because that is all their `D` carries.
100
+ *
101
+ * **Bounds granularity.** `minDate` / `maxDate` clamping in the date
102
+ * primitives compares the full instant through `compare`, so a date-time
103
+ * `min`/`max` clamps identically on every time-capable adapter (e.g. native
104
+ * `Date` and `CalendarDateTime` produce the same result for the same input).
105
+ * For the *calendar grid*, where availability is day-granular so the boundary
106
+ * day of a date-time `min`/`max` stays selectable, the primitives compare
107
+ * calendar days instead, through {@link compareDate} when present and
108
+ * otherwise from the y/m/d getters.
109
+ */
110
+ compare(a: D, b: D): number;
111
+ /**
112
+ * Optionally compares two dates by calendar day only, ignoring any time
113
+ * component. Returns a negative number when `a`'s day is before `b`'s, `0`
114
+ * when they fall on the same calendar day, and a positive number when `a`'s
115
+ * day is after `b`'s.
116
+ *
117
+ * Adapters may **omit** this method: the primitives then derive the
118
+ * day-only comparison from the {@link getYear} / {@link getMonth} /
119
+ * {@link getDate} getters, which is correct for any adapter. Implement it only
120
+ * to override that default (e.g. a bespoke day-granular ordering). This
121
+ * overrides day-only *ordering* only — it does not change the Gregorian month
122
+ * structure the grid assumes (see the *Calendar system* note on the interface).
123
+ * Day-only adapters whose {@link compare} already ignores time need not
124
+ * implement it.
125
+ */
126
+ compareDate?(a: D, b: D): number;
127
+ /** Whether `a` and `b` fall on the same calendar day. */
128
+ isSameDay(a: D, b: D): boolean;
129
+ /** Whether `date` is a valid date of this adapter's type. */
130
+ isValid(date: D): boolean;
131
+ /**
132
+ * The locale this adapter formats in, or `null` for the runtime default. A
133
+ * segmented date / time field with no `[locale]` of its own takes its segment
134
+ * order, separators, hour cycle and AM/PM names from it, so they match what
135
+ * {@link format} produces. Reading a signal here makes every field and
136
+ * formatted value follow a runtime language switch.
137
+ */
138
+ locale?(): string | null;
139
+ /**
140
+ * Formats `date` for display. When `locale` is omitted the adapter's own
141
+ * {@link locale} is used, else the runtime's default locale; pass one to
142
+ * force a specific locale for month / weekday / day-period names.
143
+ *
144
+ * **SSR / hydration caveat.** With no `locale` the result resolves against the
145
+ * runtime's default locale, so a server render and a client hydration can
146
+ * produce different strings when the server and browser locales differ —
147
+ * surfacing as a hydration mismatch on every formatted value (heading, weekday
148
+ * headers, cell labels). The runtime time zone applies too for adapters that
149
+ * format through a wall-clock instant.
150
+ *
151
+ * **SSR-safe pattern.** Pin a `locale` (or format client-side) for the server
152
+ * render so both environments resolve the same locale. See the calendar
153
+ * README's "SSR / hydration" section.
154
+ *
155
+ * @param options Standard `Intl.DateTimeFormat` options (e.g.
156
+ * `{ month: 'long', year: 'numeric' }` for a calendar heading,
157
+ * `{ weekday: 'short' }` for a column header).
158
+ * @param locale Optional BCP 47 locale tag governing the formatted names;
159
+ * falls back to {@link locale}, then the runtime's default locale, when
160
+ * omitted.
161
+ */
162
+ format(date: D, options: Intl.DateTimeFormatOptions, locale?: string): string;
163
+ /**
164
+ * Whether this adapter's `D` can carry a wall-clock time component (hour /
165
+ * minute / second). Day-only adapters omit the optional time accessors below
166
+ * and return `false` (or omit this method); time-capable adapters implement
167
+ * them and return `true`. `ForTimeField` — and the time granularity of the
168
+ * date primitives — require a time-capable adapter.
169
+ */
170
+ supportsTime?(): boolean;
171
+ /** The hour of `date`, **0-23** (24-hour clock). Time-capable adapters only. */
172
+ getHours?(date: D): number;
173
+ /** The minute of `date`, **0-59**. Time-capable adapters only. */
174
+ getMinutes?(date: D): number;
175
+ /** The second of `date`, **0-59**. Time-capable adapters only. */
176
+ getSeconds?(date: D): number;
177
+ /**
178
+ * Returns a new date with its time set to the given parts, preserving the
179
+ * calendar day. Time-capable adapters only.
180
+ *
181
+ * @param hours Hour of day, **0-23**.
182
+ * @param minutes Minute of hour, **0-59**.
183
+ * @param seconds Second of minute, **0-59**.
184
+ */
185
+ setTime?(date: D, hours: number, minutes: number, seconds: number): D;
187
186
  }
188
187
  /**
189
188
  * A {@link DateAdapter} narrowed to one that implements the optional time
@@ -199,8 +198,7 @@ type TimeCapableDateAdapter<D> = DateAdapter<D> & Required<Pick<DateAdapter<D>,
199
198
  * There is no application-wide default — a calendar with no adapter in scope
200
199
  * throws a descriptive error.
201
200
  */
202
- declare const FOR_DATE_ADAPTER: InjectionToken<DateAdapter<unknown>>;
203
-
201
+ export declare const FOR_DATE_ADAPTER: InjectionToken<DateAdapter<unknown>>;
204
202
  /**
205
203
  * Creates a memoized `Intl.DateTimeFormat` factory shared by the date adapters.
206
204
  *
@@ -220,8 +218,7 @@ declare const FOR_DATE_ADAPTER: InjectionToken<DateAdapter<unknown>>;
220
218
  * @returns A function that returns the cached `Intl.DateTimeFormat` for the
221
219
  * given `locale` (or the runtime default when omitted) and `options`.
222
220
  */
223
- declare function createFormatterCache(): (locale: string | undefined, options: Intl.DateTimeFormatOptions) => Intl.DateTimeFormat;
224
-
221
+ export declare function createFormatterCache(): (locale: string | undefined, options: Intl.DateTimeFormatOptions) => Intl.DateTimeFormat;
225
222
  /**
226
223
  * Zero-dependency {@link DateAdapter} over the built-in `Date`. `today` and
227
224
  * `createDate` produce days at local midnight, and the calendar grid stays
@@ -239,44 +236,44 @@ declare function createFormatterCache(): (locale: string | undefined, options: I
239
236
  * `Date` and the `@internationalized/date` adapters operate on the Gregorian
240
237
  * calendar; non-Gregorian calendar systems are not supported.
241
238
  */
242
- declare class NativeDateAdapter implements DateAdapter<Date> {
243
- #private;
244
- /**
245
- * Today at local midnight in the runtime time zone. Subject to the
246
- * SSR/hydration caveat on {@link DateAdapter.today}.
247
- */
248
- today(): Date;
249
- createDate(year: number, month: number, day: number): Date;
250
- getYear(date: Date): number;
251
- getMonth(date: Date): number;
252
- getDate(date: Date): number;
253
- getDayOfWeek(date: Date): number;
254
- getDaysInMonth(date: Date): number;
255
- getFirstDayOfWeek(): number;
256
- addDays(date: Date, n: number): Date;
257
- addMonths(date: Date, n: number): Date;
258
- addYears(date: Date, n: number): Date;
259
- compare(a: Date, b: Date): number;
260
- isSameDay(a: Date, b: Date): boolean;
261
- isValid(date: Date): boolean;
262
- /**
263
- * The locale {@link format} falls back to, or `null` for the runtime default.
264
- * Override it in a subclass to format, and lay out every date / time field,
265
- * in the app's language.
266
- */
267
- locale(): string | null;
268
- /**
269
- * Formats through `locale`, else {@link locale}, else the runtime's default
270
- * locale. Subject to the SSR/hydration caveat on {@link DateAdapter.format}.
271
- */
272
- format(date: Date, options: Intl.DateTimeFormatOptions, locale?: string): string;
273
- supportsTime(): boolean;
274
- getHours(date: Date): number;
275
- getMinutes(date: Date): number;
276
- getSeconds(date: Date): number;
277
- setTime(date: Date, hours: number, minutes: number, seconds: number): Date;
278
- static ɵfac: i0.ɵɵFactoryDeclaration<NativeDateAdapter, never>;
279
- static ɵprov: i0.ɵɵInjectableDeclaration<NativeDateAdapter>;
239
+ export declare class NativeDateAdapter implements DateAdapter<Date> {
240
+ #private;
241
+ /**
242
+ * Today at local midnight in the runtime time zone. Subject to the
243
+ * SSR/hydration caveat on {@link DateAdapter.today}.
244
+ */
245
+ today(): Date;
246
+ createDate(year: number, month: number, day: number): Date;
247
+ getYear(date: Date): number;
248
+ getMonth(date: Date): number;
249
+ getDate(date: Date): number;
250
+ getDayOfWeek(date: Date): number;
251
+ getDaysInMonth(date: Date): number;
252
+ getFirstDayOfWeek(): number;
253
+ addDays(date: Date, n: number): Date;
254
+ addMonths(date: Date, n: number): Date;
255
+ addYears(date: Date, n: number): Date;
256
+ compare(a: Date, b: Date): number;
257
+ isSameDay(a: Date, b: Date): boolean;
258
+ isValid(date: Date): boolean;
259
+ /**
260
+ * The locale {@link format} falls back to, or `null` for the runtime default.
261
+ * Override it in a subclass to format, and lay out every date / time field,
262
+ * in the app's language.
263
+ */
264
+ locale(): string | null;
265
+ /**
266
+ * Formats through `locale`, else {@link locale}, else the runtime's default
267
+ * locale. Subject to the SSR/hydration caveat on {@link DateAdapter.format}.
268
+ */
269
+ format(date: Date, options: Intl.DateTimeFormatOptions, locale?: string): string;
270
+ supportsTime(): boolean;
271
+ getHours(date: Date): number;
272
+ getMinutes(date: Date): number;
273
+ getSeconds(date: Date): number;
274
+ setTime(date: Date, hours: number, minutes: number, seconds: number): Date;
275
+ static ɵfac: i0.ɵɵFactoryDeclaration<NativeDateAdapter, never>;
276
+ static ɵprov: i0.ɵɵInjectableDeclaration<any>;
280
277
  }
281
278
  /**
282
279
  * Provides the zero-dependency {@link NativeDateAdapter} as the active
@@ -290,7 +287,5 @@ declare class NativeDateAdapter implements DateAdapter<Date> {
290
287
  * });
291
288
  * ```
292
289
  */
293
- declare function provideNativeDateAdapter(): Provider[];
294
-
295
- export { FOR_DATE_ADAPTER, NativeDateAdapter, createFormatterCache, provideNativeDateAdapter };
296
- export type { DateAdapter, TimeCapableDateAdapter };
290
+ export declare function provideNativeDateAdapter(): Provider[];
291
+ export type { DateAdapter, TimeCapableDateAdapter };