@mortenbrudvik/waveui 0.9.0 → 0.11.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 (264) hide show
  1. package/README.md +758 -152
  2. package/dist/components/button/Toolbar.cjs +1 -1
  3. package/dist/components/button/Toolbar.cjs.map +1 -1
  4. package/dist/components/button/Toolbar.mjs +25 -30
  5. package/dist/components/button/Toolbar.mjs.map +1 -1
  6. package/dist/components/button/Toolbar.navigation.cjs +2 -0
  7. package/dist/components/button/Toolbar.navigation.cjs.map +1 -0
  8. package/dist/components/button/Toolbar.navigation.mjs +17 -0
  9. package/dist/components/button/Toolbar.navigation.mjs.map +1 -0
  10. package/dist/components/data-display/Avatar.cjs +1 -1
  11. package/dist/components/data-display/Avatar.cjs.map +1 -1
  12. package/dist/components/data-display/Avatar.context.cjs +2 -0
  13. package/dist/components/data-display/Avatar.context.cjs.map +1 -0
  14. package/dist/components/data-display/Avatar.context.mjs +9 -0
  15. package/dist/components/data-display/Avatar.context.mjs.map +1 -0
  16. package/dist/components/data-display/Avatar.mjs +66 -61
  17. package/dist/components/data-display/Avatar.mjs.map +1 -1
  18. package/dist/components/data-display/InteractionTag.cjs +2 -0
  19. package/dist/components/data-display/InteractionTag.cjs.map +1 -0
  20. package/dist/components/data-display/InteractionTag.mjs +234 -0
  21. package/dist/components/data-display/InteractionTag.mjs.map +1 -0
  22. package/dist/components/data-display/Tag.cjs +1 -1
  23. package/dist/components/data-display/Tag.cjs.map +1 -1
  24. package/dist/components/data-display/Tag.mjs +222 -90
  25. package/dist/components/data-display/Tag.mjs.map +1 -1
  26. package/dist/components/data-display/TagGroup.cjs +2 -0
  27. package/dist/components/data-display/TagGroup.cjs.map +1 -0
  28. package/dist/components/data-display/TagGroup.context.cjs +2 -0
  29. package/dist/components/data-display/TagGroup.context.cjs.map +1 -0
  30. package/dist/components/data-display/TagGroup.context.mjs +113 -0
  31. package/dist/components/data-display/TagGroup.context.mjs.map +1 -0
  32. package/dist/components/data-display/TagGroup.mjs +149 -0
  33. package/dist/components/data-display/TagGroup.mjs.map +1 -0
  34. package/dist/components/data-display/tagStyles.cjs +2 -0
  35. package/dist/components/data-display/tagStyles.cjs.map +1 -0
  36. package/dist/components/data-display/tagStyles.mjs +108 -0
  37. package/dist/components/data-display/tagStyles.mjs.map +1 -0
  38. package/dist/components/feedback/Toaster.cjs +1 -1
  39. package/dist/components/feedback/Toaster.cjs.map +1 -1
  40. package/dist/components/feedback/Toaster.mjs +213 -181
  41. package/dist/components/feedback/Toaster.mjs.map +1 -1
  42. package/dist/components/input/Calendar.cjs +2 -0
  43. package/dist/components/input/Calendar.cjs.map +1 -0
  44. package/dist/components/input/Calendar.mjs +352 -0
  45. package/dist/components/input/Calendar.mjs.map +1 -0
  46. package/dist/components/input/Calendar.views.cjs +2 -0
  47. package/dist/components/input/Calendar.views.cjs.map +1 -0
  48. package/dist/components/input/Calendar.views.mjs +194 -0
  49. package/dist/components/input/Calendar.views.mjs.map +1 -0
  50. package/dist/components/input/ColorArea.cjs +1 -1
  51. package/dist/components/input/ColorArea.cjs.map +1 -1
  52. package/dist/components/input/ColorArea.mjs +18 -18
  53. package/dist/components/input/ColorArea.mjs.map +1 -1
  54. package/dist/components/input/Combobox.cjs +1 -1
  55. package/dist/components/input/Combobox.cjs.map +1 -1
  56. package/dist/components/input/Combobox.expand.cjs +1 -1
  57. package/dist/components/input/Combobox.expand.cjs.map +1 -1
  58. package/dist/components/input/Combobox.expand.mjs +7 -7
  59. package/dist/components/input/Combobox.expand.mjs.map +1 -1
  60. package/dist/components/input/Combobox.mjs +232 -156
  61. package/dist/components/input/Combobox.mjs.map +1 -1
  62. package/dist/components/input/Combobox.text.cjs +2 -0
  63. package/dist/components/input/Combobox.text.cjs.map +1 -0
  64. package/dist/components/input/Combobox.text.mjs +24 -0
  65. package/dist/components/input/Combobox.text.mjs.map +1 -0
  66. package/dist/components/input/DatePicker.cjs +1 -1
  67. package/dist/components/input/DatePicker.cjs.map +1 -1
  68. package/dist/components/input/DatePicker.mjs +203 -288
  69. package/dist/components/input/DatePicker.mjs.map +1 -1
  70. package/dist/components/input/Dropdown.cjs +1 -1
  71. package/dist/components/input/Dropdown.cjs.map +1 -1
  72. package/dist/components/input/Dropdown.mjs +135 -109
  73. package/dist/components/input/Dropdown.mjs.map +1 -1
  74. package/dist/components/input/Listbox.cjs +2 -0
  75. package/dist/components/input/Listbox.cjs.map +1 -0
  76. package/dist/components/input/Listbox.mjs +134 -0
  77. package/dist/components/input/Listbox.mjs.map +1 -0
  78. package/dist/components/input/Option.cjs +1 -1
  79. package/dist/components/input/Option.cjs.map +1 -1
  80. package/dist/components/input/Option.mjs +163 -97
  81. package/dist/components/input/Option.mjs.map +1 -1
  82. package/dist/components/input/SwatchPicker.cjs +1 -1
  83. package/dist/components/input/SwatchPicker.cjs.map +1 -1
  84. package/dist/components/input/SwatchPicker.context.cjs +2 -0
  85. package/dist/components/input/SwatchPicker.context.cjs.map +1 -0
  86. package/dist/components/input/SwatchPicker.context.mjs +35 -0
  87. package/dist/components/input/SwatchPicker.context.mjs.map +1 -0
  88. package/dist/components/input/SwatchPicker.mjs +131 -103
  89. package/dist/components/input/SwatchPicker.mjs.map +1 -1
  90. package/dist/components/input/SwatchPicker.swatches.cjs +2 -0
  91. package/dist/components/input/SwatchPicker.swatches.cjs.map +1 -0
  92. package/dist/components/input/SwatchPicker.swatches.mjs +207 -0
  93. package/dist/components/input/SwatchPicker.swatches.mjs.map +1 -0
  94. package/dist/components/input/TagPicker.cjs +1 -1
  95. package/dist/components/input/TagPicker.cjs.map +1 -1
  96. package/dist/components/input/TagPicker.context.cjs +2 -0
  97. package/dist/components/input/TagPicker.context.cjs.map +1 -0
  98. package/dist/components/input/TagPicker.context.mjs +20 -0
  99. package/dist/components/input/TagPicker.context.mjs.map +1 -0
  100. package/dist/components/input/TagPicker.create.cjs +2 -0
  101. package/dist/components/input/TagPicker.create.cjs.map +1 -0
  102. package/dist/components/input/TagPicker.create.mjs +24 -0
  103. package/dist/components/input/TagPicker.create.mjs.map +1 -0
  104. package/dist/components/input/TagPicker.mjs +13 -274
  105. package/dist/components/input/TagPicker.mjs.map +1 -1
  106. package/dist/components/input/TagPicker.option.cjs +2 -0
  107. package/dist/components/input/TagPicker.option.cjs.map +1 -0
  108. package/dist/components/input/TagPicker.option.mjs +45 -0
  109. package/dist/components/input/TagPicker.option.mjs.map +1 -0
  110. package/dist/components/input/TagPicker.overflow.cjs +2 -0
  111. package/dist/components/input/TagPicker.overflow.cjs.map +1 -0
  112. package/dist/components/input/TagPicker.overflow.mjs +153 -0
  113. package/dist/components/input/TagPicker.overflow.mjs.map +1 -0
  114. package/dist/components/input/TagPicker.parts.cjs +2 -0
  115. package/dist/components/input/TagPicker.parts.cjs.map +1 -0
  116. package/dist/components/input/TagPicker.parts.mjs +425 -0
  117. package/dist/components/input/TagPicker.parts.mjs.map +1 -0
  118. package/dist/components/input/TagPicker.root.cjs +2 -0
  119. package/dist/components/input/TagPicker.root.cjs.map +1 -0
  120. package/dist/components/input/TagPicker.root.mjs +416 -0
  121. package/dist/components/input/TagPicker.root.mjs.map +1 -0
  122. package/dist/components/input/TimePicker.cjs +1 -1
  123. package/dist/components/input/TimePicker.cjs.map +1 -1
  124. package/dist/components/input/TimePicker.mjs +77 -77
  125. package/dist/components/input/TimePicker.mjs.map +1 -1
  126. package/dist/components/input/dateUtils.cjs +1 -1
  127. package/dist/components/input/dateUtils.cjs.map +1 -1
  128. package/dist/components/input/dateUtils.mjs +114 -96
  129. package/dist/components/input/dateUtils.mjs.map +1 -1
  130. package/dist/components/input/pickerLabels.cjs +2 -0
  131. package/dist/components/input/pickerLabels.cjs.map +1 -0
  132. package/dist/components/input/pickerLabels.mjs +16 -0
  133. package/dist/components/input/pickerLabels.mjs.map +1 -0
  134. package/dist/components/input/pickerValues.cjs +2 -0
  135. package/dist/components/input/pickerValues.cjs.map +1 -0
  136. package/dist/components/input/pickerValues.mjs +24 -0
  137. package/dist/components/input/pickerValues.mjs.map +1 -0
  138. package/dist/components/layout/Accordion.cjs.map +1 -1
  139. package/dist/components/layout/Accordion.mjs.map +1 -1
  140. package/dist/components/navigation/Hamburger.cjs +2 -0
  141. package/dist/components/navigation/Hamburger.cjs.map +1 -0
  142. package/dist/components/navigation/Hamburger.mjs +54 -0
  143. package/dist/components/navigation/Hamburger.mjs.map +1 -0
  144. package/dist/components/navigation/Nav.cjs +1 -1
  145. package/dist/components/navigation/Nav.cjs.map +1 -1
  146. package/dist/components/navigation/Nav.context.cjs +2 -0
  147. package/dist/components/navigation/Nav.context.cjs.map +1 -0
  148. package/dist/components/navigation/Nav.context.mjs +137 -0
  149. package/dist/components/navigation/Nav.context.mjs.map +1 -0
  150. package/dist/components/navigation/Nav.mjs +151 -258
  151. package/dist/components/navigation/Nav.mjs.map +1 -1
  152. package/dist/components/navigation/Nav.parts.cjs +2 -0
  153. package/dist/components/navigation/Nav.parts.cjs.map +1 -0
  154. package/dist/components/navigation/Nav.parts.mjs +77 -0
  155. package/dist/components/navigation/Nav.parts.mjs.map +1 -0
  156. package/dist/components/navigation/Nav.root.cjs +2 -0
  157. package/dist/components/navigation/Nav.root.cjs.map +1 -0
  158. package/dist/components/navigation/Nav.root.mjs +78 -0
  159. package/dist/components/navigation/Nav.root.mjs.map +1 -0
  160. package/dist/components/navigation/NavDrawer.cjs +2 -0
  161. package/dist/components/navigation/NavDrawer.cjs.map +1 -0
  162. package/dist/components/navigation/NavDrawer.context.cjs +2 -0
  163. package/dist/components/navigation/NavDrawer.context.cjs.map +1 -0
  164. package/dist/components/navigation/NavDrawer.context.mjs +11 -0
  165. package/dist/components/navigation/NavDrawer.context.mjs.map +1 -0
  166. package/dist/components/navigation/NavDrawer.mjs +179 -0
  167. package/dist/components/navigation/NavDrawer.mjs.map +1 -0
  168. package/dist/components/overlays/Dialog.cjs +1 -1
  169. package/dist/components/overlays/Dialog.cjs.map +1 -1
  170. package/dist/components/overlays/Dialog.mjs +190 -125
  171. package/dist/components/overlays/Dialog.mjs.map +1 -1
  172. package/dist/components/overlays/Dialog.shared.cjs +1 -1
  173. package/dist/components/overlays/Dialog.shared.cjs.map +1 -1
  174. package/dist/components/overlays/Dialog.shared.mjs +157 -81
  175. package/dist/components/overlays/Dialog.shared.mjs.map +1 -1
  176. package/dist/components/overlays/Dialog.slots.cjs +2 -0
  177. package/dist/components/overlays/Dialog.slots.cjs.map +1 -0
  178. package/dist/components/overlays/Dialog.slots.mjs +129 -0
  179. package/dist/components/overlays/Dialog.slots.mjs.map +1 -0
  180. package/dist/components/overlays/Drawer.cjs +1 -1
  181. package/dist/components/overlays/Drawer.cjs.map +1 -1
  182. package/dist/components/overlays/Drawer.context.cjs +2 -0
  183. package/dist/components/overlays/Drawer.context.cjs.map +1 -0
  184. package/dist/components/overlays/Drawer.context.mjs +29 -0
  185. package/dist/components/overlays/Drawer.context.mjs.map +1 -0
  186. package/dist/components/overlays/Drawer.mjs +12 -187
  187. package/dist/components/overlays/Drawer.mjs.map +1 -1
  188. package/dist/components/overlays/Drawer.panel.cjs +2 -0
  189. package/dist/components/overlays/Drawer.panel.cjs.map +1 -0
  190. package/dist/components/overlays/Drawer.panel.mjs +159 -0
  191. package/dist/components/overlays/Drawer.panel.mjs.map +1 -0
  192. package/dist/components/overlays/Drawer.parts.cjs +2 -0
  193. package/dist/components/overlays/Drawer.parts.cjs.map +1 -0
  194. package/dist/components/overlays/Drawer.parts.mjs +152 -0
  195. package/dist/components/overlays/Drawer.parts.mjs.map +1 -0
  196. package/dist/components/overlays/Drawer.root.cjs +2 -0
  197. package/dist/components/overlays/Drawer.root.cjs.map +1 -0
  198. package/dist/components/overlays/Drawer.root.mjs +207 -0
  199. package/dist/components/overlays/Drawer.root.mjs.map +1 -0
  200. package/dist/components/overlays/Drawer.scroll.cjs +2 -0
  201. package/dist/components/overlays/Drawer.scroll.cjs.map +1 -0
  202. package/dist/components/overlays/Drawer.scroll.mjs +42 -0
  203. package/dist/components/overlays/Drawer.scroll.mjs.map +1 -0
  204. package/dist/components/table/useGridNavigation.cjs +1 -1
  205. package/dist/components/table/useGridNavigation.cjs.map +1 -1
  206. package/dist/components/table/useGridNavigation.mjs +67 -70
  207. package/dist/components/table/useGridNavigation.mjs.map +1 -1
  208. package/dist/hooks/useActiveDescendant.cjs +2 -0
  209. package/dist/hooks/useActiveDescendant.cjs.map +1 -0
  210. package/dist/hooks/useActiveDescendant.mjs +56 -0
  211. package/dist/hooks/useActiveDescendant.mjs.map +1 -0
  212. package/dist/hooks/useDismiss.cjs.map +1 -1
  213. package/dist/hooks/useDismiss.mjs.map +1 -1
  214. package/dist/hooks/useFocusTrap.cjs +1 -1
  215. package/dist/hooks/useFocusTrap.cjs.map +1 -1
  216. package/dist/hooks/useFocusTrap.mjs +115 -98
  217. package/dist/hooks/useFocusTrap.mjs.map +1 -1
  218. package/dist/hooks/useListbox.cjs +1 -1
  219. package/dist/hooks/useListbox.cjs.map +1 -1
  220. package/dist/hooks/useListbox.mjs +250 -210
  221. package/dist/hooks/useListbox.mjs.map +1 -1
  222. package/dist/hooks/useModalLayer.cjs +1 -1
  223. package/dist/hooks/useModalLayer.cjs.map +1 -1
  224. package/dist/hooks/useModalLayer.mjs +35 -22
  225. package/dist/hooks/useModalLayer.mjs.map +1 -1
  226. package/dist/hooks/useRestoreFocus.cjs +1 -1
  227. package/dist/hooks/useRestoreFocus.cjs.map +1 -1
  228. package/dist/hooks/useRestoreFocus.mjs +91 -78
  229. package/dist/hooks/useRestoreFocus.mjs.map +1 -1
  230. package/dist/hooks/useRovingGrid.cjs +2 -0
  231. package/dist/hooks/useRovingGrid.cjs.map +1 -0
  232. package/dist/hooks/useRovingGrid.mjs +69 -0
  233. package/dist/hooks/useRovingGrid.mjs.map +1 -0
  234. package/dist/hooks/useRovingTabIndex.cjs +1 -1
  235. package/dist/hooks/useRovingTabIndex.cjs.map +1 -1
  236. package/dist/hooks/useRovingTabIndex.mjs +102 -78
  237. package/dist/hooks/useRovingTabIndex.mjs.map +1 -1
  238. package/dist/index.cjs +1 -1
  239. package/dist/index.d.cts +4391 -394
  240. package/dist/index.d.ts +4391 -394
  241. package/dist/index.mjs +115 -101
  242. package/dist/lib/classNames.cjs +1 -1
  243. package/dist/lib/classNames.cjs.map +1 -1
  244. package/dist/lib/classNames.mjs +170 -74
  245. package/dist/lib/classNames.mjs.map +1 -1
  246. package/dist/lib/date.cjs +2 -0
  247. package/dist/lib/date.cjs.map +1 -0
  248. package/dist/lib/date.mjs +44 -0
  249. package/dist/lib/date.mjs.map +1 -0
  250. package/dist/lib/focus.cjs +1 -1
  251. package/dist/lib/focus.cjs.map +1 -1
  252. package/dist/lib/focus.mjs +5 -2
  253. package/dist/lib/focus.mjs.map +1 -1
  254. package/dist/lib/icons.cjs +1 -1
  255. package/dist/lib/icons.cjs.map +1 -1
  256. package/dist/lib/icons.mjs +13 -6
  257. package/dist/lib/icons.mjs.map +1 -1
  258. package/dist/lib/layers.cjs +1 -1
  259. package/dist/lib/layers.cjs.map +1 -1
  260. package/dist/lib/layers.mjs +53 -47
  261. package/dist/lib/layers.mjs.map +1 -1
  262. package/dist/styles.css +1 -1
  263. package/package.json +1 -1
  264. package/src/styles/tokens.css +25 -0
