@spark-ui/components 14.0.0-beta.1 → 14.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (382) hide show
  1. package/dist/Button-B6rA3-e5.js +2 -0
  2. package/dist/{Button-C3xHNaGl.js.map → Button-B6rA3-e5.js.map} +1 -1
  3. package/dist/{Button-D32Avk2j.mjs → Button-C3C0aixy.mjs} +4 -4
  4. package/dist/{Button-D32Avk2j.mjs.map → Button-C3C0aixy.mjs.map} +1 -1
  5. package/dist/DialogContent.styles-BSfXHt21.mjs +61 -0
  6. package/dist/DialogContent.styles-BSfXHt21.mjs.map +1 -0
  7. package/dist/DialogContent.styles-bBs6l8Cy.js +2 -0
  8. package/dist/DialogContent.styles-bBs6l8Cy.js.map +1 -0
  9. package/dist/Icon-CF0W0LKr.js +2 -0
  10. package/dist/{Icon-Bf0XrmiR.js.map → Icon-CF0W0LKr.js.map} +1 -1
  11. package/dist/{Icon-D1RueiPY.mjs → Icon-Ck-dhfLd.mjs} +6 -6
  12. package/dist/{Icon-D1RueiPY.mjs.map → Icon-Ck-dhfLd.mjs.map} +1 -1
  13. package/dist/{IconButton-BY3gYXtU.mjs → IconButton-C62-axzv.mjs} +6 -6
  14. package/dist/{IconButton-BY3gYXtU.mjs.map → IconButton-C62-axzv.mjs.map} +1 -1
  15. package/dist/IconButton-D3g86WpZ.js +2 -0
  16. package/dist/{IconButton-Bf-EDzpI.js.map → IconButton-D3g86WpZ.js.map} +1 -1
  17. package/dist/Slot-D2Bbf8Gw.mjs +14 -0
  18. package/dist/{Slot-C98rL4yy.mjs.map → Slot-D2Bbf8Gw.mjs.map} +1 -1
  19. package/dist/Slot-DQ8z2zsy.js +2 -0
  20. package/dist/{Slot-ghrohQLA.js.map → Slot-DQ8z2zsy.js.map} +1 -1
  21. package/dist/Spinner-_Kffli3B.js +2 -0
  22. package/dist/{Spinner-DK8VEsaR.js.map → Spinner-_Kffli3B.js.map} +1 -1
  23. package/dist/{Spinner-CYL5kyzM.mjs → Spinner-jF3-zoh_.mjs} +3 -3
  24. package/dist/{Spinner-CYL5kyzM.mjs.map → Spinner-jF3-zoh_.mjs.map} +1 -1
  25. package/dist/{TextLink-3MEVs3No.mjs → TextLink-BuzFRWO6.mjs} +3 -3
  26. package/dist/{TextLink-3MEVs3No.mjs.map → TextLink-BuzFRWO6.mjs.map} +1 -1
  27. package/dist/TextLink-C3xDLsbC.js +2 -0
  28. package/dist/{TextLink-DD0VO37q.js.map → TextLink-C3xDLsbC.js.map} +1 -1
  29. package/dist/{VisuallyHidden-AoRh4WRK.js → VisuallyHidden-CB6Nx76j.js} +2 -2
  30. package/dist/{VisuallyHidden-AoRh4WRK.js.map → VisuallyHidden-CB6Nx76j.js.map} +1 -1
  31. package/dist/{VisuallyHidden-ByNP7ZUI.mjs → VisuallyHidden-KH1biLx-.mjs} +2 -2
  32. package/dist/{VisuallyHidden-ByNP7ZUI.mjs.map → VisuallyHidden-KH1biLx-.mjs.map} +1 -1
  33. package/dist/accordion/index.d.mts +15 -0
  34. package/dist/accordion/index.js +1 -1
  35. package/dist/accordion/index.js.map +1 -1
  36. package/dist/accordion/index.mjs +90 -608
  37. package/dist/accordion/index.mjs.map +1 -1
  38. package/dist/alert-dialog/AlertDialogPortal.d.ts +1 -1
  39. package/dist/alert-dialog/index.d.mts +38 -0
  40. package/dist/alert-dialog/index.js +1 -34
  41. package/dist/alert-dialog/index.js.map +1 -1
  42. package/dist/alert-dialog/index.mjs +139 -2475
  43. package/dist/alert-dialog/index.mjs.map +1 -1
  44. package/dist/avatar/index.d.mts +15 -0
  45. package/dist/avatar/index.js +1 -1
  46. package/dist/avatar/index.js.map +1 -1
  47. package/dist/avatar/index.mjs +4 -4
  48. package/dist/badge/index.d.mts +1 -0
  49. package/dist/badge/index.js +1 -1
  50. package/dist/badge/index.js.map +1 -1
  51. package/dist/badge/index.mjs +6 -6
  52. package/dist/breadcrumb/index.d.mts +12 -0
  53. package/dist/breadcrumb/index.js +1 -1
  54. package/dist/breadcrumb/index.js.map +1 -1
  55. package/dist/breadcrumb/index.mjs +21 -21
  56. package/dist/button/Button.d.ts +1 -1
  57. package/dist/button/index.d.mts +1 -0
  58. package/dist/button/index.js +1 -1
  59. package/dist/button/index.mjs +1 -1
  60. package/dist/button/variants/index.d.mts +5 -0
  61. package/dist/card/index.d.mts +8 -0
  62. package/dist/card/index.js +1 -1
  63. package/dist/card/index.js.map +1 -1
  64. package/dist/card/index.mjs +2 -2
  65. package/dist/carousel/index.d.mts +19 -0
  66. package/dist/carousel/index.js +1 -1
  67. package/dist/carousel/index.js.map +1 -1
  68. package/dist/carousel/index.mjs +3 -3
  69. package/dist/checkbox/index.d.mts +2 -0
  70. package/dist/checkbox/index.js +1 -1
  71. package/dist/checkbox/index.js.map +1 -1
  72. package/dist/checkbox/index.mjs +128 -364
  73. package/dist/checkbox/index.mjs.map +1 -1
  74. package/dist/chip/index.d.mts +15 -0
  75. package/dist/chip/index.js +1 -1
  76. package/dist/chip/index.js.map +1 -1
  77. package/dist/chip/index.mjs +196 -370
  78. package/dist/chip/index.mjs.map +1 -1
  79. package/dist/chip/variants/index.d.mts +3 -0
  80. package/dist/collapsible/index.d.mts +7 -0
  81. package/dist/collapsible/index.js +1 -1
  82. package/dist/collapsible/index.js.map +1 -1
  83. package/dist/collapsible/index.mjs +38 -213
  84. package/dist/collapsible/index.mjs.map +1 -1
  85. package/dist/combobox/index.d.mts +35 -0
  86. package/dist/combobox/index.js +1 -1
  87. package/dist/combobox/index.js.map +1 -1
  88. package/dist/combobox/index.mjs +7 -7
  89. package/dist/combobox/utils/index.d.mts +14 -0
  90. package/dist/dialog/Dialog.d.ts +13 -13
  91. package/dist/dialog/DialogClose.d.ts +9 -8
  92. package/dist/dialog/DialogContent.d.ts +4 -4
  93. package/dist/dialog/DialogDescription.d.ts +3 -3
  94. package/dist/dialog/DialogOverlay.d.ts +5 -5
  95. package/dist/dialog/DialogPortal.d.ts +4 -4
  96. package/dist/dialog/DialogTitle.d.ts +3 -3
  97. package/dist/dialog/DialogTrigger.d.ts +5 -9
  98. package/dist/dialog/index.d.mts +37 -0
  99. package/dist/dialog/index.js +1 -1
  100. package/dist/dialog/index.js.map +1 -1
  101. package/dist/dialog/index.mjs +149 -159
  102. package/dist/dialog/index.mjs.map +1 -1
  103. package/dist/divider/index.d.mts +6 -0
  104. package/dist/divider/index.js +1 -1
  105. package/dist/divider/index.js.map +1 -1
  106. package/dist/divider/index.mjs +58 -76
  107. package/dist/divider/index.mjs.map +1 -1
  108. package/dist/drawer/Drawer.d.ts +12 -19
  109. package/dist/drawer/DrawerClose.d.ts +9 -5
  110. package/dist/drawer/DrawerContent.d.ts +5 -5
  111. package/dist/drawer/DrawerDescription.d.ts +4 -4
  112. package/dist/drawer/DrawerOverlay.d.ts +5 -5
  113. package/dist/drawer/DrawerPortal.d.ts +4 -4
  114. package/dist/drawer/DrawerTitle.d.ts +5 -5
  115. package/dist/drawer/DrawerTrigger.d.ts +5 -5
  116. package/dist/drawer/index.d.mts +37 -0
  117. package/dist/drawer/index.d.ts +2 -0
  118. package/dist/drawer/index.js +1 -1
  119. package/dist/drawer/index.js.map +1 -1
  120. package/dist/drawer/index.mjs +143 -114
  121. package/dist/drawer/index.mjs.map +1 -1
  122. package/dist/drawer/useRenderSlot.d.ts +3 -0
  123. package/dist/dropdown/index.d.mts +29 -0
  124. package/dist/dropdown/index.js +1 -1
  125. package/dist/dropdown/index.js.map +1 -1
  126. package/dist/dropdown/index.mjs +5 -5
  127. package/dist/file-upload/index.d.mts +22 -0
  128. package/dist/file-upload/index.js +1 -1
  129. package/dist/file-upload/index.js.map +1 -1
  130. package/dist/file-upload/index.mjs +6 -6
  131. package/dist/form-field/index.d.mts +31 -0
  132. package/dist/form-field/index.js +1 -1
  133. package/dist/form-field/index.js.map +1 -1
  134. package/dist/form-field/index.mjs +47 -47
  135. package/dist/icon/index.d.mts +1 -0
  136. package/dist/icon/index.js +1 -1
  137. package/dist/icon/index.mjs +1 -1
  138. package/dist/icon-button/index.d.mts +1 -0
  139. package/dist/icon-button/index.js +1 -1
  140. package/dist/icon-button/index.mjs +1 -1
  141. package/dist/input/index.d.mts +21 -0
  142. package/dist/input/index.js +1 -1
  143. package/dist/input/index.js.map +1 -1
  144. package/dist/input/index.mjs +4 -4
  145. package/dist/input-otp/index.d.mts +14 -0
  146. package/dist/input-otp/index.js +1 -1
  147. package/dist/input-otp/index.js.map +1 -1
  148. package/dist/input-otp/index.mjs +139 -137
  149. package/dist/input-otp/index.mjs.map +1 -1
  150. package/dist/kbd/index.d.mts +1 -0
  151. package/dist/label/index.d.mts +7 -0
  152. package/dist/label/index.js +1 -1
  153. package/dist/label/index.js.map +1 -1
  154. package/dist/label/index.mjs +37 -2
  155. package/dist/label/index.mjs.map +1 -1
  156. package/dist/link-box/index.d.mts +9 -0
  157. package/dist/link-box/index.js +1 -1
  158. package/dist/link-box/index.js.map +1 -1
  159. package/dist/link-box/index.mjs +7 -7
  160. package/dist/pagination/index.d.mts +18 -0
  161. package/dist/pagination/index.js +1 -1
  162. package/dist/pagination/index.js.map +1 -1
  163. package/dist/pagination/index.mjs +126 -844
  164. package/dist/pagination/index.mjs.map +1 -1
  165. package/dist/popover/index.d.mts +17 -0
  166. package/dist/popover/index.js +1 -1
  167. package/dist/popover/index.js.map +1 -1
  168. package/dist/popover/index.mjs +119 -1748
  169. package/dist/popover/index.mjs.map +1 -1
  170. package/dist/portal/index.d.mts +1 -0
  171. package/dist/portal/index.js +1 -1
  172. package/dist/portal/index.js.map +1 -1
  173. package/dist/portal/index.mjs +3 -3
  174. package/dist/portal/index.mjs.map +1 -1
  175. package/dist/progress/index.d.mts +13 -0
  176. package/dist/progress/index.js +1 -6
  177. package/dist/progress/index.js.map +1 -1
  178. package/dist/progress/index.mjs +87 -162
  179. package/dist/progress/index.mjs.map +1 -1
  180. package/dist/progress-tracker/index.d.mts +10 -0
  181. package/dist/progress-tracker/index.js +1 -1
  182. package/dist/progress-tracker/index.js.map +1 -1
  183. package/dist/progress-tracker/index.mjs +14 -14
  184. package/dist/radio-group/index.d.mts +7 -0
  185. package/dist/radio-group/index.js +1 -1
  186. package/dist/radio-group/index.js.map +1 -1
  187. package/dist/radio-group/index.mjs +85 -312
  188. package/dist/radio-group/index.mjs.map +1 -1
  189. package/dist/rating/index.d.mts +1 -0
  190. package/dist/rating/index.js +1 -1
  191. package/dist/rating/index.js.map +1 -1
  192. package/dist/rating/index.mjs +11 -11
  193. package/dist/scrolling-list/index.d.mts +15 -0
  194. package/dist/scrolling-list/index.js +1 -1
  195. package/dist/scrolling-list/index.js.map +1 -1
  196. package/dist/scrolling-list/index.mjs +168 -333
  197. package/dist/scrolling-list/index.mjs.map +1 -1
  198. package/dist/segmented-gauge/index.d.mts +13 -0
  199. package/dist/segmented-gauge/index.js +1 -1
  200. package/dist/segmented-gauge/index.js.map +1 -1
  201. package/dist/segmented-gauge/index.mjs +1 -1
  202. package/dist/select/index.d.mts +21 -0
  203. package/dist/select/index.js +1 -1
  204. package/dist/select/index.js.map +1 -1
  205. package/dist/select/index.mjs +21 -21
  206. package/dist/skeleton/index.d.mts +8 -0
  207. package/dist/skeleton/index.js +1 -1
  208. package/dist/skeleton/index.js.map +1 -1
  209. package/dist/skeleton/index.mjs +2 -2
  210. package/dist/slider/Slider.d.ts +6 -1
  211. package/dist/slider/SliderContext.d.ts +4 -1
  212. package/dist/slider/index.d.mts +8 -0
  213. package/dist/slider/index.js +1 -1
  214. package/dist/slider/index.js.map +1 -1
  215. package/dist/slider/index.mjs +96 -496
  216. package/dist/slider/index.mjs.map +1 -1
  217. package/dist/slot/index.d.mts +1 -0
  218. package/dist/slot/index.js +1 -1
  219. package/dist/slot/index.mjs +1 -1
  220. package/dist/snackbar/index.d.mts +13 -0
  221. package/dist/snackbar/index.js +1 -1
  222. package/dist/snackbar/index.js.map +1 -1
  223. package/dist/snackbar/index.mjs +189 -1105
  224. package/dist/snackbar/index.mjs.map +1 -1
  225. package/dist/spinner/index.d.mts +1 -0
  226. package/dist/spinner/index.js +1 -1
  227. package/dist/spinner/index.mjs +1 -1
  228. package/dist/stepper/index.d.mts +9 -0
  229. package/dist/stepper/index.js +1 -7
  230. package/dist/stepper/index.js.map +1 -1
  231. package/dist/stepper/index.mjs +137 -2317
  232. package/dist/stepper/index.mjs.map +1 -1
  233. package/dist/switch/index.d.mts +1 -0
  234. package/dist/switch/index.js +1 -1
  235. package/dist/switch/index.js.map +1 -1
  236. package/dist/switch/index.mjs +85 -208
  237. package/dist/switch/index.mjs.map +1 -1
  238. package/dist/tabs/index.d.mts +13 -0
  239. package/dist/tabs/index.js +1 -1
  240. package/dist/tabs/index.js.map +1 -1
  241. package/dist/tabs/index.mjs +179 -329
  242. package/dist/tabs/index.mjs.map +1 -1
  243. package/dist/tag/index.d.mts +1 -0
  244. package/dist/tag/index.js +1 -1
  245. package/dist/tag/index.js.map +1 -1
  246. package/dist/tag/index.mjs +2 -2
  247. package/dist/tag/variants/index.d.mts +3 -0
  248. package/dist/text-link/index.d.mts +1 -0
  249. package/dist/text-link/index.js +1 -1
  250. package/dist/text-link/index.mjs +1 -1
  251. package/dist/textarea/index.d.mts +14 -0
  252. package/dist/textarea/index.js +1 -1
  253. package/dist/textarea/index.js.map +1 -1
  254. package/dist/textarea/index.mjs +6 -6
  255. package/dist/toast/index.d.mts +20 -0
  256. package/dist/toast/index.js +1 -1
  257. package/dist/toast/index.js.map +1 -1
  258. package/dist/toast/index.mjs +146 -1008
  259. package/dist/toast/index.mjs.map +1 -1
  260. package/dist/useRenderSlot-DATwjgpo.js +2 -0
  261. package/dist/useRenderSlot-DATwjgpo.js.map +1 -0
  262. package/dist/useRenderSlot-LwWj8QbC.mjs +10 -0
  263. package/dist/useRenderSlot-LwWj8QbC.mjs.map +1 -0
  264. package/dist/visually-hidden/index.d.mts +1 -0
  265. package/dist/visually-hidden/index.js +1 -1
  266. package/dist/visually-hidden/index.mjs +1 -1
  267. package/package.json +7 -6
  268. package/dist/Button-C3xHNaGl.js +0 -2
  269. package/dist/DialogContent.styles-BrhKaHc_.js +0 -2
  270. package/dist/DialogContent.styles-BrhKaHc_.js.map +0 -1
  271. package/dist/DialogContent.styles-WGWJS9dj.mjs +0 -48
  272. package/dist/DialogContent.styles-WGWJS9dj.mjs.map +0 -1
  273. package/dist/Icon-Bf0XrmiR.js +0 -2
  274. package/dist/IconButton-Bf-EDzpI.js +0 -2
  275. package/dist/Slot-C98rL4yy.mjs +0 -14
  276. package/dist/Slot-ghrohQLA.js +0 -2
  277. package/dist/Spinner-DK8VEsaR.js +0 -2
  278. package/dist/TextLink-DD0VO37q.js +0 -2
  279. package/dist/composite-Br3kM5N9.mjs +0 -40
  280. package/dist/composite-Br3kM5N9.mjs.map +0 -1
  281. package/dist/composite-fJD9R7R0.js +0 -2
  282. package/dist/composite-fJD9R7R0.js.map +0 -1
  283. package/dist/detectBrowser-Bc7rk5fI.mjs +0 -44
  284. package/dist/detectBrowser-Bc7rk5fI.mjs.map +0 -1
  285. package/dist/detectBrowser-DTbs_30X.js +0 -2
  286. package/dist/detectBrowser-DTbs_30X.js.map +0 -1
  287. package/dist/downshift.esm-Ncwetv0s.mjs +0 -3038
  288. package/dist/downshift.esm-Ncwetv0s.mjs.map +0 -1
  289. package/dist/downshift.esm-PfCOUbxq.js +0 -37
  290. package/dist/downshift.esm-PfCOUbxq.js.map +0 -1
  291. package/dist/floating-ui.utils.dom-CCN4I08l.js +0 -2
  292. package/dist/floating-ui.utils.dom-CCN4I08l.js.map +0 -1
  293. package/dist/floating-ui.utils.dom-uiDUZc_y.mjs +0 -136
  294. package/dist/floating-ui.utils.dom-uiDUZc_y.mjs.map +0 -1
  295. package/dist/index-0KYGKeVg.js +0 -2
  296. package/dist/index-0KYGKeVg.js.map +0 -1
  297. package/dist/index-1WIgmEZh.js +0 -2
  298. package/dist/index-1WIgmEZh.js.map +0 -1
  299. package/dist/index-BRi38DTc.mjs +0 -21
  300. package/dist/index-BRi38DTc.mjs.map +0 -1
  301. package/dist/index-BZAtNKwE.mjs +0 -71
  302. package/dist/index-BZAtNKwE.mjs.map +0 -1
  303. package/dist/index-BZPx6jYI.mjs +0 -9
  304. package/dist/index-BZPx6jYI.mjs.map +0 -1
  305. package/dist/index-BlkdpEIe.mjs +0 -55
  306. package/dist/index-BlkdpEIe.mjs.map +0 -1
  307. package/dist/index-BmAFn37q.mjs +0 -49
  308. package/dist/index-BmAFn37q.mjs.map +0 -1
  309. package/dist/index-C-J_tHdS.js +0 -6
  310. package/dist/index-C-J_tHdS.js.map +0 -1
  311. package/dist/index-C1qb0595.mjs +0 -28
  312. package/dist/index-C1qb0595.mjs.map +0 -1
  313. package/dist/index-C34GgsKQ.mjs +0 -54
  314. package/dist/index-C34GgsKQ.mjs.map +0 -1
  315. package/dist/index-CCKe-Mpx.mjs +0 -7
  316. package/dist/index-CCKe-Mpx.mjs.map +0 -1
  317. package/dist/index-CDBBjNXc.js +0 -2
  318. package/dist/index-CDBBjNXc.js.map +0 -1
  319. package/dist/index-CYjGhVvU.mjs +0 -243
  320. package/dist/index-CYjGhVvU.mjs.map +0 -1
  321. package/dist/index-ChLwd62c.js +0 -2
  322. package/dist/index-ChLwd62c.js.map +0 -1
  323. package/dist/index-Cjj_rUPu.js +0 -2
  324. package/dist/index-Cjj_rUPu.js.map +0 -1
  325. package/dist/index-CyMbLkj0.js +0 -2
  326. package/dist/index-CyMbLkj0.js.map +0 -1
  327. package/dist/index-DFZozV_h.mjs +0 -69
  328. package/dist/index-DFZozV_h.mjs.map +0 -1
  329. package/dist/index-DKuHkHFX.js +0 -2
  330. package/dist/index-DKuHkHFX.js.map +0 -1
  331. package/dist/index-DLHLIYPI.mjs +0 -16
  332. package/dist/index-DLHLIYPI.mjs.map +0 -1
  333. package/dist/index-DO-atGp-.js +0 -2
  334. package/dist/index-DO-atGp-.js.map +0 -1
  335. package/dist/index-DWlg8lkk.mjs +0 -179
  336. package/dist/index-DWlg8lkk.mjs.map +0 -1
  337. package/dist/index-DYxWvftI.js +0 -2
  338. package/dist/index-DYxWvftI.js.map +0 -1
  339. package/dist/index-D_lWkK39.mjs +0 -803
  340. package/dist/index-D_lWkK39.mjs.map +0 -1
  341. package/dist/index-DdkVj7D0.js +0 -18
  342. package/dist/index-DdkVj7D0.js.map +0 -1
  343. package/dist/index-De-6atSi.js +0 -2
  344. package/dist/index-De-6atSi.js.map +0 -1
  345. package/dist/index-DhGWNzsz.mjs +0 -83
  346. package/dist/index-DhGWNzsz.mjs.map +0 -1
  347. package/dist/index-Dkj4QRX8.js +0 -2
  348. package/dist/index-Dkj4QRX8.js.map +0 -1
  349. package/dist/index-DlIFg0Eu.mjs +0 -60
  350. package/dist/index-DlIFg0Eu.mjs.map +0 -1
  351. package/dist/index-DnaHaH_0.js +0 -2
  352. package/dist/index-DnaHaH_0.js.map +0 -1
  353. package/dist/index-MHF2-CYX.js +0 -2
  354. package/dist/index-MHF2-CYX.js.map +0 -1
  355. package/dist/index-MQ0c3ZX_.js +0 -2
  356. package/dist/index-MQ0c3ZX_.js.map +0 -1
  357. package/dist/index-MSR-vgWR.mjs +0 -37
  358. package/dist/index-MSR-vgWR.mjs.map +0 -1
  359. package/dist/index-VL0YEmOW.mjs +0 -125
  360. package/dist/index-VL0YEmOW.mjs.map +0 -1
  361. package/dist/index-tXqxYME3.js +0 -42
  362. package/dist/index-tXqxYME3.js.map +0 -1
  363. package/dist/inertValue-Bif5Sqs6.mjs +0 -522
  364. package/dist/inertValue-Bif5Sqs6.mjs.map +0 -1
  365. package/dist/inertValue-ShwihJSN.js +0 -5
  366. package/dist/inertValue-ShwihJSN.js.map +0 -1
  367. package/dist/useCollapsiblePanel-D1dCo0lf.js +0 -4
  368. package/dist/useCollapsiblePanel-D1dCo0lf.js.map +0 -1
  369. package/dist/useCollapsiblePanel-kbMNl4Z4.mjs +0 -287
  370. package/dist/useCollapsiblePanel-kbMNl4Z4.mjs.map +0 -1
  371. package/dist/useFocusWithin-CFNEka2I.js +0 -2
  372. package/dist/useFocusWithin-CFNEka2I.js.map +0 -1
  373. package/dist/useFocusWithin-CoL4390f.mjs +0 -796
  374. package/dist/useFocusWithin-CoL4390f.mjs.map +0 -1
  375. package/dist/useOpenChangeComplete-Dk-u_f2y.js +0 -2
  376. package/dist/useOpenChangeComplete-Dk-u_f2y.js.map +0 -1
  377. package/dist/useOpenChangeComplete-RUbg6RBw.mjs +0 -582
  378. package/dist/useOpenChangeComplete-RUbg6RBw.mjs.map +0 -1
  379. package/dist/useTransitionStatus-CktVVKxz.mjs +0 -46
  380. package/dist/useTransitionStatus-CktVVKxz.mjs.map +0 -1
  381. package/dist/useTransitionStatus-CqbEyvIj.js +0 -2
  382. package/dist/useTransitionStatus-CqbEyvIj.js.map +0 -1
