@bigbinary/neeto-atoms 1.0.5 → 1.0.7

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 (503) hide show
  1. package/dist/DataTable-Y4POx0WN.js +3737 -0
  2. package/dist/DataTable-Y4POx0WN.js.map +1 -0
  3. package/dist/button-COIbN8dg.js +40 -0
  4. package/dist/button-COIbN8dg.js.map +1 -0
  5. package/dist/check-Cpkv29p1.js +15 -0
  6. package/dist/check-Cpkv29p1.js.map +1 -0
  7. package/dist/chevron-down-BNi0ntys.js +15 -0
  8. package/dist/chevron-down-BNi0ntys.js.map +1 -0
  9. package/dist/chevron-left-BDoT8E2-.js +15 -0
  10. package/dist/chevron-left-BDoT8E2-.js.map +1 -0
  11. package/dist/chevron-right-DQnrO-ek.js +15 -0
  12. package/dist/chevron-right-DQnrO-ek.js.map +1 -0
  13. package/dist/chevron-up-Bf2G3AAU.js +15 -0
  14. package/dist/chevron-up-Bf2G3AAU.js.map +1 -0
  15. package/dist/cjs/DataTable-DJw2SZ7b.js +3764 -0
  16. package/dist/cjs/DataTable-DJw2SZ7b.js.map +1 -0
  17. package/dist/cjs/button-B8XGl69v.js +63 -0
  18. package/dist/cjs/button-B8XGl69v.js.map +1 -0
  19. package/dist/cjs/check-BQgcDXys.js +17 -0
  20. package/dist/cjs/check-BQgcDXys.js.map +1 -0
  21. package/dist/cjs/chevron-down-CPsWSS51.js +17 -0
  22. package/dist/cjs/chevron-down-CPsWSS51.js.map +1 -0
  23. package/dist/cjs/chevron-left-BldoOh5p.js +17 -0
  24. package/dist/cjs/chevron-left-BldoOh5p.js.map +1 -0
  25. package/dist/cjs/chevron-right-0jNdwX2Q.js +17 -0
  26. package/dist/cjs/chevron-right-0jNdwX2Q.js.map +1 -0
  27. package/dist/cjs/chevron-up-BpwpBnZU.js +17 -0
  28. package/dist/cjs/chevron-up-BpwpBnZU.js.map +1 -0
  29. package/dist/cjs/components/DataTable.js +53 -0
  30. package/dist/cjs/components/DataTable.js.map +1 -0
  31. package/dist/cjs/createLucideIcon-D0tRgV6l.js +149 -0
  32. package/dist/cjs/createLucideIcon-D0tRgV6l.js.map +1 -0
  33. package/dist/cjs/dialog-DzNWLbJ6.js +50 -0
  34. package/dist/cjs/dialog-DzNWLbJ6.js.map +1 -0
  35. package/dist/cjs/ellipsis-4aubOI2n.js +21 -0
  36. package/dist/cjs/ellipsis-4aubOI2n.js.map +1 -0
  37. package/dist/cjs/floating-ui.react-dom-B4Aw6O7R.js +2293 -0
  38. package/dist/cjs/floating-ui.react-dom-B4Aw6O7R.js.map +1 -0
  39. package/dist/cjs/index-9jC1advf.js +34 -0
  40. package/dist/cjs/index-9jC1advf.js.map +1 -0
  41. package/dist/cjs/index-BZhTddX0.js +47 -0
  42. package/dist/cjs/index-BZhTddX0.js.map +1 -0
  43. package/dist/cjs/index-Bf0WsHta.js +63 -0
  44. package/dist/cjs/index-Bf0WsHta.js.map +1 -0
  45. package/dist/cjs/index-BqCr1H3u.js +173 -0
  46. package/dist/cjs/index-BqCr1H3u.js.map +1 -0
  47. package/dist/cjs/index-BrpkRQoS.js +99 -0
  48. package/dist/cjs/index-BrpkRQoS.js.map +1 -0
  49. package/dist/cjs/index-Bvu9MiFi.js +247 -0
  50. package/dist/cjs/index-Bvu9MiFi.js.map +1 -0
  51. package/dist/cjs/index-BwAq9ba8.js +38 -0
  52. package/dist/cjs/index-BwAq9ba8.js.map +1 -0
  53. package/dist/cjs/index-C9ICrOhM.js +328 -0
  54. package/dist/cjs/index-C9ICrOhM.js.map +1 -0
  55. package/dist/cjs/index-CB9xFokC.js +59 -0
  56. package/dist/cjs/index-CB9xFokC.js.map +1 -0
  57. package/dist/cjs/index-CCdG4z4E.js +30 -0
  58. package/dist/cjs/index-CCdG4z4E.js.map +1 -0
  59. package/dist/cjs/index-CF951Pw9.js +38 -0
  60. package/dist/cjs/index-CF951Pw9.js.map +1 -0
  61. package/dist/cjs/index-CGUGhyIp.js +103 -0
  62. package/dist/cjs/index-CGUGhyIp.js.map +1 -0
  63. package/dist/cjs/index-CGet1HH4.js +953 -0
  64. package/dist/cjs/index-CGet1HH4.js.map +1 -0
  65. package/dist/cjs/index-COPkC3I5.js +14 -0
  66. package/dist/cjs/index-COPkC3I5.js.map +1 -0
  67. package/dist/cjs/index-Ch55j1or.js +176 -0
  68. package/dist/cjs/index-Ch55j1or.js.map +1 -0
  69. package/dist/cjs/index-ChSOMM8b.js +1153 -0
  70. package/dist/cjs/index-ChSOMM8b.js.map +1 -0
  71. package/dist/cjs/index-CyrAgb4H.js +93 -0
  72. package/dist/cjs/index-CyrAgb4H.js.map +1 -0
  73. package/dist/cjs/index-D-iDn9RI.js +63 -0
  74. package/dist/cjs/index-D-iDn9RI.js.map +1 -0
  75. package/dist/cjs/index-DAds6mf_.js +433 -0
  76. package/dist/cjs/index-DAds6mf_.js.map +1 -0
  77. package/dist/cjs/index-DMbj7vXd.js +152 -0
  78. package/dist/cjs/index-DMbj7vXd.js.map +1 -0
  79. package/dist/cjs/index-DR7GJU4J.js +248 -0
  80. package/dist/cjs/index-DR7GJU4J.js.map +1 -0
  81. package/dist/cjs/index-DcCSSgb7.js +153 -0
  82. package/dist/cjs/index-DcCSSgb7.js.map +1 -0
  83. package/dist/cjs/index-Df-Ffa3s.js +43 -0
  84. package/dist/cjs/index-Df-Ffa3s.js.map +1 -0
  85. package/dist/cjs/index-DnKJmaCq.js +8 -0
  86. package/dist/cjs/index-DnKJmaCq.js.map +1 -0
  87. package/dist/cjs/index-DuNgWCXZ.js +113 -0
  88. package/dist/cjs/index-DuNgWCXZ.js.map +1 -0
  89. package/dist/cjs/index-EyWRfsCG.js +9 -0
  90. package/dist/cjs/index-EyWRfsCG.js.map +1 -0
  91. package/dist/cjs/index-lWVw05cs.js +35 -0
  92. package/dist/cjs/index-lWVw05cs.js.map +1 -0
  93. package/dist/cjs/index.js +53 -66849
  94. package/dist/cjs/index.js.map +1 -1
  95. package/dist/cjs/input-CgKPISj_.js +11 -0
  96. package/dist/cjs/input-CgKPISj_.js.map +1 -0
  97. package/dist/cjs/input-group-DoK0-4fL.js +66 -0
  98. package/dist/cjs/input-group-DoK0-4fL.js.map +1 -0
  99. package/dist/cjs/label-Bdc9ytTI.js +52 -0
  100. package/dist/cjs/label-Bdc9ytTI.js.map +1 -0
  101. package/dist/cjs/loader-circle-Bw7zP2Gn.js +17 -0
  102. package/dist/cjs/loader-circle-Bw7zP2Gn.js.map +1 -0
  103. package/dist/cjs/primitives/Accordion.js +340 -0
  104. package/dist/cjs/primitives/Accordion.js.map +1 -0
  105. package/dist/cjs/primitives/Alert.js +40 -0
  106. package/dist/cjs/primitives/Alert.js.map +1 -0
  107. package/dist/cjs/primitives/AlertDialog.js +256 -0
  108. package/dist/cjs/primitives/AlertDialog.js.map +1 -0
  109. package/dist/cjs/primitives/AspectRatio.js +75 -0
  110. package/dist/cjs/primitives/AspectRatio.js.map +1 -0
  111. package/dist/cjs/primitives/Avatar.js +189 -0
  112. package/dist/cjs/primitives/Avatar.js.map +1 -0
  113. package/dist/cjs/primitives/Badge.js +34 -0
  114. package/dist/cjs/primitives/Badge.js.map +1 -0
  115. package/dist/cjs/primitives/Breadcrumb.js +50 -0
  116. package/dist/cjs/primitives/Breadcrumb.js.map +1 -0
  117. package/dist/cjs/primitives/Button.js +16 -0
  118. package/dist/cjs/primitives/Button.js.map +1 -0
  119. package/dist/cjs/primitives/ButtonGroup.js +43 -0
  120. package/dist/cjs/primitives/ButtonGroup.js.map +1 -0
  121. package/dist/cjs/primitives/Calendar.js +8030 -0
  122. package/dist/cjs/primitives/Calendar.js.map +1 -0
  123. package/dist/cjs/primitives/Card.js +43 -0
  124. package/dist/cjs/primitives/Card.js.map +1 -0
  125. package/dist/cjs/primitives/Carousel.js +1867 -0
  126. package/dist/cjs/primitives/Carousel.js.map +1 -0
  127. package/dist/cjs/primitives/Chart.js +18787 -0
  128. package/dist/cjs/primitives/Chart.js.map +1 -0
  129. package/dist/cjs/primitives/Checkbox.js +304 -0
  130. package/dist/cjs/primitives/Checkbox.js.map +1 -0
  131. package/dist/cjs/primitives/Collapsible.js +33 -0
  132. package/dist/cjs/primitives/Collapsible.js.map +1 -0
  133. package/dist/cjs/primitives/Combobox.js +10288 -0
  134. package/dist/cjs/primitives/Combobox.js.map +1 -0
  135. package/dist/cjs/primitives/Command.js +248 -0
  136. package/dist/cjs/primitives/Command.js.map +1 -0
  137. package/dist/cjs/primitives/ContextMenu.js +404 -0
  138. package/dist/cjs/primitives/ContextMenu.js.map +1 -0
  139. package/dist/cjs/primitives/Dialog.js +48 -0
  140. package/dist/cjs/primitives/Dialog.js.map +1 -0
  141. package/dist/cjs/primitives/Drawer.js +1715 -0
  142. package/dist/cjs/primitives/Drawer.js.map +1 -0
  143. package/dist/cjs/primitives/DropdownMenu.js +383 -0
  144. package/dist/cjs/primitives/DropdownMenu.js.map +1 -0
  145. package/dist/cjs/primitives/Empty.js +50 -0
  146. package/dist/cjs/primitives/Empty.js.map +1 -0
  147. package/dist/cjs/primitives/Field.js +95 -0
  148. package/dist/cjs/primitives/Field.js.map +1 -0
  149. package/dist/cjs/primitives/HoverCard.js +291 -0
  150. package/dist/cjs/primitives/HoverCard.js.map +1 -0
  151. package/dist/cjs/primitives/Input.js +10 -0
  152. package/dist/cjs/primitives/Input.js.map +1 -0
  153. package/dist/cjs/primitives/InputGroup.js +27 -0
  154. package/dist/cjs/primitives/InputGroup.js.map +1 -0
  155. package/dist/cjs/primitives/InputOTP.js +84 -0
  156. package/dist/cjs/primitives/InputOTP.js.map +1 -0
  157. package/dist/cjs/primitives/Item.js +96 -0
  158. package/dist/cjs/primitives/Item.js.map +1 -0
  159. package/dist/cjs/primitives/Kbd.js +18 -0
  160. package/dist/cjs/primitives/Kbd.js.map +1 -0
  161. package/dist/cjs/primitives/Label.js +14 -0
  162. package/dist/cjs/primitives/Label.js.map +1 -0
  163. package/dist/cjs/primitives/Menubar.js +547 -0
  164. package/dist/cjs/primitives/Menubar.js.map +1 -0
  165. package/dist/cjs/primitives/NativeSelect.js +26 -0
  166. package/dist/cjs/primitives/NativeSelect.js.map +1 -0
  167. package/dist/cjs/primitives/NavigationMenu.js +856 -0
  168. package/dist/cjs/primitives/NavigationMenu.js.map +1 -0
  169. package/dist/cjs/primitives/Pagination.js +52 -0
  170. package/dist/cjs/primitives/Pagination.js.map +1 -0
  171. package/dist/cjs/primitives/Popover.js +444 -0
  172. package/dist/cjs/primitives/Popover.js.map +1 -0
  173. package/dist/cjs/primitives/Progress.js +125 -0
  174. package/dist/cjs/primitives/Progress.js.map +1 -0
  175. package/dist/cjs/primitives/RadioGroup.js +322 -0
  176. package/dist/cjs/primitives/RadioGroup.js.map +1 -0
  177. package/dist/cjs/primitives/Resizable.js +2051 -0
  178. package/dist/cjs/primitives/Resizable.js.map +1 -0
  179. package/dist/cjs/primitives/ScrollArea.js +754 -0
  180. package/dist/cjs/primitives/ScrollArea.js.map +1 -0
  181. package/dist/cjs/primitives/Select.js +1318 -0
  182. package/dist/cjs/primitives/Select.js.map +1 -0
  183. package/dist/cjs/primitives/Separator.js +14 -0
  184. package/dist/cjs/primitives/Separator.js.map +1 -0
  185. package/dist/cjs/primitives/Sheet.js +44 -0
  186. package/dist/cjs/primitives/Sheet.js.map +1 -0
  187. package/dist/cjs/primitives/Sidebar.js +310 -0
  188. package/dist/cjs/primitives/Sidebar.js.map +1 -0
  189. package/dist/cjs/primitives/Skeleton.js +10 -0
  190. package/dist/cjs/primitives/Skeleton.js.map +1 -0
  191. package/dist/cjs/primitives/Slider.js +591 -0
  192. package/dist/cjs/primitives/Slider.js.map +1 -0
  193. package/dist/cjs/primitives/Sonner.js +1260 -0
  194. package/dist/cjs/primitives/Sonner.js.map +1 -0
  195. package/dist/cjs/primitives/Spinner.js +16 -0
  196. package/dist/cjs/primitives/Spinner.js.map +1 -0
  197. package/dist/cjs/primitives/Switch.js +184 -0
  198. package/dist/cjs/primitives/Switch.js.map +1 -0
  199. package/dist/cjs/primitives/Table.js +45 -0
  200. package/dist/cjs/primitives/Table.js.map +1 -0
  201. package/dist/cjs/primitives/Tabs.js +250 -0
  202. package/dist/cjs/primitives/Tabs.js.map +1 -0
  203. package/dist/cjs/primitives/Textarea.js +10 -0
  204. package/dist/cjs/primitives/Textarea.js.map +1 -0
  205. package/dist/cjs/primitives/Toggle.js +19 -0
  206. package/dist/cjs/primitives/Toggle.js.map +1 -0
  207. package/dist/cjs/primitives/ToggleGroup.js +221 -0
  208. package/dist/cjs/primitives/ToggleGroup.js.map +1 -0
  209. package/dist/cjs/primitives/Tooltip.js +33 -0
  210. package/dist/cjs/primitives/Tooltip.js.map +1 -0
  211. package/dist/cjs/primitives/Typography.js +105 -0
  212. package/dist/cjs/primitives/Typography.js.map +1 -0
  213. package/dist/cjs/primitives/index.js +422 -0
  214. package/dist/cjs/primitives/index.js.map +1 -0
  215. package/dist/cjs/reselect-CeyIIDM-.js +457 -0
  216. package/dist/cjs/reselect-CeyIIDM-.js.map +1 -0
  217. package/dist/cjs/separator-CPy2gyg1.js +58 -0
  218. package/dist/cjs/separator-CPy2gyg1.js.map +1 -0
  219. package/dist/cjs/sheet-nHSYZxAA.js +48 -0
  220. package/dist/cjs/sheet-nHSYZxAA.js.map +1 -0
  221. package/dist/cjs/skeleton-DffZ8bV7.js +11 -0
  222. package/dist/cjs/skeleton-DffZ8bV7.js.map +1 -0
  223. package/dist/cjs/textarea-CZSSY75H.js +11 -0
  224. package/dist/cjs/textarea-CZSSY75H.js.map +1 -0
  225. package/dist/cjs/toggle-CaqzT8dI.js +84 -0
  226. package/dist/cjs/toggle-CaqzT8dI.js.map +1 -0
  227. package/dist/cjs/tooltip-CRkOMh1b.js +542 -0
  228. package/dist/cjs/tooltip-CRkOMh1b.js.map +1 -0
  229. package/dist/cjs/use-mobile-B-UYxtqX.js +41 -0
  230. package/dist/cjs/use-mobile-B-UYxtqX.js.map +1 -0
  231. package/dist/cjs/utils-CTr7wn5d.js +3210 -0
  232. package/dist/cjs/utils-CTr7wn5d.js.map +1 -0
  233. package/dist/cjs/x-Brw3FJst.js +20 -0
  234. package/dist/cjs/x-Brw3FJst.js.map +1 -0
  235. package/dist/components/DataTable/DataTable.d.ts +1 -1
  236. package/dist/components/DataTable/types.d.ts +0 -5
  237. package/dist/components/DataTable.js +41 -0
  238. package/dist/components/DataTable.js.map +1 -0
  239. package/dist/createLucideIcon-C8ycilSN.js +147 -0
  240. package/dist/createLucideIcon-C8ycilSN.js.map +1 -0
  241. package/dist/dialog-C97DOTvO.js +39 -0
  242. package/dist/dialog-C97DOTvO.js.map +1 -0
  243. package/dist/ellipsis-lb8Ws6br.js +19 -0
  244. package/dist/ellipsis-lb8Ws6br.js.map +1 -0
  245. package/dist/floating-ui.react-dom-CcGbtPEK.js +2243 -0
  246. package/dist/floating-ui.react-dom-CcGbtPEK.js.map +1 -0
  247. package/dist/index-0o2E3Cnw.js +146 -0
  248. package/dist/index-0o2E3Cnw.js.map +1 -0
  249. package/dist/index-30QpKM0j.js +16 -0
  250. package/dist/index-30QpKM0j.js.map +1 -0
  251. package/dist/index-B4_fVWDx.js +1129 -0
  252. package/dist/index-B4_fVWDx.js.map +1 -0
  253. package/dist/index-BA158WEj.js +12 -0
  254. package/dist/index-BA158WEj.js.map +1 -0
  255. package/dist/index-BNPynZWM.js +225 -0
  256. package/dist/index-BNPynZWM.js.map +1 -0
  257. package/dist/index-BYZaLNq1.js +41 -0
  258. package/dist/index-BYZaLNq1.js.map +1 -0
  259. package/dist/index-BfAAoDv6.js +7 -0
  260. package/dist/index-BfAAoDv6.js.map +1 -0
  261. package/dist/index-BtkPdosV.js +40 -0
  262. package/dist/index-BtkPdosV.js.map +1 -0
  263. package/dist/index-BwxI_qgh.js +915 -0
  264. package/dist/index-BwxI_qgh.js.map +1 -0
  265. package/dist/index-ByEpUy7w.js +302 -0
  266. package/dist/index-ByEpUy7w.js.map +1 -0
  267. package/dist/index-CSMSzzKM.js +93 -0
  268. package/dist/index-CSMSzzKM.js.map +1 -0
  269. package/dist/index-CSUSJzOJ.js +13 -0
  270. package/dist/index-CSUSJzOJ.js.map +1 -0
  271. package/dist/index-CSggBaQF.js +36 -0
  272. package/dist/index-CSggBaQF.js.map +1 -0
  273. package/dist/index-CfriMyrd.js +91 -0
  274. package/dist/index-CfriMyrd.js.map +1 -0
  275. package/dist/index-CiyxEyB0.js +80 -0
  276. package/dist/index-CiyxEyB0.js.map +1 -0
  277. package/dist/index-Cor698lu.js +71 -0
  278. package/dist/index-Cor698lu.js.map +1 -0
  279. package/dist/index-D7Zy7P05.js +45 -0
  280. package/dist/index-D7Zy7P05.js.map +1 -0
  281. package/dist/index-DNzunGHb.js +12 -0
  282. package/dist/index-DNzunGHb.js.map +1 -0
  283. package/dist/index-DOzu5J1s.js +8 -0
  284. package/dist/index-DOzu5J1s.js.map +1 -0
  285. package/dist/index-DZXbzIgC.js +6 -0
  286. package/dist/index-DZXbzIgC.js.map +1 -0
  287. package/dist/index-Dd1i1d2M.js +155 -0
  288. package/dist/index-Dd1i1d2M.js.map +1 -0
  289. package/dist/index-DhnfW8wQ.js +128 -0
  290. package/dist/index-DhnfW8wQ.js.map +1 -0
  291. package/dist/index-PF0ms7Xn.js +402 -0
  292. package/dist/index-PF0ms7Xn.js.map +1 -0
  293. package/dist/index-fV_U4ZJM.js +18 -0
  294. package/dist/index-fV_U4ZJM.js.map +1 -0
  295. package/dist/index-j_qxDBFl.js +224 -0
  296. package/dist/index-j_qxDBFl.js.map +1 -0
  297. package/dist/index-yFgkK_AM.js +131 -0
  298. package/dist/index-yFgkK_AM.js.map +1 -0
  299. package/dist/index-zW4GjM5L.js +16 -0
  300. package/dist/index-zW4GjM5L.js.map +1 -0
  301. package/dist/index.d.ts +0 -55
  302. package/dist/index.js +41 -66515
  303. package/dist/index.js.map +1 -1
  304. package/dist/input-GLCCE2kT.js +9 -0
  305. package/dist/input-GLCCE2kT.js.map +1 -0
  306. package/dist/input-group-CDBpz6Pb.js +59 -0
  307. package/dist/input-group-CDBpz6Pb.js.map +1 -0
  308. package/dist/label-B4qDF3W1.js +30 -0
  309. package/dist/label-B4qDF3W1.js.map +1 -0
  310. package/dist/loader-circle-DycHUAWN.js +15 -0
  311. package/dist/loader-circle-DycHUAWN.js.map +1 -0
  312. package/dist/primitives/Accordion.js +331 -0
  313. package/dist/primitives/Accordion.js.map +1 -0
  314. package/dist/primitives/Alert.js +35 -0
  315. package/dist/primitives/Alert.js.map +1 -0
  316. package/dist/primitives/AlertDialog.js +223 -0
  317. package/dist/primitives/AlertDialog.js.map +1 -0
  318. package/dist/primitives/AspectRatio.js +53 -0
  319. package/dist/primitives/AspectRatio.js.map +1 -0
  320. package/dist/primitives/Avatar.js +162 -0
  321. package/dist/primitives/Avatar.js.map +1 -0
  322. package/dist/primitives/Badge.js +31 -0
  323. package/dist/primitives/Badge.js.map +1 -0
  324. package/dist/primitives/Breadcrumb.js +42 -0
  325. package/dist/primitives/Breadcrumb.js.map +1 -0
  326. package/dist/{components → primitives}/Button.d.ts +1 -1
  327. package/dist/primitives/Button.js +14 -0
  328. package/dist/primitives/Button.js.map +1 -0
  329. package/dist/primitives/ButtonGroup.js +38 -0
  330. package/dist/primitives/ButtonGroup.js.map +1 -0
  331. package/dist/primitives/Calendar.js +8008 -0
  332. package/dist/primitives/Calendar.js.map +1 -0
  333. package/dist/primitives/Card.js +35 -0
  334. package/dist/primitives/Card.js.map +1 -0
  335. package/dist/{components → primitives}/Carousel.d.ts +1 -1
  336. package/dist/primitives/Carousel.js +1841 -0
  337. package/dist/primitives/Carousel.js.map +1 -0
  338. package/dist/primitives/Chart.js +18761 -0
  339. package/dist/primitives/Chart.js.map +1 -0
  340. package/dist/primitives/Checkbox.js +282 -0
  341. package/dist/primitives/Checkbox.js.map +1 -0
  342. package/dist/primitives/Collapsible.js +29 -0
  343. package/dist/primitives/Collapsible.js.map +1 -0
  344. package/dist/primitives/Combobox.js +10251 -0
  345. package/dist/primitives/Combobox.js.map +1 -0
  346. package/dist/primitives/Command.js +218 -0
  347. package/dist/primitives/Command.js.map +1 -0
  348. package/dist/primitives/ContextMenu.js +368 -0
  349. package/dist/primitives/ContextMenu.js.map +1 -0
  350. package/dist/primitives/Dialog.js +37 -0
  351. package/dist/primitives/Dialog.js.map +1 -0
  352. package/dist/primitives/Drawer.js +1685 -0
  353. package/dist/primitives/Drawer.js.map +1 -0
  354. package/dist/primitives/DropdownMenu.js +347 -0
  355. package/dist/primitives/DropdownMenu.js.map +1 -0
  356. package/dist/primitives/Empty.js +43 -0
  357. package/dist/primitives/Empty.js.map +1 -0
  358. package/dist/primitives/Field.js +84 -0
  359. package/dist/primitives/Field.js.map +1 -0
  360. package/dist/primitives/HoverCard.js +267 -0
  361. package/dist/primitives/HoverCard.js.map +1 -0
  362. package/dist/primitives/Input.js +8 -0
  363. package/dist/primitives/Input.js.map +1 -0
  364. package/dist/primitives/InputGroup.js +20 -0
  365. package/dist/primitives/InputGroup.js.map +1 -0
  366. package/dist/primitives/InputOTP.js +59 -0
  367. package/dist/primitives/InputOTP.js.map +1 -0
  368. package/dist/primitives/Item.js +85 -0
  369. package/dist/primitives/Item.js.map +1 -0
  370. package/dist/primitives/Kbd.js +15 -0
  371. package/dist/primitives/Kbd.js.map +1 -0
  372. package/dist/primitives/Label.js +12 -0
  373. package/dist/primitives/Label.js.map +1 -0
  374. package/dist/primitives/Menubar.js +510 -0
  375. package/dist/primitives/Menubar.js.map +1 -0
  376. package/dist/primitives/NativeSelect.js +22 -0
  377. package/dist/primitives/NativeSelect.js.map +1 -0
  378. package/dist/primitives/NavigationMenu.js +823 -0
  379. package/dist/primitives/NavigationMenu.js.map +1 -0
  380. package/dist/primitives/Pagination.js +44 -0
  381. package/dist/primitives/Pagination.js.map +1 -0
  382. package/dist/primitives/Popover.js +416 -0
  383. package/dist/primitives/Popover.js.map +1 -0
  384. package/dist/primitives/Progress.js +103 -0
  385. package/dist/primitives/Progress.js.map +1 -0
  386. package/dist/primitives/RadioGroup.js +299 -0
  387. package/dist/primitives/RadioGroup.js.map +1 -0
  388. package/dist/primitives/Resizable.js +2047 -0
  389. package/dist/primitives/Resizable.js.map +1 -0
  390. package/dist/primitives/ScrollArea.js +731 -0
  391. package/dist/primitives/ScrollArea.js.map +1 -0
  392. package/dist/primitives/Select.js +1286 -0
  393. package/dist/primitives/Select.js.map +1 -0
  394. package/dist/primitives/Separator.js +12 -0
  395. package/dist/primitives/Separator.js.map +1 -0
  396. package/dist/primitives/Sheet.js +35 -0
  397. package/dist/primitives/Sheet.js.map +1 -0
  398. package/dist/primitives/Sidebar.js +265 -0
  399. package/dist/primitives/Sidebar.js.map +1 -0
  400. package/dist/primitives/Skeleton.js +8 -0
  401. package/dist/primitives/Skeleton.js.map +1 -0
  402. package/dist/primitives/Slider.js +569 -0
  403. package/dist/primitives/Slider.js.map +1 -0
  404. package/dist/primitives/Sonner.js +1236 -0
  405. package/dist/primitives/Sonner.js.map +1 -0
  406. package/dist/primitives/Spinner.js +14 -0
  407. package/dist/primitives/Spinner.js.map +1 -0
  408. package/dist/primitives/Switch.js +162 -0
  409. package/dist/primitives/Switch.js.map +1 -0
  410. package/dist/{components → primitives}/Table.d.ts +2 -2
  411. package/dist/primitives/Table.js +36 -0
  412. package/dist/primitives/Table.js.map +1 -0
  413. package/dist/primitives/Tabs.js +224 -0
  414. package/dist/primitives/Tabs.js.map +1 -0
  415. package/dist/primitives/Textarea.js +8 -0
  416. package/dist/primitives/Textarea.js.map +1 -0
  417. package/dist/primitives/Toggle.js +17 -0
  418. package/dist/primitives/Toggle.js.map +1 -0
  419. package/dist/primitives/ToggleGroup.js +199 -0
  420. package/dist/primitives/ToggleGroup.js.map +1 -0
  421. package/dist/primitives/Tooltip.js +28 -0
  422. package/dist/primitives/Tooltip.js.map +1 -0
  423. package/dist/{components → primitives}/Typography.d.ts +1 -1
  424. package/dist/primitives/Typography.js +83 -0
  425. package/dist/primitives/Typography.js.map +1 -0
  426. package/dist/primitives/index.d.ts +55 -0
  427. package/dist/primitives/index.js +110 -0
  428. package/dist/primitives/index.js.map +1 -0
  429. package/dist/reselect-CABQm5hA.js +448 -0
  430. package/dist/reselect-CABQm5hA.js.map +1 -0
  431. package/dist/separator-BbhgePmX.js +36 -0
  432. package/dist/separator-BbhgePmX.js.map +1 -0
  433. package/dist/shadcn/components/badge.d.ts +1 -1
  434. package/dist/shadcn/components/button.d.ts +2 -2
  435. package/dist/shadcn/components/typography.d.ts +2 -2
  436. package/dist/sheet-D1ngftfX.js +39 -0
  437. package/dist/sheet-D1ngftfX.js.map +1 -0
  438. package/dist/skeleton-AR83txPr.js +9 -0
  439. package/dist/skeleton-AR83txPr.js.map +1 -0
  440. package/dist/textarea-BSZwxzjQ.js +9 -0
  441. package/dist/textarea-BSZwxzjQ.js.map +1 -0
  442. package/dist/toggle-2k9K8a5c.js +60 -0
  443. package/dist/toggle-2k9K8a5c.js.map +1 -0
  444. package/dist/tooltip-D5soNrAP.js +517 -0
  445. package/dist/tooltip-D5soNrAP.js.map +1 -0
  446. package/dist/use-mobile-IRjN_mlT.js +19 -0
  447. package/dist/use-mobile-IRjN_mlT.js.map +1 -0
  448. package/dist/utils-DdHUxIdC.js +3207 -0
  449. package/dist/utils-DdHUxIdC.js.map +1 -0
  450. package/dist/x-_o2T3n6D.js +18 -0
  451. package/dist/x-_o2T3n6D.js.map +1 -0
  452. package/package.json +53 -33
  453. /package/dist/{components → primitives}/Accordion.d.ts +0 -0
  454. /package/dist/{components → primitives}/Alert.d.ts +0 -0
  455. /package/dist/{components → primitives}/AlertDialog.d.ts +0 -0
  456. /package/dist/{components → primitives}/AspectRatio.d.ts +0 -0
  457. /package/dist/{components → primitives}/Avatar.d.ts +0 -0
  458. /package/dist/{components → primitives}/Badge.d.ts +0 -0
  459. /package/dist/{components → primitives}/Breadcrumb.d.ts +0 -0
  460. /package/dist/{components → primitives}/ButtonGroup.d.ts +0 -0
  461. /package/dist/{components → primitives}/Calendar.d.ts +0 -0
  462. /package/dist/{components → primitives}/Card.d.ts +0 -0
  463. /package/dist/{components → primitives}/Chart.d.ts +0 -0
  464. /package/dist/{components → primitives}/Checkbox.d.ts +0 -0
  465. /package/dist/{components → primitives}/Collapsible.d.ts +0 -0
  466. /package/dist/{components → primitives}/Combobox.d.ts +0 -0
  467. /package/dist/{components → primitives}/Command.d.ts +0 -0
  468. /package/dist/{components → primitives}/ContextMenu.d.ts +0 -0
  469. /package/dist/{components → primitives}/Dialog.d.ts +0 -0
  470. /package/dist/{components → primitives}/Drawer.d.ts +0 -0
  471. /package/dist/{components → primitives}/DropdownMenu.d.ts +0 -0
  472. /package/dist/{components → primitives}/Empty.d.ts +0 -0
  473. /package/dist/{components → primitives}/Field.d.ts +0 -0
  474. /package/dist/{components → primitives}/HoverCard.d.ts +0 -0
  475. /package/dist/{components → primitives}/Input.d.ts +0 -0
  476. /package/dist/{components → primitives}/InputGroup.d.ts +0 -0
  477. /package/dist/{components → primitives}/InputOTP.d.ts +0 -0
  478. /package/dist/{components → primitives}/Item.d.ts +0 -0
  479. /package/dist/{components → primitives}/Kbd.d.ts +0 -0
  480. /package/dist/{components → primitives}/Label.d.ts +0 -0
  481. /package/dist/{components → primitives}/Menubar.d.ts +0 -0
  482. /package/dist/{components → primitives}/NativeSelect.d.ts +0 -0
  483. /package/dist/{components → primitives}/NavigationMenu.d.ts +0 -0
  484. /package/dist/{components → primitives}/Pagination.d.ts +0 -0
  485. /package/dist/{components → primitives}/Popover.d.ts +0 -0
  486. /package/dist/{components → primitives}/Progress.d.ts +0 -0
  487. /package/dist/{components → primitives}/RadioGroup.d.ts +0 -0
  488. /package/dist/{components → primitives}/Resizable.d.ts +0 -0
  489. /package/dist/{components → primitives}/ScrollArea.d.ts +0 -0
  490. /package/dist/{components → primitives}/Select.d.ts +0 -0
  491. /package/dist/{components → primitives}/Separator.d.ts +0 -0
  492. /package/dist/{components → primitives}/Sheet.d.ts +0 -0
  493. /package/dist/{components → primitives}/Sidebar.d.ts +0 -0
  494. /package/dist/{components → primitives}/Skeleton.d.ts +0 -0
  495. /package/dist/{components → primitives}/Slider.d.ts +0 -0
  496. /package/dist/{components → primitives}/Sonner.d.ts +0 -0
  497. /package/dist/{components → primitives}/Spinner.d.ts +0 -0
  498. /package/dist/{components → primitives}/Switch.d.ts +0 -0
  499. /package/dist/{components → primitives}/Tabs.d.ts +0 -0
  500. /package/dist/{components → primitives}/Textarea.d.ts +0 -0
  501. /package/dist/{components → primitives}/Toggle.d.ts +0 -0
  502. /package/dist/{components → primitives}/ToggleGroup.d.ts +0 -0
  503. /package/dist/{components → primitives}/Tooltip.d.ts +0 -0
