@easypost/easy-ui 1.0.0-alpha.60 → 1.0.0-alpha.61

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 (243) 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 +6 -0
  8. package/Calendar/CalendarCell.d.ts.map +1 -1
  9. package/Calendar/index.js +2 -40
  10. package/Calendar/index.mjs +2 -40
  11. package/Card/index.js +1 -1
  12. package/Card/index.mjs +1 -1
  13. package/Checkbox/index.js +1 -1
  14. package/Checkbox/index.mjs +1 -1
  15. package/CodeBlock/index.js +13 -13
  16. package/CodeBlock/index.mjs +15 -15
  17. package/CodeSnippet/index.js +1 -1
  18. package/CodeSnippet/index.mjs +1 -1
  19. package/DataGrid/index.js +63 -62
  20. package/DataGrid/index.mjs +72 -71
  21. package/DatePicker/DateField.d.ts +14 -0
  22. package/DatePicker/DateField.d.ts.map +1 -0
  23. package/DatePicker/DatePicker.d.ts +91 -0
  24. package/DatePicker/DatePicker.d.ts.map +1 -0
  25. package/DatePicker/DatePicker.stories.d.ts +14 -0
  26. package/DatePicker/DatePicker.stories.d.ts.map +1 -0
  27. package/DatePicker/DatePicker.test.d.ts +2 -0
  28. package/DatePicker/DatePicker.test.d.ts.map +1 -0
  29. package/DatePicker/DatePickerBase.d.ts +32 -0
  30. package/DatePicker/DatePickerBase.d.ts.map +1 -0
  31. package/DatePicker/DatePickerOverlay.d.ts +12 -0
  32. package/DatePicker/DatePickerOverlay.d.ts.map +1 -0
  33. package/DatePicker/DatePickerTrigger.d.ts +20 -0
  34. package/DatePicker/DatePickerTrigger.d.ts.map +1 -0
  35. package/DatePicker/index.d.ts +2 -0
  36. package/DatePicker/index.d.ts.map +1 -0
  37. package/DatePicker/index.js +275 -0
  38. package/DatePicker/index.mjs +275 -0
  39. package/DateRangePicker/DateRangePicker.d.ts +89 -0
  40. package/DateRangePicker/DateRangePicker.d.ts.map +1 -0
  41. package/DateRangePicker/DateRangePicker.stories.d.ts +14 -0
  42. package/DateRangePicker/DateRangePicker.stories.d.ts.map +1 -0
  43. package/DateRangePicker/DateRangePicker.test.d.ts +2 -0
  44. package/DateRangePicker/DateRangePicker.test.d.ts.map +1 -0
  45. package/DateRangePicker/index.d.ts +2 -0
  46. package/DateRangePicker/index.d.ts.map +1 -0
  47. package/DateRangePicker/index.js +434 -0
  48. package/DateRangePicker/index.mjs +434 -0
  49. package/Drawer/index.js +22 -22
  50. package/Drawer/index.mjs +21 -21
  51. package/DropdownButton/index.js +12 -12
  52. package/DropdownButton/index.mjs +13 -13
  53. package/EmptyStateCard/index.js +8 -8
  54. package/EmptyStateCard/index.mjs +8 -8
  55. package/FocusedProductLayout/index.js +23 -23
  56. package/FocusedProductLayout/index.mjs +23 -23
  57. package/ForgeLayout/index.js +27 -27
  58. package/ForgeLayout/index.mjs +30 -30
  59. package/FormLayout/index.js +5 -5
  60. package/FormLayout/index.mjs +5 -5
  61. package/HorizontalGrid/index.js +1 -1
  62. package/HorizontalGrid/index.mjs +1 -1
  63. package/HorizontalStack/index.js +1 -1
  64. package/HorizontalStack/index.mjs +1 -1
  65. package/Icon/index.js +1 -1
  66. package/Icon/index.mjs +1 -1
  67. package/IconButton/index.js +12 -12
  68. package/IconButton/index.mjs +13 -13
  69. package/InputField/index.js +1 -1
  70. package/InputField/index.mjs +1 -1
  71. package/KebabButton/index.js +1 -1
  72. package/KebabButton/index.mjs +1 -1
  73. package/Menu/index.js +1 -1
  74. package/Menu/index.mjs +1 -1
  75. package/Modal/index.js +23 -23
  76. package/Modal/index.mjs +22 -22
  77. package/NexusLayout/index.js +28 -28
  78. package/NexusLayout/index.mjs +31 -31
  79. package/Notification/index.js +1 -1
  80. package/Notification/index.mjs +1 -1
  81. package/Pagination/index.js +7 -7
  82. package/Pagination/index.mjs +8 -8
  83. package/PillGroup/index.js +9 -9
  84. package/PillGroup/index.mjs +19 -19
  85. package/ProductLayout/index.js +24 -24
  86. package/ProductLayout/index.mjs +25 -25
  87. package/Provider/index.js +1 -1
  88. package/Provider/index.mjs +2 -2
  89. package/RadioButtonGroup/index.js +2 -2
  90. package/RadioButtonGroup/index.mjs +5 -5
  91. package/RadioGroup/index.js +16 -16
  92. package/RadioGroup/index.mjs +21 -21
  93. package/RangeCalendar/RangeCalendar.test.d.ts +2 -1
  94. package/RangeCalendar/RangeCalendar.test.d.ts.map +1 -1
  95. package/RangeCalendar/index.js +2 -226
  96. package/RangeCalendar/index.mjs +2 -226
  97. package/SearchNav/index.js +29 -29
  98. package/SearchNav/index.mjs +30 -30
  99. package/SectionCard/index.js +7 -7
  100. package/SectionCard/index.mjs +7 -7
  101. package/Select/index.js +7 -6
  102. package/Select/index.mjs +6 -5
  103. package/SelectorErrorTooltip/index.js +1 -1
  104. package/SelectorErrorTooltip/index.mjs +1 -1
  105. package/Spinner/index.js +1 -1
  106. package/Spinner/index.mjs +1 -1
  107. package/SplitToggleCard/index.js +4 -4
  108. package/SplitToggleCard/index.mjs +4 -4
  109. package/Stepper/index.js +1 -1
  110. package/Stepper/index.mjs +1 -1
  111. package/TabNav/index.js +1 -1
  112. package/TabNav/index.mjs +1 -1
  113. package/TabPanels/index.js +1 -1
  114. package/TabPanels/index.mjs +7 -7
  115. package/Tabs/index.js +1 -1
  116. package/Tabs/index.mjs +1 -1
  117. package/Text/index.js +1 -1
  118. package/Text/index.mjs +1 -1
  119. package/TextField/index.js +1 -1
  120. package/TextField/index.mjs +1 -1
  121. package/Textarea/index.js +1 -1
  122. package/Textarea/index.mjs +1 -1
  123. package/Toggle/index.js +1 -1
  124. package/Toggle/index.mjs +1 -1
  125. package/ToggleCard/index.js +2 -2
  126. package/ToggleCard/index.mjs +2 -2
  127. package/Tooltip/index.js +1 -1
  128. package/Tooltip/index.mjs +1 -1
  129. package/UnstyledButton/index.mjs +1 -1
  130. package/VerticalNav/index.js +24 -24
  131. package/VerticalNav/index.mjs +27 -27
  132. package/VerticalStack/index.js +1 -1
  133. package/VerticalStack/index.mjs +1 -1
  134. package/__chunks__/{Button-DuqSI9GS.js → Button-BzB8v2mS.js} +17 -17
  135. package/__chunks__/{Button-D0YAQvKG.mjs → Button-DcYNVtp7.mjs} +3 -3
  136. package/__chunks__/{Button-bGGT-c6v.mjs → Button-gxCTl22H.mjs} +18 -18
  137. package/__chunks__/{Button-D8vjHIx8.js → Button-jgkOum0d.js} +1 -1
  138. package/__chunks__/Calendar-BS8zgZK8.js +41 -0
  139. package/__chunks__/Calendar-C9hD67Rz.mjs +42 -0
  140. package/__chunks__/{CalendarBase-DbXh9rhk.mjs → CalendarBase-4iGD1mPK.mjs} +99 -27
  141. package/__chunks__/{CalendarBase-CiBPzvL4.js → CalendarBase-saNix6u1.js} +94 -22
  142. package/__chunks__/{Card-DdHvpDEw.mjs → Card-Cr-bIjoN.mjs} +12 -12
  143. package/__chunks__/{Card-93kQP9IL.js → Card-DaFTIHZD.js} +12 -12
  144. package/__chunks__/{Checkbox-BRrfKcFE.mjs → Checkbox-BR4RBHLp.mjs} +23 -23
  145. package/__chunks__/{Checkbox-MbPCVxqs.js → Checkbox-BY4UkCg7.js} +20 -20
  146. package/__chunks__/{CodeSnippet-xb-psm_O.mjs → CodeSnippet-ChZIz_CO.mjs} +2 -2
  147. package/__chunks__/{CodeSnippet-D9ZZXVs3.js → CodeSnippet-H-6ta_Y8.js} +2 -2
  148. package/__chunks__/DatePickerBase-DlbnqBLN.mjs +3152 -0
  149. package/__chunks__/DatePickerBase-vorBKIfJ.js +3166 -0
  150. package/__chunks__/{FocusScope-CEeqhVmO.mjs → FocusScope-CjcZn1Rq.mjs} +4 -4
  151. package/__chunks__/{HelpMenu-E6z6tRl8.js → HelpMenu-BzUSoyPi.js} +6 -6
  152. package/__chunks__/{HelpMenu-CCHBb1Kr.mjs → HelpMenu-yEjZgR1V.mjs} +7 -7
  153. package/__chunks__/{HorizontalGrid-B7ijxURd.js → HorizontalGrid-Bhj16LbM.js} +1 -1
  154. package/__chunks__/{HorizontalGrid-vw7R2Tld.mjs → HorizontalGrid-D4bJqbQV.mjs} +1 -1
  155. package/__chunks__/{HorizontalStack-Dx9zYaH0.mjs → HorizontalStack-BDZp8p9E.mjs} +1 -1
  156. package/__chunks__/{HorizontalStack-1g4N72TF.js → HorizontalStack-_DnrRlDb.js} +1 -1
  157. package/__chunks__/{Icon-QGDwoR1f.mjs → Icon-BdtOD2WX.mjs} +2 -2
  158. package/__chunks__/{Icon-oPEVg2C8.js → Icon-DJ8CpeVT.js} +2 -2
  159. package/__chunks__/InputCaption-BBbxPdvJ.mjs +61 -0
  160. package/__chunks__/InputCaption-CEIuQ6BY.js +60 -0
  161. package/__chunks__/{InputField-BGBRvVMR.js → InputField-BUU9HZ1I.js} +7 -6
  162. package/__chunks__/{InputField-BI73lSp6.mjs → InputField-CPxOg_cd.mjs} +8 -7
  163. package/__chunks__/InputIcon-MHt_XLtO.mjs +112 -0
  164. package/__chunks__/InputIcon-nUumrcJ5.js +111 -0
  165. package/__chunks__/{KebabButton-DBLcfQI6.mjs → KebabButton-BapJTvS6.mjs} +5 -5
  166. package/__chunks__/{KebabButton-C15-V-k2.js → KebabButton-C3KI5LDA.js} +4 -4
  167. package/__chunks__/{LiveAnnouncer-Bi_Y3tfX.mjs → LiveAnnouncer-BSV5-C0m.mjs} +5 -1
  168. package/__chunks__/{LiveAnnouncer-Dwkwacle.js → LiveAnnouncer-CzeNwq2D.js} +4 -0
  169. package/__chunks__/{Menu-Cuqxc1iw.js → Menu-CkQaJJAH.js} +31 -30
  170. package/__chunks__/{Menu-BELtbX2b.mjs → Menu-LzJveIa-.mjs} +21 -20
  171. package/__chunks__/{Notification-D90-75ZN.js → Notification-C5_bwXj4.js} +15 -15
  172. package/__chunks__/{Notification-lqESwByD.mjs → Notification-CAmvbAK1.mjs} +18 -18
  173. package/__chunks__/{Spinner-D3LMSY80.js → NumberFormatter-CXW1Iqpu.js} +1 -79
  174. package/__chunks__/{Spinner-tHEG0z1g.mjs → NumberFormatter-p5KNJNTT.mjs} +1 -79
  175. package/__chunks__/{Overlay-CuhLUuXt.mjs → Overlay-d3z5W5Nn.mjs} +6 -6
  176. package/__chunks__/RangeCalendar-5enltd2P.js +227 -0
  177. package/__chunks__/RangeCalendar-Bhk32GB_.mjs +228 -0
  178. package/__chunks__/{SelectOverlay-pFcbx7UM.js → SelectOverlay-DKJvzJJ7.js} +35 -33
  179. package/__chunks__/{SelectOverlay-CadnQpV0.mjs → SelectOverlay-MLWWpDpl.mjs} +32 -30
  180. package/__chunks__/{SelectionManager-IO4G_cI2.mjs → SelectionManager-DCO_d3m1.mjs} +2 -2
  181. package/__chunks__/{SelectorErrorTooltip-CFlgzXu5.mjs → SelectorErrorTooltip-DLyZgeUf.mjs} +4 -4
  182. package/__chunks__/{SelectorErrorTooltip-Cfzpo7X3.js → SelectorErrorTooltip-DowQ2whn.js} +4 -4
  183. package/__chunks__/Spinner-BFydR08g.js +100 -0
  184. package/__chunks__/Spinner-hJoFNoHJ.mjs +101 -0
  185. package/__chunks__/{Stepper-B0w3sKYh.mjs → Stepper-BY8zQdW2.mjs} +27 -27
  186. package/__chunks__/{Stepper-Bbihngk4.js → Stepper-CxWpMLEW.js} +25 -25
  187. package/__chunks__/{TabNav-BHETvib0.js → TabNav-1cTg6TWo.js} +1 -1
  188. package/__chunks__/{TabNav-2W0d3JQ0.mjs → TabNav-burpvHrg.mjs} +1 -1
  189. package/__chunks__/{Tabs-C-D794Gi.mjs → Tabs-BzZ9w82m.mjs} +18 -18
  190. package/__chunks__/{Tabs-9dihRp0n.js → Tabs-DHXJckwb.js} +17 -17
  191. package/__chunks__/{Text-D8wg72pq.mjs → Text-CQ_8wg0t.mjs} +34 -34
  192. package/__chunks__/{Text-CEI17LPu.js → Text-Dfbyoxsz.js} +34 -34
  193. package/__chunks__/{Toggle-DlIBs_Za.mjs → Toggle-BiaALtul.mjs} +13 -13
  194. package/__chunks__/{Toggle-4oQhSggV.js → Toggle-CYKsPbEK.js} +11 -11
  195. package/__chunks__/{Tooltip-Cxv7qnVD.mjs → Tooltip-5ZgKkdk8.mjs} +12 -12
  196. package/__chunks__/{Tooltip-7wXzqEZl.js → Tooltip-Bzqm5boz.js} +8 -8
  197. package/__chunks__/{UnstyledButton-B7BScs8i.mjs → UnstyledButton-BlB066YT.mjs} +1 -1
  198. package/__chunks__/{VerticalStack-BTB8fX9P.js → VerticalStack-_gyNJbOa.js} +3 -3
  199. package/__chunks__/{VerticalStack-HnwP17N3.mjs → VerticalStack-eKUWFHU3.mjs} +3 -3
  200. package/__chunks__/{VisuallyHidden-BttNIgVC.mjs → VisuallyHidden-DmDK0fH3.mjs} +1 -1
  201. package/__chunks__/{ariaHideOutside-DcIkumuG.mjs → ariaHideOutside-B-UoCW1g.mjs} +5 -29
  202. package/__chunks__/{ariaHideOutside-DNGR3Fo6.js → ariaHideOutside-a1MUBVQF.js} +0 -24
  203. package/__chunks__/{focusSafely-Dw7K4rnX.mjs → focusSafely-DcMa3q3g.mjs} +2 -2
  204. package/__chunks__/{isVirtualEvent-BFRy7P_p.mjs → isVirtualEvent-BPCuFO54.mjs} +2 -2
  205. package/__chunks__/{useButton-B1CurEpI.mjs → useButton-BoMy_zYC.mjs} +2 -2
  206. package/__chunks__/useCollator-DGrSWVh4.js +12 -0
  207. package/__chunks__/useCollator-DXoNI6C-.mjs +13 -0
  208. package/__chunks__/{useDialog-Dsqz1M_N.js → useDialog-DILXRLSs.js} +1 -1
  209. package/__chunks__/{useDialog-DAYxqkKY.mjs → useDialog-o0QWfg2a.mjs} +3 -3
  210. package/__chunks__/{useEdgeInterceptors-BCHFmpf_.js → useEdgeInterceptors-DfiAHAYW.js} +5 -5
  211. package/__chunks__/{useEdgeInterceptors-CVxwDmQ0.mjs → useEdgeInterceptors-wWqxCUZX.mjs} +5 -5
  212. package/__chunks__/{useFocus-DDj4i8Xy.mjs → useFocus-BEhCbr7O.mjs} +2 -2
  213. package/__chunks__/{useFocusRing-BE_dgxH5.mjs → useFocusRing-BUwbt1Yv.mjs} +3 -3
  214. package/__chunks__/{useFocusVisible-CXSIZSY_.mjs → useFocusVisible-8tH_I2iV.mjs} +1 -1
  215. package/__chunks__/{useFocusWithin-CDX8m0Wu.mjs → useFocusWithin-CfhMwfXS.mjs} +1 -1
  216. package/__chunks__/{useFocusable-DD5dAIXt.mjs → useFocusable-DoNt-Wd3.mjs} +2 -2
  217. package/__chunks__/{useFormValidation-gwcVryr8.mjs → useFormValidation-D5Y_7NR2.mjs} +25 -3
  218. package/__chunks__/{useFormValidation-C2DoIczP.js → useFormValidation-DYz5WFze.js} +22 -0
  219. package/__chunks__/{useHasTabbableChild-CRCY1COZ.mjs → useHasTabbableChild-DUcbkV37.mjs} +1 -1
  220. package/__chunks__/{useHighlightSelectionDescription-CsB-ufoX.js → useHighlightSelectionDescription-CT5XKTz0.js} +2 -2
  221. package/__chunks__/{useHighlightSelectionDescription-DnW5KkSs.mjs → useHighlightSelectionDescription-DWm7Wr6h.mjs} +3 -3
  222. package/__chunks__/{useLink-B__d3N9L.mjs → useLink-B_g4ae9e.mjs} +2 -2
  223. package/__chunks__/{useListState-CH1PXfc5.mjs → useListState-AFrlkW73.mjs} +1 -1
  224. package/__chunks__/{useLocalizedStringFormatter-B5ons_mh.mjs → useLocalizedStringFormatter-CLrYoOi9.mjs} +4 -1
  225. package/__chunks__/{useLocalizedStringFormatter-D74_5d4h.js → useLocalizedStringFormatter-CaF1VsOH.js} +3 -0
  226. package/__chunks__/{useOverlayPosition-B31NgShQ.mjs → useOverlayPosition-B_X4JGFp.mjs} +2 -2
  227. package/__chunks__/useOverlayTrigger-Do68TGFi.mjs +28 -0
  228. package/__chunks__/useOverlayTrigger-MyMg5wFE.js +27 -0
  229. package/__chunks__/{usePress-lFMUra6S.mjs → usePress-BAsZaqDB.mjs} +1 -1
  230. package/__chunks__/{useSelectableItem-BdD2_J2D.mjs → useSelectableItem-DL-4kc1g.mjs} +5 -5
  231. package/__chunks__/{useSelectableList-D0uxeze4.mjs → useSelectableList-BQ06AmlV.mjs} +4 -14
  232. package/__chunks__/{useSelectableList-DlkRkps4.js → useSelectableList-F8fB4Dtg.js} +2 -12
  233. package/__chunks__/{useSingleSelectListState-BuqfjUxj.mjs → useSingleSelectListState-DuCUY6dR.mjs} +1 -1
  234. package/__chunks__/{useToggle-b0GY9dCM.mjs → useToggle-CU6aSiOx.mjs} +2 -2
  235. package/__chunks__/{useTreeState-BZxhJy4m.mjs → useTreeState-w_raYfy2.mjs} +1 -1
  236. package/__chunks__/{useTriggerWidth-DEToHKD3.mjs → useTriggerWidth-DA668KiC.mjs} +6 -335
  237. package/__chunks__/{useTriggerWidth-C7OT3WI9.js → useTriggerWidth-ROE4ZhGv.js} +3 -332
  238. package/__chunks__/utilities-DKvHenAr.js +353 -0
  239. package/__chunks__/utilities-DmLL16up.mjs +354 -0
  240. package/package.json +1 -1
  241. package/style.css +1249 -1104
  242. package/__chunks__/InputIcon-BGgFAA4L.mjs +0 -168
  243. package/__chunks__/InputIcon-CUOJRoq8.js +0 -167