@@ -1 +1 @@
1
- {"version":3,"file":"dateUtils.cjs","names":["makeDate","date","year","monthIndex","day","startOfDay","startOfMonth","daysInMonth","addDays","amount","addMonths","target","isSameDay","a","b","isSameMonth","isDateInRange","min","max","clampDate","getCalendarDays","first","viewMonth","offset","firstDayOfWeek","days","i","pad","value","length","formatISODate","fromFields","month","parseISODate","match","text","isValidLocaleTag","locale","DEFAULT_DATE_OPTIONS","GRID_CALENDARS","calendarCache","getCalendar","key","calendar","resolved","formatterCache","getFormatter","options","formatter","withCalendar","BIDI_MARKS","infoCache","SAMPLE_DATE","toAsciiDigits","out","char","digits","getLocaleInfo","cached","numberFormat","parts","order","literals","pattern","yearOffset","yearLength","part","info","getLocaleDateFormat","formatDate","digitGroups","normalized","groups","parseDate","iso","values","field","roundTrip","group","getWeekdayNames","short","long","formatMonthYear","formatDayLabel","numberFormatCache","formatDayNumber","TIME_24H","TIME_12H","timeToMinutes","twelve","hours","minutes","seconds","pm","minutesToValue","minutesToTime","format","period","normalizeTimeStep","step","generateTimeOptions","increment","minTime","maxTime"],"sources":["../../../src/components/input/dateUtils.ts"],"sourcesContent":["/**\n * Date and time helpers shared by `DatePicker` and `TimePicker` (spec §5.6).\n *\n * - Every date these helpers return is a **local-midnight** `Date` (the start of a calendar day in\n * the runtime's time zone). Comparisons are by calendar day, never by time of day.\n * - The default display format is `Intl.DateTimeFormat(locale, { year: 'numeric', month:\n * '2-digit', day: '2-digit' })`, and {@link parseDate} is its exact inverse for the same\n * `locale` (field order from `formatToParts`), so a formatted date always parses back to the\n * same day. ISO `yyyy-mm-dd` text is accepted too.\n * - Every formatter uses the locale's calendar only when it has the Gregorian months and days of\n * the grid (Gregorian, or the Buddhist calendar of `th-TH`, whose years are offset); any other\n * calendar (the Persian default of `fa-IR`, `-u-ca-islamic`, Japanese eras) is replaced by the\n * Gregorian one, so the text, the heading and the day labels name the day the grid shows.\n * - Pass an explicit `locale` when rendering on the server: the runtime default locale of the\n * server and the browser may differ, which would change the formatted text between them.\n *\n * Internal module (not exported from the package).\n */\n\n/* ------------------------------------------------------------------ */\n/* Day arithmetic */\n/* ------------------------------------------------------------------ */\n\n/**\n * Builds a local-midnight date without the `new Date(y, …)` two-digit-year mapping (years 0–99\n * would otherwise become 1900–1999).\n */\nfunction makeDate(year: number, monthIndex: number, day: number): Date {\n const date = new Date(2000, 0, 1);\n date.setFullYear(year, monthIndex, day);\n date.setHours(0, 0, 0, 0);\n return date;\n}\n\n/** The start (local midnight) of `date`'s calendar day, as a new `Date`. */\nexport function startOfDay(date: Date): Date {\n return makeDate(date.getFullYear(), date.getMonth(), date.getDate());\n}\n\n/** The first day (local midnight) of `date`'s month. */\nexport function startOfMonth(date: Date): Date {\n return makeDate(date.getFullYear(), date.getMonth(), 1);\n}\n\n/** The number of days in the given month (`monthIndex` may be out of range; it is normalized). */\nfunction daysInMonth(year: number, monthIndex: number): number {\n return makeDate(year, monthIndex + 1, 0).getDate();\n}\n\n/** `date` plus `amount` calendar days, at local midnight (month/year boundaries included). */\nexport function addDays(date: Date, amount: number): Date {\n return makeDate(date.getFullYear(), date.getMonth(), date.getDate() + amount);\n}\n\n/**\n * `date` plus `amount` months, at local midnight. The day is clamped to the length of the target\n * month, so Jan 31 + 1 month is Feb 28 (29 in a leap year) and Mar 31 − 1 month is Feb 28/29 —\n * never a day of the following month.\n */\nexport function addMonths(date: Date, amount: number): Date {\n const target = makeDate(date.getFullYear(), date.getMonth() + amount, 1);\n const day = Math.min(date.getDate(), daysInMonth(target.getFullYear(), target.getMonth()));\n return makeDate(target.getFullYear(), target.getMonth(), day);\n}\n\n/** Whether both dates are on the same calendar day. `false` when either is missing. */\nexport function isSameDay(a: Date | null | undefined, b: Date | null | undefined): boolean {\n return (\n !!a &&\n !!b &&\n a.getFullYear() === b.getFullYear() &&\n a.getMonth() === b.getMonth() &&\n a.getDate() === b.getDate()\n );\n}\n\n/** Whether both dates are in the same month of the same year. */\nexport function isSameMonth(a: Date, b: Date): boolean {\n return a.getFullYear() === b.getFullYear() && a.getMonth() === b.getMonth();\n}\n\n/**\n * Whether `date`'s day lies within `[min, max]`, comparing calendar days (a `max` with a time of\n * day still includes that whole day). Missing bounds are open.\n */\nexport function isDateInRange(date: Date, min?: Date | null, max?: Date | null): boolean {\n const day = startOfDay(date).getTime();\n if (min && day < startOfDay(min).getTime()) return false;\n if (max && day > startOfDay(max).getTime()) return false;\n return true;\n}\n\n/** `date`'s day clamped into `[min, max]` (calendar days), at local midnight. */\nexport function clampDate(date: Date, min?: Date | null, max?: Date | null): Date {\n const day = startOfDay(date);\n if (min && day.getTime() < startOfDay(min).getTime()) return startOfDay(min);\n if (max && day.getTime() > startOfDay(max).getTime()) return startOfDay(max);\n return day;\n}\n\n/**\n * The 42 days (6 weeks) of the calendar grid showing `viewMonth`'s month: the first row starts on\n * `firstDayOfWeek` (0 = Sunday) on or before the 1st.\n */\nexport function getCalendarDays(viewMonth: Date, firstDayOfWeek: number): Date[] {\n const first = startOfMonth(viewMonth);\n const offset = (first.getDay() - firstDayOfWeek + 7) % 7;\n const days: Date[] = [];\n for (let i = 0; i < 42; i++) days.push(addDays(first, i - offset));\n return days;\n}\n\n/* ------------------------------------------------------------------ */\n/* ISO dates */\n/* ------------------------------------------------------------------ */\n\nfunction pad(value: number, length: number): string {\n return String(value).padStart(length, '0');\n}\n\n/** `yyyy-mm-dd` from the **local** calendar fields (the `HiddenInput` form value). */\nexport function formatISODate(date: Date): string {\n return `${pad(date.getFullYear(), 4)}-${pad(date.getMonth() + 1, 2)}-${pad(date.getDate(), 2)}`;\n}\n\n/** Builds a date from calendar fields; `null` when they do not name a real day. */\nfunction fromFields(year: number, month: number, day: number): Date | null {\n if (!Number.isInteger(year) || year < 1 || year > 9999) return null;\n if (!Number.isInteger(month) || month < 1 || month > 12) return null;\n if (!Number.isInteger(day) || day < 1 || day > daysInMonth(year, month - 1)) return null;\n return makeDate(year, month - 1, day);\n}\n\n/** Parses `yyyy-mm-dd` (surrounding whitespace allowed) to local midnight; `null` otherwise. */\nexport function parseISODate(text: string): Date | null {\n const match = /^(\\d{4})-(\\d{2})-(\\d{2})$/.exec(text.trim());\n if (!match) return null;\n return fromFields(Number(match[1]), Number(match[2]), Number(match[3]));\n}\n\n/* ------------------------------------------------------------------ */\n/* Locale formats */\n/* ------------------------------------------------------------------ */\n\n/** A numeric date field. */\nexport type DateField = 'year' | 'month' | 'day';\n\n/** How a locale writes the default (numeric) date format. */\nexport interface LocaleDateFormat {\n /** The order of the fields, e.g. `['day', 'month', 'year']` for `en-GB`. */\n order: DateField[];\n /** A readable pattern with the locale's own separators, e.g. `DD/MM/YYYY`. */\n pattern: string;\n}\n\n/**\n * Whether `Intl` accepts `locale` as a language tag. Every helper below falls back to the runtime\n * default locale for a tag it rejects (the POSIX `de_DE`, `''`, a typo), so DatePicker warns about\n * one in development.\n */\nexport function isValidLocaleTag(locale: string): boolean {\n try {\n Intl.getCanonicalLocales(locale);\n return true;\n } catch {\n return false;\n }\n}\n\nconst DEFAULT_DATE_OPTIONS: Intl.DateTimeFormatOptions = {\n year: 'numeric',\n month: '2-digit',\n day: '2-digit',\n};\n\n/**\n * Calendars with the Gregorian months and days, which the grid shows (`getCalendarDays`): a locale\n * whose calendar is one of these keeps it. The Buddhist calendar (default of `th-TH`) only numbers\n * the years differently.\n */\nconst GRID_CALENDARS = new Set(['gregory', 'buddhist']);\n\nconst calendarCache = new Map<string, string>();\n\n/**\n * The calendar every date helper formats `locale` in: the locale's own (its default or a `-u-ca-`\n * extension) when it has the Gregorian months and days, else `'gregory'`. So a Persian default\n * (`fa-IR`, `fa-AF`, `ps-AF`), an explicit `-u-ca-islamic` or the Japanese eras never label the\n * Gregorian grid with other months or years, and the text stays parseable; the locale's digits\n * stay. An invalid locale tag uses the runtime default's.\n */\nfunction getCalendar(locale: string | undefined): string {\n const key = locale ?? '';\n let calendar = calendarCache.get(key);\n if (calendar === undefined) {\n let resolved: string;\n try {\n resolved = new Intl.DateTimeFormat(locale).resolvedOptions().calendar;\n } catch {\n resolved = new Intl.DateTimeFormat().resolvedOptions().calendar;\n }\n calendar = GRID_CALENDARS.has(resolved) ? resolved : 'gregory';\n calendarCache.set(key, calendar);\n }\n return calendar;\n}\n\nconst formatterCache = new Map<string, Intl.DateTimeFormat>();\n\n/**\n * A cached `Intl.DateTimeFormat` in the calendar of {@link getCalendar}; an invalid locale tag falls\n * back to the runtime default.\n */\nfunction getFormatter(\n locale: string | undefined,\n options: Intl.DateTimeFormatOptions,\n): Intl.DateTimeFormat {\n const key = `${locale ?? ''}|${JSON.stringify(options)}`;\n let formatter = formatterCache.get(key);\n if (!formatter) {\n const withCalendar = { ...options, calendar: getCalendar(locale) };\n try {\n formatter = new Intl.DateTimeFormat(locale, withCalendar);\n } catch {\n formatter = new Intl.DateTimeFormat(undefined, withCalendar);\n }\n formatterCache.set(key, formatter);\n }\n return formatter;\n}\n\n/** Bidirectional control characters Intl inserts around fields (Arabic, Hebrew locales). */\nconst BIDI_MARKS = /[\\u061c\\u200b-\\u200f\\u202a-\\u202e\\u2066-\\u2069]/g;\n\ninterface LocaleInfo extends LocaleDateFormat {\n /** Non-digit characters of the formatted date (allowed between the typed fields). */\n literals: Set<string>;\n /** Locale digit → ASCII digit (for non-Latin numbering systems). */\n digits: Map<string, string>;\n /** Formatted year minus the Gregorian year (e.g. 543 for the Buddhist calendar). */\n yearOffset: number;\n /** Digit count of a formatted year: shorter typed years are rejected (`25` is not 2025). */\n yearLength: number;\n}\n\nconst infoCache = new Map<string, LocaleInfo>();\nconst SAMPLE_DATE = makeDate(2001, 10, 23); // 23 Nov 2001: every field distinct\n\nfunction toAsciiDigits(text: string, digits: Map<string, string>): string {\n let out = '';\n for (const char of text.replace(BIDI_MARKS, '')) out += digits.get(char) ?? char;\n return out;\n}\n\nfunction getLocaleInfo(locale: string | undefined): LocaleInfo {\n const key = locale ?? '';\n const cached = infoCache.get(key);\n if (cached) return cached;\n\n const digits = new Map<string, string>();\n let numberFormat: Intl.NumberFormat;\n try {\n numberFormat = new Intl.NumberFormat(locale, { useGrouping: false });\n } catch {\n numberFormat = new Intl.NumberFormat(undefined, { useGrouping: false });\n }\n for (let i = 0; i <= 9; i++) digits.set(numberFormat.format(i), String(i));\n\n const parts = getFormatter(locale, DEFAULT_DATE_OPTIONS).formatToParts(SAMPLE_DATE);\n const order: DateField[] = [];\n const literals = new Set<string>();\n let pattern = '';\n let yearOffset = 0;\n let yearLength = 4;\n for (const part of parts) {\n if (part.type === 'day' || part.type === 'month' || part.type === 'year') {\n order.push(part.type);\n if (part.type === 'year') {\n const year = toAsciiDigits(part.value, digits);\n yearLength = year.length;\n yearOffset = Number(year) - SAMPLE_DATE.getFullYear();\n }\n pattern += part.type === 'day' ? 'DD' : part.type === 'month' ? 'MM' : 'YYYY';\n } else {\n const text = part.value.replace(BIDI_MARKS, '');\n pattern += text;\n for (const char of text) literals.add(char);\n }\n }\n const info: LocaleInfo = {\n order,\n pattern: pattern.trim(),\n literals,\n digits,\n yearOffset,\n yearLength,\n };\n infoCache.set(key, info);\n return info;\n}\n\n/**\n * The field order and a readable pattern (`DD/MM/YYYY`, `MM/DD/YYYY`, `DD.MM.YYYY`, …) of the\n * default date format for `locale` (runtime default when omitted).\n */\nexport function getLocaleDateFormat(locale?: string): LocaleDateFormat {\n const { order, pattern } = getLocaleInfo(locale);\n return { order: [...order], pattern };\n}\n\n/**\n * The default DatePicker display text: `Intl.DateTimeFormat(locale, { year: 'numeric', month:\n * '2-digit', day: '2-digit' })` in the grid-compatible calendar of {@link getCalendar} (`fa-IR`:\n * `۲۰۲۵/۰۶/۱۵`, not the Persian `۱۴۰۴/۰۳/۲۵`). {@link parseDate} with the same `locale` reverses it.\n */\nexport function formatDate(date: Date, locale?: string): string {\n return getFormatter(locale, DEFAULT_DATE_OPTIONS).format(date);\n}\n\n/** The numeric fields of `text` in order, or `null` when anything but separators surrounds them. */\nfunction digitGroups(text: string, info: LocaleInfo): string[] | null {\n const normalized = toAsciiDigits(text.trim(), info.digits);\n const groups = normalized.match(/\\d+/g);\n if (!groups) return null;\n for (const char of normalized.replace(/\\d+/g, '')) {\n if (/\\s/.test(char) || info.literals.has(char) || '/.-'.includes(char)) continue;\n return null;\n }\n return groups;\n}\n\n/**\n * Parses text typed in the default display format of `locale` — the exact inverse of\n * {@link formatDate} for the same locale — to local midnight. Also accepts single-digit day/month\n * fields, `/`, `.` and `-` separators, and ISO `yyyy-mm-dd`. Returns `null` for anything else:\n * impossible dates (31/02), a year shorter than the locale writes it (`25`), letters or extra\n * fields.\n */\nexport function parseDate(text: string, locale?: string): Date | null {\n if (!text.trim()) return null;\n const iso = parseISODate(text);\n if (iso) return iso;\n\n const info = getLocaleInfo(locale);\n if (info.order.length !== 3) return null;\n const groups = digitGroups(text, info);\n if (!groups || groups.length !== 3) return null;\n\n const values: Partial<Record<DateField, number>> = {};\n for (let i = 0; i < 3; i++) {\n const field = info.order[i];\n if (field === 'year' && groups[i].length < info.yearLength) return null;\n values[field] = Number(groups[i]);\n }\n const date = fromFields(\n (values.year ?? NaN) - info.yearOffset,\n values.month ?? NaN,\n values.day ?? NaN,\n );\n if (!date) return null;\n\n // Exact inverse: formatting the result must give back the typed numbers (guards calendars\n // whose months or days differ from the Gregorian ones).\n const roundTrip = digitGroups(formatDate(date, locale), info);\n if (!roundTrip || roundTrip.some((group, i) => Number(group) !== Number(groups[i]))) return null;\n return date;\n}\n\n/** The 12 long month names of `locale` (January … December). */\nexport function getMonthNames(locale?: string): string[] {\n const formatter = getFormatter(locale, { month: 'long' });\n return Array.from({ length: 12 }, (_, month) => formatter.format(makeDate(2001, month, 1)));\n}\n\n/** A weekday name in both lengths. */\nexport interface WeekdayName {\n /** Short name for the column header (`Mon`). */\n short: string;\n /** Full name for assistive technology (`Monday`). */\n long: string;\n}\n\n/** The seven weekday names of `locale`, starting at `firstDayOfWeek` (0 = Sunday). */\nexport function getWeekdayNames(locale: string | undefined, firstDayOfWeek = 0): WeekdayName[] {\n const short = getFormatter(locale, { weekday: 'short' });\n const long = getFormatter(locale, { weekday: 'long' });\n // 1 January 2023 was a Sunday.\n return Array.from({ length: 7 }, (_, i) => {\n const day = makeDate(2023, 0, 1 + ((firstDayOfWeek + i) % 7));\n return { short: short.format(day), long: long.format(day) };\n });\n}\n\n/** The calendar heading, e.g. `May 2025` / `Mai 2025`. */\nexport function formatMonthYear(date: Date, locale?: string): string {\n return getFormatter(locale, { month: 'long', year: 'numeric' }).format(date);\n}\n\n/** The accessible name of a day cell, e.g. `Monday, May 26, 2025`. */\nexport function formatDayLabel(date: Date, locale?: string): string {\n return getFormatter(locale, {\n weekday: 'long',\n year: 'numeric',\n month: 'long',\n day: 'numeric',\n }).format(date);\n}\n\nconst numberFormatCache = new Map<string, Intl.NumberFormat>();\n\n/** The day-of-month number in the locale's digits, without suffixes (`3`, not `3日`). */\nexport function formatDayNumber(date: Date, locale?: string): string {\n const key = locale ?? '';\n let formatter = numberFormatCache.get(key);\n if (!formatter) {\n try {\n formatter = new Intl.NumberFormat(locale, { useGrouping: false });\n } catch {\n formatter = new Intl.NumberFormat(undefined, { useGrouping: false });\n }\n numberFormatCache.set(key, formatter);\n }\n return formatter.format(date.getDate());\n}\n\n/* ------------------------------------------------------------------ */\n/* Time */\n/* ------------------------------------------------------------------ */\n\n/** TimePicker label style. */\nexport type TimeFormat = '12h' | '24h';\n\nconst TIME_24H = /^(\\d{1,2}):(\\d{2})(?::(\\d{2}))?$/;\nconst TIME_12H = /^(\\d{1,2}):(\\d{2})(?::(\\d{2}))?\\s*([ap])\\.?\\s*m\\.?$/i;\n\n/**\n * Minutes since midnight of a time string: `HH:mm`, `H:mm`, `HH:mm:ss` (seconds ignored) or a\n * 12-hour time such as `9:00 AM`, `12:30 pm`, `11:59 p.m.`. `NaN` when invalid.\n */\nexport function timeToMinutes(text: string): number {\n const value = text.trim();\n const twelve = TIME_12H.exec(value);\n const match = twelve ?? TIME_24H.exec(value);\n if (!match) return NaN;\n let hours = Number(match[1]);\n const minutes = Number(match[2]);\n const seconds = match[3] === undefined ? 0 : Number(match[3]);\n if (minutes > 59 || seconds > 59) return NaN;\n if (twelve) {\n if (hours < 1 || hours > 12) return NaN;\n const pm = match[4].toLowerCase() === 'p';\n hours = (hours % 12) + (pm ? 12 : 0);\n } else if (hours > 23) {\n return NaN;\n }\n return hours * 60 + minutes;\n}\n\n/** `HH:mm` (24-hour, zero-padded): the TimePicker value format. */\nexport function minutesToValue(minutes: number): string {\n const hours = Math.floor(minutes / 60) % 24;\n return `${pad(hours, 2)}:${pad(minutes % 60, 2)}`;\n}\n\n/** Display text of a time: `13:00` (`'24h'`) or `1:00 PM` (`'12h'`). */\nexport function minutesToTime(minutes: number, format: TimeFormat): string {\n if (format === '24h') return minutesToValue(minutes);\n const hours = Math.floor(minutes / 60) % 24;\n const period = hours >= 12 ? 'PM' : 'AM';\n const hours12 = hours % 12 === 0 ? 12 : hours % 12;\n return `${hours12}:${pad(minutes % 60, 2)} ${period}`;\n}\n\n/** The TimePicker step fallback for invalid values. */\nexport const DEFAULT_TIME_STEP = 30;\n\n/**\n * Guards a TimePicker `step`: a non-finite or non-positive step falls back to\n * {@link DEFAULT_TIME_STEP} (`valid: false`, so the component can report it); fractions are\n * floored to a whole number of minutes, at least 1.\n */\nexport function normalizeTimeStep(step: number): { step: number; valid: boolean } {\n if (!Number.isFinite(step) || step <= 0) return { step: DEFAULT_TIME_STEP, valid: false };\n return { step: Math.max(1, Math.floor(step)), valid: true };\n}\n\n/** One generated TimePicker option. */\nexport interface TimeOption {\n /** `HH:mm`. */\n value: string;\n /** Display text in the requested format. */\n label: string;\n}\n\n/**\n * The options from `minTime` to `maxTime` (inclusive) every `step` minutes. The step is guarded\n * with {@link normalizeTimeStep} (the loop always terminates); invalid or reversed bounds give\n * `[]`.\n */\nexport function generateTimeOptions(\n step: number,\n minTime: string,\n maxTime: string,\n format: TimeFormat,\n): TimeOption[] {\n const increment = normalizeTimeStep(step).step;\n const min = timeToMinutes(minTime);\n const max = timeToMinutes(maxTime);\n if (Number.isNaN(min) || Number.isNaN(max) || min > max) return [];\n const options: TimeOption[] = [];\n for (let minutes = min; minutes <= max; minutes += increment) {\n options.push({ value: minutesToValue(minutes), label: minutesToTime(minutes, format) });\n }\n return options;\n}\n"],"mappings":"aA2BA,SAASA,EAAS,EAAc,EAAoB,EAAmB,CACrE,IAAMC,EAAO,IAAI,KAAK,IAAM,EAAG,CAAC,EAGhC,OAFAA,EAAK,YAAYC,EAAMC,EAAYC,CAAG,EACtCH,EAAK,SAAS,EAAG,EAAG,EAAG,CAAC,EACjBA,CACT,CAGA,SAAgBI,EAAW,EAAkB,CAC3C,OAAOL,EAASC,EAAK,YAAY,EAAGA,EAAK,SAAS,EAAGA,EAAK,QAAQ,CAAC,CACrE,CAGA,SAAgBK,EAAa,EAAkB,CAC7C,OAAON,EAASC,EAAK,YAAY,EAAGA,EAA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AAI,EAAG,KAAK,MAAMA,CAAI,CAAC,EAAG,MAAO,EAAK,CAC5D,CAeA,SAAgBC,EACd,EACA,EACA,EACA,EACc,CACd,IAAMC,EAAYH,EAAkBC,CAAI,CAAC,CAAC,KACpClF,EAAMuE,EAAcc,CAAO,EAC3BpF,EAAMsE,EAAce,CAAO,EACjC,GAAI,OAAO,MAAMtF,CAAG,GAAK,OAAO,MAAMC,CAAG,GAAKD,EAAMC,EAAK,MAAO,CAAC,EACjE,IAAM6B,EAAwB,CAAC,EAC/B,IAAK,IAAI4C,EAAU1E,EAAK0E,GAAWzE,EAAK,GAAWmF,EACjDtD,EAAQ,KAAK,CAAE,MAAO+C,EAAeH,CAAO,EAAG,MAAOI,EAAcJ,EAASK,CAAM,CAAE,CAAC,EAExF,OAAOjD,CACT"}
1
+ {"version":3,"file":"dateUtils.cjs","names":["startOfDay","makeDate","startOfMonth","addDays","daysInMonth","startOfWeek","require_date","isSameMonth","a","b","isDateInRange","day","date","min","max","clampDate","getDecadeStart","year","getYearMonths","month","getDecadeYears","decadeStart","index","isMonthOutOfRange","first","last","isYearOutOfRange","getCalendarDays","viewMonth","offset","firstDayOfWeek","days","i","isDayUnavailable","disabledDates","getSelectionRange","mode","start","workWeekDays","weekDay","isUnavailable","candidate","pad","value","length","formatISODate","fromFields","parseISODate","match","text","isValidLocaleTag","locale","DEFAULT_DATE_OPTIONS","GRID_CALENDARS","calendarCache","getCalendar","key","calendar","resolved","formatterCache","getFormatter","options","formatter","withCalendar","BIDI_MARKS","infoCache","SAMPLE_DATE","toAsciiDigits","out","char","digits","getLocaleInfo","cached","numberFormat","parts","order","literals","pattern","yearOffset","yearLength","part","info","getLocaleDateFormat","formatDate","digitGroups","normalized","groups","parseDate","iso","values","field","roundTrip","group","getWeekdayNames","short","long","formatMonthYear","formatMonthShort","formatYear","formatDecade","formatDayLabel","numberFormatCache","formatDayNumber","TIME_24H","TIME_12H","timeToMinutes","twelve","hours","minutes","seconds","pm","minutesToValue","minutesToTime","format","period","normalizeTimeStep","step","generateTimeOptions","increment","minTime","maxTime"],"sources":["../../../src/components/input/dateUtils.ts"],"sourcesContent":["/**\n * Date and time helpers shared by `DatePicker` and `TimePicker` (spec §5.6).\n *\n * - Every date these helpers return is a **local-midnight** `Date` (the start of a calendar day in\n * the runtime's time zone). Comparisons are by calendar day, never by time of day.\n * - The default display format is `Intl.DateTimeFormat(locale, { year: 'numeric', month:\n * '2-digit', day: '2-digit' })`, and {@link parseDate} is its exact inverse for the same\n * `locale` (field order from `formatToParts`), so a formatted date always parses back to the\n * same day. ISO `yyyy-mm-dd` text is accepted too.\n * - Every formatter uses the locale's calendar only when it has the Gregorian months and days of\n * the grid (Gregorian, or the Buddhist calendar of `th-TH`, whose years are offset); any other\n * calendar (the Persian default of `fa-IR`, `-u-ca-islamic`, Japanese eras) is replaced by the\n * Gregorian one, so the text, the heading and the day labels name the day the grid shows.\n * - Pass an explicit `locale` when rendering on the server: the runtime default locale of the\n * server and the browser may differ, which would change the formatted text between them.\n *\n * Internal module (not exported from the package).\n */\n\nimport {\n addDays,\n addMonths,\n daysInMonth,\n isSameDay,\n makeDate,\n startOfDay,\n startOfMonth,\n startOfWeek,\n} from '../../lib/date';\nimport type { DayOfWeek } from '../../lib/types';\n\n/* ------------------------------------------------------------------ */\n/* Day arithmetic (the shared helpers live in lib/date) */\n/* ------------------------------------------------------------------ */\n\nexport { addDays, addMonths, isSameDay, startOfDay, startOfMonth };\n\n/** Whether both dates are in the same month of the same year. */\nexport function isSameMonth(a: Date, b: Date): boolean {\n return a.getFullYear() === b.getFullYear() && a.getMonth() === b.getMonth();\n}\n\n/**\n * Whether `date`'s day lies within `[min, max]`, comparing calendar days (a `max` with a time of\n * day still includes that whole day). Missing bounds are open.\n */\nexport function isDateInRange(date: Date, min?: Date | null, max?: Date | null): boolean {\n const day = startOfDay(date).getTime();\n if (min && day < startOfDay(min).getTime()) return false;\n if (max && day > startOfDay(max).getTime()) return false;\n return true;\n}\n\n/** `date`'s day clamped into `[min, max]` (calendar days), at local midnight. */\nexport function clampDate(date: Date, min?: Date | null, max?: Date | null): Date {\n const day = startOfDay(date);\n if (min && day.getTime() < startOfDay(min).getTime()) return startOfDay(min);\n if (max && day.getTime() > startOfDay(max).getTime()) return startOfDay(max);\n return day;\n}\n\n/** The first year of `year`'s decade (2025 gives 2020). */\nexport function getDecadeStart(year: number): number {\n return Math.floor(year / 10) * 10;\n}\n\n/** The 12 months of `year`, as the 1st of each month (the cells of the month view). */\nexport function getYearMonths(year: number): Date[] {\n return Array.from({ length: 12 }, (_, month) => makeDate(year, month, 1));\n}\n\n/**\n * The 12 years of the year view, as January 1 of each: the decade starting at `decadeStart`, with\n * the year before and the year after it.\n */\nexport function getDecadeYears(decadeStart: number): Date[] {\n return Array.from({ length: 12 }, (_, index) => makeDate(decadeStart - 1 + index, 0, 1));\n}\n\n/** Whether every day of `month`'s month lies outside `[min, max]` (calendar days). */\nexport function isMonthOutOfRange(month: Date, min?: Date | null, max?: Date | null): boolean {\n const first = startOfMonth(month);\n const last = makeDate(first.getFullYear(), first.getMonth() + 1, 0);\n return (!!min && last < startOfDay(min)) || (!!max && first > startOfDay(max));\n}\n\n/** Whether every day of `year` lies outside `[min, max]` (calendar days). */\nexport function isYearOutOfRange(year: number, min?: Date | null, max?: Date | null): boolean {\n return (\n (!!min && makeDate(year, 11, 31) < startOfDay(min)) ||\n (!!max && makeDate(year, 0, 1) > startOfDay(max))\n );\n}\n\n/**\n * The 42 days (6 weeks) of the calendar grid showing `viewMonth`'s month: the first row starts on\n * `firstDayOfWeek` (0 = Sunday) on or before the 1st.\n */\nexport function getCalendarDays(viewMonth: Date, firstDayOfWeek: number): Date[] {\n const first = startOfMonth(viewMonth);\n const offset = (first.getDay() - firstDayOfWeek + 7) % 7;\n const days: Date[] = [];\n for (let i = 0; i < 42; i++) days.push(addDays(first, i - offset));\n return days;\n}\n\n/**\n * Whether a day cannot be picked: outside `min`/`max` (whole days) or named by `disabledDates`\n * (called with local midnight). The one rule behind the focusable-but-unavailable look, the\n * drawn range and the emitted range.\n */\nexport function isDayUnavailable(\n date: Date,\n min?: Date | null,\n max?: Date | null,\n disabledDates?: (date: Date) => boolean,\n): boolean {\n return !isDateInRange(date, min, max) || !!disabledDates?.(startOfDay(date));\n}\n\n/** What a pick selects (the Calendar's `selectionRange`). */\nexport type CalendarSelectionRange = 'day' | 'week' | 'work-week' | 'month';\n\n/**\n * The days a pick of `date` selects, in order, at local midnight: the day itself (`'day'`, whatever\n * its availability), its week from `firstDayOfWeek`, the days of that week named by `workWeekDays`\n * (`'work-week'`, in the order of the week), or its whole month. The days of the other modes that\n * `isUnavailable` names are left out.\n */\nexport function getSelectionRange(\n date: Date,\n mode: CalendarSelectionRange,\n firstDayOfWeek: DayOfWeek,\n workWeekDays: readonly DayOfWeek[],\n isUnavailable?: (date: Date) => boolean,\n): Date[] {\n const day = startOfDay(date);\n let days: Date[];\n if (mode === 'day') return [day];\n if (mode === 'month') {\n const first = startOfMonth(day);\n days = Array.from({ length: daysInMonth(day.getFullYear(), day.getMonth()) }, (_, i) =>\n addDays(first, i),\n );\n } else {\n const start = startOfWeek(day, firstDayOfWeek);\n days = Array.from({ length: 7 }, (_, i) => addDays(start, i));\n if (mode === 'work-week') {\n days = days.filter((weekDay) => workWeekDays.includes(weekDay.getDay() as DayOfWeek));\n }\n }\n return isUnavailable ? days.filter((candidate) => !isUnavailable(candidate)) : days;\n}\n\n/* ------------------------------------------------------------------ */\n/* ISO dates */\n/* ------------------------------------------------------------------ */\n\nfunction pad(value: number, length: number): string {\n return String(value).padStart(length, '0');\n}\n\n/** `yyyy-mm-dd` from the **local** calendar fields (the `HiddenInput` form value). */\nexport function formatISODate(date: Date): string {\n return `${pad(date.getFullYear(), 4)}-${pad(date.getMonth() + 1, 2)}-${pad(date.getDate(), 2)}`;\n}\n\n/** Builds a date from calendar fields; `null` when they do not name a real day. */\nfunction fromFields(year: number, month: number, day: number): Date | null {\n if (!Number.isInteger(year) || year < 1 || year > 9999) return null;\n if (!Number.isInteger(month) || month < 1 || month > 12) return null;\n if (!Number.isInteger(day) || day < 1 || day > daysInMonth(year, month - 1)) return null;\n return makeDate(year, month - 1, day);\n}\n\n/** Parses `yyyy-mm-dd` (surrounding whitespace allowed) to local midnight; `null` otherwise. */\nexport function parseISODate(text: string): Date | null {\n const match = /^(\\d{4})-(\\d{2})-(\\d{2})$/.exec(text.trim());\n if (!match) return null;\n return fromFields(Number(match[1]), Number(match[2]), Number(match[3]));\n}\n\n/* ------------------------------------------------------------------ */\n/* Locale formats */\n/* ------------------------------------------------------------------ */\n\n/** A numeric date field. */\nexport type DateField = 'year' | 'month' | 'day';\n\n/** How a locale writes the default (numeric) date format. */\nexport interface LocaleDateFormat {\n /** The order of the fields, e.g. `['day', 'month', 'year']` for `en-GB`. */\n order: DateField[];\n /** A readable pattern with the locale's own separators, e.g. `DD/MM/YYYY`. */\n pattern: string;\n}\n\n/**\n * Whether `Intl` accepts `locale` as a language tag. Every helper below falls back to the runtime\n * default locale for a tag it rejects (the POSIX `de_DE`, `''`, a typo), so DatePicker warns about\n * one in development.\n */\nexport function isValidLocaleTag(locale: string): boolean {\n try {\n Intl.getCanonicalLocales(locale);\n return true;\n } catch {\n return false;\n }\n}\n\nconst DEFAULT_DATE_OPTIONS: Intl.DateTimeFormatOptions = {\n year: 'numeric',\n month: '2-digit',\n day: '2-digit',\n};\n\n/**\n * Calendars with the Gregorian months and days, which the grid shows (`getCalendarDays`): a locale\n * whose calendar is one of these keeps it. The Buddhist calendar (default of `th-TH`) only numbers\n * the years differently.\n */\nconst GRID_CALENDARS = new Set(['gregory', 'buddhist']);\n\nconst calendarCache = new Map<string, string>();\n\n/**\n * The calendar every date helper formats `locale` in: the locale's own (its default or a `-u-ca-`\n * extension) when it has the Gregorian months and days, else `'gregory'`. So a Persian default\n * (`fa-IR`, `fa-AF`, `ps-AF`), an explicit `-u-ca-islamic` or the Japanese eras never label the\n * Gregorian grid with other months or years, and the text stays parseable; the locale's digits\n * stay. An invalid locale tag uses the runtime default's.\n */\nfunction getCalendar(locale: string | undefined): string {\n const key = locale ?? '';\n let calendar = calendarCache.get(key);\n if (calendar === undefined) {\n let resolved: string;\n try {\n resolved = new Intl.DateTimeFormat(locale).resolvedOptions().calendar;\n } catch {\n resolved = new Intl.DateTimeFormat().resolvedOptions().calendar;\n }\n calendar = GRID_CALENDARS.has(resolved) ? resolved : 'gregory';\n calendarCache.set(key, calendar);\n }\n return calendar;\n}\n\nconst formatterCache = new Map<string, Intl.DateTimeFormat>();\n\n/**\n * A cached `Intl.DateTimeFormat` in the calendar of {@link getCalendar}; an invalid locale tag falls\n * back to the runtime default.\n */\nfunction getFormatter(\n locale: string | undefined,\n options: Intl.DateTimeFormatOptions,\n): Intl.DateTimeFormat {\n const key = `${locale ?? ''}|${JSON.stringify(options)}`;\n let formatter = formatterCache.get(key);\n if (!formatter) {\n const withCalendar = { ...options, calendar: getCalendar(locale) };\n try {\n formatter = new Intl.DateTimeFormat(locale, withCalendar);\n } catch {\n formatter = new Intl.DateTimeFormat(undefined, withCalendar);\n }\n formatterCache.set(key, formatter);\n }\n return formatter;\n}\n\n/** Bidirectional control characters Intl inserts around fields (Arabic, Hebrew locales). */\nconst BIDI_MARKS = /[\\u061c\\u200b-\\u200f\\u202a-\\u202e\\u2066-\\u2069]/g;\n\ninterface LocaleInfo extends LocaleDateFormat {\n /** Non-digit characters of the formatted date (allowed between the typed fields). */\n literals: Set<string>;\n /** Locale digit → ASCII digit (for non-Latin numbering systems). */\n digits: Map<string, string>;\n /** Formatted year minus the Gregorian year (e.g. 543 for the Buddhist calendar). */\n yearOffset: number;\n /** Digit count of a formatted year: shorter typed years are rejected (`25` is not 2025). */\n yearLength: number;\n}\n\nconst infoCache = new Map<string, LocaleInfo>();\nconst SAMPLE_DATE = makeDate(2001, 10, 23); // 23 Nov 2001: every field distinct\n\nfunction toAsciiDigits(text: string, digits: Map<string, string>): string {\n let out = '';\n for (const char of text.replace(BIDI_MARKS, '')) out += digits.get(char) ?? char;\n return out;\n}\n\nfunction getLocaleInfo(locale: string | undefined): LocaleInfo {\n const key = locale ?? '';\n const cached = infoCache.get(key);\n if (cached) return cached;\n\n const digits = new Map<string, string>();\n let numberFormat: Intl.NumberFormat;\n try {\n numberFormat = new Intl.NumberFormat(locale, { useGrouping: false });\n } catch {\n numberFormat = new Intl.NumberFormat(undefined, { useGrouping: false });\n }\n for (let i = 0; i <= 9; i++) digits.set(numberFormat.format(i), String(i));\n\n const parts = getFormatter(locale, DEFAULT_DATE_OPTIONS).formatToParts(SAMPLE_DATE);\n const order: DateField[] = [];\n const literals = new Set<string>();\n let pattern = '';\n let yearOffset = 0;\n let yearLength = 4;\n for (const part of parts) {\n if (part.type === 'day' || part.type === 'month' || part.type === 'year') {\n order.push(part.type);\n if (part.type === 'year') {\n const year = toAsciiDigits(part.value, digits);\n yearLength = year.length;\n yearOffset = Number(year) - SAMPLE_DATE.getFullYear();\n }\n pattern += part.type === 'day' ? 'DD' : part.type === 'month' ? 'MM' : 'YYYY';\n } else {\n const text = part.value.replace(BIDI_MARKS, '');\n pattern += text;\n for (const char of text) literals.add(char);\n }\n }\n const info: LocaleInfo = {\n order,\n pattern: pattern.trim(),\n literals,\n digits,\n yearOffset,\n yearLength,\n };\n infoCache.set(key, info);\n return info;\n}\n\n/**\n * The field order and a readable pattern (`DD/MM/YYYY`, `MM/DD/YYYY`, `DD.MM.YYYY`, …) of the\n * default date format for `locale` (runtime default when omitted).\n */\nexport function getLocaleDateFormat(locale?: string): LocaleDateFormat {\n const { order, pattern } = getLocaleInfo(locale);\n return { order: [...order], pattern };\n}\n\n/**\n * The default DatePicker display text: `Intl.DateTimeFormat(locale, { year: 'numeric', month:\n * '2-digit', day: '2-digit' })` in the grid-compatible calendar of {@link getCalendar} (`fa-IR`:\n * `۲۰۲۵/۰۶/۱۵`, not the Persian `۱۴۰۴/۰۳/۲۵`). {@link parseDate} with the same `locale` reverses it.\n */\nexport function formatDate(date: Date, locale?: string): string {\n return getFormatter(locale, DEFAULT_DATE_OPTIONS).format(date);\n}\n\n/** The numeric fields of `text` in order, or `null` when anything but separators surrounds them. */\nfunction digitGroups(text: string, info: LocaleInfo): string[] | null {\n const normalized = toAsciiDigits(text.trim(), info.digits);\n const groups = normalized.match(/\\d+/g);\n if (!groups) return null;\n for (const char of normalized.replace(/\\d+/g, '')) {\n if (/\\s/.test(char) || info.literals.has(char) || '/.-'.includes(char)) continue;\n return null;\n }\n return groups;\n}\n\n/**\n * Parses text typed in the default display format of `locale` — the exact inverse of\n * {@link formatDate} for the same locale — to local midnight. Also accepts single-digit day/month\n * fields, `/`, `.` and `-` separators, and ISO `yyyy-mm-dd`. Returns `null` for anything else:\n * impossible dates (31/02), a year shorter than the locale writes it (`25`), letters or extra\n * fields.\n */\nexport function parseDate(text: string, locale?: string): Date | null {\n if (!text.trim()) return null;\n const iso = parseISODate(text);\n if (iso) return iso;\n\n const info = getLocaleInfo(locale);\n if (info.order.length !== 3) return null;\n const groups = digitGroups(text, info);\n if (!groups || groups.length !== 3) return null;\n\n const values: Partial<Record<DateField, number>> = {};\n for (let i = 0; i < 3; i++) {\n const field = info.order[i];\n if (field === 'year' && groups[i].length < info.yearLength) return null;\n values[field] = Number(groups[i]);\n }\n const date = fromFields(\n (values.year ?? NaN) - info.yearOffset,\n values.month ?? NaN,\n values.day ?? NaN,\n );\n if (!date) return null;\n\n // Exact inverse: formatting the result must give back the typed numbers (guards calendars\n // whose months or days differ from the Gregorian ones).\n const roundTrip = digitGroups(formatDate(date, locale), info);\n if (!roundTrip || roundTrip.some((group, i) => Number(group) !== Number(groups[i]))) return null;\n return date;\n}\n\n/** The 12 long month names of `locale` (January … December). */\nexport function getMonthNames(locale?: string): string[] {\n const formatter = getFormatter(locale, { month: 'long' });\n return Array.from({ length: 12 }, (_, month) => formatter.format(makeDate(2001, month, 1)));\n}\n\n/** A weekday name in both lengths. */\nexport interface WeekdayName {\n /** Short name for the column header (`Mon`). */\n short: string;\n /** Full name for assistive technology (`Monday`). */\n long: string;\n}\n\n/** The seven weekday names of `locale`, starting at `firstDayOfWeek` (0 = Sunday). */\nexport function getWeekdayNames(locale: string | undefined, firstDayOfWeek = 0): WeekdayName[] {\n const short = getFormatter(locale, { weekday: 'short' });\n const long = getFormatter(locale, { weekday: 'long' });\n // 1 January 2023 was a Sunday.\n return Array.from({ length: 7 }, (_, i) => {\n const day = makeDate(2023, 0, 1 + ((firstDayOfWeek + i) % 7));\n return { short: short.format(day), long: long.format(day) };\n });\n}\n\n/** The calendar heading, e.g. `May 2025` / `Mai 2025`. */\nexport function formatMonthYear(date: Date, locale?: string): string {\n return getFormatter(locale, { month: 'long', year: 'numeric' }).format(date);\n}\n\n/** The short month name of a month cell, e.g. `Mar` / `Mär`. */\nexport function formatMonthShort(date: Date, locale?: string): string {\n return getFormatter(locale, { month: 'short' }).format(date);\n}\n\n/**\n * The year of a year cell and of the month view's heading, in the locale's digits and the\n * calendar of {@link getCalendar}, without an era: `2025`, the Buddhist `2568` of `th-TH`.\n */\nexport function formatYear(date: Date, locale?: string): string {\n const parts = getFormatter(locale, { year: 'numeric' }).formatToParts(date);\n return parts.find((part) => part.type === 'year')?.value ?? String(date.getFullYear());\n}\n\n/**\n * The year view's heading: the decade starting at `decadeStart` as a range of years\n * (`Intl.DateTimeFormat#formatRange`), e.g. `2020 – 2029`.\n */\nexport function formatDecade(decadeStart: number, locale?: string): string {\n return getFormatter(locale, { year: 'numeric' }).formatRange(\n makeDate(decadeStart, 0, 1),\n makeDate(decadeStart + 9, 11, 31),\n );\n}\n\n/** The accessible name of a day cell, e.g. `Monday, May 26, 2025`. */\nexport function formatDayLabel(date: Date, locale?: string): string {\n return getFormatter(locale, {\n weekday: 'long',\n year: 'numeric',\n month: 'long',\n day: 'numeric',\n }).format(date);\n}\n\nconst numberFormatCache = new Map<string, Intl.NumberFormat>();\n\n/** The day-of-month number in the locale's digits, without suffixes (`3`, not `3日`). */\nexport function formatDayNumber(date: Date, locale?: string): string {\n const key = locale ?? '';\n let formatter = numberFormatCache.get(key);\n if (!formatter) {\n try {\n formatter = new Intl.NumberFormat(locale, { useGrouping: false });\n } catch {\n formatter = new Intl.NumberFormat(undefined, { useGrouping: false });\n }\n numberFormatCache.set(key, formatter);\n }\n return formatter.format(date.getDate());\n}\n\n/* ------------------------------------------------------------------ */\n/* Time */\n/* ------------------------------------------------------------------ */\n\n/** TimePicker label style. */\nexport type TimeFormat = '12h' | '24h';\n\nconst TIME_24H = /^(\\d{1,2}):(\\d{2})(?::(\\d{2}))?$/;\nconst TIME_12H = /^(\\d{1,2}):(\\d{2})(?::(\\d{2}))?\\s*([ap])\\.?\\s*m\\.?$/i;\n\n/**\n * Minutes since midnight of a time string: `HH:mm`, `H:mm`, `HH:mm:ss` (seconds ignored) or a\n * 12-hour time such as `9:00 AM`, `12:30 pm`, `11:59 p.m.`. `NaN` when invalid.\n */\nexport function timeToMinutes(text: string): number {\n const value = text.trim();\n const twelve = TIME_12H.exec(value);\n const match = twelve ?? TIME_24H.exec(value);\n if (!match) return NaN;\n let hours = Number(match[1]);\n const minutes = Number(match[2]);\n const seconds = match[3] === undefined ? 0 : Number(match[3]);\n if (minutes > 59 || seconds > 59) return NaN;\n if (twelve) {\n if (hours < 1 || hours > 12) return NaN;\n const pm = match[4].toLowerCase() === 'p';\n hours = (hours % 12) + (pm ? 12 : 0);\n } else if (hours > 23) {\n return NaN;\n }\n return hours * 60 + minutes;\n}\n\n/** `HH:mm` (24-hour, zero-padded): the TimePicker value format. */\nexport function minutesToValue(minutes: number): string {\n const hours = Math.floor(minutes / 60) % 24;\n return `${pad(hours, 2)}:${pad(minutes % 60, 2)}`;\n}\n\n/** Display text of a time: `13:00` (`'24h'`) or `1:00 PM` (`'12h'`). */\nexport function minutesToTime(minutes: number, format: TimeFormat): string {\n if (format === '24h') return minutesToValue(minutes);\n const hours = Math.floor(minutes / 60) % 24;\n const period = hours >= 12 ? 'PM' : 'AM';\n const hours12 = hours % 12 === 0 ? 12 : hours % 12;\n return `${hours12}:${pad(minutes % 60, 2)} ${period}`;\n}\n\n/** The TimePicker step fallback for invalid values. */\nexport const DEFAULT_TIME_STEP = 30;\n\n/**\n * Guards a TimePicker `step`: a non-finite or non-positive step falls back to\n * {@link DEFAULT_TIME_STEP} (`valid: false`, so the component can report it); fractions are\n * floored to a whole number of minutes, at least 1.\n */\nexport function normalizeTimeStep(step: number): { step: number; valid: boolean } {\n if (!Number.isFinite(step) || step <= 0) return { step: DEFAULT_TIME_STEP, valid: false };\n return { step: Math.max(1, Math.floor(step)), valid: true };\n}\n\n/** One generated TimePicker option. */\nexport interface TimeOption {\n /** `HH:mm`. */\n value: string;\n /** Display text in the requested format. */\n label: string;\n}\n\n/**\n * The options from `minTime` to `maxTime` (inclusive) every `step` minutes. The step is guarded\n * with {@link normalizeTimeStep} (the loop always terminates); invalid or reversed bounds give\n * `[]`.\n */\nexport function generateTimeOptions(\n step: number,\n minTime: string,\n maxTime: string,\n format: TimeFormat,\n): TimeOption[] {\n const increment = normalizeTimeStep(step).step;\n const min = timeToMinutes(minTime);\n const max = timeToMinutes(maxTime);\n if (Number.isNaN(min) || Number.isNaN(max) || min > max) return [];\n const options: TimeOption[] = [];\n for (let minutes = min; minutes <= max; minutes += increment) {\n options.push({ value: minutesToValue(minutes), label: minutesToTime(minutes, format) });\n }\n return options;\n}\n"],"mappings":"mDAsCA,SAAgBO,EAAY,EAAS,EAAkB,CACrD,OAAOC,EAAE,YAAY,IAAMC,EAAE,YAAY,GAAKD,EAAE,SAAS,IAAMC,EAAE,SAAS,CAC5E,CAMA,SAAgBC,EAAc,EAAY,EAAmB,EAA4B,CACvF,IAAMC,EAAMX,EAAAA,WAAWY,CAAI,CAAC,CAAC,QAAQ,EAGrC,MADA,EADIC,GAAOF,EAAMX,EAAAA,WAAWa,CAAG,CAAC,CAAC,QAAQ,GACrCC,GAAOH,EAAMX,EAAAA,WAAWc,CAAG,CAAC,CAAC,QAAQ,EAE3C,CAGA,SAAgBC,EAAU,EAAY,EAAmB,EAAy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,CAAC,EAAG,MAAO,EAAK,CAC5D,CAeA,SAAgBC,EACd,EACA,EACA,EACA,EACc,CACd,IAAMC,EAAYH,EAAkBC,CAAI,CAAC,CAAC,KACpCvG,EAAM4F,EAAcc,CAAO,EAC3BzG,EAAM2F,EAAce,CAAO,EACjC,GAAI,OAAO,MAAM3G,CAAG,GAAK,OAAO,MAAMC,CAAG,GAAKD,EAAMC,EAAK,MAAO,CAAC,EACjE,IAAM+C,EAAwB,CAAC,EAC/B,IAAK,IAAI+C,EAAU/F,EAAK+F,GAAW9F,EAAK,GAAWwG,EACjDzD,EAAQ,KAAK,CAAE,MAAOkD,EAAeH,CAAO,EAAG,MAAOI,EAAcJ,EAASK,CAAM,CAAE,CAAC,EAExF,OAAOpD,CACT"}
@@ -1,71 +1,80 @@
1
1
  "use client";
