@arc-ui/components 11.5.0 → 11.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (315) hide show
  1. package/dist/Alert/Alert.cjs.d.ts +1 -1
  2. package/dist/Alert/Alert.cjs.js +4 -4
  3. package/dist/Alert/Alert.esm.d.ts +1 -1
  4. package/dist/Alert/Alert.esm.js +4 -4
  5. package/dist/Badge/Badge.cjs.js +2 -2
  6. package/dist/Badge/Badge.esm.js +2 -2
  7. package/dist/Box/Box.cjs.d.ts +1 -0
  8. package/dist/Box/Box.cjs.js +13 -0
  9. package/dist/Box/Box.esm.d.ts +1 -0
  10. package/dist/Box/Box.esm.js +5 -0
  11. package/dist/Box/package.json +7 -0
  12. package/dist/BrandLogo/BrandLogo.cjs.d.ts +1 -1
  13. package/dist/BrandLogo/BrandLogo.cjs.js +2 -2
  14. package/dist/BrandLogo/BrandLogo.esm.d.ts +1 -1
  15. package/dist/BrandLogo/BrandLogo.esm.js +2 -2
  16. package/dist/Breadcrumbs/Breadcrumbs.cjs.d.ts +1 -61
  17. package/dist/Breadcrumbs/Breadcrumbs.cjs.js +10 -642
  18. package/dist/Breadcrumbs/Breadcrumbs.esm.d.ts +1 -61
  19. package/dist/Breadcrumbs/Breadcrumbs.esm.js +9 -641
  20. package/dist/Button/Button.cjs.d.ts +1 -1
  21. package/dist/Button/Button.cjs.js +4 -3
  22. package/dist/Button/Button.esm.d.ts +1 -1
  23. package/dist/Button/Button.esm.js +4 -3
  24. package/dist/Card/Card.cjs.d.ts +1 -130
  25. package/dist/Card/Card.cjs.js +12 -119
  26. package/dist/Card/Card.esm.d.ts +1 -130
  27. package/dist/Card/Card.esm.js +11 -118
  28. package/dist/Checkbox/Checkbox.cjs.d.ts +1 -64
  29. package/dist/Checkbox/Checkbox.cjs.js +11 -60
  30. package/dist/Checkbox/Checkbox.esm.d.ts +1 -64
  31. package/dist/Checkbox/Checkbox.esm.js +10 -59
  32. package/dist/Columns/Columns.cjs.d.ts +1 -76
  33. package/dist/Columns/Columns.cjs.js +6 -52
  34. package/dist/Columns/Columns.esm.d.ts +1 -76
  35. package/dist/Columns/Columns.esm.js +5 -51
  36. package/dist/Disclosure/Disclosure.cjs.d.ts +1 -1
  37. package/dist/Disclosure/Disclosure.cjs.js +2 -2
  38. package/dist/Disclosure/Disclosure.esm.d.ts +1 -1
  39. package/dist/Disclosure/Disclosure.esm.js +2 -2
  40. package/dist/DisclosureMini/DisclosureMini.cjs.d.ts +1 -1
  41. package/dist/DisclosureMini/DisclosureMini.cjs.js +3 -3
  42. package/dist/DisclosureMini/DisclosureMini.esm.d.ts +1 -1
  43. package/dist/DisclosureMini/DisclosureMini.esm.js +3 -3
  44. package/dist/Filter/Filter.cjs.d.ts +1 -0
  45. package/dist/Filter/Filter.cjs.js +13 -0
  46. package/dist/Filter/Filter.esm.d.ts +1 -0
  47. package/dist/Filter/Filter.esm.js +5 -0
  48. package/dist/Filter/package.json +7 -0
  49. package/dist/FormControl/FormControl.cjs.d.ts +1 -1
  50. package/dist/FormControl/FormControl.cjs.js +4 -5
  51. package/dist/FormControl/FormControl.esm.d.ts +1 -1
  52. package/dist/FormControl/FormControl.esm.js +4 -5
  53. package/dist/Group/Group.cjs.d.ts +1 -46
  54. package/dist/Group/Group.cjs.js +6 -43
  55. package/dist/Group/Group.esm.d.ts +1 -46
  56. package/dist/Group/Group.esm.js +5 -42
  57. package/dist/Heading/Heading.cjs.d.ts +1 -1
  58. package/dist/Heading/Heading.cjs.js +2 -2
  59. package/dist/Heading/Heading.esm.d.ts +1 -1
  60. package/dist/Heading/Heading.esm.js +2 -2
  61. package/dist/Icon/Icon.cjs.d.ts +1 -1
  62. package/dist/Icon/Icon.cjs.js +2 -2
  63. package/dist/Icon/Icon.esm.d.ts +1 -1
  64. package/dist/Icon/Icon.esm.js +2 -2
  65. package/dist/Image/Image.cjs.d.ts +1 -1
  66. package/dist/Image/Image.cjs.js +2 -1
  67. package/dist/Image/Image.esm.d.ts +1 -1
  68. package/dist/Image/Image.esm.js +1 -1
  69. package/dist/Markup/Markup.cjs.js +1 -1
  70. package/dist/Markup/Markup.esm.js +1 -1
  71. package/dist/MediaCard/MediaCard.cjs.d.ts +61 -0
  72. package/dist/MediaCard/MediaCard.cjs.js +31 -0
  73. package/dist/MediaCard/MediaCard.esm.d.ts +61 -0
  74. package/dist/MediaCard/MediaCard.esm.js +23 -0
  75. package/dist/MediaCard/package.json +7 -0
  76. package/dist/Modal/Modal.cjs.d.ts +31 -0
  77. package/dist/Modal/Modal.cjs.js +388 -0
  78. package/dist/Modal/Modal.esm.d.ts +31 -0
  79. package/dist/Modal/Modal.esm.js +380 -0
  80. package/dist/Modal/package.json +7 -0
  81. package/dist/Pagination/Pagination.cjs.d.ts +20 -0
  82. package/dist/Pagination/Pagination.cjs.js +87 -0
  83. package/dist/Pagination/Pagination.esm.d.ts +20 -0
  84. package/dist/Pagination/Pagination.esm.js +79 -0
  85. package/dist/Pagination/package.json +7 -0
  86. package/dist/PaginationSimple/PaginationSimple.cjs.d.ts +28 -0
  87. package/dist/PaginationSimple/PaginationSimple.cjs.js +47 -0
  88. package/dist/PaginationSimple/PaginationSimple.esm.d.ts +28 -0
  89. package/dist/PaginationSimple/PaginationSimple.esm.js +39 -0
  90. package/dist/PaginationSimple/package.json +7 -0
  91. package/dist/Poster/Poster.cjs.d.ts +1 -81
  92. package/dist/Poster/Poster.cjs.js +8 -45
  93. package/dist/Poster/Poster.esm.d.ts +1 -81
  94. package/dist/Poster/Poster.esm.js +7 -44
  95. package/dist/ProgressBar/ProgressBar.cjs.js +4 -4
  96. package/dist/ProgressBar/ProgressBar.esm.js +4 -4
  97. package/dist/ProgressStepper/ProgressStepper.cjs.d.ts +89 -0
  98. package/dist/ProgressStepper/ProgressStepper.cjs.js +152 -0
  99. package/dist/ProgressStepper/ProgressStepper.esm.d.ts +89 -0
  100. package/dist/ProgressStepper/ProgressStepper.esm.js +144 -0
  101. package/dist/ProgressStepper/package.json +7 -0
  102. package/dist/RadioGroup/RadioGroup.cjs.d.ts +1 -85
  103. package/dist/RadioGroup/RadioGroup.cjs.js +9 -68
  104. package/dist/RadioGroup/RadioGroup.esm.d.ts +1 -85
  105. package/dist/RadioGroup/RadioGroup.esm.js +8 -67
  106. package/dist/Rule/Rule.cjs.js +1 -1
  107. package/dist/Rule/Rule.esm.js +1 -1
  108. package/dist/ScrollToTop/ScrollToTop.cjs.d.ts +25 -0
  109. package/dist/ScrollToTop/ScrollToTop.cjs.js +68 -0
  110. package/dist/ScrollToTop/ScrollToTop.esm.d.ts +25 -0
  111. package/dist/ScrollToTop/ScrollToTop.esm.js +60 -0
  112. package/dist/ScrollToTop/package.json +7 -0
  113. package/dist/Select/Select.cjs.d.ts +2 -2
  114. package/dist/Select/Select.cjs.js +20 -1419
  115. package/dist/Select/Select.esm.d.ts +2 -2
  116. package/dist/Select/Select.esm.js +10 -1390
  117. package/dist/SiteFooter/SiteFooter.cjs.d.ts +2 -62
  118. package/dist/SiteFooter/SiteFooter.cjs.js +10 -65
  119. package/dist/SiteFooter/SiteFooter.esm.d.ts +2 -62
  120. package/dist/SiteFooter/SiteFooter.esm.js +12 -66
  121. package/dist/SiteHeader/SiteHeader.cjs.d.ts +2 -260
  122. package/dist/SiteHeader/SiteHeader.cjs.js +17 -669
  123. package/dist/SiteHeader/SiteHeader.esm.d.ts +2 -260
  124. package/dist/SiteHeader/SiteHeader.esm.js +15 -667
  125. package/dist/Surface/Surface.cjs.d.ts +1 -1
  126. package/dist/Surface/Surface.cjs.js +1 -1
  127. package/dist/Surface/Surface.esm.d.ts +1 -1
  128. package/dist/Surface/Surface.esm.js +1 -1
  129. package/dist/Switch/Switch.cjs.d.ts +2 -2
  130. package/dist/Switch/Switch.cjs.js +8 -7
  131. package/dist/Switch/Switch.esm.d.ts +2 -2
  132. package/dist/Switch/Switch.esm.js +7 -6
  133. package/dist/Tag/Tag.cjs.js +2 -2
  134. package/dist/Tag/Tag.esm.js +2 -2
  135. package/dist/Text/Text.cjs.d.ts +1 -1
  136. package/dist/Text/Text.cjs.js +2 -2
  137. package/dist/Text/Text.esm.d.ts +1 -1
  138. package/dist/Text/Text.esm.js +2 -2
  139. package/dist/TextArea/TextArea.cjs.d.ts +61 -0
  140. package/dist/TextArea/TextArea.cjs.js +87 -0
  141. package/dist/TextArea/TextArea.esm.d.ts +61 -0
  142. package/dist/TextArea/TextArea.esm.js +79 -0
  143. package/dist/TextArea/package.json +7 -0
  144. package/dist/TextInput/TextInput.cjs.d.ts +1 -75
  145. package/dist/TextInput/TextInput.cjs.js +10 -76
  146. package/dist/TextInput/TextInput.esm.d.ts +1 -75
  147. package/dist/TextInput/TextInput.esm.js +9 -75
  148. package/dist/UniversalHeader/UniversalHeader.cjs.d.ts +1 -26
  149. package/dist/UniversalHeader/UniversalHeader.cjs.js +5 -30
  150. package/dist/UniversalHeader/UniversalHeader.esm.d.ts +1 -26
  151. package/dist/UniversalHeader/UniversalHeader.esm.js +4 -29
  152. package/dist/_shared/cjs/Box-ebe2b7be.d.ts +39 -0
  153. package/dist/_shared/cjs/Box-ebe2b7be.js +30 -0
  154. package/dist/_shared/cjs/{BrandLogo-8008f0c4.js → BrandLogo-8107d59f.js} +1 -1
  155. package/dist/_shared/cjs/Breadcrumbs-9f580f69.d.ts +61 -0
  156. package/dist/_shared/cjs/Breadcrumbs-9f580f69.js +106 -0
  157. package/dist/_shared/cjs/BtIconChevronLeftMid-df952a3e.js +31 -0
  158. package/dist/_shared/cjs/{Button-5dff284a.js → Button-b4d6ccc8.js} +8 -29
  159. package/dist/_shared/cjs/Card-f1108bfe.d.ts +136 -0
  160. package/dist/_shared/cjs/Card-f1108bfe.js +124 -0
  161. package/dist/_shared/cjs/Checkbox-c927b62f.d.ts +64 -0
  162. package/dist/_shared/cjs/Checkbox-c927b62f.js +62 -0
  163. package/dist/_shared/cjs/Columns-e90798f8.d.ts +76 -0
  164. package/dist/_shared/cjs/Columns-e90798f8.js +57 -0
  165. package/dist/_shared/cjs/{DisclosureMini-5af13d3c.js → DisclosureMini-2a10006e.js} +5 -3
  166. package/dist/_shared/cjs/Filter-a7574fe7.d.ts +83 -0
  167. package/dist/_shared/cjs/Filter-a7574fe7.js +121 -0
  168. package/dist/_shared/{esm/FormControl-0744f93f.d.ts → cjs/FormControl-78b007b7.d.ts} +4 -0
  169. package/dist/_shared/cjs/{FormControl-42360ae8.js → FormControl-78b007b7.js} +10 -10
  170. package/dist/_shared/cjs/Group-f85dd4c0.d.ts +46 -0
  171. package/dist/_shared/cjs/Group-f85dd4c0.js +48 -0
  172. package/dist/_shared/cjs/{Heading-d45f6a7f.js → Heading-ed1cb455.js} +1 -1
  173. package/dist/_shared/cjs/{Icon-9ae8dbe1.js → Icon-e1dd45eb.js} +1 -1
  174. package/dist/_shared/cjs/{Image-3bf4b4f3.js → Image-0e393cbf.js} +2 -0
  175. package/dist/_shared/cjs/ItemGroup-5af4d600.d.ts +27 -0
  176. package/dist/_shared/cjs/NavItem-df20237c.d.ts +43 -0
  177. package/dist/_shared/cjs/NavItemWithSubNav-65f21828.d.ts +49 -0
  178. package/dist/_shared/cjs/Poster-faea1ad3.d.ts +81 -0
  179. package/dist/_shared/cjs/Poster-faea1ad3.js +50 -0
  180. package/dist/_shared/cjs/RadioGroup-8e17de70.d.ts +97 -0
  181. package/dist/_shared/cjs/RadioGroup-8e17de70.js +70 -0
  182. package/dist/_shared/cjs/SiteFooter-9f7f9c2d.d.ts +62 -0
  183. package/dist/_shared/cjs/SiteFooter-9f7f9c2d.js +73 -0
  184. package/dist/_shared/cjs/SiteHeader-c25ee36e.d.ts +78 -0
  185. package/dist/_shared/cjs/SiteHeader.rehydrator-ccbebde6.d.ts +78 -0
  186. package/dist/_shared/cjs/SiteHeader.rehydrator-ccbebde6.js +673 -0
  187. package/dist/_shared/cjs/SubNavItem-a84d1bf4.d.ts +48 -0
  188. package/dist/_shared/cjs/{Surface-6da0a78e.d.ts → Surface-b7c51b2b.d.ts} +3 -2
  189. package/dist/_shared/cjs/{Surface-6da0a78e.js → Surface-b7c51b2b.js} +1 -1
  190. package/dist/_shared/cjs/{Text-6f2827e6.js → Text-555a29a4.js} +1 -1
  191. package/dist/_shared/cjs/TextInput-7ed03a48.d.ts +75 -0
  192. package/dist/_shared/cjs/TextInput-b768e346.d.ts +10 -0
  193. package/dist/_shared/cjs/TextInput-b768e346.js +78 -0
  194. package/dist/_shared/cjs/UniversalHeader-da622e1a.d.ts +26 -0
  195. package/dist/_shared/cjs/UniversalHeader-da622e1a.js +35 -0
  196. package/dist/_shared/cjs/debounce-506538c5.js +544 -0
  197. package/dist/_shared/cjs/index-31fbb076.js +1416 -0
  198. package/dist/_shared/cjs/index-699086a7.d.ts +2 -0
  199. package/dist/_shared/cjs/index-74488a9f.d.ts +2 -0
  200. package/dist/_shared/cjs/index-c81c9401.d.ts +3 -3
  201. package/dist/_shared/cjs/index-e340924e.d.ts +2 -0
  202. package/dist/_shared/cjs/index-e6d20018.d.ts +3 -0
  203. package/dist/_shared/cjs/index-eb06f640.d.ts +2 -0
  204. package/dist/_shared/cjs/index-f419cf04.d.ts +2 -0
  205. package/dist/_shared/cjs/index.module-5ea728f4.js +23 -0
  206. package/dist/_shared/cjs/{index.module-af7c85f2.js → index.module-9b87a34d.js} +84 -103
  207. package/dist/_shared/esm/Box-06d99d8a.d.ts +39 -0
  208. package/dist/_shared/esm/Box-06d99d8a.js +24 -0
  209. package/dist/_shared/esm/{BrandLogo-56699561.js → BrandLogo-9ec620e8.js} +1 -1
  210. package/dist/_shared/esm/Breadcrumbs-5dc0afa7.d.ts +61 -0
  211. package/dist/_shared/esm/Breadcrumbs-5dc0afa7.js +100 -0
  212. package/dist/_shared/esm/BtIconChevronLeftMid-9f4f3a3d.js +25 -0
  213. package/dist/_shared/esm/{Button-61241dd0.js → Button-9c3b0b11.js} +4 -25
  214. package/dist/_shared/esm/Card-79b6eae0.d.ts +136 -0
  215. package/dist/_shared/esm/Card-79b6eae0.js +118 -0
  216. package/dist/_shared/esm/Checkbox-2d144384.d.ts +64 -0
  217. package/dist/_shared/esm/Checkbox-2d144384.js +56 -0
  218. package/dist/_shared/esm/Columns-8704515b.d.ts +76 -0
  219. package/dist/_shared/esm/Columns-8704515b.js +51 -0
  220. package/dist/_shared/esm/{DisclosureMini-322fccc0.js → DisclosureMini-78a8f392.js} +5 -3
  221. package/dist/_shared/esm/Filter-a01aed11.d.ts +83 -0
  222. package/dist/_shared/esm/Filter-a01aed11.js +115 -0
  223. package/dist/_shared/{cjs/FormControl-42360ae8.d.ts → esm/FormControl-2fa7aae5.d.ts} +4 -0
  224. package/dist/_shared/esm/{FormControl-0744f93f.js → FormControl-2fa7aae5.js} +10 -10
  225. package/dist/_shared/esm/Group-fb26fd32.d.ts +46 -0
  226. package/dist/_shared/esm/Group-fb26fd32.js +42 -0
  227. package/dist/_shared/esm/{Heading-b61432fb.js → Heading-ee6bec51.js} +1 -1
  228. package/dist/_shared/esm/{Icon-fd247973.js → Icon-c1af47bc.js} +1 -1
  229. package/dist/_shared/esm/{Image-3596ce55.js → Image-3ed3863c.js} +2 -1
  230. package/dist/_shared/esm/ItemGroup-5af4d600.d.ts +27 -0
  231. package/dist/_shared/esm/NavItem-df20237c.d.ts +43 -0
  232. package/dist/_shared/esm/NavItemWithSubNav-65f21828.d.ts +49 -0
  233. package/dist/_shared/esm/Poster-a83ae770.d.ts +81 -0
  234. package/dist/_shared/esm/Poster-a83ae770.js +44 -0
  235. package/dist/_shared/esm/RadioGroup-65b8c8bf.d.ts +97 -0
  236. package/dist/_shared/esm/RadioGroup-65b8c8bf.js +64 -0
  237. package/dist/_shared/esm/SiteFooter-51bdc7df.d.ts +62 -0
  238. package/dist/_shared/esm/SiteFooter-51bdc7df.js +67 -0
  239. package/dist/_shared/esm/SiteHeader-c25ee36e.d.ts +78 -0
  240. package/dist/_shared/esm/SiteHeader.rehydrator-382d1c03.d.ts +78 -0
  241. package/dist/_shared/esm/SiteHeader.rehydrator-382d1c03.js +666 -0
  242. package/dist/_shared/esm/SubNavItem-a84d1bf4.d.ts +48 -0
  243. package/dist/_shared/esm/{Surface-bb100ef8.d.ts → Surface-dde51789.d.ts} +3 -2
  244. package/dist/_shared/esm/{Surface-bb100ef8.js → Surface-dde51789.js} +1 -1
  245. package/dist/_shared/esm/{Text-00e9743b.js → Text-14deb70e.js} +1 -1
  246. package/dist/_shared/esm/TextInput-62bb7dee.d.ts +10 -0
  247. package/dist/_shared/esm/TextInput-62bb7dee.js +72 -0
  248. package/dist/_shared/esm/TextInput-7ed03a48.d.ts +75 -0
  249. package/dist/_shared/esm/UniversalHeader-1c5a886d.d.ts +26 -0
  250. package/dist/_shared/esm/UniversalHeader-1c5a886d.js +29 -0
  251. package/dist/_shared/esm/debounce-e228705f.js +542 -0
  252. package/dist/_shared/esm/index-4fa635bd.js +1386 -0
  253. package/dist/_shared/esm/index-699086a7.d.ts +2 -0
  254. package/dist/_shared/esm/index-74488a9f.d.ts +2 -0
  255. package/dist/_shared/esm/index-c81c9401.d.ts +3 -3
  256. package/dist/_shared/esm/index-e340924e.d.ts +2 -0
  257. package/dist/_shared/esm/index-e6d20018.d.ts +3 -0
  258. package/dist/_shared/esm/index-eb06f640.d.ts +2 -0
  259. package/dist/_shared/esm/index-f419cf04.d.ts +2 -0
  260. package/dist/_shared/esm/{index.module-599b86dd.js → index.module-216016b5.js} +86 -104
  261. package/dist/_shared/esm/index.module-88179159.js +21 -0
  262. package/dist/index.es.js +179 -28
  263. package/dist/index.es.js.map +1 -1
  264. package/dist/index.js +180 -27
  265. package/dist/index.js.map +1 -1
  266. package/dist/styles.css +1 -1
  267. package/dist/types/components/Box/Box.d.ts +36 -0
  268. package/dist/types/components/Box/index.d.ts +1 -0
  269. package/dist/types/components/Filter/Filter.d.ts +38 -0
  270. package/dist/types/components/Filter/FilterControls/FilterControl/FilterControl.d.ts +16 -0
  271. package/dist/types/components/Filter/FilterControls/FilterControls.d.ts +12 -0
  272. package/dist/types/components/Filter/FilterItems/FilterItem/FilterItem.d.ts +12 -0
  273. package/dist/types/components/Filter/FilterItems/FilterItems.d.ts +12 -0
  274. package/dist/types/components/Filter/index.d.ts +1 -0
  275. package/dist/types/components/FormControl/FormControl.d.ts +4 -0
  276. package/dist/types/components/Image/index.d.ts +1 -1
  277. package/dist/types/components/MediaCard/MediaCard.d.ts +57 -0
  278. package/dist/types/components/MediaCard/index.d.ts +1 -0
  279. package/dist/types/components/Modal/Modal.stories-wip.d.ts +9 -0
  280. package/dist/types/components/Pagination/Pagination.d.ts +19 -0
  281. package/dist/types/components/Pagination/index.d.ts +1 -0
  282. package/dist/types/components/PaginationSimple/PaginationSimple.d.ts +27 -0
  283. package/dist/types/components/PaginationSimple/index.d.ts +1 -0
  284. package/dist/types/components/ProgressStepper/ProgressStepper.d.ts +28 -0
  285. package/dist/types/components/ProgressStepper/ProgressStepperItem/ProgressStepperItem.d.ts +62 -0
  286. package/dist/types/components/ProgressStepper/index.d.ts +1 -0
  287. package/dist/types/components/ProgressStepper/progressStatus.d.ts +1 -0
  288. package/dist/types/components/RadioGroup/RadioGroup.d.ts +1 -1
  289. package/dist/types/components/ScrollToTop/ScrollToTop.d.ts +24 -0
  290. package/dist/types/components/ScrollToTop/index.d.ts +1 -0
  291. package/dist/types/components/Select/Select.d.ts +1 -1
  292. package/dist/types/components/Surface/Surface.d.ts +2 -1
  293. package/dist/types/components/Surface/index.d.ts +1 -1
  294. package/dist/types/components/Switch/Switch.d.ts +1 -1
  295. package/dist/types/components/TextArea/TextArea.d.ts +60 -0
  296. package/dist/types/components/TextArea/index.d.ts +1 -0
  297. package/dist/types/components/TextInput/TextInput.d.ts +1 -1
  298. package/dist/types/components/index.d.ts +2 -0
  299. package/dist/types/hooks/use-pagination.d.ts +1 -0
  300. package/dist/types/styles.d.ts +10 -0
  301. package/package.json +4 -4
  302. /package/dist/_shared/cjs/{BrandLogo-8008f0c4.d.ts → BrandLogo-8107d59f.d.ts} +0 -0
  303. /package/dist/_shared/cjs/{Button-5dff284a.d.ts → Button-b4d6ccc8.d.ts} +0 -0
  304. /package/dist/_shared/cjs/{DisclosureMini-5af13d3c.d.ts → DisclosureMini-2a10006e.d.ts} +0 -0
  305. /package/dist/_shared/cjs/{Heading-d45f6a7f.d.ts → Heading-ed1cb455.d.ts} +0 -0
  306. /package/dist/_shared/cjs/{Icon-9ae8dbe1.d.ts → Icon-e1dd45eb.d.ts} +0 -0
  307. /package/dist/_shared/cjs/{Image-3bf4b4f3.d.ts → Image-0e393cbf.d.ts} +0 -0
  308. /package/dist/_shared/cjs/{Text-6f2827e6.d.ts → Text-555a29a4.d.ts} +0 -0
  309. /package/dist/_shared/esm/{BrandLogo-56699561.d.ts → BrandLogo-9ec620e8.d.ts} +0 -0
  310. /package/dist/_shared/esm/{Button-61241dd0.d.ts → Button-9c3b0b11.d.ts} +0 -0
  311. /package/dist/_shared/esm/{DisclosureMini-322fccc0.d.ts → DisclosureMini-78a8f392.d.ts} +0 -0
  312. /package/dist/_shared/esm/{Heading-b61432fb.d.ts → Heading-ee6bec51.d.ts} +0 -0
  313. /package/dist/_shared/esm/{Icon-fd247973.d.ts → Icon-c1af47bc.d.ts} +0 -0
  314. /package/dist/_shared/esm/{Image-3596ce55.d.ts → Image-3ed3863c.d.ts} +0 -0
  315. /package/dist/_shared/esm/{Text-00e9743b.d.ts → Text-14deb70e.d.ts} +0 -0