@@ -0,0 +1,434 @@
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
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
22
+ const React = require("react");
23
+ const RangeCalendar = require("../__chunks__/RangeCalendar-5enltd2P.js");
24
+ const DatePickerBase = require("../__chunks__/DatePickerBase-vorBKIfJ.js");
25
+ const CalendarBase = require("../__chunks__/CalendarBase-saNix6u1.js");
26
+ const useFormValidation = require("../__chunks__/useFormValidation-DYz5WFze.js");
27
+ const Overlay = require("../__chunks__/Overlay-ZinDp2HW.js");
28
+ const useControlledState = require("../__chunks__/useControlledState-mnKBd6Uc.js");
29
+ const FocusScope = require("../__chunks__/FocusScope-Co1hHX8R.js");
30
+ const mergeProps = require("../__chunks__/mergeProps-DniMwM6P.js");
31
+ const filterDOMProps = require("../__chunks__/filterDOMProps-D3iOHP0H.js");
32
+ const scrollIntoView = require("../__chunks__/scrollIntoView-DkcUbB3D.js");
33
+ const useField = require("../__chunks__/useField-BJW_bXVD.js");
34
+ const useFocusWithin = require("../__chunks__/useFocusWithin-C1ioGWec.js");
35
+ const context = require("../__chunks__/context-D3NeXov7.js");
36
+ const useLocalizedStringFormatter = require("../__chunks__/useLocalizedStringFormatter-CaF1VsOH.js");
37
+ function $93c38a5e28be6249$export$e50a61c1de9f574(props) {
38
+ var _value_start, _value_end;
39
+ let overlayState = Overlay.$fc909762b330b746$export$61c6a8c84e605fb6(props);
40
+ let [controlledValue, setControlledValue] = useControlledState.$458b0a5536c1a7cf$export$40bfa8c7b0832715(props.value, props.defaultValue || null, props.onChange);
41
+ let [placeholderValue, setPlaceholderValue] = React.useState(() => controlledValue || {
42
+ start: null,
43
+ end: null
44
+ });
45
+ if (controlledValue == null && placeholderValue.start && placeholderValue.end) {
46
+ placeholderValue = {
47
+ start: null,
48
+ end: null
49
+ };
50
+ setPlaceholderValue(placeholderValue);
51
+ }
52
+ let value = controlledValue || placeholderValue;
53
+ let setValue = (value2) => {
54
+ setPlaceholderValue(value2 || {
55
+ start: null,
56
+ end: null
57
+ });
58
+ if ($93c38a5e28be6249$var$isCompleteRange(value2)) setControlledValue(value2);
59
+ else setControlledValue(null);
60
+ };
61
+ let v = (value === null || value === void 0 ? void 0 : value.start) || (value === null || value === void 0 ? void 0 : value.end) || props.placeholderValue || null;
62
+ let [granularity, defaultTimeZone] = DatePickerBase.$35a22f14a1f04b11$export$2440da353cedad43(v, props.granularity);
63
+ let hasTime = granularity === "hour" || granularity === "minute" || granularity === "second";
64
+ var _props_shouldCloseOnSelect;
65
+ let shouldCloseOnSelect = (_props_shouldCloseOnSelect = props.shouldCloseOnSelect) !== null && _props_shouldCloseOnSelect !== void 0 ? _props_shouldCloseOnSelect : true;
66
+ let [dateRange, setSelectedDateRange] = React.useState(null);
67
+ let [timeRange, setSelectedTimeRange] = React.useState(null);
68
+ if (value && $93c38a5e28be6249$var$isCompleteRange(value)) {
69
+ dateRange = value;
70
+ if ("hour" in value.start) timeRange = value;
71
+ }
72
+ let commitValue = (dateRange2, timeRange2) => {
73
+ setValue({
74
+ start: "timeZone" in timeRange2.start ? timeRange2.start.set(CalendarBase.$11d87f3f76e88657$export$93522d1a439f3617(dateRange2.start)) : CalendarBase.$11d87f3f76e88657$export$b21e0b124e224484(dateRange2.start, timeRange2.start),
75
+ end: "timeZone" in timeRange2.end ? timeRange2.end.set(CalendarBase.$11d87f3f76e88657$export$93522d1a439f3617(dateRange2.end)) : CalendarBase.$11d87f3f76e88657$export$b21e0b124e224484(dateRange2.end, timeRange2.end)
76
+ });
77
+ setSelectedDateRange(null);
78
+ setSelectedTimeRange(null);
79
+ validation.commitValidation();
80
+ };
81
+ let setDateRange = (range) => {
82
+ let shouldClose = typeof shouldCloseOnSelect === "function" ? shouldCloseOnSelect() : shouldCloseOnSelect;
83
+ if (hasTime) {
84
+ if ($93c38a5e28be6249$var$isCompleteRange(range) && (timeRange === null || timeRange === void 0 ? void 0 : timeRange.start) && (timeRange === null || timeRange === void 0 ? void 0 : timeRange.end)) commitValue(range, {
85
+ start: (timeRange === null || timeRange === void 0 ? void 0 : timeRange.start) || DatePickerBase.$35a22f14a1f04b11$export$c5221a78ef73c5e9(props.placeholderValue),
86
+ end: (timeRange === null || timeRange === void 0 ? void 0 : timeRange.end) || DatePickerBase.$35a22f14a1f04b11$export$c5221a78ef73c5e9(props.placeholderValue)
87
+ });
88
+ else setSelectedDateRange(range);
89
+ } else if ($93c38a5e28be6249$var$isCompleteRange(range)) {
90
+ setValue(range);
91
+ validation.commitValidation();
92
+ } else setSelectedDateRange(range);
93
+ if (shouldClose) overlayState.setOpen(false);
94
+ };
95
+ let setTimeRange = (range) => {
96
+ if ($93c38a5e28be6249$var$isCompleteRange(dateRange) && $93c38a5e28be6249$var$isCompleteRange(range)) commitValue(dateRange, range);
97
+ else setSelectedTimeRange(range);
98
+ };
99
+ let showEra = (value === null || value === void 0 ? void 0 : (_value_start = value.start) === null || _value_start === void 0 ? void 0 : _value_start.calendar.identifier) === "gregory" && value.start.era === "BC" || (value === null || value === void 0 ? void 0 : (_value_end = value.end) === null || _value_end === void 0 ? void 0 : _value_end.calendar.identifier) === "gregory" && value.end.era === "BC";
100
+ let formatOpts = React.useMemo(() => ({
101
+ granularity,
102
+ timeZone: defaultTimeZone,
103
+ hideTimeZone: props.hideTimeZone,
104
+ hourCycle: props.hourCycle,
105
+ shouldForceLeadingZeros: props.shouldForceLeadingZeros,
106
+ showEra
107
+ }), [
108
+ granularity,
109
+ props.hourCycle,
110
+ props.shouldForceLeadingZeros,
111
+ defaultTimeZone,
112
+ props.hideTimeZone,
113
+ showEra
114
+ ]);
115
+ let { minValue, maxValue, isDateUnavailable } = props;
116
+ let builtinValidation = React.useMemo(() => DatePickerBase.$35a22f14a1f04b11$export$80ff8fc0ae339c13(value, minValue, maxValue, isDateUnavailable, formatOpts), [
117
+ value,
118
+ minValue,
119
+ maxValue,
120
+ isDateUnavailable,
121
+ formatOpts
122
+ ]);
123
+ let validation = useFormValidation.$e5be200c675c3b3a$export$fc1a364ae1f3ff10(__spreadProps(__spreadValues({}, props), {
124
+ value: controlledValue,
125
+ name: React.useMemo(() => [
126
+ props.startName,
127
+ props.endName
128
+ ].filter((n) => n != null), [
129
+ props.startName,
130
+ props.endName
131
+ ]),
132
+ builtinValidation
133
+ }));
134
+ let isValueInvalid = validation.displayValidation.isInvalid;
135
+ let validationState = props.validationState || (isValueInvalid ? "invalid" : null);
136
+ return __spreadProps(__spreadValues(__spreadProps(__spreadValues({}, validation), {
137
+ value,
138
+ setValue,
139
+ dateRange,
140
+ timeRange,
141
+ granularity,
142
+ hasTime,
143
+ setDate(part, date) {
144
+ var _dateRange_end, _dateRange_start;
145
+ if (part === "start") setDateRange({
146
+ start: date,
147
+ end: (_dateRange_end = dateRange === null || dateRange === void 0 ? void 0 : dateRange.end) !== null && _dateRange_end !== void 0 ? _dateRange_end : null
148
+ });
149
+ else setDateRange({
150
+ start: (_dateRange_start = dateRange === null || dateRange === void 0 ? void 0 : dateRange.start) !== null && _dateRange_start !== void 0 ? _dateRange_start : null,
151
+ end: date
152
+ });
153
+ },
154
+ setTime(part, time) {
155
+ var _timeRange_end, _timeRange_start;
156
+ if (part === "start") setTimeRange({
157
+ start: time,
158
+ end: (_timeRange_end = timeRange === null || timeRange === void 0 ? void 0 : timeRange.end) !== null && _timeRange_end !== void 0 ? _timeRange_end : null
159
+ });
160
+ else setTimeRange({
161
+ start: (_timeRange_start = timeRange === null || timeRange === void 0 ? void 0 : timeRange.start) !== null && _timeRange_start !== void 0 ? _timeRange_start : null,
162
+ end: time
163
+ });
164
+ },
165
+ setDateTime(part, dateTime) {
166
+ var _value_end2, _value_start2;
167
+ if (part === "start") setValue({
168
+ start: dateTime,
169
+ end: (_value_end2 = value === null || value === void 0 ? void 0 : value.end) !== null && _value_end2 !== void 0 ? _value_end2 : null
170
+ });
171
+ else setValue({
172
+ start: (_value_start2 = value === null || value === void 0 ? void 0 : value.start) !== null && _value_start2 !== void 0 ? _value_start2 : null,
173
+ end: dateTime
174
+ });
175
+ },
176
+ setDateRange,
177
+ setTimeRange
178
+ }), overlayState), {
179
+ setOpen(isOpen) {
180
+ if (!isOpen && !((value === null || value === void 0 ? void 0 : value.start) && (value === null || value === void 0 ? void 0 : value.end)) && $93c38a5e28be6249$var$isCompleteRange(dateRange) && hasTime) commitValue(dateRange, {
181
+ start: (timeRange === null || timeRange === void 0 ? void 0 : timeRange.start) || DatePickerBase.$35a22f14a1f04b11$export$c5221a78ef73c5e9(props.placeholderValue),
182
+ end: (timeRange === null || timeRange === void 0 ? void 0 : timeRange.end) || DatePickerBase.$35a22f14a1f04b11$export$c5221a78ef73c5e9(props.placeholderValue)
183
+ });
184
+ overlayState.setOpen(isOpen);
185
+ },
186
+ validationState,
187
+ isInvalid: isValueInvalid,
188
+ formatValue(locale, fieldOptions) {
189
+ if (!value || !value.start || !value.end) return null;
190
+ let startTimeZone = "timeZone" in value.start ? value.start.timeZone : void 0;
191
+ let startGranularity = props.granularity || (value.start && "minute" in value.start ? "minute" : "day");
192
+ let endTimeZone = "timeZone" in value.end ? value.end.timeZone : void 0;
193
+ let endGranularity = props.granularity || (value.end && "minute" in value.end ? "minute" : "day");
194
+ let startOptions = DatePickerBase.$35a22f14a1f04b11$export$7e319ea407e63bc0(fieldOptions, {
195
+ granularity: startGranularity,
196
+ timeZone: startTimeZone,
197
+ hideTimeZone: props.hideTimeZone,
198
+ hourCycle: props.hourCycle,
199
+ showEra: value.start.calendar.identifier === "gregory" && value.start.era === "BC" || value.end.calendar.identifier === "gregory" && value.end.era === "BC"
200
+ });
201
+ let startDate = value.start.toDate(startTimeZone || "UTC");
202
+ let endDate = value.end.toDate(endTimeZone || "UTC");
203
+ let startFormatter = new CalendarBase.$fb18d541ea1ad717$export$ad991b66133851cf(locale, startOptions);
204
+ let endFormatter;
205
+ if (startTimeZone === endTimeZone && startGranularity === endGranularity && value.start.compare(value.end) !== 0) {
206
+ try {
207
+ let parts = startFormatter.formatRangeToParts(startDate, endDate);
208
+ let separatorIndex = -1;
209
+ for (let i = 0; i < parts.length; i++) {
210
+ let part = parts[i];
211
+ if (part.source === "shared" && part.type === "literal") separatorIndex = i;
212
+ else if (part.source === "endRange") break;
213
+ }
214
+ let start = "";
215
+ let end = "";
216
+ for (let i = 0; i < parts.length; i++) {
217
+ if (i < separatorIndex) start += parts[i].value;
218
+ else if (i > separatorIndex) end += parts[i].value;
219
+ }
220
+ return {
221
+ start,
222
+ end
223
+ };
224
+ } catch (e) {
225
+ }
226
+ endFormatter = startFormatter;
227
+ } else {
228
+ let endOptions = DatePickerBase.$35a22f14a1f04b11$export$7e319ea407e63bc0(fieldOptions, {
229
+ granularity: endGranularity,
230
+ timeZone: endTimeZone,
231
+ hideTimeZone: props.hideTimeZone,
232
+ hourCycle: props.hourCycle
233
+ });
234
+ endFormatter = new CalendarBase.$fb18d541ea1ad717$export$ad991b66133851cf(locale, endOptions);
235
+ }
236
+ return {
237
+ start: startFormatter.format(startDate),
238
+ end: endFormatter.format(endDate)
239
+ };
240
+ },
241
+ getDateFormatter(locale, formatOptions) {
242
+ let newOptions = __spreadValues(__spreadValues({}, formatOpts), formatOptions);
243
+ let newFormatOptions = DatePickerBase.$35a22f14a1f04b11$export$7e319ea407e63bc0({}, newOptions);
244
+ return new CalendarBase.$fb18d541ea1ad717$export$ad991b66133851cf(locale, newFormatOptions);
245
+ }
246
+ });
247
+ }
248
+ function $93c38a5e28be6249$var$isCompleteRange(value) {
249
+ return (value === null || value === void 0 ? void 0 : value.start) != null && value.end != null;
250
+ }
251
+ function $parcel$interopDefault(a) {
252
+ return a && a.__esModule ? a.default : a;
253
+ }
254
+ function $887cac91b7cc8801$export$12fd5f0e9f4bb192(props, state, ref) {
255
+ var _state_value, _state_value1, _state_dateRange;
256
+ let stringFormatter = useLocalizedStringFormatter.$fca6afa0e843324b$export$f12b703ca79dfbb1($parcel$interopDefault(DatePickerBase.$dfb4eba373ed9493$exports), "@react-aria/datepicker");
257
+ let { isInvalid, validationErrors, validationDetails } = state.displayValidation;
258
+ let { labelProps, fieldProps, descriptionProps, errorMessageProps } = useField.$2baaea4c71418dea$export$294aa081a6c6f55d(__spreadProps(__spreadValues({}, props), {
259
+ labelElementType: "span",
260
+ isInvalid,
261
+ errorMessage: props.errorMessage || validationErrors
262
+ }));
263
+ let labelledBy = fieldProps["aria-labelledby"] || fieldProps.id;
264
+ let { locale } = context.$18f2051aff69b9bf$export$43bb16f9c6d9e3f7();
265
+ let range = state.formatValue(locale, {
266
+ month: "long"
267
+ });
268
+ let description = range ? stringFormatter.format("selectedRangeDescription", {
269
+ startDate: range.start,
270
+ endDate: range.end
271
+ }) : "";
272
+ let descProps = scrollIntoView.$ef06256079686ba0$export$f8aeda7b10753fa1(description);
273
+ let startFieldProps = {
274
+ "aria-label": stringFormatter.format("startDate"),
275
+ "aria-labelledby": labelledBy
276
+ };
277
+ let endFieldProps = {
278
+ "aria-label": stringFormatter.format("endDate"),
279
+ "aria-labelledby": labelledBy
280
+ };
281
+ let buttonId = mergeProps.$bdb11010cef70236$export$f680877a34711e37();
282
+ let dialogId = mergeProps.$bdb11010cef70236$export$f680877a34711e37();
283
+ let groupProps = DatePickerBase.$3dfb0f96be0d6a08$export$4a931266a3838b86(state, ref);
284
+ let ariaDescribedBy = [
285
+ descProps["aria-describedby"],
286
+ fieldProps["aria-describedby"]
287
+ ].filter(Boolean).join(" ") || void 0;
288
+ let focusManager = React.useMemo(() => FocusScope.$9bf71ea28793e738$export$c5251b9e124bf29(ref, {
289
+ // Exclude the button from the focus manager.
290
+ accept: (element) => element.id !== buttonId
291
+ }), [
292
+ ref,
293
+ buttonId
294
+ ]);
295
+ let commonFieldProps = {
296
+ [DatePickerBase.$16f0b7bb276bc17e$export$7b3062cd49e80452]: focusManager,
297
+ [DatePickerBase.$16f0b7bb276bc17e$export$300019f83c56d282]: "presentation",
298
+ "aria-describedby": ariaDescribedBy,
299
+ placeholderValue: props.placeholderValue,
300
+ hideTimeZone: props.hideTimeZone,
301
+ hourCycle: props.hourCycle,
302
+ granularity: props.granularity,
303
+ shouldForceLeadingZeros: props.shouldForceLeadingZeros,
304
+ isDisabled: props.isDisabled,
305
+ isReadOnly: props.isReadOnly,
306
+ isRequired: props.isRequired,
307
+ validationBehavior: props.validationBehavior
308
+ };
309
+ let domProps = filterDOMProps.$65484d02dcb7eb3e$export$457c3d6518dd4c6f(props);
310
+ let { focusWithinProps } = useFocusWithin.$9ab94262bd0047c7$export$420e68273165f4ec(__spreadProps(__spreadValues({}, props), {
311
+ isDisabled: state.isOpen,
312
+ onBlurWithin: props.onBlur,
313
+ onFocusWithin: props.onFocus,
314
+ onFocusWithinChange: props.onFocusChange
315
+ }));
316
+ let startFieldValidation = React.useRef(useFormValidation.$e5be200c675c3b3a$export$dad6ae84456c676a);
317
+ let endFieldValidation = React.useRef(useFormValidation.$e5be200c675c3b3a$export$dad6ae84456c676a);
318
+ var _state_value_start, _state_value_end;
319
+ return {
320
+ groupProps: mergeProps.$3ef42575df84b30b$export$9d1611c77c2fe928(domProps, groupProps, fieldProps, descProps, focusWithinProps, {
321
+ role: "group",
322
+ "aria-disabled": props.isDisabled || null,
323
+ "aria-describedby": ariaDescribedBy,
324
+ onKeyDown(e) {
325
+ if (state.isOpen) return;
326
+ if (props.onKeyDown) props.onKeyDown(e);
327
+ },
328
+ onKeyUp(e) {
329
+ if (state.isOpen) return;
330
+ if (props.onKeyUp) props.onKeyUp(e);
331
+ }
332
+ }),
333
+ labelProps: __spreadProps(__spreadValues({}, labelProps), {
334
+ onClick: () => {
335
+ focusManager.focusFirst();
336
+ }
337
+ }),
338
+ buttonProps: __spreadProps(__spreadValues({}, descProps), {
339
+ id: buttonId,
340
+ "aria-haspopup": "dialog",
341
+ "aria-label": stringFormatter.format("calendar"),
342
+ "aria-labelledby": `${buttonId} ${labelledBy}`,
343
+ "aria-describedby": ariaDescribedBy,
344
+ "aria-expanded": state.isOpen,
345
+ isDisabled: props.isDisabled || props.isReadOnly,
346
+ onPress: () => state.setOpen(true)
347
+ }),
348
+ dialogProps: {
349
+ id: dialogId,
350
+ "aria-labelledby": `${buttonId} ${labelledBy}`
351
+ },
352
+ startFieldProps: __spreadProps(__spreadValues(__spreadValues({}, startFieldProps), commonFieldProps), {
353
+ value: (_state_value_start = (_state_value = state.value) === null || _state_value === void 0 ? void 0 : _state_value.start) !== null && _state_value_start !== void 0 ? _state_value_start : null,
354
+ onChange: (start) => state.setDateTime("start", start),
355
+ autoFocus: props.autoFocus,
356
+ name: props.startName,
357
+ [useFormValidation.$e5be200c675c3b3a$export$a763b9476acd3eb]: {
358
+ realtimeValidation: state.realtimeValidation,
359
+ displayValidation: state.displayValidation,
360
+ updateValidation(e) {
361
+ startFieldValidation.current = e;
362
+ state.updateValidation(useFormValidation.$e5be200c675c3b3a$export$75ee7c75d68f5b0e(e, endFieldValidation.current));
363
+ },
364
+ resetValidation: state.resetValidation,
365
+ commitValidation: state.commitValidation
366
+ }
367
+ }),
368
+ endFieldProps: __spreadProps(__spreadValues(__spreadValues({}, endFieldProps), commonFieldProps), {
369
+ value: (_state_value_end = (_state_value1 = state.value) === null || _state_value1 === void 0 ? void 0 : _state_value1.end) !== null && _state_value_end !== void 0 ? _state_value_end : null,
370
+ onChange: (end) => state.setDateTime("end", end),
371
+ name: props.endName,
372
+ [useFormValidation.$e5be200c675c3b3a$export$a763b9476acd3eb]: {
373
+ realtimeValidation: state.realtimeValidation,
374
+ displayValidation: state.displayValidation,
375
+ updateValidation(e) {
376
+ endFieldValidation.current = e;
377
+ state.updateValidation(useFormValidation.$e5be200c675c3b3a$export$75ee7c75d68f5b0e(startFieldValidation.current, e));
378
+ },
379
+ resetValidation: state.resetValidation,
380
+ commitValidation: state.commitValidation
381
+ }
382
+ }),
383
+ descriptionProps,
384
+ errorMessageProps,
385
+ calendarProps: {
386
+ autoFocus: true,
387
+ value: ((_state_dateRange = state.dateRange) === null || _state_dateRange === void 0 ? void 0 : _state_dateRange.start) && state.dateRange.end ? state.dateRange : null,
388
+ onChange: state.setDateRange,
389
+ minValue: props.minValue,
390
+ maxValue: props.maxValue,
391
+ isDisabled: props.isDisabled,
392
+ isReadOnly: props.isReadOnly,
393
+ isDateUnavailable: props.isDateUnavailable,
394
+ allowsNonContiguousRanges: props.allowsNonContiguousRanges,
395
+ defaultFocusedValue: state.dateRange ? void 0 : props.placeholderValue,
396
+ isInvalid: state.isInvalid,
397
+ errorMessage: typeof props.errorMessage === "function" ? props.errorMessage(state.displayValidation) : props.errorMessage || state.displayValidation.validationErrors.join(" ")
398
+ },
399
+ isInvalid,
400
+ validationErrors,
401
+ validationDetails
402
+ };
403
+ }
404
+ function DateRangePicker(props) {
405
+ const { label, size = "md", isDisabled, isInvalid, errorMessage, "aria-label": ariaLabel } = props;
406
+ const datePickerRef = React.useRef(null);
407
+ const state = $93c38a5e28be6249$export$e50a61c1de9f574(props);
408
+ const { groupProps, labelProps, startFieldProps, endFieldProps, buttonProps, dialogProps, calendarProps } = $887cac91b7cc8801$export$12fd5f0e9f4bb192(props, state, datePickerRef);
409
+ const triggerProps = {
410
+ datePickerRef,
411
+ buttonProps,
412
+ groupProps,
413
+ startFieldProps,
414
+ endFieldProps,
415
+ isDisabled,
416
+ size,
417
+ isInvalid,
418
+ errorMessage: errorMessage || calendarProps.errorMessage
419
+ };
420
+ const overlayProps = {
421
+ dialogProps
422
+ };
423
+ return React.createElement(DatePickerBase.DatePickerBase, {
424
+ labelProps,
425
+ triggerProps,
426
+ overlayProps,
427
+ state,
428
+ label,
429
+ "aria-label": ariaLabel
430
+ }, React.createElement(RangeCalendar.RangeCalendar, __spreadProps(__spreadValues({}, calendarProps), {
431
+ isInvalid: false
432
+ })));
433
+ }
434
+ exports.DateRangePicker = DateRangePicker;