2
+ import { addDays as e, addMonths as t, daysInMonth as n, isSameDay as r, makeDate as i, startOfDay as a, startOfMonth as o, startOfWeek as s } from "../../lib/date.mjs";
2
3
  //#region src/components/input/dateUtils.ts
3
- function e(e, t, n) {
4
- let r = new Date(2e3, 0, 1);
5
- return r.setFullYear(e, t, n), r.setHours(0, 0, 0, 0), r;
4
+ function c(e, t) {
5
+ return e.getFullYear() === t.getFullYear() && e.getMonth() === t.getMonth();
6
6
  }
7
- function t(t) {
8
- return e(t.getFullYear(), t.getMonth(), t.getDate());
7
+ function l(e, t, n) {
8
+ let r = a(e).getTime();
9
+ return !(t && r < a(t).getTime() || n && r > a(n).getTime());
9
10
  }
10
- function n(t) {
11
- return e(t.getFullYear(), t.getMonth(), 1);
11
+ function u(e, t, n) {
12
+ let r = a(e);
13
+ return t && r.getTime() < a(t).getTime() ? a(t) : n && r.getTime() > a(n).getTime() ? a(n) : r;
12
14
  }
13
- function r(t, n) {
14
- return e(t, n + 1, 0).getDate();
15
+ function d(e) {
16
+ return Math.floor(e / 10) * 10;
15
17
  }
16
- function i(t, n) {
17
- return e(t.getFullYear(), t.getMonth(), t.getDate() + n);
18
+ function f(e) {
19
+ return Array.from({ length: 12 }, (t, n) => i(e, n, 1));
18
20
  }
19
- function a(t, n) {
20
- let i = e(t.getFullYear(), t.getMonth() + n, 1), a = Math.min(t.getDate(), r(i.getFullYear(), i.getMonth()));
21
- return e(i.getFullYear(), i.getMonth(), a);
21
+ function p(e) {
22
+ return Array.from({ length: 12 }, (t, n) => i(e - 1 + n, 0, 1));
22
23
  }
23
- function o(e, t) {
24
- return !!e && !!t && e.getFullYear() === t.getFullYear() && e.getMonth() === t.getMonth() && e.getDate() === t.getDate();
24
+ function m(e, t, n) {
25
+ let r = o(e), s = i(r.getFullYear(), r.getMonth() + 1, 0);
26
+ return !!t && s < a(t) || !!n && r > a(n);
25
27
  }
26
- function s(e, t) {
27
- return e.getFullYear() === t.getFullYear() && e.getMonth() === t.getMonth();
28
+ function h(e, t, n) {
29
+ return !!t && i(e, 11, 31) < a(t) || !!n && i(e, 0, 1) > a(n);
28
30
  }
29
- function c(e, n, r) {
30
- let i = t(e).getTime();
31
- return !(n && i < t(n).getTime() || r && i > t(r).getTime());
31
+ function g(t, n) {
32
+ let r = o(t), i = (r.getDay() - n + 7) % 7, a = [];
33
+ for (let t = 0; t < 42; t++) a.push(e(r, t - i));
34
+ return a;
32
35
  }
33
- function l(e, n, r) {
34
- let i = t(e);
35
- return n && i.getTime() < t(n).getTime() ? t(n) : r && i.getTime() > t(r).getTime() ? t(r) : i;
36
+ function _(e, t, n, r) {
37
+ return !l(e, t, n) || !!r?.(a(e));
36
38
  }
37
- function u(e, t) {
38
- let r = n(e), a = (r.getDay() - t + 7) % 7, o = [];
39
- for (let e = 0; e < 42; e++) o.push(i(r, e - a));
40
- return o;
39
+ function v(t, r, i, c, l) {
40
+ let u = a(t), d;
41
+ if (r === "day") return [u];
42
+ if (r === "month") {
43
+ let t = o(u);
44
+ d = Array.from({ length: n(u.getFullYear(), u.getMonth()) }, (n, r) => e(t, r));
45
+ } else {
46
+ let t = s(u, i);
47
+ d = Array.from({ length: 7 }, (n, r) => e(t, r)), r === "work-week" && (d = d.filter((e) => c.includes(e.getDay())));
48
+ }
49
+ return l ? d.filter((e) => !l(e)) : d;
41
50
  }
42
- function d(e, t) {
51
+ function y(e, t) {
43
52
  return String(e).padStart(t, "0");
44
53
  }
45
- function f(e) {
46
- return `${d(e.getFullYear(), 4)}-${d(e.getMonth() + 1, 2)}-${d(e.getDate(), 2)}`;
54
+ function b(e) {
55
+ return `${y(e.getFullYear(), 4)}-${y(e.getMonth() + 1, 2)}-${y(e.getDate(), 2)}`;
47
56
  }
48
- function p(t, n, i) {
49
- return !Number.isInteger(t) || t < 1 || t > 9999 || !Number.isInteger(n) || n < 1 || n > 12 || !Number.isInteger(i) || i < 1 || i > r(t, n - 1) ? null : e(t, n - 1, i);
57
+ function x(e, t, r) {
58
+ return !Number.isInteger(e) || e < 1 || e > 9999 || !Number.isInteger(t) || t < 1 || t > 12 || !Number.isInteger(r) || r < 1 || r > n(e, t - 1) ? null : i(e, t - 1, r);
50
59
  }
51
- function m(e) {
60
+ function S(e) {
52
61
  let t = /^(\d{4})-(\d{2})-(\d{2})$/.exec(e.trim());
53
- return t ? p(Number(t[1]), Number(t[2]), Number(t[3])) : null;
62
+ return t ? x(Number(t[1]), Number(t[2]), Number(t[3])) : null;
54
63
  }
55
- function h(e) {
64
+ function C(e) {
56
65
  try {
57
66
  return Intl.getCanonicalLocales(e), !0;
58
67
  } catch {
59
68
  return !1;
60
69
  }
61
70
  }
62
- var g = {
71
+ var w = {
63
72
  year: "numeric",
64
73
  month: "2-digit",
65
74
  day: "2-digit"
66
- }, _ = /* @__PURE__ */ new Set(["gregory", "buddhist"]), v = /* @__PURE__ */ new Map();
67
- function y(e) {
68
- let t = e ?? "", n = v.get(t);
75
+ }, T = /* @__PURE__ */ new Set(["gregory", "buddhist"]), E = /* @__PURE__ */ new Map();
76
+ function D(e) {
77
+ let t = e ?? "", n = E.get(t);
69
78
  if (n === void 0) {
70
79
  let r;
71
80
  try {
@@ -73,35 +82,35 @@ function y(e) {
73
82
  } catch {
74
83
  r = new Intl.DateTimeFormat().resolvedOptions().calendar;
75
84
  }
76
- n = _.has(r) ? r : "gregory", v.set(t, n);
85
+ n = T.has(r) ? r : "gregory", E.set(t, n);
77
86
  }
78
87
  return n;
79
88
  }
80
- var b = /* @__PURE__ */ new Map();
81
- function x(e, t) {
82
- let n = `${e ?? ""}|${JSON.stringify(t)}`, r = b.get(n);
89
+ var O = /* @__PURE__ */ new Map();
90
+ function k(e, t) {
91
+ let n = `${e ?? ""}|${JSON.stringify(t)}`, r = O.get(n);
83
92
  if (!r) {
84
93
  let i = {
85
94
  ...t,
86
- calendar: y(e)
95
+ calendar: D(e)
87
96
  };
88
97
  try {
89
98
  r = new Intl.DateTimeFormat(e, i);
90
99
  } catch {
91
100
  r = new Intl.DateTimeFormat(void 0, i);
92
101
  }
93
- b.set(n, r);
102
+ O.set(n, r);
94
103
  }
95
104
  return r;
96
105
  }
97
- var S = /[\u061c\u200b-\u200f\u202a-\u202e\u2066-\u2069]/g, C = /* @__PURE__ */ new Map(), w = e(2001, 10, 23);
98
- function T(e, t) {
106
+ var A = /[\u061c\u200b-\u200f\u202a-\u202e\u2066-\u2069]/g, j = /* @__PURE__ */ new Map(), M = i(2001, 10, 23);
107
+ function N(e, t) {
99
108
  let n = "";
100
- for (let r of e.replace(S, "")) n += t.get(r) ?? r;
109
+ for (let r of e.replace(A, "")) n += t.get(r) ?? r;
101
110
  return n;
102
111
  }
103
- function E(e) {
104
- let t = e ?? "", n = C.get(t);
112
+ function P(e) {
113
+ let t = e ?? "", n = j.get(t);
105
114
  if (n) return n;
106
115
  let r = /* @__PURE__ */ new Map(), i;
107
116
  try {
@@ -110,15 +119,15 @@ function E(e) {
110
119
  i = new Intl.NumberFormat(void 0, { useGrouping: !1 });
111
120
  }
112
121
  for (let e = 0; e <= 9; e++) r.set(i.format(e), String(e));
113
- let a = x(e, g).formatToParts(w), o = [], s = /* @__PURE__ */ new Set(), c = "", l = 0, u = 4;
122
+ let a = k(e, w).formatToParts(M), o = [], s = /* @__PURE__ */ new Set(), c = "", l = 0, u = 4;
114
123
  for (let e of a) if (e.type === "day" || e.type === "month" || e.type === "year") {
115
124
  if (o.push(e.type), e.type === "year") {
116
- let t = T(e.value, r);
117
- u = t.length, l = Number(t) - w.getFullYear();
125
+ let t = N(e.value, r);
126
+ u = t.length, l = Number(t) - M.getFullYear();
118
127
  }
119
128
  c += e.type === "day" ? "DD" : e.type === "month" ? "MM" : "YYYY";
120
129
  } else {
121
- let t = e.value.replace(S, "");
130
+ let t = e.value.replace(A, "");
122
131
  c += t;
123
132
  for (let e of t) s.add(e);
124
133
  }
@@ -130,31 +139,31 @@ function E(e) {
130
139
  yearOffset: l,
131
140
  yearLength: u
132
141
  };
133
- return C.set(t, d), d;
142
+ return j.set(t, d), d;
134
143
  }
135
- function D(e) {
136
- let { order: t, pattern: n } = E(e);
144
+ function F(e) {
145
+ let { order: t, pattern: n } = P(e);
137
146
  return {
138
147
  order: [...t],
139
148
  pattern: n
140
149
  };
141
150
  }
142
- function O(e, t) {
143
- return x(t, g).format(e);
151
+ function I(e, t) {
152
+ return k(t, w).format(e);
144
153
  }
145
- function k(e, t) {
146
- let n = T(e.trim(), t.digits), r = n.match(/\d+/g);
154
+ function L(e, t) {
155
+ let n = N(e.trim(), t.digits), r = n.match(/\d+/g);
147
156
  if (!r) return null;
148
157
  for (let e of n.replace(/\d+/g, "")) if (!(/\s/.test(e) || t.literals.has(e) || "/.-".includes(e))) return null;
149
158
  return r;
150
159
  }
151
- function A(e, t) {
160
+ function R(e, t) {
152
161
  if (!e.trim()) return null;
153
- let n = m(e);
162
+ let n = S(e);
154
163
  if (n) return n;
155
- let r = E(t);
164
+ let r = P(t);
156
165
  if (r.order.length !== 3) return null;
157
- let i = k(e, r);
166
+ let i = L(e, r);
158
167
  if (!i || i.length !== 3) return null;
159
168
  let a = {};
160
169
  for (let e = 0; e < 3; e++) {
@@ -162,51 +171,60 @@ function A(e, t) {
162
171
  if (t === "year" && i[e].length < r.yearLength) return null;
163
172
  a[t] = Number(i[e]);
164
173
  }
165
- let o = p((a.year ?? NaN) - r.yearOffset, a.month ?? NaN, a.day ?? NaN);
174
+ let o = x((a.year ?? NaN) - r.yearOffset, a.month ?? NaN, a.day ?? NaN);
166
175
  if (!o) return null;
167
- let s = k(O(o, t), r);
176
+ let s = L(I(o, t), r);
168
177
  return !s || s.some((e, t) => Number(e) !== Number(i[t])) ? null : o;
169
178
  }
170
- function j(t, n = 0) {
171
- let r = x(t, { weekday: "short" }), i = x(t, { weekday: "long" });
172
- return Array.from({ length: 7 }, (t, a) => {
173
- let o = e(2023, 0, 1 + (n + a) % 7);
179
+ function z(e, t = 0) {
180
+ let n = k(e, { weekday: "short" }), r = k(e, { weekday: "long" });
181
+ return Array.from({ length: 7 }, (e, a) => {
182
+ let o = i(2023, 0, 1 + (t + a) % 7);
174
183
  return {
175
- short: r.format(o),
176
- long: i.format(o)
184
+ short: n.format(o),
185
+ long: r.format(o)
177
186
  };
178
187
  });
179
188
  }
180
- function M(e, t) {
181
- return x(t, {
189
+ function B(e, t) {
190
+ return k(t, {
182
191
  month: "long",
183
192
  year: "numeric"
184
193
  }).format(e);
185
194
  }
186
- function N(e, t) {
187
- return x(t, {
195
+ function V(e, t) {
196
+ return k(t, { month: "short" }).format(e);
197
+ }
198
+ function H(e, t) {
199
+ return k(t, { year: "numeric" }).formatToParts(e).find((e) => e.type === "year")?.value ?? String(e.getFullYear());
200
+ }
201
+ function U(e, t) {
202
+ return k(t, { year: "numeric" }).formatRange(i(e, 0, 1), i(e + 9, 11, 31));
203
+ }
204
+ function W(e, t) {
205
+ return k(t, {
188
206
  weekday: "long",
189
207
  year: "numeric",
190
208
  month: "long",
191
209
  day: "numeric"
192
210
  }).format(e);
193
211
  }
194
- var P = /* @__PURE__ */ new Map();
195
- function F(e, t) {
196
- let n = t ?? "", r = P.get(n);
212
+ var G = /* @__PURE__ */ new Map();
213
+ function K(e, t) {
214
+ let n = t ?? "", r = G.get(n);
197
215
  if (!r) {
198
216
  try {
199
217
  r = new Intl.NumberFormat(t, { useGrouping: !1 });
200
218
  } catch {
201
219
  r = new Intl.NumberFormat(void 0, { useGrouping: !1 });
202
220
  }
203
- P.set(n, r);
221
+ G.set(n, r);
204
222
  }
205
223
  return r.format(e.getDate());
206
224
  }
207
- var I = /^(\d{1,2}):(\d{2})(?::(\d{2}))?$/, L = /^(\d{1,2}):(\d{2})(?::(\d{2}))?\s*([ap])\.?\s*m\.?$/i;
208
- function R(e) {
209
- let t = e.trim(), n = L.exec(t), r = n ?? I.exec(t);
225
+ var q = /^(\d{1,2}):(\d{2})(?::(\d{2}))?$/, J = /^(\d{1,2}):(\d{2})(?::(\d{2}))?\s*([ap])\.?\s*m\.?$/i;
226
+ function Y(e) {
227
+ let t = e.trim(), n = J.exec(t), r = n ?? q.exec(t);
210
228
  if (!r) return NaN;
211
229
  let i = Number(r[1]), a = Number(r[2]), o = r[3] === void 0 ? 0 : Number(r[3]);
212
230
  if (a > 59 || o > 59) return NaN;
@@ -217,15 +235,15 @@ function R(e) {
217
235
  } else if (i > 23) return NaN;
218
236
  return i * 60 + a;
219
237
  }
220
- function z(e) {
221
- return `${d(Math.floor(e / 60) % 24, 2)}:${d(e % 60, 2)}`;
238
+ function X(e) {
239
+ return `${y(Math.floor(e / 60) % 24, 2)}:${y(e % 60, 2)}`;
222
240
  }
223
- function B(e, t) {
224
- if (t === "24h") return z(e);
241
+ function Z(e, t) {
242
+ if (t === "24h") return X(e);
225
243
  let n = Math.floor(e / 60) % 24, r = n >= 12 ? "PM" : "AM";
226
- return `${n % 12 == 0 ? 12 : n % 12}:${d(e % 60, 2)} ${r}`;
244
+ return `${n % 12 == 0 ? 12 : n % 12}:${y(e % 60, 2)} ${r}`;
227
245
  }
228
- function V(e) {
246
+ function Q(e) {
229
247
  return !Number.isFinite(e) || e <= 0 ? {
230
248
  step: 30,
231
249
  valid: !1
@@ -234,17 +252,17 @@ function V(e) {
234
252
  valid: !0
235
253
  };
236
254
  }
237
- function H(e, t, n, r) {
238
- let i = V(e).step, a = R(t), o = R(n);
255
+ function $(e, t, n, r) {
256
+ let i = Q(e).step, a = Y(t), o = Y(n);
239
257
  if (Number.isNaN(a) || Number.isNaN(o) || a > o) return [];
240
258
  let s = [];
241
259
  for (let e = a; e <= o; e += i) s.push({
242
- value: z(e),
243
- label: B(e, r)
260
+ value: X(e),
261
+ label: Z(e, r)
244
262
  });
245
263
  return s;
246
264
  }
247
265
  //#endregion
248
- export { i as addDays, a as addMonths, l as clampDate, O as formatDate, N as formatDayLabel, F as formatDayNumber, f as formatISODate, M as formatMonthYear, H as generateTimeOptions, u as getCalendarDays, D as getLocaleDateFormat, j as getWeekdayNames, c as isDateInRange, o as isSameDay, s as isSameMonth, h as isValidLocaleTag, B as minutesToTime, z as minutesToValue, V as normalizeTimeStep, A as parseDate, m as parseISODate, t as startOfDay, n as startOfMonth, R as timeToMinutes };
266
+ export { e as addDays, t as addMonths, u as clampDate, I as formatDate, W as formatDayLabel, K as formatDayNumber, U as formatDecade, b as formatISODate, V as formatMonthShort, B as formatMonthYear, H as formatYear, $ as generateTimeOptions, g as getCalendarDays, d as getDecadeStart, p as getDecadeYears, F as getLocaleDateFormat, v as getSelectionRange, z as getWeekdayNames, f as getYearMonths, l as isDateInRange, _ as isDayUnavailable, m as isMonthOutOfRange, r as isSameDay, c as isSameMonth, C as isValidLocaleTag, h as isYearOutOfRange, Z as minutesToTime, X as minutesToValue, Q as normalizeTimeStep, R as parseDate, S as parseISODate, a as startOfDay, o as startOfMonth, Y as timeToMinutes };
249
267
 
250
268
  //# sourceMappingURL=dateUtils.mjs.map