@servicetitan/anvil2 1.46.1 → 1.46.3

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 (267) hide show
  1. package/CHANGELOG.md +48 -0
  2. package/dist/{Alert-BNGvfMAV.js → Alert-CPOBY6O5.js} +2 -2
  3. package/dist/{Alert-BNGvfMAV.js.map → Alert-CPOBY6O5.js.map} +1 -1
  4. package/dist/Alert.js +1 -1
  5. package/dist/{Announcement-CoheCP1i.js → Announcement-BvzAEdx8.js} +2 -2
  6. package/dist/{Announcement-CoheCP1i.js.map → Announcement-BvzAEdx8.js.map} +1 -1
  7. package/dist/Announcement.js +1 -1
  8. package/dist/AnvilProvider-C_qRQnE6.js.map +1 -1
  9. package/dist/{Avatar-CyGjhToG.js → Avatar-3d5Kv2CF.js} +2 -2
  10. package/dist/{Avatar-CyGjhToG.js.map → Avatar-3d5Kv2CF.js.map} +1 -1
  11. package/dist/{Avatar-D07f9NH_.js → Avatar-DJ3oJNsv.js} +2 -2
  12. package/dist/{Avatar-D07f9NH_.js.map → Avatar-DJ3oJNsv.js.map} +1 -1
  13. package/dist/Avatar.js +2 -2
  14. package/dist/Badge-DCA9mfc2.js.map +1 -1
  15. package/dist/Breadcrumbs-C4_PEolS.js.map +1 -1
  16. package/dist/{Button-BxFXQ0-n.js → Button-VNQQgZ45.js} +2 -2
  17. package/dist/{Button-BxFXQ0-n.js.map → Button-VNQQgZ45.js.map} +1 -1
  18. package/dist/Button.css +48 -48
  19. package/dist/Button.js +1 -1
  20. package/dist/Button.module-C1g9rrJs.js +25 -0
  21. package/dist/Button.module-C1g9rrJs.js.map +1 -0
  22. package/dist/{ButtonCompound-BF2Q6gGX.js → ButtonCompound-BbPK-Xjj.js} +2 -2
  23. package/dist/{ButtonCompound-BF2Q6gGX.js.map → ButtonCompound-BbPK-Xjj.js.map} +1 -1
  24. package/dist/ButtonCompound.js +1 -1
  25. package/dist/{ButtonLink-CXv65WVV.js → ButtonLink-CqR1F5Wn.js} +3 -3
  26. package/dist/{ButtonLink-CXv65WVV.js.map → ButtonLink-CqR1F5Wn.js.map} +1 -1
  27. package/dist/ButtonLink.js +1 -1
  28. package/dist/{ButtonToggle-pSwg7NvT.js → ButtonToggle-PCeSG-5D.js} +3 -3
  29. package/dist/{ButtonToggle-pSwg7NvT.js.map → ButtonToggle-PCeSG-5D.js.map} +1 -1
  30. package/dist/ButtonToggle.js +1 -1
  31. package/dist/{Calendar-BQ5F2ENO.js → Calendar-Cn0fOgog.js} +366 -169
  32. package/dist/Calendar-Cn0fOgog.js.map +1 -0
  33. package/dist/Calendar.js +1 -1
  34. package/dist/Card-vTYeSkxt.js.map +1 -1
  35. package/dist/{Checkbox-Dl4KTwEJ.js → Checkbox-C5PX8wur.js} +2 -2
  36. package/dist/{Checkbox-Dl4KTwEJ.js.map → Checkbox-C5PX8wur.js.map} +1 -1
  37. package/dist/{Checkbox-DDrmVC-u.js → Checkbox-DAODkzN3.js} +2 -2
  38. package/dist/{Checkbox-DDrmVC-u.js.map → Checkbox-DAODkzN3.js.map} +1 -1
  39. package/dist/Checkbox.js +2 -2
  40. package/dist/{Chip-Bz-vlQ4D.js → Chip-DLU13qe-.js} +2 -2
  41. package/dist/{Chip-Bz-vlQ4D.js.map → Chip-DLU13qe-.js.map} +1 -1
  42. package/dist/Chip.js +1 -1
  43. package/dist/{Combobox-B9nesJuc.js → Combobox-DO8cIvRQ.js} +146 -55
  44. package/dist/Combobox-DO8cIvRQ.js.map +1 -0
  45. package/dist/Combobox.js +1 -1
  46. package/dist/{DateField-DXxPsRtf.js → DateField-qHdgwSlB.js} +36 -102
  47. package/dist/DateField-qHdgwSlB.js.map +1 -0
  48. package/dist/DateField.js +1 -1
  49. package/dist/{DateFieldRange-Xauviu1w.js → DateFieldRange-GNpWV70g.js} +57 -58
  50. package/dist/DateFieldRange-GNpWV70g.js.map +1 -0
  51. package/dist/DateFieldRange.js +1 -1
  52. package/dist/{DateFieldSingle-yLnwpVzd.js → DateFieldSingle-B9caNibj.js} +53 -55
  53. package/dist/DateFieldSingle-B9caNibj.js.map +1 -0
  54. package/dist/DateFieldSingle.js +1 -1
  55. package/dist/{DateFieldYearless-Ba7HiTiI.js → DateFieldYearless-BmeKGaDc.js} +4 -4
  56. package/dist/{DateFieldYearless-Ba7HiTiI.js.map → DateFieldYearless-BmeKGaDc.js.map} +1 -1
  57. package/dist/DateFieldYearless.js +1 -1
  58. package/dist/{DaysOfTheWeek-BYSYZySH.js → DaysOfTheWeek-DPH13VCK.js} +4 -4
  59. package/dist/{DaysOfTheWeek-BYSYZySH.js.map → DaysOfTheWeek-DPH13VCK.js.map} +1 -1
  60. package/dist/DaysOfTheWeek.js +1 -1
  61. package/dist/Details-CF8DImjw.js.map +1 -1
  62. package/dist/{Dialog-CgkrvrQu.js → Dialog-BHFLnFNQ.js} +7 -7
  63. package/dist/{Dialog-CgkrvrQu.js.map → Dialog-BHFLnFNQ.js.map} +1 -1
  64. package/dist/Dialog.js +1 -1
  65. package/dist/Divider-DJe8kLf2.js.map +1 -1
  66. package/dist/Dnd.js +1 -1
  67. package/dist/DndSort.js +2 -2
  68. package/dist/DndSort.js.map +1 -1
  69. package/dist/{Drawer-CM4ZbAro.js → Drawer-BDA7Sjj9.js} +7 -7
  70. package/dist/{Drawer-CM4ZbAro.js.map → Drawer-BDA7Sjj9.js.map} +1 -1
  71. package/dist/Drawer.js +1 -1
  72. package/dist/{DrawerContext-DboTgTmo.js → DrawerContext-D4tWTLVf.js} +27 -10
  73. package/dist/DrawerContext-D4tWTLVf.js.map +1 -0
  74. package/dist/{EditCard-WKzZ2XCz.js → EditCard-CZzL0nx7.js} +2 -2
  75. package/dist/{EditCard-WKzZ2XCz.js.map → EditCard-CZzL0nx7.js.map} +1 -1
  76. package/dist/EditCard.js +1 -1
  77. package/dist/{FieldLabel-BsbTTyom.js → FieldLabel-Bgl3iu13.js} +2 -2
  78. package/dist/{FieldLabel-BsbTTyom.js.map → FieldLabel-Bgl3iu13.js.map} +1 -1
  79. package/dist/FieldLabel.js +1 -1
  80. package/dist/FieldMessage-B7uQ8vmr.js.map +1 -1
  81. package/dist/Flex-BdQMekvA.js.map +1 -1
  82. package/dist/Grid-MGUC698u.js.map +1 -1
  83. package/dist/Helper-BkIDJqgA.js.map +1 -1
  84. package/dist/Icon-D8SPKeO4.js.map +1 -1
  85. package/dist/{InputMask-_F139qFu.js → InputMask-B13KumrK.js} +3 -3
  86. package/dist/{InputMask-_F139qFu.js.map → InputMask-B13KumrK.js.map} +1 -1
  87. package/dist/InputMask.js +1 -1
  88. package/dist/Layout-CUUb2PVr.js.map +1 -1
  89. package/dist/Link-eRsLWPaQ.js.map +1 -1
  90. package/dist/LinkButton-2lXfrVoU.js.map +1 -1
  91. package/dist/{ListView-pb3rIcze.js → ListView-C-cVQZHp.js} +3 -3
  92. package/dist/{ListView-pb3rIcze.js.map → ListView-C-cVQZHp.js.map} +1 -1
  93. package/dist/ListView.js +1 -1
  94. package/dist/{Listbox-CUhMbFm2.js → Listbox-DxGx630W.js} +2 -2
  95. package/dist/{Listbox-CUhMbFm2.js.map → Listbox-DxGx630W.js.map} +1 -1
  96. package/dist/Listbox.js +1 -1
  97. package/dist/LocalizationContext-UsmB5mnR.js.map +1 -1
  98. package/dist/LocalizationProvider-DEZyjW5d.js.map +1 -1
  99. package/dist/{Menu-DEVZz9xZ.js → Menu-DUZqzpwg.js} +8 -10
  100. package/dist/Menu-DUZqzpwg.js.map +1 -0
  101. package/dist/Menu.js +1 -1
  102. package/dist/{NumberField-CkZZrkYC.js → NumberField-DWPAy1eG.js} +11 -11
  103. package/dist/{NumberField-CkZZrkYC.js.map → NumberField-DWPAy1eG.js.map} +1 -1
  104. package/dist/NumberField.css +9 -6
  105. package/dist/NumberField.js +1 -1
  106. package/dist/Overflow.js.map +1 -1
  107. package/dist/{Page-BMDkbDcU.js → Page-BfH2mGSt.js} +11 -11
  108. package/dist/Page-BfH2mGSt.js.map +1 -0
  109. package/dist/Page.js +1 -1
  110. package/dist/{Pagination-BJsCppgW.js → Pagination-B_G9QcHf.js} +48 -24
  111. package/dist/Pagination-B_G9QcHf.js.map +1 -0
  112. package/dist/Pagination.css +6 -6
  113. package/dist/Pagination.js +1 -1
  114. package/dist/{Popover-r26xMIfm.js → Popover-v8R920kj.js} +137 -196
  115. package/dist/Popover-v8R920kj.js.map +1 -0
  116. package/dist/Popover.js +1 -1
  117. package/dist/PortalProvider-9lXkQ0xY.js.map +1 -1
  118. package/dist/{ProgressBar-DXcXZEJ2.js → ProgressBar-BWN2yv1s.js} +2 -2
  119. package/dist/{ProgressBar-DXcXZEJ2.js.map → ProgressBar-BWN2yv1s.js.map} +1 -1
  120. package/dist/ProgressBar.js +1 -1
  121. package/dist/{Radio-C89VCMXd.js → Radio-C5riI-do.js} +2 -2
  122. package/dist/{Radio-C89VCMXd.js.map → Radio-C5riI-do.js.map} +1 -1
  123. package/dist/Radio.js +2 -2
  124. package/dist/{RadioGroup-C_4buUtG.js → RadioGroup-B7O06pVu.js} +2 -2
  125. package/dist/{RadioGroup-C_4buUtG.js.map → RadioGroup-B7O06pVu.js.map} +1 -1
  126. package/dist/{SearchField-Bb0uObwG.js → SearchField-CbwGErC4.js} +2 -2
  127. package/dist/{SearchField-Bb0uObwG.js.map → SearchField-CbwGErC4.js.map} +1 -1
  128. package/dist/SearchField.js +1 -1
  129. package/dist/{SegmentedControl-CsjjV1Dz.js → SegmentedControl-CLDdes8W.js} +4 -4
  130. package/dist/{SegmentedControl-CsjjV1Dz.js.map → SegmentedControl-CLDdes8W.js.map} +1 -1
  131. package/dist/SegmentedControl.js +1 -1
  132. package/dist/{SelectCard-BTYZg9TG.js → SelectCard-Ca07K1FW.js} +3 -3
  133. package/dist/{SelectCard-BTYZg9TG.js.map → SelectCard-Ca07K1FW.js.map} +1 -1
  134. package/dist/SelectCard.js +1 -1
  135. package/dist/{SelectTrigger-f1hvRrSC.js → SelectTrigger-CaXX1SHG.js} +3 -3
  136. package/dist/{SelectTrigger-f1hvRrSC.js.map → SelectTrigger-CaXX1SHG.js.map} +1 -1
  137. package/dist/SelectTrigger.js +1 -1
  138. package/dist/{SelectTriggerBase-DP9fmRSo.js → SelectTriggerBase-C7TLCna1.js} +4 -4
  139. package/dist/{SelectTriggerBase-DP9fmRSo.js.map → SelectTriggerBase-C7TLCna1.js.map} +1 -1
  140. package/dist/{SideNav-CBAzYyML.js → SideNav-nqq5sAwz.js} +3 -3
  141. package/dist/SideNav-nqq5sAwz.js.map +1 -0
  142. package/dist/SideNav.js +1 -1
  143. package/dist/Skeleton.js.map +1 -1
  144. package/dist/Spinner-wmO8Epw0.js.map +1 -1
  145. package/dist/SrOnly-CTsYSuby.js.map +1 -1
  146. package/dist/{Stepper-D-fOH9TF.js → Stepper-DQ_Hm-AI.js} +4 -4
  147. package/dist/{Stepper-D-fOH9TF.js.map → Stepper-DQ_Hm-AI.js.map} +1 -1
  148. package/dist/Stepper.js +1 -1
  149. package/dist/Switch-C2ddZcr9.js.map +1 -1
  150. package/dist/{Tab-wNucMTgo.js → Tab-CzNx3IdF.js} +45 -37
  151. package/dist/Tab-CzNx3IdF.js.map +1 -0
  152. package/dist/Tab.js +1 -1
  153. package/dist/Text-BqvcbXyp.js.map +1 -1
  154. package/dist/{TextField-D8fow9j7.js → TextField-D9gD-34Q.js} +3 -3
  155. package/dist/{TextField-D8fow9j7.js.map → TextField-D9gD-34Q.js.map} +1 -1
  156. package/dist/{TextField-BiHxlzE3.js → TextField-uCHgwO5F.js} +2 -2
  157. package/dist/{TextField-BiHxlzE3.js.map → TextField-uCHgwO5F.js.map} +1 -1
  158. package/dist/TextField.js +1 -1
  159. package/dist/{Textarea-BdVJJlbP.js → Textarea-B2-6m291.js} +3 -3
  160. package/dist/{Textarea-BdVJJlbP.js.map → Textarea-B2-6m291.js.map} +1 -1
  161. package/dist/Textarea.js +1 -1
  162. package/dist/ThemeProvider-Be3Pvtpz.js.map +1 -1
  163. package/dist/ThemeProviderContext-l52GohYT.js.map +1 -1
  164. package/dist/{TimeField-CmbErrsZ.js → TimeField-B5Jgy-Zg.js} +363 -360
  165. package/dist/TimeField-B5Jgy-Zg.js.map +1 -0
  166. package/dist/TimeField.js +1 -1
  167. package/dist/Toast.js +2 -2
  168. package/dist/{Toaster-B7zUwJOt.js → Toaster-CHyB-Mxs.js} +3 -3
  169. package/dist/{Toaster-B7zUwJOt.js.map → Toaster-CHyB-Mxs.js.map} +1 -1
  170. package/dist/{Toaster-9cpG_tWR.js → Toaster-CyiGDKMh.js} +18 -18
  171. package/dist/{Toaster-9cpG_tWR.js.map → Toaster-CyiGDKMh.js.map} +1 -1
  172. package/dist/{Toolbar-D4zuUFhb.js → Toolbar-BXGTrR6o.js} +19 -18
  173. package/dist/Toolbar-BXGTrR6o.js.map +1 -0
  174. package/dist/Toolbar.js +1 -1
  175. package/dist/{Tooltip-BI3Xs75X.js → Tooltip-DhtVlhah.js} +9 -3
  176. package/dist/{Tooltip-BI3Xs75X.js.map → Tooltip-DhtVlhah.js.map} +1 -1
  177. package/dist/Tooltip.js +1 -1
  178. package/dist/TrackingProvider-BtSjkmpM.js.map +1 -1
  179. package/dist/beta.js +1 -1
  180. package/dist/childrenToString-Bz9MqbHb.js.map +1 -1
  181. package/dist/components/Calendar/Calendar.d.ts +5 -0
  182. package/dist/components/Calendar/CalendarNowButton.d.ts +3 -1
  183. package/dist/components/Combobox/ComboboxTypes.d.ts +10 -5
  184. package/dist/components/Combobox/internal/ComboboxGroupContext.d.ts +1 -1
  185. package/dist/components/Combobox/internal/useGroups.d.ts +2 -2
  186. package/dist/components/DndSort/internal/test-utils.d.ts +1 -1
  187. package/dist/components/Popover/Popover.d.ts +136 -1
  188. package/dist/components/Popover/PopoverTrigger.d.ts +0 -1
  189. package/dist/components/Popover/internal/PopoverContext.d.ts +5 -3
  190. package/dist/components/Popover/internal/usePopoverContext.d.ts +6 -4
  191. package/dist/components/TimeField/TimeField.d.ts +4 -1
  192. package/dist/extends-Bg2s_OKl.js.map +1 -1
  193. package/dist/getActiveElement-BcSyVE7S.js.map +1 -1
  194. package/dist/getKeyboardFocusableElements-QqcABz0D.js.map +1 -1
  195. package/dist/hooks/useMergeRefs/useMergeRefs.d.ts +11 -0
  196. package/dist/{index-V5Ez2gq_.js → index-DrM3iid4.js} +2 -2
  197. package/dist/{index-V5Ez2gq_.js.map → index-DrM3iid4.js.map} +1 -1
  198. package/dist/index-tZvMCc77.js.map +1 -1
  199. package/dist/{index.esm-D889iexm.js → index.esm-BwMVvxTV.js} +199 -144
  200. package/dist/index.esm-BwMVvxTV.js.map +1 -0
  201. package/dist/index.js +52 -52
  202. package/dist/index.js.map +1 -1
  203. package/dist/internal/hooks/useFocusWithin/useFocusWithin.d.ts +2 -1
  204. package/dist/internal/hooks/useKeyboardFocusables/useKeyboardFocusables.d.ts +0 -1
  205. package/dist/internal/hooks/useOnClickOutside/useOnClickOutside.d.ts +5 -1
  206. package/dist/makeZeroShortcutPreprocessor-CxsiGTRW.js.map +1 -1
  207. package/dist/{proxy-CreWmH-e.js → proxy-BbFHSE6L.js} +8631 -8680
  208. package/dist/proxy-BbFHSE6L.js.map +1 -0
  209. package/dist/{use-reduced-motion-znCm41qB.js → use-reduced-motion-DSpxmqyT.js} +3 -3
  210. package/dist/use-reduced-motion-DSpxmqyT.js.map +1 -0
  211. package/dist/useAccessibleColor-BYKjkGRg.js.map +1 -1
  212. package/dist/useBreakpoint-Cv5fnZxs.js.map +1 -1
  213. package/dist/{useFocusWithin-BhhgRXdZ.js → useFocusWithin-hi77jsrB.js} +6 -3
  214. package/dist/useFocusWithin-hi77jsrB.js.map +1 -0
  215. package/dist/useInfiniteCombobox-WcRgC9p6.js.map +1 -1
  216. package/dist/useIntersectionObserver-BEmMDO3P.js.map +1 -1
  217. package/dist/{useDialogTransitionStates-2NaE_noq.js → useKeyboardFocusables-ek2mYel-.js} +46 -5
  218. package/dist/useKeyboardFocusables-ek2mYel-.js.map +1 -0
  219. package/dist/useLayoutPropsUtil-DjD5IMh0.js.map +1 -1
  220. package/dist/useMergeRefs-Dfmtq9cI.js +22 -0
  221. package/dist/useMergeRefs-Dfmtq9cI.js.map +1 -0
  222. package/dist/useMergeRefs.js +1 -1
  223. package/dist/{useOnClickOutside-BHEWMLa9.js → useOnClickOutside-C5AZE_I6.js} +6 -62
  224. package/dist/useOnClickOutside-C5AZE_I6.js.map +1 -0
  225. package/dist/useOptionallyControlledState-DbDuos5L.js.map +1 -1
  226. package/dist/{usePopoverSupport-DIjjfodl.js → usePopoverSupport-CWTCDfN2.js} +2 -2
  227. package/dist/{usePopoverSupport-DIjjfodl.js.map → usePopoverSupport-CWTCDfN2.js.map} +1 -1
  228. package/dist/usePrefersColorScheme-_hT7dK7_.js.map +1 -1
  229. package/dist/usePrevious-Bvq-5auG.js.map +1 -1
  230. package/dist/useSize.js.map +1 -1
  231. package/dist/{useSwipe-CULmVQEk.js → useSwipe-Cp-CJxLU.js} +2 -2
  232. package/dist/{useSwipe-CULmVQEk.js.map → useSwipe-Cp-CJxLU.js.map} +1 -1
  233. package/dist/useSwipe.js +1 -1
  234. package/dist/useTrackingContext-DRwDL8DE.js.map +1 -1
  235. package/dist/useTrackingId.js.map +1 -1
  236. package/dist/utils-CnKBdBNm.js +50 -0
  237. package/dist/utils-CnKBdBNm.js.map +1 -0
  238. package/package.json +12 -18
  239. package/dist/Button.module-pUNSKoVC.js +0 -25
  240. package/dist/Button.module-pUNSKoVC.js.map +0 -1
  241. package/dist/Calendar-BQ5F2ENO.js.map +0 -1
  242. package/dist/Combobox-B9nesJuc.js.map +0 -1
  243. package/dist/DateField-DXxPsRtf.js.map +0 -1
  244. package/dist/DateFieldRange-Xauviu1w.js.map +0 -1
  245. package/dist/DateFieldSingle-yLnwpVzd.js.map +0 -1
  246. package/dist/DrawerContext-DboTgTmo.js.map +0 -1
  247. package/dist/Menu-DEVZz9xZ.js.map +0 -1
  248. package/dist/Page-BMDkbDcU.js.map +0 -1
  249. package/dist/Pagination-BJsCppgW.js.map +0 -1
  250. package/dist/Popover-r26xMIfm.js.map +0 -1
  251. package/dist/SideNav-CBAzYyML.js.map +0 -1
  252. package/dist/Tab-wNucMTgo.js.map +0 -1
  253. package/dist/TimeField-CmbErrsZ.js.map +0 -1
  254. package/dist/Toolbar-D4zuUFhb.js.map +0 -1
  255. package/dist/components/DateFieldSingle/internal/useDateFieldOrchestration.d.ts +0 -17
  256. package/dist/index.esm-D889iexm.js.map +0 -1
  257. package/dist/proxy-CreWmH-e.js.map +0 -1
  258. package/dist/use-reduced-motion-znCm41qB.js.map +0 -1
  259. package/dist/useDateFieldOrchestration-BNJCsRkS.js +0 -138
  260. package/dist/useDateFieldOrchestration-BNJCsRkS.js.map +0 -1
  261. package/dist/useDialogTransitionStates-2NaE_noq.js.map +0 -1
  262. package/dist/useFocusWithin-BhhgRXdZ.js.map +0 -1
  263. package/dist/useMergeRefs-Bde85AWI.js +0 -21
  264. package/dist/useMergeRefs-Bde85AWI.js.map +0 -1
  265. package/dist/useOnClickOutside-BHEWMLa9.js.map +0 -1
  266. package/dist/usePopoverCloseDelayWorkaround-BZcjPkvT.js +0 -18
  267. package/dist/usePopoverCloseDelayWorkaround-BZcjPkvT.js.map +0 -1
