@arc-ui/components 12.0.0-beta.5 → 12.0.0-beta.8

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 (445) hide show
  1. package/dist/Alert/Alert.cjs.js +9 -10
  2. package/dist/Alert/Alert.esm.js +4 -5
  3. package/dist/Alert/styles.css +1 -0
  4. package/dist/Align/Align.cjs.js +7 -8
  5. package/dist/Align/Align.esm.js +1 -2
  6. package/dist/Align/styles.css +1 -0
  7. package/dist/AppButton/AppButton.cjs.js +4 -3
  8. package/dist/AppButton/AppButton.esm.js +4 -3
  9. package/dist/AppButton/styles.css +1 -0
  10. package/dist/Avatar/Avatar.cjs.js +7 -8
  11. package/dist/Avatar/Avatar.esm.js +7 -8
  12. package/dist/Avatar/styles.css +1 -0
  13. package/dist/AvatarGroup/AvatarGroup.cjs.js +14 -15
  14. package/dist/AvatarGroup/AvatarGroup.esm.js +7 -8
  15. package/dist/AvatarGroup/styles.css +1 -0
  16. package/dist/Badge/Badge.cjs.js +5 -13
  17. package/dist/Badge/Badge.esm.js +4 -12
  18. package/dist/Badge/styles.css +1 -0
  19. package/dist/Box/Box.cjs.js +6 -24
  20. package/dist/Box/Box.esm.js +5 -23
  21. package/dist/Box/styles.css +1 -0
  22. package/dist/BrandLogo/BrandLogo.cjs.js +3 -4
  23. package/dist/BrandLogo/BrandLogo.esm.js +3 -4
  24. package/dist/BrandLogo/styles.css +1 -0
  25. package/dist/Breadcrumbs/Breadcrumbs.cjs.js +5 -5
  26. package/dist/Breadcrumbs/Breadcrumbs.esm.js +5 -5
  27. package/dist/Breadcrumbs/styles.css +1 -0
  28. package/dist/Button/Button.cjs.js +5 -6
  29. package/dist/Button/Button.esm.js +5 -6
  30. package/dist/Button/styles.css +1 -0
  31. package/dist/ButtonV2/ButtonV2.cjs.js +5 -6
  32. package/dist/ButtonV2/ButtonV2.esm.js +5 -6
  33. package/dist/ButtonV2/styles.css +1 -0
  34. package/dist/Calendar/Calendar.cjs.js +10 -11
  35. package/dist/Calendar/Calendar.esm.js +10 -11
  36. package/dist/Calendar/styles.css +1 -0
  37. package/dist/CardFooter/CardFooter.cjs.js +17 -0
  38. package/dist/CardFooter/CardFooter.esm.js +9 -0
  39. package/dist/CardFooter/package.json +7 -0
  40. package/dist/CardFooter/styles.css +1 -0
  41. package/dist/CardHeading/CardHeading.cjs.js +14 -0
  42. package/dist/CardHeading/CardHeading.esm.js +6 -0
  43. package/dist/CardHeading/package.json +7 -0
  44. package/dist/CardHeading/styles.css +1 -0
  45. package/dist/Carousel/Carousel.cjs.js +1921 -0
  46. package/dist/Carousel/Carousel.esm.js +1913 -0
  47. package/dist/Carousel/package.json +7 -0
  48. package/dist/Carousel/styles.css +1 -0
  49. package/dist/Checkbox/Checkbox.cjs.js +8 -9
  50. package/dist/Checkbox/Checkbox.esm.js +8 -9
  51. package/dist/Checkbox/styles.css +1 -0
  52. package/dist/Columns/Columns.cjs.js +2 -3
  53. package/dist/Columns/Columns.esm.js +2 -3
  54. package/dist/Columns/styles.css +1 -0
  55. package/dist/ConditionalWrapper/ConditionalWrapper.cjs.js +10 -0
  56. package/dist/ConditionalWrapper/ConditionalWrapper.esm.js +2 -0
  57. package/dist/ConditionalWrapper/package.json +7 -0
  58. package/dist/ContentSwitcher/ContentSwitcher.cjs.js +20 -0
  59. package/dist/ContentSwitcher/ContentSwitcher.esm.js +12 -0
  60. package/dist/ContentSwitcher/package.json +7 -0
  61. package/dist/ContentSwitcher/styles.css +1 -0
  62. package/dist/ContentSwitcherDropdown/ContentSwitcherDropdown.cjs.js +23 -0
  63. package/dist/ContentSwitcherDropdown/ContentSwitcherDropdown.esm.js +15 -0
  64. package/dist/ContentSwitcherDropdown/package.json +7 -0
  65. package/dist/ContentSwitcherDropdown/styles.css +1 -0
  66. package/dist/DatePicker/DatePicker.cjs.js +19 -23
  67. package/dist/DatePicker/DatePicker.esm.js +19 -23
  68. package/dist/DatePicker/styles.css +1 -0
  69. package/dist/Disclosure/Disclosure.cjs.js +8 -9
  70. package/dist/Disclosure/Disclosure.esm.js +4 -5
  71. package/dist/Disclosure/styles.css +1 -0
  72. package/dist/DisclosureMini/DisclosureMini.cjs.js +5 -6
  73. package/dist/DisclosureMini/DisclosureMini.esm.js +5 -6
  74. package/dist/DisclosureMini/styles.css +1 -0
  75. package/dist/Download/Download.cjs.js +16 -0
  76. package/dist/Download/Download.esm.js +8 -0
  77. package/dist/Download/package.json +7 -0
  78. package/dist/Download/styles.css +1 -0
  79. package/dist/Elevation/Elevation.cjs.js +5 -5
  80. package/dist/Elevation/Elevation.esm.js +1 -1
  81. package/dist/Elevation/styles.css +1 -0
  82. package/dist/Filter/Filter.cjs.js +4 -4
  83. package/dist/Filter/Filter.esm.js +4 -4
  84. package/dist/Filter/styles.css +1 -0
  85. package/dist/FormControl/FormControl.cjs.js +7 -8
  86. package/dist/FormControl/FormControl.esm.js +7 -8
  87. package/dist/FormControl/styles.css +1 -0
  88. package/dist/Grid/Grid.cjs.js +2 -3
  89. package/dist/Grid/Grid.esm.js +2 -3
  90. package/dist/Grid/styles.css +1 -0
  91. package/dist/Group/Group.cjs.js +3 -3
  92. package/dist/Group/Group.esm.js +3 -3
  93. package/dist/Group/styles.css +1 -0
  94. package/dist/Heading/Heading.cjs.js +3 -4
  95. package/dist/Heading/Heading.esm.js +3 -4
  96. package/dist/Heading/styles.css +1 -0
  97. package/dist/HeroBanner/HeroBanner.cjs.js +63 -0
  98. package/dist/HeroBanner/HeroBanner.esm.js +55 -0
  99. package/dist/HeroBanner/package.json +7 -0
  100. package/dist/HeroBanner/styles.css +1 -0
  101. package/dist/HeroButton/HeroButton.cjs.js +5 -6
  102. package/dist/HeroButton/HeroButton.esm.js +5 -6
  103. package/dist/HeroButton/styles.css +1 -0
  104. package/dist/Hidden/Hidden.cjs.js +5 -5
  105. package/dist/Hidden/Hidden.esm.js +1 -1
  106. package/dist/Hidden/styles.css +1 -0
  107. package/dist/Icon/Icon.cjs.js +3 -4
  108. package/dist/Icon/Icon.esm.js +3 -4
  109. package/dist/Icon/styles.css +1 -0
  110. package/dist/Image/Image.cjs.js +2 -3
  111. package/dist/Image/Image.esm.js +2 -3
  112. package/dist/Image/styles.css +1 -0
  113. package/dist/ImpactCard/ImpactCard.cjs.js +17 -18
  114. package/dist/ImpactCard/ImpactCard.esm.js +11 -12
  115. package/dist/ImpactCard/styles.css +1 -0
  116. package/dist/InformationCard/InformationCard.cjs.js +37 -51
  117. package/dist/InformationCard/InformationCard.esm.js +34 -48
  118. package/dist/InformationCard/styles.css +1 -0
  119. package/dist/Link/Link.cjs.js +15 -16
  120. package/dist/Link/Link.esm.js +8 -9
  121. package/dist/Link/styles.css +1 -0
  122. package/dist/Markup/Markup.cjs.js +6 -6
  123. package/dist/Markup/Markup.esm.js +2 -2
  124. package/dist/Markup/styles.css +1 -0
  125. package/dist/MediaCard/MediaCard.cjs.js +15 -15
  126. package/dist/MediaCard/MediaCard.esm.js +15 -15
  127. package/dist/MediaCard/styles.css +1 -0
  128. package/dist/Modal/Modal.cjs.js +44 -1201
  129. package/dist/Modal/Modal.esm.js +13 -1169
  130. package/dist/Modal/styles.css +1 -0
  131. package/dist/Pagination/Pagination.cjs.js +12 -13
  132. package/dist/Pagination/Pagination.esm.js +3 -4
  133. package/dist/Pagination/styles.css +1 -0
  134. package/dist/PaginationSimple/PaginationSimple.cjs.js +85 -17
  135. package/dist/PaginationSimple/PaginationSimple.esm.js +82 -14
  136. package/dist/PaginationSimple/styles.css +1 -0
  137. package/dist/Poster/Poster.cjs.js +4 -5
  138. package/dist/Poster/Poster.esm.js +4 -5
  139. package/dist/Poster/styles.css +1 -0
  140. package/dist/ProgressBar/ProgressBar.cjs.js +12 -13
  141. package/dist/ProgressBar/ProgressBar.esm.js +6 -7
  142. package/dist/ProgressBar/styles.css +1 -0
  143. package/dist/ProgressStepper/ProgressStepper.cjs.js +5 -6
  144. package/dist/ProgressStepper/ProgressStepper.esm.js +5 -6
  145. package/dist/ProgressStepper/styles.css +1 -0
  146. package/dist/RadioGroup/RadioGroup.cjs.js +8 -9
  147. package/dist/RadioGroup/RadioGroup.esm.js +8 -9
  148. package/dist/RadioGroup/styles.css +1 -0
  149. package/dist/Rule/Rule.cjs.js +5 -5
  150. package/dist/Rule/Rule.esm.js +2 -2
  151. package/dist/Rule/styles.css +1 -0
  152. package/dist/ScrollToTop/ScrollToTop.cjs.js +26 -10
  153. package/dist/ScrollToTop/ScrollToTop.esm.js +21 -5
  154. package/dist/ScrollToTop/styles.css +1 -0
  155. package/dist/Section/Section.cjs.js +2 -2
  156. package/dist/Section/Section.esm.js +2 -2
  157. package/dist/Section/styles.css +1 -0
  158. package/dist/Select/Select.cjs.js +31 -1132
  159. package/dist/Select/Select.esm.js +18 -1119
  160. package/dist/Select/styles.css +1 -0
  161. package/dist/SiteFooter/SiteFooter.cjs.js +7 -8
  162. package/dist/SiteFooter/SiteFooter.esm.js +7 -8
  163. package/dist/SiteFooter/styles.css +1 -0
  164. package/dist/SiteHeaderV2/SiteHeaderV2.cjs.js +12 -13
  165. package/dist/SiteHeaderV2/SiteHeaderV2.esm.js +12 -13
  166. package/dist/SiteHeaderV2/styles.css +1 -0
  167. package/dist/SkipLink/SkipLink.cjs.js +4 -4
  168. package/dist/SkipLink/SkipLink.esm.js +3 -3
  169. package/dist/SkipLink/styles.css +1 -0
  170. package/dist/Spinner/Spinner.cjs.js +12 -0
  171. package/dist/Spinner/Spinner.esm.js +4 -0
  172. package/dist/Spinner/package.json +7 -0
  173. package/dist/Spinner/styles.css +1 -0
  174. package/dist/Surface/Surface.cjs.js +2 -2
  175. package/dist/Surface/Surface.esm.js +2 -2
  176. package/dist/Surface/styles.css +1 -0
  177. package/dist/Switch/Switch.cjs.js +16 -18
  178. package/dist/Switch/Switch.esm.js +12 -14
  179. package/dist/Switch/styles.css +1 -0
  180. package/dist/Tabs/Tabs.cjs.js +9 -11
  181. package/dist/Tabs/Tabs.esm.js +9 -11
  182. package/dist/Tabs/styles.css +1 -0
  183. package/dist/Tag/Tag.cjs.js +77 -9
  184. package/dist/Tag/Tag.esm.js +76 -8
  185. package/dist/Tag/styles.css +1 -0
  186. package/dist/Text/Text.cjs.js +3 -4
  187. package/dist/Text/Text.esm.js +3 -4
  188. package/dist/Text/styles.css +1 -0
  189. package/dist/TextArea/TextArea.cjs.js +64 -59
  190. package/dist/TextArea/TextArea.esm.js +60 -55
  191. package/dist/TextArea/styles.css +1 -0
  192. package/dist/TextInput/TextInput.cjs.js +8 -10
  193. package/dist/TextInput/TextInput.esm.js +8 -10
  194. package/dist/TextInput/styles.css +1 -0
  195. package/dist/Theme/Theme.cjs.js +7 -6
  196. package/dist/Theme/Theme.esm.js +5 -4
  197. package/dist/Theme/styles.css +1 -0
  198. package/dist/ThemeIcon/ThemeIcon.cjs.js +3 -4
  199. package/dist/ThemeIcon/ThemeIcon.esm.js +3 -4
  200. package/dist/ThemeIcon/styles.css +1 -0
  201. package/dist/Toast/Toast.cjs.js +8 -10
  202. package/dist/Toast/Toast.esm.js +8 -10
  203. package/dist/Toast/styles.css +1 -0
  204. package/dist/Truncate/Truncate.cjs.js +3 -3
  205. package/dist/Truncate/Truncate.esm.js +3 -3
  206. package/dist/Truncate/styles.css +1 -0
  207. package/dist/TypographyCard/TypographyCard.cjs.js +15 -16
  208. package/dist/TypographyCard/TypographyCard.esm.js +10 -11
  209. package/dist/TypographyCard/styles.css +1 -0
  210. package/dist/UniversalHeader/UniversalHeader.cjs.js +3 -3
  211. package/dist/UniversalHeader/UniversalHeader.esm.js +3 -3
  212. package/dist/UniversalHeader/styles.css +1 -0
  213. package/dist/VerticalSpace/VerticalSpace.cjs.js +2 -2
  214. package/dist/VerticalSpace/VerticalSpace.esm.js +2 -2
  215. package/dist/VerticalSpace/styles.css +1 -0
  216. package/dist/VideoPlayer/VideoPlayer.cjs.js +38 -26
  217. package/dist/VideoPlayer/VideoPlayer.esm.js +37 -25
  218. package/dist/VideoPlayer/styles.css +1 -0
  219. package/dist/Visible/Visible.cjs.js +5 -5
  220. package/dist/Visible/Visible.esm.js +1 -1
  221. package/dist/Visible/styles.css +1 -0
  222. package/dist/VisuallyHidden/VisuallyHidden.cjs.js +2 -1
  223. package/dist/VisuallyHidden/VisuallyHidden.esm.js +2 -1
  224. package/dist/VisuallyHidden/styles.css +1 -0
  225. package/dist/_shared/cjs/{Avatar-fc0d9b8b.js → Avatar-7478d063.js} +11 -12
  226. package/dist/_shared/cjs/Badge-ca986033.js +17 -0
  227. package/dist/_shared/cjs/Box-e225b4a4.js +29 -0
  228. package/dist/_shared/cjs/{BrandLogo-1d2ca2c7.js → BrandLogo-bf632f2b.js} +7 -8
  229. package/dist/_shared/cjs/{Breadcrumbs-7af0af2c.js → Breadcrumbs-bb292a9e.js} +15 -14
  230. package/dist/_shared/cjs/BtIconArrowRight.esm-c78e3c11.js +30 -0
  231. package/dist/_shared/cjs/BtIconChevronRight2Px.esm-e8329e34.js +44 -0
  232. package/dist/_shared/cjs/BtIconChevronRightMid.esm-745faaca.js +28 -0
  233. package/dist/_shared/cjs/BtIconPlayFill.esm-7e848bd9.js +30 -0
  234. package/dist/_shared/cjs/{Button-7d891a89.js → Button-76215474.js} +12 -13
  235. package/dist/_shared/cjs/{ButtonV2-b2db3f46.js → ButtonV2-320f74b2.js} +21 -16
  236. package/dist/_shared/cjs/{Calendar-649cc139.js → Calendar-16ed5bec.js} +915 -915
  237. package/dist/_shared/cjs/CardFooter-6aa9a280.js +79 -0
  238. package/dist/_shared/cjs/CardHeading-30ef8abc.js +16 -0
  239. package/dist/_shared/cjs/{Checkbox-0e423653.js → Checkbox-4dbaac21.js} +17 -12
  240. package/dist/_shared/cjs/{Columns-1224bdff.js → Columns-ff4977f8.js} +9 -10
  241. package/dist/_shared/cjs/Combination-d19b4dc6.js +1203 -0
  242. package/dist/_shared/cjs/ContentSwitcher-1b789e2f.js +98 -0
  243. package/dist/_shared/cjs/ContentSwitcherDropdown-0de9f7e4.js +47 -0
  244. package/dist/_shared/cjs/DatePicker-a0f14025.js +939 -0
  245. package/dist/_shared/cjs/{DisclosureMini-c01ecce0.js → DisclosureMini-09ee2d12.js} +10 -10
  246. package/dist/_shared/cjs/Download-08d71049.js +43 -0
  247. package/dist/_shared/cjs/{Filter-3b897d92.js → Filter-60b0dd96.js} +14 -14
  248. package/dist/_shared/cjs/{FormControl-88d48f42.js → FormControl-fa7bb586.js} +12 -12
  249. package/dist/_shared/cjs/{Grid-9e91fb3d.js → Grid-a50fb206.js} +10 -11
  250. package/dist/_shared/cjs/{Group-3d5ea240.js → Group-1aba9855.js} +9 -9
  251. package/dist/_shared/cjs/{Heading-fb63844f.js → Heading-cb321adf.js} +9 -9
  252. package/dist/_shared/cjs/{HeroButton-0586a7c4.js → HeroButton-75e1ab78.js} +20 -20
  253. package/dist/_shared/cjs/Icon-859c6c00.js +47 -0
  254. package/dist/_shared/cjs/{Image-e9a5a326.js → Image-b807e951.js} +9 -10
  255. package/dist/_shared/cjs/{MediaCard-8f41b411.js → MediaCard-8101ae8b.js} +18 -18
  256. package/dist/_shared/cjs/{Poster-b7242b37.js → Poster-46b6803e.js} +13 -14
  257. package/dist/_shared/cjs/{ProgressStepper-fb8405c2.js → ProgressStepper-5fb2e7ac.js} +18 -42
  258. package/dist/_shared/cjs/{RadioGroup-a4186267.js → RadioGroup-f8963bd2.js} +14 -14
  259. package/dist/_shared/cjs/{Section-ecfc659b.js → Section-bee4a090.js} +5 -5
  260. package/dist/_shared/cjs/{SiteFooter-7c4072b5.js → SiteFooter-3fee99ae.js} +11 -11
  261. package/dist/_shared/cjs/{SiteHeaderV2-94687999.js → SiteHeaderV2-0f072158.js} +71 -106
  262. package/dist/_shared/cjs/Spinner-2a1d9f20.js +24 -0
  263. package/dist/_shared/cjs/{index-df60851b.js → Surface-4bc47dcb.js} +53 -65
  264. package/dist/_shared/cjs/Tabs-ba44ea49.js +90 -0
  265. package/dist/_shared/cjs/{Text-1c1110a4.js → Text-f6be8fdd.js} +8 -8
  266. package/dist/_shared/cjs/{TextInput-762e2309.js → TextInput-9d9a53ac.js} +13 -13
  267. package/dist/_shared/cjs/{ThemeIcon-ee814862.js → ThemeIcon-6b10d20a.js} +8 -9
  268. package/dist/_shared/cjs/{Toast-d06a89e0.js → Toast-a33b5a2e.js} +16 -17
  269. package/dist/_shared/cjs/{UniversalHeader-f6d9c63a.js → UniversalHeader-114ac8f5.js} +6 -6
  270. package/dist/_shared/cjs/{VerticalSpace-e128ec68.js → VerticalSpace-3908ae62.js} +5 -5
  271. package/dist/_shared/cjs/{VisuallyHidden-b0de4c7b.js → VisuallyHidden-821078c9.js} +3 -2
  272. package/dist/_shared/cjs/{component-df82bc05.js → component-ae4b7058.js} +4 -4
  273. package/dist/_shared/cjs/{Combination-3a639f6d.js → floating-ui.react-dom-08b8b87c.js} +37 -1103
  274. package/dist/_shared/cjs/{Tabs-75c34f43.js → index-1e7a1fce.js} +11 -96
  275. package/dist/_shared/cjs/{index-3d629205.js → index-2bf59363.js} +19 -1
  276. package/dist/_shared/cjs/{index-996dec94.js → index-527f962b.js} +1 -1
  277. package/dist/_shared/cjs/index-6b0bf2cc.js +2204 -0
  278. package/dist/_shared/cjs/{index-7aa7f96a.js → index-879e71ee.js} +8 -1
  279. package/dist/_shared/cjs/{index-41b09e85.js → index-ba3141f5.js} +20 -1
  280. package/dist/_shared/cjs/{index-0c6319ec.js → index-dbc843d3.js} +1 -1
  281. package/dist/_shared/cjs/{index.es-16759329.js → index.es-11fc5df7.js} +2 -2
  282. package/dist/_shared/cjs/index.es-b404d2c5.js +324 -0
  283. package/dist/_shared/esm/{Avatar-38cc0595.js → Avatar-b2fde5c6.js} +5 -6
  284. package/dist/_shared/esm/Badge-a6bda4a7.js +11 -0
  285. package/dist/_shared/esm/Box-2a1645ed.js +23 -0
  286. package/dist/_shared/esm/{BrandLogo-7ed8aeda.js → BrandLogo-3424eb79.js} +2 -3
  287. package/dist/_shared/esm/{Breadcrumbs-9078b68e.js → Breadcrumbs-7de7bfa5.js} +11 -10
  288. package/dist/_shared/esm/BtIconArrowRight.esm-8bcaa8ad.js +24 -0
  289. package/dist/_shared/esm/BtIconChevronRight2Px.esm-84262845.js +37 -0
  290. package/dist/_shared/esm/BtIconChevronRightMid.esm-f67f0ca3.js +22 -0
  291. package/dist/_shared/esm/BtIconPlayFill.esm-ec2797a0.js +24 -0
  292. package/dist/_shared/esm/{Button-dde2b46a.js → Button-9cab8eec.js} +4 -5
  293. package/dist/_shared/esm/{ButtonV2-49cd0615.js → ButtonV2-4dc8830e.js} +13 -8
  294. package/dist/_shared/esm/{Calendar-60591442.js → Calendar-e3f8c4f0.js} +893 -893
  295. package/dist/_shared/esm/CardFooter-2902bd84.js +73 -0
  296. package/dist/_shared/esm/CardHeading-6d3dbfad.js +10 -0
  297. package/dist/_shared/esm/{Checkbox-0baca464.js → Checkbox-f40de2e9.js} +12 -7
  298. package/dist/_shared/esm/{Columns-6a8f6fbb.js → Columns-5e02e601.js} +1 -2
  299. package/dist/_shared/esm/Combination-a063f96d.js +1163 -0
  300. package/dist/_shared/esm/ContentSwitcher-e0bd73a7.js +92 -0
  301. package/dist/_shared/esm/ContentSwitcherDropdown-306b4660.js +41 -0
  302. package/dist/_shared/esm/DatePicker-3f82e2c4.js +910 -0
  303. package/dist/_shared/esm/{DisclosureMini-38f4c459.js → DisclosureMini-60cb2a6c.js} +4 -4
  304. package/dist/_shared/esm/Download-a5443778.js +37 -0
  305. package/dist/_shared/esm/{Filter-49dcf5ce.js → Filter-bc821cbc.js} +11 -11
  306. package/dist/_shared/esm/{FormControl-d873f7fa.js → FormControl-7ff0a178.js} +5 -5
  307. package/dist/_shared/esm/{Grid-fb9fc522.js → Grid-75251350.js} +1 -2
  308. package/dist/_shared/esm/{Group-66196f07.js → Group-b4e10621.js} +2 -2
  309. package/dist/_shared/esm/{Heading-906c7c7c.js → Heading-14df0c64.js} +5 -5
  310. package/dist/_shared/esm/{HeroButton-7ea692bf.js → HeroButton-1221bd94.js} +12 -12
  311. package/dist/_shared/esm/{Icon-512f834f.js → Icon-3e813b34.js} +16 -6
  312. package/dist/_shared/esm/{Image-57d08939.js → Image-85c39506.js} +1 -2
  313. package/dist/_shared/esm/{MediaCard-c12d89ea.js → MediaCard-387c8f11.js} +10 -10
  314. package/dist/_shared/esm/{Poster-e05a8b45.js → Poster-adcd3ba3.js} +4 -5
  315. package/dist/_shared/esm/{ProgressStepper-189ed0f9.js → ProgressStepper-72b070a8.js} +9 -33
  316. package/dist/_shared/esm/{RadioGroup-8ff17cbb.js → RadioGroup-6e657cee.js} +7 -7
  317. package/dist/_shared/esm/{Section-1acbc06a.js → Section-b9caea45.js} +1 -1
  318. package/dist/_shared/esm/{SiteFooter-b65497e8.js → SiteFooter-61b4ae63.js} +6 -6
  319. package/dist/_shared/esm/{SiteHeaderV2-784b3bf8.js → SiteHeaderV2-1fde7d20.js} +10 -45
  320. package/dist/_shared/esm/Spinner-9d28043d.js +18 -0
  321. package/dist/_shared/esm/{index-288c66b5.js → Surface-56d329b0.js} +48 -65
  322. package/dist/_shared/esm/Tabs-276a0836.js +84 -0
  323. package/dist/_shared/esm/{Text-a46fb76b.js → Text-98ad2e78.js} +5 -5
  324. package/dist/_shared/esm/{TextInput-94c7b1a4.js → TextInput-eccd0140.js} +6 -6
  325. package/dist/_shared/esm/{ThemeIcon-c2dc41a6.js → ThemeIcon-810de4bc.js} +2 -3
  326. package/dist/_shared/esm/{Toast-de6ca2f3.js → Toast-62932e3b.js} +6 -7
  327. package/dist/_shared/esm/{UniversalHeader-456ad60c.js → UniversalHeader-370d7fa4.js} +3 -3
  328. package/dist/_shared/esm/{VerticalSpace-b07cd8e6.js → VerticalSpace-549fbdc8.js} +1 -1
  329. package/dist/_shared/esm/VisuallyHidden-fee374a8.js +12 -0
  330. package/dist/_shared/esm/{component-d0a555cf.js → component-94b3dbfe.js} +1 -1
  331. package/dist/_shared/esm/{Combination-ae3a3f08.js → floating-ui.react-dom-1bb71aae.js} +15 -1079
  332. package/dist/_shared/esm/{index-f97466e9.js → index-14c7f4da.js} +1 -1
  333. package/dist/_shared/esm/index-24509173.js +2169 -0
  334. package/dist/_shared/esm/{index-cace3545.js → index-57d4cb34.js} +33 -33
  335. package/dist/_shared/esm/{Tabs-21ac7dfe.js → index-89a7c31c.js} +6 -90
  336. package/dist/_shared/esm/{index-4e58de24.js → index-ac50b180.js} +21 -3
  337. package/dist/_shared/esm/{index-7740883c.js → index-b9923ee4.js} +9 -2
  338. package/dist/_shared/esm/{index-605031ca.js → index-ce6dee84.js} +53 -53
  339. package/dist/_shared/esm/index-e969452b.js +41 -0
  340. package/dist/_shared/esm/{index-fa93ec97.js → index-f2ddcbe2.js} +1 -1
  341. package/dist/_shared/esm/index.es-4921e8dd.js +318 -0
  342. package/dist/_shared/esm/{index.es-1b6d33c2.js → index.es-52a3bcff.js} +2 -2
  343. package/dist/index.es.js +14634 -13762
  344. package/dist/index.es.js.map +1 -1
  345. package/dist/index.js +14637 -13761
  346. package/dist/index.js.map +1 -1
  347. package/dist/styles.css +9 -7
  348. package/dist/types/components/Avatar/index.d.ts +1 -1
  349. package/dist/types/components/Box/Box.d.ts +4 -0
  350. package/dist/types/components/ButtonV2/ButtonV2.d.ts +2 -2
  351. package/dist/types/components/CardHeading/index.d.ts +1 -0
  352. package/dist/types/components/Carousel/Carousel.d.ts +34 -0
  353. package/dist/types/components/Carousel/components/DotButton.d.ts +10 -0
  354. package/dist/types/components/Carousel/constants/breakpoints.d.ts +5 -0
  355. package/dist/types/components/Carousel/helpers/get-options.d.ts +3 -0
  356. package/dist/types/components/Carousel/helpers/get-slide-width.d.ts +12 -0
  357. package/dist/types/components/Carousel/index.d.ts +1 -0
  358. package/dist/types/components/Carousel/types/breakpoints.d.ts +1 -0
  359. package/dist/types/components/Carousel/types/keynames.d.ts +5 -0
  360. package/dist/types/components/Carousel/types/responsive.d.ts +3 -0
  361. package/dist/types/components/Carousel/types/screen-sizes.d.ts +2 -0
  362. package/dist/types/components/Carousel/types/slide-config.d.ts +5 -0
  363. package/dist/types/components/Checkbox/Checkbox.d.ts +1 -1
  364. package/dist/types/components/ContentSwitcher/ContentSwitcher.d.ts +28 -0
  365. package/dist/types/components/ContentSwitcher/ContentSwitcherContent/ContentSwitcherContent.d.ts +12 -0
  366. package/dist/types/components/ContentSwitcher/ContentSwitcherContent/index.d.ts +1 -0
  367. package/dist/types/components/ContentSwitcher/ContentSwitcherList/ContentSwitcherList.d.ts +24 -0
  368. package/dist/types/components/ContentSwitcher/ContentSwitcherList/index.d.ts +1 -0
  369. package/dist/types/components/ContentSwitcher/ContentSwitcherTab/ContentSwitcherTab.d.ts +17 -0
  370. package/dist/types/components/ContentSwitcher/ContentSwitcherTab/index.d.ts +1 -0
  371. package/dist/types/components/ContentSwitcher/index.d.ts +1 -0
  372. package/dist/types/components/ContentSwitcherDropdown/ContentSwitcherDropdown.d.ts +37 -0
  373. package/dist/types/components/ContentSwitcherDropdown/index.d.ts +1 -0
  374. package/dist/types/components/Disclosure/index.d.ts +1 -1
  375. package/dist/types/components/Download/Download.d.ts +41 -0
  376. package/dist/types/components/Download/index.d.ts +1 -0
  377. package/dist/types/components/Heading/Heading.d.ts +4 -0
  378. package/dist/types/components/Heading/index.d.ts +1 -1
  379. package/dist/types/components/HeroBanner/HeroBanner.d.ts +52 -0
  380. package/dist/types/components/HeroBanner/index.d.ts +1 -0
  381. package/dist/types/components/Icon/Icon.d.ts +2 -2
  382. package/dist/types/components/ImpactCard/ImpactCard.d.ts +2 -2
  383. package/dist/types/components/ImpactCard/index.d.ts +1 -1
  384. package/dist/types/components/InformationCard/InformationCard.d.ts +2 -2
  385. package/dist/types/components/InformationCard/index.d.ts +1 -1
  386. package/dist/types/components/MediaCard/MediaCard.d.ts +1 -1
  387. package/dist/types/components/MediaCard/index.d.ts +1 -1
  388. package/dist/types/components/PaginationSimple/PaginationSimple.d.ts +24 -16
  389. package/dist/types/components/Spinner/Spinner.d.ts +16 -0
  390. package/dist/types/components/Spinner/index.d.ts +1 -0
  391. package/dist/types/components/Surface/Surface.d.ts +4 -0
  392. package/dist/types/components/Switch/Switch.d.ts +4 -0
  393. package/dist/types/components/Tabs/TabsList/TabsList.d.ts +5 -0
  394. package/dist/types/components/Text/Text.d.ts +4 -0
  395. package/dist/types/components/TextInput/TextInput.d.ts +2 -2
  396. package/dist/types/components/ThemeIcon/icon-names.d.ts +1 -1
  397. package/dist/types/components/Truncate/Truncate.d.ts +1 -1
  398. package/dist/types/components/TypographyCard/TypographyCard.d.ts +2 -2
  399. package/dist/types/components/TypographyCard/index.d.ts +1 -1
  400. package/dist/types/components/VideoPlayer/VideoPlayer.d.ts +9 -0
  401. package/dist/types/components/index.d.ts +4 -0
  402. package/dist/types/helpers/index.d.ts +0 -2
  403. package/dist/types/styles.d.ts +9 -4
  404. package/package.json +24 -16
  405. package/dist/_shared/cjs/ArcIconEclipse.esm-ac777a76.js +0 -28
  406. package/dist/_shared/cjs/BtIconArrowRight.esm-5989f2ca.js +0 -38
  407. package/dist/_shared/cjs/BtIconChevronRightMid.esm-3e8d18a9.js +0 -28
  408. package/dist/_shared/cjs/BtIconPlayFill.esm-b8997cfc.js +0 -30
  409. package/dist/_shared/cjs/CardFooter-5414bc4f.js +0 -79
  410. package/dist/_shared/cjs/DatePicker-2417e55b.js +0 -550
  411. package/dist/_shared/cjs/Icon-0ec0c1fb.js +0 -37
  412. package/dist/_shared/cjs/Surface-8599dbe4.js +0 -57
  413. package/dist/_shared/cjs/Tag-452048f6.js +0 -44
  414. package/dist/_shared/cjs/index-039a9d35.js +0 -23
  415. package/dist/_shared/cjs/index-28447df0.js +0 -23
  416. package/dist/_shared/cjs/index-dcfdd5da.js +0 -11
  417. package/dist/_shared/cjs/suffix-modifier-c8a34402.js +0 -19
  418. package/dist/_shared/esm/ArcIconEclipse.esm-bb48b82a.js +0 -22
  419. package/dist/_shared/esm/BtIconArrowRight.esm-6a17d0ce.js +0 -31
  420. package/dist/_shared/esm/BtIconChevronRightMid.esm-4764708f.js +0 -22
  421. package/dist/_shared/esm/BtIconPlayFill.esm-05fc0344.js +0 -24
  422. package/dist/_shared/esm/CardFooter-c79fb2db.js +0 -73
  423. package/dist/_shared/esm/DatePicker-c7bb178e.js +0 -539
  424. package/dist/_shared/esm/Surface-71d21a9e.js +0 -48
  425. package/dist/_shared/esm/Tag-2513c185.js +0 -38
  426. package/dist/_shared/esm/VisuallyHidden-06692fd3.js +0 -11
  427. package/dist/_shared/esm/index-5113ed53.js +0 -24
  428. package/dist/_shared/esm/index-6028d797.js +0 -21
  429. package/dist/_shared/esm/index-69089474.js +0 -21
  430. package/dist/_shared/esm/index-a624de47.js +0 -9
  431. package/dist/_shared/esm/suffix-modifier-1ce05abe.js +0 -17
  432. package/dist/types/components/ProgressStepper/ProgressStepperItem/icons/Todo.d.ts +0 -2
  433. package/dist/types/helpers/filter-data-attrs.d.ts +0 -1
  434. package/dist/types/helpers/suffix-modifier.d.ts +0 -9
  435. package/dist/types/private-components/CardHeading/index.d.ts +0 -1
  436. package/dist/types/private-components/index.d.ts +0 -3
  437. package/dist/_shared/cjs/{ConditionalWrapper-be3b2625.js → ConditionalWrapper-bf944594.js} +0 -0
  438. package/dist/_shared/cjs/{index-7e31a45b.js → index-28fbfd5b.js} +52 -52
  439. package/dist/_shared/cjs/{index-3dd54df1.js → index-76f7dd53.js} +31 -31
  440. /package/dist/_shared/esm/{ConditionalWrapper-59be8f35.js → ConditionalWrapper-b85979de.js} +0 -0
  441. /package/dist/types/{private-components → components}/CardFooter/CardFooter.d.ts +0 -0
  442. /package/dist/types/{private-components → components}/CardFooter/index.d.ts +0 -0
  443. /package/dist/types/{private-components → components}/CardHeading/CardHeading.d.ts +0 -0
  444. /package/dist/types/{private-components → components}/ConditionalWrapper/ConditionalWrapper.d.ts +0 -0
  445. /package/dist/types/{private-components → components}/ConditionalWrapper/index.d.ts +0 -0
