@easypost/easy-ui 1.0.0-alpha.54 → 1.0.0-alpha.56

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 (239) hide show
  1. package/Badge/index.js +14 -14
  2. package/Badge/index.mjs +14 -14
  3. package/Banner/index.js +5 -5
  4. package/Banner/index.mjs +5 -5
  5. package/Button/index.js +1 -1
  6. package/Button/index.mjs +1 -1
  7. package/CHANGELOG.md +13 -0
  8. package/Calendar/Calendar.d.ts +43 -33
  9. package/Calendar/Calendar.d.ts.map +1 -1
  10. package/Calendar/CalendarBase.d.ts +57 -0
  11. package/Calendar/CalendarBase.d.ts.map +1 -0
  12. package/Calendar/CalendarCell.d.ts +2 -2
  13. package/Calendar/CalendarCell.d.ts.map +1 -1
  14. package/Calendar/CalendarGrid.d.ts +2 -5
  15. package/Calendar/CalendarGrid.d.ts.map +1 -1
  16. package/Calendar/CalendarHeader.d.ts +1 -6
  17. package/Calendar/CalendarHeader.d.ts.map +1 -1
  18. package/Calendar/index.js +9 -3349
  19. package/Calendar/index.mjs +8 -3348
  20. package/Card/index.js +1 -1
  21. package/Card/index.mjs +1 -1
  22. package/Checkbox/index.js +1 -1
  23. package/Checkbox/index.mjs +1 -1
  24. package/CodeBlock/index.js +14 -14
  25. package/CodeBlock/index.mjs +16 -16
  26. package/CodeSnippet/index.js +1 -1
  27. package/CodeSnippet/index.mjs +1 -1
  28. package/DataGrid/index.js +63 -63
  29. package/DataGrid/index.mjs +72 -72
  30. package/Drawer/index.js +23 -24
  31. package/Drawer/index.mjs +21 -22
  32. package/DropdownButton/index.js +13 -13
  33. package/DropdownButton/index.mjs +13 -13
  34. package/EmptyStateCard/index.js +8 -8
  35. package/EmptyStateCard/index.mjs +8 -8
  36. package/FocusedProductLayout/index.js +23 -23
  37. package/FocusedProductLayout/index.mjs +23 -23
  38. package/FormLayout/index.js +5 -5
  39. package/FormLayout/index.mjs +5 -5
  40. package/HorizontalGrid/index.js +1 -1
  41. package/HorizontalGrid/index.mjs +1 -1
  42. package/HorizontalStack/index.js +1 -1
  43. package/HorizontalStack/index.mjs +1 -1
  44. package/Icon/index.js +1 -1
  45. package/Icon/index.mjs +1 -1
  46. package/IconButton/index.js +13 -13
  47. package/IconButton/index.mjs +13 -13
  48. package/InputField/InputField.d.ts +4 -0
  49. package/InputField/InputField.d.ts.map +1 -1
  50. package/InputField/index.js +1 -1
  51. package/InputField/index.mjs +1 -1
  52. package/InputField/inputText.d.ts +24 -0
  53. package/InputField/inputText.d.ts.map +1 -0
  54. package/InputField/utilities.d.ts +1 -1
  55. package/InputField/utilities.d.ts.map +1 -1
  56. package/KebabButton/index.js +1 -1
  57. package/KebabButton/index.mjs +1 -1
  58. package/Menu/index.js +1 -1
  59. package/Menu/index.mjs +1 -1
  60. package/Modal/index.js +24 -25
  61. package/Modal/index.mjs +22 -23
  62. package/NexusLayout/index.js +30 -30
  63. package/NexusLayout/index.mjs +32 -32
  64. package/Notification/index.js +1 -1
  65. package/Notification/index.mjs +1 -1
  66. package/Pagination/index.js +11 -11
  67. package/Pagination/index.mjs +9 -9
  68. package/PillGroup/index.js +12 -12
  69. package/PillGroup/index.mjs +22 -22
  70. package/ProductLayout/index.js +26 -27
  71. package/ProductLayout/index.mjs +25 -26
  72. package/Provider/index.js +2 -2
  73. package/Provider/index.mjs +2 -2
  74. package/RadioButtonGroup/index.js +4 -4
  75. package/RadioButtonGroup/index.mjs +8 -8
  76. package/RadioGroup/index.js +18 -18
  77. package/RadioGroup/index.mjs +25 -25
  78. package/RangeCalendar/RangeCalendar.d.ts +71 -0
  79. package/RangeCalendar/RangeCalendar.d.ts.map +1 -0
  80. package/RangeCalendar/RangeCalendar.stories.d.ts +15 -0
  81. package/RangeCalendar/RangeCalendar.stories.d.ts.map +1 -0
  82. package/RangeCalendar/RangeCalendar.test.d.ts +2 -0
  83. package/RangeCalendar/RangeCalendar.test.d.ts.map +1 -0
  84. package/RangeCalendar/index.d.ts +2 -0
  85. package/RangeCalendar/index.d.ts.map +1 -0
  86. package/RangeCalendar/index.js +228 -0
  87. package/RangeCalendar/index.mjs +228 -0
  88. package/SearchNav/index.js +30 -30
  89. package/SearchNav/index.mjs +30 -30
  90. package/SectionCard/index.js +9 -5497
  91. package/SectionCard/index.mjs +8 -5496
  92. package/Select/index.js +5 -5
  93. package/Select/index.mjs +5 -5
  94. package/SelectorErrorTooltip/index.js +1 -1
  95. package/SelectorErrorTooltip/index.mjs +1 -1
  96. package/Spinner/index.js +1 -1
  97. package/Spinner/index.mjs +1 -1
  98. package/SplitToggleCard/index.js +4 -4
  99. package/SplitToggleCard/index.mjs +4 -4
  100. package/Stepper/index.js +1 -1
  101. package/Stepper/index.mjs +1 -1
  102. package/TabNav/index.js +1 -1
  103. package/TabNav/index.mjs +1 -1
  104. package/TabPanels/index.js +4 -4
  105. package/TabPanels/index.mjs +7 -7
  106. package/Tabs/index.js +1 -1
  107. package/Tabs/index.mjs +1 -1
  108. package/Text/index.js +1 -1
  109. package/Text/index.mjs +1 -1
  110. package/TextField/TextField.stories.d.ts +1 -0
  111. package/TextField/TextField.stories.d.ts.map +1 -1
  112. package/TextField/index.js +1 -1
  113. package/TextField/index.mjs +1 -1
  114. package/Textarea/index.js +1 -1
  115. package/Textarea/index.mjs +1 -1
  116. package/Toggle/index.js +1 -1
  117. package/Toggle/index.mjs +1 -1
  118. package/ToggleCard/index.js +2 -2
  119. package/ToggleCard/index.mjs +2 -2
  120. package/Tooltip/index.js +1 -1
  121. package/Tooltip/index.mjs +1 -1
  122. package/UnstyledButton/index.js +1 -1
  123. package/UnstyledButton/index.mjs +1 -1
  124. package/VerticalNav/index.js +25 -25
  125. package/VerticalNav/index.mjs +26 -26
  126. package/VerticalStack/index.js +1 -1
  127. package/VerticalStack/index.mjs +1 -1
  128. package/__chunks__/{Button-Dy9idhgT.mjs → Button-D6onI-kJ.mjs} +18 -18
  129. package/__chunks__/{Button-D_Bk7BuN.js → Button-DQ2NkvB7.js} +18 -18
  130. package/__chunks__/CalendarBase-DaXcE0Vl.js +3410 -0
  131. package/__chunks__/CalendarBase-DkLU-xxk.mjs +3411 -0
  132. package/__chunks__/{Card-mxjU9S-F.mjs → Card-CYdEo89C.mjs} +12 -12
  133. package/__chunks__/{Card-9RlZlFEC.js → Card-Cw9W0Zvm.js} +12 -12
  134. package/__chunks__/{Checkbox-CBB8jlZw.js → Checkbox-DMIaBIMX.js} +21 -21
  135. package/__chunks__/{Checkbox-BgumKMXU.mjs → Checkbox-DTX_wDBB.mjs} +24 -24
  136. package/__chunks__/{CodeSnippet-BjUoaeh9.mjs → CodeSnippet-CBDtqnFn.mjs} +2 -2
  137. package/__chunks__/{CodeSnippet-DVrkwOg4.js → CodeSnippet-Dg-w1ncw.js} +2 -2
  138. package/__chunks__/{FocusScope-C194OB-4.mjs → FocusScope-CEeqhVmO.mjs} +3 -3
  139. package/__chunks__/{FocusScope-DJer9ahG.js → FocusScope-Co1hHX8R.js} +1 -1
  140. package/__chunks__/{HelpMenu-m1qJ4EyP.mjs → HelpMenu-DCIr7b5K.mjs} +7 -7
  141. package/__chunks__/{HelpMenu-DF2Bx-bn.js → HelpMenu-br4uY5D7.js} +7 -7
  142. package/__chunks__/{HorizontalGrid-BYR8Gr-h.mjs → HorizontalGrid--W2GD8lN.mjs} +1 -1
  143. package/__chunks__/{HorizontalGrid-DuHNRhon.js → HorizontalGrid-BUpw5nwO.js} +1 -1
  144. package/__chunks__/{HorizontalStack-By6XdGZh.js → HorizontalStack-CXhmbQu4.js} +1 -1
  145. package/__chunks__/{HorizontalStack-DaZakHYj.mjs → HorizontalStack-x4HGqgsU.mjs} +1 -1
  146. package/__chunks__/{Icon-BB9QecRC.js → Icon-BCBvOy-b.js} +2 -2
  147. package/__chunks__/{Icon-3zFwhVjn.mjs → Icon-CDgix2Sz.mjs} +2 -2
  148. package/__chunks__/{InputField-CdEl4M4-.mjs → InputField-Bj22Z9om.mjs} +36 -14
  149. package/__chunks__/{InputField-CHAxJwME.js → InputField-C86b2081.js} +31 -9
  150. package/__chunks__/{InputIcon-oj25h1MN.js → InputIcon-BLzlQuQq.js} +44 -27
  151. package/__chunks__/{InputIcon--PdoGQOO.mjs → InputIcon-zjySEVjo.mjs} +44 -27
  152. package/__chunks__/{KebabButton-3bAqpgLu.js → KebabButton-ClU7vgEf.js} +5 -5
  153. package/__chunks__/{KebabButton-fmLpDchx.mjs → KebabButton-DDDKfSUI.mjs} +5 -5
  154. package/__chunks__/{Menu-B95QYBVQ.mjs → Menu-B4KcJbMm.mjs} +20 -21
  155. package/__chunks__/{Menu--B0Fn4Ol.js → Menu-anVQErb9.js} +18 -19
  156. package/__chunks__/{Notification-DTb3bJn4.js → Notification-BCLsclpu.js} +20 -20
  157. package/__chunks__/{Notification-D15awRNG.mjs → Notification-BoMoXyLI.mjs} +20 -20
  158. package/__chunks__/{Overlay-BtzIt9Ka.mjs → Overlay-CuhLUuXt.mjs} +58 -6
  159. package/__chunks__/{Overlay-CUtfbILq.js → Overlay-ZinDp2HW.js} +54 -2
  160. package/__chunks__/{SelectOverlay-_dx1vHML.js → SelectOverlay-BAFmxwi9.js} +26 -27
  161. package/__chunks__/{SelectOverlay-D39ws5R2.mjs → SelectOverlay-C5Kk7H2z.mjs} +34 -35
  162. package/__chunks__/{SelectorErrorTooltip-DhV9YtiA.js → SelectorErrorTooltip-B1tkBijI.js} +4 -4
  163. package/__chunks__/{SelectorErrorTooltip-D8y5kImH.mjs → SelectorErrorTooltip-C3BApHSk.mjs} +4 -4
  164. package/__chunks__/{Spinner-CVcjgzNy.js → Spinner-0AHyjbiK.js} +5 -5
  165. package/__chunks__/{Spinner-CfniY1TS.mjs → Spinner-DCi-JKIV.mjs} +8 -8
  166. package/__chunks__/{Stepper-D_2YRENa.mjs → Stepper-CgF1pSNE.mjs} +28 -28
  167. package/__chunks__/{Stepper-E2li7kd2.js → Stepper-Ds60cKSk.js} +26 -26
  168. package/__chunks__/{TabNav-BgwlyiLE.mjs → TabNav-BVyJkGz0.mjs} +1 -1
  169. package/__chunks__/{TabNav-C7_HMIZx.js → TabNav-BpsdF4EQ.js} +1 -1
  170. package/__chunks__/{Tabs-WKn9NKJy.js → Tabs-BTr3Uoym.js} +17 -17
  171. package/__chunks__/{Tabs-CwxqTiAn.mjs → Tabs-N3WVqQTL.mjs} +19 -19
  172. package/__chunks__/{Text-CoOcI-ZA.js → Text-Bo5ZXIKu.js} +34 -34
  173. package/__chunks__/{Text-Dfn-c0km.mjs → Text-Sv_euunS.mjs} +34 -34
  174. package/__chunks__/{Toggle-DYTnMD3t.js → Toggle-CHXljwk6.js} +12 -12
  175. package/__chunks__/{Toggle-qa6gbH9Q.mjs → Toggle-Dj6H2veI.mjs} +14 -14
  176. package/__chunks__/{Tooltip-6vJKVOnU.js → Tooltip-C0qyP5jK.js} +14 -14
  177. package/__chunks__/{Tooltip-DnLwtGUV.mjs → Tooltip-DMLWZU15.mjs} +14 -14
  178. package/__chunks__/{UnstyledButton-0v6TRjMY.mjs → UnstyledButton-6seSbTV1.mjs} +2 -2
  179. package/__chunks__/{UnstyledButton-BfeN_d1h.js → UnstyledButton-Dn8KZHdh.js} +1 -1
  180. package/__chunks__/{VerticalStack-ac4iBcxE.mjs → VerticalStack-BGcflJsS.mjs} +3 -3
  181. package/__chunks__/{VerticalStack-BUxIVmGp.js → VerticalStack-DYStFa7Z.js} +3 -3
  182. package/__chunks__/{VisuallyHidden-BsBkcHpw.mjs → VisuallyHidden-BttNIgVC.mjs} +2 -2
  183. package/__chunks__/{ariaHideOutside-2fSu0FuJ.js → ariaHideOutside-DNGR3Fo6.js} +3 -3
  184. package/__chunks__/{ariaHideOutside-Dhj8j6Mb.mjs → ariaHideOutside-DcIkumuG.mjs} +5 -5
  185. package/__chunks__/{runAfterTransition-DtSqibrj.js → context-C6CFGY_J.js} +7 -0
  186. package/__chunks__/{runAfterTransition-B7Bfhj0D.mjs → context-CgOWZch5.mjs} +8 -1
  187. package/__chunks__/{context-D3I6RuRU.mjs → context-DEwqildc.mjs} +1 -1
  188. package/__chunks__/{focusSafely-DfpH-pE9.mjs → focusSafely-Dw7K4rnX.mjs} +3 -3
  189. package/__chunks__/{focusSafely-CZPj1Dug.js → focusSafely-sLifanM7.js} +4 -4
  190. package/__chunks__/{isVirtualEvent-BPCuFO54.mjs → isVirtualEvent-BFRy7P_p.mjs} +2 -2
  191. package/__chunks__/lodash-Cu2-TIbX.mjs +5492 -0
  192. package/__chunks__/lodash-DfTCP3Dk.js +5491 -0
  193. package/__chunks__/{mergeProps-SJQ-f8LF.mjs → mergeProps-T961Q1yJ.mjs} +4 -4
  194. package/__chunks__/{scrollIntoView-C4vMSOYx.mjs → scrollIntoView-GfnXaOCE.mjs} +1 -1
  195. package/__chunks__/{useButton-C6QFpa4j.mjs → useButton-DEhs-Rkj.mjs} +3 -3
  196. package/__chunks__/{useButton-DVdJNlul.js → useButton-DvulUoU2.js} +2 -2
  197. package/__chunks__/{useDialog-CfUEt_df.mjs → useDialog-DAYxqkKY.mjs} +4 -4
  198. package/__chunks__/{useDialog-CtMBWxF5.js → useDialog-Dsqz1M_N.js} +3 -3
  199. package/__chunks__/{useEdgeInterceptors-DYwJNXXm.mjs → useEdgeInterceptors-B-WQYXsP.mjs} +5 -5
  200. package/__chunks__/{useEdgeInterceptors-CQ1iontu.js → useEdgeInterceptors-CuD3aTAb.js} +5 -5
  201. package/__chunks__/useEvent-C5RCZjKr.mjs +23 -0
  202. package/__chunks__/useEvent-DY7dR7Mi.js +22 -0
  203. package/__chunks__/{useField-DPD-La1H.mjs → useField-DWmSslhe.mjs} +2 -2
  204. package/__chunks__/{useFocus-By3Cx-xz.mjs → useFocus-DDj4i8Xy.mjs} +2 -2
  205. package/__chunks__/{useFocusRing-dRPhwlpK.mjs → useFocusRing-BE_dgxH5.mjs} +3 -3
  206. package/__chunks__/{useFocusVisible-BbEmluTm.mjs → useFocusVisible-CXSIZSY_.mjs} +2 -2
  207. package/__chunks__/{useFocusWithin-krnNAgDY.mjs → useFocusWithin-CDX8m0Wu.mjs} +1 -1
  208. package/__chunks__/{useFocusable-D0hhxIk-.js → useFocusable-BfXLORiH.js} +1 -1
  209. package/__chunks__/{useFocusable-B0naYTNU.mjs → useFocusable-DD5dAIXt.mjs} +4 -4
  210. package/__chunks__/{useFormReset-CFhWic3i.mjs → useFormReset-CmXMJVpO.mjs} +1 -1
  211. package/__chunks__/{useFormValidation-DAScndBq.mjs → useFormValidation-gwcVryr8.mjs} +2 -2
  212. package/__chunks__/{useHasTabbableChild-BY-g4H3y.js → useHasTabbableChild-C34XhtMr.js} +1 -1
  213. package/__chunks__/{useHasTabbableChild-9rS-nuc-.mjs → useHasTabbableChild-CRCY1COZ.mjs} +2 -2
  214. package/__chunks__/{useHighlightSelectionDescription-CPtYsCSQ.mjs → useHighlightSelectionDescription-DCgFgP4G.mjs} +3 -3
  215. package/__chunks__/{useLabel-BlM5Qwvq.mjs → useLabel-C0Q8946u.mjs} +2 -2
  216. package/__chunks__/{useLabels-DdXkBiwn.mjs → useLabels-Bly436JP.mjs} +1 -1
  217. package/__chunks__/{useLocalizedStringFormatter-DJWWtB78.mjs → useLocalizedStringFormatter-B5ons_mh.mjs} +1 -1
  218. package/__chunks__/{useModal-DajWXu6g.mjs → useOverlayPosition-B31NgShQ.mjs} +6 -73
  219. package/__chunks__/{useModal-QwDRNW96.js → useOverlayPosition-ucZjuzzI.js} +2 -69
  220. package/__chunks__/{usePress-CiUDlxr6.mjs → usePress-DV7a17gG.mjs} +4 -5
  221. package/__chunks__/{usePress-BVH8whNd.js → usePress-Dz8YYpge.js} +7 -8
  222. package/__chunks__/{useSelectableItem-CHd6ksRw.mjs → useSelectableItem-BDZ5pN_C.mjs} +11 -28
  223. package/__chunks__/{useSelectableItem-C0qCIU8l.js → useSelectableItem-BGvBbIwY.js} +9 -26
  224. package/__chunks__/{useSelectableList-FvytdUu7.mjs → useSelectableList-Bj35aLZH.mjs} +2 -2
  225. package/__chunks__/{useSelectableList-CnP9hXkb.js → useSelectableList-DlkRkps4.js} +1 -1
  226. package/__chunks__/{useSyncRef-Cp332icp.mjs → useSyncRef-CpaiKz0R.mjs} +1 -1
  227. package/__chunks__/{useToggle-YUgC8qn-.mjs → useToggle-BfGkPrAg.mjs} +4 -4
  228. package/__chunks__/{useToggle-DsYRac30.js → useToggle-D7gzXCXF.js} +2 -2
  229. package/__chunks__/{useTriggerWidth-B3JINZlR.mjs → useTriggerWidth-BC_zeUJ5.mjs} +7 -7
  230. package/__chunks__/{useTriggerWidth-CcKoLR8z.js → useTriggerWidth-C7OT3WI9.js} +4 -4
  231. package/__chunks__/{utils-Dm-0qf_-.mjs → utils-XuD3IFpv.mjs} +1 -1
  232. package/package.json +1 -1
  233. package/style.css +1131 -1046
  234. package/__chunks__/context-B-c1HPQa.js +0 -8
  235. package/__chunks__/context-BzShm_W7.mjs +0 -9
  236. package/__chunks__/useCloseOnScroll-CLFhBFoo.js +0 -54
  237. package/__chunks__/useCloseOnScroll-DxZ3orlK.mjs +0 -55
  238. package/__chunks__/{KeyboardDoubleArrowLeft-GpUjmD9o.mjs → KeyboardDoubleArrowRight-AAMLvGk-.mjs} +4 -4
  239. package/__chunks__/{KeyboardDoubleArrowLeft-BHR8vGMo.js → KeyboardDoubleArrowRight-Ber8mUIO.js} +4 -4