@@ -1,16 +1,16 @@
1
1
  import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
2
2
  import * as React from 'react';
3
3
  import { createContext, useContext, forwardRef, useState, useEffect, useRef, useCallback, useMemo, useId } from 'react';
4
- import { B as Button } from './Button-BxFXQ0-n.js';
4
+ import { B as Button } from './Button-VNQQgZ45.js';
5
5
  import { S as SvgKeyboardArrowDown } from './keyboard_arrow_down-C8WQ38p1.js';
6
6
  import { S as SvgKeyboardArrowUp } from './keyboard_arrow_up-CxzK6LAl.js';
7
7
  import { S as SvgKeyboardArrowLeft, a as SvgKeyboardArrowRight } from './keyboard_arrow_right-DZWNVytH.js';
8
8
  import { c as cx } from './index-tZvMCc77.js';
9
9
  import { S as SrOnly } from './SrOnly-CTsYSuby.js';
10
- import { u as useSwipe } from './useSwipe-CULmVQEk.js';
10
+ import { u as useSwipe } from './useSwipe-Cp-CJxLU.js';
11
11
  import { G as Grid } from './Grid-MGUC698u.js';
12
- import { S as SelectCard } from './SelectCard-BTYZg9TG.js';
13
- import { u as useMergeRefs } from './useMergeRefs-Bde85AWI.js';
12
+ import { S as SelectCard } from './SelectCard-Ca07K1FW.js';
13
+ import { u as useMergeRefs } from './useMergeRefs-Dfmtq9cI.js';
14
14
  import { flushSync } from 'react-dom';
