@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,1715 @@
1
+ 'use strict';
2
+
3
+ var jsxRuntime = require('react/jsx-runtime');
4
+ var index = require('../index-DAds6mf_.js');
5
+ var React = require('react');
6
+ var utils = require('../utils-CTr7wn5d.js');
7
+ require('../index-COPkC3I5.js');
8
+ require('../index-D-iDn9RI.js');
9
+ require('../index-CGUGhyIp.js');
10
+ require('../index-BwAq9ba8.js');
11
+ require('../index-CCdG4z4E.js');
12
+ require('../index-CyrAgb4H.js');
13
+ require('../index-Bvu9MiFi.js');
14
+ require('../index-DMbj7vXd.js');
15
+ require('react-dom');
16
+ require('../index-lWVw05cs.js');
17
+ require('../index-ChSOMM8b.js');
18
+ require('../index-Df-Ffa3s.js');
19
+ require('../index-DcCSSgb7.js');
20
+
21
+ function _interopNamespace(e) {
22
+ if (e && e.__esModule) return e;
23
+ var n = Object.create(null);
24
+ if (e) {
25
+ Object.keys(e).forEach(function (k) {
26
+ if (k !== 'default') {
27
+ var d = Object.getOwnPropertyDescriptor(e, k);
28
+ Object.defineProperty(n, k, d.get ? d : {
29
+ enumerable: true,
30
+ get: function () { return e[k]; }
31
+ });
32
+ }
33
+ });
34
+ }
35
+ n.default = e;
36
+ return Object.freeze(n);
37
+ }
38
+
39
+ var React__namespace = /*#__PURE__*/_interopNamespace(React);
40
+
41
+ function __insertCSS(code) {
42
+ if (typeof document == 'undefined') return
43
+ let head = document.head || document.getElementsByTagName('head')[0];
44
+ let style = document.createElement('style');
45
+ style.type = 'text/css';
46
+ head.appendChild(style)
47
+ ;style.styleSheet ? (style.styleSheet.cssText = code) : style.appendChild(document.createTextNode(code));
48
+ }
49
+
50
+ const DrawerContext = React__namespace.default.createContext({
51
+ drawerRef: {
52
+ current: null
53
+ },
54
+ overlayRef: {
55
+ current: null
56
+ },
57
+ onPress: ()=>{},
58
+ onRelease: ()=>{},
59
+ onDrag: ()=>{},
60
+ onNestedDrag: ()=>{},
61
+ onNestedOpenChange: ()=>{},
62
+ onNestedRelease: ()=>{},
63
+ openProp: undefined,
64
+ dismissible: false,
65
+ isOpen: false,
66
+ isDragging: false,
67
+ keyboardIsOpen: {
68
+ current: false
69
+ },
70
+ snapPointsOffset: null,
71
+ snapPoints: null,
72
+ handleOnly: false,
73
+ modal: false,
74
+ shouldFade: false,
75
+ activeSnapPoint: null,
76
+ onOpenChange: ()=>{},
77
+ setActiveSnapPoint: ()=>{},
78
+ closeDrawer: ()=>{},
79
+ direction: 'bottom',
80
+ shouldAnimate: {
81
+ current: true
82
+ },
83
+ shouldScaleBackground: false,
84
+ setBackgroundColorOnScale: true,
85
+ noBodyStyles: false,
86
+ container: null,
87
+ autoFocus: false
88
+ });
89
+ const useDrawerContext = ()=>{
90
+ const context = React__namespace.default.useContext(DrawerContext);
91
+ if (!context) {
92
+ throw new Error('useDrawerContext must be used within a Drawer.Root');
93
+ }
94
+ return context;
95
+ };
96
+
97
+ __insertCSS("[data-vaul-drawer]{touch-action:none;will-change:transform;transition:transform .5s cubic-bezier(.32, .72, 0, 1);animation-duration:.5s;animation-timing-function:cubic-bezier(0.32,0.72,0,1)}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=bottom][data-state=open]{animation-name:slideFromBottom}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=bottom][data-state=closed]{animation-name:slideToBottom}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=top][data-state=open]{animation-name:slideFromTop}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=top][data-state=closed]{animation-name:slideToTop}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=left][data-state=open]{animation-name:slideFromLeft}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=left][data-state=closed]{animation-name:slideToLeft}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=right][data-state=open]{animation-name:slideFromRight}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=right][data-state=closed]{animation-name:slideToRight}[data-vaul-drawer][data-vaul-snap-points=true][data-vaul-drawer-direction=bottom]{transform:translate3d(0,var(--initial-transform,100%),0)}[data-vaul-drawer][data-vaul-snap-points=true][data-vaul-drawer-direction=top]{transform:translate3d(0,calc(var(--initial-transform,100%) * -1),0)}[data-vaul-drawer][data-vaul-snap-points=true][data-vaul-drawer-direction=left]{transform:translate3d(calc(var(--initial-transform,100%) * -1),0,0)}[data-vaul-drawer][data-vaul-snap-points=true][data-vaul-drawer-direction=right]{transform:translate3d(var(--initial-transform,100%),0,0)}[data-vaul-drawer][data-vaul-delayed-snap-points=true][data-vaul-drawer-direction=top]{transform:translate3d(0,var(--snap-point-height,0),0)}[data-vaul-drawer][data-vaul-delayed-snap-points=true][data-vaul-drawer-direction=bottom]{transform:translate3d(0,var(--snap-point-height,0),0)}[data-vaul-drawer][data-vaul-delayed-snap-points=true][data-vaul-drawer-direction=left]{transform:translate3d(var(--snap-point-height,0),0,0)}[data-vaul-drawer][data-vaul-delayed-snap-points=true][data-vaul-drawer-direction=right]{transform:translate3d(var(--snap-point-height,0),0,0)}[data-vaul-overlay][data-vaul-snap-points=false]{animation-duration:.5s;animation-timing-function:cubic-bezier(0.32,0.72,0,1)}[data-vaul-overlay][data-vaul-snap-points=false][data-state=open]{animation-name:fadeIn}[data-vaul-overlay][data-state=closed]{animation-name:fadeOut}[data-vaul-animate=false]{animation:none!important}[data-vaul-overlay][data-vaul-snap-points=true]{opacity:0;transition:opacity .5s cubic-bezier(.32, .72, 0, 1)}[data-vaul-overlay][data-vaul-snap-points=true]{opacity:1}[data-vaul-drawer]:not([data-vaul-custom-container=true])::after{content:'';position:absolute;background:inherit;background-color:inherit}[data-vaul-drawer][data-vaul-drawer-direction=top]::after{top:initial;bottom:100%;left:0;right:0;height:200%}[data-vaul-drawer][data-vaul-drawer-direction=bottom]::after{top:100%;bottom:initial;left:0;right:0;height:200%}[data-vaul-drawer][data-vaul-drawer-direction=left]::after{left:initial;right:100%;top:0;bottom:0;width:200%}[data-vaul-drawer][data-vaul-drawer-direction=right]::after{left:100%;right:initial;top:0;bottom:0;width:200%}[data-vaul-overlay][data-vaul-snap-points=true]:not([data-vaul-snap-points-overlay=true]):not(\n[data-state=closed]\n){opacity:0}[data-vaul-overlay][data-vaul-snap-points-overlay=true]{opacity:1}[data-vaul-handle]{display:block;position:relative;opacity:.7;background:#e2e2e4;margin-left:auto;margin-right:auto;height:5px;width:32px;border-radius:1rem;touch-action:pan-y}[data-vaul-handle]:active,[data-vaul-handle]:hover{opacity:1}[data-vaul-handle-hitarea]{position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);width:max(100%,2.75rem);height:max(100%,2.75rem);touch-action:inherit}@media (hover:hover) and (pointer:fine){[data-vaul-drawer]{user-select:none}}@media (pointer:fine){[data-vaul-handle-hitarea]:{width:100%;height:100%}}@keyframes fadeIn{from{opacity:0}to{opacity:1}}@keyframes fadeOut{to{opacity:0}}@keyframes slideFromBottom{from{transform:translate3d(0,var(--initial-transform,100%),0)}to{transform:translate3d(0,0,0)}}@keyframes slideToBottom{to{transform:translate3d(0,var(--initial-transform,100%),0)}}@keyframes slideFromTop{from{transform:translate3d(0,calc(var(--initial-transform,100%) * -1),0)}to{transform:translate3d(0,0,0)}}@keyframes slideToTop{to{transform:translate3d(0,calc(var(--initial-transform,100%) * -1),0)}}@keyframes slideFromLeft{from{transform:translate3d(calc(var(--initial-transform,100%) * -1),0,0)}to{transform:translate3d(0,0,0)}}@keyframes slideToLeft{to{transform:translate3d(calc(var(--initial-transform,100%) * -1),0,0)}}@keyframes slideFromRight{from{transform:translate3d(var(--initial-transform,100%),0,0)}to{transform:translate3d(0,0,0)}}@keyframes slideToRight{to{transform:translate3d(var(--initial-transform,100%),0,0)}}");
98
+
99
+ function isMobileFirefox() {
100
+ const userAgent = navigator.userAgent;
101
+ return typeof window !== 'undefined' && (/Firefox/.test(userAgent) && /Mobile/.test(userAgent) || // Android Firefox
102
+ /FxiOS/.test(userAgent) // iOS Firefox
103
+ );
104
+ }
105
+ function isMac() {
106
+ return testPlatform(/^Mac/);
107
+ }
108
+ function isIPhone() {
109
+ return testPlatform(/^iPhone/);
110
+ }
111
+ function isSafari() {
112
+ return /^((?!chrome|android).)*safari/i.test(navigator.userAgent);
113
+ }
114
+ function isIPad() {
115
+ return testPlatform(/^iPad/) || // iPadOS 13 lies and says it's a Mac, but we can distinguish by detecting touch support.
116
+ isMac() && navigator.maxTouchPoints > 1;
117
+ }
118
+ function isIOS() {
119
+ return isIPhone() || isIPad();
120
+ }
121
+ function testPlatform(re) {
122
+ return typeof window !== 'undefined' && window.navigator != null ? re.test(window.navigator.platform) : undefined;
123
+ }
124
+
125
+ // This code comes from https://github.com/adobe/react-spectrum/blob/main/packages/%40react-aria/overlays/src/usePreventScroll.ts
126
+ const KEYBOARD_BUFFER = 24;
127
+ const useIsomorphicLayoutEffect = typeof window !== 'undefined' ? React.useLayoutEffect : React.useEffect;
128
+ function chain$1(...callbacks) {
129
+ return (...args)=>{
130
+ for (let callback of callbacks){
131
+ if (typeof callback === 'function') {
132
+ callback(...args);
133
+ }
134
+ }
135
+ };
136
+ }
137
+ // @ts-ignore
138
+ const visualViewport = typeof document !== 'undefined' && window.visualViewport;
139
+ function isScrollable(node) {
140
+ let style = window.getComputedStyle(node);
141
+ return /(auto|scroll)/.test(style.overflow + style.overflowX + style.overflowY);
142
+ }
143
+ function getScrollParent(node) {
144
+ if (isScrollable(node)) {
145
+ node = node.parentElement;
146
+ }
147
+ while(node && !isScrollable(node)){
148
+ node = node.parentElement;
149
+ }
150
+ return node || document.scrollingElement || document.documentElement;
151
+ }
152
+ // HTML input types that do not cause the software keyboard to appear.
153
+ const nonTextInputTypes = new Set([
154
+ 'checkbox',
155
+ 'radio',
156
+ 'range',
157
+ 'color',
158
+ 'file',
159
+ 'image',
160
+ 'button',
161
+ 'submit',
162
+ 'reset'
163
+ ]);
164
+ // The number of active usePreventScroll calls. Used to determine whether to revert back to the original page style/scroll position
165
+ let preventScrollCount = 0;
166
+ let restore;
167
+ /**
168
+ * Prevents scrolling on the document body on mount, and
169
+ * restores it on unmount. Also ensures that content does not
170
+ * shift due to the scrollbars disappearing.
171
+ */ function usePreventScroll(options = {}) {
172
+ let { isDisabled } = options;
173
+ useIsomorphicLayoutEffect(()=>{
174
+ if (isDisabled) {
175
+ return;
176
+ }
177
+ preventScrollCount++;
178
+ if (preventScrollCount === 1) {
179
+ if (isIOS()) {
180
+ restore = preventScrollMobileSafari();
181
+ }
182
+ }
183
+ return ()=>{
184
+ preventScrollCount--;
185
+ if (preventScrollCount === 0) {
186
+ restore == null ? void 0 : restore();
187
+ }
188
+ };
189
+ }, [
190
+ isDisabled
191
+ ]);
192
+ }
193
+ // Mobile Safari is a whole different beast. Even with overflow: hidden,
194
+ // it still scrolls the page in many situations:
195
+ //
196
+ // 1. When the bottom toolbar and address bar are collapsed, page scrolling is always allowed.
197
+ // 2. When the keyboard is visible, the viewport does not resize. Instead, the keyboard covers part of
198
+ // it, so it becomes scrollable.
199
+ // 3. When tapping on an input, the page always scrolls so that the input is centered in the visual viewport.
200
+ // This may cause even fixed position elements to scroll off the screen.
201
+ // 4. When using the next/previous buttons in the keyboard to navigate between inputs, the whole page always
202
+ // scrolls, even if the input is inside a nested scrollable element that could be scrolled instead.
203
+ //
204
+ // In order to work around these cases, and prevent scrolling without jankiness, we do a few things:
205
+ //
206
+ // 1. Prevent default on `touchmove` events that are not in a scrollable element. This prevents touch scrolling
207
+ // on the window.
208
+ // 2. Prevent default on `touchmove` events inside a scrollable element when the scroll position is at the
209
+ // top or bottom. This avoids the whole page scrolling instead, but does prevent overscrolling.
210
+ // 3. Prevent default on `touchend` events on input elements and handle focusing the element ourselves.
211
+ // 4. When focusing an input, apply a transform to trick Safari into thinking the input is at the top
212
+ // of the page, which prevents it from scrolling the page. After the input is focused, scroll the element
213
+ // into view ourselves, without scrolling the whole page.
214
+ // 5. Offset the body by the scroll position using a negative margin and scroll to the top. This should appear the
215
+ // same visually, but makes the actual scroll position always zero. This is required to make all of the
216
+ // above work or Safari will still try to scroll the page when focusing an input.
217
+ // 6. As a last resort, handle window scroll events, and scroll back to the top. This can happen when attempting
218
+ // to navigate to an input with the next/previous buttons that's outside a modal.
219
+ function preventScrollMobileSafari() {
220
+ let scrollable;
221
+ let lastY = 0;
222
+ let onTouchStart = (e)=>{
223
+ // Store the nearest scrollable parent element from the element that the user touched.
224
+ scrollable = getScrollParent(e.target);
225
+ if (scrollable === document.documentElement && scrollable === document.body) {
226
+ return;
227
+ }
228
+ lastY = e.changedTouches[0].pageY;
229
+ };
230
+ let onTouchMove = (e)=>{
231
+ // Prevent scrolling the window.
232
+ if (!scrollable || scrollable === document.documentElement || scrollable === document.body) {
233
+ e.preventDefault();
234
+ return;
235
+ }
236
+ // Prevent scrolling up when at the top and scrolling down when at the bottom
237
+ // of a nested scrollable area, otherwise mobile Safari will start scrolling
238
+ // the window instead. Unfortunately, this disables bounce scrolling when at
239
+ // the top but it's the best we can do.
240
+ let y = e.changedTouches[0].pageY;
241
+ let scrollTop = scrollable.scrollTop;
242
+ let bottom = scrollable.scrollHeight - scrollable.clientHeight;
243
+ if (bottom === 0) {
244
+ return;
245
+ }
246
+ if (scrollTop <= 0 && y > lastY || scrollTop >= bottom && y < lastY) {
247
+ e.preventDefault();
248
+ }
249
+ lastY = y;
250
+ };
251
+ let onTouchEnd = (e)=>{
252
+ let target = e.target;
253
+ // Apply this change if we're not already focused on the target element
254
+ if (isInput(target) && target !== document.activeElement) {
255
+ e.preventDefault();
256
+ // Apply a transform to trick Safari into thinking the input is at the top of the page
257
+ // so it doesn't try to scroll it into view. When tapping on an input, this needs to
258
+ // be done before the "focus" event, so we have to focus the element ourselves.
259
+ target.style.transform = 'translateY(-2000px)';
260
+ target.focus();
261
+ requestAnimationFrame(()=>{
262
+ target.style.transform = '';
263
+ });
264
+ }
265
+ };
266
+ let onFocus = (e)=>{
267
+ let target = e.target;
268
+ if (isInput(target)) {
269
+ // Transform also needs to be applied in the focus event in cases where focus moves
270
+ // other than tapping on an input directly, e.g. the next/previous buttons in the
271
+ // software keyboard. In these cases, it seems applying the transform in the focus event
272
+ // is good enough, whereas when tapping an input, it must be done before the focus event. 🤷‍♂️
273
+ target.style.transform = 'translateY(-2000px)';
274
+ requestAnimationFrame(()=>{
275
+ target.style.transform = '';
276
+ // This will have prevented the browser from scrolling the focused element into view,
277
+ // so we need to do this ourselves in a way that doesn't cause the whole page to scroll.
278
+ if (visualViewport) {
279
+ if (visualViewport.height < window.innerHeight) {
280
+ // If the keyboard is already visible, do this after one additional frame
281
+ // to wait for the transform to be removed.
282
+ requestAnimationFrame(()=>{
283
+ scrollIntoView(target);
284
+ });
285
+ } else {
286
+ // Otherwise, wait for the visual viewport to resize before scrolling so we can
287
+ // measure the correct position to scroll to.
288
+ visualViewport.addEventListener('resize', ()=>scrollIntoView(target), {
289
+ once: true
290
+ });
291
+ }
292
+ }
293
+ });
294
+ }
295
+ };
296
+ let onWindowScroll = ()=>{
297
+ // Last resort. If the window scrolled, scroll it back to the top.
298
+ // It should always be at the top because the body will have a negative margin (see below).
299
+ window.scrollTo(0, 0);
300
+ };
301
+ // Record the original scroll position so we can restore it.
302
+ // Then apply a negative margin to the body to offset it by the scroll position. This will
303
+ // enable us to scroll the window to the top, which is required for the rest of this to work.
304
+ let scrollX = window.pageXOffset;
305
+ let scrollY = window.pageYOffset;
306
+ let restoreStyles = chain$1(setStyle(document.documentElement, 'paddingRight', `${window.innerWidth - document.documentElement.clientWidth}px`));
307
+ // Scroll to the top. The negative margin on the body will make this appear the same.
308
+ window.scrollTo(0, 0);
309
+ let removeEvents = chain$1(addEvent(document, 'touchstart', onTouchStart, {
310
+ passive: false,
311
+ capture: true
312
+ }), addEvent(document, 'touchmove', onTouchMove, {
313
+ passive: false,
314
+ capture: true
315
+ }), addEvent(document, 'touchend', onTouchEnd, {
316
+ passive: false,
317
+ capture: true
318
+ }), addEvent(document, 'focus', onFocus, true), addEvent(window, 'scroll', onWindowScroll));
319
+ return ()=>{
320
+ // Restore styles and scroll the page back to where it was.
321
+ restoreStyles();
322
+ removeEvents();
323
+ window.scrollTo(scrollX, scrollY);
324
+ };
325
+ }
326
+ // Sets a CSS property on an element, and returns a function to revert it to the previous value.
327
+ function setStyle(element, style, value) {
328
+ // https://github.com/microsoft/TypeScript/issues/17827#issuecomment-391663310
329
+ // @ts-ignore
330
+ let cur = element.style[style];
331
+ // @ts-ignore
332
+ element.style[style] = value;
333
+ return ()=>{
334
+ // @ts-ignore
335
+ element.style[style] = cur;
336
+ };
337
+ }
338
+ // Adds an event listener to an element, and returns a function to remove it.
339
+ function addEvent(target, event, handler, options) {
340
+ // @ts-ignore
341
+ target.addEventListener(event, handler, options);
342
+ return ()=>{
343
+ // @ts-ignore
344
+ target.removeEventListener(event, handler, options);
345
+ };
346
+ }
347
+ function scrollIntoView(target) {
348
+ let root = document.scrollingElement || document.documentElement;
349
+ while(target && target !== root){
350
+ // Find the parent scrollable element and adjust the scroll position if the target is not already in view.
351
+ let scrollable = getScrollParent(target);
352
+ if (scrollable !== document.documentElement && scrollable !== document.body && scrollable !== target) {
353
+ let scrollableTop = scrollable.getBoundingClientRect().top;
354
+ let targetTop = target.getBoundingClientRect().top;
355
+ let targetBottom = target.getBoundingClientRect().bottom;
356
+ // Buffer is needed for some edge cases
357
+ const keyboardHeight = scrollable.getBoundingClientRect().bottom + KEYBOARD_BUFFER;
358
+ if (targetBottom > keyboardHeight) {
359
+ scrollable.scrollTop += targetTop - scrollableTop;
360
+ }
361
+ }
362
+ // @ts-ignore
363
+ target = scrollable.parentElement;
364
+ }
365
+ }
366
+ function isInput(target) {
367
+ return target instanceof HTMLInputElement && !nonTextInputTypes.has(target.type) || target instanceof HTMLTextAreaElement || target instanceof HTMLElement && target.isContentEditable;
368
+ }
369
+
370
+ // This code comes from https://github.com/radix-ui/primitives/tree/main/packages/react/compose-refs
371
+ /**
372
+ * Set a given ref to a given value
373
+ * This utility takes care of different types of refs: callback refs and RefObject(s)
374
+ */ function setRef(ref, value) {
375
+ if (typeof ref === 'function') {
376
+ ref(value);
377
+ } else if (ref !== null && ref !== undefined) {
378
+ ref.current = value;
379
+ }
380
+ }
381
+ /**
382
+ * A utility to compose multiple refs together
383
+ * Accepts callback refs and RefObject(s)
384
+ */ function composeRefs(...refs) {
385
+ return (node)=>refs.forEach((ref)=>setRef(ref, node));
386
+ }
387
+ /**
388
+ * A custom hook that composes multiple refs
389
+ * Accepts callback refs and RefObject(s)
390
+ */ function useComposedRefs(...refs) {
391
+ // eslint-disable-next-line react-hooks/exhaustive-deps
392
+ return React__namespace.useCallback(composeRefs(...refs), refs);
393
+ }
394
+
395
+ const cache = new WeakMap();
396
+ function set(el, styles, ignoreCache = false) {
397
+ if (!el || !(el instanceof HTMLElement)) return;
398
+ let originalStyles = {};
399
+ Object.entries(styles).forEach(([key, value])=>{
400
+ if (key.startsWith('--')) {
401
+ el.style.setProperty(key, value);
402
+ return;
403
+ }
404
+ originalStyles[key] = el.style[key];
405
+ el.style[key] = value;
406
+ });
407
+ if (ignoreCache) return;
408
+ cache.set(el, originalStyles);
409
+ }
410
+ function reset(el, prop) {
411
+ if (!el || !(el instanceof HTMLElement)) return;
412
+ let originalStyles = cache.get(el);
413
+ if (!originalStyles) {
414
+ return;
415
+ }
416
+ {
417
+ el.style[prop] = originalStyles[prop];
418
+ }
419
+ }
420
+ const isVertical = (direction)=>{
421
+ switch(direction){
422
+ case 'top':
423
+ case 'bottom':
424
+ return true;
425
+ case 'left':
426
+ case 'right':
427
+ return false;
428
+ default:
429
+ return direction;
430
+ }
431
+ };
432
+ function getTranslate(element, direction) {
433
+ if (!element) {
434
+ return null;
435
+ }
436
+ const style = window.getComputedStyle(element);
437
+ const transform = // @ts-ignore
438
+ style.transform || style.webkitTransform || style.mozTransform;
439
+ let mat = transform.match(/^matrix3d\((.+)\)$/);
440
+ if (mat) {
441
+ // https://developer.mozilla.org/en-US/docs/Web/CSS/transform-function/matrix3d
442
+ return parseFloat(mat[1].split(', ')[isVertical(direction) ? 13 : 12]);
443
+ }
444
+ // https://developer.mozilla.org/en-US/docs/Web/CSS/transform-function/matrix
445
+ mat = transform.match(/^matrix\((.+)\)$/);
446
+ return mat ? parseFloat(mat[1].split(', ')[isVertical(direction) ? 5 : 4]) : null;
447
+ }
448
+ function dampenValue(v) {
449
+ return 8 * (Math.log(v + 1) - 2);
450
+ }
451
+ function assignStyle(element, style) {
452
+ if (!element) return ()=>{};
453
+ const prevStyle = element.style.cssText;
454
+ Object.assign(element.style, style);
455
+ return ()=>{
456
+ element.style.cssText = prevStyle;
457
+ };
458
+ }
459
+ /**
460
+ * Receives functions as arguments and returns a new function that calls all.
461
+ */ function chain(...fns) {
462
+ return (...args)=>{
463
+ for (const fn of fns){
464
+ if (typeof fn === 'function') {
465
+ // @ts-ignore
466
+ fn(...args);
467
+ }
468
+ }
469
+ };
470
+ }
471
+
472
+ const TRANSITIONS = {
473
+ DURATION: 0.5,
474
+ EASE: [
475
+ 0.32,
476
+ 0.72,
477
+ 0,
478
+ 1
479
+ ]
480
+ };
481
+ const VELOCITY_THRESHOLD = 0.4;
482
+ const CLOSE_THRESHOLD = 0.25;
483
+ const SCROLL_LOCK_TIMEOUT = 100;
484
+ const BORDER_RADIUS = 8;
485
+ const NESTED_DISPLACEMENT = 16;
486
+ const WINDOW_TOP_OFFSET = 26;
487
+ const DRAG_CLASS = 'vaul-dragging';
488
+
489
+ // This code comes from https://github.com/radix-ui/primitives/blob/main/packages/react/use-controllable-state/src/useControllableState.tsx
490
+ function useCallbackRef(callback) {
491
+ const callbackRef = React__namespace.default.useRef(callback);
492
+ React__namespace.default.useEffect(()=>{
493
+ callbackRef.current = callback;
494
+ });
495
+ // https://github.com/facebook/react/issues/19240
496
+ return React__namespace.default.useMemo(()=>(...args)=>callbackRef.current == null ? void 0 : callbackRef.current.call(callbackRef, ...args), []);
497
+ }
498
+ function useUncontrolledState({ defaultProp, onChange }) {
499
+ const uncontrolledState = React__namespace.default.useState(defaultProp);
500
+ const [value] = uncontrolledState;
501
+ const prevValueRef = React__namespace.default.useRef(value);
502
+ const handleChange = useCallbackRef(onChange);
503
+ React__namespace.default.useEffect(()=>{
504
+ if (prevValueRef.current !== value) {
505
+ handleChange(value);
506
+ prevValueRef.current = value;
507
+ }
508
+ }, [
509
+ value,
510
+ prevValueRef,
511
+ handleChange
512
+ ]);
513
+ return uncontrolledState;
514
+ }
515
+ function useControllableState({ prop, defaultProp, onChange = ()=>{} }) {
516
+ const [uncontrolledProp, setUncontrolledProp] = useUncontrolledState({
517
+ defaultProp,
518
+ onChange
519
+ });
520
+ const isControlled = prop !== undefined;
521
+ const value = isControlled ? prop : uncontrolledProp;
522
+ const handleChange = useCallbackRef(onChange);
523
+ const setValue = React__namespace.default.useCallback((nextValue)=>{
524
+ if (isControlled) {
525
+ const setter = nextValue;
526
+ const value = typeof nextValue === 'function' ? setter(prop) : nextValue;
527
+ if (value !== prop) handleChange(value);
528
+ } else {
529
+ setUncontrolledProp(nextValue);
530
+ }
531
+ }, [
532
+ isControlled,
533
+ prop,
534
+ setUncontrolledProp,
535
+ handleChange
536
+ ]);
537
+ return [
538
+ value,
539
+ setValue
540
+ ];
541
+ }
542
+
543
+ function useSnapPoints({ activeSnapPointProp, setActiveSnapPointProp, snapPoints, drawerRef, overlayRef, fadeFromIndex, onSnapPointChange, direction = 'bottom', container, snapToSequentialPoint }) {
544
+ const [activeSnapPoint, setActiveSnapPoint] = useControllableState({
545
+ prop: activeSnapPointProp,
546
+ defaultProp: snapPoints == null ? void 0 : snapPoints[0],
547
+ onChange: setActiveSnapPointProp
548
+ });
549
+ const [windowDimensions, setWindowDimensions] = React__namespace.default.useState(typeof window !== 'undefined' ? {
550
+ innerWidth: window.innerWidth,
551
+ innerHeight: window.innerHeight
552
+ } : undefined);
553
+ React__namespace.default.useEffect(()=>{
554
+ function onResize() {
555
+ setWindowDimensions({
556
+ innerWidth: window.innerWidth,
557
+ innerHeight: window.innerHeight
558
+ });
559
+ }
560
+ window.addEventListener('resize', onResize);
561
+ return ()=>window.removeEventListener('resize', onResize);
562
+ }, []);
563
+ const isLastSnapPoint = React__namespace.default.useMemo(()=>activeSnapPoint === (snapPoints == null ? void 0 : snapPoints[snapPoints.length - 1]) || null, [
564
+ snapPoints,
565
+ activeSnapPoint
566
+ ]);
567
+ const activeSnapPointIndex = React__namespace.default.useMemo(()=>{
568
+ var _snapPoints_findIndex;
569
+ return (_snapPoints_findIndex = snapPoints == null ? void 0 : snapPoints.findIndex((snapPoint)=>snapPoint === activeSnapPoint)) != null ? _snapPoints_findIndex : null;
570
+ }, [
571
+ snapPoints,
572
+ activeSnapPoint
573
+ ]);
574
+ const shouldFade = snapPoints && snapPoints.length > 0 && (fadeFromIndex || fadeFromIndex === 0) && !Number.isNaN(fadeFromIndex) && snapPoints[fadeFromIndex] === activeSnapPoint || !snapPoints;
575
+ const snapPointsOffset = React__namespace.default.useMemo(()=>{
576
+ const containerSize = container ? {
577
+ width: container.getBoundingClientRect().width,
578
+ height: container.getBoundingClientRect().height
579
+ } : typeof window !== 'undefined' ? {
580
+ width: window.innerWidth,
581
+ height: window.innerHeight
582
+ } : {
583
+ width: 0,
584
+ height: 0
585
+ };
586
+ var _snapPoints_map;
587
+ return (_snapPoints_map = snapPoints == null ? void 0 : snapPoints.map((snapPoint)=>{
588
+ const isPx = typeof snapPoint === 'string';
589
+ let snapPointAsNumber = 0;
590
+ if (isPx) {
591
+ snapPointAsNumber = parseInt(snapPoint, 10);
592
+ }
593
+ if (isVertical(direction)) {
594
+ const height = isPx ? snapPointAsNumber : windowDimensions ? snapPoint * containerSize.height : 0;
595
+ if (windowDimensions) {
596
+ return direction === 'bottom' ? containerSize.height - height : -containerSize.height + height;
597
+ }
598
+ return height;
599
+ }
600
+ const width = isPx ? snapPointAsNumber : windowDimensions ? snapPoint * containerSize.width : 0;
601
+ if (windowDimensions) {
602
+ return direction === 'right' ? containerSize.width - width : -containerSize.width + width;
603
+ }
604
+ return width;
605
+ })) != null ? _snapPoints_map : [];
606
+ }, [
607
+ snapPoints,
608
+ windowDimensions,
609
+ container
610
+ ]);
611
+ const activeSnapPointOffset = React__namespace.default.useMemo(()=>activeSnapPointIndex !== null ? snapPointsOffset == null ? void 0 : snapPointsOffset[activeSnapPointIndex] : null, [
612
+ snapPointsOffset,
613
+ activeSnapPointIndex
614
+ ]);
615
+ const snapToPoint = React__namespace.default.useCallback((dimension)=>{
616
+ var _snapPointsOffset_findIndex;
617
+ const newSnapPointIndex = (_snapPointsOffset_findIndex = snapPointsOffset == null ? void 0 : snapPointsOffset.findIndex((snapPointDim)=>snapPointDim === dimension)) != null ? _snapPointsOffset_findIndex : null;
618
+ onSnapPointChange(newSnapPointIndex);
619
+ set(drawerRef.current, {
620
+ transition: `transform ${TRANSITIONS.DURATION}s cubic-bezier(${TRANSITIONS.EASE.join(',')})`,
621
+ transform: isVertical(direction) ? `translate3d(0, ${dimension}px, 0)` : `translate3d(${dimension}px, 0, 0)`
622
+ });
623
+ if (snapPointsOffset && newSnapPointIndex !== snapPointsOffset.length - 1 && fadeFromIndex !== undefined && newSnapPointIndex !== fadeFromIndex && newSnapPointIndex < fadeFromIndex) {
624
+ set(overlayRef.current, {
625
+ transition: `opacity ${TRANSITIONS.DURATION}s cubic-bezier(${TRANSITIONS.EASE.join(',')})`,
626
+ opacity: '0'
627
+ });
628
+ } else {
629
+ set(overlayRef.current, {
630
+ transition: `opacity ${TRANSITIONS.DURATION}s cubic-bezier(${TRANSITIONS.EASE.join(',')})`,
631
+ opacity: '1'
632
+ });
633
+ }
634
+ setActiveSnapPoint(snapPoints == null ? void 0 : snapPoints[Math.max(newSnapPointIndex, 0)]);
635
+ }, [
636
+ drawerRef.current,
637
+ snapPoints,
638
+ snapPointsOffset,
639
+ fadeFromIndex,
640
+ overlayRef,
641
+ setActiveSnapPoint
642
+ ]);
643
+ React__namespace.default.useEffect(()=>{
644
+ if (activeSnapPoint || activeSnapPointProp) {
645
+ var _snapPoints_findIndex;
646
+ const newIndex = (_snapPoints_findIndex = snapPoints == null ? void 0 : snapPoints.findIndex((snapPoint)=>snapPoint === activeSnapPointProp || snapPoint === activeSnapPoint)) != null ? _snapPoints_findIndex : -1;
647
+ if (snapPointsOffset && newIndex !== -1 && typeof snapPointsOffset[newIndex] === 'number') {
648
+ snapToPoint(snapPointsOffset[newIndex]);
649
+ }
650
+ }
651
+ }, [
652
+ activeSnapPoint,
653
+ activeSnapPointProp,
654
+ snapPoints,
655
+ snapPointsOffset,
656
+ snapToPoint
657
+ ]);
658
+ function onRelease({ draggedDistance, closeDrawer, velocity, dismissible }) {
659
+ if (fadeFromIndex === undefined) return;
660
+ const currentPosition = direction === 'bottom' || direction === 'right' ? (activeSnapPointOffset != null ? activeSnapPointOffset : 0) - draggedDistance : (activeSnapPointOffset != null ? activeSnapPointOffset : 0) + draggedDistance;
661
+ const isOverlaySnapPoint = activeSnapPointIndex === fadeFromIndex - 1;
662
+ const isFirst = activeSnapPointIndex === 0;
663
+ const hasDraggedUp = draggedDistance > 0;
664
+ if (isOverlaySnapPoint) {
665
+ set(overlayRef.current, {
666
+ transition: `opacity ${TRANSITIONS.DURATION}s cubic-bezier(${TRANSITIONS.EASE.join(',')})`
667
+ });
668
+ }
669
+ if (!snapToSequentialPoint && velocity > 2 && !hasDraggedUp) {
670
+ if (dismissible) closeDrawer();
671
+ else snapToPoint(snapPointsOffset[0]); // snap to initial point
672
+ return;
673
+ }
674
+ if (!snapToSequentialPoint && velocity > 2 && hasDraggedUp && snapPointsOffset && snapPoints) {
675
+ snapToPoint(snapPointsOffset[snapPoints.length - 1]);
676
+ return;
677
+ }
678
+ // Find the closest snap point to the current position
679
+ const closestSnapPoint = snapPointsOffset == null ? void 0 : snapPointsOffset.reduce((prev, curr)=>{
680
+ if (typeof prev !== 'number' || typeof curr !== 'number') return prev;
681
+ return Math.abs(curr - currentPosition) < Math.abs(prev - currentPosition) ? curr : prev;
682
+ });
683
+ const dim = isVertical(direction) ? window.innerHeight : window.innerWidth;
684
+ if (velocity > VELOCITY_THRESHOLD && Math.abs(draggedDistance) < dim * 0.4) {
685
+ const dragDirection = hasDraggedUp ? 1 : -1; // 1 = up, -1 = down
686
+ // Don't do anything if we swipe upwards while being on the last snap point
687
+ if (dragDirection > 0 && isLastSnapPoint && snapPoints) {
688
+ snapToPoint(snapPointsOffset[snapPoints.length - 1]);
689
+ return;
690
+ }
691
+ if (isFirst && dragDirection < 0 && dismissible) {
692
+ closeDrawer();
693
+ }
694
+ if (activeSnapPointIndex === null) return;
695
+ snapToPoint(snapPointsOffset[activeSnapPointIndex + dragDirection]);
696
+ return;
697
+ }
698
+ snapToPoint(closestSnapPoint);
699
+ }
700
+ function onDrag({ draggedDistance }) {
701
+ if (activeSnapPointOffset === null) return;
702
+ const newValue = direction === 'bottom' || direction === 'right' ? activeSnapPointOffset - draggedDistance : activeSnapPointOffset + draggedDistance;
703
+ // Don't do anything if we exceed the last(biggest) snap point
704
+ if ((direction === 'bottom' || direction === 'right') && newValue < snapPointsOffset[snapPointsOffset.length - 1]) {
705
+ return;
706
+ }
707
+ if ((direction === 'top' || direction === 'left') && newValue > snapPointsOffset[snapPointsOffset.length - 1]) {
708
+ return;
709
+ }
710
+ set(drawerRef.current, {
711
+ transform: isVertical(direction) ? `translate3d(0, ${newValue}px, 0)` : `translate3d(${newValue}px, 0, 0)`
712
+ });
713
+ }
714
+ function getPercentageDragged(absDraggedDistance, isDraggingDown) {
715
+ if (!snapPoints || typeof activeSnapPointIndex !== 'number' || !snapPointsOffset || fadeFromIndex === undefined) return null;
716
+ // If this is true we are dragging to a snap point that is supposed to have an overlay
717
+ const isOverlaySnapPoint = activeSnapPointIndex === fadeFromIndex - 1;
718
+ const isOverlaySnapPointOrHigher = activeSnapPointIndex >= fadeFromIndex;
719
+ if (isOverlaySnapPointOrHigher && isDraggingDown) {
720
+ return 0;
721
+ }
722
+ // Don't animate, but still use this one if we are dragging away from the overlaySnapPoint
723
+ if (isOverlaySnapPoint && !isDraggingDown) return 1;
724
+ if (!shouldFade && !isOverlaySnapPoint) return null;
725
+ // Either fadeFrom index or the one before
726
+ const targetSnapPointIndex = isOverlaySnapPoint ? activeSnapPointIndex + 1 : activeSnapPointIndex - 1;
727
+ // Get the distance from overlaySnapPoint to the one before or vice-versa to calculate the opacity percentage accordingly
728
+ const snapPointDistance = isOverlaySnapPoint ? snapPointsOffset[targetSnapPointIndex] - snapPointsOffset[targetSnapPointIndex - 1] : snapPointsOffset[targetSnapPointIndex + 1] - snapPointsOffset[targetSnapPointIndex];
729
+ const percentageDragged = absDraggedDistance / Math.abs(snapPointDistance);
730
+ if (isOverlaySnapPoint) {
731
+ return 1 - percentageDragged;
732
+ } else {
733
+ return percentageDragged;
734
+ }
735
+ }
736
+ return {
737
+ isLastSnapPoint,
738
+ activeSnapPoint,
739
+ shouldFade,
740
+ getPercentageDragged,
741
+ setActiveSnapPoint,
742
+ activeSnapPointIndex,
743
+ onRelease,
744
+ onDrag,
745
+ snapPointsOffset
746
+ };
747
+ }
748
+
749
+ const noop = ()=>()=>{};
750
+ function useScaleBackground() {
751
+ const { direction, isOpen, shouldScaleBackground, setBackgroundColorOnScale, noBodyStyles } = useDrawerContext();
752
+ const timeoutIdRef = React__namespace.default.useRef(null);
753
+ const initialBackgroundColor = React.useMemo(()=>document.body.style.backgroundColor, []);
754
+ function getScale() {
755
+ return (window.innerWidth - WINDOW_TOP_OFFSET) / window.innerWidth;
756
+ }
757
+ React__namespace.default.useEffect(()=>{
758
+ if (isOpen && shouldScaleBackground) {
759
+ if (timeoutIdRef.current) clearTimeout(timeoutIdRef.current);
760
+ const wrapper = document.querySelector('[data-vaul-drawer-wrapper]') || document.querySelector('[vaul-drawer-wrapper]');
761
+ if (!wrapper) return;
762
+ chain(setBackgroundColorOnScale && !noBodyStyles ? assignStyle(document.body, {
763
+ background: 'black'
764
+ }) : noop, assignStyle(wrapper, {
765
+ transformOrigin: isVertical(direction) ? 'top' : 'left',
766
+ transitionProperty: 'transform, border-radius',
767
+ transitionDuration: `${TRANSITIONS.DURATION}s`,
768
+ transitionTimingFunction: `cubic-bezier(${TRANSITIONS.EASE.join(',')})`
769
+ }));
770
+ const wrapperStylesCleanup = assignStyle(wrapper, {
771
+ borderRadius: `${BORDER_RADIUS}px`,
772
+ overflow: 'hidden',
773
+ ...isVertical(direction) ? {
774
+ transform: `scale(${getScale()}) translate3d(0, calc(env(safe-area-inset-top) + 14px), 0)`
775
+ } : {
776
+ transform: `scale(${getScale()}) translate3d(calc(env(safe-area-inset-top) + 14px), 0, 0)`
777
+ }
778
+ });
779
+ return ()=>{
780
+ wrapperStylesCleanup();
781
+ timeoutIdRef.current = window.setTimeout(()=>{
782
+ if (initialBackgroundColor) {
783
+ document.body.style.background = initialBackgroundColor;
784
+ } else {
785
+ document.body.style.removeProperty('background');
786
+ }
787
+ }, TRANSITIONS.DURATION * 1000);
788
+ };
789
+ }
790
+ }, [
791
+ isOpen,
792
+ shouldScaleBackground,
793
+ initialBackgroundColor
794
+ ]);
795
+ }
796
+
797
+ let previousBodyPosition = null;
798
+ /**
799
+ * This hook is necessary to prevent buggy behavior on iOS devices (need to test on Android).
800
+ * I won't get into too much detail about what bugs it solves, but so far I've found that setting the body to `position: fixed` is the most reliable way to prevent those bugs.
801
+ * Issues that this hook solves:
802
+ * https://github.com/emilkowalski/vaul/issues/435
803
+ * https://github.com/emilkowalski/vaul/issues/433
804
+ * And more that I discovered, but were just not reported.
805
+ */ function usePositionFixed({ isOpen, modal, nested, hasBeenOpened, preventScrollRestoration, noBodyStyles }) {
806
+ const [activeUrl, setActiveUrl] = React__namespace.default.useState(()=>typeof window !== 'undefined' ? window.location.href : '');
807
+ const scrollPos = React__namespace.default.useRef(0);
808
+ const setPositionFixed = React__namespace.default.useCallback(()=>{
809
+ // All browsers on iOS will return true here.
810
+ if (!isSafari()) return;
811
+ // If previousBodyPosition is already set, don't set it again.
812
+ if (previousBodyPosition === null && isOpen && !noBodyStyles) {
813
+ previousBodyPosition = {
814
+ position: document.body.style.position,
815
+ top: document.body.style.top,
816
+ left: document.body.style.left,
817
+ height: document.body.style.height,
818
+ right: 'unset'
819
+ };
820
+ // Update the dom inside an animation frame
821
+ const { scrollX, innerHeight } = window;
822
+ document.body.style.setProperty('position', 'fixed', 'important');
823
+ Object.assign(document.body.style, {
824
+ top: `${-scrollPos.current}px`,
825
+ left: `${-scrollX}px`,
826
+ right: '0px',
827
+ height: 'auto'
828
+ });
829
+ window.setTimeout(()=>window.requestAnimationFrame(()=>{
830
+ // Attempt to check if the bottom bar appeared due to the position change
831
+ const bottomBarHeight = innerHeight - window.innerHeight;
832
+ if (bottomBarHeight && scrollPos.current >= innerHeight) {
833
+ // Move the content further up so that the bottom bar doesn't hide it
834
+ document.body.style.top = `${-(scrollPos.current + bottomBarHeight)}px`;
835
+ }
836
+ }), 300);
837
+ }
838
+ }, [
839
+ isOpen
840
+ ]);
841
+ const restorePositionSetting = React__namespace.default.useCallback(()=>{
842
+ // All browsers on iOS will return true here.
843
+ if (!isSafari()) return;
844
+ if (previousBodyPosition !== null && !noBodyStyles) {
845
+ // Convert the position from "px" to Int
846
+ const y = -parseInt(document.body.style.top, 10);
847
+ const x = -parseInt(document.body.style.left, 10);
848
+ // Restore styles
849
+ Object.assign(document.body.style, previousBodyPosition);
850
+ window.requestAnimationFrame(()=>{
851
+ if (preventScrollRestoration && activeUrl !== window.location.href) {
852
+ setActiveUrl(window.location.href);
853
+ return;
854
+ }
855
+ window.scrollTo(x, y);
856
+ });
857
+ previousBodyPosition = null;
858
+ }
859
+ }, [
860
+ activeUrl
861
+ ]);
862
+ React__namespace.default.useEffect(()=>{
863
+ function onScroll() {
864
+ scrollPos.current = window.scrollY;
865
+ }
866
+ onScroll();
867
+ window.addEventListener('scroll', onScroll);
868
+ return ()=>{
869
+ window.removeEventListener('scroll', onScroll);
870
+ };
871
+ }, []);
872
+ React__namespace.default.useEffect(()=>{
873
+ if (!modal) return;
874
+ return ()=>{
875
+ if (typeof document === 'undefined') return;
876
+ // Another drawer is opened, safe to ignore the execution
877
+ const hasDrawerOpened = !!document.querySelector('[data-vaul-drawer]');
878
+ if (hasDrawerOpened) return;
879
+ restorePositionSetting();
880
+ };
881
+ }, [
882
+ modal,
883
+ restorePositionSetting
884
+ ]);
885
+ React__namespace.default.useEffect(()=>{
886
+ if (nested || !hasBeenOpened) return;
887
+ // This is needed to force Safari toolbar to show **before** the drawer starts animating to prevent a gnarly shift from happening
888
+ if (isOpen) {
889
+ // avoid for standalone mode (PWA)
890
+ const isStandalone = window.matchMedia('(display-mode: standalone)').matches;
891
+ !isStandalone && setPositionFixed();
892
+ if (!modal) {
893
+ window.setTimeout(()=>{
894
+ restorePositionSetting();
895
+ }, 500);
896
+ }
897
+ } else {
898
+ restorePositionSetting();
899
+ }
900
+ }, [
901
+ isOpen,
902
+ hasBeenOpened,
903
+ activeUrl,
904
+ modal,
905
+ nested,
906
+ setPositionFixed,
907
+ restorePositionSetting
908
+ ]);
909
+ return {
910
+ restorePositionSetting
911
+ };
912
+ }
913
+
914
+ function Root({ open: openProp, onOpenChange, children, onDrag: onDragProp, onRelease: onReleaseProp, snapPoints, shouldScaleBackground = false, setBackgroundColorOnScale = true, closeThreshold = CLOSE_THRESHOLD, scrollLockTimeout = SCROLL_LOCK_TIMEOUT, dismissible = true, handleOnly = false, fadeFromIndex = snapPoints && snapPoints.length - 1, activeSnapPoint: activeSnapPointProp, setActiveSnapPoint: setActiveSnapPointProp, fixed, modal = true, onClose, nested, noBodyStyles = false, direction = 'bottom', defaultOpen = false, disablePreventScroll = true, snapToSequentialPoint = false, preventScrollRestoration = false, repositionInputs = true, onAnimationEnd, container, autoFocus = false }) {
915
+ var _drawerRef_current, _drawerRef_current1;
916
+ const [isOpen = false, setIsOpen] = useControllableState({
917
+ defaultProp: defaultOpen,
918
+ prop: openProp,
919
+ onChange: (o)=>{
920
+ onOpenChange == null ? void 0 : onOpenChange(o);
921
+ if (!o && !nested) {
922
+ restorePositionSetting();
923
+ }
924
+ setTimeout(()=>{
925
+ onAnimationEnd == null ? void 0 : onAnimationEnd(o);
926
+ }, TRANSITIONS.DURATION * 1000);
927
+ if (o && !modal) {
928
+ if (typeof window !== 'undefined') {
929
+ window.requestAnimationFrame(()=>{
930
+ document.body.style.pointerEvents = 'auto';
931
+ });
932
+ }
933
+ }
934
+ if (!o) {
935
+ // This will be removed when the exit animation ends (`500ms`)
936
+ document.body.style.pointerEvents = 'auto';
937
+ }
938
+ }
939
+ });
940
+ const [hasBeenOpened, setHasBeenOpened] = React__namespace.default.useState(false);
941
+ const [isDragging, setIsDragging] = React__namespace.default.useState(false);
942
+ const [justReleased, setJustReleased] = React__namespace.default.useState(false);
943
+ const overlayRef = React__namespace.default.useRef(null);
944
+ const openTime = React__namespace.default.useRef(null);
945
+ const dragStartTime = React__namespace.default.useRef(null);
946
+ const dragEndTime = React__namespace.default.useRef(null);
947
+ const lastTimeDragPrevented = React__namespace.default.useRef(null);
948
+ const isAllowedToDrag = React__namespace.default.useRef(false);
949
+ const nestedOpenChangeTimer = React__namespace.default.useRef(null);
950
+ const pointerStart = React__namespace.default.useRef(0);
951
+ const keyboardIsOpen = React__namespace.default.useRef(false);
952
+ const shouldAnimate = React__namespace.default.useRef(!defaultOpen);
953
+ const previousDiffFromInitial = React__namespace.default.useRef(0);
954
+ const drawerRef = React__namespace.default.useRef(null);
955
+ const drawerHeightRef = React__namespace.default.useRef(((_drawerRef_current = drawerRef.current) == null ? void 0 : _drawerRef_current.getBoundingClientRect().height) || 0);
956
+ const drawerWidthRef = React__namespace.default.useRef(((_drawerRef_current1 = drawerRef.current) == null ? void 0 : _drawerRef_current1.getBoundingClientRect().width) || 0);
957
+ const initialDrawerHeight = React__namespace.default.useRef(0);
958
+ const onSnapPointChange = React__namespace.default.useCallback((activeSnapPointIndex)=>{
959
+ // Change openTime ref when we reach the last snap point to prevent dragging for 500ms incase it's scrollable.
960
+ if (snapPoints && activeSnapPointIndex === snapPointsOffset.length - 1) openTime.current = new Date();
961
+ }, []);
962
+ const { activeSnapPoint, activeSnapPointIndex, setActiveSnapPoint, onRelease: onReleaseSnapPoints, snapPointsOffset, onDrag: onDragSnapPoints, shouldFade, getPercentageDragged: getSnapPointsPercentageDragged } = useSnapPoints({
963
+ snapPoints,
964
+ activeSnapPointProp,
965
+ setActiveSnapPointProp,
966
+ drawerRef,
967
+ fadeFromIndex,
968
+ overlayRef,
969
+ onSnapPointChange,
970
+ direction,
971
+ container,
972
+ snapToSequentialPoint
973
+ });
974
+ usePreventScroll({
975
+ isDisabled: !isOpen || isDragging || !modal || justReleased || !hasBeenOpened || !repositionInputs || !disablePreventScroll
976
+ });
977
+ const { restorePositionSetting } = usePositionFixed({
978
+ isOpen,
979
+ modal,
980
+ nested: nested != null ? nested : false,
981
+ hasBeenOpened,
982
+ preventScrollRestoration,
983
+ noBodyStyles
984
+ });
985
+ function getScale() {
986
+ return (window.innerWidth - WINDOW_TOP_OFFSET) / window.innerWidth;
987
+ }
988
+ function onPress(event) {
989
+ var _drawerRef_current, _drawerRef_current1;
990
+ if (!dismissible && !snapPoints) return;
991
+ if (drawerRef.current && !drawerRef.current.contains(event.target)) return;
992
+ drawerHeightRef.current = ((_drawerRef_current = drawerRef.current) == null ? void 0 : _drawerRef_current.getBoundingClientRect().height) || 0;
993
+ drawerWidthRef.current = ((_drawerRef_current1 = drawerRef.current) == null ? void 0 : _drawerRef_current1.getBoundingClientRect().width) || 0;
994
+ setIsDragging(true);
995
+ dragStartTime.current = new Date();
996
+ // iOS doesn't trigger mouseUp after scrolling so we need to listen to touched in order to disallow dragging
997
+ if (isIOS()) {
998
+ window.addEventListener('touchend', ()=>isAllowedToDrag.current = false, {
999
+ once: true
1000
+ });
1001
+ }
1002
+ // Ensure we maintain correct pointer capture even when going outside of the drawer
1003
+ event.target.setPointerCapture(event.pointerId);
1004
+ pointerStart.current = isVertical(direction) ? event.pageY : event.pageX;
1005
+ }
1006
+ function shouldDrag(el, isDraggingInDirection) {
1007
+ var _window_getSelection;
1008
+ let element = el;
1009
+ const highlightedText = (_window_getSelection = window.getSelection()) == null ? void 0 : _window_getSelection.toString();
1010
+ const swipeAmount = drawerRef.current ? getTranslate(drawerRef.current, direction) : null;
1011
+ const date = new Date();
1012
+ // Fixes https://github.com/emilkowalski/vaul/issues/483
1013
+ if (element.tagName === 'SELECT') {
1014
+ return false;
1015
+ }
1016
+ if (element.hasAttribute('data-vaul-no-drag') || element.closest('[data-vaul-no-drag]')) {
1017
+ return false;
1018
+ }
1019
+ if (direction === 'right' || direction === 'left') {
1020
+ return true;
1021
+ }
1022
+ // Allow scrolling when animating
1023
+ if (openTime.current && date.getTime() - openTime.current.getTime() < 500) {
1024
+ return false;
1025
+ }
1026
+ if (swipeAmount !== null) {
1027
+ if (direction === 'bottom' ? swipeAmount > 0 : swipeAmount < 0) {
1028
+ return true;
1029
+ }
1030
+ }
1031
+ // Don't drag if there's highlighted text
1032
+ if (highlightedText && highlightedText.length > 0) {
1033
+ return false;
1034
+ }
1035
+ // Disallow dragging if drawer was scrolled within `scrollLockTimeout`
1036
+ if (lastTimeDragPrevented.current && date.getTime() - lastTimeDragPrevented.current.getTime() < scrollLockTimeout && swipeAmount === 0) {
1037
+ lastTimeDragPrevented.current = date;
1038
+ return false;
1039
+ }
1040
+ if (isDraggingInDirection) {
1041
+ lastTimeDragPrevented.current = date;
1042
+ // We are dragging down so we should allow scrolling
1043
+ return false;
1044
+ }
1045
+ // Keep climbing up the DOM tree as long as there's a parent
1046
+ while(element){
1047
+ // Check if the element is scrollable
1048
+ if (element.scrollHeight > element.clientHeight) {
1049
+ if (element.scrollTop !== 0) {
1050
+ lastTimeDragPrevented.current = new Date();
1051
+ // The element is scrollable and not scrolled to the top, so don't drag
1052
+ return false;
1053
+ }
1054
+ if (element.getAttribute('role') === 'dialog') {
1055
+ return true;
1056
+ }
1057
+ }
1058
+ // Move up to the parent element
1059
+ element = element.parentNode;
1060
+ }
1061
+ // No scrollable parents not scrolled to the top found, so drag
1062
+ return true;
1063
+ }
1064
+ function onDrag(event) {
1065
+ if (!drawerRef.current) {
1066
+ return;
1067
+ }
1068
+ // We need to know how much of the drawer has been dragged in percentages so that we can transform background accordingly
1069
+ if (isDragging) {
1070
+ const directionMultiplier = direction === 'bottom' || direction === 'right' ? 1 : -1;
1071
+ const draggedDistance = (pointerStart.current - (isVertical(direction) ? event.pageY : event.pageX)) * directionMultiplier;
1072
+ const isDraggingInDirection = draggedDistance > 0;
1073
+ // Pre condition for disallowing dragging in the close direction.
1074
+ const noCloseSnapPointsPreCondition = snapPoints && !dismissible && !isDraggingInDirection;
1075
+ // Disallow dragging down to close when first snap point is the active one and dismissible prop is set to false.
1076
+ if (noCloseSnapPointsPreCondition && activeSnapPointIndex === 0) return;
1077
+ // We need to capture last time when drag with scroll was triggered and have a timeout between
1078
+ const absDraggedDistance = Math.abs(draggedDistance);
1079
+ const wrapper = document.querySelector('[data-vaul-drawer-wrapper]');
1080
+ const drawerDimension = direction === 'bottom' || direction === 'top' ? drawerHeightRef.current : drawerWidthRef.current;
1081
+ // Calculate the percentage dragged, where 1 is the closed position
1082
+ let percentageDragged = absDraggedDistance / drawerDimension;
1083
+ const snapPointPercentageDragged = getSnapPointsPercentageDragged(absDraggedDistance, isDraggingInDirection);
1084
+ if (snapPointPercentageDragged !== null) {
1085
+ percentageDragged = snapPointPercentageDragged;
1086
+ }
1087
+ // Disallow close dragging beyond the smallest snap point.
1088
+ if (noCloseSnapPointsPreCondition && percentageDragged >= 1) {
1089
+ return;
1090
+ }
1091
+ if (!isAllowedToDrag.current && !shouldDrag(event.target, isDraggingInDirection)) return;
1092
+ drawerRef.current.classList.add(DRAG_CLASS);
1093
+ // If shouldDrag gave true once after pressing down on the drawer, we set isAllowedToDrag to true and it will remain true until we let go, there's no reason to disable dragging mid way, ever, and that's the solution to it
1094
+ isAllowedToDrag.current = true;
1095
+ set(drawerRef.current, {
1096
+ transition: 'none'
1097
+ });
1098
+ set(overlayRef.current, {
1099
+ transition: 'none'
1100
+ });
1101
+ if (snapPoints) {
1102
+ onDragSnapPoints({
1103
+ draggedDistance
1104
+ });
1105
+ }
1106
+ // Run this only if snapPoints are not defined or if we are at the last snap point (highest one)
1107
+ if (isDraggingInDirection && !snapPoints) {
1108
+ const dampenedDraggedDistance = dampenValue(draggedDistance);
1109
+ const translateValue = Math.min(dampenedDraggedDistance * -1, 0) * directionMultiplier;
1110
+ set(drawerRef.current, {
1111
+ transform: isVertical(direction) ? `translate3d(0, ${translateValue}px, 0)` : `translate3d(${translateValue}px, 0, 0)`
1112
+ });
1113
+ return;
1114
+ }
1115
+ const opacityValue = 1 - percentageDragged;
1116
+ if (shouldFade || fadeFromIndex && activeSnapPointIndex === fadeFromIndex - 1) {
1117
+ onDragProp == null ? void 0 : onDragProp(event, percentageDragged);
1118
+ set(overlayRef.current, {
1119
+ opacity: `${opacityValue}`,
1120
+ transition: 'none'
1121
+ }, true);
1122
+ }
1123
+ if (wrapper && overlayRef.current && shouldScaleBackground) {
1124
+ // Calculate percentageDragged as a fraction (0 to 1)
1125
+ const scaleValue = Math.min(getScale() + percentageDragged * (1 - getScale()), 1);
1126
+ const borderRadiusValue = 8 - percentageDragged * 8;
1127
+ const translateValue = Math.max(0, 14 - percentageDragged * 14);
1128
+ set(wrapper, {
1129
+ borderRadius: `${borderRadiusValue}px`,
1130
+ transform: isVertical(direction) ? `scale(${scaleValue}) translate3d(0, ${translateValue}px, 0)` : `scale(${scaleValue}) translate3d(${translateValue}px, 0, 0)`,
1131
+ transition: 'none'
1132
+ }, true);
1133
+ }
1134
+ if (!snapPoints) {
1135
+ const translateValue = absDraggedDistance * directionMultiplier;
1136
+ set(drawerRef.current, {
1137
+ transform: isVertical(direction) ? `translate3d(0, ${translateValue}px, 0)` : `translate3d(${translateValue}px, 0, 0)`
1138
+ });
1139
+ }
1140
+ }
1141
+ }
1142
+ React__namespace.default.useEffect(()=>{
1143
+ window.requestAnimationFrame(()=>{
1144
+ shouldAnimate.current = true;
1145
+ });
1146
+ }, []);
1147
+ React__namespace.default.useEffect(()=>{
1148
+ var _window_visualViewport;
1149
+ function onVisualViewportChange() {
1150
+ if (!drawerRef.current || !repositionInputs) return;
1151
+ const focusedElement = document.activeElement;
1152
+ if (isInput(focusedElement) || keyboardIsOpen.current) {
1153
+ var _window_visualViewport;
1154
+ const visualViewportHeight = ((_window_visualViewport = window.visualViewport) == null ? void 0 : _window_visualViewport.height) || 0;
1155
+ const totalHeight = window.innerHeight;
1156
+ // This is the height of the keyboard
1157
+ let diffFromInitial = totalHeight - visualViewportHeight;
1158
+ const drawerHeight = drawerRef.current.getBoundingClientRect().height || 0;
1159
+ // Adjust drawer height only if it's tall enough
1160
+ const isTallEnough = drawerHeight > totalHeight * 0.8;
1161
+ if (!initialDrawerHeight.current) {
1162
+ initialDrawerHeight.current = drawerHeight;
1163
+ }
1164
+ const offsetFromTop = drawerRef.current.getBoundingClientRect().top;
1165
+ // visualViewport height may change due to somq e subtle changes to the keyboard. Checking if the height changed by 60 or more will make sure that they keyboard really changed its open state.
1166
+ if (Math.abs(previousDiffFromInitial.current - diffFromInitial) > 60) {
1167
+ keyboardIsOpen.current = !keyboardIsOpen.current;
1168
+ }
1169
+ if (snapPoints && snapPoints.length > 0 && snapPointsOffset && activeSnapPointIndex) {
1170
+ const activeSnapPointHeight = snapPointsOffset[activeSnapPointIndex] || 0;
1171
+ diffFromInitial += activeSnapPointHeight;
1172
+ }
1173
+ previousDiffFromInitial.current = diffFromInitial;
1174
+ // We don't have to change the height if the input is in view, when we are here we are in the opened keyboard state so we can correctly check if the input is in view
1175
+ if (drawerHeight > visualViewportHeight || keyboardIsOpen.current) {
1176
+ const height = drawerRef.current.getBoundingClientRect().height;
1177
+ let newDrawerHeight = height;
1178
+ if (height > visualViewportHeight) {
1179
+ newDrawerHeight = visualViewportHeight - (isTallEnough ? offsetFromTop : WINDOW_TOP_OFFSET);
1180
+ }
1181
+ // When fixed, don't move the drawer upwards if there's space, but rather only change it's height so it's fully scrollable when the keyboard is open
1182
+ if (fixed) {
1183
+ drawerRef.current.style.height = `${height - Math.max(diffFromInitial, 0)}px`;
1184
+ } else {
1185
+ drawerRef.current.style.height = `${Math.max(newDrawerHeight, visualViewportHeight - offsetFromTop)}px`;
1186
+ }
1187
+ } else if (!isMobileFirefox()) {
1188
+ drawerRef.current.style.height = `${initialDrawerHeight.current}px`;
1189
+ }
1190
+ if (snapPoints && snapPoints.length > 0 && !keyboardIsOpen.current) {
1191
+ drawerRef.current.style.bottom = `0px`;
1192
+ } else {
1193
+ // Negative bottom value would never make sense
1194
+ drawerRef.current.style.bottom = `${Math.max(diffFromInitial, 0)}px`;
1195
+ }
1196
+ }
1197
+ }
1198
+ (_window_visualViewport = window.visualViewport) == null ? void 0 : _window_visualViewport.addEventListener('resize', onVisualViewportChange);
1199
+ return ()=>{
1200
+ var _window_visualViewport;
1201
+ return (_window_visualViewport = window.visualViewport) == null ? void 0 : _window_visualViewport.removeEventListener('resize', onVisualViewportChange);
1202
+ };
1203
+ }, [
1204
+ activeSnapPointIndex,
1205
+ snapPoints,
1206
+ snapPointsOffset
1207
+ ]);
1208
+ function closeDrawer(fromWithin) {
1209
+ cancelDrag();
1210
+ onClose == null ? void 0 : onClose();
1211
+ if (!fromWithin) {
1212
+ setIsOpen(false);
1213
+ }
1214
+ setTimeout(()=>{
1215
+ if (snapPoints) {
1216
+ setActiveSnapPoint(snapPoints[0]);
1217
+ }
1218
+ }, TRANSITIONS.DURATION * 1000); // seconds to ms
1219
+ }
1220
+ function resetDrawer() {
1221
+ if (!drawerRef.current) return;
1222
+ const wrapper = document.querySelector('[data-vaul-drawer-wrapper]');
1223
+ const currentSwipeAmount = getTranslate(drawerRef.current, direction);
1224
+ set(drawerRef.current, {
1225
+ transform: 'translate3d(0, 0, 0)',
1226
+ transition: `transform ${TRANSITIONS.DURATION}s cubic-bezier(${TRANSITIONS.EASE.join(',')})`
1227
+ });
1228
+ set(overlayRef.current, {
1229
+ transition: `opacity ${TRANSITIONS.DURATION}s cubic-bezier(${TRANSITIONS.EASE.join(',')})`,
1230
+ opacity: '1'
1231
+ });
1232
+ // Don't reset background if swiped upwards
1233
+ if (shouldScaleBackground && currentSwipeAmount && currentSwipeAmount > 0 && isOpen) {
1234
+ set(wrapper, {
1235
+ borderRadius: `${BORDER_RADIUS}px`,
1236
+ overflow: 'hidden',
1237
+ ...isVertical(direction) ? {
1238
+ transform: `scale(${getScale()}) translate3d(0, calc(env(safe-area-inset-top) + 14px), 0)`,
1239
+ transformOrigin: 'top'
1240
+ } : {
1241
+ transform: `scale(${getScale()}) translate3d(calc(env(safe-area-inset-top) + 14px), 0, 0)`,
1242
+ transformOrigin: 'left'
1243
+ },
1244
+ transitionProperty: 'transform, border-radius',
1245
+ transitionDuration: `${TRANSITIONS.DURATION}s`,
1246
+ transitionTimingFunction: `cubic-bezier(${TRANSITIONS.EASE.join(',')})`
1247
+ }, true);
1248
+ }
1249
+ }
1250
+ function cancelDrag() {
1251
+ if (!isDragging || !drawerRef.current) return;
1252
+ drawerRef.current.classList.remove(DRAG_CLASS);
1253
+ isAllowedToDrag.current = false;
1254
+ setIsDragging(false);
1255
+ dragEndTime.current = new Date();
1256
+ }
1257
+ function onRelease(event) {
1258
+ if (!isDragging || !drawerRef.current) return;
1259
+ drawerRef.current.classList.remove(DRAG_CLASS);
1260
+ isAllowedToDrag.current = false;
1261
+ setIsDragging(false);
1262
+ dragEndTime.current = new Date();
1263
+ const swipeAmount = getTranslate(drawerRef.current, direction);
1264
+ if (!event || !shouldDrag(event.target, false) || !swipeAmount || Number.isNaN(swipeAmount)) return;
1265
+ if (dragStartTime.current === null) return;
1266
+ const timeTaken = dragEndTime.current.getTime() - dragStartTime.current.getTime();
1267
+ const distMoved = pointerStart.current - (isVertical(direction) ? event.pageY : event.pageX);
1268
+ const velocity = Math.abs(distMoved) / timeTaken;
1269
+ if (velocity > 0.05) {
1270
+ // `justReleased` is needed to prevent the drawer from focusing on an input when the drag ends, as it's not the intent most of the time.
1271
+ setJustReleased(true);
1272
+ setTimeout(()=>{
1273
+ setJustReleased(false);
1274
+ }, 200);
1275
+ }
1276
+ if (snapPoints) {
1277
+ const directionMultiplier = direction === 'bottom' || direction === 'right' ? 1 : -1;
1278
+ onReleaseSnapPoints({
1279
+ draggedDistance: distMoved * directionMultiplier,
1280
+ closeDrawer,
1281
+ velocity,
1282
+ dismissible
1283
+ });
1284
+ onReleaseProp == null ? void 0 : onReleaseProp(event, true);
1285
+ return;
1286
+ }
1287
+ // Moved upwards, don't do anything
1288
+ if (direction === 'bottom' || direction === 'right' ? distMoved > 0 : distMoved < 0) {
1289
+ resetDrawer();
1290
+ onReleaseProp == null ? void 0 : onReleaseProp(event, true);
1291
+ return;
1292
+ }
1293
+ if (velocity > VELOCITY_THRESHOLD) {
1294
+ closeDrawer();
1295
+ onReleaseProp == null ? void 0 : onReleaseProp(event, false);
1296
+ return;
1297
+ }
1298
+ var _drawerRef_current_getBoundingClientRect_height;
1299
+ const visibleDrawerHeight = Math.min((_drawerRef_current_getBoundingClientRect_height = drawerRef.current.getBoundingClientRect().height) != null ? _drawerRef_current_getBoundingClientRect_height : 0, window.innerHeight);
1300
+ var _drawerRef_current_getBoundingClientRect_width;
1301
+ const visibleDrawerWidth = Math.min((_drawerRef_current_getBoundingClientRect_width = drawerRef.current.getBoundingClientRect().width) != null ? _drawerRef_current_getBoundingClientRect_width : 0, window.innerWidth);
1302
+ const isHorizontalSwipe = direction === 'left' || direction === 'right';
1303
+ if (Math.abs(swipeAmount) >= (isHorizontalSwipe ? visibleDrawerWidth : visibleDrawerHeight) * closeThreshold) {
1304
+ closeDrawer();
1305
+ onReleaseProp == null ? void 0 : onReleaseProp(event, false);
1306
+ return;
1307
+ }
1308
+ onReleaseProp == null ? void 0 : onReleaseProp(event, true);
1309
+ resetDrawer();
1310
+ }
1311
+ React__namespace.default.useEffect(()=>{
1312
+ // Trigger enter animation without using CSS animation
1313
+ if (isOpen) {
1314
+ set(document.documentElement, {
1315
+ scrollBehavior: 'auto'
1316
+ });
1317
+ openTime.current = new Date();
1318
+ }
1319
+ return ()=>{
1320
+ reset(document.documentElement, 'scrollBehavior');
1321
+ };
1322
+ }, [
1323
+ isOpen
1324
+ ]);
1325
+ function onNestedOpenChange(o) {
1326
+ const scale = o ? (window.innerWidth - NESTED_DISPLACEMENT) / window.innerWidth : 1;
1327
+ const initialTranslate = o ? -NESTED_DISPLACEMENT : 0;
1328
+ if (nestedOpenChangeTimer.current) {
1329
+ window.clearTimeout(nestedOpenChangeTimer.current);
1330
+ }
1331
+ set(drawerRef.current, {
1332
+ transition: `transform ${TRANSITIONS.DURATION}s cubic-bezier(${TRANSITIONS.EASE.join(',')})`,
1333
+ transform: isVertical(direction) ? `scale(${scale}) translate3d(0, ${initialTranslate}px, 0)` : `scale(${scale}) translate3d(${initialTranslate}px, 0, 0)`
1334
+ });
1335
+ if (!o && drawerRef.current) {
1336
+ nestedOpenChangeTimer.current = setTimeout(()=>{
1337
+ const translateValue = getTranslate(drawerRef.current, direction);
1338
+ set(drawerRef.current, {
1339
+ transition: 'none',
1340
+ transform: isVertical(direction) ? `translate3d(0, ${translateValue}px, 0)` : `translate3d(${translateValue}px, 0, 0)`
1341
+ });
1342
+ }, 500);
1343
+ }
1344
+ }
1345
+ function onNestedDrag(_event, percentageDragged) {
1346
+ if (percentageDragged < 0) return;
1347
+ const initialScale = (window.innerWidth - NESTED_DISPLACEMENT) / window.innerWidth;
1348
+ const newScale = initialScale + percentageDragged * (1 - initialScale);
1349
+ const newTranslate = -NESTED_DISPLACEMENT + percentageDragged * NESTED_DISPLACEMENT;
1350
+ set(drawerRef.current, {
1351
+ transform: isVertical(direction) ? `scale(${newScale}) translate3d(0, ${newTranslate}px, 0)` : `scale(${newScale}) translate3d(${newTranslate}px, 0, 0)`,
1352
+ transition: 'none'
1353
+ });
1354
+ }
1355
+ function onNestedRelease(_event, o) {
1356
+ const dim = isVertical(direction) ? window.innerHeight : window.innerWidth;
1357
+ const scale = o ? (dim - NESTED_DISPLACEMENT) / dim : 1;
1358
+ const translate = o ? -NESTED_DISPLACEMENT : 0;
1359
+ if (o) {
1360
+ set(drawerRef.current, {
1361
+ transition: `transform ${TRANSITIONS.DURATION}s cubic-bezier(${TRANSITIONS.EASE.join(',')})`,
1362
+ transform: isVertical(direction) ? `scale(${scale}) translate3d(0, ${translate}px, 0)` : `scale(${scale}) translate3d(${translate}px, 0, 0)`
1363
+ });
1364
+ }
1365
+ }
1366
+ React__namespace.default.useEffect(()=>{
1367
+ if (!modal) {
1368
+ // Need to do this manually unfortunately
1369
+ window.requestAnimationFrame(()=>{
1370
+ document.body.style.pointerEvents = 'auto';
1371
+ });
1372
+ }
1373
+ }, [
1374
+ modal
1375
+ ]);
1376
+ return /*#__PURE__*/ React__namespace.default.createElement(index.Root, {
1377
+ defaultOpen: defaultOpen,
1378
+ onOpenChange: (open)=>{
1379
+ if (!dismissible && !open) return;
1380
+ if (open) {
1381
+ setHasBeenOpened(true);
1382
+ } else {
1383
+ closeDrawer(true);
1384
+ }
1385
+ setIsOpen(open);
1386
+ },
1387
+ open: isOpen
1388
+ }, /*#__PURE__*/ React__namespace.default.createElement(DrawerContext.Provider, {
1389
+ value: {
1390
+ activeSnapPoint,
1391
+ snapPoints,
1392
+ setActiveSnapPoint,
1393
+ drawerRef,
1394
+ overlayRef,
1395
+ onOpenChange,
1396
+ onPress,
1397
+ onRelease,
1398
+ onDrag,
1399
+ dismissible,
1400
+ shouldAnimate,
1401
+ handleOnly,
1402
+ isOpen,
1403
+ isDragging,
1404
+ shouldFade,
1405
+ closeDrawer,
1406
+ onNestedDrag,
1407
+ onNestedOpenChange,
1408
+ onNestedRelease,
1409
+ keyboardIsOpen,
1410
+ modal,
1411
+ snapPointsOffset,
1412
+ activeSnapPointIndex,
1413
+ direction,
1414
+ shouldScaleBackground,
1415
+ setBackgroundColorOnScale,
1416
+ noBodyStyles,
1417
+ container,
1418
+ autoFocus
1419
+ }
1420
+ }, children));
1421
+ }
1422
+ const Overlay = /*#__PURE__*/ React__namespace.default.forwardRef(function({ ...rest }, ref) {
1423
+ const { overlayRef, snapPoints, onRelease, shouldFade, isOpen, modal, shouldAnimate } = useDrawerContext();
1424
+ const composedRef = useComposedRefs(ref, overlayRef);
1425
+ const hasSnapPoints = snapPoints && snapPoints.length > 0;
1426
+ // Overlay is the component that is locking scroll, removing it will unlock the scroll without having to dig into Radix's Dialog library
1427
+ if (!modal) {
1428
+ return null;
1429
+ }
1430
+ const onMouseUp = React__namespace.default.useCallback((event)=>onRelease(event), [
1431
+ onRelease
1432
+ ]);
1433
+ return /*#__PURE__*/ React__namespace.default.createElement(index.Overlay, {
1434
+ onMouseUp: onMouseUp,
1435
+ ref: composedRef,
1436
+ "data-vaul-overlay": "",
1437
+ "data-vaul-snap-points": isOpen && hasSnapPoints ? 'true' : 'false',
1438
+ "data-vaul-snap-points-overlay": isOpen && shouldFade ? 'true' : 'false',
1439
+ "data-vaul-animate": (shouldAnimate == null ? void 0 : shouldAnimate.current) ? 'true' : 'false',
1440
+ ...rest
1441
+ });
1442
+ });
1443
+ Overlay.displayName = 'Drawer.Overlay';
1444
+ const Content = /*#__PURE__*/ React__namespace.default.forwardRef(function({ onPointerDownOutside, style, onOpenAutoFocus, ...rest }, ref) {
1445
+ const { drawerRef, onPress, onRelease, onDrag, keyboardIsOpen, snapPointsOffset, activeSnapPointIndex, modal, isOpen, direction, snapPoints, container, handleOnly, shouldAnimate, autoFocus } = useDrawerContext();
1446
+ // Needed to use transition instead of animations
1447
+ const [delayedSnapPoints, setDelayedSnapPoints] = React__namespace.default.useState(false);
1448
+ const composedRef = useComposedRefs(ref, drawerRef);
1449
+ const pointerStartRef = React__namespace.default.useRef(null);
1450
+ const lastKnownPointerEventRef = React__namespace.default.useRef(null);
1451
+ const wasBeyondThePointRef = React__namespace.default.useRef(false);
1452
+ const hasSnapPoints = snapPoints && snapPoints.length > 0;
1453
+ useScaleBackground();
1454
+ const isDeltaInDirection = (delta, direction, threshold = 0)=>{
1455
+ if (wasBeyondThePointRef.current) return true;
1456
+ const deltaY = Math.abs(delta.y);
1457
+ const deltaX = Math.abs(delta.x);
1458
+ const isDeltaX = deltaX > deltaY;
1459
+ const dFactor = [
1460
+ 'bottom',
1461
+ 'right'
1462
+ ].includes(direction) ? 1 : -1;
1463
+ if (direction === 'left' || direction === 'right') {
1464
+ const isReverseDirection = delta.x * dFactor < 0;
1465
+ if (!isReverseDirection && deltaX >= 0 && deltaX <= threshold) {
1466
+ return isDeltaX;
1467
+ }
1468
+ } else {
1469
+ const isReverseDirection = delta.y * dFactor < 0;
1470
+ if (!isReverseDirection && deltaY >= 0 && deltaY <= threshold) {
1471
+ return !isDeltaX;
1472
+ }
1473
+ }
1474
+ wasBeyondThePointRef.current = true;
1475
+ return true;
1476
+ };
1477
+ React__namespace.default.useEffect(()=>{
1478
+ if (hasSnapPoints) {
1479
+ window.requestAnimationFrame(()=>{
1480
+ setDelayedSnapPoints(true);
1481
+ });
1482
+ }
1483
+ }, []);
1484
+ function handleOnPointerUp(event) {
1485
+ pointerStartRef.current = null;
1486
+ wasBeyondThePointRef.current = false;
1487
+ onRelease(event);
1488
+ }
1489
+ return /*#__PURE__*/ React__namespace.default.createElement(index.Content, {
1490
+ "data-vaul-drawer-direction": direction,
1491
+ "data-vaul-drawer": "",
1492
+ "data-vaul-delayed-snap-points": delayedSnapPoints ? 'true' : 'false',
1493
+ "data-vaul-snap-points": isOpen && hasSnapPoints ? 'true' : 'false',
1494
+ "data-vaul-custom-container": container ? 'true' : 'false',
1495
+ "data-vaul-animate": (shouldAnimate == null ? void 0 : shouldAnimate.current) ? 'true' : 'false',
1496
+ ...rest,
1497
+ ref: composedRef,
1498
+ style: snapPointsOffset && snapPointsOffset.length > 0 ? {
1499
+ '--snap-point-height': `${snapPointsOffset[activeSnapPointIndex != null ? activeSnapPointIndex : 0]}px`,
1500
+ ...style
1501
+ } : style,
1502
+ onPointerDown: (event)=>{
1503
+ if (handleOnly) return;
1504
+ rest.onPointerDown == null ? void 0 : rest.onPointerDown.call(rest, event);
1505
+ pointerStartRef.current = {
1506
+ x: event.pageX,
1507
+ y: event.pageY
1508
+ };
1509
+ onPress(event);
1510
+ },
1511
+ onOpenAutoFocus: (e)=>{
1512
+ onOpenAutoFocus == null ? void 0 : onOpenAutoFocus(e);
1513
+ if (!autoFocus) {
1514
+ e.preventDefault();
1515
+ }
1516
+ },
1517
+ onPointerDownOutside: (e)=>{
1518
+ onPointerDownOutside == null ? void 0 : onPointerDownOutside(e);
1519
+ if (!modal || e.defaultPrevented) {
1520
+ e.preventDefault();
1521
+ return;
1522
+ }
1523
+ if (keyboardIsOpen.current) {
1524
+ keyboardIsOpen.current = false;
1525
+ }
1526
+ },
1527
+ onFocusOutside: (e)=>{
1528
+ if (!modal) {
1529
+ e.preventDefault();
1530
+ return;
1531
+ }
1532
+ },
1533
+ onPointerMove: (event)=>{
1534
+ lastKnownPointerEventRef.current = event;
1535
+ if (handleOnly) return;
1536
+ rest.onPointerMove == null ? void 0 : rest.onPointerMove.call(rest, event);
1537
+ if (!pointerStartRef.current) return;
1538
+ const yPosition = event.pageY - pointerStartRef.current.y;
1539
+ const xPosition = event.pageX - pointerStartRef.current.x;
1540
+ const swipeStartThreshold = event.pointerType === 'touch' ? 10 : 2;
1541
+ const delta = {
1542
+ x: xPosition,
1543
+ y: yPosition
1544
+ };
1545
+ const isAllowedToSwipe = isDeltaInDirection(delta, direction, swipeStartThreshold);
1546
+ if (isAllowedToSwipe) onDrag(event);
1547
+ else if (Math.abs(xPosition) > swipeStartThreshold || Math.abs(yPosition) > swipeStartThreshold) {
1548
+ pointerStartRef.current = null;
1549
+ }
1550
+ },
1551
+ onPointerUp: (event)=>{
1552
+ rest.onPointerUp == null ? void 0 : rest.onPointerUp.call(rest, event);
1553
+ pointerStartRef.current = null;
1554
+ wasBeyondThePointRef.current = false;
1555
+ onRelease(event);
1556
+ },
1557
+ onPointerOut: (event)=>{
1558
+ rest.onPointerOut == null ? void 0 : rest.onPointerOut.call(rest, event);
1559
+ handleOnPointerUp(lastKnownPointerEventRef.current);
1560
+ },
1561
+ onContextMenu: (event)=>{
1562
+ rest.onContextMenu == null ? void 0 : rest.onContextMenu.call(rest, event);
1563
+ if (lastKnownPointerEventRef.current) {
1564
+ handleOnPointerUp(lastKnownPointerEventRef.current);
1565
+ }
1566
+ }
1567
+ });
1568
+ });
1569
+ Content.displayName = 'Drawer.Content';
1570
+ const LONG_HANDLE_PRESS_TIMEOUT = 250;
1571
+ const DOUBLE_TAP_TIMEOUT = 120;
1572
+ const Handle = /*#__PURE__*/ React__namespace.default.forwardRef(function({ preventCycle = false, children, ...rest }, ref) {
1573
+ const { closeDrawer, isDragging, snapPoints, activeSnapPoint, setActiveSnapPoint, dismissible, handleOnly, isOpen, onPress, onDrag } = useDrawerContext();
1574
+ const closeTimeoutIdRef = React__namespace.default.useRef(null);
1575
+ const shouldCancelInteractionRef = React__namespace.default.useRef(false);
1576
+ function handleStartCycle() {
1577
+ // Stop if this is the second click of a double click
1578
+ if (shouldCancelInteractionRef.current) {
1579
+ handleCancelInteraction();
1580
+ return;
1581
+ }
1582
+ window.setTimeout(()=>{
1583
+ handleCycleSnapPoints();
1584
+ }, DOUBLE_TAP_TIMEOUT);
1585
+ }
1586
+ function handleCycleSnapPoints() {
1587
+ // Prevent accidental taps while resizing drawer
1588
+ if (isDragging || preventCycle || shouldCancelInteractionRef.current) {
1589
+ handleCancelInteraction();
1590
+ return;
1591
+ }
1592
+ // Make sure to clear the timeout id if the user releases the handle before the cancel timeout
1593
+ handleCancelInteraction();
1594
+ if (!snapPoints || snapPoints.length === 0) {
1595
+ if (!dismissible) {
1596
+ closeDrawer();
1597
+ }
1598
+ return;
1599
+ }
1600
+ const isLastSnapPoint = activeSnapPoint === snapPoints[snapPoints.length - 1];
1601
+ if (isLastSnapPoint && dismissible) {
1602
+ closeDrawer();
1603
+ return;
1604
+ }
1605
+ const currentSnapIndex = snapPoints.findIndex((point)=>point === activeSnapPoint);
1606
+ if (currentSnapIndex === -1) return; // activeSnapPoint not found in snapPoints
1607
+ const nextSnapPoint = snapPoints[currentSnapIndex + 1];
1608
+ setActiveSnapPoint(nextSnapPoint);
1609
+ }
1610
+ function handleStartInteraction() {
1611
+ closeTimeoutIdRef.current = window.setTimeout(()=>{
1612
+ // Cancel click interaction on a long press
1613
+ shouldCancelInteractionRef.current = true;
1614
+ }, LONG_HANDLE_PRESS_TIMEOUT);
1615
+ }
1616
+ function handleCancelInteraction() {
1617
+ if (closeTimeoutIdRef.current) {
1618
+ window.clearTimeout(closeTimeoutIdRef.current);
1619
+ }
1620
+ shouldCancelInteractionRef.current = false;
1621
+ }
1622
+ return /*#__PURE__*/ React__namespace.default.createElement("div", {
1623
+ onClick: handleStartCycle,
1624
+ onPointerCancel: handleCancelInteraction,
1625
+ onPointerDown: (e)=>{
1626
+ if (handleOnly) onPress(e);
1627
+ handleStartInteraction();
1628
+ },
1629
+ onPointerMove: (e)=>{
1630
+ if (handleOnly) onDrag(e);
1631
+ },
1632
+ // onPointerUp is already handled by the content component
1633
+ ref: ref,
1634
+ "data-vaul-drawer-visible": isOpen ? 'true' : 'false',
1635
+ "data-vaul-handle": "",
1636
+ "aria-hidden": "true",
1637
+ ...rest
1638
+ }, /*#__PURE__*/ React__namespace.default.createElement("span", {
1639
+ "data-vaul-handle-hitarea": "",
1640
+ "aria-hidden": "true"
1641
+ }, children));
1642
+ });
1643
+ Handle.displayName = 'Drawer.Handle';
1644
+ function Portal(props) {
1645
+ const context = useDrawerContext();
1646
+ const { container = context.container, ...portalProps } = props;
1647
+ return /*#__PURE__*/ React__namespace.default.createElement(index.Portal, {
1648
+ container: container,
1649
+ ...portalProps
1650
+ });
1651
+ }
1652
+ const Drawer$2 = {
1653
+ Root,
1654
+ Content,
1655
+ Overlay,
1656
+ Trigger: index.Trigger,
1657
+ Portal,
1658
+ Close: index.Close,
1659
+ Title: index.Title,
1660
+ Description: index.Description
1661
+ };
1662
+
1663
+ function Drawer$1({ ...props }) {
1664
+ return jsxRuntime.jsx(Drawer$2.Root, { "data-slot": "drawer", ...props });
1665
+ }
1666
+ function DrawerTrigger$1({ ...props }) {
1667
+ return jsxRuntime.jsx(Drawer$2.Trigger, { "data-slot": "drawer-trigger", ...props });
1668
+ }
1669
+ function DrawerPortal$1({ ...props }) {
1670
+ return jsxRuntime.jsx(Drawer$2.Portal, { "data-slot": "drawer-portal", ...props });
1671
+ }
1672
+ function DrawerClose$1({ ...props }) {
1673
+ return jsxRuntime.jsx(Drawer$2.Close, { "data-slot": "drawer-close", ...props });
1674
+ }
1675
+ function DrawerOverlay$1({ className, ...props }) {
1676
+ return (jsxRuntime.jsx(Drawer$2.Overlay, { "data-slot": "drawer-overlay", className: utils.cn("fixed inset-0 z-50 bg-black/10 supports-backdrop-filter:backdrop-blur-xs data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0", className), ...props }));
1677
+ }
1678
+ function DrawerContent$1({ className, children, ...props }) {
1679
+ return (jsxRuntime.jsxs(DrawerPortal$1, { "data-slot": "drawer-portal", children: [jsxRuntime.jsx(DrawerOverlay$1, {}), jsxRuntime.jsxs(Drawer$2.Content, { "data-slot": "drawer-content", className: utils.cn("group/drawer-content fixed z-50 flex h-auto flex-col bg-popover text-sm text-popover-foreground data-[vaul-drawer-direction=bottom]:inset-x-0 data-[vaul-drawer-direction=bottom]:bottom-0 data-[vaul-drawer-direction=bottom]:mt-24 data-[vaul-drawer-direction=bottom]:max-h-[80vh] data-[vaul-drawer-direction=bottom]:rounded-t-xl data-[vaul-drawer-direction=bottom]:border-t data-[vaul-drawer-direction=left]:inset-y-0 data-[vaul-drawer-direction=left]:start-0 data-[vaul-drawer-direction=left]:w-3/4 data-[vaul-drawer-direction=left]:rounded-e-xl data-[vaul-drawer-direction=left]:border-e data-[vaul-drawer-direction=right]:inset-y-0 data-[vaul-drawer-direction=right]:end-0 data-[vaul-drawer-direction=right]:w-3/4 data-[vaul-drawer-direction=right]:rounded-s-xl data-[vaul-drawer-direction=right]:border-s data-[vaul-drawer-direction=top]:inset-x-0 data-[vaul-drawer-direction=top]:top-0 data-[vaul-drawer-direction=top]:mb-24 data-[vaul-drawer-direction=top]:max-h-[80vh] data-[vaul-drawer-direction=top]:rounded-b-xl data-[vaul-drawer-direction=top]:border-b data-[vaul-drawer-direction=left]:sm:max-w-sm data-[vaul-drawer-direction=right]:sm:max-w-sm", className), ...props, children: [jsxRuntime.jsx("div", { className: "mx-auto mt-4 hidden h-1 w-[100px] shrink-0 rounded-full bg-muted group-data-[vaul-drawer-direction=bottom]/drawer-content:block" }), children] })] }));
1680
+ }
1681
+ function DrawerHeader$1({ className, ...props }) {
1682
+ return (jsxRuntime.jsx("div", { "data-slot": "drawer-header", className: utils.cn("flex flex-col gap-0.5 p-4 group-data-[vaul-drawer-direction=bottom]/drawer-content:text-center group-data-[vaul-drawer-direction=top]/drawer-content:text-center md:gap-0.5 md:text-start", className), ...props }));
1683
+ }
1684
+ function DrawerFooter$1({ className, ...props }) {
1685
+ return (jsxRuntime.jsx("div", { "data-slot": "drawer-footer", className: utils.cn("mt-auto flex flex-col gap-2 p-4", className), ...props }));
1686
+ }
1687
+ function DrawerTitle$1({ className, ...props }) {
1688
+ return (jsxRuntime.jsx(Drawer$2.Title, { "data-slot": "drawer-title", className: utils.cn("text-base font-medium text-foreground", className), ...props }));
1689
+ }
1690
+ function DrawerDescription$1({ className, ...props }) {
1691
+ return (jsxRuntime.jsx(Drawer$2.Description, { "data-slot": "drawer-description", className: utils.cn("text-sm text-muted-foreground", className), ...props }));
1692
+ }
1693
+
1694
+ const Drawer = (props) => (jsxRuntime.jsx(Drawer$1, { ...props }));
1695
+ const DrawerPortal = (props) => jsxRuntime.jsx(DrawerPortal$1, { ...props });
1696
+ const DrawerOverlay = (props) => jsxRuntime.jsx(DrawerOverlay$1, { ...props });
1697
+ const DrawerTrigger = (props) => jsxRuntime.jsx(DrawerTrigger$1, { ...props });
1698
+ const DrawerClose = (props) => (jsxRuntime.jsx(DrawerClose$1, { ...props }));
1699
+ const DrawerContent = (props) => jsxRuntime.jsx(DrawerContent$1, { ...props });
1700
+ const DrawerHeader = (props) => jsxRuntime.jsx(DrawerHeader$1, { ...props });
1701
+ const DrawerFooter = (props) => jsxRuntime.jsx(DrawerFooter$1, { ...props });
1702
+ const DrawerTitle = (props) => (jsxRuntime.jsx(DrawerTitle$1, { ...props }));
1703
+ const DrawerDescription = (props) => jsxRuntime.jsx(DrawerDescription$1, { ...props });
1704
+
1705
+ exports.Drawer = Drawer;
1706
+ exports.DrawerClose = DrawerClose;
1707
+ exports.DrawerContent = DrawerContent;
1708
+ exports.DrawerDescription = DrawerDescription;
1709
+ exports.DrawerFooter = DrawerFooter;
1710
+ exports.DrawerHeader = DrawerHeader;
1711
+ exports.DrawerOverlay = DrawerOverlay;
1712
+ exports.DrawerPortal = DrawerPortal;
1713
+ exports.DrawerTitle = DrawerTitle;
1714
+ exports.DrawerTrigger = DrawerTrigger;
1715
+ //# sourceMappingURL=Drawer.js.map