@@ -1,6 +1,6 @@
1
- import { a as $ea8dcbcb9ea1b556$export$323e4fc2fa4753fb } from "../__chunks__/usePress-CiUDlxr6.mjs";
1
+ import { a as $ea8dcbcb9ea1b556$export$323e4fc2fa4753fb } from "../__chunks__/usePress-DV7a17gG.mjs";
2
2
  import React__default from "react";
3
- import { b as NotificationProvider } from "../__chunks__/Notification-D15awRNG.mjs";
3
+ import { b as NotificationProvider } from "../__chunks__/Notification-BoMoXyLI.mjs";
4
4
  import { T as ThemeProvider } from "../__chunks__/Theme-CKTfAcvs.mjs";
5
5
  function Provider({ children, theme, colorScheme, notificationPlacement, navigate, useHref }) {
6
6
  return React__default.createElement(EasyUIRouterProvider, {
@@ -22,16 +22,16 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
22
22
  const React = require("react");
23
23
  const utils = require("../__chunks__/utils-DXO9zsKE.js");
24
24
  const useControlledState = require("../__chunks__/useControlledState-mnKBd6Uc.js");
25
- const useButton = require("../__chunks__/useButton-DVdJNlul.js");
25
+ const useButton = require("../__chunks__/useButton-DvulUoU2.js");
26
26
  const mergeProps = require("../__chunks__/mergeProps-DniMwM6P.js");
27
- const FocusScope = require("../__chunks__/FocusScope-DJer9ahG.js");
27
+ const FocusScope = require("../__chunks__/FocusScope-Co1hHX8R.js");
28
28
  const filterDOMProps = require("../__chunks__/filterDOMProps-D3iOHP0H.js");
29
29
  const context = require("../__chunks__/context-D3NeXov7.js");
30
30
  const useToggleState = require("../__chunks__/useToggleState-CdbEMLRz.js");
31
31
  const useFocusRing = require("../__chunks__/useFocusRing-DFRFvht_.js");
32
32
  const useHover = require("../__chunks__/useHover-BIKwjrCT.js");
33
33
  const utilities_css = require("../utilities/css.js");
34
- const Text = require("../__chunks__/Text-CoOcI-ZA.js");
34
+ const Text = require("../__chunks__/Text-Bo5ZXIKu.js");
35
35
  function $ad999b7f496648d1$export$8deac67f4addf270(props) {
36
36
  let { selectionMode = "single", disallowEmptySelection, isDisabled = false } = props;
37
37
  let [selectedKeys, setSelectedKeys] = useControlledState.$458b0a5536c1a7cf$export$40bfa8c7b0832715(React.useMemo(() => props.selectedKeys ? new Set(props.selectedKeys) : void 0, [
@@ -230,7 +230,7 @@ function $efde0372d7a700fe$var$ToggleButton(props, ref) {
230
230
  }));
231
231
  }
232
232
  const $efde0372d7a700fe$export$d2b052e7b4be1756 = /* @__PURE__ */ React.forwardRef($efde0372d7a700fe$var$ToggleButton);
233
- const RadioButtonGroupButton$1 = "_RadioButtonGroupButton_mfbzo_5";
233
+ const RadioButtonGroupButton$1 = "_RadioButtonGroupButton_1clij_5";
234
234
  const styles = {
235
235
  RadioButtonGroupButton: RadioButtonGroupButton$1
236
236
  };
@@ -18,18 +18,18 @@ var __spreadValues = (a, b) => {
18
18
  };
19
19
  var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
20
20
  import React__default, { useMemo, useState, useRef, forwardRef, createContext, useContext } from "react";
21
- import { $ as $64fa3d84918910a7$export$29f1550f4b0d4415, a as $64fa3d84918910a7$export$4d86445c2cf5e3 } from "../__chunks__/utils-Dm-0qf_-.mjs";
21
+ import { $ as $64fa3d84918910a7$export$29f1550f4b0d4415, a as $64fa3d84918910a7$export$4d86445c2cf5e3 } from "../__chunks__/utils-XuD3IFpv.mjs";
22
22
  import { $ as $458b0a5536c1a7cf$export$40bfa8c7b0832715 } from "../__chunks__/useControlledState-CFWhSD5C.mjs";
23
- import { $ as $701a24aa0da5b062$export$ea18c227d4417cc3 } from "../__chunks__/useButton-C6QFpa4j.mjs";
24
- import { f as $ff5963eb1fccf552$export$e08e3b67e392101e, a as $3ef42575df84b30b$export$9d1611c77c2fe928, b as $f0a04ccd8dbdd83b$export$e5c5a5f917a5871c } from "../__chunks__/mergeProps-SJQ-f8LF.mjs";
25
- import { c as $9bf71ea28793e738$export$c5251b9e124bf29 } from "../__chunks__/FocusScope-C194OB-4.mjs";
23
+ import { $ as $701a24aa0da5b062$export$ea18c227d4417cc3 } from "../__chunks__/useButton-DEhs-Rkj.mjs";
24
+ import { f as $ff5963eb1fccf552$export$e08e3b67e392101e, $ as $3ef42575df84b30b$export$9d1611c77c2fe928, a as $f0a04ccd8dbdd83b$export$e5c5a5f917a5871c } from "../__chunks__/mergeProps-T961Q1yJ.mjs";
25
+ import { c as $9bf71ea28793e738$export$c5251b9e124bf29 } from "../__chunks__/FocusScope-CEeqhVmO.mjs";
26
26
  import { $ as $65484d02dcb7eb3e$export$457c3d6518dd4c6f } from "../__chunks__/filterDOMProps-EDDcM64A.mjs";
27
- import { $ as $18f2051aff69b9bf$export$43bb16f9c6d9e3f7 } from "../__chunks__/context-D3I6RuRU.mjs";
27
+ import { $ as $18f2051aff69b9bf$export$43bb16f9c6d9e3f7 } from "../__chunks__/context-DEwqildc.mjs";
28
28
  import { $ as $3017fa7ffdddec74$export$8042c6c013fd5226 } from "../__chunks__/useToggleState-kFojjzgV.mjs";
29
- import { $ as $f7dceffc5ad7768b$export$4e328f61c538687f } from "../__chunks__/useFocusRing-dRPhwlpK.mjs";
29
+ import { $ as $f7dceffc5ad7768b$export$4e328f61c538687f } from "../__chunks__/useFocusRing-BE_dgxH5.mjs";
30
30
  import { $ as $6179b936705e76d3$export$ae780daf29e6d456 } from "../__chunks__/useHover-BOYR4wqI.mjs";
31
31
  import { getComponentThemeToken, classNames } from "../utilities/css.mjs";
32
- import { T as Text } from "../__chunks__/Text-Dfn-c0km.mjs";
32
+ import { T as Text } from "../__chunks__/Text-Sv_euunS.mjs";
33
33
  function $ad999b7f496648d1$export$8deac67f4addf270(props) {
34
34
  let { selectionMode = "single", disallowEmptySelection, isDisabled = false } = props;
35
35
  let [selectedKeys, setSelectedKeys] = $458b0a5536c1a7cf$export$40bfa8c7b0832715(useMemo(() => props.selectedKeys ? new Set(props.selectedKeys) : void 0, [
@@ -228,7 +228,7 @@ function $efde0372d7a700fe$var$ToggleButton(props, ref) {
228
228
  }));
229
229
  }
230
230
  const $efde0372d7a700fe$export$d2b052e7b4be1756 = /* @__PURE__ */ forwardRef($efde0372d7a700fe$var$ToggleButton);
231
- const RadioButtonGroupButton$1 = "_RadioButtonGroupButton_mfbzo_5";
231
+ const RadioButtonGroupButton$1 = "_RadioButtonGroupButton_1clij_5";
232
232
  const styles = {
233
233
  RadioButtonGroupButton: RadioButtonGroupButton$1
234
234
  };
@@ -32,20 +32,20 @@ var __objRest = (source, exclude) => {
32
32
  };
33
33
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
34
34
  const React = require("react");
35
- const Text = require("../__chunks__/Text-CoOcI-ZA.js");
36
- const HorizontalStack = require("../__chunks__/HorizontalStack-By6XdGZh.js");
37
- const SelectorErrorTooltip = require("../__chunks__/SelectorErrorTooltip-DhV9YtiA.js");
35
+ const Text = require("../__chunks__/Text-Bo5ZXIKu.js");
36
+ const HorizontalStack = require("../__chunks__/HorizontalStack-CXhmbQu4.js");
37
+ const SelectorErrorTooltip = require("../__chunks__/SelectorErrorTooltip-B1tkBijI.js");
38
38
  const utilities_css = require("../utilities/css.js");
39
39
  const mergeProps = require("../__chunks__/mergeProps-DniMwM6P.js");
40
40
  const filterDOMProps = require("../__chunks__/filterDOMProps-D3iOHP0H.js");
41
41
  const useFormReset = require("../__chunks__/useFormReset-Bgj93eR3.js");
42
- const useFocusable = require("../__chunks__/useFocusable-D0hhxIk-.js");
42
+ const useFocusable = require("../__chunks__/useFocusable-BfXLORiH.js");
43
43
  const useFormValidation = require("../__chunks__/useFormValidation-C2DoIczP.js");
44
- const usePress = require("../__chunks__/usePress-BVH8whNd.js");
44
+ const usePress = require("../__chunks__/usePress-Dz8YYpge.js");
45
45
  const useFocusRing = require("../__chunks__/useFocusRing-DFRFvht_.js");
46
46
  const useHover = require("../__chunks__/useHover-BIKwjrCT.js");
47
47
  const useControlledState = require("../__chunks__/useControlledState-mnKBd6Uc.js");
48
- const FocusScope = require("../__chunks__/FocusScope-DJer9ahG.js");
48
+ const FocusScope = require("../__chunks__/FocusScope-Co1hHX8R.js");
49
49
  const useField = require("../__chunks__/useField-BJW_bXVD.js");
50
50
  const useFocusWithin = require("../__chunks__/useFocusWithin-C1ioGWec.js");
51
51
  const context = require("../__chunks__/context-D3NeXov7.js");
@@ -244,16 +244,16 @@ const useRadioGroupContext = () => {
244
244
  }
245
245
  return radioGroupContext;
246
246
  };
247
- const RadioGroupItem$1 = "_RadioGroupItem_1m39v_5";
248
- const label = "_label_1m39v_11";
249
- const radioOuter = "_radioOuter_1m39v_29";
250
- const radioInner = "_radioInner_1m39v_30";
251
- const focusVisible = "_focusVisible_1m39v_44";
252
- const selected = "_selected_1m39v_63";
253
- const invalid = "_invalid_1m39v_67";
254
- const disabled = "_disabled_1m39v_71";
255
- const hovered = "_hovered_1m39v_83";
256
- const readOnly = "_readOnly_1m39v_83";
247
+ const RadioGroupItem$1 = "_RadioGroupItem_3yg2r_5";
248
+ const label = "_label_3yg2r_11";
249
+ const radioOuter = "_radioOuter_3yg2r_29";
250
+ const radioInner = "_radioInner_3yg2r_30";
251
+ const focusVisible = "_focusVisible_3yg2r_44";
252
+ const selected = "_selected_3yg2r_63";
253
+ const invalid = "_invalid_3yg2r_67";
254
+ const disabled = "_disabled_3yg2r_71";
255
+ const hovered = "_hovered_3yg2r_83";
256
+ const readOnly = "_readOnly_3yg2r_83";
257
257
  const styles$1 = {
258
258
  RadioGroupItem: RadioGroupItem$1,
259
259
  label,
@@ -302,8 +302,8 @@ function RadioGroupItem(props) {
302
302
  content: errorText
303
303
  })));
304
304
  }
305
- const RadioGroup$1 = "_RadioGroup_1g9j9_5";
306
- const list = "_list_1g9j9_14";
305
+ const RadioGroup$1 = "_RadioGroup_13efh_5";
306
+ const list = "_list_13efh_14";
307
307
  const styles = {
308
308
  RadioGroup: RadioGroup$1,
309
309
  list
@@ -30,23 +30,23 @@ var __objRest = (source, exclude) => {
30
30
  return target;
31
31
  };
32
32
  import React__default, { useMemo, useState, useContext } from "react";
33
- import { T as Text } from "../__chunks__/Text-Dfn-c0km.mjs";
34
- import { H as HorizontalStack } from "../__chunks__/HorizontalStack-DaZakHYj.mjs";
35
- import { S as SelectorErrorTooltip } from "../__chunks__/SelectorErrorTooltip-D8y5kImH.mjs";
33
+ import { T as Text } from "../__chunks__/Text-Sv_euunS.mjs";
34
+ import { H as HorizontalStack } from "../__chunks__/HorizontalStack-x4HGqgsU.mjs";
35
+ import { S as SelectorErrorTooltip } from "../__chunks__/SelectorErrorTooltip-C3BApHSk.mjs";
36
36
  import { classNames } from "../utilities/css.mjs";
37
- import { a as $3ef42575df84b30b$export$9d1611c77c2fe928, d as $bdb11010cef70236$export$f680877a34711e37 } from "../__chunks__/mergeProps-SJQ-f8LF.mjs";
37
+ import { $ as $3ef42575df84b30b$export$9d1611c77c2fe928, d as $bdb11010cef70236$export$f680877a34711e37 } from "../__chunks__/mergeProps-T961Q1yJ.mjs";
38
38
  import { $ as $65484d02dcb7eb3e$export$457c3d6518dd4c6f } from "../__chunks__/filterDOMProps-EDDcM64A.mjs";
39
- import { $ as $99facab73266f662$export$5add1d006293d136 } from "../__chunks__/useFormReset-CFhWic3i.mjs";
40
- import { $ as $e6afbd83fe6ebbd2$export$4c014de7c8940b4c } from "../__chunks__/useFocusable-B0naYTNU.mjs";
41
- import { $ as $e5be200c675c3b3a$export$fc1a364ae1f3ff10, a as $e93e671b31057976$export$b8473d3665f3a75a } from "../__chunks__/useFormValidation-DAScndBq.mjs";
42
- import { $ as $f6c31cce2adf654f$export$45712eceda6fad21 } from "../__chunks__/usePress-CiUDlxr6.mjs";
43
- import { $ as $f7dceffc5ad7768b$export$4e328f61c538687f } from "../__chunks__/useFocusRing-dRPhwlpK.mjs";
39
+ import { $ as $99facab73266f662$export$5add1d006293d136 } from "../__chunks__/useFormReset-CmXMJVpO.mjs";
40
+ import { $ as $e6afbd83fe6ebbd2$export$4c014de7c8940b4c } from "../__chunks__/useFocusable-DD5dAIXt.mjs";
41
+ import { $ as $e5be200c675c3b3a$export$fc1a364ae1f3ff10, a as $e93e671b31057976$export$b8473d3665f3a75a } from "../__chunks__/useFormValidation-gwcVryr8.mjs";
42
+ import { $ as $f6c31cce2adf654f$export$45712eceda6fad21 } from "../__chunks__/usePress-DV7a17gG.mjs";
43
+ import { $ as $f7dceffc5ad7768b$export$4e328f61c538687f } from "../__chunks__/useFocusRing-BE_dgxH5.mjs";
44
44
  import { $ as $6179b936705e76d3$export$ae780daf29e6d456 } from "../__chunks__/useHover-BOYR4wqI.mjs";
45
45
  import { $ as $458b0a5536c1a7cf$export$40bfa8c7b0832715 } from "../__chunks__/useControlledState-CFWhSD5C.mjs";
46
- import { $ as $9bf71ea28793e738$export$2d6ec8fc375ceafa } from "../__chunks__/FocusScope-C194OB-4.mjs";
47
- import { $ as $2baaea4c71418dea$export$294aa081a6c6f55d } from "../__chunks__/useField-DPD-La1H.mjs";
48
- import { $ as $9ab94262bd0047c7$export$420e68273165f4ec } from "../__chunks__/useFocusWithin-krnNAgDY.mjs";
49
- import { $ as $18f2051aff69b9bf$export$43bb16f9c6d9e3f7 } from "../__chunks__/context-D3I6RuRU.mjs";
46
+ import { $ as $9bf71ea28793e738$export$2d6ec8fc375ceafa } from "../__chunks__/FocusScope-CEeqhVmO.mjs";
47
+ import { $ as $2baaea4c71418dea$export$294aa081a6c6f55d } from "../__chunks__/useField-DWmSslhe.mjs";
48
+ import { $ as $9ab94262bd0047c7$export$420e68273165f4ec } from "../__chunks__/useFocusWithin-CDX8m0Wu.mjs";
49
+ import { $ as $18f2051aff69b9bf$export$43bb16f9c6d9e3f7 } from "../__chunks__/context-DEwqildc.mjs";
50
50
  let $a54cdc5c1942b639$var$instance = Math.round(Math.random() * 1e10);
51
51
  let $a54cdc5c1942b639$var$i = 0;
52
52
  function $a54cdc5c1942b639$export$bca9d026f8e704eb(props) {
@@ -242,16 +242,16 @@ const useRadioGroupContext = () => {
242
242
  }
243
243
  return radioGroupContext;
244
244
  };
245
- const RadioGroupItem$1 = "_RadioGroupItem_1m39v_5";
246
- const label = "_label_1m39v_11";
247
- const radioOuter = "_radioOuter_1m39v_29";
248
- const radioInner = "_radioInner_1m39v_30";
249
- const focusVisible = "_focusVisible_1m39v_44";
250
- const selected = "_selected_1m39v_63";
251
- const invalid = "_invalid_1m39v_67";
252
- const disabled = "_disabled_1m39v_71";
253
- const hovered = "_hovered_1m39v_83";
254
- const readOnly = "_readOnly_1m39v_83";
245
+ const RadioGroupItem$1 = "_RadioGroupItem_3yg2r_5";
246
+ const label = "_label_3yg2r_11";
247
+ const radioOuter = "_radioOuter_3yg2r_29";
248
+ const radioInner = "_radioInner_3yg2r_30";
249
+ const focusVisible = "_focusVisible_3yg2r_44";
250
+ const selected = "_selected_3yg2r_63";
251
+ const invalid = "_invalid_3yg2r_67";
252
+ const disabled = "_disabled_3yg2r_71";
253
+ const hovered = "_hovered_3yg2r_83";
254
+ const readOnly = "_readOnly_3yg2r_83";
255
255
  const styles$1 = {
256
256
  RadioGroupItem: RadioGroupItem$1,
257
257
  label,
@@ -300,8 +300,8 @@ function RadioGroupItem(props) {
300
300
  content: errorText
301
301
  })));