@@ -0,0 +1,1386 @@
1
+ import * as React from 'react';
2
+ import { useEffect, forwardRef, useContext, useState, createElement, useRef, createContext, useCallback } from 'react';
3
+ import { a as $9f79659886946c16$export$e5c5a5f917a5871c, g as $b1b2314f5f9a1d84$export$25bec8c6f54ee79a, $ as $6ed0406888f73fc4$export$c7b2cbe3552a0d05, e as $8927f6f2acc4f386$export$250ffa63cdc0d034, _ as _extends, f as $e42e1063c40fb3ef$export$b9ecd428b558ff10, h as $8927f6f2acc4f386$export$6d1a0317bde7de7f } from './index.module-216016b5.js';
4
+ import $7SXl2$reactdom from 'react-dom';
5
+
6
+ const $1746a345f3d73bb7$var$useReactId = React['useId'.toString()] || (()=>undefined
7
+ );
8
+ let $1746a345f3d73bb7$var$count = 0;
9
+ function $1746a345f3d73bb7$export$f680877a34711e37(deterministicId) {
10
+ const [id, setId] = React.useState($1746a345f3d73bb7$var$useReactId()); // React versions older than 18 will have client-side ids only.
11
+ $9f79659886946c16$export$e5c5a5f917a5871c(()=>{
12
+ if (!deterministicId) setId((reactId)=>reactId !== null && reactId !== void 0 ? reactId : String($1746a345f3d73bb7$var$count++)
13
+ );
14
+ }, [
15
+ deterministicId
16
+ ]);
17
+ return deterministicId || (id ? `radix-${id}` : '');
18
+ }
19
+
20
+ /**
21
+ * Listens for when the escape key is down
22
+ */ function $addc16e1bbe58fd0$export$3a72a57244d6e765(onEscapeKeyDownProp, ownerDocument = globalThis === null || globalThis === void 0 ? void 0 : globalThis.document) {
23
+ const onEscapeKeyDown = $b1b2314f5f9a1d84$export$25bec8c6f54ee79a(onEscapeKeyDownProp);
24
+ useEffect(()=>{
25
+ const handleKeyDown = (event)=>{
26
+ if (event.key === 'Escape') onEscapeKeyDown(event);
27
+ };
28
+ ownerDocument.addEventListener('keydown', handleKeyDown);
29
+ return ()=>ownerDocument.removeEventListener('keydown', handleKeyDown)
30
+ ;
31
+ }, [
32
+ onEscapeKeyDown,
33
+ ownerDocument
34
+ ]);
35
+ }
36
+
37
+ const $5cb92bef7577960e$var$CONTEXT_UPDATE = 'dismissableLayer.update';
38
+ const $5cb92bef7577960e$var$POINTER_DOWN_OUTSIDE = 'dismissableLayer.pointerDownOutside';
39
+ const $5cb92bef7577960e$var$FOCUS_OUTSIDE = 'dismissableLayer.focusOutside';
40
+ let $5cb92bef7577960e$var$originalBodyPointerEvents;
41
+ const $5cb92bef7577960e$var$DismissableLayerContext = /*#__PURE__*/ createContext({
42
+ layers: new Set(),
43
+ layersWithOutsidePointerEventsDisabled: new Set(),
44
+ branches: new Set()
45
+ });
46
+ const $5cb92bef7577960e$export$177fb62ff3ec1f22 = /*#__PURE__*/ forwardRef((props, forwardedRef)=>{
47
+ var _node$ownerDocument;
48
+ const { disableOutsidePointerEvents: disableOutsidePointerEvents = false , onEscapeKeyDown: onEscapeKeyDown , onPointerDownOutside: onPointerDownOutside , onFocusOutside: onFocusOutside , onInteractOutside: onInteractOutside , onDismiss: onDismiss , ...layerProps } = props;
49
+ const context = useContext($5cb92bef7577960e$var$DismissableLayerContext);
50
+ const [node1, setNode] = useState(null);
51
+ const ownerDocument = (_node$ownerDocument = node1 === null || node1 === void 0 ? void 0 : node1.ownerDocument) !== null && _node$ownerDocument !== void 0 ? _node$ownerDocument : globalThis === null || globalThis === void 0 ? void 0 : globalThis.document;
52
+ const [, force] = useState({});
53
+ const composedRefs = $6ed0406888f73fc4$export$c7b2cbe3552a0d05(forwardedRef, (node)=>setNode(node)
54
+ );
55
+ const layers = Array.from(context.layers);
56
+ const [highestLayerWithOutsidePointerEventsDisabled] = [
57
+ ...context.layersWithOutsidePointerEventsDisabled
58
+ ].slice(-1); // prettier-ignore
59
+ const highestLayerWithOutsidePointerEventsDisabledIndex = layers.indexOf(highestLayerWithOutsidePointerEventsDisabled); // prettier-ignore
60
+ const index = node1 ? layers.indexOf(node1) : -1;
61
+ const isBodyPointerEventsDisabled = context.layersWithOutsidePointerEventsDisabled.size > 0;
62
+ const isPointerEventsEnabled = index >= highestLayerWithOutsidePointerEventsDisabledIndex;
63
+ const pointerDownOutside = $5cb92bef7577960e$var$usePointerDownOutside((event)=>{
64
+ const target = event.target;
65
+ const isPointerDownOnBranch = [
66
+ ...context.branches
67
+ ].some((branch)=>branch.contains(target)
68
+ );
69
+ if (!isPointerEventsEnabled || isPointerDownOnBranch) return;
70
+ onPointerDownOutside === null || onPointerDownOutside === void 0 || onPointerDownOutside(event);
71
+ onInteractOutside === null || onInteractOutside === void 0 || onInteractOutside(event);
72
+ if (!event.defaultPrevented) onDismiss === null || onDismiss === void 0 || onDismiss();
73
+ }, ownerDocument);
74
+ const focusOutside = $5cb92bef7577960e$var$useFocusOutside((event)=>{
75
+ const target = event.target;
76
+ const isFocusInBranch = [
77
+ ...context.branches
78
+ ].some((branch)=>branch.contains(target)
79
+ );
80
+ if (isFocusInBranch) return;
81
+ onFocusOutside === null || onFocusOutside === void 0 || onFocusOutside(event);
82
+ onInteractOutside === null || onInteractOutside === void 0 || onInteractOutside(event);
83
+ if (!event.defaultPrevented) onDismiss === null || onDismiss === void 0 || onDismiss();
84
+ }, ownerDocument);
85
+ $addc16e1bbe58fd0$export$3a72a57244d6e765((event)=>{
86
+ const isHighestLayer = index === context.layers.size - 1;
87
+ if (!isHighestLayer) return;
88
+ onEscapeKeyDown === null || onEscapeKeyDown === void 0 || onEscapeKeyDown(event);
89
+ if (!event.defaultPrevented && onDismiss) {
90
+ event.preventDefault();
91
+ onDismiss();
92
+ }
93
+ }, ownerDocument);
94
+ useEffect(()=>{
95
+ if (!node1) return;
96
+ if (disableOutsidePointerEvents) {
97
+ if (context.layersWithOutsidePointerEventsDisabled.size === 0) {
98
+ $5cb92bef7577960e$var$originalBodyPointerEvents = ownerDocument.body.style.pointerEvents;
99
+ ownerDocument.body.style.pointerEvents = 'none';
100
+ }
101
+ context.layersWithOutsidePointerEventsDisabled.add(node1);
102
+ }
103
+ context.layers.add(node1);
104
+ $5cb92bef7577960e$var$dispatchUpdate();
105
+ return ()=>{
106
+ if (disableOutsidePointerEvents && context.layersWithOutsidePointerEventsDisabled.size === 1) ownerDocument.body.style.pointerEvents = $5cb92bef7577960e$var$originalBodyPointerEvents;
107
+ };
108
+ }, [
109
+ node1,
110
+ ownerDocument,
111
+ disableOutsidePointerEvents,
112
+ context
113
+ ]);
114
+ /**
115
+ * We purposefully prevent combining this effect with the `disableOutsidePointerEvents` effect
116
+ * because a change to `disableOutsidePointerEvents` would remove this layer from the stack
117
+ * and add it to the end again so the layering order wouldn't be _creation order_.
118
+ * We only want them to be removed from context stacks when unmounted.
119
+ */ useEffect(()=>{
120
+ return ()=>{
121
+ if (!node1) return;
122
+ context.layers.delete(node1);
123
+ context.layersWithOutsidePointerEventsDisabled.delete(node1);
124
+ $5cb92bef7577960e$var$dispatchUpdate();
125
+ };
126
+ }, [
127
+ node1,
128
+ context
129
+ ]);
130
+ useEffect(()=>{
131
+ const handleUpdate = ()=>force({})
132
+ ;
133
+ document.addEventListener($5cb92bef7577960e$var$CONTEXT_UPDATE, handleUpdate);
134
+ return ()=>document.removeEventListener($5cb92bef7577960e$var$CONTEXT_UPDATE, handleUpdate)
135
+ ;
136
+ }, []);
137
+ return /*#__PURE__*/ createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.div, _extends({}, layerProps, {
138
+ ref: composedRefs,
139
+ style: {
140
+ pointerEvents: isBodyPointerEventsDisabled ? isPointerEventsEnabled ? 'auto' : 'none' : undefined,
141
+ ...props.style
142
+ },
143
+ onFocusCapture: $e42e1063c40fb3ef$export$b9ecd428b558ff10(props.onFocusCapture, focusOutside.onFocusCapture),
144
+ onBlurCapture: $e42e1063c40fb3ef$export$b9ecd428b558ff10(props.onBlurCapture, focusOutside.onBlurCapture),
145
+ onPointerDownCapture: $e42e1063c40fb3ef$export$b9ecd428b558ff10(props.onPointerDownCapture, pointerDownOutside.onPointerDownCapture)
146
+ }));
147
+ });
148
+ /* -----------------------------------------------------------------------------------------------*/ /**
149
+ * Listens for `pointerdown` outside a react subtree. We use `pointerdown` rather than `pointerup`
150
+ * to mimic layer dismissing behaviour present in OS.
151
+ * Returns props to pass to the node we want to check for outside events.
152
+ */ function $5cb92bef7577960e$var$usePointerDownOutside(onPointerDownOutside, ownerDocument = globalThis === null || globalThis === void 0 ? void 0 : globalThis.document) {
153
+ const handlePointerDownOutside = $b1b2314f5f9a1d84$export$25bec8c6f54ee79a(onPointerDownOutside);
154
+ const isPointerInsideReactTreeRef = useRef(false);
155
+ const handleClickRef = useRef(()=>{});
156
+ useEffect(()=>{
157
+ const handlePointerDown = (event)=>{
158
+ if (event.target && !isPointerInsideReactTreeRef.current) {
159
+ const eventDetail = {
160
+ originalEvent: event
161
+ };
162
+ function handleAndDispatchPointerDownOutsideEvent() {
163
+ $5cb92bef7577960e$var$handleAndDispatchCustomEvent($5cb92bef7577960e$var$POINTER_DOWN_OUTSIDE, handlePointerDownOutside, eventDetail, {
164
+ discrete: true
165
+ });
166
+ }
167
+ /**
168
+ * On touch devices, we need to wait for a click event because browsers implement
169
+ * a ~350ms delay between the time the user stops touching the display and when the
170
+ * browser executres events. We need to ensure we don't reactivate pointer-events within
171
+ * this timeframe otherwise the browser may execute events that should have been prevented.
172
+ *
173
+ * Additionally, this also lets us deal automatically with cancellations when a click event
174
+ * isn't raised because the page was considered scrolled/drag-scrolled, long-pressed, etc.
175
+ *
176
+ * This is why we also continuously remove the previous listener, because we cannot be
177
+ * certain that it was raised, and therefore cleaned-up.
178
+ */ if (event.pointerType === 'touch') {
179
+ ownerDocument.removeEventListener('click', handleClickRef.current);
180
+ handleClickRef.current = handleAndDispatchPointerDownOutsideEvent;
181
+ ownerDocument.addEventListener('click', handleClickRef.current, {
182
+ once: true
183
+ });
184
+ } else handleAndDispatchPointerDownOutsideEvent();
185
+ }
186
+ isPointerInsideReactTreeRef.current = false;
187
+ };
188
+ /**
189
+ * if this hook executes in a component that mounts via a `pointerdown` event, the event
190
+ * would bubble up to the document and trigger a `pointerDownOutside` event. We avoid
191
+ * this by delaying the event listener registration on the document.
192
+ * This is not React specific, but rather how the DOM works, ie:
193
+ * ```
194
+ * button.addEventListener('pointerdown', () => {
195
+ * console.log('I will log');
196
+ * document.addEventListener('pointerdown', () => {
197
+ * console.log('I will also log');
198
+ * })
199
+ * });
200
+ */ const timerId = window.setTimeout(()=>{
201
+ ownerDocument.addEventListener('pointerdown', handlePointerDown);
202
+ }, 0);
203
+ return ()=>{
204
+ window.clearTimeout(timerId);
205
+ ownerDocument.removeEventListener('pointerdown', handlePointerDown);
206
+ ownerDocument.removeEventListener('click', handleClickRef.current);
207
+ };
208
+ }, [
209
+ ownerDocument,
210
+ handlePointerDownOutside
211
+ ]);
212
+ return {
213
+ // ensures we check React component tree (not just DOM tree)
214
+ onPointerDownCapture: ()=>isPointerInsideReactTreeRef.current = true
215
+ };
216
+ }
217
+ /**
218
+ * Listens for when focus happens outside a react subtree.
219
+ * Returns props to pass to the root (node) of the subtree we want to check.
220
+ */ function $5cb92bef7577960e$var$useFocusOutside(onFocusOutside, ownerDocument = globalThis === null || globalThis === void 0 ? void 0 : globalThis.document) {
221
+ const handleFocusOutside = $b1b2314f5f9a1d84$export$25bec8c6f54ee79a(onFocusOutside);
222
+ const isFocusInsideReactTreeRef = useRef(false);
223
+ useEffect(()=>{
224
+ const handleFocus = (event)=>{
225
+ if (event.target && !isFocusInsideReactTreeRef.current) {
226
+ const eventDetail = {
227
+ originalEvent: event
228
+ };
229
+ $5cb92bef7577960e$var$handleAndDispatchCustomEvent($5cb92bef7577960e$var$FOCUS_OUTSIDE, handleFocusOutside, eventDetail, {
230
+ discrete: false
231
+ });
232
+ }
233
+ };
234
+ ownerDocument.addEventListener('focusin', handleFocus);
235
+ return ()=>ownerDocument.removeEventListener('focusin', handleFocus)
236
+ ;
237
+ }, [
238
+ ownerDocument,
239
+ handleFocusOutside
240
+ ]);
241
+ return {
242
+ onFocusCapture: ()=>isFocusInsideReactTreeRef.current = true
243
+ ,
244
+ onBlurCapture: ()=>isFocusInsideReactTreeRef.current = false
245
+ };
246
+ }
247
+ function $5cb92bef7577960e$var$dispatchUpdate() {
248
+ const event = new CustomEvent($5cb92bef7577960e$var$CONTEXT_UPDATE);
249
+ document.dispatchEvent(event);
250
+ }
251
+ function $5cb92bef7577960e$var$handleAndDispatchCustomEvent(name, handler, detail, { discrete: discrete }) {
252
+ const target = detail.originalEvent.target;
253
+ const event = new CustomEvent(name, {
254
+ bubbles: false,
255
+ cancelable: true,
256
+ detail: detail
257
+ });
258
+ if (handler) target.addEventListener(name, handler, {
259
+ once: true
260
+ });
261
+ if (discrete) $8927f6f2acc4f386$export$6d1a0317bde7de7f(target, event);
262
+ else target.dispatchEvent(event);
263
+ }
264
+
265
+ const $d3863c46a17e8a28$var$AUTOFOCUS_ON_MOUNT = 'focusScope.autoFocusOnMount';
266
+ const $d3863c46a17e8a28$var$AUTOFOCUS_ON_UNMOUNT = 'focusScope.autoFocusOnUnmount';
267
+ const $d3863c46a17e8a28$var$EVENT_OPTIONS = {
268
+ bubbles: false,
269
+ cancelable: true
270
+ };
271
+ const $d3863c46a17e8a28$export$20e40289641fbbb6 = /*#__PURE__*/ forwardRef((props, forwardedRef)=>{
272
+ const { loop: loop = false , trapped: trapped = false , onMountAutoFocus: onMountAutoFocusProp , onUnmountAutoFocus: onUnmountAutoFocusProp , ...scopeProps } = props;
273
+ const [container1, setContainer] = useState(null);
274
+ const onMountAutoFocus = $b1b2314f5f9a1d84$export$25bec8c6f54ee79a(onMountAutoFocusProp);
275
+ const onUnmountAutoFocus = $b1b2314f5f9a1d84$export$25bec8c6f54ee79a(onUnmountAutoFocusProp);
276
+ const lastFocusedElementRef = useRef(null);
277
+ const composedRefs = $6ed0406888f73fc4$export$c7b2cbe3552a0d05(forwardedRef, (node)=>setContainer(node)
278
+ );
279
+ const focusScope = useRef({
280
+ paused: false,
281
+ pause () {
282
+ this.paused = true;
283
+ },
284
+ resume () {
285
+ this.paused = false;
286
+ }
287
+ }).current; // Takes care of trapping focus if focus is moved outside programmatically for example
288
+ useEffect(()=>{
289
+ if (trapped) {
290
+ function handleFocusIn(event) {
291
+ if (focusScope.paused || !container1) return;
292
+ const target = event.target;
293
+ if (container1.contains(target)) lastFocusedElementRef.current = target;
294
+ else $d3863c46a17e8a28$var$focus(lastFocusedElementRef.current, {
295
+ select: true
296
+ });
297
+ }
298
+ function handleFocusOut(event) {
299
+ if (focusScope.paused || !container1) return;
300
+ if (!container1.contains(event.relatedTarget)) $d3863c46a17e8a28$var$focus(lastFocusedElementRef.current, {
301
+ select: true
302
+ });
303
+ }
304
+ document.addEventListener('focusin', handleFocusIn);
305
+ document.addEventListener('focusout', handleFocusOut);
306
+ return ()=>{
307
+ document.removeEventListener('focusin', handleFocusIn);
308
+ document.removeEventListener('focusout', handleFocusOut);
309
+ };
310
+ }
311
+ }, [
312
+ trapped,
313
+ container1,
314
+ focusScope.paused
315
+ ]);
316
+ useEffect(()=>{
317
+ if (container1) {
318
+ $d3863c46a17e8a28$var$focusScopesStack.add(focusScope);
319
+ const previouslyFocusedElement = document.activeElement;
320
+ const hasFocusedCandidate = container1.contains(previouslyFocusedElement);
321
+ if (!hasFocusedCandidate) {
322
+ const mountEvent = new CustomEvent($d3863c46a17e8a28$var$AUTOFOCUS_ON_MOUNT, $d3863c46a17e8a28$var$EVENT_OPTIONS);
323
+ container1.addEventListener($d3863c46a17e8a28$var$AUTOFOCUS_ON_MOUNT, onMountAutoFocus);
324
+ container1.dispatchEvent(mountEvent);
325
+ if (!mountEvent.defaultPrevented) {
326
+ $d3863c46a17e8a28$var$focusFirst($d3863c46a17e8a28$var$removeLinks($d3863c46a17e8a28$var$getTabbableCandidates(container1)), {
327
+ select: true
328
+ });
329
+ if (document.activeElement === previouslyFocusedElement) $d3863c46a17e8a28$var$focus(container1);
330
+ }
331
+ }
332
+ return ()=>{
333
+ container1.removeEventListener($d3863c46a17e8a28$var$AUTOFOCUS_ON_MOUNT, onMountAutoFocus); // We hit a react bug (fixed in v17) with focusing in unmount.
334
+ // We need to delay the focus a little to get around it for now.
335
+ // See: https://github.com/facebook/react/issues/17894
336
+ setTimeout(()=>{
337
+ const unmountEvent = new CustomEvent($d3863c46a17e8a28$var$AUTOFOCUS_ON_UNMOUNT, $d3863c46a17e8a28$var$EVENT_OPTIONS);
338
+ container1.addEventListener($d3863c46a17e8a28$var$AUTOFOCUS_ON_UNMOUNT, onUnmountAutoFocus);
339
+ container1.dispatchEvent(unmountEvent);
340
+ if (!unmountEvent.defaultPrevented) $d3863c46a17e8a28$var$focus(previouslyFocusedElement !== null && previouslyFocusedElement !== void 0 ? previouslyFocusedElement : document.body, {
341
+ select: true
342
+ });
343
+ // we need to remove the listener after we `dispatchEvent`
344
+ container1.removeEventListener($d3863c46a17e8a28$var$AUTOFOCUS_ON_UNMOUNT, onUnmountAutoFocus);
345
+ $d3863c46a17e8a28$var$focusScopesStack.remove(focusScope);
346
+ }, 0);
347
+ };
348
+ }
349
+ }, [
350
+ container1,
351
+ onMountAutoFocus,
352
+ onUnmountAutoFocus,
353
+ focusScope
354
+ ]); // Takes care of looping focus (when tabbing whilst at the edges)
355
+ const handleKeyDown = useCallback((event)=>{
356
+ if (!loop && !trapped) return;
357
+ if (focusScope.paused) return;
358
+ const isTabKey = event.key === 'Tab' && !event.altKey && !event.ctrlKey && !event.metaKey;
359
+ const focusedElement = document.activeElement;
360
+ if (isTabKey && focusedElement) {
361
+ const container = event.currentTarget;
362
+ const [first, last] = $d3863c46a17e8a28$var$getTabbableEdges(container);
363
+ const hasTabbableElementsInside = first && last; // we can only wrap focus if we have tabbable edges
364
+ if (!hasTabbableElementsInside) {
365
+ if (focusedElement === container) event.preventDefault();
366
+ } else {
367
+ if (!event.shiftKey && focusedElement === last) {
368
+ event.preventDefault();
369
+ if (loop) $d3863c46a17e8a28$var$focus(first, {
370
+ select: true
371
+ });
372
+ } else if (event.shiftKey && focusedElement === first) {
373
+ event.preventDefault();
374
+ if (loop) $d3863c46a17e8a28$var$focus(last, {
375
+ select: true
376
+ });
377
+ }
378
+ }
379
+ }
380
+ }, [
381
+ loop,
382
+ trapped,
383
+ focusScope.paused
384
+ ]);
385
+ return /*#__PURE__*/ createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.div, _extends({
386
+ tabIndex: -1
387
+ }, scopeProps, {
388
+ ref: composedRefs,
389
+ onKeyDown: handleKeyDown
390
+ }));
391
+ });
392
+ /* -------------------------------------------------------------------------------------------------
393
+ * Utils
394
+ * -----------------------------------------------------------------------------------------------*/ /**
395
+ * Attempts focusing the first element in a list of candidates.
396
+ * Stops when focus has actually moved.
397
+ */ function $d3863c46a17e8a28$var$focusFirst(candidates, { select: select = false } = {}) {
398
+ const previouslyFocusedElement = document.activeElement;
399
+ for (const candidate of candidates){
400
+ $d3863c46a17e8a28$var$focus(candidate, {
401
+ select: select
402
+ });
403
+ if (document.activeElement !== previouslyFocusedElement) return;
404
+ }
405
+ }
406
+ /**
407
+ * Returns the first and last tabbable elements inside a container.
408
+ */ function $d3863c46a17e8a28$var$getTabbableEdges(container) {
409
+ const candidates = $d3863c46a17e8a28$var$getTabbableCandidates(container);
410
+ const first = $d3863c46a17e8a28$var$findVisible(candidates, container);
411
+ const last = $d3863c46a17e8a28$var$findVisible(candidates.reverse(), container);
412
+ return [
413
+ first,
414
+ last
415
+ ];
416
+ }
417
+ /**
418
+ * Returns a list of potential tabbable candidates.
419
+ *
420
+ * NOTE: This is only a close approximation. For example it doesn't take into account cases like when
421
+ * elements are not visible. This cannot be worked out easily by just reading a property, but rather
422
+ * necessitate runtime knowledge (computed styles, etc). We deal with these cases separately.
423
+ *
424
+ * See: https://developer.mozilla.org/en-US/docs/Web/API/TreeWalker
425
+ * Credit: https://github.com/discord/focus-layers/blob/master/src/util/wrapFocus.tsx#L1
426
+ */ function $d3863c46a17e8a28$var$getTabbableCandidates(container) {
427
+ const nodes = [];
428
+ const walker = document.createTreeWalker(container, NodeFilter.SHOW_ELEMENT, {
429
+ acceptNode: (node)=>{
430
+ const isHiddenInput = node.tagName === 'INPUT' && node.type === 'hidden';
431
+ if (node.disabled || node.hidden || isHiddenInput) return NodeFilter.FILTER_SKIP; // `.tabIndex` is not the same as the `tabindex` attribute. It works on the
432
+ // runtime's understanding of tabbability, so this automatically accounts
433
+ // for any kind of element that could be tabbed to.
434
+ return node.tabIndex >= 0 ? NodeFilter.FILTER_ACCEPT : NodeFilter.FILTER_SKIP;
435
+ }
436
+ });
437
+ while(walker.nextNode())nodes.push(walker.currentNode); // we do not take into account the order of nodes with positive `tabIndex` as it
438
+ // hinders accessibility to have tab order different from visual order.
439
+ return nodes;
440
+ }
441
+ /**
442
+ * Returns the first visible element in a list.
443
+ * NOTE: Only checks visibility up to the `container`.
444
+ */ function $d3863c46a17e8a28$var$findVisible(elements, container) {
445
+ for (const element of elements){
446
+ // we stop checking if it's hidden at the `container` level (excluding)
447
+ if (!$d3863c46a17e8a28$var$isHidden(element, {
448
+ upTo: container
449
+ })) return element;
450
+ }
451
+ }
452
+ function $d3863c46a17e8a28$var$isHidden(node, { upTo: upTo }) {
453
+ if (getComputedStyle(node).visibility === 'hidden') return true;
454
+ while(node){
455
+ // we stop at `upTo` (excluding it)
456
+ if (upTo !== undefined && node === upTo) return false;
457
+ if (getComputedStyle(node).display === 'none') return true;
458
+ node = node.parentElement;
459
+ }
460
+ return false;
461
+ }
462
+ function $d3863c46a17e8a28$var$isSelectableInput(element) {
463
+ return element instanceof HTMLInputElement && 'select' in element;
464
+ }
465
+ function $d3863c46a17e8a28$var$focus(element, { select: select = false } = {}) {
466
+ // only focus if that element is focusable
467
+ if (element && element.focus) {
468
+ const previouslyFocusedElement = document.activeElement; // NOTE: we prevent scrolling on focus, to minimize jarring transitions for users
469
+ element.focus({
470
+ preventScroll: true
471
+ }); // only select if its not the same element, it supports selection and we need to select
472
+ if (element !== previouslyFocusedElement && $d3863c46a17e8a28$var$isSelectableInput(element) && select) element.select();
473
+ }
474
+ }
475
+ /* -------------------------------------------------------------------------------------------------
476
+ * FocusScope stack
477
+ * -----------------------------------------------------------------------------------------------*/ const $d3863c46a17e8a28$var$focusScopesStack = $d3863c46a17e8a28$var$createFocusScopesStack();
478
+ function $d3863c46a17e8a28$var$createFocusScopesStack() {
479
+ /** A stack of focus scopes, with the active one at the top */ let stack = [];
480
+ return {
481
+ add (focusScope) {
482
+ // pause the currently active focus scope (at the top of the stack)
483
+ const activeFocusScope = stack[0];
484
+ if (focusScope !== activeFocusScope) activeFocusScope === null || activeFocusScope === void 0 || activeFocusScope.pause();
485
+ // remove in case it already exists (because we'll re-add it at the top of the stack)
486
+ stack = $d3863c46a17e8a28$var$arrayRemove(stack, focusScope);
487
+ stack.unshift(focusScope);
488
+ },
489
+ remove (focusScope) {
490
+ var _stack$;
491
+ stack = $d3863c46a17e8a28$var$arrayRemove(stack, focusScope);
492
+ (_stack$ = stack[0]) === null || _stack$ === void 0 || _stack$.resume();
493
+ }
494
+ };
495
+ }
496
+ function $d3863c46a17e8a28$var$arrayRemove(array, item) {
497
+ const updatedArray = [
498
+ ...array
499
+ ];
500
+ const index = updatedArray.indexOf(item);
501
+ if (index !== -1) updatedArray.splice(index, 1);
502
+ return updatedArray;
503
+ }
504
+ function $d3863c46a17e8a28$var$removeLinks(items) {
505
+ return items.filter((item)=>item.tagName !== 'A'
506
+ );
507
+ }
508
+
509
+ const $f1701beae083dbae$export$602eac185826482c = /*#__PURE__*/ forwardRef((props, forwardedRef)=>{
510
+ var _globalThis$document;
511
+ const { container: container = globalThis === null || globalThis === void 0 ? void 0 : (_globalThis$document = globalThis.document) === null || _globalThis$document === void 0 ? void 0 : _globalThis$document.body , ...portalProps } = props;
512
+ return container ? /*#__PURE__*/ $7SXl2$reactdom.createPortal(/*#__PURE__*/ createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.div, _extends({}, portalProps, {
513
+ ref: forwardedRef
514
+ })), container) : null;
515
+ });
516
+
517
+ /** Number of components which have requested interest to have focus guards */ let $3db38b7d1fb3fe6a$var$count = 0;
518
+ /**
519
+ * Injects a pair of focus guards at the edges of the whole DOM tree
520
+ * to ensure `focusin` & `focusout` events can be caught consistently.
521
+ */ function $3db38b7d1fb3fe6a$export$b7ece24a22aeda8c() {
522
+ useEffect(()=>{
523
+ var _edgeGuards$, _edgeGuards$2;
524
+ const edgeGuards = document.querySelectorAll('[data-radix-focus-guard]');
525
+ document.body.insertAdjacentElement('afterbegin', (_edgeGuards$ = edgeGuards[0]) !== null && _edgeGuards$ !== void 0 ? _edgeGuards$ : $3db38b7d1fb3fe6a$var$createFocusGuard());
526
+ document.body.insertAdjacentElement('beforeend', (_edgeGuards$2 = edgeGuards[1]) !== null && _edgeGuards$2 !== void 0 ? _edgeGuards$2 : $3db38b7d1fb3fe6a$var$createFocusGuard());
527
+ $3db38b7d1fb3fe6a$var$count++;
528
+ return ()=>{
529
+ if ($3db38b7d1fb3fe6a$var$count === 1) document.querySelectorAll('[data-radix-focus-guard]').forEach((node)=>node.remove()
530
+ );
531
+ $3db38b7d1fb3fe6a$var$count--;
532
+ };
533
+ }, []);
534
+ }
535
+ function $3db38b7d1fb3fe6a$var$createFocusGuard() {
536
+ const element = document.createElement('span');
537
+ element.setAttribute('data-radix-focus-guard', '');
538
+ element.tabIndex = 0;
539
+ element.style.cssText = 'outline: none; opacity: 0; position: fixed; pointer-events: none';
540
+ return element;
541
+ }
542
+
543
+ /******************************************************************************
544
+ Copyright (c) Microsoft Corporation.
545
+
546
+ Permission to use, copy, modify, and/or distribute this software for any
547
+ purpose with or without fee is hereby granted.
548
+
549
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
550
+ REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
551
+ AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
552
+ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
553
+ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
554
+ OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
555
+ PERFORMANCE OF THIS SOFTWARE.
556
+ ***************************************************************************** */
557
+
558
+ var __assign$1 = function() {
559
+ __assign$1 = Object.assign || function __assign(t) {
560
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
561
+ s = arguments[i];
562
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
563
+ }
564
+ return t;
565
+ };
566
+ return __assign$1.apply(this, arguments);
567
+ };
568
+
569
+ function __rest$1(s, e) {
570
+ var t = {};
571
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
572
+ t[p] = s[p];
573
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
574
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
575
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
576
+ t[p[i]] = s[p[i]];
577
+ }
578
+ return t;
579
+ }
580
+
581
+ function __spreadArray(to, from, pack) {
582
+ if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
583
+ if (ar || !(i in from)) {
584
+ if (!ar) ar = Array.prototype.slice.call(from, 0, i);
585
+ ar[i] = from[i];
586
+ }
587
+ }
588
+ return to.concat(ar || Array.prototype.slice.call(from));
589
+ }
590
+
591
+ var zeroRightClassName = 'right-scroll-bar-position';
592
+ var fullWidthClassName = 'width-before-scroll-bar';
593
+ var noScrollbarsClassName = 'with-scroll-bars-hidden';
594
+ /**
595
+ * Name of a CSS variable containing the amount of "hidden" scrollbar
596
+ * ! might be undefined ! use will fallback!
597
+ */
598
+ var removedBarSizeVariable = '--removed-body-scroll-bar-size';
599
+
600
+ /**
601
+ * Assigns a value for a given ref, no matter of the ref format
602
+ * @param {RefObject} ref - a callback function or ref object
603
+ * @param value - a new value
604
+ *
605
+ * @see https://github.com/theKashey/use-callback-ref#assignref
606
+ * @example
607
+ * const refObject = useRef();
608
+ * const refFn = (ref) => {....}
609
+ *
610
+ * assignRef(refObject, "refValue");
611
+ * assignRef(refFn, "refValue");
612
+ */
613
+ function assignRef(ref, value) {
614
+ if (typeof ref === 'function') {
615
+ ref(value);
616
+ }
617
+ else if (ref) {
618
+ ref.current = value;
619
+ }
620
+ return ref;
621
+ }
622
+
623
+ /**
624
+ * creates a MutableRef with ref change callback
625
+ * @param initialValue - initial ref value
626
+ * @param {Function} callback - a callback to run when value changes
627
+ *
628
+ * @example
629
+ * const ref = useCallbackRef(0, (newValue, oldValue) => console.log(oldValue, '->', newValue);
630
+ * ref.current = 1;
631
+ * // prints 0 -> 1
632
+ *
633
+ * @see https://reactjs.org/docs/hooks-reference.html#useref
634
+ * @see https://github.com/theKashey/use-callback-ref#usecallbackref---to-replace-reactuseref
635
+ * @returns {MutableRefObject}
636
+ */
637
+ function useCallbackRef(initialValue, callback) {
638
+ var ref = useState(function () { return ({
639
+ // value
640
+ value: initialValue,
641
+ // last callback
642
+ callback: callback,
643
+ // "memoized" public interface
644
+ facade: {
645
+ get current() {
646
+ return ref.value;
647
+ },
648
+ set current(value) {
649
+ var last = ref.value;
650
+ if (last !== value) {
651
+ ref.value = value;
652
+ ref.callback(value, last);
653
+ }
654
+ },
655
+ },
656
+ }); })[0];
657
+ // update callback
658
+ ref.callback = callback;
659
+ return ref.facade;
660
+ }
661
+
662
+ /**
663
+ * Merges two or more refs together providing a single interface to set their value
664
+ * @param {RefObject|Ref} refs
665
+ * @returns {MutableRefObject} - a new ref, which translates all changes to {refs}
666
+ *
667
+ * @see {@link mergeRefs} a version without buit-in memoization
668
+ * @see https://github.com/theKashey/use-callback-ref#usemergerefs
669
+ * @example
670
+ * const Component = React.forwardRef((props, ref) => {
671
+ * const ownRef = useRef();
672
+ * const domRef = useMergeRefs([ref, ownRef]); // 👈 merge together
673
+ * return <div ref={domRef}>...</div>
674
+ * }
675
+ */
676
+ function useMergeRefs(refs, defaultValue) {
677
+ return useCallbackRef(defaultValue || null, function (newValue) { return refs.forEach(function (ref) { return assignRef(ref, newValue); }); });
678
+ }
679
+
680
+ /*! *****************************************************************************
681
+ Copyright (c) Microsoft Corporation.
682
+
683
+ Permission to use, copy, modify, and/or distribute this software for any
684
+ purpose with or without fee is hereby granted.
685
+
686
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
687
+ REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
688
+ AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
689
+ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
690
+ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
691
+ OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
692
+ PERFORMANCE OF THIS SOFTWARE.
693
+ ***************************************************************************** */
694
+
695
+ var __assign = function() {
696
+ __assign = Object.assign || function __assign(t) {
697
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
698
+ s = arguments[i];
699
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
700
+ }
701
+ return t;
702
+ };
703
+ return __assign.apply(this, arguments);
704
+ };
705
+
706
+ function __rest(s, e) {
707
+ var t = {};
708
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
709
+ t[p] = s[p];
710
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
711
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
712
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
713
+ t[p[i]] = s[p[i]];
714
+ }
715
+ return t;
716
+ }
717
+
718
+ function ItoI(a) {
719
+ return a;
720
+ }
721
+ function innerCreateMedium(defaults, middleware) {
722
+ if (middleware === void 0) { middleware = ItoI; }
723
+ var buffer = [];
724
+ var assigned = false;
725
+ var medium = {
726
+ read: function () {
727
+ if (assigned) {
728
+ throw new Error('Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.');
729
+ }
730
+ if (buffer.length) {
731
+ return buffer[buffer.length - 1];
732
+ }
733
+ return defaults;
734
+ },
735
+ useMedium: function (data) {
736
+ var item = middleware(data, assigned);
737
+ buffer.push(item);
738
+ return function () {
739
+ buffer = buffer.filter(function (x) { return x !== item; });
740
+ };
741
+ },
742
+ assignSyncMedium: function (cb) {
743
+ assigned = true;
744
+ while (buffer.length) {
745
+ var cbs = buffer;
746
+ buffer = [];
747
+ cbs.forEach(cb);
748
+ }
749
+ buffer = {
750
+ push: function (x) { return cb(x); },
751
+ filter: function () { return buffer; },
752
+ };
753
+ },
754
+ assignMedium: function (cb) {
755
+ assigned = true;
756
+ var pendingQueue = [];
757
+ if (buffer.length) {
758
+ var cbs = buffer;
759
+ buffer = [];
760
+ cbs.forEach(cb);
761
+ pendingQueue = buffer;
762
+ }
763
+ var executeQueue = function () {
764
+ var cbs = pendingQueue;
765
+ pendingQueue = [];
766
+ cbs.forEach(cb);
767
+ };
768
+ var cycle = function () { return Promise.resolve().then(executeQueue); };
769
+ cycle();
770
+ buffer = {
771
+ push: function (x) {
772
+ pendingQueue.push(x);
773
+ cycle();
774
+ },
775
+ filter: function (filter) {
776
+ pendingQueue = pendingQueue.filter(filter);
777
+ return buffer;
778
+ },
779
+ };
780
+ },
781
+ };
782
+ return medium;
783
+ }
784
+ // eslint-disable-next-line @typescript-eslint/ban-types
785
+ function createSidecarMedium(options) {
786
+ if (options === void 0) { options = {}; }
787
+ var medium = innerCreateMedium(null);
788
+ medium.options = __assign({ async: true, ssr: false }, options);
789
+ return medium;
790
+ }
791
+
792
+ var SideCar$1 = function (_a) {
793
+ var sideCar = _a.sideCar, rest = __rest(_a, ["sideCar"]);
794
+ if (!sideCar) {
795
+ throw new Error('Sidecar: please provide `sideCar` property to import the right car');
796
+ }
797
+ var Target = sideCar.read();
798
+ if (!Target) {
799
+ throw new Error('Sidecar medium not found');
800
+ }
801
+ return React.createElement(Target, __assign({}, rest));
802
+ };
803
+ SideCar$1.isSideCarExport = true;
804
+ function exportSidecar(medium, exported) {
805
+ medium.useMedium(exported);
806
+ return SideCar$1;
807
+ }
808
+
809
+ var effectCar = createSidecarMedium();
810
+
811
+ var nothing = function () {
812
+ return;
813
+ };
814
+ /**
815
+ * Removes scrollbar from the page and contain the scroll within the Lock
816
+ */
817
+ var RemoveScroll = React.forwardRef(function (props, parentRef) {
818
+ var ref = React.useRef(null);
819
+ var _a = React.useState({
820
+ onScrollCapture: nothing,
821
+ onWheelCapture: nothing,
822
+ onTouchMoveCapture: nothing,
823
+ }), callbacks = _a[0], setCallbacks = _a[1];
824
+ var forwardProps = props.forwardProps, children = props.children, className = props.className, removeScrollBar = props.removeScrollBar, enabled = props.enabled, shards = props.shards, sideCar = props.sideCar, noIsolation = props.noIsolation, inert = props.inert, allowPinchZoom = props.allowPinchZoom, _b = props.as, Container = _b === void 0 ? 'div' : _b, rest = __rest$1(props, ["forwardProps", "children", "className", "removeScrollBar", "enabled", "shards", "sideCar", "noIsolation", "inert", "allowPinchZoom", "as"]);
825
+ var SideCar = sideCar;
826
+ var containerRef = useMergeRefs([ref, parentRef]);
827
+ var containerProps = __assign$1(__assign$1({}, rest), callbacks);
828
+ return (React.createElement(React.Fragment, null,
829
+ enabled && (React.createElement(SideCar, { sideCar: effectCar, removeScrollBar: removeScrollBar, shards: shards, noIsolation: noIsolation, inert: inert, setCallbacks: setCallbacks, allowPinchZoom: !!allowPinchZoom, lockRef: ref })),
830
+ forwardProps ? (React.cloneElement(React.Children.only(children), __assign$1(__assign$1({}, containerProps), { ref: containerRef }))) : (React.createElement(Container, __assign$1({}, containerProps, { className: className, ref: containerRef }), children))));
831
+ });
832
+ RemoveScroll.defaultProps = {
833
+ enabled: true,
834
+ removeScrollBar: true,
835
+ inert: false,
836
+ };
837
+ RemoveScroll.classNames = {
838
+ fullWidth: fullWidthClassName,
839
+ zeroRight: zeroRightClassName,
840
+ };
841
+
842
+ var getNonce = function () {
843
+ if (typeof __webpack_nonce__ !== 'undefined') {
844
+ return __webpack_nonce__;
845
+ }
846
+ return undefined;
847
+ };
848
+
849
+ function makeStyleTag() {
850
+ if (!document)
851
+ return null;
852
+ var tag = document.createElement('style');
853
+ tag.type = 'text/css';
854
+ var nonce = getNonce();
855
+ if (nonce) {
856
+ tag.setAttribute('nonce', nonce);
857
+ }
858
+ return tag;
859
+ }
860
+ function injectStyles(tag, css) {
861
+ // @ts-ignore
862
+ if (tag.styleSheet) {
863
+ // @ts-ignore
864
+ tag.styleSheet.cssText = css;
865
+ }
866
+ else {
867
+ tag.appendChild(document.createTextNode(css));
868
+ }
869
+ }
870
+ function insertStyleTag(tag) {
871
+ var head = document.head || document.getElementsByTagName('head')[0];
872
+ head.appendChild(tag);
873
+ }
874
+ var stylesheetSingleton = function () {
875
+ var counter = 0;
876
+ var stylesheet = null;
877
+ return {
878
+ add: function (style) {
879
+ if (counter == 0) {
880
+ if ((stylesheet = makeStyleTag())) {
881
+ injectStyles(stylesheet, style);
882
+ insertStyleTag(stylesheet);
883
+ }
884
+ }
885
+ counter++;
886
+ },
887
+ remove: function () {
888
+ counter--;
889
+ if (!counter && stylesheet) {
890
+ stylesheet.parentNode && stylesheet.parentNode.removeChild(stylesheet);
891
+ stylesheet = null;
892
+ }
893
+ },
894
+ };
895
+ };
896
+
897
+ /**
898
+ * creates a hook to control style singleton
899
+ * @see {@link styleSingleton} for a safer component version
900
+ * @example
901
+ * ```tsx
902
+ * const useStyle = styleHookSingleton();
903
+ * ///
904
+ * useStyle('body { overflow: hidden}');
905
+ */
906
+ var styleHookSingleton = function () {
907
+ var sheet = stylesheetSingleton();
908
+ return function (styles, isDynamic) {
909
+ React.useEffect(function () {
910
+ sheet.add(styles);
911
+ return function () {
912
+ sheet.remove();
913
+ };
914
+ }, [styles && isDynamic]);
915
+ };
916
+ };
917
+
918
+ /**
919
+ * create a Component to add styles on demand
920
+ * - styles are added when first instance is mounted
921
+ * - styles are removed when the last instance is unmounted
922
+ * - changing styles in runtime does nothing unless dynamic is set. But with multiple components that can lead to the undefined behavior
923
+ */
924
+ var styleSingleton = function () {
925
+ var useStyle = styleHookSingleton();
926
+ var Sheet = function (_a) {
927
+ var styles = _a.styles, dynamic = _a.dynamic;
928
+ useStyle(styles, dynamic);
929
+ return null;
930
+ };
931
+ return Sheet;
932
+ };
933
+
934
+ var zeroGap = {
935
+ left: 0,
936
+ top: 0,
937
+ right: 0,
938
+ gap: 0,
939
+ };
940
+ var parse = function (x) { return parseInt(x || '', 10) || 0; };
941
+ var getOffset = function (gapMode) {
942
+ var cs = window.getComputedStyle(document.body);
943
+ var left = cs[gapMode === 'padding' ? 'paddingLeft' : 'marginLeft'];
944
+ var top = cs[gapMode === 'padding' ? 'paddingTop' : 'marginTop'];
945
+ var right = cs[gapMode === 'padding' ? 'paddingRight' : 'marginRight'];
946
+ return [parse(left), parse(top), parse(right)];
947
+ };
948
+ var getGapWidth = function (gapMode) {
949
+ if (gapMode === void 0) { gapMode = 'margin'; }
950
+ if (typeof window === 'undefined') {
951
+ return zeroGap;
952
+ }
953
+ var offsets = getOffset(gapMode);
954
+ var documentWidth = document.documentElement.clientWidth;
955
+ var windowWidth = window.innerWidth;
956
+ return {
957
+ left: offsets[0],
958
+ top: offsets[1],
959
+ right: offsets[2],
960
+ gap: Math.max(0, windowWidth - documentWidth + offsets[2] - offsets[0]),
961
+ };
962
+ };
963
+
964
+ var Style = styleSingleton();
965
+ // important tip - once we measure scrollBar width and remove them
966
+ // we could not repeat this operation
967
+ // thus we are using style-singleton - only the first "yet correct" style will be applied.
968
+ var getStyles = function (_a, allowRelative, gapMode, important) {
969
+ var left = _a.left, top = _a.top, right = _a.right, gap = _a.gap;
970
+ if (gapMode === void 0) { gapMode = 'margin'; }
971
+ return "\n .".concat(noScrollbarsClassName, " {\n overflow: hidden ").concat(important, ";\n padding-right: ").concat(gap, "px ").concat(important, ";\n }\n body {\n overflow: hidden ").concat(important, ";\n overscroll-behavior: contain;\n ").concat([
972
+ allowRelative && "position: relative ".concat(important, ";"),
973
+ gapMode === 'margin' &&
974
+ "\n padding-left: ".concat(left, "px;\n padding-top: ").concat(top, "px;\n padding-right: ").concat(right, "px;\n margin-left:0;\n margin-top:0;\n margin-right: ").concat(gap, "px ").concat(important, ";\n "),
975
+ gapMode === 'padding' && "padding-right: ".concat(gap, "px ").concat(important, ";"),
976
+ ]
977
+ .filter(Boolean)
978
+ .join(''), "\n }\n \n .").concat(zeroRightClassName, " {\n right: ").concat(gap, "px ").concat(important, ";\n }\n \n .").concat(fullWidthClassName, " {\n margin-right: ").concat(gap, "px ").concat(important, ";\n }\n \n .").concat(zeroRightClassName, " .").concat(zeroRightClassName, " {\n right: 0 ").concat(important, ";\n }\n \n .").concat(fullWidthClassName, " .").concat(fullWidthClassName, " {\n margin-right: 0 ").concat(important, ";\n }\n \n body {\n ").concat(removedBarSizeVariable, ": ").concat(gap, "px;\n }\n");
979
+ };
980
+ /**
981
+ * Removes page scrollbar and blocks page scroll when mounted
982
+ */
983
+ var RemoveScrollBar = function (props) {
984
+ var noRelative = props.noRelative, noImportant = props.noImportant, _a = props.gapMode, gapMode = _a === void 0 ? 'margin' : _a;
985
+ /*
986
+ gap will be measured on every component mount
987
+ however it will be used only by the "first" invocation
988
+ due to singleton nature of <Style
989
+ */
990
+ var gap = React.useMemo(function () { return getGapWidth(gapMode); }, [gapMode]);
991
+ return React.createElement(Style, { styles: getStyles(gap, !noRelative, gapMode, !noImportant ? '!important' : '') });
992
+ };
993
+
994
+ var passiveSupported = false;
995
+ if (typeof window !== 'undefined') {
996
+ try {
997
+ var options = Object.defineProperty({}, 'passive', {
998
+ get: function () {
999
+ passiveSupported = true;
1000
+ return true;
1001
+ },
1002
+ });
1003
+ // @ts-ignore
1004
+ window.addEventListener('test', options, options);
1005
+ // @ts-ignore
1006
+ window.removeEventListener('test', options, options);
1007
+ }
1008
+ catch (err) {
1009
+ passiveSupported = false;
1010
+ }
1011
+ }
1012
+ var nonPassive = passiveSupported ? { passive: false } : false;
1013
+
1014
+ var alwaysContainsScroll = function (node) {
1015
+ // textarea will always _contain_ scroll inside self. It only can be hidden
1016
+ return node.tagName === 'TEXTAREA';
1017
+ };
1018
+ var elementCanBeScrolled = function (node, overflow) {
1019
+ var styles = window.getComputedStyle(node);
1020
+ return (
1021
+ // not-not-scrollable
1022
+ styles[overflow] !== 'hidden' &&
1023
+ // contains scroll inside self
1024
+ !(styles.overflowY === styles.overflowX && !alwaysContainsScroll(node) && styles[overflow] === 'visible'));
1025
+ };
1026
+ var elementCouldBeVScrolled = function (node) { return elementCanBeScrolled(node, 'overflowY'); };
1027
+ var elementCouldBeHScrolled = function (node) { return elementCanBeScrolled(node, 'overflowX'); };
1028
+ var locationCouldBeScrolled = function (axis, node) {
1029
+ var current = node;
1030
+ do {
1031
+ // Skip over shadow root
1032
+ if (typeof ShadowRoot !== 'undefined' && current instanceof ShadowRoot) {
1033
+ current = current.host;
1034
+ }
1035
+ var isScrollable = elementCouldBeScrolled(axis, current);
1036
+ if (isScrollable) {
1037
+ var _a = getScrollVariables(axis, current), s = _a[1], d = _a[2];
1038
+ if (s > d) {
1039
+ return true;
1040
+ }
1041
+ }
1042
+ current = current.parentNode;
1043
+ } while (current && current !== document.body);
1044
+ return false;
1045
+ };
1046
+ var getVScrollVariables = function (_a) {
1047
+ var scrollTop = _a.scrollTop, scrollHeight = _a.scrollHeight, clientHeight = _a.clientHeight;
1048
+ return [
1049
+ scrollTop,
1050
+ scrollHeight,
1051
+ clientHeight,
1052
+ ];
1053
+ };
1054
+ var getHScrollVariables = function (_a) {
1055
+ var scrollLeft = _a.scrollLeft, scrollWidth = _a.scrollWidth, clientWidth = _a.clientWidth;
1056
+ return [
1057
+ scrollLeft,
1058
+ scrollWidth,
1059
+ clientWidth,
1060
+ ];
1061
+ };
1062
+ var elementCouldBeScrolled = function (axis, node) {
1063
+ return axis === 'v' ? elementCouldBeVScrolled(node) : elementCouldBeHScrolled(node);
1064
+ };
1065
+ var getScrollVariables = function (axis, node) {
1066
+ return axis === 'v' ? getVScrollVariables(node) : getHScrollVariables(node);
1067
+ };
1068
+ var getDirectionFactor = function (axis, direction) {
1069
+ /**
1070
+ * If the element's direction is rtl (right-to-left), then scrollLeft is 0 when the scrollbar is at its rightmost position,
1071
+ * and then increasingly negative as you scroll towards the end of the content.
1072
+ * @see https://developer.mozilla.org/en-US/docs/Web/API/Element/scrollLeft
1073
+ */
1074
+ return axis === 'h' && direction === 'rtl' ? -1 : 1;
1075
+ };
1076
+ var handleScroll = function (axis, endTarget, event, sourceDelta, noOverscroll) {
1077
+ var directionFactor = getDirectionFactor(axis, window.getComputedStyle(endTarget).direction);
1078
+ var delta = directionFactor * sourceDelta;
1079
+ // find scrollable target
1080
+ var target = event.target;
1081
+ var targetInLock = endTarget.contains(target);
1082
+ var shouldCancelScroll = false;
1083
+ var isDeltaPositive = delta > 0;
1084
+ var availableScroll = 0;
1085
+ var availableScrollTop = 0;
1086
+ do {
1087
+ var _a = getScrollVariables(axis, target), position = _a[0], scroll_1 = _a[1], capacity = _a[2];
1088
+ var elementScroll = scroll_1 - capacity - directionFactor * position;
1089
+ if (position || elementScroll) {
1090
+ if (elementCouldBeScrolled(axis, target)) {
1091
+ availableScroll += elementScroll;
1092
+ availableScrollTop += position;
1093
+ }
1094
+ }
1095
+ target = target.parentNode;
1096
+ } while (
1097
+ // portaled content
1098
+ (!targetInLock && target !== document.body) ||
1099
+ // self content
1100
+ (targetInLock && (endTarget.contains(target) || endTarget === target)));
1101
+ if (isDeltaPositive && ((noOverscroll && availableScroll === 0) || (!noOverscroll && delta > availableScroll))) {
1102
+ shouldCancelScroll = true;
1103
+ }
1104
+ else if (!isDeltaPositive &&
1105
+ ((noOverscroll && availableScrollTop === 0) || (!noOverscroll && -delta > availableScrollTop))) {
1106
+ shouldCancelScroll = true;
1107
+ }
1108
+ return shouldCancelScroll;
1109
+ };
1110
+
1111
+ var getTouchXY = function (event) {
1112
+ return 'changedTouches' in event ? [event.changedTouches[0].clientX, event.changedTouches[0].clientY] : [0, 0];
1113
+ };
1114
+ var getDeltaXY = function (event) { return [event.deltaX, event.deltaY]; };
1115
+ var extractRef = function (ref) {
1116
+ return ref && 'current' in ref ? ref.current : ref;
1117
+ };
1118
+ var deltaCompare = function (x, y) { return x[0] === y[0] && x[1] === y[1]; };
1119
+ var generateStyle = function (id) { return "\n .block-interactivity-".concat(id, " {pointer-events: none;}\n .allow-interactivity-").concat(id, " {pointer-events: all;}\n"); };
1120
+ var idCounter = 0;
1121
+ var lockStack = [];
1122
+ function RemoveScrollSideCar(props) {
1123
+ var shouldPreventQueue = React.useRef([]);
1124
+ var touchStartRef = React.useRef([0, 0]);
1125
+ var activeAxis = React.useRef();
1126
+ var id = React.useState(idCounter++)[0];
1127
+ var Style = React.useState(function () { return styleSingleton(); })[0];
1128
+ var lastProps = React.useRef(props);
1129
+ React.useEffect(function () {
1130
+ lastProps.current = props;
1131
+ }, [props]);
1132
+ React.useEffect(function () {
1133
+ if (props.inert) {
1134
+ document.body.classList.add("block-interactivity-".concat(id));
1135
+ var allow_1 = __spreadArray([props.lockRef.current], (props.shards || []).map(extractRef), true).filter(Boolean);
1136
+ allow_1.forEach(function (el) { return el.classList.add("allow-interactivity-".concat(id)); });
1137
+ return function () {
1138
+ document.body.classList.remove("block-interactivity-".concat(id));
1139
+ allow_1.forEach(function (el) { return el.classList.remove("allow-interactivity-".concat(id)); });
1140
+ };
1141
+ }
1142
+ return;
1143
+ }, [props.inert, props.lockRef.current, props.shards]);
1144
+ var shouldCancelEvent = React.useCallback(function (event, parent) {
1145
+ if ('touches' in event && event.touches.length === 2) {
1146
+ return !lastProps.current.allowPinchZoom;
1147
+ }
1148
+ var touch = getTouchXY(event);
1149
+ var touchStart = touchStartRef.current;
1150
+ var deltaX = 'deltaX' in event ? event.deltaX : touchStart[0] - touch[0];
1151
+ var deltaY = 'deltaY' in event ? event.deltaY : touchStart[1] - touch[1];
1152
+ var currentAxis;
1153
+ var target = event.target;
1154
+ var moveDirection = Math.abs(deltaX) > Math.abs(deltaY) ? 'h' : 'v';
1155
+ // allow horizontal touch move on Range inputs. They will not cause any scroll
1156
+ if ('touches' in event && moveDirection === 'h' && target.type === 'range') {
1157
+ return false;
1158
+ }
1159
+ var canBeScrolledInMainDirection = locationCouldBeScrolled(moveDirection, target);
1160
+ if (!canBeScrolledInMainDirection) {
1161
+ return true;
1162
+ }
1163
+ if (canBeScrolledInMainDirection) {
1164
+ currentAxis = moveDirection;
1165
+ }
1166
+ else {
1167
+ currentAxis = moveDirection === 'v' ? 'h' : 'v';
1168
+ canBeScrolledInMainDirection = locationCouldBeScrolled(moveDirection, target);
1169
+ // other axis might be not scrollable
1170
+ }
1171
+ if (!canBeScrolledInMainDirection) {
1172
+ return false;
1173
+ }
1174
+ if (!activeAxis.current && 'changedTouches' in event && (deltaX || deltaY)) {
1175
+ activeAxis.current = currentAxis;
1176
+ }
1177
+ if (!currentAxis) {
1178
+ return true;
1179
+ }
1180
+ var cancelingAxis = activeAxis.current || currentAxis;
1181
+ return handleScroll(cancelingAxis, parent, event, cancelingAxis === 'h' ? deltaX : deltaY, true);
1182
+ }, []);
1183
+ var shouldPrevent = React.useCallback(function (_event) {
1184
+ var event = _event;
1185
+ if (!lockStack.length || lockStack[lockStack.length - 1] !== Style) {
1186
+ // not the last active
1187
+ return;
1188
+ }
1189
+ var delta = 'deltaY' in event ? getDeltaXY(event) : getTouchXY(event);
1190
+ var sourceEvent = shouldPreventQueue.current.filter(function (e) { return e.name === event.type && e.target === event.target && deltaCompare(e.delta, delta); })[0];
1191
+ // self event, and should be canceled
1192
+ if (sourceEvent && sourceEvent.should) {
1193
+ if (event.cancelable) {
1194
+ event.preventDefault();
1195
+ }
1196
+ return;
1197
+ }
1198
+ // outside or shard event
1199
+ if (!sourceEvent) {
1200
+ var shardNodes = (lastProps.current.shards || [])
1201
+ .map(extractRef)
1202
+ .filter(Boolean)
1203
+ .filter(function (node) { return node.contains(event.target); });
1204
+ var shouldStop = shardNodes.length > 0 ? shouldCancelEvent(event, shardNodes[0]) : !lastProps.current.noIsolation;
1205
+ if (shouldStop) {
1206
+ if (event.cancelable) {
1207
+ event.preventDefault();
1208
+ }
1209
+ }
1210
+ }
1211
+ }, []);
1212
+ var shouldCancel = React.useCallback(function (name, delta, target, should) {
1213
+ var event = { name: name, delta: delta, target: target, should: should };
1214
+ shouldPreventQueue.current.push(event);
1215
+ setTimeout(function () {
1216
+ shouldPreventQueue.current = shouldPreventQueue.current.filter(function (e) { return e !== event; });
1217
+ }, 1);
1218
+ }, []);
1219
+ var scrollTouchStart = React.useCallback(function (event) {
1220
+ touchStartRef.current = getTouchXY(event);
1221
+ activeAxis.current = undefined;
1222
+ }, []);
1223
+ var scrollWheel = React.useCallback(function (event) {
1224
+ shouldCancel(event.type, getDeltaXY(event), event.target, shouldCancelEvent(event, props.lockRef.current));
1225
+ }, []);
1226
+ var scrollTouchMove = React.useCallback(function (event) {
1227
+ shouldCancel(event.type, getTouchXY(event), event.target, shouldCancelEvent(event, props.lockRef.current));
1228
+ }, []);
1229
+ React.useEffect(function () {
1230
+ lockStack.push(Style);
1231
+ props.setCallbacks({
1232
+ onScrollCapture: scrollWheel,
1233
+ onWheelCapture: scrollWheel,
1234
+ onTouchMoveCapture: scrollTouchMove,
1235
+ });
1236
+ document.addEventListener('wheel', shouldPrevent, nonPassive);
1237
+ document.addEventListener('touchmove', shouldPrevent, nonPassive);
1238
+ document.addEventListener('touchstart', scrollTouchStart, nonPassive);
1239
+ return function () {
1240
+ lockStack = lockStack.filter(function (inst) { return inst !== Style; });
1241
+ document.removeEventListener('wheel', shouldPrevent, nonPassive);
1242
+ document.removeEventListener('touchmove', shouldPrevent, nonPassive);
1243
+ document.removeEventListener('touchstart', scrollTouchStart, nonPassive);
1244
+ };
1245
+ }, []);
1246
+ var removeScrollBar = props.removeScrollBar, inert = props.inert;
1247
+ return (React.createElement(React.Fragment, null,
1248
+ inert ? React.createElement(Style, { styles: generateStyle(id) }) : null,
1249
+ removeScrollBar ? React.createElement(RemoveScrollBar, { gapMode: "margin" }) : null));
1250
+ }
1251
+
1252
+ var SideCar = exportSidecar(effectCar, RemoveScrollSideCar);
1253
+
1254
+ var ReactRemoveScroll = React.forwardRef(function (props, ref) { return (React.createElement(RemoveScroll, __assign$1({}, props, { ref: ref, sideCar: SideCar }))); });
1255
+ ReactRemoveScroll.classNames = RemoveScroll.classNames;
1256
+ var $01b9c$RemoveScroll = ReactRemoveScroll;
1257
+
1258
+ var getDefaultParent = function (originalTarget) {
1259
+ if (typeof document === 'undefined') {
1260
+ return null;
1261
+ }
1262
+ var sampleTarget = Array.isArray(originalTarget) ? originalTarget[0] : originalTarget;
1263
+ return sampleTarget.ownerDocument.body;
1264
+ };
1265
+ var counterMap = new WeakMap();
1266
+ var uncontrolledNodes = new WeakMap();
1267
+ var markerMap = {};
1268
+ var lockCount = 0;
1269
+ var unwrapHost = function (node) {
1270
+ return node && (node.host || unwrapHost(node.parentNode));
1271
+ };
1272
+ var correctTargets = function (parent, targets) {
1273
+ return targets.map(function (target) {
1274
+ if (parent.contains(target)) {
1275
+ return target;
1276
+ }
1277
+ var correctedTarget = unwrapHost(target);
1278
+ if (correctedTarget && parent.contains(correctedTarget)) {
1279
+ return correctedTarget;
1280
+ }
1281
+ console.error('aria-hidden', target, 'in not contained inside', parent, '. Doing nothing');
1282
+ return null;
1283
+ }).filter(function (x) { return Boolean(x); });
1284
+ };
1285
+ /**
1286
+ * Marks everything except given node(or nodes) as aria-hidden
1287
+ * @param {Element | Element[]} originalTarget - elements to keep on the page
1288
+ * @param [parentNode] - top element, defaults to document.body
1289
+ * @param {String} [markerName] - a special attribute to mark every node
1290
+ * @param {String} [controlAttribute] - html Attribute to control
1291
+ * @return {Undo} undo command
1292
+ */
1293
+ var applyAttributeToOthers = function (originalTarget, parentNode, markerName, controlAttribute) {
1294
+ var targets = correctTargets(parentNode, Array.isArray(originalTarget) ? originalTarget : [originalTarget]);
1295
+ if (!markerMap[markerName]) {
1296
+ markerMap[markerName] = new WeakMap();
1297
+ }
1298
+ var markerCounter = markerMap[markerName];
1299
+ var hiddenNodes = [];
1300
+ var elementsToKeep = new Set();
1301
+ var elementsToStop = new Set(targets);
1302
+ var keep = function (el) {
1303
+ if (!el || elementsToKeep.has(el)) {
1304
+ return;
1305
+ }
1306
+ elementsToKeep.add(el);
1307
+ keep(el.parentNode);
1308
+ };
1309
+ targets.forEach(keep);
1310
+ var deep = function (parent) {
1311
+ if (!parent || elementsToStop.has(parent)) {
1312
+ return;
1313
+ }
1314
+ Array.prototype.forEach.call(parent.children, function (node) {
1315
+ if (elementsToKeep.has(node)) {
1316
+ deep(node);
1317
+ }
1318
+ else {
1319
+ var attr = node.getAttribute(controlAttribute);
1320
+ var alreadyHidden = attr !== null && attr !== 'false';
1321
+ var counterValue = (counterMap.get(node) || 0) + 1;
1322
+ var markerValue = (markerCounter.get(node) || 0) + 1;
1323
+ counterMap.set(node, counterValue);
1324
+ markerCounter.set(node, markerValue);
1325
+ hiddenNodes.push(node);
1326
+ if (counterValue === 1 && alreadyHidden) {
1327
+ uncontrolledNodes.set(node, true);
1328
+ }
1329
+ if (markerValue === 1) {
1330
+ node.setAttribute(markerName, 'true');
1331
+ }
1332
+ if (!alreadyHidden) {
1333
+ node.setAttribute(controlAttribute, 'true');
1334
+ }
1335
+ }
1336
+ });
1337
+ };
1338
+ deep(parentNode);
1339
+ elementsToKeep.clear();
1340
+ lockCount++;
1341
+ return function () {
1342
+ hiddenNodes.forEach(function (node) {
1343
+ var counterValue = counterMap.get(node) - 1;
1344
+ var markerValue = markerCounter.get(node) - 1;
1345
+ counterMap.set(node, counterValue);
1346
+ markerCounter.set(node, markerValue);
1347
+ if (!counterValue) {
1348
+ if (!uncontrolledNodes.has(node)) {
1349
+ node.removeAttribute(controlAttribute);
1350
+ }
1351
+ uncontrolledNodes.delete(node);
1352
+ }
1353
+ if (!markerValue) {
1354
+ node.removeAttribute(markerName);
1355
+ }
1356
+ });
1357
+ lockCount--;
1358
+ if (!lockCount) {
1359
+ // clear
1360
+ counterMap = new WeakMap();
1361
+ counterMap = new WeakMap();
1362
+ uncontrolledNodes = new WeakMap();
1363
+ markerMap = {};
1364
+ }
1365
+ };
1366
+ };
1367
+ /**
1368
+ * Marks everything except given node(or nodes) as aria-hidden
1369
+ * @param {Element | Element[]} originalTarget - elements to keep on the page
1370
+ * @param [parentNode] - top element, defaults to document.body
1371
+ * @param {String} [markerName] - a special attribute to mark every node
1372
+ * @return {Undo} undo command
1373
+ */
1374
+ var hideOthers = function (originalTarget, parentNode, markerName) {
1375
+ if (markerName === void 0) { markerName = 'data-aria-hidden'; }
1376
+ var targets = Array.from(Array.isArray(originalTarget) ? originalTarget : [originalTarget]);
1377
+ var activeParentNode = parentNode || getDefaultParent(originalTarget);
1378
+ if (!activeParentNode) {
1379
+ return function () { return null; };
1380
+ }
1381
+ // we should not hide ariaLive elements - https://github.com/theKashey/aria-hidden/issues/10
1382
+ targets.push.apply(targets, Array.from(activeParentNode.querySelectorAll('[aria-live]')));
1383
+ return applyAttributeToOthers(targets, activeParentNode, markerName, 'aria-hidden');
1384
+ };
1385
+
1386
+ export { $1746a345f3d73bb7$export$f680877a34711e37 as $, $f1701beae083dbae$export$602eac185826482c as a, $01b9c$RemoveScroll as b, $3db38b7d1fb3fe6a$export$b7ece24a22aeda8c as c, $d3863c46a17e8a28$export$20e40289641fbbb6 as d, $5cb92bef7577960e$export$177fb62ff3ec1f22 as e, hideOthers as h };