@@ -0,0 +1,910 @@
1
+ import { b as __spreadArray, _ as __rest, a as __assign, f as filterDataAttrs } from './index.es-4921e8dd.js';
2
+ import * as React from 'react';
3
+ import React__default, { forwardRef, useState, useRef, useEffect } from 'react';
4
+ import { c as classNames } from './index-2e73c2e9.js';
5
+ import { P as Primitive, u as useLayoutEffect2, c as createContextScope, a as useComposedRefs, b as useCallbackRef, d as composeEventHandlers, e as Presence, R as RemoveScroll, S as Slot, f as useFocusGuards, F as FocusScope, D as DismissableLayer, g as useControllableState, h as useId, i as Portal$1 } from './Combination-a063f96d.js';
6
+ import { u as useFloating, a as autoUpdate, o as offset, s as shift, l as limitShift, f as flip, b as size, c as arrow, h as hide } from './floating-ui.react-dom-1bb71aae.js';
7
+ import { jsx } from 'react/jsx-runtime';
8
+ import { h as hideOthers, u as useThemeElement } from './component-94b3dbfe.js';
9
+ import { C as Calendar, i as isBefore, a as isAfter, c as compareAsc } from './Calendar-e3f8c4f0.js';
10
+ import { r as requiredArgs, t as toDate, b as isValid, f as format } from './index-ce6dee84.js';
11
+ import { T as TextInputWithPlaceHolder } from './TextInput-eccd0140.js';
12
+
13
+ /**
14
+ * @name startOfDay
15
+ * @category Day Helpers
16
+ * @summary Return the start of a day for the given date.
17
+ *
18
+ * @description
19
+ * Return the start of a day for the given date.
20
+ * The result will be in the local timezone.
21
+ *
22
+ * @param {Date|Number} date - the original date
23
+ * @returns {Date} the start of a day
24
+ * @throws {TypeError} 1 argument required
25
+ *
26
+ * @example
27
+ * // The start of a day for 2 September 2014 11:55:00:
28
+ * const result = startOfDay(new Date(2014, 8, 2, 11, 55, 0))
29
+ * //=> Tue Sep 02 2014 00:00:00
30
+ */
31
+ function startOfDay(dirtyDate) {
32
+ requiredArgs(1, arguments);
33
+ var date = toDate(dirtyDate);
34
+ date.setHours(0, 0, 0, 0);
35
+ return date;
36
+ }
37
+
38
+ /**
39
+ * @name isSameDay
40
+ * @category Day Helpers
41
+ * @summary Are the given dates in the same day (and year and month)?
42
+ *
43
+ * @description
44
+ * Are the given dates in the same day (and year and month)?
45
+ *
46
+ * @param {Date|Number} dateLeft - the first date to check
47
+ * @param {Date|Number} dateRight - the second date to check
48
+ * @returns {Boolean} the dates are in the same day (and year and month)
49
+ * @throws {TypeError} 2 arguments required
50
+ *
51
+ * @example
52
+ * // Are 4 September 06:00:00 and 4 September 18:00:00 in the same day?
53
+ * const result = isSameDay(new Date(2014, 8, 4, 6, 0), new Date(2014, 8, 4, 18, 0))
54
+ * //=> true
55
+ *
56
+ * @example
57
+ * // Are 4 September and 4 October in the same day?
58
+ * const result = isSameDay(new Date(2014, 8, 4), new Date(2014, 9, 4))
59
+ * //=> false
60
+ *
61
+ * @example
62
+ * // Are 4 September, 2014 and 4 September, 2015 in the same day?
63
+ * const result = isSameDay(new Date(2014, 8, 4), new Date(2015, 8, 4))
64
+ * //=> false
65
+ */
66
+ function isSameDay(dirtyDateLeft, dirtyDateRight) {
67
+ requiredArgs(2, arguments);
68
+ var dateLeftStartOfDay = startOfDay(dirtyDateLeft);
69
+ var dateRightStartOfDay = startOfDay(dirtyDateRight);
70
+ return dateLeftStartOfDay.getTime() === dateRightStartOfDay.getTime();
71
+ }
72
+
73
+ var parseRangeString = function (value) {
74
+ if (value === void 0) { value = ""; }
75
+ var _a = value.replace(/\s/g, "").split("-"), _b = _a[0], start = _b === void 0 ? "" : _b, _c = _a[1], end = _c === void 0 ? "" : _c;
76
+ var _d = start.split("/"), startDay = _d[0], startMonth = _d[1], startYear = _d[2];
77
+ var _e = end.split("/"), endDay = _e[0], endMonth = _e[1], endYear = _e[2];
78
+ return {
79
+ start: {
80
+ date: start,
81
+ day: startDay,
82
+ month: startMonth,
83
+ year: startYear
84
+ },
85
+ end: {
86
+ date: end,
87
+ day: endDay,
88
+ month: endMonth,
89
+ year: endYear
90
+ }
91
+ };
92
+ };
93
+
94
+ var parseDateString = function (value) {
95
+ var _a = value.split("/"), day = _a[0], month = _a[1], year = _a[2];
96
+ return {
97
+ day: day,
98
+ month: month,
99
+ year: year
100
+ };
101
+ };
102
+
103
+ var isDateValid = function (value) {
104
+ if (value === void 0) { value = ""; }
105
+ var _a = value.split("/"), day = _a[0], month = _a[1], year = _a[2];
106
+ return (/^\d{2}\/\d{2}\/\d{4}$/.test(value) &&
107
+ isValid(new Date("".concat(year, "-").concat(month, "-").concat(day))));
108
+ };
109
+
110
+ var isRangeValid = function (value) {
111
+ if (value === void 0) { value = ""; }
112
+ var _a = value.replace(/\s/g, "").split("-"), _b = _a[0], start = _b === void 0 ? "" : _b, _c = _a[1], end = _c === void 0 ? "" : _c;
113
+ return isDateValid(start) && isDateValid(end);
114
+ };
115
+
116
+ var DATE_FORMAT = "dd/MM/yyyy";
117
+
118
+ // packages/react/arrow/src/Arrow.tsx
119
+ var NAME = "Arrow";
120
+ var Arrow$1 = React.forwardRef((props, forwardedRef) => {
121
+ const { children, width = 10, height = 5, ...arrowProps } = props;
122
+ return /* @__PURE__ */ jsx(
123
+ Primitive.svg,
124
+ {
125
+ ...arrowProps,
126
+ ref: forwardedRef,
127
+ width,
128
+ height,
129
+ viewBox: "0 0 30 10",
130
+ preserveAspectRatio: "none",
131
+ children: props.asChild ? children : /* @__PURE__ */ jsx("polygon", { points: "0,0 30,0 15,10" })
132
+ }
133
+ );
134
+ });
135
+ Arrow$1.displayName = NAME;
136
+ var Root = Arrow$1;
137
+
138
+ // packages/react/use-size/src/useSize.tsx
139
+ function useSize(element) {
140
+ const [size, setSize] = React.useState(void 0);
141
+ useLayoutEffect2(() => {
142
+ if (element) {
143
+ setSize({ width: element.offsetWidth, height: element.offsetHeight });
144
+ const resizeObserver = new ResizeObserver((entries) => {
145
+ if (!Array.isArray(entries)) {
146
+ return;
147
+ }
148
+ if (!entries.length) {
149
+ return;
150
+ }
151
+ const entry = entries[0];
152
+ let width;
153
+ let height;
154
+ if ("borderBoxSize" in entry) {
155
+ const borderSizeEntry = entry["borderBoxSize"];
156
+ const borderSize = Array.isArray(borderSizeEntry) ? borderSizeEntry[0] : borderSizeEntry;
157
+ width = borderSize["inlineSize"];
158
+ height = borderSize["blockSize"];
159
+ } else {
160
+ width = element.offsetWidth;
161
+ height = element.offsetHeight;
162
+ }
163
+ setSize({ width, height });
164
+ });
165
+ resizeObserver.observe(element, { box: "border-box" });
166
+ return () => resizeObserver.unobserve(element);
167
+ } else {
168
+ setSize(void 0);
169
+ }
170
+ }, [element]);
171
+ return size;
172
+ }
173
+
174
+ var POPPER_NAME = "Popper";
175
+ var [createPopperContext, createPopperScope] = createContextScope(POPPER_NAME);
176
+ var [PopperProvider, usePopperContext] = createPopperContext(POPPER_NAME);
177
+ var Popper = (props) => {
178
+ const { __scopePopper, children } = props;
179
+ const [anchor, setAnchor] = React.useState(null);
180
+ return /* @__PURE__ */ jsx(PopperProvider, { scope: __scopePopper, anchor, onAnchorChange: setAnchor, children });
181
+ };
182
+ Popper.displayName = POPPER_NAME;
183
+ var ANCHOR_NAME$1 = "PopperAnchor";
184
+ var PopperAnchor = React.forwardRef(
185
+ (props, forwardedRef) => {
186
+ const { __scopePopper, virtualRef, ...anchorProps } = props;
187
+ const context = usePopperContext(ANCHOR_NAME$1, __scopePopper);
188
+ const ref = React.useRef(null);
189
+ const composedRefs = useComposedRefs(forwardedRef, ref);
190
+ React.useEffect(() => {
191
+ context.onAnchorChange(virtualRef?.current || ref.current);
192
+ });
193
+ return virtualRef ? null : /* @__PURE__ */ jsx(Primitive.div, { ...anchorProps, ref: composedRefs });
194
+ }
195
+ );
196
+ PopperAnchor.displayName = ANCHOR_NAME$1;
197
+ var CONTENT_NAME$1 = "PopperContent";
198
+ var [PopperContentProvider, useContentContext] = createPopperContext(CONTENT_NAME$1);
199
+ var PopperContent = React.forwardRef(
200
+ (props, forwardedRef) => {
201
+ const {
202
+ __scopePopper,
203
+ side = "bottom",
204
+ sideOffset = 0,
205
+ align = "center",
206
+ alignOffset = 0,
207
+ arrowPadding = 0,
208
+ avoidCollisions = true,
209
+ collisionBoundary = [],
210
+ collisionPadding: collisionPaddingProp = 0,
211
+ sticky = "partial",
212
+ hideWhenDetached = false,
213
+ updatePositionStrategy = "optimized",
214
+ onPlaced,
215
+ ...contentProps
216
+ } = props;
217
+ const context = usePopperContext(CONTENT_NAME$1, __scopePopper);
218
+ const [content, setContent] = React.useState(null);
219
+ const composedRefs = useComposedRefs(forwardedRef, (node) => setContent(node));
220
+ const [arrow$1, setArrow] = React.useState(null);
221
+ const arrowSize = useSize(arrow$1);
222
+ const arrowWidth = arrowSize?.width ?? 0;
223
+ const arrowHeight = arrowSize?.height ?? 0;
224
+ const desiredPlacement = side + (align !== "center" ? "-" + align : "");
225
+ const collisionPadding = typeof collisionPaddingProp === "number" ? collisionPaddingProp : { top: 0, right: 0, bottom: 0, left: 0, ...collisionPaddingProp };
226
+ const boundary = Array.isArray(collisionBoundary) ? collisionBoundary : [collisionBoundary];
227
+ const hasExplicitBoundaries = boundary.length > 0;
228
+ const detectOverflowOptions = {
229
+ padding: collisionPadding,
230
+ boundary: boundary.filter(isNotNull),
231
+ // with `strategy: 'fixed'`, this is the only way to get it to respect boundaries
232
+ altBoundary: hasExplicitBoundaries
233
+ };
234
+ const { refs, floatingStyles, placement, isPositioned, middlewareData } = useFloating({
235
+ // default to `fixed` strategy so users don't have to pick and we also avoid focus scroll issues
236
+ strategy: "fixed",
237
+ placement: desiredPlacement,
238
+ whileElementsMounted: (...args) => {
239
+ const cleanup = autoUpdate(...args, {
240
+ animationFrame: updatePositionStrategy === "always"
241
+ });
242
+ return cleanup;
243
+ },
244
+ elements: {
245
+ reference: context.anchor
246
+ },
247
+ middleware: [
248
+ offset({ mainAxis: sideOffset + arrowHeight, alignmentAxis: alignOffset }),
249
+ avoidCollisions && shift({
250
+ mainAxis: true,
251
+ crossAxis: false,
252
+ limiter: sticky === "partial" ? limitShift() : void 0,
253
+ ...detectOverflowOptions
254
+ }),
255
+ avoidCollisions && flip({ ...detectOverflowOptions }),
256
+ size({
257
+ ...detectOverflowOptions,
258
+ apply: ({ elements, rects, availableWidth, availableHeight }) => {
259
+ const { width: anchorWidth, height: anchorHeight } = rects.reference;
260
+ const contentStyle = elements.floating.style;
261
+ contentStyle.setProperty("--radix-popper-available-width", `${availableWidth}px`);
262
+ contentStyle.setProperty("--radix-popper-available-height", `${availableHeight}px`);
263
+ contentStyle.setProperty("--radix-popper-anchor-width", `${anchorWidth}px`);
264
+ contentStyle.setProperty("--radix-popper-anchor-height", `${anchorHeight}px`);
265
+ }
266
+ }),
267
+ arrow$1 && arrow({ element: arrow$1, padding: arrowPadding }),
268
+ transformOrigin({ arrowWidth, arrowHeight }),
269
+ hideWhenDetached && hide({ strategy: "referenceHidden", ...detectOverflowOptions })
270
+ ]
271
+ });
272
+ const [placedSide, placedAlign] = getSideAndAlignFromPlacement(placement);
273
+ const handlePlaced = useCallbackRef(onPlaced);
274
+ useLayoutEffect2(() => {
275
+ if (isPositioned) {
276
+ handlePlaced?.();
277
+ }
278
+ }, [isPositioned, handlePlaced]);
279
+ const arrowX = middlewareData.arrow?.x;
280
+ const arrowY = middlewareData.arrow?.y;
281
+ const cannotCenterArrow = middlewareData.arrow?.centerOffset !== 0;
282
+ const [contentZIndex, setContentZIndex] = React.useState();
283
+ useLayoutEffect2(() => {
284
+ if (content) setContentZIndex(window.getComputedStyle(content).zIndex);
285
+ }, [content]);
286
+ return /* @__PURE__ */ jsx(
287
+ "div",
288
+ {
289
+ ref: refs.setFloating,
290
+ "data-radix-popper-content-wrapper": "",
291
+ style: {
292
+ ...floatingStyles,
293
+ transform: isPositioned ? floatingStyles.transform : "translate(0, -200%)",
294
+ // keep off the page when measuring
295
+ minWidth: "max-content",
296
+ zIndex: contentZIndex,
297
+ ["--radix-popper-transform-origin"]: [
298
+ middlewareData.transformOrigin?.x,
299
+ middlewareData.transformOrigin?.y
300
+ ].join(" "),
301
+ // hide the content if using the hide middleware and should be hidden
302
+ // set visibility to hidden and disable pointer events so the UI behaves
303
+ // as if the PopperContent isn't there at all
304
+ ...middlewareData.hide?.referenceHidden && {
305
+ visibility: "hidden",
306
+ pointerEvents: "none"
307
+ }
308
+ },
309
+ dir: props.dir,
310
+ children: /* @__PURE__ */ jsx(
311
+ PopperContentProvider,
312
+ {
313
+ scope: __scopePopper,
314
+ placedSide,
315
+ onArrowChange: setArrow,
316
+ arrowX,
317
+ arrowY,
318
+ shouldHideArrow: cannotCenterArrow,
319
+ children: /* @__PURE__ */ jsx(
320
+ Primitive.div,
321
+ {
322
+ "data-side": placedSide,
323
+ "data-align": placedAlign,
324
+ ...contentProps,
325
+ ref: composedRefs,
326
+ style: {
327
+ ...contentProps.style,
328
+ // if the PopperContent hasn't been placed yet (not all measurements done)
329
+ // we prevent animations so that users's animation don't kick in too early referring wrong sides
330
+ animation: !isPositioned ? "none" : void 0
331
+ }
332
+ }
333
+ )
334
+ }
335
+ )
336
+ }
337
+ );
338
+ }
339
+ );
340
+ PopperContent.displayName = CONTENT_NAME$1;
341
+ var ARROW_NAME$1 = "PopperArrow";
342
+ var OPPOSITE_SIDE = {
343
+ top: "bottom",
344
+ right: "left",
345
+ bottom: "top",
346
+ left: "right"
347
+ };
348
+ var PopperArrow = React.forwardRef(function PopperArrow2(props, forwardedRef) {
349
+ const { __scopePopper, ...arrowProps } = props;
350
+ const contentContext = useContentContext(ARROW_NAME$1, __scopePopper);
351
+ const baseSide = OPPOSITE_SIDE[contentContext.placedSide];
352
+ return (
353
+ // we have to use an extra wrapper because `ResizeObserver` (used by `useSize`)
354
+ // doesn't report size as we'd expect on SVG elements.
355
+ // it reports their bounding box which is effectively the largest path inside the SVG.
356
+ /* @__PURE__ */ jsx(
357
+ "span",
358
+ {
359
+ ref: contentContext.onArrowChange,
360
+ style: {
361
+ position: "absolute",
362
+ left: contentContext.arrowX,
363
+ top: contentContext.arrowY,
364
+ [baseSide]: 0,
365
+ transformOrigin: {
366
+ top: "",
367
+ right: "0 0",
368
+ bottom: "center 0",
369
+ left: "100% 0"
370
+ }[contentContext.placedSide],
371
+ transform: {
372
+ top: "translateY(100%)",
373
+ right: "translateY(50%) rotate(90deg) translateX(-50%)",
374
+ bottom: `rotate(180deg)`,
375
+ left: "translateY(50%) rotate(-90deg) translateX(50%)"
376
+ }[contentContext.placedSide],
377
+ visibility: contentContext.shouldHideArrow ? "hidden" : void 0
378
+ },
379
+ children: /* @__PURE__ */ jsx(
380
+ Root,
381
+ {
382
+ ...arrowProps,
383
+ ref: forwardedRef,
384
+ style: {
385
+ ...arrowProps.style,
386
+ // ensures the element can be measured correctly (mostly for if SVG)
387
+ display: "block"
388
+ }
389
+ }
390
+ )
391
+ }
392
+ )
393
+ );
394
+ });
395
+ PopperArrow.displayName = ARROW_NAME$1;
396
+ function isNotNull(value) {
397
+ return value !== null;
398
+ }
399
+ var transformOrigin = (options) => ({
400
+ name: "transformOrigin",
401
+ options,
402
+ fn(data) {
403
+ const { placement, rects, middlewareData } = data;
404
+ const cannotCenterArrow = middlewareData.arrow?.centerOffset !== 0;
405
+ const isArrowHidden = cannotCenterArrow;
406
+ const arrowWidth = isArrowHidden ? 0 : options.arrowWidth;
407
+ const arrowHeight = isArrowHidden ? 0 : options.arrowHeight;
408
+ const [placedSide, placedAlign] = getSideAndAlignFromPlacement(placement);
409
+ const noArrowAlign = { start: "0%", center: "50%", end: "100%" }[placedAlign];
410
+ const arrowXCenter = (middlewareData.arrow?.x ?? 0) + arrowWidth / 2;
411
+ const arrowYCenter = (middlewareData.arrow?.y ?? 0) + arrowHeight / 2;
412
+ let x = "";
413
+ let y = "";
414
+ if (placedSide === "bottom") {
415
+ x = isArrowHidden ? noArrowAlign : `${arrowXCenter}px`;
416
+ y = `${-arrowHeight}px`;
417
+ } else if (placedSide === "top") {
418
+ x = isArrowHidden ? noArrowAlign : `${arrowXCenter}px`;
419
+ y = `${rects.floating.height + arrowHeight}px`;
420
+ } else if (placedSide === "right") {
421
+ x = `${-arrowHeight}px`;
422
+ y = isArrowHidden ? noArrowAlign : `${arrowYCenter}px`;
423
+ } else if (placedSide === "left") {
424
+ x = `${rects.floating.width + arrowHeight}px`;
425
+ y = isArrowHidden ? noArrowAlign : `${arrowYCenter}px`;
426
+ }
427
+ return { data: { x, y } };
428
+ }
429
+ });
430
+ function getSideAndAlignFromPlacement(placement) {
431
+ const [side, align = "center"] = placement.split("-");
432
+ return [side, align];
433
+ }
434
+ var Root2$1 = Popper;
435
+ var Anchor = PopperAnchor;
436
+ var Content = PopperContent;
437
+ var Arrow = PopperArrow;
438
+
439
+ var POPOVER_NAME = "Popover";
440
+ var [createPopoverContext, createPopoverScope] = createContextScope(POPOVER_NAME, [
441
+ createPopperScope
442
+ ]);
443
+ var usePopperScope = createPopperScope();
444
+ var [PopoverProvider, usePopoverContext] = createPopoverContext(POPOVER_NAME);
445
+ var Popover = (props) => {
446
+ const {
447
+ __scopePopover,
448
+ children,
449
+ open: openProp,
450
+ defaultOpen,
451
+ onOpenChange,
452
+ modal = false
453
+ } = props;
454
+ const popperScope = usePopperScope(__scopePopover);
455
+ const triggerRef = React.useRef(null);
456
+ const [hasCustomAnchor, setHasCustomAnchor] = React.useState(false);
457
+ const [open = false, setOpen] = useControllableState({
458
+ prop: openProp,
459
+ defaultProp: defaultOpen,
460
+ onChange: onOpenChange
461
+ });
462
+ return /* @__PURE__ */ jsx(Root2$1, { ...popperScope, children: /* @__PURE__ */ jsx(
463
+ PopoverProvider,
464
+ {
465
+ scope: __scopePopover,
466
+ contentId: useId(),
467
+ triggerRef,
468
+ open,
469
+ onOpenChange: setOpen,
470
+ onOpenToggle: React.useCallback(() => setOpen((prevOpen) => !prevOpen), [setOpen]),
471
+ hasCustomAnchor,
472
+ onCustomAnchorAdd: React.useCallback(() => setHasCustomAnchor(true), []),
473
+ onCustomAnchorRemove: React.useCallback(() => setHasCustomAnchor(false), []),
474
+ modal,
475
+ children
476
+ }
477
+ ) });
478
+ };
479
+ Popover.displayName = POPOVER_NAME;
480
+ var ANCHOR_NAME = "PopoverAnchor";
481
+ var PopoverAnchor = React.forwardRef(
482
+ (props, forwardedRef) => {
483
+ const { __scopePopover, ...anchorProps } = props;
484
+ const context = usePopoverContext(ANCHOR_NAME, __scopePopover);
485
+ const popperScope = usePopperScope(__scopePopover);
486
+ const { onCustomAnchorAdd, onCustomAnchorRemove } = context;
487
+ React.useEffect(() => {
488
+ onCustomAnchorAdd();
489
+ return () => onCustomAnchorRemove();
490
+ }, [onCustomAnchorAdd, onCustomAnchorRemove]);
491
+ return /* @__PURE__ */ jsx(Anchor, { ...popperScope, ...anchorProps, ref: forwardedRef });
492
+ }
493
+ );
494
+ PopoverAnchor.displayName = ANCHOR_NAME;
495
+ var TRIGGER_NAME = "PopoverTrigger";
496
+ var PopoverTrigger = React.forwardRef(
497
+ (props, forwardedRef) => {
498
+ const { __scopePopover, ...triggerProps } = props;
499
+ const context = usePopoverContext(TRIGGER_NAME, __scopePopover);
500
+ const popperScope = usePopperScope(__scopePopover);
501
+ const composedTriggerRef = useComposedRefs(forwardedRef, context.triggerRef);
502
+ const trigger = /* @__PURE__ */ jsx(
503
+ Primitive.button,
504
+ {
505
+ type: "button",
506
+ "aria-haspopup": "dialog",
507
+ "aria-expanded": context.open,
508
+ "aria-controls": context.contentId,
509
+ "data-state": getState(context.open),
510
+ ...triggerProps,
511
+ ref: composedTriggerRef,
512
+ onClick: composeEventHandlers(props.onClick, context.onOpenToggle)
513
+ }
514
+ );
515
+ return context.hasCustomAnchor ? trigger : /* @__PURE__ */ jsx(Anchor, { asChild: true, ...popperScope, children: trigger });
516
+ }
517
+ );
518
+ PopoverTrigger.displayName = TRIGGER_NAME;
519
+ var PORTAL_NAME = "PopoverPortal";
520
+ var [PortalProvider, usePortalContext] = createPopoverContext(PORTAL_NAME, {
521
+ forceMount: void 0
522
+ });
523
+ var PopoverPortal = (props) => {
524
+ const { __scopePopover, forceMount, children, container } = props;
525
+ const context = usePopoverContext(PORTAL_NAME, __scopePopover);
526
+ return /* @__PURE__ */ jsx(PortalProvider, { scope: __scopePopover, forceMount, children: /* @__PURE__ */ jsx(Presence, { present: forceMount || context.open, children: /* @__PURE__ */ jsx(Portal$1, { asChild: true, container, children }) }) });
527
+ };
528
+ PopoverPortal.displayName = PORTAL_NAME;
529
+ var CONTENT_NAME = "PopoverContent";
530
+ var PopoverContent = React.forwardRef(
531
+ (props, forwardedRef) => {
532
+ const portalContext = usePortalContext(CONTENT_NAME, props.__scopePopover);
533
+ const { forceMount = portalContext.forceMount, ...contentProps } = props;
534
+ const context = usePopoverContext(CONTENT_NAME, props.__scopePopover);
535
+ return /* @__PURE__ */ jsx(Presence, { present: forceMount || context.open, children: context.modal ? /* @__PURE__ */ jsx(PopoverContentModal, { ...contentProps, ref: forwardedRef }) : /* @__PURE__ */ jsx(PopoverContentNonModal, { ...contentProps, ref: forwardedRef }) });
536
+ }
537
+ );
538
+ PopoverContent.displayName = CONTENT_NAME;
539
+ var PopoverContentModal = React.forwardRef(
540
+ (props, forwardedRef) => {
541
+ const context = usePopoverContext(CONTENT_NAME, props.__scopePopover);
542
+ const contentRef = React.useRef(null);
543
+ const composedRefs = useComposedRefs(forwardedRef, contentRef);
544
+ const isRightClickOutsideRef = React.useRef(false);
545
+ React.useEffect(() => {
546
+ const content = contentRef.current;
547
+ if (content) return hideOthers(content);
548
+ }, []);
549
+ return /* @__PURE__ */ jsx(RemoveScroll, { as: Slot, allowPinchZoom: true, children: /* @__PURE__ */ jsx(
550
+ PopoverContentImpl,
551
+ {
552
+ ...props,
553
+ ref: composedRefs,
554
+ trapFocus: context.open,
555
+ disableOutsidePointerEvents: true,
556
+ onCloseAutoFocus: composeEventHandlers(props.onCloseAutoFocus, (event) => {
557
+ event.preventDefault();
558
+ if (!isRightClickOutsideRef.current) context.triggerRef.current?.focus();
559
+ }),
560
+ onPointerDownOutside: composeEventHandlers(
561
+ props.onPointerDownOutside,
562
+ (event) => {
563
+ const originalEvent = event.detail.originalEvent;
564
+ const ctrlLeftClick = originalEvent.button === 0 && originalEvent.ctrlKey === true;
565
+ const isRightClick = originalEvent.button === 2 || ctrlLeftClick;
566
+ isRightClickOutsideRef.current = isRightClick;
567
+ },
568
+ { checkForDefaultPrevented: false }
569
+ ),
570
+ onFocusOutside: composeEventHandlers(
571
+ props.onFocusOutside,
572
+ (event) => event.preventDefault(),
573
+ { checkForDefaultPrevented: false }
574
+ )
575
+ }
576
+ ) });
577
+ }
578
+ );
579
+ var PopoverContentNonModal = React.forwardRef(
580
+ (props, forwardedRef) => {
581
+ const context = usePopoverContext(CONTENT_NAME, props.__scopePopover);
582
+ const hasInteractedOutsideRef = React.useRef(false);
583
+ const hasPointerDownOutsideRef = React.useRef(false);
584
+ return /* @__PURE__ */ jsx(
585
+ PopoverContentImpl,
586
+ {
587
+ ...props,
588
+ ref: forwardedRef,
589
+ trapFocus: false,
590
+ disableOutsidePointerEvents: false,
591
+ onCloseAutoFocus: (event) => {
592
+ props.onCloseAutoFocus?.(event);
593
+ if (!event.defaultPrevented) {
594
+ if (!hasInteractedOutsideRef.current) context.triggerRef.current?.focus();
595
+ event.preventDefault();
596
+ }
597
+ hasInteractedOutsideRef.current = false;
598
+ hasPointerDownOutsideRef.current = false;
599
+ },
600
+ onInteractOutside: (event) => {
601
+ props.onInteractOutside?.(event);
602
+ if (!event.defaultPrevented) {
603
+ hasInteractedOutsideRef.current = true;
604
+ if (event.detail.originalEvent.type === "pointerdown") {
605
+ hasPointerDownOutsideRef.current = true;
606
+ }
607
+ }
608
+ const target = event.target;
609
+ const targetIsTrigger = context.triggerRef.current?.contains(target);
610
+ if (targetIsTrigger) event.preventDefault();
611
+ if (event.detail.originalEvent.type === "focusin" && hasPointerDownOutsideRef.current) {
612
+ event.preventDefault();
613
+ }
614
+ }
615
+ }
616
+ );
617
+ }
618
+ );
619
+ var PopoverContentImpl = React.forwardRef(
620
+ (props, forwardedRef) => {
621
+ const {
622
+ __scopePopover,
623
+ trapFocus,
624
+ onOpenAutoFocus,
625
+ onCloseAutoFocus,
626
+ disableOutsidePointerEvents,
627
+ onEscapeKeyDown,
628
+ onPointerDownOutside,
629
+ onFocusOutside,
630
+ onInteractOutside,
631
+ ...contentProps
632
+ } = props;
633
+ const context = usePopoverContext(CONTENT_NAME, __scopePopover);
634
+ const popperScope = usePopperScope(__scopePopover);
635
+ useFocusGuards();
636
+ return /* @__PURE__ */ jsx(
637
+ FocusScope,
638
+ {
639
+ asChild: true,
640
+ loop: true,
641
+ trapped: trapFocus,
642
+ onMountAutoFocus: onOpenAutoFocus,
643
+ onUnmountAutoFocus: onCloseAutoFocus,
644
+ children: /* @__PURE__ */ jsx(
645
+ DismissableLayer,
646
+ {
647
+ asChild: true,
648
+ disableOutsidePointerEvents,
649
+ onInteractOutside,
650
+ onEscapeKeyDown,
651
+ onPointerDownOutside,
652
+ onFocusOutside,
653
+ onDismiss: () => context.onOpenChange(false),
654
+ children: /* @__PURE__ */ jsx(
655
+ Content,
656
+ {
657
+ "data-state": getState(context.open),
658
+ role: "dialog",
659
+ id: context.contentId,
660
+ ...popperScope,
661
+ ...contentProps,
662
+ ref: forwardedRef,
663
+ style: {
664
+ ...contentProps.style,
665
+ // re-namespace exposed content custom properties
666
+ ...{
667
+ "--radix-popover-content-transform-origin": "var(--radix-popper-transform-origin)",
668
+ "--radix-popover-content-available-width": "var(--radix-popper-available-width)",
669
+ "--radix-popover-content-available-height": "var(--radix-popper-available-height)",
670
+ "--radix-popover-trigger-width": "var(--radix-popper-anchor-width)",
671
+ "--radix-popover-trigger-height": "var(--radix-popper-anchor-height)"
672
+ }
673
+ }
674
+ }
675
+ )
676
+ }
677
+ )
678
+ }
679
+ );
680
+ }
681
+ );
682
+ var CLOSE_NAME = "PopoverClose";
683
+ var PopoverClose = React.forwardRef(
684
+ (props, forwardedRef) => {
685
+ const { __scopePopover, ...closeProps } = props;
686
+ const context = usePopoverContext(CLOSE_NAME, __scopePopover);
687
+ return /* @__PURE__ */ jsx(
688
+ Primitive.button,
689
+ {
690
+ type: "button",
691
+ ...closeProps,
692
+ ref: forwardedRef,
693
+ onClick: composeEventHandlers(props.onClick, () => context.onOpenChange(false))
694
+ }
695
+ );
696
+ }
697
+ );
698
+ PopoverClose.displayName = CLOSE_NAME;
699
+ var ARROW_NAME = "PopoverArrow";
700
+ var PopoverArrow = React.forwardRef(
701
+ (props, forwardedRef) => {
702
+ const { __scopePopover, ...arrowProps } = props;
703
+ const popperScope = usePopperScope(__scopePopover);
704
+ return /* @__PURE__ */ jsx(Arrow, { ...popperScope, ...arrowProps, ref: forwardedRef });
705
+ }
706
+ );
707
+ PopoverArrow.displayName = ARROW_NAME;
708
+ function getState(open) {
709
+ return open ? "open" : "closed";
710
+ }
711
+ var Root2 = Popover;
712
+ var Anchor2 = PopoverAnchor;
713
+ var Portal = PopoverPortal;
714
+ var Content2 = PopoverContent;
715
+
716
+ var formatDate = function (value) {
717
+ return format(value, DATE_FORMAT);
718
+ };
719
+
720
+ var isDisabledDate = function (disabledDates, date) {
721
+ return Boolean(disabledDates &&
722
+ disabledDates.find(function (disabledDate) { return isSameDay(date, disabledDate); }));
723
+ };
724
+
725
+ var convertDateStringToDate = function (value) {
726
+ if (value === void 0) { value = ""; }
727
+ var _a = parseDateString(value), day = _a.day, month = _a.month, year = _a.year;
728
+ var isValidDate = isDateValid(value);
729
+ return isValidDate ? new Date("".concat(year, "-").concat(month, "-").concat(day)) : new Date();
730
+ };
731
+
732
+ var convertRangeStringToDates = function (value) {
733
+ if (value === void 0) { value = ""; }
734
+ var _a = parseRangeString(value), start = _a.start, end = _a.end;
735
+ return __spreadArray(__spreadArray([], (isDateValid(start.date)
736
+ ? [new Date("".concat(start.year, "-").concat(start.month, "-").concat(start.day))]
737
+ : []), true), (isDateValid(end.date)
738
+ ? [new Date("".concat(end.year, "-").concat(end.month, "-").concat(end.day))]
739
+ : []), true);
740
+ };
741
+
742
+ /**
743
+ * Use `DatePicker` to clearly present available dates and allow users to choose a way to enter information.
744
+ */
745
+ var DatePicker = forwardRef(function (_a, ref) {
746
+ var errorMessage = _a.errorMessage, helper = _a.helper, id = _a.id, label = _a.label, isDisabled = _a.isDisabled, isReadOnly = _a.isReadOnly, isRequired = _a.isRequired, labelSize = _a.labelSize, inputSize = _a.inputSize, _b = _a.value, value = _b === void 0 ? "" : _b, name = _a.name, onBlur = _a.onBlur, onChange = _a.onChange, onDateSelect = _a.onDateSelect, onRangeSelect = _a.onRangeSelect, onClickDisclosure = _a.onClickDisclosure, disclosureTitle = _a.disclosureTitle, disclosureText = _a.disclosureText, type = _a.type, _c = _a.isFluid, isFluid = _c === void 0 ? false : _c, _d = _a.selectionType, selectionType = _d === void 0 ? "single" : _d, disabledDates = _a.disabledDates, minDate = _a.minDate, maxDate = _a.maxDate, props = __rest(_a, ["errorMessage", "helper", "id", "label", "isDisabled", "isReadOnly", "isRequired", "labelSize", "inputSize", "value", "name", "onBlur", "onChange", "onDateSelect", "onRangeSelect", "onClickDisclosure", "disclosureTitle", "disclosureText", "type", "isFluid", "selectionType", "disabledDates", "minDate", "maxDate"]);
747
+ var _e = useThemeElement(), themeElement = _e[0], setThemeElement = _e[1];
748
+ var _f = useState("Choose date"), ariaLabel = _f[0], setAriaLabel = _f[1];
749
+ var _g = useState(false), showCalendar = _g[0], setShowCalendar = _g[1];
750
+ var buttonRef = useRef(null);
751
+ var ourRef = useRef(null);
752
+ var previousValidValue = useRef(value);
753
+ var lowerCaseDateFormat = DATE_FORMAT.toLowerCase();
754
+ var placeHolder = selectionType === "range"
755
+ ? "".concat(lowerCaseDateFormat, " - ").concat(lowerCaseDateFormat)
756
+ : lowerCaseDateFormat;
757
+ useEffect(function () {
758
+ if (selectionType === "single" &&
759
+ isDateValid(value) &&
760
+ !isDisabledDate(disabledDates, convertDateStringToDate(value))) {
761
+ previousValidValue.current = value;
762
+ }
763
+ if (selectionType === "range" && isRangeValid(value)) {
764
+ var rangeHasDisabledDates = convertRangeStringToDates(value).some(function (rangeValue) { return isDisabledDate(disabledDates, rangeValue); });
765
+ if (!rangeHasDisabledDates) {
766
+ previousValidValue.current = value;
767
+ }
768
+ }
769
+ }, [value, disabledDates, selectionType]);
770
+ var getDatePickerRef = function (elementRef) {
771
+ ourRef.current = elementRef;
772
+ if (ref && typeof ref === "object") {
773
+ ref.current = elementRef;
774
+ }
775
+ if (ref && typeof ref === "function") {
776
+ ref(elementRef);
777
+ }
778
+ };
779
+ var dispatchChangeEvent = function (e, value) {
780
+ onChange &&
781
+ onChange(__assign(__assign({}, e), { target: __assign(__assign({}, e.target), { value: value }) }));
782
+ };
783
+ var handleRangeSelect = function (rangeSelection) {
784
+ var start = formatDate(rangeSelection.start);
785
+ var end = rangeSelection.end ? formatDate(rangeSelection.end) : null;
786
+ onRangeSelect &&
787
+ onRangeSelect(__assign(__assign({}, rangeSelection), { formattedRange: "".concat(start).concat(end ? " - ".concat(end) : "") }));
788
+ rangeSelection.isSelectionComplete && setShowCalendar(false);
789
+ };
790
+ var handleDateSelect = function (value) {
791
+ onDateSelect &&
792
+ onDateSelect({
793
+ date: value,
794
+ formattedDate: formatDate(value)
795
+ });
796
+ setShowCalendar(false);
797
+ };
798
+ var handleSingleSelectionBlur = function (e) {
799
+ if (value && isDateValid(value) && selectionType === "single") {
800
+ var _a = parseDateString(value), day = _a.day, month = _a.month, year = _a.year;
801
+ var date = new Date("".concat(year, "-").concat(month, "-").concat(day));
802
+ var isDateBeforeMinDate = minDate && isBefore(date, minDate);
803
+ var isDateAfterMaxDate = maxDate && isAfter(date, maxDate);
804
+ var isDisabledValue = isDisabledDate(disabledDates, date);
805
+ if (isDateBeforeMinDate) {
806
+ return dispatchChangeEvent(e, "".concat(formatDate(minDate)));
807
+ }
808
+ if (isDateAfterMaxDate) {
809
+ return dispatchChangeEvent(e, "".concat(formatDate(maxDate)));
810
+ }
811
+ if (isDisabledValue) {
812
+ var date_1 = previousValidValue.current
813
+ ? convertDateStringToDate(previousValidValue.current)
814
+ : new Date();
815
+ return dispatchChangeEvent(e, "".concat(formatDate(date_1)));
816
+ }
817
+ }
818
+ };
819
+ var handleRangeSelectionBlur = function (e) {
820
+ if (isRangeValid(value) && selectionType === "range") {
821
+ var _a = convertRangeStringToDates(value), start = _a[0], end = _a[1];
822
+ var isStartDateBeforeMinDate = minDate && isBefore(start, minDate);
823
+ var isEndDateAfterMaxDate = maxDate && isAfter(end, maxDate);
824
+ var isStartDateDisabled = isDisabledDate(disabledDates, start);
825
+ var isEndDateDisabled = isDisabledDate(disabledDates, end);
826
+ if (isStartDateBeforeMinDate && isEndDateAfterMaxDate) {
827
+ return dispatchChangeEvent(e, "".concat(formatDate(minDate), " - ").concat(formatDate(maxDate)));
828
+ }
829
+ if (isStartDateBeforeMinDate) {
830
+ return dispatchChangeEvent(e, "".concat(formatDate(minDate), " - ").concat(formatDate(end)));
831
+ }
832
+ if (isEndDateAfterMaxDate) {
833
+ return dispatchChangeEvent(e, "".concat(formatDate(start), " - ").concat(formatDate(maxDate)));
834
+ }
835
+ if (isStartDateDisabled || isEndDateDisabled) {
836
+ var _b = previousValidValue.current
837
+ ? convertRangeStringToDates(previousValidValue.current)
838
+ : [], start_1 = _b[0], end_1 = _b[1];
839
+ return dispatchChangeEvent(e, start_1 && end_1 ? "".concat(formatDate(start_1), " - ").concat(formatDate(end_1)) : "");
840
+ }
841
+ if (isAfter(start, end)) {
842
+ var _c = [start, end].sort(compareAsc), orderedStart = _c[0], orderedEnd = _c[1];
843
+ return dispatchChangeEvent(e, "".concat(formatDate(orderedStart), " - ").concat(formatDate(orderedEnd)));
844
+ }
845
+ }
846
+ };
847
+ var handleBlur = function (e) {
848
+ onBlur && onBlur(e);
849
+ if (selectionType === "single") {
850
+ handleSingleSelectionBlur(e);
851
+ }
852
+ if (selectionType === "range") {
853
+ handleRangeSelectionBlur(e);
854
+ }
855
+ };
856
+ var handleChange = function (e) {
857
+ onChange && onChange(e);
858
+ };
859
+ var handleCalendarOpenChange = function (isOpen) {
860
+ if (document.activeElement)
861
+ setShowCalendar(isOpen);
862
+ };
863
+ var handleIconClick = function () {
864
+ var _a;
865
+ !((_a = ourRef.current) === null || _a === void 0 ? void 0 : _a.contains(document.activeElement)) &&
866
+ !isDisabled &&
867
+ !isReadOnly &&
868
+ setShowCalendar(true);
869
+ };
870
+ var handleIconFocus = function () {
871
+ if (selectionType === "range" && isRangeValid(value)) {
872
+ var _a = convertRangeStringToDates(value), start = _a[0], end = _a[1];
873
+ return setAriaLabel("Change dates, currently selected dates are ".concat(format(start, "EEEE do MMMM, yyyy"), " to ").concat(format(end, "EEEE do MMMM, yyyy")));
874
+ }
875
+ if (selectionType === "single" && isDateValid(value)) {
876
+ var date = convertDateStringToDate(value);
877
+ return setAriaLabel("Change date, currently selected date is ".concat(format(date, "EEEE do MMMM, yyyy")));
878
+ }
879
+ setAriaLabel("Choose Date");
880
+ };
881
+ var handleCalendarClose = function () {
882
+ var _a, _b;
883
+ if (((_a = document.activeElement) === null || _a === void 0 ? void 0 : _a.tagName) === "BODY") {
884
+ (_b = buttonRef.current) === null || _b === void 0 ? void 0 : _b.focus();
885
+ }
886
+ };
887
+ var onCancelClick = function () {
888
+ setShowCalendar(false);
889
+ };
890
+ var handleAutoFocus = function (e) {
891
+ e.preventDefault();
892
+ };
893
+ return (React__default.createElement("div", { ref: setThemeElement, className: classNames({
894
+ "arc-DatePicker--constrained": !isFluid
895
+ }) },
896
+ React__default.createElement(TextInputWithPlaceHolder, __assign({ ref: getDatePickerRef, iconButton: {
897
+ onClick: handleIconClick,
898
+ onFocus: handleIconFocus,
899
+ icon: "datePickerCalendar",
900
+ label: ariaLabel,
901
+ ref: buttonRef
902
+ }, placeholder: placeHolder, errorMessage: errorMessage, helper: helper, id: id, isDisabled: isDisabled, isReadOnly: isReadOnly, isRequired: isRequired, label: label, labelSize: labelSize, maxLength: selectionType === "range" ? 23 : 10, name: name, onBlur: handleBlur, onChange: handleChange, onClickDisclosure: onClickDisclosure, type: "text", value: value, disclosureTitle: disclosureTitle, disclosureText: disclosureText, inputSize: inputSize }, props, filterDataAttrs(props))),
903
+ React__default.createElement(Root2, __assign({ open: showCalendar, onOpenChange: handleCalendarOpenChange }, filterDataAttrs(props)),
904
+ React__default.createElement(Anchor2, null),
905
+ React__default.createElement(Portal, { container: themeElement },
906
+ React__default.createElement(Content2, { align: "start", "aria-modal": "true", "aria-label": "Choose Date", className: "arc-DatePicker-modal", onOpenAutoFocus: handleAutoFocus, onCloseAutoFocus: handleCalendarClose },
907
+ React__default.createElement(Calendar, { autoFocusOnMount: true, type: type, onCancelClick: onCancelClick, selectionType: selectionType, selectedDate: convertDateStringToDate(value), selectedRange: convertRangeStringToDates(value), disabledDates: disabledDates, minDate: minDate, maxDate: maxDate, onDateSelect: handleDateSelect, onRangeSelect: handleRangeSelect }))))));
908
+ });
909
+
910
+ export { DATE_FORMAT as D, parseDateString as a, isDateValid as b, DatePicker as c, isRangeValid as i, parseRangeString as p };