@@ -0,0 +1,1129 @@
1
+ import * as React from 'react';
2
+ import { useState } from 'react';
3
+ import { u as useComposedRefs } from './index-BtkPdosV.js';
4
+ import { P as Primitive } from './index-DhnfW8wQ.js';
5
+ import { u as useCallbackRef$1 } from './index-CSUSJzOJ.js';
6
+ import { jsx } from 'react/jsx-runtime';
7
+
8
+ var AUTOFOCUS_ON_MOUNT = "focusScope.autoFocusOnMount";
9
+ var AUTOFOCUS_ON_UNMOUNT = "focusScope.autoFocusOnUnmount";
10
+ var EVENT_OPTIONS = { bubbles: false, cancelable: true };
11
+ var FOCUS_SCOPE_NAME = "FocusScope";
12
+ var FocusScope = React.forwardRef((props, forwardedRef) => {
13
+ const {
14
+ loop = false,
15
+ trapped = false,
16
+ onMountAutoFocus: onMountAutoFocusProp,
17
+ onUnmountAutoFocus: onUnmountAutoFocusProp,
18
+ ...scopeProps
19
+ } = props;
20
+ const [container, setContainer] = React.useState(null);
21
+ const onMountAutoFocus = useCallbackRef$1(onMountAutoFocusProp);
22
+ const onUnmountAutoFocus = useCallbackRef$1(onUnmountAutoFocusProp);
23
+ const lastFocusedElementRef = React.useRef(null);
24
+ const composedRefs = useComposedRefs(forwardedRef, (node) => setContainer(node));
25
+ const focusScope = React.useRef({
26
+ paused: false,
27
+ pause() {
28
+ this.paused = true;
29
+ },
30
+ resume() {
31
+ this.paused = false;
32
+ }
33
+ }).current;
34
+ React.useEffect(() => {
35
+ if (trapped) {
36
+ let handleFocusIn2 = function(event) {
37
+ if (focusScope.paused || !container) return;
38
+ const target = event.target;
39
+ if (container.contains(target)) {
40
+ lastFocusedElementRef.current = target;
41
+ } else {
42
+ focus(lastFocusedElementRef.current, { select: true });
43
+ }
44
+ }, handleFocusOut2 = function(event) {
45
+ if (focusScope.paused || !container) return;
46
+ const relatedTarget = event.relatedTarget;
47
+ if (relatedTarget === null) return;
48
+ if (!container.contains(relatedTarget)) {
49
+ focus(lastFocusedElementRef.current, { select: true });
50
+ }
51
+ }, handleMutations2 = function(mutations) {
52
+ const focusedElement = document.activeElement;
53
+ if (focusedElement !== document.body) return;
54
+ for (const mutation of mutations) {
55
+ if (mutation.removedNodes.length > 0) focus(container);
56
+ }
57
+ };
58
+ document.addEventListener("focusin", handleFocusIn2);
59
+ document.addEventListener("focusout", handleFocusOut2);
60
+ const mutationObserver = new MutationObserver(handleMutations2);
61
+ if (container) mutationObserver.observe(container, { childList: true, subtree: true });
62
+ return () => {
63
+ document.removeEventListener("focusin", handleFocusIn2);
64
+ document.removeEventListener("focusout", handleFocusOut2);
65
+ mutationObserver.disconnect();
66
+ };
67
+ }
68
+ }, [trapped, container, focusScope.paused]);
69
+ React.useEffect(() => {
70
+ if (container) {
71
+ focusScopesStack.add(focusScope);
72
+ const previouslyFocusedElement = document.activeElement;
73
+ const hasFocusedCandidate = container.contains(previouslyFocusedElement);
74
+ if (!hasFocusedCandidate) {
75
+ const mountEvent = new CustomEvent(AUTOFOCUS_ON_MOUNT, EVENT_OPTIONS);
76
+ container.addEventListener(AUTOFOCUS_ON_MOUNT, onMountAutoFocus);
77
+ container.dispatchEvent(mountEvent);
78
+ if (!mountEvent.defaultPrevented) {
79
+ focusFirst(removeLinks(getTabbableCandidates(container)), { select: true });
80
+ if (document.activeElement === previouslyFocusedElement) {
81
+ focus(container);
82
+ }
83
+ }
84
+ }
85
+ return () => {
86
+ container.removeEventListener(AUTOFOCUS_ON_MOUNT, onMountAutoFocus);
87
+ setTimeout(() => {
88
+ const unmountEvent = new CustomEvent(AUTOFOCUS_ON_UNMOUNT, EVENT_OPTIONS);
89
+ container.addEventListener(AUTOFOCUS_ON_UNMOUNT, onUnmountAutoFocus);
90
+ container.dispatchEvent(unmountEvent);
91
+ if (!unmountEvent.defaultPrevented) {
92
+ focus(previouslyFocusedElement ?? document.body, { select: true });
93
+ }
94
+ container.removeEventListener(AUTOFOCUS_ON_UNMOUNT, onUnmountAutoFocus);
95
+ focusScopesStack.remove(focusScope);
96
+ }, 0);
97
+ };
98
+ }
99
+ }, [container, onMountAutoFocus, onUnmountAutoFocus, focusScope]);
100
+ const handleKeyDown = React.useCallback(
101
+ (event) => {
102
+ if (!loop && !trapped) return;
103
+ if (focusScope.paused) return;
104
+ const isTabKey = event.key === "Tab" && !event.altKey && !event.ctrlKey && !event.metaKey;
105
+ const focusedElement = document.activeElement;
106
+ if (isTabKey && focusedElement) {
107
+ const container2 = event.currentTarget;
108
+ const [first, last] = getTabbableEdges(container2);
109
+ const hasTabbableElementsInside = first && last;
110
+ if (!hasTabbableElementsInside) {
111
+ if (focusedElement === container2) event.preventDefault();
112
+ } else {
113
+ if (!event.shiftKey && focusedElement === last) {
114
+ event.preventDefault();
115
+ if (loop) focus(first, { select: true });
116
+ } else if (event.shiftKey && focusedElement === first) {
117
+ event.preventDefault();
118
+ if (loop) focus(last, { select: true });
119
+ }
120
+ }
121
+ }
122
+ },
123
+ [loop, trapped, focusScope.paused]
124
+ );
125
+ return /* @__PURE__ */ jsx(Primitive.div, { tabIndex: -1, ...scopeProps, ref: composedRefs, onKeyDown: handleKeyDown });
126
+ });
127
+ FocusScope.displayName = FOCUS_SCOPE_NAME;
128
+ function focusFirst(candidates, { select = false } = {}) {
129
+ const previouslyFocusedElement = document.activeElement;
130
+ for (const candidate of candidates) {
131
+ focus(candidate, { select });
132
+ if (document.activeElement !== previouslyFocusedElement) return;
133
+ }
134
+ }
135
+ function getTabbableEdges(container) {
136
+ const candidates = getTabbableCandidates(container);
137
+ const first = findVisible(candidates, container);
138
+ const last = findVisible(candidates.reverse(), container);
139
+ return [first, last];
140
+ }
141
+ function getTabbableCandidates(container) {
142
+ const nodes = [];
143
+ const walker = document.createTreeWalker(container, NodeFilter.SHOW_ELEMENT, {
144
+ acceptNode: (node) => {
145
+ const isHiddenInput = node.tagName === "INPUT" && node.type === "hidden";
146
+ if (node.disabled || node.hidden || isHiddenInput) return NodeFilter.FILTER_SKIP;
147
+ return node.tabIndex >= 0 ? NodeFilter.FILTER_ACCEPT : NodeFilter.FILTER_SKIP;
148
+ }
149
+ });
150
+ while (walker.nextNode()) nodes.push(walker.currentNode);
151
+ return nodes;
152
+ }
153
+ function findVisible(elements, container) {
154
+ for (const element of elements) {
155
+ if (!isHidden(element, { upTo: container })) return element;
156
+ }
157
+ }
158
+ function isHidden(node, { upTo }) {
159
+ if (getComputedStyle(node).visibility === "hidden") return true;
160
+ while (node) {
161
+ if (upTo !== void 0 && node === upTo) return false;
162
+ if (getComputedStyle(node).display === "none") return true;
163
+ node = node.parentElement;
164
+ }
165
+ return false;
166
+ }
167
+ function isSelectableInput(element) {
168
+ return element instanceof HTMLInputElement && "select" in element;
169
+ }
170
+ function focus(element, { select = false } = {}) {
171
+ if (element && element.focus) {
172
+ const previouslyFocusedElement = document.activeElement;
173
+ element.focus({ preventScroll: true });
174
+ if (element !== previouslyFocusedElement && isSelectableInput(element) && select)
175
+ element.select();
176
+ }
177
+ }
178
+ var focusScopesStack = createFocusScopesStack();
179
+ function createFocusScopesStack() {
180
+ let stack = [];
181
+ return {
182
+ add(focusScope) {
183
+ const activeFocusScope = stack[0];
184
+ if (focusScope !== activeFocusScope) {
185
+ activeFocusScope?.pause();
186
+ }
187
+ stack = arrayRemove(stack, focusScope);
188
+ stack.unshift(focusScope);
189
+ },
190
+ remove(focusScope) {
191
+ stack = arrayRemove(stack, focusScope);
192
+ stack[0]?.resume();
193
+ }
194
+ };
195
+ }
196
+ function arrayRemove(array, item) {
197
+ const updatedArray = [...array];
198
+ const index = updatedArray.indexOf(item);
199
+ if (index !== -1) {
200
+ updatedArray.splice(index, 1);
201
+ }
202
+ return updatedArray;
203
+ }
204
+ function removeLinks(items) {
205
+ return items.filter((item) => item.tagName !== "A");
206
+ }
207
+
208
+ var count = 0;
209
+ function useFocusGuards() {
210
+ React.useEffect(() => {
211
+ const edgeGuards = document.querySelectorAll("[data-radix-focus-guard]");
212
+ document.body.insertAdjacentElement("afterbegin", edgeGuards[0] ?? createFocusGuard());
213
+ document.body.insertAdjacentElement("beforeend", edgeGuards[1] ?? createFocusGuard());
214
+ count++;
215
+ return () => {
216
+ if (count === 1) {
217
+ document.querySelectorAll("[data-radix-focus-guard]").forEach((node) => node.remove());
218
+ }
219
+ count--;
220
+ };
221
+ }, []);
222
+ }
223
+ function createFocusGuard() {
224
+ const element = document.createElement("span");
225
+ element.setAttribute("data-radix-focus-guard", "");
226
+ element.tabIndex = 0;
227
+ element.style.outline = "none";
228
+ element.style.opacity = "0";
229
+ element.style.position = "fixed";
230
+ element.style.pointerEvents = "none";
231
+ return element;
232
+ }
233
+
234
+ /******************************************************************************
235
+ Copyright (c) Microsoft Corporation.
236
+
237
+ Permission to use, copy, modify, and/or distribute this software for any
238
+ purpose with or without fee is hereby granted.
239
+
240
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
241
+ REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
242
+ AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
243
+ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
244
+ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
245
+ OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
246
+ PERFORMANCE OF THIS SOFTWARE.
247
+ ***************************************************************************** */
248
+ /* global Reflect, Promise, SuppressedError, Symbol, Iterator */
249
+
250
+
251
+ var __assign = function() {
252
+ __assign = Object.assign || function __assign(t) {
253
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
254
+ s = arguments[i];
255
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
256
+ }
257
+ return t;
258
+ };
259
+ return __assign.apply(this, arguments);
260
+ };
261
+
262
+ function __rest(s, e) {
263
+ var t = {};
264
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
265
+ t[p] = s[p];
266
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
267
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
268
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
269
+ t[p[i]] = s[p[i]];
270
+ }
271
+ return t;
272
+ }
273
+
274
+ function __spreadArray(to, from, pack) {
275
+ if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
276
+ if (ar || !(i in from)) {
277
+ if (!ar) ar = Array.prototype.slice.call(from, 0, i);
278
+ ar[i] = from[i];
279
+ }
280
+ }
281
+ return to.concat(ar || Array.prototype.slice.call(from));
282
+ }
283
+
284
+ typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
285
+ var e = new Error(message);
286
+ return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
287
+ };
288
+
289
+ var zeroRightClassName = 'right-scroll-bar-position';
290
+ var fullWidthClassName = 'width-before-scroll-bar';
291
+ var noScrollbarsClassName = 'with-scroll-bars-hidden';
292
+ /**
293
+ * Name of a CSS variable containing the amount of "hidden" scrollbar
294
+ * ! might be undefined ! use will fallback!
295
+ */
296
+ var removedBarSizeVariable = '--removed-body-scroll-bar-size';
297
+
298
+ /**
299
+ * Assigns a value for a given ref, no matter of the ref format
300
+ * @param {RefObject} ref - a callback function or ref object
301
+ * @param value - a new value
302
+ *
303
+ * @see https://github.com/theKashey/use-callback-ref#assignref
304
+ * @example
305
+ * const refObject = useRef();
306
+ * const refFn = (ref) => {....}
307
+ *
308
+ * assignRef(refObject, "refValue");
309
+ * assignRef(refFn, "refValue");
310
+ */
311
+ function assignRef(ref, value) {
312
+ if (typeof ref === 'function') {
313
+ ref(value);
314
+ }
315
+ else if (ref) {
316
+ ref.current = value;
317
+ }
318
+ return ref;
319
+ }
320
+
321
+ /**
322
+ * creates a MutableRef with ref change callback
323
+ * @param initialValue - initial ref value
324
+ * @param {Function} callback - a callback to run when value changes
325
+ *
326
+ * @example
327
+ * const ref = useCallbackRef(0, (newValue, oldValue) => console.log(oldValue, '->', newValue);
328
+ * ref.current = 1;
329
+ * // prints 0 -> 1
330
+ *
331
+ * @see https://reactjs.org/docs/hooks-reference.html#useref
332
+ * @see https://github.com/theKashey/use-callback-ref#usecallbackref---to-replace-reactuseref
333
+ * @returns {MutableRefObject}
334
+ */
335
+ function useCallbackRef(initialValue, callback) {
336
+ var ref = useState(function () { return ({
337
+ // value
338
+ value: initialValue,
339
+ // last callback
340
+ callback: callback,
341
+ // "memoized" public interface
342
+ facade: {
343
+ get current() {
344
+ return ref.value;
345
+ },
346
+ set current(value) {
347
+ var last = ref.value;
348
+ if (last !== value) {
349
+ ref.value = value;
350
+ ref.callback(value, last);
351
+ }
352
+ },
353
+ },
354
+ }); })[0];
355
+ // update callback
356
+ ref.callback = callback;
357
+ return ref.facade;
358
+ }
359
+
360
+ var useIsomorphicLayoutEffect = typeof window !== 'undefined' ? React.useLayoutEffect : React.useEffect;
361
+ var currentValues = new WeakMap();
362
+ /**
363
+ * Merges two or more refs together providing a single interface to set their value
364
+ * @param {RefObject|Ref} refs
365
+ * @returns {MutableRefObject} - a new ref, which translates all changes to {refs}
366
+ *
367
+ * @see {@link mergeRefs} a version without buit-in memoization
368
+ * @see https://github.com/theKashey/use-callback-ref#usemergerefs
369
+ * @example
370
+ * const Component = React.forwardRef((props, ref) => {
371
+ * const ownRef = useRef();
372
+ * const domRef = useMergeRefs([ref, ownRef]); // 👈 merge together
373
+ * return <div ref={domRef}>...</div>
374
+ * }
375
+ */
376
+ function useMergeRefs(refs, defaultValue) {
377
+ var callbackRef = useCallbackRef(null, function (newValue) {
378
+ return refs.forEach(function (ref) { return assignRef(ref, newValue); });
379
+ });
380
+ // handle refs changes - added or removed
381
+ useIsomorphicLayoutEffect(function () {
382
+ var oldValue = currentValues.get(callbackRef);
383
+ if (oldValue) {
384
+ var prevRefs_1 = new Set(oldValue);
385
+ var nextRefs_1 = new Set(refs);
386
+ var current_1 = callbackRef.current;
387
+ prevRefs_1.forEach(function (ref) {
388
+ if (!nextRefs_1.has(ref)) {
389
+ assignRef(ref, null);
390
+ }
391
+ });
392
+ nextRefs_1.forEach(function (ref) {
393
+ if (!prevRefs_1.has(ref)) {
394
+ assignRef(ref, current_1);
395
+ }
396
+ });
397
+ }
398
+ currentValues.set(callbackRef, refs);
399
+ }, [refs]);
400
+ return callbackRef;
401
+ }
402
+
403
+ function ItoI(a) {
404
+ return a;
405
+ }
406
+ function innerCreateMedium(defaults, middleware) {
407
+ if (middleware === void 0) { middleware = ItoI; }
408
+ var buffer = [];
409
+ var assigned = false;
410
+ var medium = {
411
+ read: function () {
412
+ if (assigned) {
413
+ throw new Error('Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.');
414
+ }
415
+ if (buffer.length) {
416
+ return buffer[buffer.length - 1];
417
+ }
418
+ return defaults;
419
+ },
420
+ useMedium: function (data) {
421
+ var item = middleware(data, assigned);
422
+ buffer.push(item);
423
+ return function () {
424
+ buffer = buffer.filter(function (x) { return x !== item; });
425
+ };
426
+ },
427
+ assignSyncMedium: function (cb) {
428
+ assigned = true;
429
+ while (buffer.length) {
430
+ var cbs = buffer;
431
+ buffer = [];
432
+ cbs.forEach(cb);
433
+ }
434
+ buffer = {
435
+ push: function (x) { return cb(x); },
436
+ filter: function () { return buffer; },
437
+ };
438
+ },
439
+ assignMedium: function (cb) {
440
+ assigned = true;
441
+ var pendingQueue = [];
442
+ if (buffer.length) {
443
+ var cbs = buffer;
444
+ buffer = [];
445
+ cbs.forEach(cb);
446
+ pendingQueue = buffer;
447
+ }
448
+ var executeQueue = function () {
449
+ var cbs = pendingQueue;
450
+ pendingQueue = [];
451
+ cbs.forEach(cb);
452
+ };
453
+ var cycle = function () { return Promise.resolve().then(executeQueue); };
454
+ cycle();
455
+ buffer = {
456
+ push: function (x) {
457
+ pendingQueue.push(x);
458
+ cycle();
459
+ },
460
+ filter: function (filter) {
461
+ pendingQueue = pendingQueue.filter(filter);
462
+ return buffer;
463
+ },
464
+ };
465
+ },
466
+ };
467
+ return medium;
468
+ }
469
+ // eslint-disable-next-line @typescript-eslint/ban-types
470
+ function createSidecarMedium(options) {
471
+ if (options === void 0) { options = {}; }
472
+ var medium = innerCreateMedium(null);
473
+ medium.options = __assign({ async: true, ssr: false }, options);
474
+ return medium;
475
+ }
476
+
477
+ var SideCar$1 = function (_a) {
478
+ var sideCar = _a.sideCar, rest = __rest(_a, ["sideCar"]);
479
+ if (!sideCar) {
480
+ throw new Error('Sidecar: please provide `sideCar` property to import the right car');
481
+ }
482
+ var Target = sideCar.read();
483
+ if (!Target) {
484
+ throw new Error('Sidecar medium not found');
485
+ }
486
+ return React.createElement(Target, __assign({}, rest));
487
+ };
488
+ SideCar$1.isSideCarExport = true;
489
+ function exportSidecar(medium, exported) {
490
+ medium.useMedium(exported);
491
+ return SideCar$1;
492
+ }
493
+
494
+ var effectCar = createSidecarMedium();
495
+
496
+ var nothing = function () {
497
+ return;
498
+ };
499
+ /**
500
+ * Removes scrollbar from the page and contain the scroll within the Lock
501
+ */
502
+ var RemoveScroll = React.forwardRef(function (props, parentRef) {
503
+ var ref = React.useRef(null);
504
+ var _a = React.useState({
505
+ onScrollCapture: nothing,
506
+ onWheelCapture: nothing,
507
+ onTouchMoveCapture: nothing,
508
+ }), callbacks = _a[0], setCallbacks = _a[1];
509
+ var forwardProps = props.forwardProps, children = props.children, className = props.className, removeScrollBar = props.removeScrollBar, enabled = props.enabled, shards = props.shards, sideCar = props.sideCar, noRelative = props.noRelative, noIsolation = props.noIsolation, inert = props.inert, allowPinchZoom = props.allowPinchZoom, _b = props.as, Container = _b === void 0 ? 'div' : _b, gapMode = props.gapMode, rest = __rest(props, ["forwardProps", "children", "className", "removeScrollBar", "enabled", "shards", "sideCar", "noRelative", "noIsolation", "inert", "allowPinchZoom", "as", "gapMode"]);
510
+ var SideCar = sideCar;
511
+ var containerRef = useMergeRefs([ref, parentRef]);
512
+ var containerProps = __assign(__assign({}, rest), callbacks);
513
+ return (React.createElement(React.Fragment, null,
514
+ enabled && (React.createElement(SideCar, { sideCar: effectCar, removeScrollBar: removeScrollBar, shards: shards, noRelative: noRelative, noIsolation: noIsolation, inert: inert, setCallbacks: setCallbacks, allowPinchZoom: !!allowPinchZoom, lockRef: ref, gapMode: gapMode })),
515
+ forwardProps ? (React.cloneElement(React.Children.only(children), __assign(__assign({}, containerProps), { ref: containerRef }))) : (React.createElement(Container, __assign({}, containerProps, { className: className, ref: containerRef }), children))));
516
+ });
517
+ RemoveScroll.defaultProps = {
518
+ enabled: true,
519
+ removeScrollBar: true,
520
+ inert: false,
521
+ };
522
+ RemoveScroll.classNames = {
523
+ fullWidth: fullWidthClassName,
524
+ zeroRight: zeroRightClassName,
525
+ };
526
+
527
+ var getNonce = function () {
528
+ if (typeof __webpack_nonce__ !== 'undefined') {
529
+ return __webpack_nonce__;
530
+ }
531
+ return undefined;
532
+ };
533
+
534
+ function makeStyleTag() {
535
+ if (!document)
536
+ return null;
537
+ var tag = document.createElement('style');
538
+ tag.type = 'text/css';
539
+ var nonce = getNonce();
540
+ if (nonce) {
541
+ tag.setAttribute('nonce', nonce);
542
+ }
543
+ return tag;
544
+ }
545
+ function injectStyles(tag, css) {
546
+ // @ts-ignore
547
+ if (tag.styleSheet) {
548
+ // @ts-ignore
549
+ tag.styleSheet.cssText = css;
550
+ }
551
+ else {
552
+ tag.appendChild(document.createTextNode(css));
553
+ }
554
+ }
555
+ function insertStyleTag(tag) {
556
+ var head = document.head || document.getElementsByTagName('head')[0];
557
+ head.appendChild(tag);
558
+ }
559
+ var stylesheetSingleton = function () {
560
+ var counter = 0;
561
+ var stylesheet = null;
562
+ return {
563
+ add: function (style) {
564
+ if (counter == 0) {
565
+ if ((stylesheet = makeStyleTag())) {
566
+ injectStyles(stylesheet, style);
567
+ insertStyleTag(stylesheet);
568
+ }
569
+ }
570
+ counter++;
571
+ },
572
+ remove: function () {
573
+ counter--;
574
+ if (!counter && stylesheet) {
575
+ stylesheet.parentNode && stylesheet.parentNode.removeChild(stylesheet);
576
+ stylesheet = null;
577
+ }
578
+ },
579
+ };
580
+ };
581
+
582
+ /**
583
+ * creates a hook to control style singleton
584
+ * @see {@link styleSingleton} for a safer component version
585
+ * @example
586
+ * ```tsx
587
+ * const useStyle = styleHookSingleton();
588
+ * ///
589
+ * useStyle('body { overflow: hidden}');
590
+ */
591
+ var styleHookSingleton = function () {
592
+ var sheet = stylesheetSingleton();
593
+ return function (styles, isDynamic) {
594
+ React.useEffect(function () {
595
+ sheet.add(styles);
596
+ return function () {
597
+ sheet.remove();
598
+ };
599
+ }, [styles && isDynamic]);
600
+ };
601
+ };
602
+
603
+ /**
604
+ * create a Component to add styles on demand
605
+ * - styles are added when first instance is mounted
606
+ * - styles are removed when the last instance is unmounted
607
+ * - changing styles in runtime does nothing unless dynamic is set. But with multiple components that can lead to the undefined behavior
608
+ */
609
+ var styleSingleton = function () {
610
+ var useStyle = styleHookSingleton();
611
+ var Sheet = function (_a) {
612
+ var styles = _a.styles, dynamic = _a.dynamic;
613
+ useStyle(styles, dynamic);
614
+ return null;
615
+ };
616
+ return Sheet;
617
+ };
618
+
619
+ var zeroGap = {
620
+ left: 0,
621
+ top: 0,
622
+ right: 0,
623
+ gap: 0,
624
+ };
625
+ var parse = function (x) { return parseInt(x || '', 10) || 0; };
626
+ var getOffset = function (gapMode) {
627
+ var cs = window.getComputedStyle(document.body);
628
+ var left = cs[gapMode === 'padding' ? 'paddingLeft' : 'marginLeft'];
629
+ var top = cs[gapMode === 'padding' ? 'paddingTop' : 'marginTop'];
630
+ var right = cs[gapMode === 'padding' ? 'paddingRight' : 'marginRight'];
631
+ return [parse(left), parse(top), parse(right)];
632
+ };
633
+ var getGapWidth = function (gapMode) {
634
+ if (gapMode === void 0) { gapMode = 'margin'; }
635
+ if (typeof window === 'undefined') {
636
+ return zeroGap;
637
+ }
638
+ var offsets = getOffset(gapMode);
639
+ var documentWidth = document.documentElement.clientWidth;
640
+ var windowWidth = window.innerWidth;
641
+ return {
642
+ left: offsets[0],
643
+ top: offsets[1],
644
+ right: offsets[2],
645
+ gap: Math.max(0, windowWidth - documentWidth + offsets[2] - offsets[0]),
646
+ };
647
+ };
648
+
649
+ var Style = styleSingleton();
650
+ var lockAttribute = 'data-scroll-locked';
651
+ // important tip - once we measure scrollBar width and remove them
652
+ // we could not repeat this operation
653
+ // thus we are using style-singleton - only the first "yet correct" style will be applied.
654
+ var getStyles = function (_a, allowRelative, gapMode, important) {
655
+ var left = _a.left, top = _a.top, right = _a.right, gap = _a.gap;
656
+ if (gapMode === void 0) { gapMode = 'margin'; }
657
+ return "\n .".concat(noScrollbarsClassName, " {\n overflow: hidden ").concat(important, ";\n padding-right: ").concat(gap, "px ").concat(important, ";\n }\n body[").concat(lockAttribute, "] {\n overflow: hidden ").concat(important, ";\n overscroll-behavior: contain;\n ").concat([
658
+ allowRelative && "position: relative ".concat(important, ";"),
659
+ gapMode === 'margin' &&
660
+ "\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 "),
661
+ gapMode === 'padding' && "padding-right: ".concat(gap, "px ").concat(important, ";"),
662
+ ]
663
+ .filter(Boolean)
664
+ .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[").concat(lockAttribute, "] {\n ").concat(removedBarSizeVariable, ": ").concat(gap, "px;\n }\n");
665
+ };
666
+ var getCurrentUseCounter = function () {
667
+ var counter = parseInt(document.body.getAttribute(lockAttribute) || '0', 10);
668
+ return isFinite(counter) ? counter : 0;
669
+ };
670
+ var useLockAttribute = function () {
671
+ React.useEffect(function () {
672
+ document.body.setAttribute(lockAttribute, (getCurrentUseCounter() + 1).toString());
673
+ return function () {
674
+ var newCounter = getCurrentUseCounter() - 1;
675
+ if (newCounter <= 0) {
676
+ document.body.removeAttribute(lockAttribute);
677
+ }
678
+ else {
679
+ document.body.setAttribute(lockAttribute, newCounter.toString());
680
+ }
681
+ };
682
+ }, []);
683
+ };
684
+ /**
685
+ * Removes page scrollbar and blocks page scroll when mounted
686
+ */
687
+ var RemoveScrollBar = function (_a) {
688
+ var noRelative = _a.noRelative, noImportant = _a.noImportant, _b = _a.gapMode, gapMode = _b === void 0 ? 'margin' : _b;
689
+ useLockAttribute();
690
+ /*
691
+ gap will be measured on every component mount
692
+ however it will be used only by the "first" invocation
693
+ due to singleton nature of <Style
694
+ */
695
+ var gap = React.useMemo(function () { return getGapWidth(gapMode); }, [gapMode]);
696
+ return React.createElement(Style, { styles: getStyles(gap, !noRelative, gapMode, !noImportant ? '!important' : '') });
697
+ };
698
+
699
+ var passiveSupported = false;
700
+ if (typeof window !== 'undefined') {
701
+ try {
702
+ var options = Object.defineProperty({}, 'passive', {
703
+ get: function () {
704
+ passiveSupported = true;
705
+ return true;
706
+ },
707
+ });
708
+ // @ts-ignore
709
+ window.addEventListener('test', options, options);
710
+ // @ts-ignore
711
+ window.removeEventListener('test', options, options);
712
+ }
713
+ catch (err) {
714
+ passiveSupported = false;
715
+ }
716
+ }
717
+ var nonPassive = passiveSupported ? { passive: false } : false;
718
+
719
+ var alwaysContainsScroll = function (node) {
720
+ // textarea will always _contain_ scroll inside self. It only can be hidden
721
+ return node.tagName === 'TEXTAREA';
722
+ };
723
+ var elementCanBeScrolled = function (node, overflow) {
724
+ if (!(node instanceof Element)) {
725
+ return false;
726
+ }
727
+ var styles = window.getComputedStyle(node);
728
+ return (
729
+ // not-not-scrollable
730
+ styles[overflow] !== 'hidden' &&
731
+ // contains scroll inside self
732
+ !(styles.overflowY === styles.overflowX && !alwaysContainsScroll(node) && styles[overflow] === 'visible'));
733
+ };
734
+ var elementCouldBeVScrolled = function (node) { return elementCanBeScrolled(node, 'overflowY'); };
735
+ var elementCouldBeHScrolled = function (node) { return elementCanBeScrolled(node, 'overflowX'); };
736
+ var locationCouldBeScrolled = function (axis, node) {
737
+ var ownerDocument = node.ownerDocument;
738
+ var current = node;
739
+ do {
740
+ // Skip over shadow root
741
+ if (typeof ShadowRoot !== 'undefined' && current instanceof ShadowRoot) {
742
+ current = current.host;
743
+ }
744
+ var isScrollable = elementCouldBeScrolled(axis, current);
745
+ if (isScrollable) {
746
+ var _a = getScrollVariables(axis, current), scrollHeight = _a[1], clientHeight = _a[2];
747
+ if (scrollHeight > clientHeight) {
748
+ return true;
749
+ }
750
+ }
751
+ current = current.parentNode;
752
+ } while (current && current !== ownerDocument.body);
753
+ return false;
754
+ };
755
+ var getVScrollVariables = function (_a) {
756
+ var scrollTop = _a.scrollTop, scrollHeight = _a.scrollHeight, clientHeight = _a.clientHeight;
757
+ return [
758
+ scrollTop,
759
+ scrollHeight,
760
+ clientHeight,
761
+ ];
762
+ };
763
+ var getHScrollVariables = function (_a) {
764
+ var scrollLeft = _a.scrollLeft, scrollWidth = _a.scrollWidth, clientWidth = _a.clientWidth;
765
+ return [
766
+ scrollLeft,
767
+ scrollWidth,
768
+ clientWidth,
769
+ ];
770
+ };
771
+ var elementCouldBeScrolled = function (axis, node) {
772
+ return axis === 'v' ? elementCouldBeVScrolled(node) : elementCouldBeHScrolled(node);
773
+ };
774
+ var getScrollVariables = function (axis, node) {
775
+ return axis === 'v' ? getVScrollVariables(node) : getHScrollVariables(node);
776
+ };
777
+ var getDirectionFactor = function (axis, direction) {
778
+ /**
779
+ * If the element's direction is rtl (right-to-left), then scrollLeft is 0 when the scrollbar is at its rightmost position,
780
+ * and then increasingly negative as you scroll towards the end of the content.
781
+ * @see https://developer.mozilla.org/en-US/docs/Web/API/Element/scrollLeft
782
+ */
783
+ return axis === 'h' && direction === 'rtl' ? -1 : 1;
784
+ };
785
+ var handleScroll = function (axis, endTarget, event, sourceDelta, noOverscroll) {
786
+ var directionFactor = getDirectionFactor(axis, window.getComputedStyle(endTarget).direction);
787
+ var delta = directionFactor * sourceDelta;
788
+ // find scrollable target
789
+ var target = event.target;
790
+ var targetInLock = endTarget.contains(target);
791
+ var shouldCancelScroll = false;
792
+ var isDeltaPositive = delta > 0;
793
+ var availableScroll = 0;
794
+ var availableScrollTop = 0;
795
+ do {
796
+ if (!target) {
797
+ break;
798
+ }
799
+ var _a = getScrollVariables(axis, target), position = _a[0], scroll_1 = _a[1], capacity = _a[2];
800
+ var elementScroll = scroll_1 - capacity - directionFactor * position;
801
+ if (position || elementScroll) {
802
+ if (elementCouldBeScrolled(axis, target)) {
803
+ availableScroll += elementScroll;
804
+ availableScrollTop += position;
805
+ }
806
+ }
807
+ var parent_1 = target.parentNode;
808
+ // we will "bubble" from ShadowDom in case we are, or just to the parent in normal case
809
+ // this is the same logic used in focus-lock
810
+ target = (parent_1 && parent_1.nodeType === Node.DOCUMENT_FRAGMENT_NODE ? parent_1.host : parent_1);
811
+ } while (
812
+ // portaled content
813
+ (!targetInLock && target !== document.body) ||
814
+ // self content
815
+ (targetInLock && (endTarget.contains(target) || endTarget === target)));
816
+ // handle epsilon around 0 (non standard zoom levels)
817
+ if (isDeltaPositive &&
818
+ ((Math.abs(availableScroll) < 1) || (false))) {
819
+ shouldCancelScroll = true;
820
+ }
821
+ else if (!isDeltaPositive &&
822
+ ((Math.abs(availableScrollTop) < 1) || (false))) {
823
+ shouldCancelScroll = true;
824
+ }
825
+ return shouldCancelScroll;
826
+ };
827
+
828
+ var getTouchXY = function (event) {
829
+ return 'changedTouches' in event ? [event.changedTouches[0].clientX, event.changedTouches[0].clientY] : [0, 0];
830
+ };
831
+ var getDeltaXY = function (event) { return [event.deltaX, event.deltaY]; };
832
+ var extractRef = function (ref) {
833
+ return ref && 'current' in ref ? ref.current : ref;
834
+ };
835
+ var deltaCompare = function (x, y) { return x[0] === y[0] && x[1] === y[1]; };
836
+ var generateStyle = function (id) { return "\n .block-interactivity-".concat(id, " {pointer-events: none;}\n .allow-interactivity-").concat(id, " {pointer-events: all;}\n"); };
837
+ var idCounter = 0;
838
+ var lockStack = [];
839
+ function RemoveScrollSideCar(props) {
840
+ var shouldPreventQueue = React.useRef([]);
841
+ var touchStartRef = React.useRef([0, 0]);
842
+ var activeAxis = React.useRef();
843
+ var id = React.useState(idCounter++)[0];
844
+ var Style = React.useState(styleSingleton)[0];
845
+ var lastProps = React.useRef(props);
846
+ React.useEffect(function () {
847
+ lastProps.current = props;
848
+ }, [props]);
849
+ React.useEffect(function () {
850
+ if (props.inert) {
851
+ document.body.classList.add("block-interactivity-".concat(id));
852
+ var allow_1 = __spreadArray([props.lockRef.current], (props.shards || []).map(extractRef), true).filter(Boolean);
853
+ allow_1.forEach(function (el) { return el.classList.add("allow-interactivity-".concat(id)); });
854
+ return function () {
855
+ document.body.classList.remove("block-interactivity-".concat(id));
856
+ allow_1.forEach(function (el) { return el.classList.remove("allow-interactivity-".concat(id)); });
857
+ };
858
+ }
859
+ return;
860
+ }, [props.inert, props.lockRef.current, props.shards]);
861
+ var shouldCancelEvent = React.useCallback(function (event, parent) {
862
+ if (('touches' in event && event.touches.length === 2) || (event.type === 'wheel' && event.ctrlKey)) {
863
+ return !lastProps.current.allowPinchZoom;
864
+ }
865
+ var touch = getTouchXY(event);
866
+ var touchStart = touchStartRef.current;
867
+ var deltaX = 'deltaX' in event ? event.deltaX : touchStart[0] - touch[0];
868
+ var deltaY = 'deltaY' in event ? event.deltaY : touchStart[1] - touch[1];
869
+ var currentAxis;
870
+ var target = event.target;
871
+ var moveDirection = Math.abs(deltaX) > Math.abs(deltaY) ? 'h' : 'v';
872
+ // allow horizontal touch move on Range inputs. They will not cause any scroll
873
+ if ('touches' in event && moveDirection === 'h' && target.type === 'range') {
874
+ return false;
875
+ }
876
+ // allow drag selection (iOS); check if selection's anchorNode is the same as target or contains target
877
+ var selection = window.getSelection();
878
+ var anchorNode = selection && selection.anchorNode;
879
+ var isTouchingSelection = anchorNode ? anchorNode === target || anchorNode.contains(target) : false;
880
+ if (isTouchingSelection) {
881
+ return false;
882
+ }
883
+ var canBeScrolledInMainDirection = locationCouldBeScrolled(moveDirection, target);
884
+ if (!canBeScrolledInMainDirection) {
885
+ return true;
886
+ }
887
+ if (canBeScrolledInMainDirection) {
888
+ currentAxis = moveDirection;
889
+ }
890
+ else {
891
+ currentAxis = moveDirection === 'v' ? 'h' : 'v';
892
+ canBeScrolledInMainDirection = locationCouldBeScrolled(moveDirection, target);
893
+ // other axis might be not scrollable
894
+ }
895
+ if (!canBeScrolledInMainDirection) {
896
+ return false;
897
+ }
898
+ if (!activeAxis.current && 'changedTouches' in event && (deltaX || deltaY)) {
899
+ activeAxis.current = currentAxis;
900
+ }
901
+ if (!currentAxis) {
902
+ return true;
903
+ }
904
+ var cancelingAxis = activeAxis.current || currentAxis;
905
+ return handleScroll(cancelingAxis, parent, event, cancelingAxis === 'h' ? deltaX : deltaY);
906
+ }, []);
907
+ var shouldPrevent = React.useCallback(function (_event) {
908
+ var event = _event;
909
+ if (!lockStack.length || lockStack[lockStack.length - 1] !== Style) {
910
+ // not the last active
911
+ return;
912
+ }
913
+ var delta = 'deltaY' in event ? getDeltaXY(event) : getTouchXY(event);
914
+ var sourceEvent = shouldPreventQueue.current.filter(function (e) { return e.name === event.type && (e.target === event.target || event.target === e.shadowParent) && deltaCompare(e.delta, delta); })[0];
915
+ // self event, and should be canceled
916
+ if (sourceEvent && sourceEvent.should) {
917
+ if (event.cancelable) {
918
+ event.preventDefault();
919
+ }
920
+ return;
921
+ }
922
+ // outside or shard event
923
+ if (!sourceEvent) {
924
+ var shardNodes = (lastProps.current.shards || [])
925
+ .map(extractRef)
926
+ .filter(Boolean)
927
+ .filter(function (node) { return node.contains(event.target); });
928
+ var shouldStop = shardNodes.length > 0 ? shouldCancelEvent(event, shardNodes[0]) : !lastProps.current.noIsolation;
929
+ if (shouldStop) {
930
+ if (event.cancelable) {
931
+ event.preventDefault();
932
+ }
933
+ }
934
+ }
935
+ }, []);
936
+ var shouldCancel = React.useCallback(function (name, delta, target, should) {
937
+ var event = { name: name, delta: delta, target: target, should: should, shadowParent: getOutermostShadowParent(target) };
938
+ shouldPreventQueue.current.push(event);
939
+ setTimeout(function () {
940
+ shouldPreventQueue.current = shouldPreventQueue.current.filter(function (e) { return e !== event; });
941
+ }, 1);
942
+ }, []);
943
+ var scrollTouchStart = React.useCallback(function (event) {
944
+ touchStartRef.current = getTouchXY(event);
945
+ activeAxis.current = undefined;
946
+ }, []);
947
+ var scrollWheel = React.useCallback(function (event) {
948
+ shouldCancel(event.type, getDeltaXY(event), event.target, shouldCancelEvent(event, props.lockRef.current));
949
+ }, []);
950
+ var scrollTouchMove = React.useCallback(function (event) {
951
+ shouldCancel(event.type, getTouchXY(event), event.target, shouldCancelEvent(event, props.lockRef.current));
952
+ }, []);
953
+ React.useEffect(function () {
954
+ lockStack.push(Style);
955
+ props.setCallbacks({
956
+ onScrollCapture: scrollWheel,
957
+ onWheelCapture: scrollWheel,
958
+ onTouchMoveCapture: scrollTouchMove,
959
+ });
960
+ document.addEventListener('wheel', shouldPrevent, nonPassive);
961
+ document.addEventListener('touchmove', shouldPrevent, nonPassive);
962
+ document.addEventListener('touchstart', scrollTouchStart, nonPassive);
963
+ return function () {
964
+ lockStack = lockStack.filter(function (inst) { return inst !== Style; });
965
+ document.removeEventListener('wheel', shouldPrevent, nonPassive);
966
+ document.removeEventListener('touchmove', shouldPrevent, nonPassive);
967
+ document.removeEventListener('touchstart', scrollTouchStart, nonPassive);
968
+ };
969
+ }, []);
970
+ var removeScrollBar = props.removeScrollBar, inert = props.inert;
971
+ return (React.createElement(React.Fragment, null,
972
+ inert ? React.createElement(Style, { styles: generateStyle(id) }) : null,
973
+ removeScrollBar ? React.createElement(RemoveScrollBar, { noRelative: props.noRelative, gapMode: props.gapMode }) : null));
974
+ }
975
+ function getOutermostShadowParent(node) {
976
+ var shadowParent = null;
977
+ while (node !== null) {
978
+ if (node instanceof ShadowRoot) {
979
+ shadowParent = node.host;
980
+ node = node.host;
981
+ }
982
+ node = node.parentNode;
983
+ }
984
+ return shadowParent;
985
+ }
986
+
987
+ var SideCar = exportSidecar(effectCar, RemoveScrollSideCar);
988
+
989
+ var ReactRemoveScroll = React.forwardRef(function (props, ref) { return (React.createElement(RemoveScroll, __assign({}, props, { ref: ref, sideCar: SideCar }))); });
990
+ ReactRemoveScroll.classNames = RemoveScroll.classNames;
991
+
992
+ var getDefaultParent = function (originalTarget) {
993
+ if (typeof document === 'undefined') {
994
+ return null;
995
+ }
996
+ var sampleTarget = Array.isArray(originalTarget) ? originalTarget[0] : originalTarget;
997
+ return sampleTarget.ownerDocument.body;
998
+ };
999
+ var counterMap = new WeakMap();
1000
+ var uncontrolledNodes = new WeakMap();
1001
+ var markerMap = {};
1002
+ var lockCount = 0;
1003
+ var unwrapHost = function (node) {
1004
+ return node && (node.host || unwrapHost(node.parentNode));
1005
+ };
1006
+ var correctTargets = function (parent, targets) {
1007
+ return targets
1008
+ .map(function (target) {
1009
+ if (parent.contains(target)) {
1010
+ return target;
1011
+ }
1012
+ var correctedTarget = unwrapHost(target);
1013
+ if (correctedTarget && parent.contains(correctedTarget)) {
1014
+ return correctedTarget;
1015
+ }
1016
+ console.error('aria-hidden', target, 'in not contained inside', parent, '. Doing nothing');
1017
+ return null;
1018
+ })
1019
+ .filter(function (x) { return Boolean(x); });
1020
+ };
1021
+ /**
1022
+ * Marks everything except given node(or nodes) as aria-hidden
1023
+ * @param {Element | Element[]} originalTarget - elements to keep on the page
1024
+ * @param [parentNode] - top element, defaults to document.body
1025
+ * @param {String} [markerName] - a special attribute to mark every node
1026
+ * @param {String} [controlAttribute] - html Attribute to control
1027
+ * @return {Undo} undo command
1028
+ */
1029
+ var applyAttributeToOthers = function (originalTarget, parentNode, markerName, controlAttribute) {
1030
+ var targets = correctTargets(parentNode, Array.isArray(originalTarget) ? originalTarget : [originalTarget]);
1031
+ if (!markerMap[markerName]) {
1032
+ markerMap[markerName] = new WeakMap();
1033
+ }
1034
+ var markerCounter = markerMap[markerName];
1035
+ var hiddenNodes = [];
1036
+ var elementsToKeep = new Set();
1037
+ var elementsToStop = new Set(targets);
1038
+ var keep = function (el) {
1039
+ if (!el || elementsToKeep.has(el)) {
1040
+ return;
1041
+ }
1042
+ elementsToKeep.add(el);
1043
+ keep(el.parentNode);
1044
+ };
1045
+ targets.forEach(keep);
1046
+ var deep = function (parent) {
1047
+ if (!parent || elementsToStop.has(parent)) {
1048
+ return;
1049
+ }
1050
+ Array.prototype.forEach.call(parent.children, function (node) {
1051
+ if (elementsToKeep.has(node)) {
1052
+ deep(node);
1053
+ }
1054
+ else {
1055
+ try {
1056
+ var attr = node.getAttribute(controlAttribute);
1057
+ var alreadyHidden = attr !== null && attr !== 'false';
1058
+ var counterValue = (counterMap.get(node) || 0) + 1;
1059
+ var markerValue = (markerCounter.get(node) || 0) + 1;
1060
+ counterMap.set(node, counterValue);
1061
+ markerCounter.set(node, markerValue);
1062
+ hiddenNodes.push(node);
1063
+ if (counterValue === 1 && alreadyHidden) {
1064
+ uncontrolledNodes.set(node, true);
1065
+ }
1066
+ if (markerValue === 1) {
1067
+ node.setAttribute(markerName, 'true');
1068
+ }
1069
+ if (!alreadyHidden) {
1070
+ node.setAttribute(controlAttribute, 'true');
1071
+ }
1072
+ }
1073
+ catch (e) {
1074
+ console.error('aria-hidden: cannot operate on ', node, e);
1075
+ }
1076
+ }
1077
+ });
1078
+ };
1079
+ deep(parentNode);
1080
+ elementsToKeep.clear();
1081
+ lockCount++;
1082
+ return function () {
1083
+ hiddenNodes.forEach(function (node) {
1084
+ var counterValue = counterMap.get(node) - 1;
1085
+ var markerValue = markerCounter.get(node) - 1;
1086
+ counterMap.set(node, counterValue);
1087
+ markerCounter.set(node, markerValue);
1088
+ if (!counterValue) {
1089
+ if (!uncontrolledNodes.has(node)) {
1090
+ node.removeAttribute(controlAttribute);
1091
+ }
1092
+ uncontrolledNodes.delete(node);
1093
+ }
1094
+ if (!markerValue) {
1095
+ node.removeAttribute(markerName);
1096
+ }
1097
+ });
1098
+ lockCount--;
1099
+ if (!lockCount) {
1100
+ // clear
1101
+ counterMap = new WeakMap();
1102
+ counterMap = new WeakMap();
1103
+ uncontrolledNodes = new WeakMap();
1104
+ markerMap = {};
1105
+ }
1106
+ };
1107
+ };
1108
+ /**
1109
+ * Marks everything except given node(or nodes) as aria-hidden
1110
+ * @param {Element | Element[]} originalTarget - elements to keep on the page
1111
+ * @param [parentNode] - top element, defaults to document.body
1112
+ * @param {String} [markerName] - a special attribute to mark every node
1113
+ * @return {Undo} undo command
1114
+ */
1115
+ var hideOthers = function (originalTarget, parentNode, markerName) {
1116
+ if (markerName === void 0) { markerName = 'data-aria-hidden'; }
1117
+ var targets = Array.from(Array.isArray(originalTarget) ? originalTarget : [originalTarget]);
1118
+ var activeParentNode = getDefaultParent(originalTarget);
1119
+ if (!activeParentNode) {
1120
+ return function () { return null; };
1121
+ }
1122
+ // we should not hide aria-live elements - https://github.com/theKashey/aria-hidden/issues/10
1123
+ // and script elements, as they have no impact on accessibility.
1124
+ targets.push.apply(targets, Array.from(activeParentNode.querySelectorAll('[aria-live], script')));
1125
+ return applyAttributeToOthers(targets, activeParentNode, markerName, 'aria-hidden');
1126
+ };
1127
+
1128
+ export { FocusScope as F, ReactRemoveScroll as R, hideOthers as h, useFocusGuards as u };
1129
+ //# sourceMappingURL=index-B4_fVWDx.js.map