15
15
  import { u as useOptionallyControlledState } from './useOptionallyControlledState-DbDuos5L.js';
16
16
  import { u as usePrevious } from './usePrevious-Bvq-5auG.js';
@@ -410,12 +410,13 @@ class SystemZone extends Zone {
410
410
  }
411
411
  }
412
412
 
413
- let dtfCache = {};
414
- function makeDTF(zone) {
415
- if (!dtfCache[zone]) {
416
- dtfCache[zone] = new Intl.DateTimeFormat("en-US", {
413
+ const dtfCache = new Map();
414
+ function makeDTF(zoneName) {
415
+ let dtf = dtfCache.get(zoneName);
416
+ if (dtf === undefined) {
417
+ dtf = new Intl.DateTimeFormat("en-US", {
417
418
  hour12: false,
418
- timeZone: zone,
419
+ timeZone: zoneName,
419
420
  year: "numeric",
420
421
  month: "2-digit",
421
422
  day: "2-digit",
@@ -424,8 +425,9 @@ function makeDTF(zone) {
424
425
  second: "2-digit",
425
426
  era: "short",
426
427
  });
428
+ dtfCache.set(zoneName, dtf);
427
429
  }
428
- return dtfCache[zone];
430
+ return dtf;
429
431
  }
430
432
 
431
433
  const typeToPos = {
@@ -461,7 +463,7 @@ function partsOffset(dtf, date) {
461
463
  return filled;
462
464
  }
463
465
 
464
- let ianaZoneCache = {};
466
+ const ianaZoneCache = new Map();
465
467
  /**
466
468
  * A zone identified by an IANA identifier, like America/New_York
467
469
  * @implements {Zone}
@@ -472,10 +474,11 @@ class IANAZone extends Zone {
472
474
  * @return {IANAZone}
473
475
  */
474
476
  static create(name) {
475
- if (!ianaZoneCache[name]) {
476
- ianaZoneCache[name] = new IANAZone(name);
477
+ let zone = ianaZoneCache.get(name);
478
+ if (zone === undefined) {
479
+ ianaZoneCache.set(name, (zone = new IANAZone(name)));
477
480
  }
478
- return ianaZoneCache[name];
481
+ return zone;
479
482
  }
480
483
 
481
484
  /**
@@ -483,8 +486,8 @@ class IANAZone extends Zone {
483
486
  * @return {void}
484
487
  */
485
488
  static resetCache() {
486
- ianaZoneCache = {};
487
- dtfCache = {};
489
+ ianaZoneCache.clear();
490
+ dtfCache.clear();
488
491
  }
489
492
 
490
493
  /**
@@ -587,6 +590,7 @@ class IANAZone extends Zone {
587
590
  * @return {number}
588
591
  */
589
592
  offset(ts) {
593
+ if (!this.valid) return NaN;
590
594
  const date = new Date(ts);
591
595
 
592
596
  if (isNaN(date)) return NaN;
@@ -652,36 +656,36 @@ function getCachedLF(locString, opts = {}) {
652
656
  return dtf;
653
657
  }
654
658
 
655
- let intlDTCache = {};
659
+ const intlDTCache = new Map();
656
660
  function getCachedDTF(locString, opts = {}) {
657
661
  const key = JSON.stringify([locString, opts]);
658
- let dtf = intlDTCache[key];
659
- if (!dtf) {
662
+ let dtf = intlDTCache.get(key);
663
+ if (dtf === undefined) {
660
664
  dtf = new Intl.DateTimeFormat(locString, opts);
661
- intlDTCache[key] = dtf;
665
+ intlDTCache.set(key, dtf);
662
666
  }
663
667
  return dtf;
664
668
  }
665
669
 
666
- let intlNumCache = {};
670
+ const intlNumCache = new Map();
667
671
  function getCachedINF(locString, opts = {}) {
668
672
  const key = JSON.stringify([locString, opts]);
669
- let inf = intlNumCache[key];
670
- if (!inf) {
673
+ let inf = intlNumCache.get(key);
674
+ if (inf === undefined) {
671
675
  inf = new Intl.NumberFormat(locString, opts);
672
- intlNumCache[key] = inf;
676
+ intlNumCache.set(key, inf);
673
677
  }
674
678
  return inf;
675
679
  }
676
680
 
677
- let intlRelCache = {};
681
+ const intlRelCache = new Map();
678
682
  function getCachedRTF(locString, opts = {}) {
679
683
  const { base, ...cacheKeyOpts } = opts; // exclude `base` from the options
680
684
  const key = JSON.stringify([locString, cacheKeyOpts]);
681
- let inf = intlRelCache[key];
682
- if (!inf) {
685
+ let inf = intlRelCache.get(key);
686
+ if (inf === undefined) {
683
687
  inf = new Intl.RelativeTimeFormat(locString, opts);
684
- intlRelCache[key] = inf;
688
+ intlRelCache.set(key, inf);
685
689
  }
686
690
  return inf;
687
691
  }
@@ -696,14 +700,28 @@ function systemLocale() {
696
700
  }
697
701
  }
698
702
 
699
- let weekInfoCache = {};
703
+ const intlResolvedOptionsCache = new Map();
704
+ function getCachedIntResolvedOptions(locString) {
705
+ let opts = intlResolvedOptionsCache.get(locString);
706
+ if (opts === undefined) {
707
+ opts = new Intl.DateTimeFormat(locString).resolvedOptions();
708
+ intlResolvedOptionsCache.set(locString, opts);
709
+ }
710
+ return opts;
711
+ }
712
+
713
+ const weekInfoCache = new Map();
700
714
  function getCachedWeekInfo(locString) {
701
- let data = weekInfoCache[locString];
715
+ let data = weekInfoCache.get(locString);
702
716
  if (!data) {
703
717
  const locale = new Intl.Locale(locString);
704
718
  // browsers currently implement this as a property, but spec says it should be a getter function
705
719
  data = "getWeekInfo" in locale ? locale.getWeekInfo() : locale.weekInfo;
706
- weekInfoCache[locString] = data;
720
+ // minimalDays was removed from WeekInfo: https://github.com/tc39/proposal-intl-locale-info/issues/86
721
+ if (!("minimalDays" in data)) {
722
+ data = { ...fallbackWeekSettings, ...data };
723
+ }
724
+ weekInfoCache.set(locString, data);
707
725
  }
708
726
  return data;
709
727
  }
@@ -802,7 +820,7 @@ function supportsFastNumbers(loc) {
802
820
  loc.numberingSystem === "latn" ||
803
821
  !loc.locale ||
804
822
  loc.locale.startsWith("en") ||
805
- new Intl.DateTimeFormat(loc.intl).resolvedOptions().numberingSystem === "latn"
823
+ getCachedIntResolvedOptions(loc.locale).numberingSystem === "latn"
806
824
  );
807
825
  }
808
826
  }
@@ -961,7 +979,6 @@ const fallbackWeekSettings = {
961
979
  /**
962
980
  * @private
963
981
  */
964
-
965
982
  class Locale {
966
983
  static fromOpts(opts) {
967
984
  return Locale.create(
@@ -985,9 +1002,11 @@ class Locale {
985
1002
 
986
1003
  static resetCache() {
987
1004
  sysLocaleCache = null;
988
- intlDTCache = {};
989
- intlNumCache = {};
990
- intlRelCache = {};
1005
+ intlDTCache.clear();
1006
+ intlNumCache.clear();
1007
+ intlRelCache.clear();
1008
+ intlResolvedOptionsCache.clear();
1009
+ weekInfoCache.clear();
991
1010
  }
992
1011
 
993
1012
  static fromObject({ locale, numberingSystem, outputCalendar, weekSettings } = {}) {
@@ -1052,10 +1071,18 @@ class Locale {
1052
1071
 
1053
1072
  months(length, format = false) {
1054
1073
  return listStuff(this, length, months, () => {
1074
+ // Workaround for "ja" locale: formatToParts does not label all parts of the month
1075
+ // as "month" and for this locale there is no difference between "format" and "non-format".
1076
+ // As such, just use format() instead of formatToParts() and take the whole string
1077
+ const monthSpecialCase = this.intl === "ja" || this.intl.startsWith("ja-");
1078
+ format &= !monthSpecialCase;
1055
1079
  const intl = format ? { month: length, day: "numeric" } : { month: length },
1056
1080
  formatStr = format ? "format" : "standalone";
1057
1081
  if (!this.monthsCache[formatStr][length]) {
1058
- this.monthsCache[formatStr][length] = mapMonths((dt) => this.extract(dt, intl, "month"));
1082
+ const mapper = !monthSpecialCase
1083
+ ? (dt) => this.extract(dt, intl, "month")
1084
+ : (dt) => this.dtFormatter(dt, intl).format();
1085
+ this.monthsCache[formatStr][length] = mapMonths(mapper);
1059
1086
  }
1060
1087
  return this.monthsCache[formatStr][length];
1061
1088
  });
@@ -1141,7 +1168,7 @@ class Locale {
1141
1168
  return (
1142
1169
  this.locale === "en" ||
1143
1170
  this.locale.toLowerCase() === "en-us" ||
1144
- new Intl.DateTimeFormat(this.intl).resolvedOptions().locale.startsWith("en-us")
1171
+ getCachedIntResolvedOptions(this.intl).locale.startsWith("en-us")
1145
1172
  );
1146
1173
  }
1147
1174
 
@@ -1384,7 +1411,6 @@ class InvalidZone extends Zone {
1384
1411
  * @private
1385
1412
  */
1386
1413
 
1387
-
1388
1414
  function normalizeZone(input, defaultZone) {
1389
1415
  if (isUndefined(input) || input === null) {
1390
1416
  return defaultZone;
@@ -1480,22 +1506,26 @@ function parseDigits(str) {
1480
1506
  }
1481
1507
 
1482
1508
  // cache of {numberingSystem: {append: regex}}
1483
- let digitRegexCache = {};
1509
+ const digitRegexCache = new Map();
1484
1510
  function resetDigitRegexCache() {
1485
- digitRegexCache = {};
1511
+ digitRegexCache.clear();
1486
1512
  }
1487
1513
 
1488
1514
  function digitRegex({ numberingSystem }, append = "") {
1489
1515
  const ns = numberingSystem || "latn";
1490
1516
 
1491
- if (!digitRegexCache[ns]) {
1492
- digitRegexCache[ns] = {};
1517
+ let appendCache = digitRegexCache.get(ns);
1518
+ if (appendCache === undefined) {
1519
+ appendCache = new Map();
1520
+ digitRegexCache.set(ns, appendCache);
1493
1521
  }
1494
- if (!digitRegexCache[ns][append]) {
1495
- digitRegexCache[ns][append] = new RegExp(`${numberingSystems[ns]}${append}`);
1522
+ let regex = appendCache.get(append);
1523
+ if (regex === undefined) {
1524
+ regex = new RegExp(`${numberingSystems[ns]}${append}`);
1525
+ appendCache.set(append, regex);
1496
1526
  }
1497
1527
 
1498
- return digitRegexCache[ns][append];
1528
+ return regex;
1499
1529
  }
1500
1530
 
1501
1531
  let now = () => Date.now(),
@@ -1885,7 +1915,6 @@ function hasInvalidTimeData(obj) {
1885
1915
  it up into, say, parsingUtil.js and basicUtil.js and so on. But they are divided up by feature area.
1886
1916
  */
1887
1917
 
1888
-
1889
1918
  /**
1890
1919
  * @private
1891
1920
  */
@@ -2037,10 +2066,24 @@ function parseMillis(fraction) {
2037
2066
  }
2038
2067
  }
2039
2068
 
2040
- function roundTo(number, digits, towardZero = false) {
2041
- const factor = 10 ** digits,
2042
- rounder = towardZero ? Math.trunc : Math.round;
2043
- return rounder(number * factor) / factor;
2069
+ function roundTo(number, digits, rounding = "round") {
2070
+ const factor = 10 ** digits;
2071
+ switch (rounding) {
2072
+ case "expand":
2073
+ return number > 0
2074
+ ? Math.ceil(number * factor) / factor
2075
+ : Math.floor(number * factor) / factor;
2076
+ case "trunc":
2077
+ return Math.trunc(number * factor) / factor;
2078
+ case "round":
2079
+ return Math.round(number * factor) / factor;
2080
+ case "floor":
2081
+ return Math.floor(number * factor) / factor;
2082
+ case "ceil":
2083
+ return Math.ceil(number * factor) / factor;
2084
+ default:
2085
+ throw new RangeError(`Value rounding ${rounding} is out of range`);
2086
+ }
2044
2087
  }
2045
2088
 
2046
2089
  // DATE BASICS
@@ -2148,7 +2191,7 @@ function signedOffset(offHourStr, offMinuteStr) {
2148
2191
 
2149
2192
  function asNumber(value) {
2150
2193
  const numericValue = Number(value);
2151
- if (typeof value === "boolean" || value === "" || Number.isNaN(numericValue))
2194
+ if (typeof value === "boolean" || value === "" || !Number.isFinite(numericValue))
2152
2195
  throw new InvalidArgumentError(`Invalid unit value ${value}`);
2153
2196
  return numericValue;
2154
2197
  }
@@ -2407,8 +2450,12 @@ class Formatter {
2407
2450
  for (let i = 0; i < fmt.length; i++) {
2408
2451
  const c = fmt.charAt(i);
2409
2452
  if (c === "'") {
2410
- if (currentFull.length > 0) {
2411
- splits.push({ literal: bracketed || /^\s+$/.test(currentFull), val: currentFull });
2453
+ // turn '' into a literal signal quote instead of just skipping the empty literal
2454
+ if (currentFull.length > 0 || bracketed) {
2455
+ splits.push({
2456
+ literal: bracketed || /^\s+$/.test(currentFull),
2457
+ val: currentFull === "" ? "'" : currentFull,
2458
+ });
2412
2459
  }
2413
2460
  current = null;
2414
2461
  currentFull = "";
@@ -2472,7 +2519,7 @@ class Formatter {
2472
2519
  return this.dtFormatter(dt, opts).resolvedOptions();
2473
2520
  }
2474
2521
 
2475
- num(n, p = 0) {
2522
+ num(n, p = 0, signDisplay = undefined) {
2476
2523
  // we get some perf out of doing this here, annoyingly
2477
2524
  if (this.opts.forceSimple) {
2478
2525
  return padStart(n, p);
@@ -2483,6 +2530,9 @@ class Formatter {
2483
2530
  if (p > 0) {
2484
2531
  opts.padTo = p;
2485
2532
  }
2533
+ if (signDisplay) {
2534
+ opts.signDisplay = signDisplay;
2535
+ }
2486
2536
 
2487
2537
  return this.loc.numberFormatter(opts).format(n);
2488
2538
  }
@@ -2718,32 +2768,44 @@ class Formatter {
2718
2768
  }
2719
2769
 
2720
2770
  formatDurationFromString(dur, fmt) {
2771
+ const invertLargest = this.opts.signMode === "negativeLargestOnly" ? -1 : 1;
2721
2772
  const tokenToField = (token) => {
2722
2773
  switch (token[0]) {
2723
2774
  case "S":
2724
- return "millisecond";
2775
+ return "milliseconds";
2725
2776
  case "s":
2726
- return "second";
2777
+ return "seconds";
2727
2778
  case "m":
2728
- return "minute";
2779
+ return "minutes";
2729
2780
  case "h":
2730
- return "hour";
2781
+ return "hours";
2731
2782
  case "d":
2732
- return "day";
2783
+ return "days";
2733
2784
  case "w":
2734
- return "week";
2785
+ return "weeks";
2735
2786
  case "M":
2736
- return "month";
2787
+ return "months";
2737
2788
  case "y":
2738
- return "year";
2789
+ return "years";
2739
2790
  default:
2740
2791
  return null;
2741
2792
  }
2742
2793
  },
2743
- tokenToString = (lildur) => (token) => {
2794
+ tokenToString = (lildur, info) => (token) => {
2744
2795
  const mapped = tokenToField(token);
2745
2796
  if (mapped) {
2746
- return this.num(lildur.get(mapped), token.length);
2797
+ const inversionFactor =
2798
+ info.isNegativeDuration && mapped !== info.largestUnit ? invertLargest : 1;
2799
+ let signDisplay;
2800
+ if (this.opts.signMode === "negativeLargestOnly" && mapped !== info.largestUnit) {
2801
+ signDisplay = "never";
2802
+ } else if (this.opts.signMode === "all") {
2803
+ signDisplay = "always";
2804
+ } else {
2805
+ // "auto" and "negative" are the same, but "auto" has better support
2806
+ signDisplay = "auto";
2807
+ }
2808
+ return this.num(lildur.get(mapped) * inversionFactor, token.length, signDisplay);
2747
2809
  } else {
2748
2810
  return token;
2749
2811
  }
@@ -2753,8 +2815,14 @@ class Formatter {
2753
2815
  (found, { literal, val }) => (literal ? found : found.concat(val)),
2754
2816
  []
2755
2817
  ),
2756
- collapsed = dur.shiftTo(...realTokens.map(tokenToField).filter((t) => t));
2757
- return stringifyTokens(tokens, tokenToString(collapsed));
2818
+ collapsed = dur.shiftTo(...realTokens.map(tokenToField).filter((t) => t)),
2819
+ durationInfo = {
2820
+ isNegativeDuration: collapsed < 0,
2821
+ // this relies on "collapsed" being based on "shiftTo", which builds up the object
2822
+ // in order
2823
+ largestUnit: Object.keys(collapsed.values)[0],
2824
+ };
2825
+ return stringifyTokens(tokens, tokenToString(collapsed, durationInfo));
2758
2826
  }
2759
2827
  }
2760
2828
 
@@ -2815,11 +2883,11 @@ function simpleParse(...keys) {
2815
2883
  }
2816
2884
 
2817
2885
  // ISO and SQL parsing
2818
- const offsetRegex = /(?:(Z)|([+-]\d\d)(?::?(\d\d))?)/;
2886
+ const offsetRegex = /(?:([Zz])|([+-]\d\d)(?::?(\d\d))?)/;
2819
2887
  const isoExtendedZone = `(?:${offsetRegex.source}?(?:\\[(${ianaRegex.source})\\])?)?`;
2820
2888
  const isoTimeBaseRegex = /(\d\d)(?::?(\d\d)(?::?(\d\d)(?:[.,](\d{1,30}))?)?)?/;
2821
2889
  const isoTimeRegex = RegExp(`${isoTimeBaseRegex.source}${isoExtendedZone}`);
2822
- const isoTimeExtensionRegex = RegExp(`(?:T${isoTimeRegex.source})?`);
2890
+ const isoTimeExtensionRegex = RegExp(`(?:[Tt]${isoTimeRegex.source})?`);
2823
2891
  const isoYmdRegex = /([+-]\d{6}|\d{4})(?:-?(\d\d)(?:-?(\d\d))?)?/;
2824
2892
  const isoWeekRegex = /(\d{4})-?W(\d\d)(?:-?(\d))?/;
2825
2893
  const isoOrdinalRegex = /(\d{4})-?(\d{3})/;
@@ -3534,9 +3602,13 @@ class Duration {
3534
3602
  * @param {string} fmt - the format string
3535
3603
  * @param {Object} opts - options
3536
3604
  * @param {boolean} [opts.floor=true] - floor numerical values
3605
+ * @param {'negative'|'all'|'negativeLargestOnly'} [opts.signMode=negative] - How to handle signs
3537
3606
  * @example Duration.fromObject({ years: 1, days: 6, seconds: 2 }).toFormat("y d s") //=> "1 6 2"
3538
3607
  * @example Duration.fromObject({ years: 1, days: 6, seconds: 2 }).toFormat("yy dd sss") //=> "01 06 002"
3539
3608
  * @example Duration.fromObject({ years: 1, days: 6, seconds: 2 }).toFormat("M S") //=> "12 518402000"
3609
+ * @example Duration.fromObject({ days: 6, seconds: 2 }).toFormat("d s", { signMode: "all" }) //=> "+6 +2"
3610
+ * @example Duration.fromObject({ days: -6, seconds: -2 }).toFormat("d s", { signMode: "all" }) //=> "-6 -2"
3611
+ * @example Duration.fromObject({ days: -6, seconds: -2 }).toFormat("d s", { signMode: "negativeLargestOnly" }) //=> "-6 2"
3540
3612
  * @return {string}
3541
3613
  */
3542
3614
  toFormat(fmt, opts = {}) {
@@ -3556,21 +3628,25 @@ class Duration {
3556
3628
  * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat#options
3557
3629
  * @param {Object} opts - Formatting options. Accepts the same keys as the options parameter of the native `Intl.NumberFormat` constructor, as well as `listStyle`.
3558
3630
  * @param {string} [opts.listStyle='narrow'] - How to format the merged list. Corresponds to the `style` property of the options parameter of the native `Intl.ListFormat` constructor.
3631
+ * @param {boolean} [opts.showZeros=true] - Show all units previously used by the duration even if they are zero
3559
3632
  * @example
3560
3633
  * ```js
3561
- * var dur = Duration.fromObject({ days: 1, hours: 5, minutes: 6 })
3562
- * dur.toHuman() //=> '1 day, 5 hours, 6 minutes'
3563
- * dur.toHuman({ listStyle: "long" }) //=> '1 day, 5 hours, and 6 minutes'
3564
- * dur.toHuman({ unitDisplay: "short" }) //=> '1 day, 5 hr, 6 min'
3634
+ * var dur = Duration.fromObject({ months: 1, weeks: 0, hours: 5, minutes: 6 })
3635
+ * dur.toHuman() //=> '1 month, 0 weeks, 5 hours, 6 minutes'
3636
+ * dur.toHuman({ listStyle: "long" }) //=> '1 month, 0 weeks, 5 hours, and 6 minutes'
3637
+ * dur.toHuman({ unitDisplay: "short" }) //=> '1 mth, 0 wks, 5 hr, 6 min'
3638
+ * dur.toHuman({ showZeros: false }) //=> '1 month, 5 hours, 6 minutes'
3565
3639
  * ```
3566
3640
  */
3567
3641
  toHuman(opts = {}) {
3568
3642
  if (!this.isValid) return INVALID$2;
3569
3643
 
3644
+ const showZeros = opts.showZeros !== false;
3645
+
3570
3646
  const l = orderedUnits$1
3571
3647
  .map((unit) => {
3572
3648
  const val = this.values[unit];
3573
- if (isUndefined(val)) {
3649
+ if (isUndefined(val) || (val === 0 && !showZeros)) {
3574
3650
  return null;
3575
3651
  }
3576
3652
  return this.loc
@@ -3930,6 +4006,17 @@ class Duration {
3930
4006
  return clone$1(this, { values: negated }, true);
3931
4007
  }
3932
4008
 
4009
+ /**
4010
+ * Removes all units with values equal to 0 from this Duration.
4011
+ * @example Duration.fromObject({ years: 2, days: 0, hours: 0, minutes: 0 }).removeZeros().toObject() //=> { years: 2 }
4012
+ * @return {Duration}
4013
+ */
4014
+ removeZeros() {
4015
+ if (!this.isValid) return this;
4016
+ const vals = removeZeroes(this.values);
4017
+ return clone$1(this, { values: vals }, true);
4018
+ }
4019
+
3933
4020
  /**
3934
4021
  * Get the years.
3935
4022
  * @type {number}
@@ -4240,13 +4327,22 @@ class Interval {
4240
4327
  }
4241
4328
 
4242
4329
  /**
4243
- * Returns the end of the Interval
4330
+ * Returns the end of the Interval. This is the first instant which is not part of the interval
4331
+ * (Interval is half-open).
4244
4332
  * @type {DateTime}
4245
4333
  */
4246
4334
  get end() {
4247
4335
  return this.isValid ? this.e : null;
4248
4336
  }
4249
4337
 
4338
+ /**
4339
+ * Returns the last DateTime included in the interval (since end is not part of the interval)
4340
+ * @type {DateTime}
4341
+ */
4342
+ get lastDateTime() {
4343
+ return this.isValid ? (this.e ? this.e.minus(1) : null) : null;
4344
+ }
4345
+
4250
4346
  /**
4251
4347
  * Returns whether this Interval's end is at least its start, meaning that the Interval isn't 'backwards'.
4252
4348
  * @type {boolean}
@@ -4511,8 +4607,11 @@ class Interval {
4511
4607
  }
4512
4608
 
4513
4609
  /**
4514
- * Merge an array of Intervals into a equivalent minimal set of Intervals.
4610
+ * Merge an array of Intervals into an equivalent minimal set of Intervals.
4515
4611
  * Combines overlapping and adjacent Intervals.
4612
+ * The resulting array will contain the Intervals in ascending order, that is, starting with the earliest Interval
4613
+ * and ending with the latest.
4614
+ *
4516
4615
  * @param {Array} intervals
4517
4616
  * @return {Array}
4518
4617
  */
@@ -5660,21 +5759,22 @@ function toTechFormat(dt, format, allowZ = true) {
5660
5759
  : null;
5661
5760
  }
5662
5761
 
5663
- function toISODate(o, extended) {
5762
+ function toISODate(o, extended, precision) {
5664
5763
  const longFormat = o.c.year > 9999 || o.c.year < 0;
5665
5764
  let c = "";
5666
5765
  if (longFormat && o.c.year >= 0) c += "+";
5667
5766
  c += padStart(o.c.year, longFormat ? 6 : 4);
5668
-
5767
+ if (precision === "year") return c;
5669
5768
  if (extended) {
5670
5769
  c += "-";
5671
5770
  c += padStart(o.c.month);
5771
+ if (precision === "month") return c;
5672
5772
  c += "-";
5673
- c += padStart(o.c.day);
5674
5773
  } else {
5675
5774
  c += padStart(o.c.month);
5676
- c += padStart(o.c.day);
5775
+ if (precision === "month") return c;
5677
5776
  }
5777
+ c += padStart(o.c.day);
5678
5778
  return c;
5679
5779
  }
5680
5780
 
@@ -5684,26 +5784,39 @@ function toISOTime(
5684
5784
  suppressSeconds,
5685
5785
  suppressMilliseconds,
5686
5786
  includeOffset,
5687
- extendedZone
5787
+ extendedZone,
5788
+ precision
5688
5789
  ) {
5689
- let c = padStart(o.c.hour);
5690
- if (extended) {
5691
- c += ":";
5692
- c += padStart(o.c.minute);
5693
- if (o.c.millisecond !== 0 || o.c.second !== 0 || !suppressSeconds) {
5694
- c += ":";
5695
- }
5696
- } else {
5697
- c += padStart(o.c.minute);
5698
- }
5699
-
5700
- if (o.c.millisecond !== 0 || o.c.second !== 0 || !suppressSeconds) {
5701
- c += padStart(o.c.second);
5702
-
5703
- if (o.c.millisecond !== 0 || !suppressMilliseconds) {
5704
- c += ".";
5705
- c += padStart(o.c.millisecond, 3);
5706
- }
5790
+ let showSeconds = !suppressSeconds || o.c.millisecond !== 0 || o.c.second !== 0,
5791
+ c = "";
5792
+ switch (precision) {
5793
+ case "day":
5794
+ case "month":
5795
+ case "year":
5796
+ break;
5797
+ default:
5798
+ c += padStart(o.c.hour);
5799
+ if (precision === "hour") break;
5800
+ if (extended) {
5801
+ c += ":";
5802
+ c += padStart(o.c.minute);
5803
+ if (precision === "minute") break;
5804
+ if (showSeconds) {
5805
+ c += ":";
5806
+ c += padStart(o.c.second);
5807
+ }
5808
+ } else {
5809
+ c += padStart(o.c.minute);
5810
+ if (precision === "minute") break;
5811
+ if (showSeconds) {
5812
+ c += padStart(o.c.second);
5813
+ }
5814
+ }
5815
+ if (precision === "second") break;
5816
+ if (showSeconds && (!suppressMilliseconds || o.c.millisecond !== 0)) {
5817
+ c += ".";
5818
+ c += padStart(o.c.millisecond, 3);
5819
+ }
5707
5820
  }
5708
5821
 
5709
5822
  if (includeOffset) {
@@ -5835,15 +5948,27 @@ function normalizeUnitWithLocalWeeks(unit) {
5835
5948
  // This is safe for quickDT (used by local() and utc()) because we don't fill in
5836
5949
  // higher-order units from tsNow (as we do in fromObject, this requires that
5837
5950
  // offset is calculated from tsNow).
5951
+ /**
5952
+ * @param {Zone} zone
5953
+ * @return {number}
5954
+ */
5838
5955
  function guessOffsetForZone(zone) {
5839
- if (!zoneOffsetGuessCache[zone]) {
5840
- if (zoneOffsetTs === undefined) {
5841
- zoneOffsetTs = Settings.now();
5842
- }
5956
+ if (zoneOffsetTs === undefined) {
5957
+ zoneOffsetTs = Settings.now();
5958
+ }
5843
5959
 
5844
- zoneOffsetGuessCache[zone] = zone.offset(zoneOffsetTs);
5960
+ // Do not cache anything but IANA zones, because it is not safe to do so.
5961
+ // Guessing an offset which is not present in the zone can cause wrong results from fixOffset
5962
+ if (zone.type !== "iana") {
5963
+ return zone.offset(zoneOffsetTs);
5964
+ }
5965
+ const zoneName = zone.name;
5966
+ let offsetGuess = zoneOffsetGuessCache.get(zoneName);
5967
+ if (offsetGuess === undefined) {
5968
+ offsetGuess = zone.offset(zoneOffsetTs);
5969
+ zoneOffsetGuessCache.set(zoneName, offsetGuess);
5845
5970
  }
5846
- return zoneOffsetGuessCache[zone];
5971
+ return offsetGuess;
5847
5972
  }
5848
5973
 
5849
5974
  // this is a dumbed down version of fromObject() that runs about 60% faster
@@ -5883,8 +6008,9 @@ function quickDT(obj, opts) {
5883
6008
 
5884
6009
  function diffRelative(start, end, opts) {
5885
6010
  const round = isUndefined(opts.round) ? true : opts.round,
6011
+ rounding = isUndefined(opts.rounding) ? "trunc" : opts.rounding,
5886
6012
  format = (c, unit) => {
5887
- c = roundTo(c, round || opts.calendary ? 0 : 2, true);
6013
+ c = roundTo(c, round || opts.calendary ? 0 : 2, opts.calendary ? "round" : rounding);
5888
6014
  const formatter = end.loc.clone(opts).relFormatter(opts);
5889
6015
  return formatter.format(c, unit);
5890
6016
  },
@@ -5933,7 +6059,7 @@ let zoneOffsetTs;
5933
6059
  * This optimizes quickDT via guessOffsetForZone to avoid repeated calls of
5934
6060
  * zone.offset().
5935
6061
  */
5936
- let zoneOffsetGuessCache = {};
6062
+ const zoneOffsetGuessCache = new Map();
5937
6063
 
5938
6064
  /**
5939
6065
  * A DateTime is an immutable data structure representing a specific date and time and accompanying methods. It contains class and instance methods for creating, parsing, interrogating, transforming, and formatting them.
@@ -6137,7 +6263,7 @@ class DateTime {
6137
6263
  throw new InvalidArgumentError(
6138
6264
  `fromMillis requires a numerical input, but received a ${typeof milliseconds} with value ${milliseconds}`
6139
6265
  );
6140
- } else if (milliseconds < -864e13 || milliseconds > MAX_DATE) {
6266
+ } else if (milliseconds < -MAX_DATE || milliseconds > MAX_DATE) {
6141
6267
  // this isn't perfect because we can still end up out of range because of additional shifting, but it's a start
6142
6268
  return DateTime.invalid("Timestamp out of range");
6143
6269
  } else {
@@ -6498,7 +6624,7 @@ class DateTime {
6498
6624
 
6499
6625
  static resetCache() {
6500
6626
  zoneOffsetTs = undefined;
6501
- zoneOffsetGuessCache = {};
6627
+ zoneOffsetGuessCache.clear();
6502
6628
  }
6503
6629
 
6504
6630
  // INFO
@@ -7263,11 +7389,14 @@ class DateTime {
7263
7389
  * @param {boolean} [opts.includeOffset=true] - include the offset, such as 'Z' or '-04:00'
7264
7390
  * @param {boolean} [opts.extendedZone=false] - add the time zone format extension
7265
7391
  * @param {string} [opts.format='extended'] - choose between the basic and extended format
7392
+ * @param {string} [opts.precision='milliseconds'] - truncate output to desired presicion: 'years', 'months', 'days', 'hours', 'minutes', 'seconds' or 'milliseconds'. When precision and suppressSeconds or suppressMilliseconds are used together, precision sets the maximum unit shown in the output, however seconds or milliseconds will still be suppressed if they are 0.
7266
7393
  * @example DateTime.utc(1983, 5, 25).toISO() //=> '1982-05-25T00:00:00.000Z'
7267
7394
  * @example DateTime.now().toISO() //=> '2017-04-22T20:47:05.335-04:00'
7268
7395
  * @example DateTime.now().toISO({ includeOffset: false }) //=> '2017-04-22T20:47:05.335'
7269
7396
  * @example DateTime.now().toISO({ format: 'basic' }) //=> '20170422T204705.335-0400'
7270
- * @return {string}
7397
+ * @example DateTime.now().toISO({ precision: 'day' }) //=> '2017-04-22Z'
7398
+ * @example DateTime.now().toISO({ precision: 'minute' }) //=> '2017-04-22T20:47Z'
7399
+ * @return {string|null}
7271
7400
  */
7272
7401
  toISO({
7273
7402
  format = "extended",
@@ -7275,16 +7404,26 @@ class DateTime {
7275
7404
  suppressMilliseconds = false,
7276
7405
  includeOffset = true,
7277
7406
  extendedZone = false,
7407
+ precision = "milliseconds",
7278
7408
  } = {}) {
7279
7409
  if (!this.isValid) {
7280
7410
  return null;
7281
7411
  }
7282
7412
 
7413
+ precision = normalizeUnit(precision);
7283
7414
  const ext = format === "extended";
7284
7415
 
7285
- let c = toISODate(this, ext);
7286
- c += "T";
7287
- c += toISOTime(this, ext, suppressSeconds, suppressMilliseconds, includeOffset, extendedZone);
7416
+ let c = toISODate(this, ext, precision);
7417
+ if (orderedUnits.indexOf(precision) >= 3) c += "T";
7418
+ c += toISOTime(
7419
+ this,
7420
+ ext,
7421
+ suppressSeconds,
7422
+ suppressMilliseconds,
7423
+ includeOffset,
7424
+ extendedZone,
7425
+ precision
7426
+ );
7288
7427
  return c;
7289
7428
  }
7290
7429
 
@@ -7292,16 +7431,17 @@ class DateTime {
7292
7431
  * Returns an ISO 8601-compliant string representation of this DateTime's date component
7293
7432
  * @param {Object} opts - options
7294
7433
  * @param {string} [opts.format='extended'] - choose between the basic and extended format
7434
+ * @param {string} [opts.precision='day'] - truncate output to desired precision: 'years', 'months', or 'days'.
7295
7435
  * @example DateTime.utc(1982, 5, 25).toISODate() //=> '1982-05-25'
7296
7436
  * @example DateTime.utc(1982, 5, 25).toISODate({ format: 'basic' }) //=> '19820525'
7297
- * @return {string}
7437
+ * @example DateTime.utc(1982, 5, 25).toISODate({ precision: 'month' }) //=> '1982-05'
7438
+ * @return {string|null}
7298
7439
  */
7299
- toISODate({ format = "extended" } = {}) {
7440
+ toISODate({ format = "extended", precision = "day" } = {}) {
7300
7441
  if (!this.isValid) {
7301
7442
  return null;
7302
7443
  }
7303
-
7304
- return toISODate(this, format === "extended");
7444
+ return toISODate(this, format === "extended", normalizeUnit(precision));
7305
7445
  }
7306
7446
 
7307
7447
  /**
@@ -7322,10 +7462,12 @@ class DateTime {
7322
7462
  * @param {boolean} [opts.extendedZone=true] - add the time zone format extension
7323
7463
  * @param {boolean} [opts.includePrefix=false] - include the `T` prefix
7324
7464
  * @param {string} [opts.format='extended'] - choose between the basic and extended format
7465
+ * @param {string} [opts.precision='milliseconds'] - truncate output to desired presicion: 'hours', 'minutes', 'seconds' or 'milliseconds'. When precision and suppressSeconds or suppressMilliseconds are used together, precision sets the maximum unit shown in the output, however seconds or milliseconds will still be suppressed if they are 0.
7325
7466
  * @example DateTime.utc().set({ hour: 7, minute: 34 }).toISOTime() //=> '07:34:19.361Z'
7326
7467
  * @example DateTime.utc().set({ hour: 7, minute: 34, seconds: 0, milliseconds: 0 }).toISOTime({ suppressSeconds: true }) //=> '07:34Z'
7327
7468
  * @example DateTime.utc().set({ hour: 7, minute: 34 }).toISOTime({ format: 'basic' }) //=> '073419.361Z'
7328
7469
  * @example DateTime.utc().set({ hour: 7, minute: 34 }).toISOTime({ includePrefix: true }) //=> 'T07:34:19.361Z'
7470
+ * @example DateTime.utc().set({ hour: 7, minute: 34, second: 56 }).toISOTime({ precision: 'minute' }) //=> '07:34Z'
7329
7471
  * @return {string}
7330
7472
  */
7331
7473
  toISOTime({
@@ -7335,12 +7477,14 @@ class DateTime {
7335
7477
  includePrefix = false,
7336
7478
  extendedZone = false,
7337
7479
  format = "extended",
7480
+ precision = "milliseconds",
7338
7481
  } = {}) {
7339
7482
  if (!this.isValid) {
7340
7483
  return null;
7341
7484
  }
7342
7485
 
7343
- let c = includePrefix ? "T" : "";
7486
+ precision = normalizeUnit(precision);
7487
+ let c = includePrefix && orderedUnits.indexOf(precision) >= 3 ? "T" : "";
7344
7488
  return (
7345
7489
  c +
7346
7490
  toISOTime(
@@ -7349,7 +7493,8 @@ class DateTime {
7349
7493
  suppressSeconds,
7350
7494
  suppressMilliseconds,
7351
7495
  includeOffset,
7352
- extendedZone
7496
+ extendedZone,
7497
+ precision
7353
7498
  )
7354
7499
  );
7355
7500
  }
@@ -7379,7 +7524,7 @@ class DateTime {
7379
7524
  /**
7380
7525
  * Returns a string representation of this DateTime appropriate for use in SQL Date
7381
7526
  * @example DateTime.utc(2014, 7, 13).toSQLDate() //=> '2014-07-13'
7382
- * @return {string}
7527
+ * @return {string|null}
7383
7528
  */
7384
7529
  toSQLDate() {
7385
7530
  if (!this.isValid) {
@@ -7474,7 +7619,7 @@ class DateTime {
7474
7619
  }
7475
7620
 
7476
7621
  /**
7477
- * Returns the epoch seconds of this DateTime.
7622
+ * Returns the epoch seconds (including milliseconds in the fractional part) of this DateTime.
7478
7623
  * @return {number}
7479
7624
  */
7480
7625
  toSeconds() {
@@ -7581,7 +7726,7 @@ class DateTime {
7581
7726
  /**
7582
7727
  * Return an Interval spanning between this DateTime and another DateTime
7583
7728
  * @param {DateTime} otherDateTime - the other end point of the Interval
7584
- * @return {Interval}
7729
+ * @return {Interval|DateTime}
7585
7730
  */
7586
7731
  until(otherDateTime) {
7587
7732
  return this.isValid ? Interval.fromDateTimes(this, otherDateTime) : this;
@@ -7627,12 +7772,13 @@ class DateTime {
7627
7772
 
7628
7773
  /**
7629
7774
  * Returns a string representation of a this time relative to now, such as "in two days". Can only internationalize if your
7630
- * platform supports Intl.RelativeTimeFormat. Rounds down by default.
7775
+ * platform supports Intl.RelativeTimeFormat. Rounds towards zero by default.
7631
7776
  * @param {Object} options - options that affect the output
7632
7777
  * @param {DateTime} [options.base=DateTime.now()] - the DateTime to use as the basis to which this time is compared. Defaults to now.
7633
7778
  * @param {string} [options.style="long"] - the style of units, must be "long", "short", or "narrow"
7634
7779
  * @param {string|string[]} options.unit - use a specific unit or array of units; if omitted, or an array, the method will pick the best unit. Use an array or one of "years", "quarters", "months", "weeks", "days", "hours", "minutes", or "seconds"
7635
7780
  * @param {boolean} [options.round=true] - whether to round the numbers in the output.
7781
+ * @param {string} [options.rounding="trunc"] - rounding method to use when rounding the numbers in the output. Can be "trunc" (toward zero), "expand" (away from zero), "round", "floor", or "ceil".
7636
7782
  * @param {number} [options.padding=0] - padding in milliseconds. This allows you to round up the result if it fits inside the threshold. Don't use in combination with {round: false} because the decimal output will include the padding.
7637
7783
  * @param {string} options.locale - override the locale of this DateTime
7638
7784
  * @param {string} options.numberingSystem - override the numberingSystem of this DateTime. The Intl system may choose not to honor this
@@ -8106,7 +8252,7 @@ function rangeUpdater(value, newDate, setValue, onSelection) {
8106
8252
 
8107
8253
  const CalendarNow = forwardRef(
8108
8254
  (props, ref) => {
8109
- const { onClick, ...rest } = props;
8255
+ const { onClick, onClickFixed, ...rest } = props;
8110
8256
  const {
8111
8257
  setFocusedDate,
8112
8258
  setSelectedMonth,
@@ -8125,7 +8271,8 @@ const CalendarNow = forwardRef(
8125
8271
  const nToday = DateTime.fromISO(DateTime.now().toISO(), {
8126
8272
  zone: defaultTimeZone
8127
8273
  }).startOf("day");
8128
- const onClickHandler = () => {
8274
+ const onClickHandler = (e) => {
8275
+ onClickFixed?.(e);
8129
8276
  setFocusedDate(nToday);
8130
8277
  setSelectedMonth(nToday.month);
8131
8278
  setSelectedYear(nToday.year);
@@ -10218,6 +10365,7 @@ const YearSelector = forwardRef(
10218
10365
  );
10219
10366
  YearSelector.displayName = "YearSelector";
10220
10367
 
10368
+ const toolbarFocusStates = ["month", "year", "next", "prev", "now"];
10221
10369
  const CalendarElement = forwardRef(
10222
10370
  (props, ref) => {
10223
10371
  const uid = useId();
@@ -10245,18 +10393,26 @@ const CalendarElement = forwardRef(
10245
10393
  range,
10246
10394
  className,
10247
10395
  _disableAutofocus,
10396
+ _disableFocus,
10248
10397
  ...remainingProps
10249
10398
  } = componentProps;
10250
10399
  const calendarRef = useRef(null);
10251
10400
  const combinedRef = useMergeRefs([ref, calendarRef]);
10252
10401
  const lastIValue = useRef(iValue);
10253
- const buttonsRef = useRef(void 0);
10254
10402
  const yearButtonRef = useRef(null);
10255
10403
  const monthButtonRef = useRef(null);
10404
+ const headerRef = useRef(null);
10405
+ const [toolbarFocus, setToolbarFocus] = useState(toolbarFocusStates[0]);
10256
10406
  const [calendarWidth, setCalendarWidth] = useState(
10257
10407
  void 0
10258
10408
  );
10259
10409
  const [calendarSelectionState, setCalendarSelectionState] = useState("day");
10410
+ const visibleHeaderButtons = useMemo(() => {
10411
+ if (calendarSelectionState !== "day") {
10412
+ return toolbarFocusStates.slice(0, 2);
10413
+ }
10414
+ return toolbarFocusStates;
10415
+ }, [calendarSelectionState]);
10260
10416
  useEffect(() => {
10261
10417
  if (!calendarRef.current || style?.width != null) return;
10262
10418
  const resizeObserver = new ResizeObserver((entries) => {
@@ -10421,41 +10577,45 @@ const CalendarElement = forwardRef(
10421
10577
  unavailableDates,
10422
10578
  unavailable,
10423
10579
  value,
10424
- startDay
10580
+ startDay,
10581
+ _disableAutofocus
10425
10582
  ]);
10426
- const updateHeaderButtons = useCallback(() => {
10427
- buttonsRef.current = calendarRef.current?.querySelectorAll(
10428
- "[data-calendar-header-button]"
10429
- );
10430
- }, []);
10431
- useEffect(() => {
10432
- updateHeaderButtons();
10433
- }, [updateHeaderButtons]);
10434
- const handleHeaderKeyDown = useCallback((e) => {
10435
- const target = e.target;
10436
- if (!buttonsRef.current || buttonsRef.current.length === 0) {
10437
- return;
10438
- }
10439
- const buttonArray = Array.from(buttonsRef.current);
10440
- const currentIndex = buttonArray.indexOf(target);
10441
- if (currentIndex === -1) return;
10442
- let newIndex;
10443
- switch (e.key) {
10444
- case "ArrowLeft":
10445
- e.preventDefault();
10446
- newIndex = currentIndex > 0 ? currentIndex - 1 : buttonArray.length - 1;
10447
- buttonArray[newIndex].focus();
10448
- break;
10449
- case "ArrowRight":
10450
- e.preventDefault();
10451
- newIndex = currentIndex < buttonArray.length - 1 ? currentIndex + 1 : 0;
10452
- buttonArray[newIndex].focus();
10453
- break;
10454
- }
10455
- }, []);
10583
+ const handleHeaderKeyDown = useCallback(
10584
+ (e) => {
10585
+ switch (e.key) {
10586
+ case "ArrowLeft":
10587
+ e.preventDefault();
10588
+ setToolbarFocus((previousToolbarFocus) => {
10589
+ const newToolbarFocus = previousToolbarFocus === visibleHeaderButtons[0] ? visibleHeaderButtons[visibleHeaderButtons.length - 1] : visibleHeaderButtons[visibleHeaderButtons.indexOf(previousToolbarFocus) - 1] ?? visibleHeaderButtons[visibleHeaderButtons.length - 1];
10590
+ const button = headerRef.current?.querySelector(
10591
+ `[data-calendar-header-button-name="${newToolbarFocus}"]`
10592
+ );
10593
+ if (button && "focus" in button && typeof button.focus === "function") {
10594
+ button.focus();
10595
+ }
10596
+ return newToolbarFocus;
10597
+ });
10598
+ break;
10599
+ case "ArrowRight":
10600
+ e.preventDefault();
10601
+ setToolbarFocus((previousToolbarFocus) => {
10602
+ const newToolbarFocus = previousToolbarFocus === visibleHeaderButtons[visibleHeaderButtons.length - 1] ? visibleHeaderButtons[0] : visibleHeaderButtons[visibleHeaderButtons.indexOf(previousToolbarFocus) + 1] ?? visibleHeaderButtons[0];
10603
+ const button = headerRef.current?.querySelector(
10604
+ `[data-calendar-header-button-name="${newToolbarFocus}"]`
10605
+ );
10606
+ if (button && "focus" in button && typeof button.focus === "function") {
10607
+ button.focus();
10608
+ }
10609
+ return newToolbarFocus;
10610
+ });
10611
+ }
10612
+ },
10613
+ [visibleHeaderButtons]
10614
+ );
10456
10615
  const handleMonthSelection = useCallback(
10457
10616
  (month) => {
10458
10617
  monthButtonRef.current?.focus();
10618
+ setToolbarFocus(toolbarFocusStates[0]);
10459
10619
  setSelectedMonth(month);
10460
10620
  setFocusedDate(
10461
10621
  DateTime.fromObject({
@@ -10466,12 +10626,14 @@ const CalendarElement = forwardRef(
10466
10626
  );
10467
10627
  setCalendarSelectionState("day");
10468
10628
  },
10629
+ // eslint-disable-next-line react-hooks/exhaustive-deps
10469
10630
  [focusedDate]
10470
10631
  );
10471
10632
  const handleYearSelection = useCallback(
10472
10633
  (year) => {
10473
10634
  if (year === null) return;
10474
10635
  yearButtonRef.current?.focus();
10636
+ setToolbarFocus(toolbarFocusStates[1]);
10475
10637
  setSelectedYear(year);
10476
10638
  setFocusedDate(
10477
10639
  DateTime.fromObject({
@@ -10482,7 +10644,8 @@ const CalendarElement = forwardRef(
10482
10644
  );
10483
10645
  setCalendarSelectionState("day");
10484
10646
  },
10485
- [defaultTimeZone, focusedDate?.month]
10647
+ // eslint-disable-next-line react-hooks/exhaustive-deps
10648
+ [focusedDate?.month]
10486
10649
  );
10487
10650
  return /* @__PURE__ */ jsx(CalendarContext.Provider, { value: providerValue, children: /* @__PURE__ */ jsxs(
10488
10651
  "div",
@@ -10497,6 +10660,7 @@ const CalendarElement = forwardRef(
10497
10660
  /* @__PURE__ */ jsx("div", { className: styles$1["header"], children: /* @__PURE__ */ jsxs(
10498
10661
  "span",
10499
10662
  {
10663
+ ref: headerRef,
10500
10664
  "aria-label": "Calendar navigation",
10501
10665
  role: "toolbar",
10502
10666
  onKeyDown: handleHeaderKeyDown,
@@ -10506,29 +10670,62 @@ const CalendarElement = forwardRef(
10506
10670
  CalendarMonthButton,
10507
10671
  {
10508
10672
  ref: monthButtonRef,
10673
+ tabIndex: _disableFocus ? -1 : toolbarFocus === toolbarFocusStates[0] ? 0 : -1,
10509
10674
  "data-calendar-header-button": true,
10675
+ "data-calendar-header-button-name": toolbarFocusStates[0],
10510
10676
  calendarSelectionState,
10511
- onClick: () => setCalendarSelectionState(
10512
- (prev) => prev === "month" ? "day" : "month"
10513
- )
10677
+ onClick: () => {
10678
+ setCalendarSelectionState(
10679
+ (prev) => prev === "month" ? "day" : "month"
10680
+ );
10681
+ setToolbarFocus(toolbarFocusStates[0]);
10682
+ }
10514
10683
  }
10515
10684
  ),
10516
10685
  /* @__PURE__ */ jsx(
10517
10686
  CalendarYearButton,
10518
10687
  {
10519
10688
  ref: yearButtonRef,
10520
- tabIndex: -1,
10689
+ tabIndex: _disableFocus ? -1 : toolbarFocus === toolbarFocusStates[1] ? 0 : -1,
10521
10690
  "data-calendar-header-button": true,
10691
+ "data-calendar-header-button-name": toolbarFocusStates[1],
10522
10692
  calendarSelectionState,
10523
- onClick: () => setCalendarSelectionState(
10524
- (prev) => prev === "year" ? "day" : "year"
10525
- )
10693
+ onClick: () => {
10694
+ setCalendarSelectionState(
10695
+ (prev) => prev === "year" ? "day" : "year"
10696
+ );
10697
+ setToolbarFocus(toolbarFocusStates[1]);
10698
+ }
10526
10699
  }
10527
10700
  ),
10528
10701
  calendarSelectionState === "day" && /* @__PURE__ */ jsxs(Fragment, { children: [
10529
- /* @__PURE__ */ jsx(CalendarPrev, { tabIndex: -1, "data-calendar-header-button": true }),
10530
- /* @__PURE__ */ jsx(CalendarNext, { tabIndex: -1, "data-calendar-header-button": true }),
10531
- /* @__PURE__ */ jsx(CalendarNow, { tabIndex: -1, "data-calendar-header-button": true })
10702
+ /* @__PURE__ */ jsx(
10703
+ CalendarPrev,
10704
+ {
10705
+ tabIndex: _disableFocus ? -1 : toolbarFocus === toolbarFocusStates[2] ? 0 : -1,
10706
+ "data-calendar-header-button": true,
10707
+ "data-calendar-header-button-name": toolbarFocusStates[2],
10708
+ onClick: () => setToolbarFocus(toolbarFocusStates[2])
10709
+ }
10710
+ ),
10711
+ /* @__PURE__ */ jsx(
10712
+ CalendarNext,
10713
+ {
10714
+ tabIndex: _disableFocus ? -1 : toolbarFocus === toolbarFocusStates[3] ? 0 : -1,
10715
+ "data-calendar-header-button": true,
10716
+ "data-calendar-header-button-name": toolbarFocusStates[3],
10717
+ onClick: () => setToolbarFocus(toolbarFocusStates[3])
10718
+ }
10719
+ ),
10720
+ /* @__PURE__ */ jsx(
10721
+ CalendarNow,
10722
+ {
10723
+ tabIndex: _disableFocus ? -1 : toolbarFocus === toolbarFocusStates[4] ? 0 : -1,
10724
+ "data-calendar-header-button": true,
10725
+ "data-calendar-header-button-name": toolbarFocusStates[4],
10726
+ onClickFixed: () => setToolbarFocus(toolbarFocusStates[4])
10727
+ }
10728
+ )
10532
10729
  ] })
10533
10730
  ]
10534
10731
  }
@@ -10635,4 +10832,4 @@ const Calendar = Object.assign(CalendarElement, {
10635
10832
  });
10636
10833
 
10637
10834
  export { Calendar as C, DateTime as D, CalendarNow as a, CalendarYearButton as b, CalendarPrev as c, CalendarNext as d, CalendarMonthButton as e, CalendarMonth as f, isValidDate as i, toDateString as t };
10638
- //# sourceMappingURL=Calendar-BQ5F2ENO.js.map
10835
+ //# sourceMappingURL=Calendar-Cn0fOgog.js.map