302
302
  }
303
- const RadioGroup$1 = "_RadioGroup_1g9j9_5";
304
- const list = "_list_1g9j9_14";
303
+ const RadioGroup$1 = "_RadioGroup_13efh_5";
304
+ const list = "_list_13efh_14";
305
305
  const styles = {
306
306
  RadioGroup: RadioGroup$1,
307
307
  list
@@ -0,0 +1,71 @@
1
+ import React from "react";
2
+ import { RangeValue } from "@react-types/shared";
3
+ import { DateValue, MappedDateValue, DateRange } from "@react-types/calendar";
4
+ import { CalendarBaseStateProps } from "../Calendar/CalendarBase";
5
+ export type RangeCalendarProps = CalendarBaseStateProps & {
6
+ /**
7
+ * The current value (controlled).
8
+ */
9
+ value?: DateRange | null;
10
+ /**
11
+ * The default value (uncontrolled).
12
+ */
13
+ defaultValue?: DateRange | null;
14
+ /**
15
+ * Handler that is called when the value changes.
16
+ */
17
+ onChange?: (value: RangeValue<MappedDateValue<DateValue>>) => void;
18
+ };
19
+ /**
20
+ *
21
+ * A `RangeCalendar` displays a grid of days and allows users to select a range of dates.
22
+ *
23
+ * @example
24
+ * _Default Value:_
25
+ * ```tsx
26
+ * <Calendar
27
+ * defaultValue={{
28
+ * start: new CalendarDate(2024, 7, 15),
29
+ * end: new CalendarDate(2024, 7, 25),
30
+ * }}
31
+ * />
32
+ * ```
33
+ *
34
+ * @example
35
+ * _Set limited available dates:_
36
+ * ```tsx
37
+ * <RangeCalendar
38
+ * minValue={new CalendarDate(2024, 7, 24)}
39
+ * maxValue={new CalendarDate(2024, 8, 5)}
40
+ * />
41
+ * ```
42
+ *
43
+ * @example
44
+ * _Date availability:_
45
+ * ```tsx
46
+ * <RangeCalendar
47
+ * isDateUnavailable={(date: DateValue) =>
48
+ * today(getLocalTimeZone()).compare(date) > 0
49
+ * }
50
+ * />
51
+ * ```
52
+ *
53
+ * @example
54
+ * _Controlled:_
55
+ * ```tsx
56
+ * const [date, setDate] = React.useState({
57
+ * start: today(getLocalTimeZone()).subtract({ days: 7 }),
58
+ * end: today(getLocalTimeZone()),
59
+ * });
60
+ *
61
+ * <RangeCalendar
62
+ * value={date}
63
+ * onChange={setDate}
64
+ * />
65
+ * ```
66
+ */
67
+ export declare function RangeCalendar(props: RangeCalendarProps): React.JSX.Element;
68
+ export declare namespace RangeCalendar {
69
+ var displayName: string;
70
+ }
71
+ //# sourceMappingURL=RangeCalendar.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"RangeCalendar.d.ts","sourceRoot":"","sources":["../../src/RangeCalendar/RangeCalendar.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAEjD,OAAO,EAAE,SAAS,EAAE,eAAe,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAC9E,OAAO,EAAgB,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAEhF,MAAM,MAAM,kBAAkB,GAAG,sBAAsB,GAAG;IACxD;;OAEG;IACH,KAAK,CAAC,EAAE,SAAS,GAAG,IAAI,CAAC;IACzB;;OAEG;IACH,YAAY,CAAC,EAAE,SAAS,GAAG,IAAI,CAAC;IAChC;;OAEG;IACH,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,UAAU,CAAC,eAAe,CAAC,SAAS,CAAC,CAAC,KAAK,IAAI,CAAC;CACpE,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+CG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE,kBAAkB,qBAkBtD;yBAlBe,aAAa"}
@@ -0,0 +1,15 @@
1
+ import { Meta, StoryObj } from "@storybook/react";
2
+ import { RangeCalendar } from "./RangeCalendar";
3
+ type Story = StoryObj<typeof RangeCalendar>;
4
+ declare const meta: Meta<typeof RangeCalendar>;
5
+ export default meta;
6
+ export declare const Default: Story;
7
+ export declare const DefaultValue: Story;
8
+ export declare const LimitAvailableDates: Story;
9
+ export declare const DatesAvailability: Story;
10
+ export declare const ShowDaysOutsideCurrentMonth: Story;
11
+ export declare const ControlledSelection: Story;
12
+ export declare const InvalidSelection: Story;
13
+ export declare const DisabledCalendar: Story;
14
+ export declare const ReadonlyCalendar: Story;
15
+ //# sourceMappingURL=RangeCalendar.stories.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"RangeCalendar.stories.d.ts","sourceRoot":"","sources":["../../src/RangeCalendar/RangeCalendar.stories.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAIlD,OAAO,EAAE,aAAa,EAAsB,MAAM,iBAAiB,CAAC;AAEpE,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,aAAa,CAAC,CAAC;AAI5C,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,OAAO,aAAa,CAqBpC,CAAC;AAEF,eAAe,IAAI,CAAC;AAEpB,eAAO,MAAM,OAAO,EAAE,KAErB,CAAC;AAEF,eAAO,MAAM,YAAY,EAAE,KAQ1B,CAAC;AAEF,eAAO,MAAM,mBAAmB,EAAE,KAUjC,CAAC;AAEF,eAAO,MAAM,iBAAiB,EAAE,KAM/B,CAAC;AAEF,eAAO,MAAM,2BAA2B,EAAE,KAKzC,CAAC;AAEF,eAAO,MAAM,mBAAmB,EAAE,KASjC,CAAC;AAEF,eAAO,MAAM,gBAAgB,EAAE,KAkB9B,CAAC;AAEF,eAAO,MAAM,gBAAgB,EAAE,KAK9B,CAAC;AAEF,eAAO,MAAM,gBAAgB,EAAE,KAK9B,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=RangeCalendar.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"RangeCalendar.test.d.ts","sourceRoot":"","sources":["../../src/RangeCalendar/RangeCalendar.test.tsx"],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ export * from "./RangeCalendar";
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/RangeCalendar/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAC"}
@@ -0,0 +1,228 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __defProps = Object.defineProperties;
4
+ var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
5
+ var __getOwnPropSymbols = Object.getOwnPropertySymbols;
6
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ var __propIsEnum = Object.prototype.propertyIsEnumerable;
8
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
9
+ var __spreadValues = (a, b) => {
10
+ for (var prop in b || (b = {}))
11
+ if (__hasOwnProp.call(b, prop))
12
+ __defNormalProp(a, prop, b[prop]);
13
+ if (__getOwnPropSymbols)
14
+ for (var prop of __getOwnPropSymbols(b)) {
15
+ if (__propIsEnum.call(b, prop))
16
+ __defNormalProp(a, prop, b[prop]);
17
+ }
18
+ return a;
19
+ };
20
+ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
21
+ var __objRest = (source, exclude) => {
22
+ var target = {};
23
+ for (var prop in source)
24
+ if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
25
+ target[prop] = source[prop];
26
+ if (source != null && __getOwnPropSymbols)
27
+ for (var prop of __getOwnPropSymbols(source)) {
28
+ if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
29
+ target[prop] = source[prop];
30
+ }
31
+ return target;
32
+ };
33
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
34
+ const React = require("react");
35
+ const CalendarBase = require("../__chunks__/CalendarBase-DaXcE0Vl.js");
36
+ const context = require("../__chunks__/context-D3NeXov7.js");
37
+ const useControlledState = require("../__chunks__/useControlledState-mnKBd6Uc.js");
38
+ const useEvent = require("../__chunks__/useEvent-DY7dR7Mi.js");
39
+ function $9a36b6ba2fb1a7c5$export$9a987164d97ecc90(props) {
40
+ let _a = props, { value: valueProp, defaultValue, onChange, createCalendar, locale, visibleDuration = {
41
+ months: 1
42
+ }, minValue, maxValue } = _a, calendarProps = __objRest(_a, ["value", "defaultValue", "onChange", "createCalendar", "locale", "visibleDuration", "minValue", "maxValue"]);
43
+ let [value, setValue] = useControlledState.$458b0a5536c1a7cf$export$40bfa8c7b0832715(valueProp, defaultValue || null, onChange);
44
+ let [anchorDate, setAnchorDateState] = React.useState(null);
45
+ let alignment = "center";
46
+ if (value && value.start && value.end) {
47
+ let start = CalendarBase.$f62d864046160412$export$f4a51ff076cc9a09(CalendarBase.$11d87f3f76e88657$export$93522d1a439f3617(value.start), visibleDuration, locale, minValue, maxValue);
48
+ let end = start.add(visibleDuration).subtract({
49
+ days: 1
50
+ });
51
+ if (value.end.compare(end) > 0) alignment = "start";
52
+ }
53
+ let availableRangeRef = React.useRef(null);
54
+ let [availableRange, setAvailableRange] = React.useState(null);
55
+ let min = React.useMemo(() => CalendarBase.$14e0f24ef4ac5c92$export$a75f2bff57811055(minValue, availableRange === null || availableRange === void 0 ? void 0 : availableRange.start), [
56
+ minValue,
57
+ availableRange
58
+ ]);
59
+ let max = React.useMemo(() => CalendarBase.$14e0f24ef4ac5c92$export$5c333a116e949cdd(maxValue, availableRange === null || availableRange === void 0 ? void 0 : availableRange.end), [
60
+ maxValue,
61
+ availableRange
62
+ ]);
63
+ let calendar = CalendarBase.$131cf43a05231e1e$export$6d095e787d2b5e1f(__spreadProps(__spreadValues({}, calendarProps), {
64
+ value: value && value.start,
65
+ createCalendar,
66
+ locale,
67
+ visibleDuration,
68
+ minValue: min,
69
+ maxValue: max,
70
+ selectionAlignment: alignment
71
+ }));
72
+ let updateAvailableRange = (date) => {
73
+ if (date && props.isDateUnavailable && !props.allowsNonContiguousRanges) {
74
+ const nextAvailableStartDate = $9a36b6ba2fb1a7c5$var$nextUnavailableDate(date, calendar, -1);
75
+ const nextAvailableEndDate = $9a36b6ba2fb1a7c5$var$nextUnavailableDate(date, calendar, 1);
76
+ availableRangeRef.current = {
77
+ start: nextAvailableStartDate,
78
+ end: nextAvailableEndDate
79
+ };
80
+ setAvailableRange(availableRangeRef.current);
81
+ } else {
82
+ availableRangeRef.current = null;
83
+ setAvailableRange(null);
84
+ }
85
+ };
86
+ let [lastVisibleRange, setLastVisibleRange] = React.useState(calendar.visibleRange);
87
+ if (!CalendarBase.$14e0f24ef4ac5c92$export$91b62ebf2ba703ee(calendar.visibleRange.start, lastVisibleRange.start) || !CalendarBase.$14e0f24ef4ac5c92$export$91b62ebf2ba703ee(calendar.visibleRange.end, lastVisibleRange.end)) {
88
+ updateAvailableRange(anchorDate);
89
+ setLastVisibleRange(calendar.visibleRange);
90
+ }
91
+ let setAnchorDate = (date) => {
92
+ if (date) {
93
+ setAnchorDateState(date);
94
+ updateAvailableRange(date);
95
+ } else {
96
+ setAnchorDateState(null);
97
+ updateAvailableRange(null);
98
+ }
99
+ };
100
+ let highlightedRange = anchorDate ? $9a36b6ba2fb1a7c5$var$makeRange(anchorDate, calendar.focusedDate) : value && $9a36b6ba2fb1a7c5$var$makeRange(value.start, value.end);
101
+ let selectDate = (date) => {
102
+ if (props.isReadOnly) return;
103
+ const constrainedDate = CalendarBase.$f62d864046160412$export$4f5203c0d889109e(date, min, max);
104
+ const previousAvailableConstrainedDate = CalendarBase.$f62d864046160412$export$a1d3911297b952d7(constrainedDate, calendar.visibleRange.start, props.isDateUnavailable);
105
+ if (!previousAvailableConstrainedDate) return;
106
+ if (!anchorDate) setAnchorDate(previousAvailableConstrainedDate);
107
+ else {
108
+ let range = $9a36b6ba2fb1a7c5$var$makeRange(anchorDate, previousAvailableConstrainedDate);
109
+ if (range) setValue({
110
+ start: $9a36b6ba2fb1a7c5$var$convertValue(range.start, value === null || value === void 0 ? void 0 : value.start),
111
+ end: $9a36b6ba2fb1a7c5$var$convertValue(range.end, value === null || value === void 0 ? void 0 : value.end)
112
+ });
113
+ setAnchorDate(null);
114
+ }
115
+ };
116
+ let [isDragging, setDragging] = React.useState(false);
117
+ let { isDateUnavailable } = props;
118
+ let isInvalidSelection = React.useMemo(() => {
119
+ if (!value || anchorDate) return false;
120
+ if (isDateUnavailable && (isDateUnavailable(value.start) || isDateUnavailable(value.end))) return true;
121
+ return CalendarBase.$f62d864046160412$export$eac50920cf2fd59a(value.start, minValue, maxValue) || CalendarBase.$f62d864046160412$export$eac50920cf2fd59a(value.end, minValue, maxValue);
122
+ }, [
123
+ isDateUnavailable,
124
+ value,
125
+ anchorDate,
126
+ minValue,
127
+ maxValue
128
+ ]);
129
+ let isValueInvalid = props.isInvalid || props.validationState === "invalid" || isInvalidSelection;
130
+ let validationState = isValueInvalid ? "invalid" : null;
131
+ return __spreadProps(__spreadValues({}, calendar), {
132
+ value,
133
+ setValue,
134
+ anchorDate,
135
+ setAnchorDate,
136
+ highlightedRange,
137
+ validationState,
138
+ isValueInvalid,
139
+ selectFocusedDate() {
140
+ selectDate(calendar.focusedDate);
141
+ },
142
+ selectDate,
143
+ highlightDate(date) {
144
+ if (anchorDate) calendar.setFocusedDate(date);
145
+ },
146
+ isSelected(date) {
147
+ return Boolean(highlightedRange && date.compare(highlightedRange.start) >= 0 && date.compare(highlightedRange.end) <= 0 && !calendar.isCellDisabled(date) && !calendar.isCellUnavailable(date));
148
+ },
149
+ isInvalid(date) {
150
+ var _availableRangeRef_current, _availableRangeRef_current1;
151
+ return calendar.isInvalid(date) || CalendarBase.$f62d864046160412$export$eac50920cf2fd59a(date, (_availableRangeRef_current = availableRangeRef.current) === null || _availableRangeRef_current === void 0 ? void 0 : _availableRangeRef_current.start, (_availableRangeRef_current1 = availableRangeRef.current) === null || _availableRangeRef_current1 === void 0 ? void 0 : _availableRangeRef_current1.end);
152
+ },
153
+ isDragging,
154
+ setDragging
155
+ });
156
+ }
157
+ function $9a36b6ba2fb1a7c5$var$makeRange(start, end) {
158
+ if (!start || !end) return null;
159
+ if (end.compare(start) < 0) [start, end] = [
160
+ end,
161
+ start
162
+ ];
163
+ return {
164
+ start: CalendarBase.$11d87f3f76e88657$export$93522d1a439f3617(start),
165
+ end: CalendarBase.$11d87f3f76e88657$export$93522d1a439f3617(end)
166
+ };
167
+ }
168
+ function $9a36b6ba2fb1a7c5$var$convertValue(newValue, oldValue) {
169
+ newValue = CalendarBase.$11d87f3f76e88657$export$b4a036af3fc0b032(newValue, (oldValue === null || oldValue === void 0 ? void 0 : oldValue.calendar) || new CalendarBase.$3b62074eb05584b2$export$80ee6245ec4f29ec());
170
+ if (oldValue && "hour" in oldValue) return oldValue.set(newValue);
171
+ return newValue;
172
+ }
173
+ function $9a36b6ba2fb1a7c5$var$nextUnavailableDate(anchorDate, state, dir) {
174
+ let nextDate = anchorDate.add({
175
+ days: dir
176
+ });
177
+ while ((dir < 0 ? nextDate.compare(state.visibleRange.start) >= 0 : nextDate.compare(state.visibleRange.end) <= 0) && !state.isCellUnavailable(nextDate)) nextDate = nextDate.add({
178
+ days: dir
179
+ });
180
+ if (state.isCellUnavailable(nextDate)) return nextDate.add({
181
+ days: -dir
182
+ });
183
+ }
184
+ function $46a4342aab3d8076$export$87e0539f600c24e5(props, state, ref) {
185
+ let res = CalendarBase.$c4acc1de3ab169cf$export$d652b3ea2d672d5b(props, state);
186
+ let isVirtualClick = React.useRef(false);
187
+ let windowRef = React.useRef(typeof window !== "undefined" ? window : null);
188
+ useEvent.$e9faafb641e167db$export$90fc3a17d93f704c(windowRef, "pointerdown", (e) => {
189
+ isVirtualClick.current = e.width === 0 && e.height === 0;
190
+ });
191
+ let endDragging = (e) => {
192
+ if (isVirtualClick.current) {
193
+ isVirtualClick.current = false;
194
+ return;
195
+ }
196
+ state.setDragging(false);
197
+ if (!state.anchorDate) return;
198
+ let target = e.target;
199
+ if (ref.current && ref.current.contains(document.activeElement) && (!ref.current.contains(target) || !target.closest('button, [role="button"]'))) state.selectFocusedDate();
200
+ };
201
+ useEvent.$e9faafb641e167db$export$90fc3a17d93f704c(windowRef, "pointerup", endDragging);
202
+ res.calendarProps.onBlur = (e) => {
203
+ if (!ref.current) return;
204
+ if ((!e.relatedTarget || !ref.current.contains(e.relatedTarget)) && state.anchorDate) state.selectFocusedDate();
205
+ };
206
+ useEvent.$e9faafb641e167db$export$90fc3a17d93f704c(ref, "touchmove", (e) => {
207
+ if (state.isDragging) e.preventDefault();
208
+ }, {
209
+ passive: false,
210
+ capture: true
211
+ });
212
+ return res;
213
+ }
214
+ function RangeCalendar(props) {
215
+ const { locale } = context.$18f2051aff69b9bf$export$43bb16f9c6d9e3f7();
216
+ const calendarRef = React.useRef(null);
217
+ const state = $9a36b6ba2fb1a7c5$export$9a987164d97ecc90(__spreadProps(__spreadValues({}, props), {
218
+ locale,
219
+ createCalendar: CalendarBase.$64244302c3013299$export$dd0bbc9b26defe37
220
+ }));
221
+ const rangeCalendarProps = $46a4342aab3d8076$export$87e0539f600c24e5(props, state, calendarRef);
222
+ return React.createElement(CalendarBase.CalendarBase, __spreadProps(__spreadValues(__spreadValues({}, props), rangeCalendarProps), {
223
+ state,
224
+ calendarRef
225
+ }));
226
+ }
227
+ RangeCalendar.displayName = "RangeCalendar";
228
+ exports.RangeCalendar = RangeCalendar;