@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,1236 @@
1
+ import { jsx } from 'react/jsx-runtime';
2
+ import * as React from 'react';
3
+ import React__default from 'react';
4
+ import ReactDOM__default from 'react-dom';
5
+ import { L as LoaderCircle } from '../loader-circle-DycHUAWN.js';
6
+ import { c as createLucideIcon } from '../createLucideIcon-C8ycilSN.js';
7
+
8
+ /**
9
+ * @license lucide-react v0.577.0 - ISC
10
+ *
11
+ * This source code is licensed under the ISC license.
12
+ * See the LICENSE file in the root directory of this source tree.
13
+ */
14
+
15
+
16
+ const __iconNode$3 = [
17
+ ["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }],
18
+ ["path", { d: "m9 12 2 2 4-4", key: "dzmm74" }]
19
+ ];
20
+ const CircleCheck = createLucideIcon("circle-check", __iconNode$3);
21
+
22
+ /**
23
+ * @license lucide-react v0.577.0 - ISC
24
+ *
25
+ * This source code is licensed under the ISC license.
26
+ * See the LICENSE file in the root directory of this source tree.
27
+ */
28
+
29
+
30
+ const __iconNode$2 = [
31
+ ["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }],
32
+ ["path", { d: "M12 16v-4", key: "1dtifu" }],
33
+ ["path", { d: "M12 8h.01", key: "e9boi3" }]
34
+ ];
35
+ const Info = createLucideIcon("info", __iconNode$2);
36
+
37
+ /**
38
+ * @license lucide-react v0.577.0 - ISC
39
+ *
40
+ * This source code is licensed under the ISC license.
41
+ * See the LICENSE file in the root directory of this source tree.
42
+ */
43
+
44
+
45
+ const __iconNode$1 = [
46
+ ["path", { d: "m15 9-6 6", key: "1uzhvr" }],
47
+ [
48
+ "path",
49
+ {
50
+ d: "M2.586 16.726A2 2 0 0 1 2 15.312V8.688a2 2 0 0 1 .586-1.414l4.688-4.688A2 2 0 0 1 8.688 2h6.624a2 2 0 0 1 1.414.586l4.688 4.688A2 2 0 0 1 22 8.688v6.624a2 2 0 0 1-.586 1.414l-4.688 4.688a2 2 0 0 1-1.414.586H8.688a2 2 0 0 1-1.414-.586z",
51
+ key: "2d38gg"
52
+ }
53
+ ],
54
+ ["path", { d: "m9 9 6 6", key: "z0biqf" }]
55
+ ];
56
+ const OctagonX = createLucideIcon("octagon-x", __iconNode$1);
57
+
58
+ /**
59
+ * @license lucide-react v0.577.0 - ISC
60
+ *
61
+ * This source code is licensed under the ISC license.
62
+ * See the LICENSE file in the root directory of this source tree.
63
+ */
64
+
65
+
66
+ const __iconNode = [
67
+ [
68
+ "path",
69
+ {
70
+ d: "m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",
71
+ key: "wmoenq"
72
+ }
73
+ ],
74
+ ["path", { d: "M12 9v4", key: "juzpu7" }],
75
+ ["path", { d: "M12 17h.01", key: "p32p05" }]
76
+ ];
77
+ const TriangleAlert = createLucideIcon("triangle-alert", __iconNode);
78
+
79
+ var M=(e,i,s,u,m,a,l,h)=>{let d=document.documentElement,w=["light","dark"];function p(n){(Array.isArray(e)?e:[e]).forEach(y=>{let k=y==="class",S=k&&a?m.map(f=>a[f]||f):m;k?(d.classList.remove(...S),d.classList.add(a&&a[n]?a[n]:n)):d.setAttribute(y,n);}),R(n);}function R(n){h&&w.includes(n)&&(d.style.colorScheme=n);}function c(){return window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}if(u)p(u);else try{let n=localStorage.getItem(i)||s,y=l&&n==="system"?c():n;p(y);}catch(n){}};var x=React.createContext(void 0),U={setTheme:e=>{},themes:[]},z=()=>{var e;return (e=React.useContext(x))!=null?e:U};React.memo(({forcedTheme:e,storageKey:i,attribute:s,enableSystem:u,enableColorScheme:m,defaultTheme:a,value:l,themes:h,nonce:d,scriptProps:w})=>{let p=JSON.stringify([s,i,a,e,h,l,u,m]).slice(1,-1);return React.createElement("script",{...w,suppressHydrationWarning:true,nonce:typeof window=="undefined"?d:"",dangerouslySetInnerHTML:{__html:`(${M.toString()})(${p})`}})});
80
+
81
+ function __insertCSS(code) {
82
+ if (typeof document == 'undefined') return
83
+ let head = document.head || document.getElementsByTagName('head')[0];
84
+ let style = document.createElement('style');
85
+ style.type = 'text/css';
86
+ head.appendChild(style)
87
+ ;style.styleSheet ? (style.styleSheet.cssText = code) : style.appendChild(document.createTextNode(code));
88
+ }
89
+
90
+ const getAsset = (type)=>{
91
+ switch(type){
92
+ case 'success':
93
+ return SuccessIcon;
94
+ case 'info':
95
+ return InfoIcon;
96
+ case 'warning':
97
+ return WarningIcon;
98
+ case 'error':
99
+ return ErrorIcon;
100
+ default:
101
+ return null;
102
+ }
103
+ };
104
+ const bars = Array(12).fill(0);
105
+ const Loader = ({ visible, className })=>{
106
+ return /*#__PURE__*/ React__default.createElement("div", {
107
+ className: [
108
+ 'sonner-loading-wrapper',
109
+ className
110
+ ].filter(Boolean).join(' '),
111
+ "data-visible": visible
112
+ }, /*#__PURE__*/ React__default.createElement("div", {
113
+ className: "sonner-spinner"
114
+ }, bars.map((_, i)=>/*#__PURE__*/ React__default.createElement("div", {
115
+ className: "sonner-loading-bar",
116
+ key: `spinner-bar-${i}`
117
+ }))));
118
+ };
119
+ const SuccessIcon = /*#__PURE__*/ React__default.createElement("svg", {
120
+ xmlns: "http://www.w3.org/2000/svg",
121
+ viewBox: "0 0 20 20",
122
+ fill: "currentColor",
123
+ height: "20",
124
+ width: "20"
125
+ }, /*#__PURE__*/ React__default.createElement("path", {
126
+ fillRule: "evenodd",
127
+ d: "M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z",
128
+ clipRule: "evenodd"
129
+ }));
130
+ const WarningIcon = /*#__PURE__*/ React__default.createElement("svg", {
131
+ xmlns: "http://www.w3.org/2000/svg",
132
+ viewBox: "0 0 24 24",
133
+ fill: "currentColor",
134
+ height: "20",
135
+ width: "20"
136
+ }, /*#__PURE__*/ React__default.createElement("path", {
137
+ fillRule: "evenodd",
138
+ d: "M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z",
139
+ clipRule: "evenodd"
140
+ }));
141
+ const InfoIcon = /*#__PURE__*/ React__default.createElement("svg", {
142
+ xmlns: "http://www.w3.org/2000/svg",
143
+ viewBox: "0 0 20 20",
144
+ fill: "currentColor",
145
+ height: "20",
146
+ width: "20"
147
+ }, /*#__PURE__*/ React__default.createElement("path", {
148
+ fillRule: "evenodd",
149
+ d: "M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z",
150
+ clipRule: "evenodd"
151
+ }));
152
+ const ErrorIcon = /*#__PURE__*/ React__default.createElement("svg", {
153
+ xmlns: "http://www.w3.org/2000/svg",
154
+ viewBox: "0 0 20 20",
155
+ fill: "currentColor",
156
+ height: "20",
157
+ width: "20"
158
+ }, /*#__PURE__*/ React__default.createElement("path", {
159
+ fillRule: "evenodd",
160
+ d: "M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z",
161
+ clipRule: "evenodd"
162
+ }));
163
+ const CloseIcon = /*#__PURE__*/ React__default.createElement("svg", {
164
+ xmlns: "http://www.w3.org/2000/svg",
165
+ width: "12",
166
+ height: "12",
167
+ viewBox: "0 0 24 24",
168
+ fill: "none",
169
+ stroke: "currentColor",
170
+ strokeWidth: "1.5",
171
+ strokeLinecap: "round",
172
+ strokeLinejoin: "round"
173
+ }, /*#__PURE__*/ React__default.createElement("line", {
174
+ x1: "18",
175
+ y1: "6",
176
+ x2: "6",
177
+ y2: "18"
178
+ }), /*#__PURE__*/ React__default.createElement("line", {
179
+ x1: "6",
180
+ y1: "6",
181
+ x2: "18",
182
+ y2: "18"
183
+ }));
184
+
185
+ const useIsDocumentHidden = ()=>{
186
+ const [isDocumentHidden, setIsDocumentHidden] = React__default.useState(document.hidden);
187
+ React__default.useEffect(()=>{
188
+ const callback = ()=>{
189
+ setIsDocumentHidden(document.hidden);
190
+ };
191
+ document.addEventListener('visibilitychange', callback);
192
+ return ()=>window.removeEventListener('visibilitychange', callback);
193
+ }, []);
194
+ return isDocumentHidden;
195
+ };
196
+
197
+ let toastsCounter = 1;
198
+ class Observer {
199
+ constructor(){
200
+ // We use arrow functions to maintain the correct `this` reference
201
+ this.subscribe = (subscriber)=>{
202
+ this.subscribers.push(subscriber);
203
+ return ()=>{
204
+ const index = this.subscribers.indexOf(subscriber);
205
+ this.subscribers.splice(index, 1);
206
+ };
207
+ };
208
+ this.publish = (data)=>{
209
+ this.subscribers.forEach((subscriber)=>subscriber(data));
210
+ };
211
+ this.addToast = (data)=>{
212
+ this.publish(data);
213
+ this.toasts = [
214
+ ...this.toasts,
215
+ data
216
+ ];
217
+ };
218
+ this.create = (data)=>{
219
+ var _data_id;
220
+ const { message, ...rest } = data;
221
+ const id = typeof (data == null ? void 0 : data.id) === 'number' || ((_data_id = data.id) == null ? void 0 : _data_id.length) > 0 ? data.id : toastsCounter++;
222
+ const alreadyExists = this.toasts.find((toast)=>{
223
+ return toast.id === id;
224
+ });
225
+ const dismissible = data.dismissible === undefined ? true : data.dismissible;
226
+ if (this.dismissedToasts.has(id)) {
227
+ this.dismissedToasts.delete(id);
228
+ }
229
+ if (alreadyExists) {
230
+ this.toasts = this.toasts.map((toast)=>{
231
+ if (toast.id === id) {
232
+ this.publish({
233
+ ...toast,
234
+ ...data,
235
+ id,
236
+ title: message
237
+ });
238
+ return {
239
+ ...toast,
240
+ ...data,
241
+ id,
242
+ dismissible,
243
+ title: message
244
+ };
245
+ }
246
+ return toast;
247
+ });
248
+ } else {
249
+ this.addToast({
250
+ title: message,
251
+ ...rest,
252
+ dismissible,
253
+ id
254
+ });
255
+ }
256
+ return id;
257
+ };
258
+ this.dismiss = (id)=>{
259
+ if (id) {
260
+ this.dismissedToasts.add(id);
261
+ requestAnimationFrame(()=>this.subscribers.forEach((subscriber)=>subscriber({
262
+ id,
263
+ dismiss: true
264
+ })));
265
+ } else {
266
+ this.toasts.forEach((toast)=>{
267
+ this.subscribers.forEach((subscriber)=>subscriber({
268
+ id: toast.id,
269
+ dismiss: true
270
+ }));
271
+ });
272
+ }
273
+ return id;
274
+ };
275
+ this.message = (message, data)=>{
276
+ return this.create({
277
+ ...data,
278
+ message
279
+ });
280
+ };
281
+ this.error = (message, data)=>{
282
+ return this.create({
283
+ ...data,
284
+ message,
285
+ type: 'error'
286
+ });
287
+ };
288
+ this.success = (message, data)=>{
289
+ return this.create({
290
+ ...data,
291
+ type: 'success',
292
+ message
293
+ });
294
+ };
295
+ this.info = (message, data)=>{
296
+ return this.create({
297
+ ...data,
298
+ type: 'info',
299
+ message
300
+ });
301
+ };
302
+ this.warning = (message, data)=>{
303
+ return this.create({
304
+ ...data,
305
+ type: 'warning',
306
+ message
307
+ });
308
+ };
309
+ this.loading = (message, data)=>{
310
+ return this.create({
311
+ ...data,
312
+ type: 'loading',
313
+ message
314
+ });
315
+ };
316
+ this.promise = (promise, data)=>{
317
+ if (!data) {
318
+ // Nothing to show
319
+ return;
320
+ }
321
+ let id = undefined;
322
+ if (data.loading !== undefined) {
323
+ id = this.create({
324
+ ...data,
325
+ promise,
326
+ type: 'loading',
327
+ message: data.loading,
328
+ description: typeof data.description !== 'function' ? data.description : undefined
329
+ });
330
+ }
331
+ const p = Promise.resolve(promise instanceof Function ? promise() : promise);
332
+ let shouldDismiss = id !== undefined;
333
+ let result;
334
+ const originalPromise = p.then(async (response)=>{
335
+ result = [
336
+ 'resolve',
337
+ response
338
+ ];
339
+ const isReactElementResponse = React__default.isValidElement(response);
340
+ if (isReactElementResponse) {
341
+ shouldDismiss = false;
342
+ this.create({
343
+ id,
344
+ type: 'default',
345
+ message: response
346
+ });
347
+ } else if (isHttpResponse(response) && !response.ok) {
348
+ shouldDismiss = false;
349
+ const promiseData = typeof data.error === 'function' ? await data.error(`HTTP error! status: ${response.status}`) : data.error;
350
+ const description = typeof data.description === 'function' ? await data.description(`HTTP error! status: ${response.status}`) : data.description;
351
+ const isExtendedResult = typeof promiseData === 'object' && !React__default.isValidElement(promiseData);
352
+ const toastSettings = isExtendedResult ? promiseData : {
353
+ message: promiseData
354
+ };
355
+ this.create({
356
+ id,
357
+ type: 'error',
358
+ description,
359
+ ...toastSettings
360
+ });
361
+ } else if (response instanceof Error) {
362
+ shouldDismiss = false;
363
+ const promiseData = typeof data.error === 'function' ? await data.error(response) : data.error;
364
+ const description = typeof data.description === 'function' ? await data.description(response) : data.description;
365
+ const isExtendedResult = typeof promiseData === 'object' && !React__default.isValidElement(promiseData);
366
+ const toastSettings = isExtendedResult ? promiseData : {
367
+ message: promiseData
368
+ };
369
+ this.create({
370
+ id,
371
+ type: 'error',
372
+ description,
373
+ ...toastSettings
374
+ });
375
+ } else if (data.success !== undefined) {
376
+ shouldDismiss = false;
377
+ const promiseData = typeof data.success === 'function' ? await data.success(response) : data.success;
378
+ const description = typeof data.description === 'function' ? await data.description(response) : data.description;
379
+ const isExtendedResult = typeof promiseData === 'object' && !React__default.isValidElement(promiseData);
380
+ const toastSettings = isExtendedResult ? promiseData : {
381
+ message: promiseData
382
+ };
383
+ this.create({
384
+ id,
385
+ type: 'success',
386
+ description,
387
+ ...toastSettings
388
+ });
389
+ }
390
+ }).catch(async (error)=>{
391
+ result = [
392
+ 'reject',
393
+ error
394
+ ];
395
+ if (data.error !== undefined) {
396
+ shouldDismiss = false;
397
+ const promiseData = typeof data.error === 'function' ? await data.error(error) : data.error;
398
+ const description = typeof data.description === 'function' ? await data.description(error) : data.description;
399
+ const isExtendedResult = typeof promiseData === 'object' && !React__default.isValidElement(promiseData);
400
+ const toastSettings = isExtendedResult ? promiseData : {
401
+ message: promiseData
402
+ };
403
+ this.create({
404
+ id,
405
+ type: 'error',
406
+ description,
407
+ ...toastSettings
408
+ });
409
+ }
410
+ }).finally(()=>{
411
+ if (shouldDismiss) {
412
+ // Toast is still in load state (and will be indefinitely — dismiss it)
413
+ this.dismiss(id);
414
+ id = undefined;
415
+ }
416
+ data.finally == null ? void 0 : data.finally.call(data);
417
+ });
418
+ const unwrap = ()=>new Promise((resolve, reject)=>originalPromise.then(()=>result[0] === 'reject' ? reject(result[1]) : resolve(result[1])).catch(reject));
419
+ if (typeof id !== 'string' && typeof id !== 'number') {
420
+ // cannot Object.assign on undefined
421
+ return {
422
+ unwrap
423
+ };
424
+ } else {
425
+ return Object.assign(id, {
426
+ unwrap
427
+ });
428
+ }
429
+ };
430
+ this.custom = (jsx, data)=>{
431
+ const id = (data == null ? void 0 : data.id) || toastsCounter++;
432
+ this.create({
433
+ jsx: jsx(id),
434
+ id,
435
+ ...data
436
+ });
437
+ return id;
438
+ };
439
+ this.getActiveToasts = ()=>{
440
+ return this.toasts.filter((toast)=>!this.dismissedToasts.has(toast.id));
441
+ };
442
+ this.subscribers = [];
443
+ this.toasts = [];
444
+ this.dismissedToasts = new Set();
445
+ }
446
+ }
447
+ const ToastState = new Observer();
448
+ // bind this to the toast function
449
+ const toastFunction = (message, data)=>{
450
+ const id = (data == null ? void 0 : data.id) || toastsCounter++;
451
+ ToastState.addToast({
452
+ title: message,
453
+ ...data,
454
+ id
455
+ });
456
+ return id;
457
+ };
458
+ const isHttpResponse = (data)=>{
459
+ return data && typeof data === 'object' && 'ok' in data && typeof data.ok === 'boolean' && 'status' in data && typeof data.status === 'number';
460
+ };
461
+ const basicToast = toastFunction;
462
+ const getHistory = ()=>ToastState.toasts;
463
+ const getToasts = ()=>ToastState.getActiveToasts();
464
+ // We use `Object.assign` to maintain the correct types as we would lose them otherwise
465
+ Object.assign(basicToast, {
466
+ success: ToastState.success,
467
+ info: ToastState.info,
468
+ warning: ToastState.warning,
469
+ error: ToastState.error,
470
+ custom: ToastState.custom,
471
+ message: ToastState.message,
472
+ promise: ToastState.promise,
473
+ dismiss: ToastState.dismiss,
474
+ loading: ToastState.loading
475
+ }, {
476
+ getHistory,
477
+ getToasts
478
+ });
479
+
480
+ __insertCSS("[data-sonner-toaster][dir=ltr],html[dir=ltr]{--toast-icon-margin-start:-3px;--toast-icon-margin-end:4px;--toast-svg-margin-start:-1px;--toast-svg-margin-end:0px;--toast-button-margin-start:auto;--toast-button-margin-end:0;--toast-close-button-start:0;--toast-close-button-end:unset;--toast-close-button-transform:translate(-35%, -35%)}[data-sonner-toaster][dir=rtl],html[dir=rtl]{--toast-icon-margin-start:4px;--toast-icon-margin-end:-3px;--toast-svg-margin-start:0px;--toast-svg-margin-end:-1px;--toast-button-margin-start:0;--toast-button-margin-end:auto;--toast-close-button-start:unset;--toast-close-button-end:0;--toast-close-button-transform:translate(35%, -35%)}[data-sonner-toaster]{position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1:hsl(0, 0%, 99%);--gray2:hsl(0, 0%, 97.3%);--gray3:hsl(0, 0%, 95.1%);--gray4:hsl(0, 0%, 93%);--gray5:hsl(0, 0%, 90.9%);--gray6:hsl(0, 0%, 88.7%);--gray7:hsl(0, 0%, 85.8%);--gray8:hsl(0, 0%, 78%);--gray9:hsl(0, 0%, 56.1%);--gray10:hsl(0, 0%, 52.3%);--gray11:hsl(0, 0%, 43.5%);--gray12:hsl(0, 0%, 9%);--border-radius:8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:0;z-index:999999999;transition:transform .4s ease}@media (hover:none) and (pointer:coarse){[data-sonner-toaster][data-lifted=true]{transform:none}}[data-sonner-toaster][data-x-position=right]{right:var(--offset-right)}[data-sonner-toaster][data-x-position=left]{left:var(--offset-left)}[data-sonner-toaster][data-x-position=center]{left:50%;transform:translateX(-50%)}[data-sonner-toaster][data-y-position=top]{top:var(--offset-top)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--offset-bottom)}[data-sonner-toast]{--y:translateY(100%);--lift-amount:calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:0;overflow-wrap:anywhere}[data-sonner-toast][data-styled=true]{padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px rgba(0,0,0,.1);width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}[data-sonner-toast]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-y-position=top]{top:0;--y:translateY(-100%);--lift:1;--lift-amount:calc(1 * var(--gap))}[data-sonner-toast][data-y-position=bottom]{bottom:0;--y:translateY(100%);--lift:-1;--lift-amount:calc(var(--lift) * var(--gap))}[data-sonner-toast][data-styled=true] [data-description]{font-weight:400;line-height:1.4;color:#3f3f3f}[data-rich-colors=true][data-sonner-toast][data-styled=true] [data-description]{color:inherit}[data-sonner-toaster][data-sonner-theme=dark] [data-description]{color:#e8e8e8}[data-sonner-toast][data-styled=true] [data-title]{font-weight:500;line-height:1.5;color:inherit}[data-sonner-toast][data-styled=true] [data-icon]{display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}[data-sonner-toast][data-promise=true] [data-icon]>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}[data-sonner-toast][data-styled=true] [data-icon]>*{flex-shrink:0}[data-sonner-toast][data-styled=true] [data-icon] svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}[data-sonner-toast][data-styled=true] [data-content]{display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;font-weight:500;cursor:pointer;outline:0;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}[data-sonner-toast][data-styled=true] [data-button]:focus-visible{box-shadow:0 0 0 2px rgba(0,0,0,.4)}[data-sonner-toast][data-styled=true] [data-button]:first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}[data-sonner-toast][data-styled=true] [data-cancel]{color:var(--normal-text);background:rgba(0,0,0,.08)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-styled=true] [data-cancel]{background:rgba(255,255,255,.3)}[data-sonner-toast][data-styled=true] [data-close-button]{position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);background:var(--normal-bg);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast][data-styled=true] [data-close-button]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-styled=true] [data-disabled=true]{cursor:not-allowed}[data-sonner-toast][data-styled=true]:hover [data-close-button]:hover{background:var(--gray2);border-color:var(--gray5)}[data-sonner-toast][data-swiping=true]::before{content:'';position:absolute;left:-100%;right:-100%;height:100%;z-index:-1}[data-sonner-toast][data-y-position=top][data-swiping=true]::before{bottom:50%;transform:scaleY(3) translateY(50%)}[data-sonner-toast][data-y-position=bottom][data-swiping=true]::before{top:50%;transform:scaleY(3) translateY(-50%)}[data-sonner-toast][data-swiping=false][data-removed=true]::before{content:'';position:absolute;inset:0;transform:scaleY(2)}[data-sonner-toast][data-expanded=true]::after{content:'';position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}[data-sonner-toast][data-mounted=true]{--y:translateY(0);opacity:1}[data-sonner-toast][data-expanded=false][data-front=false]{--scale:var(--toasts-before) * 0.05 + 1;--y:translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}[data-sonner-toast]>*{transition:opacity .4s}[data-sonner-toast][data-x-position=right]{right:0}[data-sonner-toast][data-x-position=left]{left:0}[data-sonner-toast][data-expanded=false][data-front=false][data-styled=true]>*{opacity:0}[data-sonner-toast][data-visible=false]{opacity:0;pointer-events:none}[data-sonner-toast][data-mounted=true][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}[data-sonner-toast][data-removed=true][data-front=true][data-swipe-out=false]{--y:translateY(calc(var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=false]{--y:translateY(40%);opacity:0;transition:transform .5s,opacity .2s}[data-sonner-toast][data-removed=true][data-front=false]::before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y,0)) translateX(var(--swipe-amount-x,0));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width:600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-sonner-theme=light]{--normal-bg:#fff;--normal-border:var(--gray4);--normal-text:var(--gray12);--success-bg:hsl(143, 85%, 96%);--success-border:hsl(145, 92%, 87%);--success-text:hsl(140, 100%, 27%);--info-bg:hsl(208, 100%, 97%);--info-border:hsl(221, 91%, 93%);--info-text:hsl(210, 92%, 45%);--warning-bg:hsl(49, 100%, 97%);--warning-border:hsl(49, 91%, 84%);--warning-text:hsl(31, 92%, 45%);--error-bg:hsl(359, 100%, 97%);--error-border:hsl(359, 100%, 94%);--error-text:hsl(360, 100%, 45%)}[data-sonner-toaster][data-sonner-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg:#000;--normal-border:hsl(0, 0%, 20%);--normal-text:var(--gray1)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg:#fff;--normal-border:var(--gray3);--normal-text:var(--gray12)}[data-sonner-toaster][data-sonner-theme=dark]{--normal-bg:#000;--normal-bg-hover:hsl(0, 0%, 12%);--normal-border:hsl(0, 0%, 20%);--normal-border-hover:hsl(0, 0%, 25%);--normal-text:var(--gray1);--success-bg:hsl(150, 100%, 6%);--success-border:hsl(147, 100%, 12%);--success-text:hsl(150, 86%, 65%);--info-bg:hsl(215, 100%, 6%);--info-border:hsl(223, 43%, 17%);--info-text:hsl(216, 87%, 65%);--warning-bg:hsl(64, 100%, 6%);--warning-border:hsl(60, 100%, 9%);--warning-text:hsl(46, 87%, 65%);--error-bg:hsl(358, 76%, 10%);--error-border:hsl(357, 89%, 16%);--error-text:hsl(358, 100%, 81%)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size:16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:first-child{animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}100%{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}100%{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}100%{opacity:.15}}@media (prefers-reduced-motion){.sonner-loading-bar,[data-sonner-toast],[data-sonner-toast]>*{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}");
481
+
482
+ function isAction(action) {
483
+ return action.label !== undefined;
484
+ }
485
+
486
+ // Visible toasts amount
487
+ const VISIBLE_TOASTS_AMOUNT = 3;
488
+ // Viewport padding
489
+ const VIEWPORT_OFFSET = '24px';
490
+ // Mobile viewport padding
491
+ const MOBILE_VIEWPORT_OFFSET = '16px';
492
+ // Default lifetime of a toasts (in ms)
493
+ const TOAST_LIFETIME = 4000;
494
+ // Default toast width
495
+ const TOAST_WIDTH = 356;
496
+ // Default gap between toasts
497
+ const GAP = 14;
498
+ // Threshold to dismiss a toast
499
+ const SWIPE_THRESHOLD = 45;
500
+ // Equal to exit animation duration
501
+ const TIME_BEFORE_UNMOUNT = 200;
502
+ function cn(...classes) {
503
+ return classes.filter(Boolean).join(' ');
504
+ }
505
+ function getDefaultSwipeDirections(position) {
506
+ const [y, x] = position.split('-');
507
+ const directions = [];
508
+ if (y) {
509
+ directions.push(y);
510
+ }
511
+ if (x) {
512
+ directions.push(x);
513
+ }
514
+ return directions;
515
+ }
516
+ const Toast = (props)=>{
517
+ var _toast_classNames, _toast_classNames1, _toast_classNames2, _toast_classNames3, _toast_classNames4, _toast_classNames5, _toast_classNames6, _toast_classNames7, _toast_classNames8;
518
+ const { invert: ToasterInvert, toast, unstyled, interacting, setHeights, visibleToasts, heights, index, toasts, expanded, removeToast, defaultRichColors, closeButton: closeButtonFromToaster, style, cancelButtonStyle, actionButtonStyle, className = '', descriptionClassName = '', duration: durationFromToaster, position, gap, expandByDefault, classNames, icons, closeButtonAriaLabel = 'Close toast' } = props;
519
+ const [swipeDirection, setSwipeDirection] = React__default.useState(null);
520
+ const [swipeOutDirection, setSwipeOutDirection] = React__default.useState(null);
521
+ const [mounted, setMounted] = React__default.useState(false);
522
+ const [removed, setRemoved] = React__default.useState(false);
523
+ const [swiping, setSwiping] = React__default.useState(false);
524
+ const [swipeOut, setSwipeOut] = React__default.useState(false);
525
+ const [isSwiped, setIsSwiped] = React__default.useState(false);
526
+ const [offsetBeforeRemove, setOffsetBeforeRemove] = React__default.useState(0);
527
+ const [initialHeight, setInitialHeight] = React__default.useState(0);
528
+ const remainingTime = React__default.useRef(toast.duration || durationFromToaster || TOAST_LIFETIME);
529
+ const dragStartTime = React__default.useRef(null);
530
+ const toastRef = React__default.useRef(null);
531
+ const isFront = index === 0;
532
+ const isVisible = index + 1 <= visibleToasts;
533
+ const toastType = toast.type;
534
+ const dismissible = toast.dismissible !== false;
535
+ const toastClassname = toast.className || '';
536
+ const toastDescriptionClassname = toast.descriptionClassName || '';
537
+ // Height index is used to calculate the offset as it gets updated before the toast array, which means we can calculate the new layout faster.
538
+ const heightIndex = React__default.useMemo(()=>heights.findIndex((height)=>height.toastId === toast.id) || 0, [
539
+ heights,
540
+ toast.id
541
+ ]);
542
+ const closeButton = React__default.useMemo(()=>{
543
+ var _toast_closeButton;
544
+ return (_toast_closeButton = toast.closeButton) != null ? _toast_closeButton : closeButtonFromToaster;
545
+ }, [
546
+ toast.closeButton,
547
+ closeButtonFromToaster
548
+ ]);
549
+ const duration = React__default.useMemo(()=>toast.duration || durationFromToaster || TOAST_LIFETIME, [
550
+ toast.duration,
551
+ durationFromToaster
552
+ ]);
553
+ const closeTimerStartTimeRef = React__default.useRef(0);
554
+ const offset = React__default.useRef(0);
555
+ const lastCloseTimerStartTimeRef = React__default.useRef(0);
556
+ const pointerStartRef = React__default.useRef(null);
557
+ const [y, x] = position.split('-');
558
+ const toastsHeightBefore = React__default.useMemo(()=>{
559
+ return heights.reduce((prev, curr, reducerIndex)=>{
560
+ // Calculate offset up until current toast
561
+ if (reducerIndex >= heightIndex) {
562
+ return prev;
563
+ }
564
+ return prev + curr.height;
565
+ }, 0);
566
+ }, [
567
+ heights,
568
+ heightIndex
569
+ ]);
570
+ const isDocumentHidden = useIsDocumentHidden();
571
+ const invert = toast.invert || ToasterInvert;
572
+ const disabled = toastType === 'loading';
573
+ offset.current = React__default.useMemo(()=>heightIndex * gap + toastsHeightBefore, [
574
+ heightIndex,
575
+ toastsHeightBefore
576
+ ]);
577
+ React__default.useEffect(()=>{
578
+ remainingTime.current = duration;
579
+ }, [
580
+ duration
581
+ ]);
582
+ React__default.useEffect(()=>{
583
+ // Trigger enter animation without using CSS animation
584
+ setMounted(true);
585
+ }, []);
586
+ React__default.useEffect(()=>{
587
+ const toastNode = toastRef.current;
588
+ if (toastNode) {
589
+ const height = toastNode.getBoundingClientRect().height;
590
+ // Add toast height to heights array after the toast is mounted
591
+ setInitialHeight(height);
592
+ setHeights((h)=>[
593
+ {
594
+ toastId: toast.id,
595
+ height,
596
+ position: toast.position
597
+ },
598
+ ...h
599
+ ]);
600
+ return ()=>setHeights((h)=>h.filter((height)=>height.toastId !== toast.id));
601
+ }
602
+ }, [
603
+ setHeights,
604
+ toast.id
605
+ ]);
606
+ React__default.useLayoutEffect(()=>{
607
+ // Keep height up to date with the content in case it updates
608
+ if (!mounted) return;
609
+ const toastNode = toastRef.current;
610
+ const originalHeight = toastNode.style.height;
611
+ toastNode.style.height = 'auto';
612
+ const newHeight = toastNode.getBoundingClientRect().height;
613
+ toastNode.style.height = originalHeight;
614
+ setInitialHeight(newHeight);
615
+ setHeights((heights)=>{
616
+ const alreadyExists = heights.find((height)=>height.toastId === toast.id);
617
+ if (!alreadyExists) {
618
+ return [
619
+ {
620
+ toastId: toast.id,
621
+ height: newHeight,
622
+ position: toast.position
623
+ },
624
+ ...heights
625
+ ];
626
+ } else {
627
+ return heights.map((height)=>height.toastId === toast.id ? {
628
+ ...height,
629
+ height: newHeight
630
+ } : height);
631
+ }
632
+ });
633
+ }, [
634
+ mounted,
635
+ toast.title,
636
+ toast.description,
637
+ setHeights,
638
+ toast.id,
639
+ toast.jsx,
640
+ toast.action,
641
+ toast.cancel
642
+ ]);
643
+ const deleteToast = React__default.useCallback(()=>{
644
+ // Save the offset for the exit swipe animation
645
+ setRemoved(true);
646
+ setOffsetBeforeRemove(offset.current);
647
+ setHeights((h)=>h.filter((height)=>height.toastId !== toast.id));
648
+ setTimeout(()=>{
649
+ removeToast(toast);
650
+ }, TIME_BEFORE_UNMOUNT);
651
+ }, [
652
+ toast,
653
+ removeToast,
654
+ setHeights,
655
+ offset
656
+ ]);
657
+ React__default.useEffect(()=>{
658
+ if (toast.promise && toastType === 'loading' || toast.duration === Infinity || toast.type === 'loading') return;
659
+ let timeoutId;
660
+ // Pause the timer on each hover
661
+ const pauseTimer = ()=>{
662
+ if (lastCloseTimerStartTimeRef.current < closeTimerStartTimeRef.current) {
663
+ // Get the elapsed time since the timer started
664
+ const elapsedTime = new Date().getTime() - closeTimerStartTimeRef.current;
665
+ remainingTime.current = remainingTime.current - elapsedTime;
666
+ }
667
+ lastCloseTimerStartTimeRef.current = new Date().getTime();
668
+ };
669
+ const startTimer = ()=>{
670
+ // setTimeout(, Infinity) behaves as if the delay is 0.
671
+ // As a result, the toast would be closed immediately, giving the appearance that it was never rendered.
672
+ // See: https://github.com/denysdovhan/wtfjs?tab=readme-ov-file#an-infinite-timeout
673
+ if (remainingTime.current === Infinity) return;
674
+ closeTimerStartTimeRef.current = new Date().getTime();
675
+ // Let the toast know it has started
676
+ timeoutId = setTimeout(()=>{
677
+ toast.onAutoClose == null ? void 0 : toast.onAutoClose.call(toast, toast);
678
+ deleteToast();
679
+ }, remainingTime.current);
680
+ };
681
+ if (expanded || interacting || isDocumentHidden) {
682
+ pauseTimer();
683
+ } else {
684
+ startTimer();
685
+ }
686
+ return ()=>clearTimeout(timeoutId);
687
+ }, [
688
+ expanded,
689
+ interacting,
690
+ toast,
691
+ toastType,
692
+ isDocumentHidden,
693
+ deleteToast
694
+ ]);
695
+ React__default.useEffect(()=>{
696
+ if (toast.delete) {
697
+ deleteToast();
698
+ toast.onDismiss == null ? void 0 : toast.onDismiss.call(toast, toast);
699
+ }
700
+ }, [
701
+ deleteToast,
702
+ toast.delete
703
+ ]);
704
+ function getLoadingIcon() {
705
+ var _toast_classNames;
706
+ if (icons == null ? void 0 : icons.loading) {
707
+ var _toast_classNames1;
708
+ return /*#__PURE__*/ React__default.createElement("div", {
709
+ className: cn(classNames == null ? void 0 : classNames.loader, toast == null ? void 0 : (_toast_classNames1 = toast.classNames) == null ? void 0 : _toast_classNames1.loader, 'sonner-loader'),
710
+ "data-visible": toastType === 'loading'
711
+ }, icons.loading);
712
+ }
713
+ return /*#__PURE__*/ React__default.createElement(Loader, {
714
+ className: cn(classNames == null ? void 0 : classNames.loader, toast == null ? void 0 : (_toast_classNames = toast.classNames) == null ? void 0 : _toast_classNames.loader),
715
+ visible: toastType === 'loading'
716
+ });
717
+ }
718
+ const icon = toast.icon || (icons == null ? void 0 : icons[toastType]) || getAsset(toastType);
719
+ var _toast_richColors, _icons_close;
720
+ return /*#__PURE__*/ React__default.createElement("li", {
721
+ tabIndex: 0,
722
+ ref: toastRef,
723
+ className: cn(className, toastClassname, classNames == null ? void 0 : classNames.toast, toast == null ? void 0 : (_toast_classNames = toast.classNames) == null ? void 0 : _toast_classNames.toast, classNames == null ? void 0 : classNames.default, classNames == null ? void 0 : classNames[toastType], toast == null ? void 0 : (_toast_classNames1 = toast.classNames) == null ? void 0 : _toast_classNames1[toastType]),
724
+ "data-sonner-toast": "",
725
+ "data-rich-colors": (_toast_richColors = toast.richColors) != null ? _toast_richColors : defaultRichColors,
726
+ "data-styled": !Boolean(toast.jsx || toast.unstyled || unstyled),
727
+ "data-mounted": mounted,
728
+ "data-promise": Boolean(toast.promise),
729
+ "data-swiped": isSwiped,
730
+ "data-removed": removed,
731
+ "data-visible": isVisible,
732
+ "data-y-position": y,
733
+ "data-x-position": x,
734
+ "data-index": index,
735
+ "data-front": isFront,
736
+ "data-swiping": swiping,
737
+ "data-dismissible": dismissible,
738
+ "data-type": toastType,
739
+ "data-invert": invert,
740
+ "data-swipe-out": swipeOut,
741
+ "data-swipe-direction": swipeOutDirection,
742
+ "data-expanded": Boolean(expanded || expandByDefault && mounted),
743
+ "data-testid": toast.testId,
744
+ style: {
745
+ '--index': index,
746
+ '--toasts-before': index,
747
+ '--z-index': toasts.length - index,
748
+ '--offset': `${removed ? offsetBeforeRemove : offset.current}px`,
749
+ '--initial-height': expandByDefault ? 'auto' : `${initialHeight}px`,
750
+ ...style,
751
+ ...toast.style
752
+ },
753
+ onDragEnd: ()=>{
754
+ setSwiping(false);
755
+ setSwipeDirection(null);
756
+ pointerStartRef.current = null;
757
+ },
758
+ onPointerDown: (event)=>{
759
+ if (event.button === 2) return; // Return early on right click
760
+ if (disabled || !dismissible) return;
761
+ dragStartTime.current = new Date();
762
+ setOffsetBeforeRemove(offset.current);
763
+ // Ensure we maintain correct pointer capture even when going outside of the toast (e.g. when swiping)
764
+ event.target.setPointerCapture(event.pointerId);
765
+ if (event.target.tagName === 'BUTTON') return;
766
+ setSwiping(true);
767
+ pointerStartRef.current = {
768
+ x: event.clientX,
769
+ y: event.clientY
770
+ };
771
+ },
772
+ onPointerUp: ()=>{
773
+ var _toastRef_current, _toastRef_current1, _dragStartTime_current;
774
+ if (swipeOut || !dismissible) return;
775
+ pointerStartRef.current = null;
776
+ const swipeAmountX = Number(((_toastRef_current = toastRef.current) == null ? void 0 : _toastRef_current.style.getPropertyValue('--swipe-amount-x').replace('px', '')) || 0);
777
+ const swipeAmountY = Number(((_toastRef_current1 = toastRef.current) == null ? void 0 : _toastRef_current1.style.getPropertyValue('--swipe-amount-y').replace('px', '')) || 0);
778
+ const timeTaken = new Date().getTime() - ((_dragStartTime_current = dragStartTime.current) == null ? void 0 : _dragStartTime_current.getTime());
779
+ const swipeAmount = swipeDirection === 'x' ? swipeAmountX : swipeAmountY;
780
+ const velocity = Math.abs(swipeAmount) / timeTaken;
781
+ if (Math.abs(swipeAmount) >= SWIPE_THRESHOLD || velocity > 0.11) {
782
+ setOffsetBeforeRemove(offset.current);
783
+ toast.onDismiss == null ? void 0 : toast.onDismiss.call(toast, toast);
784
+ if (swipeDirection === 'x') {
785
+ setSwipeOutDirection(swipeAmountX > 0 ? 'right' : 'left');
786
+ } else {
787
+ setSwipeOutDirection(swipeAmountY > 0 ? 'down' : 'up');
788
+ }
789
+ deleteToast();
790
+ setSwipeOut(true);
791
+ return;
792
+ } else {
793
+ var _toastRef_current2, _toastRef_current3;
794
+ (_toastRef_current2 = toastRef.current) == null ? void 0 : _toastRef_current2.style.setProperty('--swipe-amount-x', `0px`);
795
+ (_toastRef_current3 = toastRef.current) == null ? void 0 : _toastRef_current3.style.setProperty('--swipe-amount-y', `0px`);
796
+ }
797
+ setIsSwiped(false);
798
+ setSwiping(false);
799
+ setSwipeDirection(null);
800
+ },
801
+ onPointerMove: (event)=>{
802
+ var _window_getSelection, // Apply transform using both x and y values
803
+ _toastRef_current, _toastRef_current1;
804
+ if (!pointerStartRef.current || !dismissible) return;
805
+ const isHighlighted = ((_window_getSelection = window.getSelection()) == null ? void 0 : _window_getSelection.toString().length) > 0;
806
+ if (isHighlighted) return;
807
+ const yDelta = event.clientY - pointerStartRef.current.y;
808
+ const xDelta = event.clientX - pointerStartRef.current.x;
809
+ var _props_swipeDirections;
810
+ const swipeDirections = (_props_swipeDirections = props.swipeDirections) != null ? _props_swipeDirections : getDefaultSwipeDirections(position);
811
+ // Determine swipe direction if not already locked
812
+ if (!swipeDirection && (Math.abs(xDelta) > 1 || Math.abs(yDelta) > 1)) {
813
+ setSwipeDirection(Math.abs(xDelta) > Math.abs(yDelta) ? 'x' : 'y');
814
+ }
815
+ let swipeAmount = {
816
+ x: 0,
817
+ y: 0
818
+ };
819
+ const getDampening = (delta)=>{
820
+ const factor = Math.abs(delta) / 20;
821
+ return 1 / (1.5 + factor);
822
+ };
823
+ // Only apply swipe in the locked direction
824
+ if (swipeDirection === 'y') {
825
+ // Handle vertical swipes
826
+ if (swipeDirections.includes('top') || swipeDirections.includes('bottom')) {
827
+ if (swipeDirections.includes('top') && yDelta < 0 || swipeDirections.includes('bottom') && yDelta > 0) {
828
+ swipeAmount.y = yDelta;
829
+ } else {
830
+ // Smoothly transition to dampened movement
831
+ const dampenedDelta = yDelta * getDampening(yDelta);
832
+ // Ensure we don't jump when transitioning to dampened movement
833
+ swipeAmount.y = Math.abs(dampenedDelta) < Math.abs(yDelta) ? dampenedDelta : yDelta;
834
+ }
835
+ }
836
+ } else if (swipeDirection === 'x') {
837
+ // Handle horizontal swipes
838
+ if (swipeDirections.includes('left') || swipeDirections.includes('right')) {
839
+ if (swipeDirections.includes('left') && xDelta < 0 || swipeDirections.includes('right') && xDelta > 0) {
840
+ swipeAmount.x = xDelta;
841
+ } else {
842
+ // Smoothly transition to dampened movement
843
+ const dampenedDelta = xDelta * getDampening(xDelta);
844
+ // Ensure we don't jump when transitioning to dampened movement
845
+ swipeAmount.x = Math.abs(dampenedDelta) < Math.abs(xDelta) ? dampenedDelta : xDelta;
846
+ }
847
+ }
848
+ }
849
+ if (Math.abs(swipeAmount.x) > 0 || Math.abs(swipeAmount.y) > 0) {
850
+ setIsSwiped(true);
851
+ }
852
+ (_toastRef_current = toastRef.current) == null ? void 0 : _toastRef_current.style.setProperty('--swipe-amount-x', `${swipeAmount.x}px`);
853
+ (_toastRef_current1 = toastRef.current) == null ? void 0 : _toastRef_current1.style.setProperty('--swipe-amount-y', `${swipeAmount.y}px`);
854
+ }
855
+ }, closeButton && !toast.jsx && toastType !== 'loading' ? /*#__PURE__*/ React__default.createElement("button", {
856
+ "aria-label": closeButtonAriaLabel,
857
+ "data-disabled": disabled,
858
+ "data-close-button": true,
859
+ onClick: disabled || !dismissible ? ()=>{} : ()=>{
860
+ deleteToast();
861
+ toast.onDismiss == null ? void 0 : toast.onDismiss.call(toast, toast);
862
+ },
863
+ className: cn(classNames == null ? void 0 : classNames.closeButton, toast == null ? void 0 : (_toast_classNames2 = toast.classNames) == null ? void 0 : _toast_classNames2.closeButton)
864
+ }, (_icons_close = icons == null ? void 0 : icons.close) != null ? _icons_close : CloseIcon) : null, (toastType || toast.icon || toast.promise) && toast.icon !== null && ((icons == null ? void 0 : icons[toastType]) !== null || toast.icon) ? /*#__PURE__*/ React__default.createElement("div", {
865
+ "data-icon": "",
866
+ className: cn(classNames == null ? void 0 : classNames.icon, toast == null ? void 0 : (_toast_classNames3 = toast.classNames) == null ? void 0 : _toast_classNames3.icon)
867
+ }, toast.promise || toast.type === 'loading' && !toast.icon ? toast.icon || getLoadingIcon() : null, toast.type !== 'loading' ? icon : null) : null, /*#__PURE__*/ React__default.createElement("div", {
868
+ "data-content": "",
869
+ className: cn(classNames == null ? void 0 : classNames.content, toast == null ? void 0 : (_toast_classNames4 = toast.classNames) == null ? void 0 : _toast_classNames4.content)
870
+ }, /*#__PURE__*/ React__default.createElement("div", {
871
+ "data-title": "",
872
+ className: cn(classNames == null ? void 0 : classNames.title, toast == null ? void 0 : (_toast_classNames5 = toast.classNames) == null ? void 0 : _toast_classNames5.title)
873
+ }, toast.jsx ? toast.jsx : typeof toast.title === 'function' ? toast.title() : toast.title), toast.description ? /*#__PURE__*/ React__default.createElement("div", {
874
+ "data-description": "",
875
+ className: cn(descriptionClassName, toastDescriptionClassname, classNames == null ? void 0 : classNames.description, toast == null ? void 0 : (_toast_classNames6 = toast.classNames) == null ? void 0 : _toast_classNames6.description)
876
+ }, typeof toast.description === 'function' ? toast.description() : toast.description) : null), /*#__PURE__*/ React__default.isValidElement(toast.cancel) ? toast.cancel : toast.cancel && isAction(toast.cancel) ? /*#__PURE__*/ React__default.createElement("button", {
877
+ "data-button": true,
878
+ "data-cancel": true,
879
+ style: toast.cancelButtonStyle || cancelButtonStyle,
880
+ onClick: (event)=>{
881
+ // We need to check twice because typescript
882
+ if (!isAction(toast.cancel)) return;
883
+ if (!dismissible) return;
884
+ toast.cancel.onClick == null ? void 0 : toast.cancel.onClick.call(toast.cancel, event);
885
+ deleteToast();
886
+ },
887
+ className: cn(classNames == null ? void 0 : classNames.cancelButton, toast == null ? void 0 : (_toast_classNames7 = toast.classNames) == null ? void 0 : _toast_classNames7.cancelButton)
888
+ }, toast.cancel.label) : null, /*#__PURE__*/ React__default.isValidElement(toast.action) ? toast.action : toast.action && isAction(toast.action) ? /*#__PURE__*/ React__default.createElement("button", {
889
+ "data-button": true,
890
+ "data-action": true,
891
+ style: toast.actionButtonStyle || actionButtonStyle,
892
+ onClick: (event)=>{
893
+ // We need to check twice because typescript
894
+ if (!isAction(toast.action)) return;
895
+ toast.action.onClick == null ? void 0 : toast.action.onClick.call(toast.action, event);
896
+ if (event.defaultPrevented) return;
897
+ deleteToast();
898
+ },
899
+ className: cn(classNames == null ? void 0 : classNames.actionButton, toast == null ? void 0 : (_toast_classNames8 = toast.classNames) == null ? void 0 : _toast_classNames8.actionButton)
900
+ }, toast.action.label) : null);
901
+ };
902
+ function getDocumentDirection() {
903
+ if (typeof window === 'undefined') return 'ltr';
904
+ if (typeof document === 'undefined') return 'ltr'; // For Fresh purpose
905
+ const dirAttribute = document.documentElement.getAttribute('dir');
906
+ if (dirAttribute === 'auto' || !dirAttribute) {
907
+ return window.getComputedStyle(document.documentElement).direction;
908
+ }
909
+ return dirAttribute;
910
+ }
911
+ function assignOffset(defaultOffset, mobileOffset) {
912
+ const styles = {};
913
+ [
914
+ defaultOffset,
915
+ mobileOffset
916
+ ].forEach((offset, index)=>{
917
+ const isMobile = index === 1;
918
+ const prefix = isMobile ? '--mobile-offset' : '--offset';
919
+ const defaultValue = isMobile ? MOBILE_VIEWPORT_OFFSET : VIEWPORT_OFFSET;
920
+ function assignAll(offset) {
921
+ [
922
+ 'top',
923
+ 'right',
924
+ 'bottom',
925
+ 'left'
926
+ ].forEach((key)=>{
927
+ styles[`${prefix}-${key}`] = typeof offset === 'number' ? `${offset}px` : offset;
928
+ });
929
+ }
930
+ if (typeof offset === 'number' || typeof offset === 'string') {
931
+ assignAll(offset);
932
+ } else if (typeof offset === 'object') {
933
+ [
934
+ 'top',
935
+ 'right',
936
+ 'bottom',
937
+ 'left'
938
+ ].forEach((key)=>{
939
+ if (offset[key] === undefined) {
940
+ styles[`${prefix}-${key}`] = defaultValue;
941
+ } else {
942
+ styles[`${prefix}-${key}`] = typeof offset[key] === 'number' ? `${offset[key]}px` : offset[key];
943
+ }
944
+ });
945
+ } else {
946
+ assignAll(defaultValue);
947
+ }
948
+ });
949
+ return styles;
950
+ }
951
+ const Toaster$2 = /*#__PURE__*/ React__default.forwardRef(function Toaster(props, ref) {
952
+ const { id, invert, position = 'bottom-right', hotkey = [
953
+ 'altKey',
954
+ 'KeyT'
955
+ ], expand, closeButton, className, offset, mobileOffset, theme = 'light', richColors, duration, style, visibleToasts = VISIBLE_TOASTS_AMOUNT, toastOptions, dir = getDocumentDirection(), gap = GAP, icons, containerAriaLabel = 'Notifications' } = props;
956
+ const [toasts, setToasts] = React__default.useState([]);
957
+ const filteredToasts = React__default.useMemo(()=>{
958
+ if (id) {
959
+ return toasts.filter((toast)=>toast.toasterId === id);
960
+ }
961
+ return toasts.filter((toast)=>!toast.toasterId);
962
+ }, [
963
+ toasts,
964
+ id
965
+ ]);
966
+ const possiblePositions = React__default.useMemo(()=>{
967
+ return Array.from(new Set([
968
+ position
969
+ ].concat(filteredToasts.filter((toast)=>toast.position).map((toast)=>toast.position))));
970
+ }, [
971
+ filteredToasts,
972
+ position
973
+ ]);
974
+ const [heights, setHeights] = React__default.useState([]);
975
+ const [expanded, setExpanded] = React__default.useState(false);
976
+ const [interacting, setInteracting] = React__default.useState(false);
977
+ const [actualTheme, setActualTheme] = React__default.useState(theme !== 'system' ? theme : typeof window !== 'undefined' ? window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light' : 'light');
978
+ const listRef = React__default.useRef(null);
979
+ const hotkeyLabel = hotkey.join('+').replace(/Key/g, '').replace(/Digit/g, '');
980
+ const lastFocusedElementRef = React__default.useRef(null);
981
+ const isFocusWithinRef = React__default.useRef(false);
982
+ const removeToast = React__default.useCallback((toastToRemove)=>{
983
+ setToasts((toasts)=>{
984
+ var _toasts_find;
985
+ if (!((_toasts_find = toasts.find((toast)=>toast.id === toastToRemove.id)) == null ? void 0 : _toasts_find.delete)) {
986
+ ToastState.dismiss(toastToRemove.id);
987
+ }
988
+ return toasts.filter(({ id })=>id !== toastToRemove.id);
989
+ });
990
+ }, []);
991
+ React__default.useEffect(()=>{
992
+ return ToastState.subscribe((toast)=>{
993
+ if (toast.dismiss) {
994
+ // Prevent batching of other state updates
995
+ requestAnimationFrame(()=>{
996
+ setToasts((toasts)=>toasts.map((t)=>t.id === toast.id ? {
997
+ ...t,
998
+ delete: true
999
+ } : t));
1000
+ });
1001
+ return;
1002
+ }
1003
+ // Prevent batching, temp solution.
1004
+ setTimeout(()=>{
1005
+ ReactDOM__default.flushSync(()=>{
1006
+ setToasts((toasts)=>{
1007
+ const indexOfExistingToast = toasts.findIndex((t)=>t.id === toast.id);
1008
+ // Update the toast if it already exists
1009
+ if (indexOfExistingToast !== -1) {
1010
+ return [
1011
+ ...toasts.slice(0, indexOfExistingToast),
1012
+ {
1013
+ ...toasts[indexOfExistingToast],
1014
+ ...toast
1015
+ },
1016
+ ...toasts.slice(indexOfExistingToast + 1)
1017
+ ];
1018
+ }
1019
+ return [
1020
+ toast,
1021
+ ...toasts
1022
+ ];
1023
+ });
1024
+ });
1025
+ });
1026
+ });
1027
+ }, [
1028
+ toasts
1029
+ ]);
1030
+ React__default.useEffect(()=>{
1031
+ if (theme !== 'system') {
1032
+ setActualTheme(theme);
1033
+ return;
1034
+ }
1035
+ if (theme === 'system') {
1036
+ // check if current preference is dark
1037
+ if (window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches) {
1038
+ // it's currently dark
1039
+ setActualTheme('dark');
1040
+ } else {
1041
+ // it's not dark
1042
+ setActualTheme('light');
1043
+ }
1044
+ }
1045
+ if (typeof window === 'undefined') return;
1046
+ const darkMediaQuery = window.matchMedia('(prefers-color-scheme: dark)');
1047
+ try {
1048
+ // Chrome & Firefox
1049
+ darkMediaQuery.addEventListener('change', ({ matches })=>{
1050
+ if (matches) {
1051
+ setActualTheme('dark');
1052
+ } else {
1053
+ setActualTheme('light');
1054
+ }
1055
+ });
1056
+ } catch (error) {
1057
+ // Safari < 14
1058
+ darkMediaQuery.addListener(({ matches })=>{
1059
+ try {
1060
+ if (matches) {
1061
+ setActualTheme('dark');
1062
+ } else {
1063
+ setActualTheme('light');
1064
+ }
1065
+ } catch (e) {
1066
+ console.error(e);
1067
+ }
1068
+ });
1069
+ }
1070
+ }, [
1071
+ theme
1072
+ ]);
1073
+ React__default.useEffect(()=>{
1074
+ // Ensure expanded is always false when no toasts are present / only one left
1075
+ if (toasts.length <= 1) {
1076
+ setExpanded(false);
1077
+ }
1078
+ }, [
1079
+ toasts
1080
+ ]);
1081
+ React__default.useEffect(()=>{
1082
+ const handleKeyDown = (event)=>{
1083
+ var _listRef_current;
1084
+ const isHotkeyPressed = hotkey.every((key)=>event[key] || event.code === key);
1085
+ if (isHotkeyPressed) {
1086
+ var _listRef_current1;
1087
+ setExpanded(true);
1088
+ (_listRef_current1 = listRef.current) == null ? void 0 : _listRef_current1.focus();
1089
+ }
1090
+ if (event.code === 'Escape' && (document.activeElement === listRef.current || ((_listRef_current = listRef.current) == null ? void 0 : _listRef_current.contains(document.activeElement)))) {
1091
+ setExpanded(false);
1092
+ }
1093
+ };
1094
+ document.addEventListener('keydown', handleKeyDown);
1095
+ return ()=>document.removeEventListener('keydown', handleKeyDown);
1096
+ }, [
1097
+ hotkey
1098
+ ]);
1099
+ React__default.useEffect(()=>{
1100
+ if (listRef.current) {
1101
+ return ()=>{
1102
+ if (lastFocusedElementRef.current) {
1103
+ lastFocusedElementRef.current.focus({
1104
+ preventScroll: true
1105
+ });
1106
+ lastFocusedElementRef.current = null;
1107
+ isFocusWithinRef.current = false;
1108
+ }
1109
+ };
1110
+ }
1111
+ }, [
1112
+ listRef.current
1113
+ ]);
1114
+ return(// Remove item from normal navigation flow, only available via hotkey
1115
+ /*#__PURE__*/ React__default.createElement("section", {
1116
+ ref: ref,
1117
+ "aria-label": `${containerAriaLabel} ${hotkeyLabel}`,
1118
+ tabIndex: -1,
1119
+ "aria-live": "polite",
1120
+ "aria-relevant": "additions text",
1121
+ "aria-atomic": "false",
1122
+ suppressHydrationWarning: true
1123
+ }, possiblePositions.map((position, index)=>{
1124
+ var _heights_;
1125
+ const [y, x] = position.split('-');
1126
+ if (!filteredToasts.length) return null;
1127
+ return /*#__PURE__*/ React__default.createElement("ol", {
1128
+ key: position,
1129
+ dir: dir === 'auto' ? getDocumentDirection() : dir,
1130
+ tabIndex: -1,
1131
+ ref: listRef,
1132
+ className: className,
1133
+ "data-sonner-toaster": true,
1134
+ "data-sonner-theme": actualTheme,
1135
+ "data-y-position": y,
1136
+ "data-x-position": x,
1137
+ style: {
1138
+ '--front-toast-height': `${((_heights_ = heights[0]) == null ? void 0 : _heights_.height) || 0}px`,
1139
+ '--width': `${TOAST_WIDTH}px`,
1140
+ '--gap': `${gap}px`,
1141
+ ...style,
1142
+ ...assignOffset(offset, mobileOffset)
1143
+ },
1144
+ onBlur: (event)=>{
1145
+ if (isFocusWithinRef.current && !event.currentTarget.contains(event.relatedTarget)) {
1146
+ isFocusWithinRef.current = false;
1147
+ if (lastFocusedElementRef.current) {
1148
+ lastFocusedElementRef.current.focus({
1149
+ preventScroll: true
1150
+ });
1151
+ lastFocusedElementRef.current = null;
1152
+ }
1153
+ }
1154
+ },
1155
+ onFocus: (event)=>{
1156
+ const isNotDismissible = event.target instanceof HTMLElement && event.target.dataset.dismissible === 'false';
1157
+ if (isNotDismissible) return;
1158
+ if (!isFocusWithinRef.current) {
1159
+ isFocusWithinRef.current = true;
1160
+ lastFocusedElementRef.current = event.relatedTarget;
1161
+ }
1162
+ },
1163
+ onMouseEnter: ()=>setExpanded(true),
1164
+ onMouseMove: ()=>setExpanded(true),
1165
+ onMouseLeave: ()=>{
1166
+ // Avoid setting expanded to false when interacting with a toast, e.g. swiping
1167
+ if (!interacting) {
1168
+ setExpanded(false);
1169
+ }
1170
+ },
1171
+ onDragEnd: ()=>setExpanded(false),
1172
+ onPointerDown: (event)=>{
1173
+ const isNotDismissible = event.target instanceof HTMLElement && event.target.dataset.dismissible === 'false';
1174
+ if (isNotDismissible) return;
1175
+ setInteracting(true);
1176
+ },
1177
+ onPointerUp: ()=>setInteracting(false)
1178
+ }, filteredToasts.filter((toast)=>!toast.position && index === 0 || toast.position === position).map((toast, index)=>{
1179
+ var _toastOptions_duration, _toastOptions_closeButton;
1180
+ return /*#__PURE__*/ React__default.createElement(Toast, {
1181
+ key: toast.id,
1182
+ icons: icons,
1183
+ index: index,
1184
+ toast: toast,
1185
+ defaultRichColors: richColors,
1186
+ duration: (_toastOptions_duration = toastOptions == null ? void 0 : toastOptions.duration) != null ? _toastOptions_duration : duration,
1187
+ className: toastOptions == null ? void 0 : toastOptions.className,
1188
+ descriptionClassName: toastOptions == null ? void 0 : toastOptions.descriptionClassName,
1189
+ invert: invert,
1190
+ visibleToasts: visibleToasts,
1191
+ closeButton: (_toastOptions_closeButton = toastOptions == null ? void 0 : toastOptions.closeButton) != null ? _toastOptions_closeButton : closeButton,
1192
+ interacting: interacting,
1193
+ position: position,
1194
+ style: toastOptions == null ? void 0 : toastOptions.style,
1195
+ unstyled: toastOptions == null ? void 0 : toastOptions.unstyled,
1196
+ classNames: toastOptions == null ? void 0 : toastOptions.classNames,
1197
+ cancelButtonStyle: toastOptions == null ? void 0 : toastOptions.cancelButtonStyle,
1198
+ actionButtonStyle: toastOptions == null ? void 0 : toastOptions.actionButtonStyle,
1199
+ closeButtonAriaLabel: toastOptions == null ? void 0 : toastOptions.closeButtonAriaLabel,
1200
+ removeToast: removeToast,
1201
+ toasts: filteredToasts.filter((t)=>t.position == toast.position),
1202
+ heights: heights.filter((h)=>h.position == toast.position),
1203
+ setHeights: setHeights,
1204
+ expandByDefault: expand,
1205
+ gap: gap,
1206
+ expanded: expanded,
1207
+ swipeDirections: props.swipeDirections
1208
+ });
1209
+ }));
1210
+ })));
1211
+ });
1212
+
1213
+ const Toaster$1 = ({ ...props }) => {
1214
+ const { theme = "system" } = z();
1215
+ return (jsx(Toaster$2, { theme: theme, className: "toaster group", icons: {
1216
+ success: (jsx(CircleCheck, { className: "size-4" })),
1217
+ info: (jsx(Info, { className: "size-4" })),
1218
+ warning: (jsx(TriangleAlert, { className: "size-4" })),
1219
+ error: (jsx(OctagonX, { className: "size-4" })),
1220
+ loading: (jsx(LoaderCircle, { className: "size-4 animate-spin" })),
1221
+ }, style: {
1222
+ "--normal-bg": "var(--popover)",
1223
+ "--normal-text": "var(--popover-foreground)",
1224
+ "--normal-border": "var(--border)",
1225
+ "--border-radius": "var(--radius)",
1226
+ }, toastOptions: {
1227
+ classNames: {
1228
+ toast: "cn-toast",
1229
+ },
1230
+ }, ...props }));
1231
+ };
1232
+
1233
+ const Toaster = (props) => (jsx(Toaster$1, { ...props }));
1234
+
1235
+ export { Toaster };
1236
+ //# sourceMappingURL=Sonner.js.map