@@ -1,931 +1,14 @@
1
- import { jsx as x, jsxs as qe } from "react/jsx-runtime";
2
- import { useCallback as E, useEffect as y, useState as I, useRef as g, useMemo as Xe, createContext as Ye, useContext as Qe, Children as Je, isValidElement as et, cloneElement as Y, useSyncExternalStore as tt } from "react";
3
- import { s as Q } from "../index-VL0YEmOW.mjs";
4
- import { createPortal as nt } from "react-dom";
5
- import { $ as it, a as ot, b as J, c as at, d as rt, e as st, f as ut, g as ee, h as lt, i as F, j as w, k as ct, l as dt } from "../useFocusWithin-CoL4390f.mjs";
6
- import { c as j, a as z } from "../index-BmAFn37q.mjs";
7
- import { B as mt } from "../Button-D32Avk2j.mjs";
8
- import { Close as ft } from "@spark-ui/icons/Close";
9
- import { I as te } from "../Icon-D1RueiPY.mjs";
10
- import { I as bt } from "../IconButton-BY3gYXtU.mjs";
11
- function pt(t) {
12
- let e = E((o) => t.subscribe(o), [
13
- t
14
- ]), n = E(() => t.visibleToasts, [
15
- t
16
- ]);
17
- return {
18
- visibleToasts: Q.useSyncExternalStore(e, n, n),
19
- add: (o, r) => t.add(o, r),
20
- close: (o) => t.close(o),
21
- remove: (o) => t.remove(o),
22
- pauseAll: () => t.pauseAll(),
23
- resumeAll: () => t.resumeAll()
24
- };
25
- }
26
- class ht {
27
- /** Subscribes to updates to the visible toasts. */
28
- subscribe(e) {
29
- return this.subscriptions.add(e), () => this.subscriptions.delete(e);
30
- }
31
- /** Adds a new toast to the queue. */
32
- add(e, n = {}) {
33
- let i = Math.random().toString(36), o = {
34
- ...n,
35
- content: e,
36
- key: i,
37
- timer: n.timeout ? new vt(() => this.close(i), n.timeout) : void 0
38
- }, r = 0, s = this.queue.length;
39
- for (; r < s; ) {
40
- let c = Math.floor((r + s) / 2);
41
- (o.priority || 0) > (this.queue[c].priority || 0) ? s = c : r = c + 1;
42
- }
43
- this.queue.splice(r, 0, o), o.animation = r < this.maxVisibleToasts ? "entering" : "queued";
44
- let a = this.maxVisibleToasts;
45
- for (; a < this.queue.length; ) this.queue[a++].animation = "queued";
46
- return this.updateVisibleToasts({
47
- action: "add"
48
- }), i;
49
- }
50
- /**
51
- * Closes a toast. If `hasExitAnimation` is true, the toast
52
- * transitions to an "exiting" state instead of being removed immediately.
53
- */
54
- close(e) {
55
- let n = this.queue.findIndex((r) => r.key === e);
56
- if (n >= 0) {
57
- var i, o;
58
- (i = (o = this.queue[n]).onClose) === null || i === void 0 || i.call(o), this.queue.splice(n, 1);
59
- }
60
- this.updateVisibleToasts({
61
- action: "close",
62
- key: e
63
- });
64
- }
65
- /** Removes a toast from the visible toasts after an exiting animation. */
66
- remove(e) {
67
- this.updateVisibleToasts({
68
- action: "remove",
69
- key: e
70
- });
71
- }
72
- updateVisibleToasts(e) {
73
- let { action: n, key: i } = e, o = this.queue.slice(0, this.maxVisibleToasts);
74
- if (n === "add" && this.hasExitAnimation) {
75
- let r = this.visibleToasts.filter((s) => !o.some((a) => s.key === a.key)).map((s) => ({
76
- ...s,
77
- animation: "exiting"
78
- }));
79
- this.visibleToasts = r.concat(o).sort((s, a) => {
80
- var c, u;
81
- return ((c = a.priority) !== null && c !== void 0 ? c : 0) - ((u = s.priority) !== null && u !== void 0 ? u : 0);
82
- });
83
- } else n === "close" && this.hasExitAnimation ? this.visibleToasts = this.visibleToasts.map((r) => r.key !== i ? r : {
84
- ...r,
85
- animation: "exiting"
86
- }) : this.visibleToasts = o;
87
- for (let r of this.subscriptions) r();
88
- }
89
- /** Pauses the timers for all visible toasts. */
90
- pauseAll() {
91
- for (let e of this.visibleToasts) e.timer && e.timer.pause();
92
- }
93
- /** Resumes the timers for all visible toasts. */
94
- resumeAll() {
95
- for (let e of this.visibleToasts) e.timer && e.timer.resume();
96
- }
97
- constructor(e) {
98
- this.queue = [], this.subscriptions = /* @__PURE__ */ new Set(), this.visibleToasts = [];
99
- var n;
100
- this.maxVisibleToasts = (n = e?.maxVisibleToasts) !== null && n !== void 0 ? n : 1;
101
- var i;
102
- this.hasExitAnimation = (i = e?.hasExitAnimation) !== null && i !== void 0 ? i : !1;
103
- }
104
- }
105
- class vt {
106
- reset(e) {
107
- this.remaining = e, this.resume();
108
- }
109
- pause() {
110
- this.timerId != null && (clearTimeout(this.timerId), this.timerId = null, this.remaining -= Date.now() - this.startTime);
111
- }
112
- resume() {
113
- this.remaining <= 0 || (this.startTime = Date.now(), this.timerId = setTimeout(() => {
114
- this.timerId = null, this.remaining = 0, this.callback();
115
- }, this.remaining));
116
- }
117
- constructor(e, n) {
118
- this.startTime = null, this.remaining = n, this.callback = e;
119
- }
120
- }
121
- var ne = {};
122
- ne = {
123
- close: "إغلاق",
124
- notifications: (t, e) => `${e.plural(t.count, {
125
- one: () => `${e.number(t.count)} إشعار`,
126
- other: () => `${e.number(t.count)} إشعارات`
127
- })}.`
128
- };
129
- var ie = {};
130
- ie = {
131
- close: "Затвори",
132
- notifications: (t, e) => `${e.plural(t.count, {
133
- one: () => `${e.number(t.count)} известие`,
134
- other: () => `${e.number(t.count)} известия`
135
- })}.`
136
- };
137
- var oe = {};
138
- oe = {
139
- close: "Zavřít",
140
- notifications: (t, e) => `${e.plural(t.count, {
141
- one: () => `${e.number(t.count)} oznámení`,
142
- other: () => `${e.number(t.count)} oznámení`
143
- })}.`
144
- };
145
- var ae = {};
146
- ae = {
147
- close: "Luk",
148
- notifications: (t, e) => `${e.plural(t.count, {
149
- one: () => `${e.number(t.count)} besked`,
150
- other: () => `${e.number(t.count)} beskeder`
151
- })}.`
152
- };
153
- var re = {};
154
- re = {
155
- close: "Schließen",
156
- notifications: (t, e) => `${e.plural(t.count, {
157
- one: () => `${e.number(t.count)} Benachrichtigung`,
158
- other: () => `${e.number(t.count)} Benachrichtigungen`
159
- })}.`
160
- };
161
- var se = {};
162
- se = {
163
- close: "Κλείσιμο",
164
- notifications: (t, e) => `${e.plural(t.count, {
165
- one: () => `${e.number(t.count)} ειδοποίηση`,
166
- other: () => `${e.number(t.count)} ειδοποιήσεις`
167
- })}.`
168
- };
169
- var ue = {};
170
- ue = {
171
- close: "Close",
172
- notifications: (t, e) => `${e.plural(t.count, {
173
- one: () => `${e.number(t.count)} notification`,
174
- other: () => `${e.number(t.count)} notifications`
175
- })}.`
176
- };
177
- var le = {};
178
- le = {
179
- close: "Cerrar",
180
- notifications: (t, e) => `${e.plural(t.count, {
181
- one: () => `${e.number(t.count)} notificación`,
182
- other: () => `${e.number(t.count)} notificaciones`
183
- })}.`
184
- };
185
- var ce = {};
186
- ce = {
187
- close: "Sule",
188
- notifications: (t, e) => `${e.plural(t.count, {
189
- one: () => `${e.number(t.count)} teatis`,
190
- other: () => `${e.number(t.count)} teatist`
191
- })}.`
192
- };
193
- var de = {};
194
- de = {
195
- close: "Sulje",
196
- notifications: (t, e) => `${e.plural(t.count, {
197
- one: () => `${e.number(t.count)} ilmoitus`,
198
- other: () => `${e.number(t.count)} ilmoitusta`
199
- })}.`
200
- };
201
- var me = {};
202
- me = {
203
- close: "Fermer",
204
- notifications: (t, e) => `${e.plural(t.count, {
205
- one: () => `${e.number(t.count)} notification`,
206
- other: () => `${e.number(t.count)} notifications`
207
- })}.`
208
- };
209
- var fe = {};
210
- fe = {
211
- close: "סגור",
212
- notifications: (t, e) => `${e.plural(t.count, {
213
- one: () => `${e.number(t.count)} התראה`,
214
- other: () => `${e.number(t.count)} התראות`
215
- })}.`
216
- };
217
- var be = {};
218
- be = {
219
- close: "Zatvori",
220
- notifications: (t, e) => `${e.plural(t.count, {
221
- one: () => `${e.number(t.count)} obavijest`,
222
- other: () => `${e.number(t.count)} obavijesti`
223
- })}.`
224
- };
225
- var pe = {};
226
- pe = {
227
- close: "Bezárás",
228
- notifications: (t, e) => `${e.plural(t.count, {
229
- one: () => `${e.number(t.count)} értesítés`,
230
- other: () => `${e.number(t.count)} értesítés`
231
- })}.`
232
- };
233
- var he = {};
234
- he = {
235
- close: "Chiudi",
236
- notifications: (t, e) => `${e.plural(t.count, {
237
- one: () => `${e.number(t.count)} notifica`,
238
- other: () => `${e.number(t.count)} notifiche`
239
- })}.`
240
- };
241
- var ve = {};
242
- ve = {
243
- close: "閉じる",
244
- notifications: (t, e) => `${e.plural(t.count, {
245
- one: () => `${e.number(t.count)} 個の通知`,
246
- other: () => `${e.number(t.count)} 個の通知`
247
- })}。`
248
- };
249
- var $e = {};
250
- $e = {
251
- close: "닫기",
252
- notifications: (t, e) => `${e.plural(t.count, {
253
- one: () => `${e.number(t.count)}개 알림`,
254
- other: () => `${e.number(t.count)}개 알림`
255
- })}.`
256
- };
257
- var ge = {};
258
- ge = {
259
- close: "Uždaryti",
260
- notifications: (t, e) => `${e.plural(t.count, {
261
- one: () => `${e.number(t.count)} pranešimas`,
262
- other: () => `${e.number(t.count)} pranešimai`
263
- })}.`
264
- };
265
- var xe = {};
266
- xe = {
267
- close: "Aizvērt",
268
- notifications: (t, e) => `${e.plural(t.count, {
269
- one: () => `${e.number(t.count)} paziņojums`,
270
- other: () => `${e.number(t.count)} paziņojumi`
271
- })}.`
272
- };
273
- var ke = {};
274
- ke = {
275
- close: "Lukk",
276
- notifications: (t, e) => `${e.plural(t.count, {
277
- one: () => `${e.number(t.count)} varsling`,
278
- other: () => `${e.number(t.count)} varsler`
279
- })}.`
280
- };
281
- var Ee = {};
282
- Ee = {
283
- close: "Sluiten",
284
- notifications: (t, e) => `${e.plural(t.count, {
285
- one: () => `${e.number(t.count)} melding`,
286
- other: () => `${e.number(t.count)} meldingen`
287
- })}.`
288
- };
289
- var ye = {};
290
- ye = {
291
- close: "Zamknij",
292
- notifications: (t, e) => `${e.plural(t.count, {
293
- one: () => `${e.number(t.count)} powiadomienie`,
294
- few: () => `${e.number(t.count)} powiadomienia`,
295
- many: () => `${e.number(t.count)} powiadomień`,
296
- other: () => `${e.number(t.count)} powiadomienia`
297
- })}.`
298
- };
299
- var we = {};
300
- we = {
301
- close: "Fechar",
302
- notifications: (t, e) => `${e.plural(t.count, {
303
- one: () => `${e.number(t.count)} notificação`,
304
- other: () => `${e.number(t.count)} notificações`
305
- })}.`
306
- };
307
- var Le = {};
308
- Le = {
309
- close: "Fechar",
310
- notifications: (t, e) => `${e.plural(t.count, {
311
- one: () => `${e.number(t.count)} notificação`,
312
- other: () => `${e.number(t.count)} notificações`
313
- })}.`
314
- };
315
- var Te = {};
316
- Te = {
317
- close: "Închideţi",
318
- notifications: (t, e) => `${e.plural(t.count, {
319
- one: () => `${e.number(t.count)} notificare`,
320
- other: () => `${e.number(t.count)} notificări`
321
- })}.`
322
- };
323
- var Se = {};
324
- Se = {
325
- close: "Закрыть",
326
- notifications: (t, e) => `${e.plural(t.count, {
327
- one: () => `${e.number(t.count)} уведомление`,
328
- other: () => `${e.number(t.count)} уведомления`
329
- })}.`
330
- };
331
- var Ie = {};
332
- Ie = {
333
- close: "Zatvoriť",
334
- notifications: (t, e) => `${e.plural(t.count, {
335
- one: () => `${e.number(t.count)} oznámenie`,
336
- few: () => `${e.number(t.count)} oznámenia`,
337
- other: () => `${e.number(t.count)} oznámení`
338
- })}.`
339
- };
340
- var Ae = {};
341
- Ae = {
342
- close: "Zapri",
343
- notifications: (t, e) => `${e.plural(t.count, {
344
- one: () => `${e.number(t.count)} obvestilo`,
345
- two: () => `${e.number(t.count)} obvestili`,
346
- few: () => `${e.number(t.count)} obvestila`,
347
- other: () => `${e.number(t.count)} obvestil`
348
- })}.`
349
- };
350
- var Ce = {};
351
- Ce = {
352
- close: "Zatvori",
353
- notifications: (t, e) => `${e.plural(t.count, {
354
- one: () => `${e.number(t.count)} obaveštenje`,
355
- other: () => `${e.number(t.count)} obaveštenja`
356
- })}.`
357
- };
358
- var Ne = {};
359
- Ne = {
360
- close: "Stäng",
361
- notifications: (t, e) => `${e.plural(t.count, {
362
- one: () => `${e.number(t.count)} meddelande`,
363
- other: () => `${e.number(t.count)} meddelanden`
364
- })}.`
365
- };
366
- var Pe = {};
367
- Pe = {
368
- close: "Kapat",
369
- notifications: (t, e) => `${e.plural(t.count, {
370
- one: () => `${e.number(t.count)} bildirim`,
371
- other: () => `${e.number(t.count)} bildirim`
372
- })}.`
373
- };
374
- var Be = {};
375
- Be = {
376
- close: "Закрити",
377
- notifications: (t, e) => `${e.plural(t.count, {
378
- one: () => `${e.number(t.count)} сповіщення`,
379
- other: () => `${e.number(t.count)} сповіщення`
380
- })}.`
381
- };
382
- var _e = {};
383
- _e = {
384
- close: "关闭",
385
- notifications: (t, e) => `${e.plural(t.count, {
386
- one: () => `${e.number(t.count)} 个通知`,
387
- other: () => `${e.number(t.count)} 个通知`
388
- })}。`
389
- };
390
- var He = {};
391
- He = {
392
- close: "關閉",
393
- notifications: (t, e) => `${e.plural(t.count, {
394
- one: () => `${e.number(t.count)} 個通知`,
395
- other: () => `${e.number(t.count)} 個通知`
396
- })}。`
397
- };
398
- var G = {};
399
- G = {
400
- "ar-AE": ne,
401
- "bg-BG": ie,
402
- "cs-CZ": oe,
403
- "da-DK": ae,
404
- "de-DE": re,
405
- "el-GR": se,
406
- "en-US": ue,
407
- "es-ES": le,
408
- "et-EE": ce,
409
- "fi-FI": de,
410
- "fr-FR": me,
411
- "he-IL": fe,
412
- "hr-HR": be,
413
- "hu-HU": pe,
414
- "it-IT": he,
415
- "ja-JP": ve,
416
- "ko-KR": $e,
417
- "lt-LT": ge,
418
- "lv-LV": xe,
419
- "nb-NO": ke,
420
- "nl-NL": Ee,
421
- "pl-PL": ye,
422
- "pt-BR": we,
423
- "pt-PT": Le,
424
- "ro-RO": Te,
425
- "ru-RU": Se,
426
- "sk-SK": Ie,
427
- "sl-SI": Ae,
428
- "sr-SP": Ce,
429
- "sv-SE": Ne,
430
- "tr-TR": Pe,
431
- "uk-UA": Be,
432
- "zh-CN": _e,
433
- "zh-TW": He
434
- };
435
- function $t(t) {
436
- return t && t.__esModule ? t.default : t;
437
- }
438
- function gt(t, e, n) {
439
- let { key: i, timer: o, timeout: r } = t.toast;
440
- y(() => {
441
- if (!(o == null || r == null))
442
- return o.reset(r), () => {
443
- o.pause();
444
- };
445
- }, [
446
- o,
447
- r
448
- ]);
449
- let s = it(), a = ot(), c = J($t(G), "@react-aria/toast"), [u, f] = I(!1);
450
- return y(() => {
451
- f(!0);
452
- }, []), {
453
- toastProps: {
454
- ...at(t, {
455
- labelable: !0
456
- }),
457
- role: "alertdialog",
458
- "aria-modal": "false",
459
- "aria-labelledby": t["aria-labelledby"] || s,
460
- "aria-describedby": t["aria-describedby"] || a,
461
- tabIndex: 0
462
- },
463
- contentProps: {
464
- role: "alert",
465
- "aria-atomic": "true",
466
- "aria-hidden": u ? void 0 : "true"
467
- },
468
- titleProps: {
469
- id: s
470
- },
471
- descriptionProps: {
472
- id: a
473
- },
474
- closeButtonProps: {
475
- "aria-label": c.format("close"),
476
- onPress: () => e.close(i)
477
- }
478
- };
479
- }
480
- let S = !1, L = 0;
481
- function O() {
482
- S = !0, setTimeout(() => {
483
- S = !1;
484
- }, 50);
485
- }
486
- function Z(t) {
487
- t.pointerType === "touch" && O();
488
- }
489
- function xt() {
490
- if (!(typeof document > "u"))
491
- return L === 0 && (typeof PointerEvent < "u" ? document.addEventListener("pointerup", Z) : process.env.NODE_ENV === "test" && document.addEventListener("touchend", O)), L++, () => {
492
- L--, !(L > 0) && (typeof PointerEvent < "u" ? document.removeEventListener("pointerup", Z) : process.env.NODE_ENV === "test" && document.removeEventListener("touchend", O));
493
- };
494
- }
495
- function kt(t) {
496
- let { onHoverStart: e, onHoverChange: n, onHoverEnd: i, isDisabled: o } = t, [r, s] = I(!1), a = g({
497
- isHovered: !1,
498
- ignoreEmulatedMouseEvents: !1,
499
- pointerType: "",
500
- target: null
501
- }).current;
502
- y(xt, []);
503
- let { addGlobalListener: c, removeAllGlobalListeners: u } = rt(), { hoverProps: f, triggerHoverEnd: h } = Xe(() => {
504
- let b = (d, p) => {
505
- if (a.pointerType = p, o || p === "touch" || a.isHovered || !d.currentTarget.contains(d.target)) return;
506
- a.isHovered = !0;
507
- let m = d.currentTarget;
508
- a.target = m, c(st(d.target), "pointerover", ($) => {
509
- a.isHovered && a.target && !ut(a.target, $.target) && v($, $.pointerType);
510
- }, {
511
- capture: !0
512
- }), e && e({
513
- type: "hoverstart",
514
- target: m,
515
- pointerType: p
516
- }), n && n(!0), s(!0);
517
- }, v = (d, p) => {
518
- let m = a.target;
519
- a.pointerType = "", a.target = null, !(p === "touch" || !a.isHovered || !m) && (a.isHovered = !1, u(), i && i({
520
- type: "hoverend",
521
- target: m,
522
- pointerType: p
523
- }), n && n(!1), s(!1));
524
- }, l = {};
525
- return typeof PointerEvent < "u" ? (l.onPointerEnter = (d) => {
526
- S && d.pointerType === "mouse" || b(d, d.pointerType);
527
- }, l.onPointerLeave = (d) => {
528
- !o && d.currentTarget.contains(d.target) && v(d, d.pointerType);
529
- }) : process.env.NODE_ENV === "test" && (l.onTouchStart = () => {
530
- a.ignoreEmulatedMouseEvents = !0;
531
- }, l.onMouseEnter = (d) => {
532
- !a.ignoreEmulatedMouseEvents && !S && b(d, "mouse"), a.ignoreEmulatedMouseEvents = !1;
533
- }, l.onMouseLeave = (d) => {
534
- !o && d.currentTarget.contains(d.target) && v(d, "mouse");
535
- }), {
536
- hoverProps: l,
537
- triggerHoverEnd: v
538
- };
539
- }, [
540
- e,
541
- n,
542
- i,
543
- o,
544
- a,
545
- c,
546
- u
547
- ]);
548
- return y(() => {
549
- o && h({
550
- currentTarget: a.target
551
- }, a.pointerType);
552
- }, [
553
- o
554
- ]), {
555
- hoverProps: f,
556
- isHovered: r
557
- };
558
- }
559
- const De = 1, V = Symbol.for("react-aria-landmark-manager");
560
- function Et(t) {
561
- return document.addEventListener("react-aria-landmark-manager-change", t), () => document.removeEventListener("react-aria-landmark-manager-change", t);
562
- }
563
- function q() {
564
- if (typeof document > "u") return null;
565
- let t = document[V];
566
- return t && t.version >= De ? t : (document[V] = new wt(), document.dispatchEvent(new CustomEvent("react-aria-landmark-manager-change")), document[V]);
567
- }
568
- function yt() {
569
- return Q.useSyncExternalStore(Et, q, q);
570
- }
571
- class wt {
572
- setupIfNeeded() {
573
- this.isListening || (document.addEventListener("keydown", this.f6Handler, {
574
- capture: !0
575
- }), document.addEventListener("focusin", this.focusinHandler, {
576
- capture: !0
577
- }), document.addEventListener("focusout", this.focusoutHandler, {
578
- capture: !0
579
- }), this.isListening = !0);
580
- }
581
- teardownIfNeeded() {
582
- !this.isListening || this.landmarks.length > 0 || this.refCount > 0 || (document.removeEventListener("keydown", this.f6Handler, {
583
- capture: !0
584
- }), document.removeEventListener("focusin", this.focusinHandler, {
585
- capture: !0
586
- }), document.removeEventListener("focusout", this.focusoutHandler, {
587
- capture: !0
588
- }), this.isListening = !1);
589
- }
590
- focusLandmark(e, n) {
591
- var i, o;
592
- (o = this.landmarks.find((r) => r.ref.current === e)) === null || o === void 0 || (i = o.focus) === null || i === void 0 || i.call(o, n);
593
- }
594
- /**
595
- * Return set of landmarks with a specific role.
596
- */
597
- getLandmarksByRole(e) {
598
- return new Set(this.landmarks.filter((n) => n.role === e));
599
- }
600
- /**
601
- * Return first landmark with a specific role.
602
- */
603
- getLandmarkByRole(e) {
604
- return this.landmarks.find((n) => n.role === e);
605
- }
606
- addLandmark(e) {
607
- if (this.setupIfNeeded(), this.landmarks.find((o) => o.ref === e.ref) || !e.ref.current) return;
608
- if (this.landmarks.filter((o) => o.role === "main").length > 1 && process.env.NODE_ENV !== "production" && console.error('Page can contain no more than one landmark with the role "main".'), this.landmarks.length === 0) {
609
- this.landmarks = [
610
- e
611
- ], this.checkLabels(e.role);
612
- return;
613
- }
614
- let n = 0, i = this.landmarks.length - 1;
615
- for (; n <= i; ) {
616
- let o = Math.floor((n + i) / 2), r = e.ref.current.compareDocumentPosition(this.landmarks[o].ref.current);
617
- !!(r & Node.DOCUMENT_POSITION_PRECEDING || r & Node.DOCUMENT_POSITION_CONTAINS) ? n = o + 1 : i = o - 1;
618
- }
619
- this.landmarks.splice(n, 0, e), this.checkLabels(e.role);
620
- }
621
- updateLandmark(e) {
622
- let n = this.landmarks.findIndex((i) => i.ref === e.ref);
623
- n >= 0 && (this.landmarks[n] = {
624
- ...this.landmarks[n],
625
- ...e
626
- }, this.checkLabels(this.landmarks[n].role));
627
- }
628
- removeLandmark(e) {
629
- this.landmarks = this.landmarks.filter((n) => n.ref !== e), this.teardownIfNeeded();
630
- }
631
- /**
632
- * Warn if there are 2+ landmarks with the same role but no label.
633
- * Labels for landmarks with the same role must also be unique.
634
- *
635
- * See https://www.w3.org/WAI/ARIA/apg/practices/landmark-regions/.
636
- */
637
- checkLabels(e) {
638
- let n = this.getLandmarksByRole(e);
639
- if (n.size > 1) {
640
- let i = [
641
- ...n
642
- ].filter((o) => !o.label);
643
- if (i.length > 0 && process.env.NODE_ENV !== "production") console.warn(`Page contains more than one landmark with the '${e}' role. If two or more landmarks on a page share the same role, all must be labeled with an aria-label or aria-labelledby attribute: `, i.map((o) => o.ref.current));
644
- else if (process.env.NODE_ENV !== "production") {
645
- let o = [
646
- ...n
647
- ].map((s) => s.label);
648
- o.filter((s, a) => o.indexOf(s) !== a).forEach((s) => {
649
- console.warn(`Page contains more than one landmark with the '${e}' role and '${s}' label. If two or more landmarks on a page share the same role, they must have unique labels: `, [
650
- ...n
651
- ].filter((a) => a.label === s).map((a) => a.ref.current));
652
- });
653
- }
654
- }
655
- }
656
- /**
657
- * Get the landmark that is the closest parent in the DOM.
658
- * Returns undefined if no parent is a landmark.
659
- */
660
- closestLandmark(e) {
661
- let n = new Map(this.landmarks.map((o) => [
662
- o.ref.current,
663
- o
664
- ])), i = e;
665
- for (; i && !n.has(i) && i !== document.body && i.parentElement; ) i = i.parentElement;
666
- return n.get(i);
667
- }
668
- /**
669
- * Gets the next landmark, in DOM focus order, or previous if backwards is specified.
670
- * If last landmark, next should be the first landmark.
671
- * If not inside a landmark, will return first landmark.
672
- * Returns undefined if there are no landmarks.
673
- */
674
- getNextLandmark(e, { backward: n }) {
675
- var i;
676
- let o = this.closestLandmark(e), r = n ? this.landmarks.length - 1 : 0;
677
- o && (r = this.landmarks.indexOf(o) + (n ? -1 : 1));
678
- let s = () => {
679
- if (r < 0) {
680
- if (!e.dispatchEvent(new CustomEvent("react-aria-landmark-navigation", {
681
- detail: {
682
- direction: "backward"
683
- },
684
- bubbles: !0,
685
- cancelable: !0
686
- }))) return !0;
687
- r = this.landmarks.length - 1;
688
- } else if (r >= this.landmarks.length) {
689
- if (!e.dispatchEvent(new CustomEvent("react-aria-landmark-navigation", {
690
- detail: {
691
- direction: "forward"
692
- },
693
- bubbles: !0,
694
- cancelable: !0
695
- }))) return !0;
696
- r = 0;
697
- }
698
- return r < 0 || r >= this.landmarks.length;
699
- };
700
- if (s()) return;
701
- let a = r;
702
- for (; !((i = this.landmarks[r].ref.current) === null || i === void 0) && i.closest("[aria-hidden=true]"); ) {
703
- if (r += n ? -1 : 1, s()) return;
704
- if (r === a) break;
705
- }
706
- return this.landmarks[r];
707
- }
708
- /**
709
- * Look at next landmark. If an element was previously focused inside, restore focus there.
710
- * If not, focus the landmark itself.
711
- * If no landmarks at all, or none with focusable elements, don't move focus.
712
- */
713
- f6Handler(e) {
714
- e.key === "F6" && (e.altKey ? this.focusMain() : this.navigate(e.target, e.shiftKey)) && (e.preventDefault(), e.stopPropagation());
715
- }
716
- focusMain() {
717
- let e = this.getLandmarkByRole("main");
718
- return e && e.ref.current && document.contains(e.ref.current) ? (this.focusLandmark(e.ref.current, "forward"), !0) : !1;
719
- }
720
- navigate(e, n) {
721
- let i = this.getNextLandmark(e, {
722
- backward: n
723
- });
724
- if (!i) return !1;
725
- if (i.lastFocused) {
726
- let o = i.lastFocused;
727
- if (document.body.contains(o))
728
- return o.focus(), !0;
729
- }
730
- return i.ref.current && document.contains(i.ref.current) ? (this.focusLandmark(i.ref.current, n ? "backward" : "forward"), !0) : !1;
731
- }
732
- /**
733
- * Sets lastFocused for a landmark, if focus is moved within that landmark.
734
- * Lets the last focused landmark know it was blurred if something else is focused.
735
- */
736
- focusinHandler(e) {
737
- let n = this.closestLandmark(e.target);
738
- n && n.ref.current !== e.target && this.updateLandmark({
739
- ref: n.ref,
740
- lastFocused: e.target
741
- });
742
- let i = e.relatedTarget;
743
- if (i) {
744
- let o = this.closestLandmark(i);
745
- o && o.ref.current === i && o.blur();
746
- }
747
- }
748
- /**
749
- * Track if the focus is lost to the body. If it is, do cleanup on the landmark that last had focus.
750
- */
751
- focusoutHandler(e) {
752
- let n = e.target, i = e.relatedTarget;
753
- if (!i || i === document) {
754
- let o = this.closestLandmark(n);
755
- o && o.ref.current === n && o.blur();
756
- }
757
- }
758
- createLandmarkController() {
759
- let e = this;
760
- return e.refCount++, e.setupIfNeeded(), {
761
- navigate(n, i) {
762
- let o = i?.from || document.activeElement;
763
- return e.navigate(o, n === "backward");
764
- },
765
- focusNext(n) {
766
- let i = n?.from || document.activeElement;
767
- return e.navigate(i, !1);
768
- },
769
- focusPrevious(n) {
770
- let i = n?.from || document.activeElement;
771
- return e.navigate(i, !0);
772
- },
773
- focusMain() {
774
- return e.focusMain();
775
- },
776
- dispose() {
777
- e && (e.refCount--, e.teardownIfNeeded(), e = null);
778
- }
779
- };
780
- }
781
- registerLandmark(e) {
782
- return this.landmarks.find((n) => n.ref === e.ref) ? this.updateLandmark(e) : this.addLandmark(e), () => this.removeLandmark(e.ref);
783
- }
784
- constructor() {
785
- this.landmarks = [], this.isListening = !1, this.refCount = 0, this.version = De, this.f6Handler = this.f6Handler.bind(this), this.focusinHandler = this.focusinHandler.bind(this), this.focusoutHandler = this.focusoutHandler.bind(this);
786
- }
787
- }
788
- function Lt(t, e) {
789
- const { role: n, "aria-label": i, "aria-labelledby": o, focus: r } = t;
790
- let s = yt(), a = i || o, [c, u] = I(!1), f = E(() => {
791
- u(!0);
792
- }, [
793
- u
794
- ]), h = E(() => {
795
- u(!1);
796
- }, [
797
- u
798
- ]);
799
- return ee(() => {
800
- if (s) return s.registerLandmark({
801
- ref: e,
802
- label: a,
803
- role: n,
804
- focus: r || f,
805
- blur: h
806
- });
807
- }, [
808
- s,
809
- a,
810
- e,
811
- n,
812
- r,
813
- f,
814
- h
815
- ]), y(() => {
816
- var b;
817
- c && ((b = e.current) === null || b === void 0 || b.focus());
818
- }, [
819
- c,
820
- e
821
- ]), {
822
- landmarkProps: {
823
- role: n,
824
- tabIndex: c ? -1 : void 0,
825
- "aria-label": i,
826
- "aria-labelledby": o
827
- }
828
- };
829
- }
830
- function Tt(t) {
831
- return t && t.__esModule ? t.default : t;
832
- }
833
- function St(t, e, n) {
834
- let i = J(Tt(G), "@react-aria/toast"), { landmarkProps: o } = Lt({
835
- role: "region",
836
- "aria-label": t["aria-label"] || i.format("notifications", {
837
- count: e.visibleToasts.length
838
- })
839
- }, n), r = g(!1), s = g(!1), a = lt(() => {
840
- r.current || s.current ? e.pauseAll() : e.resumeAll();
841
- }), { hoverProps: c } = kt({
842
- onHoverStart: () => {
843
- r.current = !0, a();
844
- },
845
- onHoverEnd: () => {
846
- r.current = !1, a();
847
- }
848
- }), u = g([]), f = g(e.visibleToasts), h = g(null);
849
- ee(() => {
850
- if (h.current === -1 || e.visibleToasts.length === 0 || !n.current) {
851
- u.current = [], f.current = e.visibleToasts;
852
- return;
853
- }
854
- if (u.current = [
855
- ...n.current.querySelectorAll('[role="alertdialog"]')
856
- ], f.current.length === e.visibleToasts.length && e.visibleToasts.every((m, $) => m.key === f.current[$].key)) {
857
- f.current = e.visibleToasts;
858
- return;
859
- }
860
- let l = f.current.map((m, $) => ({
861
- ...m,
862
- i: $,
863
- isRemoved: !e.visibleToasts.some((k) => m.key === k.key)
864
- })), d = l.findIndex((m) => m.i === h.current && m.isRemoved);
865
- if (d > -1) {
866
- var p;
867
- if (F() === "pointer" && (!((p = b.current) === null || p === void 0) && p.isConnected)) w(b.current);
868
- else {
869
- let m = 0, $, k;
870
- for (; m <= d; )
871
- l[m].isRemoved || (k = Math.max(0, m - 1)), m++;
872
- for (; m < l.length; ) {
873
- if (!l[m].isRemoved) {
874
- $ = m - 1;
875
- break;
876
- }
877
- m++;
878
- }
879
- k === void 0 && $ === void 0 && (k = 0), k >= 0 && k < u.current.length ? w(u.current[k]) : $ >= 0 && $ < u.current.length && w(u.current[$]);
880
- }
881
- }
882
- f.current = e.visibleToasts;
883
- }, [
884
- e.visibleToasts,
885
- n,
886
- a
887
- ]);
888
- let b = g(null), { focusWithinProps: v } = ct({
889
- onFocusWithin: (l) => {
890
- s.current = !0, b.current = l.relatedTarget, a();
891
- },
892
- onBlurWithin: () => {
893
- s.current = !1, b.current = null, a();
894
- }
895
- });
896
- return y(() => {
897
- var l;
898
- e.visibleToasts.length === 0 && (!((l = b.current) === null || l === void 0) && l.isConnected) && (F() === "pointer" ? w(b.current) : b.current.focus(), b.current = null);
899
- }, [
900
- n,
901
- e.visibleToasts.length
902
- ]), y(() => () => {
903
- var l;
904
- !((l = b.current) === null || l === void 0) && l.isConnected && (F() === "pointer" ? w(b.current) : b.current.focus(), b.current = null);
905
- }, [
906
- n
907
- ]), {
908
- regionProps: dt(o, c, v, {
909
- tabIndex: -1,
910
- // Mark the toast region as a "top layer", so that it:
911
- // - is not aria-hidden when opening an overlay
912
- // - allows focus even outside a containing focus scope
913
- // - doesn’t dismiss overlays when clicking on it, even though it is outside
914
- // @ts-ignore
915
- "data-react-aria-top-layer": !0,
916
- // listen to focus events separate from focuswithin because that will only fire once
917
- // and we need to follow all focus changes
918
- onFocus: (l) => {
919
- let d = l.target.closest('[role="alertdialog"]');
920
- h.current = u.current.findIndex((p) => p === d);
921
- },
922
- onBlur: () => {
923
- h.current = -1;
924
- }
925
- })
926
- };
927
- }
928
- const It = [
1
+ import { jsx as g, jsxs as et } from "react/jsx-runtime";
2
+ import { useToastQueue as nt, ToastQueue as it } from "@react-stately/toast";
3
+ import { createContext as at, useContext as ot, useState as st, useRef as w, useEffect as z, useCallback as S, Children as rt, isValidElement as ct, cloneElement as D, useSyncExternalStore as lt } from "react";
4
+ import { createPortal as dt } from "react-dom";
5
+ import { useToast as mt, useToastRegion as ut } from "@react-aria/toast";
6
+ import { cva as B, cx as V } from "class-variance-authority";
7
+ import { B as pt } from "../Button-C3C0aixy.mjs";
8
+ import { Close as gt } from "@spark-ui/icons/Close";
9
+ import { I as F } from "../Icon-Ck-dhfLd.mjs";
10
+ import { I as bt } from "../IconButton-C62-axzv.mjs";
11
+ const ft = [
929
12
  {
930
13
  design: "filled",
931
14
  intent: "success",
@@ -976,7 +59,7 @@ const It = [
976
59
  intent: "inverse",
977
60
  class: ["bg-surface-inverse text-on-surface-inverse"]
978
61
  }
979
- ], At = [
62
+ ], xt = [
980
63
  {
981
64
  design: "tinted",
982
65
  intent: "success",
@@ -1027,7 +110,7 @@ const It = [
1027
110
  intent: "inverse",
1028
111
  class: ["bg-surface-inverse text-on-surface-inverse"]
1029
112
  }
1030
- ], Ct = j(
113
+ ], yt = B(
1031
114
  [
1032
115
  "rounded-md shadow-sm",
1033
116
  "max-w-[600px]",
@@ -1101,13 +184,13 @@ const It = [
1101
184
  inverse: ""
1102
185
  }
1103
186
  },
1104
- compoundVariants: [...It, ...At],
187
+ compoundVariants: [...ft, ...xt],
1105
188
  defaultVariants: {
1106
189
  design: "filled",
1107
190
  intent: "neutral"
1108
191
  }
1109
192
  }
1110
- ), Nt = j(
193
+ ), wt = B(
1111
194
  [
1112
195
  "inline-grid items-center",
1113
196
  "col-start-1 row-start-1",
@@ -1136,217 +219,218 @@ const It = [
1136
219
  actionOnNewline: !1
1137
220
  }
1138
221
  }
1139
- ), Fe = Ye({}), K = () => Qe(Fe), A = ({
222
+ ), Q = at({}), O = () => ot(Q), h = ({
1140
223
  design: t = "filled",
1141
224
  intent: e = "neutral",
1142
225
  onClick: n,
1143
- children: i,
1144
- className: o,
1145
- ref: r,
1146
- ...s
226
+ children: r,
227
+ className: c,
228
+ ref: d,
229
+ ...m
1147
230
  }) => {
1148
- const { toast: a, state: c } = K(), u = e ?? a.content.intent, f = t ?? a.content.design;
1149
- return /* @__PURE__ */ x(
1150
- mt,
231
+ const { toast: i, state: o } = O(), a = e ?? i.content.intent, b = t ?? i.content.design;
232
+ return /* @__PURE__ */ g(
233
+ pt,
1151
234
  {
1152
235
  "data-spark-component": "snackbar-item-action",
1153
- ref: r,
236
+ ref: d,
1154
237
  size: "md",
1155
238
  shape: "rounded",
1156
- ...u === "inverse" ? {
239
+ ...a === "inverse" ? {
1157
240
  design: "ghost",
1158
241
  intent: "surface"
1159
242
  } : {
1160
- design: f,
1161
- intent: u === "error" ? "danger" : u
243
+ design: b,
244
+ intent: a === "error" ? "danger" : a
1162
245
  },
1163
- onClick: (h) => {
1164
- n?.(h), c.close(a.key);
246
+ onClick: (x) => {
247
+ n?.(x), o.close(i.key);
1165
248
  },
1166
- style: { gridArea: "action", ...s.style },
1167
- className: z("ml-md justify-self-end", o),
1168
- ...s,
1169
- children: i
249
+ style: { gridArea: "action", ...m.style },
250
+ className: V("ml-md justify-self-end", c),
251
+ ...m,
252
+ children: r
1170
253
  }
1171
254
  );
1172
255
  };
1173
- A.displayName = "Snackbar.ItemAction";
1174
- const C = ({
256
+ h.displayName = "Snackbar.ItemAction";
257
+ const I = ({
1175
258
  design: t = "filled",
1176
259
  intent: e = "neutral",
1177
260
  "aria-label": n,
1178
- onClick: i,
1179
- className: o,
1180
- ref: r,
1181
- ...s
261
+ onClick: r,
262
+ className: c,
263
+ ref: d,
264
+ ...m
1182
265
  }) => {
1183
- const { toast: a, state: c } = K(), u = e ?? a.content.intent, f = t ?? a.content.design;
1184
- return /* @__PURE__ */ x(
266
+ const { toast: i, state: o } = O(), a = e ?? i.content.intent, b = t ?? i.content.design;
267
+ return /* @__PURE__ */ g(
1185
268
  bt,
1186
269
  {
1187
270
  "data-spark-component": "snackbar-item-close",
1188
- ref: r,
271
+ ref: d,
1189
272
  size: "md",
1190
273
  shape: "rounded",
1191
- ...u === "inverse" ? {
274
+ ...a === "inverse" ? {
1192
275
  design: "ghost",
1193
276
  intent: "surface"
1194
277
  } : {
1195
- design: f,
1196
- intent: u === "error" ? "danger" : u
278
+ design: b,
279
+ intent: a === "error" ? "danger" : a
1197
280
  },
1198
281
  "aria-label": n,
1199
- onClick: (h) => {
1200
- i?.(h), c.close(a.key);
282
+ onClick: (x) => {
283
+ r?.(x), o.close(i.key);
1201
284
  },
1202
- style: { gridArea: "close", ...s.style },
1203
- className: z("ml-md justify-self-end", o),
1204
- ...s,
1205
- children: /* @__PURE__ */ x(te, { size: "sm", children: /* @__PURE__ */ x(ft, {}) })
285
+ style: { gridArea: "close", ...m.style },
286
+ className: V("ml-md justify-self-end", c),
287
+ ...m,
288
+ children: /* @__PURE__ */ g(F, { size: "sm", children: /* @__PURE__ */ g(gt, {}) })
1206
289
  }
1207
290
  );
1208
291
  };
1209
- C.displayName = "Snackbar.ItemClose";
292
+ I.displayName = "Snackbar.ItemClose";
1210
293
  const N = ({
1211
294
  children: t,
1212
295
  className: e,
1213
296
  ...n
1214
- }) => /* @__PURE__ */ x(
1215
- te,
297
+ }) => /* @__PURE__ */ g(
298
+ F,
1216
299
  {
1217
300
  size: "md",
1218
- className: z("mx-md", e),
301
+ className: V("mx-md", e),
1219
302
  style: { gridArea: "icon", ...n.style },
1220
303
  ...n,
1221
304
  children: t
1222
305
  }
1223
306
  );
1224
307
  N.displayName = "Snackbar.ItemIcon";
1225
- const X = 75, Pt = ({
308
+ const Y = 75, St = ({
1226
309
  swipeRef: t,
1227
310
  onSwipeStart: e,
1228
311
  onSwipeMove: n,
1229
- onSwipeCancel: i,
1230
- onSwipeEnd: o,
1231
- threshold: r = 10
312
+ onSwipeCancel: r,
313
+ onSwipeEnd: c,
314
+ threshold: d = 10
1232
315
  }) => {
1233
- const [s, a] = I(), c = g(null), u = g(null), f = g(null), h = (l) => {
1234
- u.current = { x: l.clientX, y: l.clientY }, document.addEventListener("selectstart", (d) => d.preventDefault());
1235
- }, b = (l) => {
1236
- if (!u.current) return;
1237
- const d = Math.abs(l.clientX - u.current.x), p = Math.abs(l.clientY - u.current.y);
1238
- let m;
1239
- d > p && d > r ? c.current = l.clientX > u.current.x ? "right" : "left" : p > r && (c.current = l.clientY > u.current.y ? "down" : "up"), c.current && (f.current ? (m = "move", f.current = { x: d, y: p }, t.current.style.setProperty(
316
+ const [m, i] = st(), o = w(null), a = w(null), b = w(null), x = (s) => {
317
+ a.current = { x: s.clientX, y: s.clientY }, document.addEventListener("selectstart", (u) => u.preventDefault());
318
+ }, y = (s) => {
319
+ if (!a.current) return;
320
+ const u = Math.abs(s.clientX - a.current.x), f = Math.abs(s.clientY - a.current.y);
321
+ let l;
322
+ u > f && u > d ? o.current = s.clientX > a.current.x ? "right" : "left" : f > d && (o.current = s.clientY > a.current.y ? "down" : "up"), o.current && (b.current ? (l = "move", b.current = { x: u, y: f }, t.current.style.setProperty(
1240
323
  "--swipe-position-x",
1241
- `${d > p ? l.clientX - u.current.x : 0}px`
324
+ `${u > f ? s.clientX - a.current.x : 0}px`
1242
325
  ), t.current.style.setProperty(
1243
326
  "--swipe-position-y",
1244
- `${d > p ? 0 : l.clientY - u.current.y}px`
1245
- ), n?.({ state: m, direction: c.current })) : (m = "start", f.current = { x: d, y: p }, e?.({ state: m, direction: c.current })), a(m));
1246
- }, v = () => {
1247
- const l = f.current;
1248
- if (u.current = null, f.current = null, l) {
1249
- const { x: d, y: p } = l;
1250
- let m;
1251
- d > p ? d > X ? (m = "end", o?.({ state: m, direction: c.current })) : (m = "cancel", i?.({ state: m, direction: c.current })) : p > X ? (m = "end", o?.({ state: m, direction: c.current })) : (m = "cancel", i?.({ state: m, direction: c.current })), a(m), document.removeEventListener("selectstart", ($) => $.preventDefault());
327
+ `${u > f ? 0 : s.clientY - a.current.y}px`
328
+ ), n?.({ state: l, direction: o.current })) : (l = "start", b.current = { x: u, y: f }, e?.({ state: l, direction: o.current })), i(l));
329
+ }, p = () => {
330
+ const s = b.current;
331
+ if (a.current = null, b.current = null, s) {
332
+ const { x: u, y: f } = s;
333
+ let l;
334
+ u > f ? u > Y ? (l = "end", c?.({ state: l, direction: o.current })) : (l = "cancel", r?.({ state: l, direction: o.current })) : f > Y ? (l = "end", c?.({ state: l, direction: o.current })) : (l = "cancel", r?.({ state: l, direction: o.current })), i(l), document.removeEventListener("selectstart", (v) => v.preventDefault());
1252
335
  }
1253
336
  };
1254
- return y(() => {
337
+ return z(() => {
1255
338
  if (!t.current) return;
1256
- const l = t.current;
1257
- return l.addEventListener("pointerdown", h), document.addEventListener("pointermove", b), document.addEventListener("pointerup", v), () => {
1258
- l.removeEventListener("pointerdown", h), document.removeEventListener("pointermove", b), document.removeEventListener("pointerup", v);
339
+ const s = t.current;
340
+ return s.addEventListener("pointerdown", x), document.addEventListener("pointermove", y), document.addEventListener("pointerup", p), () => {
341
+ s.removeEventListener("pointerdown", x), document.removeEventListener("pointermove", y), document.removeEventListener("pointerup", p);
1259
342
  };
1260
343
  }, []), {
1261
- state: s,
1262
- direction: c.current
344
+ state: m,
345
+ direction: o.current
1263
346
  };
1264
- }, P = ({
347
+ }, A = ({
1265
348
  "aria-label": t,
1266
349
  "aria-labelledby": e,
1267
350
  "aria-describedby": n,
1268
- "aria-details": i,
1269
- design: o,
1270
- intent: r,
1271
- actionOnNewline: s,
1272
- className: a,
1273
- children: c,
1274
- ref: u,
1275
- ...f
351
+ "aria-details": r,
352
+ design: c,
353
+ intent: d,
354
+ actionOnNewline: m,
355
+ className: i,
356
+ children: o,
357
+ ref: a,
358
+ ...b
1276
359
  }) => {
1277
- const h = g(null), b = typeof u != "function" && u || h, { toast: v, state: l } = K(), { state: d, direction: p } = Pt({
1278
- swipeRef: b,
1279
- onSwipeStart: l.pauseAll,
1280
- onSwipeCancel: l.resumeAll,
1281
- onSwipeEnd: ({ direction: D }) => {
1282
- ["left", "right"].includes(`${D}`) && l.close(v.key);
360
+ const x = w(null), y = typeof a != "function" && a || x, { toast: p, state: s } = O(), { state: u, direction: f } = St({
361
+ swipeRef: y,
362
+ onSwipeStart: s.pauseAll,
363
+ onSwipeCancel: s.resumeAll,
364
+ onSwipeEnd: ({ direction: P }) => {
365
+ ["left", "right"].includes(`${P}`) && s.close(p.key);
1283
366
  }
1284
- }), { message: m, icon: $, isClosable: k, onAction: U, actionLabel: W } = v.content, B = r ?? v.content.intent, _ = o ?? v.content.design, Me = s ?? v.content.actionOnNewline, Oe = {
367
+ }), { message: l, icon: v, isClosable: G, onAction: T, actionLabel: X } = p.content, C = d ?? p.content.intent, _ = c ?? p.content.design, M = m ?? p.content.actionOnNewline, $ = {
1285
368
  ariaLabel: t,
1286
369
  ariaLabelledby: e,
1287
370
  ariaDescribedby: n,
1288
- ariaDetails: i
1289
- }, { toastProps: Re, titleProps: je, closeButtonProps: ze, contentProps: Ge } = gt(
1290
- { toast: v, ...Oe },
1291
- l
1292
- ), H = E(
1293
- (D) => Je.toArray(c).filter(et).find(
1294
- (Ze) => !!Ze.type.displayName?.includes(
1295
- D
371
+ ariaDetails: r
372
+ }, { toastProps: q, titleProps: H, closeButtonProps: K, contentProps: U } = mt(
373
+ { toast: p, ...$ },
374
+ s,
375
+ y
376
+ ), E = S(
377
+ (P) => rt.toArray(o).filter(ct).find(
378
+ (tt) => !!tt.type.displayName?.includes(
379
+ P
1296
380
  )
1297
381
  ),
1298
- [c]
1299
- ), Ke = H("Snackbar.ItemIcon"), Ue = H("Snackbar.ItemAction"), We = H("Snackbar.ItemClose");
1300
- return /* @__PURE__ */ x(
382
+ [o]
383
+ ), W = E("Snackbar.ItemIcon"), J = E("Snackbar.ItemAction"), Z = E("Snackbar.ItemClose");
384
+ return /* @__PURE__ */ g(
1301
385
  "div",
1302
386
  {
1303
387
  "data-spark-component": "snackbar-item",
1304
- className: Ct({ design: _, intent: B, className: a }),
1305
- "data-animation": v.animation,
1306
- ...!(d === "cancel" && v.animation === "exiting") && {
1307
- "data-swipe": d,
1308
- "data-swipe-direction": p
388
+ className: yt({ design: _, intent: C, className: i }),
389
+ "data-animation": p.animation,
390
+ ...!(u === "cancel" && p.animation === "exiting") && {
391
+ "data-swipe": u,
392
+ "data-swipe-direction": f
1309
393
  },
1310
- ...v.animation === "exiting" && {
394
+ ...p.animation === "exiting" && {
1311
395
  // Remove snackbar when the exiting animation completes
1312
- onAnimationEnd: () => l.remove(v.key)
396
+ onAnimationEnd: () => s.remove(p.key)
1313
397
  },
1314
- ref: b,
1315
- ...Re,
1316
- ...f,
1317
- children: /* @__PURE__ */ qe("div", { className: Nt({ actionOnNewline: Me }), ...Ge, children: [
1318
- M(Ke, $ ? N : null, {
1319
- children: $
398
+ ref: y,
399
+ ...q,
400
+ ...b,
401
+ children: /* @__PURE__ */ et("div", { className: wt({ actionOnNewline: M }), ...U, children: [
402
+ L(W, v ? N : null, {
403
+ children: v
1320
404
  }),
1321
- /* @__PURE__ */ x(
405
+ /* @__PURE__ */ g(
1322
406
  "p",
1323
407
  {
1324
408
  className: "px-md py-lg text-body-2 row-span-3",
1325
409
  style: { gridArea: "message" },
1326
- ...je,
1327
- children: m
410
+ ...H,
411
+ children: l
1328
412
  }
1329
413
  ),
1330
- M(
1331
- Ue,
1332
- W && U ? A : null,
1333
- { intent: B, design: _, onClick: U, children: W }
414
+ L(
415
+ J,
416
+ X && T ? h : null,
417
+ { intent: C, design: _, onClick: T, children: X }
1334
418
  ),
1335
- M(We, k ? C : null, {
1336
- intent: B,
419
+ L(Z, G ? I : null, {
420
+ intent: C,
1337
421
  design: _,
1338
422
  /**
1339
423
  * React Spectrum typing of aria-label is inaccurate, and aria-label value should never be undefined.
1340
424
  * See https://github.com/adobe/react-spectrum/blob/main/packages/%40react-aria/i18n/src/useLocalizedStringFormatter.ts#L40
1341
425
  */
1342
- "aria-label": ze["aria-label"]
426
+ "aria-label": K["aria-label"]
1343
427
  })
1344
428
  ] })
1345
429
  }
1346
430
  );
1347
431
  };
1348
- P.displayName = "Snackbar.Item";
1349
- const M = (t, e, n) => t ? Y(t, { ...n, ...t.props }) : e ? /* @__PURE__ */ x(e, { ...n }) : null, Bt = j(
432
+ A.displayName = "Snackbar.Item";
433
+ const L = (t, e, n) => t ? D(t, { ...n, ...t.props }) : e ? /* @__PURE__ */ g(e, { ...n }) : null, vt = B(
1350
434
  [
1351
435
  "fixed inset-x-lg z-toast group",
1352
436
  "outline-hidden pointer-events-none",
@@ -1371,91 +455,91 @@ const M = (t, e, n) => t ? Y(t, { ...n, ...t.props }) : e ? /* @__PURE__ */ x(e,
1371
455
  position: "bottom"
1372
456
  }
1373
457
  }
1374
- ), _t = ({
1375
- children: t = /* @__PURE__ */ x(P, {}),
458
+ ), kt = ({
459
+ children: t = /* @__PURE__ */ g(A, {}),
1376
460
  state: e,
1377
461
  position: n = "bottom",
1378
- className: i,
1379
- ref: o,
1380
- ...r
462
+ className: r,
463
+ ref: c,
464
+ ...d
1381
465
  }) => {
1382
- const s = g(null), a = o && typeof o != "function" ? o : s, { regionProps: c } = St(r, e, a);
1383
- return /* @__PURE__ */ x(
466
+ const m = w(null), i = c && typeof c != "function" ? c : m, { regionProps: o } = ut(d, e, i);
467
+ return /* @__PURE__ */ g(
1384
468
  "div",
1385
469
  {
1386
- ...c,
1387
- ref: a,
470
+ ...o,
471
+ ref: i,
1388
472
  "data-position": n,
1389
- className: Bt({ position: n, className: i }),
1390
- children: e.visibleToasts.map((u) => /* @__PURE__ */ x(Fe.Provider, { value: { toast: u, state: e }, children: Y(t, { key: u.key }) }, u.key))
473
+ className: vt({ position: n, className: r }),
474
+ children: e.visibleToasts.map((a) => /* @__PURE__ */ g(Q.Provider, { value: { toast: a, state: e }, children: D(t, { key: a.key }) }, a.key))
1391
475
  }
1392
476
  );
1393
- }, Ht = ({
477
+ }, ht = ({
1394
478
  providers: t,
1395
479
  subscriptions: e
1396
480
  }) => {
1397
- const n = E(
1398
- (a) => (e.add(a), () => e.delete(a)),
481
+ const n = S(
482
+ (i) => (e.add(i), () => e.delete(i)),
1399
483
  [e]
1400
- ), i = E(() => [...t].reverse()[0], [t]), o = E(
1401
- (a) => {
1402
- t.add(a);
1403
- for (const c of e)
1404
- c();
484
+ ), r = S(() => [...t].reverse()[0], [t]), c = S(
485
+ (i) => {
486
+ t.add(i);
487
+ for (const o of e)
488
+ o();
1405
489
  },
1406
490
  [t, e]
1407
- ), r = E(
1408
- (a) => {
1409
- t.delete(a);
1410
- for (const c of e)
1411
- c();
491
+ ), d = S(
492
+ (i) => {
493
+ t.delete(i);
494
+ for (const o of e)
495
+ o();
1412
496
  },
1413
497
  [t, e]
1414
498
  );
1415
499
  return {
1416
- provider: tt(n, i, i),
1417
- addProvider: o,
1418
- deleteProvider: r
500
+ provider: lt(n, r, r),
501
+ addProvider: c,
502
+ deleteProvider: d
1419
503
  };
1420
504
  };
1421
- let T = null;
1422
- const R = () => (T || (T = new ht({
505
+ let k = null;
506
+ const j = () => (k || (k = new it({
1423
507
  maxVisibleToasts: 1,
1424
508
  hasExitAnimation: !0
1425
- })), T), Xt = () => {
1426
- T = null;
1427
- }, Dt = {
509
+ })), k), Yt = () => {
510
+ k = null;
511
+ }, It = {
1428
512
  providers: /* @__PURE__ */ new Set(),
1429
513
  subscriptions: /* @__PURE__ */ new Set()
1430
- }, Ve = ({ ref: t, ...e }) => {
1431
- const n = g(null), i = pt(R()), { provider: o, addProvider: r, deleteProvider: s } = Ht(Dt);
1432
- return y(() => (r(n), () => {
1433
- for (const a of R().visibleToasts)
1434
- a.animation = void 0;
1435
- s(n);
1436
- }), []), n === o && i.visibleToasts.length > 0 ? nt(/* @__PURE__ */ x(_t, { ref: t, state: i, ...e }), document.body) : null;
1437
- };
1438
- Ve.displayName = "Snackbar";
1439
- const Yt = ({ onClose: t, timeout: e = 5e3, priority: n, ...i }) => {
1440
- R().add(i, {
514
+ }, R = ({ ref: t, ...e }) => {
515
+ const n = w(null), r = nt(j()), { provider: c, addProvider: d, deleteProvider: m } = ht(It);
516
+ return z(() => (d(n), () => {
517
+ for (const i of j().visibleToasts)
518
+ i.animation = void 0;
519
+ m(n);
520
+ }), []), n === c && r.visibleToasts.length > 0 ? dt(/* @__PURE__ */ g(kt, { ref: t, state: r, ...e }), document.body) : null;
521
+ };
522
+ R.displayName = "Snackbar";
523
+ const zt = ({ onClose: t, timeout: e = 5e3, priority: n, ...r }) => {
524
+ j().add(r, {
1441
525
  onClose: t,
1442
- timeout: e && !i.onAction ? Math.max(e, 5e3) : void 0,
526
+ timeout: e && !r.onAction ? Math.max(e, 5e3) : void 0,
1443
527
  priority: n
1444
528
  });
1445
- }, Ft = Object.assign(Ve, {
1446
- Item: P,
1447
- ItemAction: A,
1448
- ItemClose: C,
529
+ }, Nt = Object.assign(R, {
530
+ Item: A,
531
+ ItemAction: h,
532
+ ItemClose: I,
1449
533
  ItemIcon: N
1450
534
  });
1451
- Ft.displayName = "Snackbar";
1452
- P.displayName = "Snackbar.Item";
1453
- A.displayName = "Snackbar.ItemAction";
1454
- C.displayName = "Snackbar.ItemClose";
535
+ Nt.displayName = "Snackbar";
536
+ A.displayName = "Snackbar.Item";
537
+ h.displayName = "Snackbar.ItemAction";
538
+ I.displayName = "Snackbar.ItemClose";
1455
539
  N.displayName = "Snackbar.ItemIcon";
1456
540
  export {
1457
- Ft as Snackbar,
1458
- Yt as addSnackbar,
1459
- Xt as clearSnackbarQueue
541
+ Nt as Snackbar,
542
+ zt as addSnackbar,
543
+ Yt as clearSnackbarQueue
1460
544
  };
1461
545
  //# sourceMappingURL=index.mjs.map