@zentauri-ui/zentauri-components 1.2.1 → 1.3.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 (324) hide show
  1. package/README.md +66 -38
  2. package/dist/accordion-base-qVomr7f_.d.mts +66 -0
  3. package/dist/accordion-base-qVomr7f_.d.ts +66 -0
  4. package/dist/avatar-base-s4dYg-24.d.mts +49 -0
  5. package/dist/avatar-base-s4dYg-24.d.ts +49 -0
  6. package/dist/card-base-CIGac8D_.d.mts +70 -0
  7. package/dist/card-base-CIGac8D_.d.ts +70 -0
  8. package/dist/chunk-2P3UU2J3.mjs +510 -0
  9. package/dist/chunk-2P3UU2J3.mjs.map +1 -0
  10. package/dist/chunk-2PQEXQVR.js +223 -0
  11. package/dist/chunk-2PQEXQVR.js.map +1 -0
  12. package/dist/chunk-3OR47XMY.js +273 -0
  13. package/dist/chunk-3OR47XMY.js.map +1 -0
  14. package/dist/chunk-4B7KGBQB.js +206 -0
  15. package/dist/chunk-4B7KGBQB.js.map +1 -0
  16. package/dist/chunk-5QB2KNZQ.js +148 -0
  17. package/dist/chunk-5QB2KNZQ.js.map +1 -0
  18. package/dist/chunk-6I7X5BF2.js +520 -0
  19. package/dist/chunk-6I7X5BF2.js.map +1 -0
  20. package/dist/chunk-7HL3A4YF.mjs +214 -0
  21. package/dist/chunk-7HL3A4YF.mjs.map +1 -0
  22. package/dist/chunk-AOEI4V3W.mjs +286 -0
  23. package/dist/chunk-AOEI4V3W.mjs.map +1 -0
  24. package/dist/chunk-BVXTOEBI.mjs +259 -0
  25. package/dist/chunk-BVXTOEBI.mjs.map +1 -0
  26. package/dist/chunk-C2FCPQTO.js +279 -0
  27. package/dist/chunk-C2FCPQTO.js.map +1 -0
  28. package/dist/chunk-E3DZNJAD.js +128 -0
  29. package/dist/chunk-E3DZNJAD.js.map +1 -0
  30. package/dist/chunk-FLILFCQE.mjs +197 -0
  31. package/dist/chunk-FLILFCQE.mjs.map +1 -0
  32. package/dist/chunk-IXDJ3IPG.mjs +315 -0
  33. package/dist/chunk-IXDJ3IPG.mjs.map +1 -0
  34. package/dist/chunk-JQ5TIJ4F.mjs +68 -0
  35. package/dist/chunk-JQ5TIJ4F.mjs.map +1 -0
  36. package/dist/chunk-LVUPECBT.mjs +217 -0
  37. package/dist/chunk-LVUPECBT.mjs.map +1 -0
  38. package/dist/chunk-N4NO3SYL.js +328 -0
  39. package/dist/chunk-N4NO3SYL.js.map +1 -0
  40. package/dist/chunk-OJ67PZ6N.js +175 -0
  41. package/dist/chunk-OJ67PZ6N.js.map +1 -0
  42. package/dist/chunk-P5HUBXUX.js +231 -0
  43. package/dist/chunk-P5HUBXUX.js.map +1 -0
  44. package/dist/chunk-PCK6LX3K.js +253 -0
  45. package/dist/chunk-PCK6LX3K.js.map +1 -0
  46. package/dist/chunk-PGH27VTL.mjs +316 -0
  47. package/dist/chunk-PGH27VTL.mjs.map +1 -0
  48. package/dist/chunk-QZKMFSH5.js +288 -0
  49. package/dist/chunk-QZKMFSH5.js.map +1 -0
  50. package/dist/chunk-RDSPHBHK.mjs +221 -0
  51. package/dist/chunk-RDSPHBHK.mjs.map +1 -0
  52. package/dist/{chunk-P6YRSEOY.js → chunk-U4YQCAXW.js} +2 -23
  53. package/dist/chunk-U4YQCAXW.js.map +1 -0
  54. package/dist/chunk-UBFKTC2P.mjs +268 -0
  55. package/dist/chunk-UBFKTC2P.mjs.map +1 -0
  56. package/dist/chunk-UOFTZKMM.js +229 -0
  57. package/dist/chunk-UOFTZKMM.js.map +1 -0
  58. package/dist/chunk-UXGHUBNJ.mjs +240 -0
  59. package/dist/chunk-UXGHUBNJ.mjs.map +1 -0
  60. package/dist/chunk-W6PRMYUC.mjs +169 -0
  61. package/dist/chunk-W6PRMYUC.mjs.map +1 -0
  62. package/dist/chunk-WDCIZHXY.mjs +139 -0
  63. package/dist/chunk-WDCIZHXY.mjs.map +1 -0
  64. package/dist/chunk-WZKGRU3U.js +182 -0
  65. package/dist/chunk-WZKGRU3U.js.map +1 -0
  66. package/dist/chunk-X22LLJL6.js +71 -0
  67. package/dist/chunk-X22LLJL6.js.map +1 -0
  68. package/dist/{chunk-UJ3AER3U.mjs → chunk-XIXF7UVM.mjs} +3 -23
  69. package/dist/chunk-XIXF7UVM.mjs.map +1 -0
  70. package/dist/chunk-XLAFQ24R.js +328 -0
  71. package/dist/chunk-XLAFQ24R.js.map +1 -0
  72. package/dist/chunk-XWM2S6VV.mjs +124 -0
  73. package/dist/chunk-XWM2S6VV.mjs.map +1 -0
  74. package/dist/chunk-YNCD6TKE.mjs +175 -0
  75. package/dist/chunk-YNCD6TKE.mjs.map +1 -0
  76. package/dist/progress-base-Cm1JODYA.d.mts +66 -0
  77. package/dist/progress-base-Cm1JODYA.d.ts +66 -0
  78. package/dist/types-C7N9UvRm.d.mts +38 -0
  79. package/dist/types-C7N9UvRm.d.ts +38 -0
  80. package/dist/types-CFpwSbpK.d.mts +27 -0
  81. package/dist/types-CFpwSbpK.d.ts +27 -0
  82. package/dist/types-CK_vNRIb.d.mts +63 -0
  83. package/dist/types-CK_vNRIb.d.ts +63 -0
  84. package/dist/types-Ca3t5aC_.d.mts +31 -0
  85. package/dist/types-Ca3t5aC_.d.ts +31 -0
  86. package/dist/types-Cn7IcgkH.d.mts +32 -0
  87. package/dist/types-Cn7IcgkH.d.ts +32 -0
  88. package/dist/{types-BQ2H3yG7.d.mts → types-CtFK7mFE.d.mts} +1 -1
  89. package/dist/{types-BQ2H3yG7.d.ts → types-CtFK7mFE.d.ts} +1 -1
  90. package/dist/types-DMkTQsWg.d.mts +46 -0
  91. package/dist/types-DMkTQsWg.d.ts +46 -0
  92. package/dist/types-DN400jNg.d.mts +28 -0
  93. package/dist/types-DN400jNg.d.ts +28 -0
  94. package/dist/types-vcZcRc6w.d.mts +24 -0
  95. package/dist/types-vcZcRc6w.d.ts +24 -0
  96. package/dist/types-zHcMUtKK.d.mts +42 -0
  97. package/dist/types-zHcMUtKK.d.ts +42 -0
  98. package/dist/ui/accordion/animated.d.mts +24 -0
  99. package/dist/ui/accordion/animated.d.ts +24 -0
  100. package/dist/ui/accordion/animated.js +67 -0
  101. package/dist/ui/accordion/animated.js.map +1 -0
  102. package/dist/ui/accordion/animated.mjs +56 -0
  103. package/dist/ui/accordion/animated.mjs.map +1 -0
  104. package/dist/ui/accordion.d.mts +9 -65
  105. package/dist/ui/accordion.d.ts +9 -65
  106. package/dist/ui/accordion.js +32 -288
  107. package/dist/ui/accordion.js.map +1 -1
  108. package/dist/ui/accordion.mjs +6 -281
  109. package/dist/ui/accordion.mjs.map +1 -1
  110. package/dist/ui/alert/animated.d.mts +7 -2
  111. package/dist/ui/alert/animated.d.ts +7 -2
  112. package/dist/ui/alert/animated.js +23 -3
  113. package/dist/ui/alert/animated.js.map +1 -1
  114. package/dist/ui/alert/animated.mjs +21 -2
  115. package/dist/ui/alert/animated.mjs.map +1 -1
  116. package/dist/ui/alert.d.mts +3 -8
  117. package/dist/ui/alert.d.ts +3 -8
  118. package/dist/ui/alert.js +10 -14
  119. package/dist/ui/alert.mjs +2 -2
  120. package/dist/ui/avatar/animated.d.mts +22 -0
  121. package/dist/ui/avatar/animated.d.ts +22 -0
  122. package/dist/ui/avatar/animated.js +51 -0
  123. package/dist/ui/avatar/animated.js.map +1 -0
  124. package/dist/ui/avatar/animated.mjs +37 -0
  125. package/dist/ui/avatar/animated.mjs.map +1 -0
  126. package/dist/ui/avatar.d.mts +7 -53
  127. package/dist/ui/avatar.d.ts +7 -53
  128. package/dist/ui/avatar.js +32 -210
  129. package/dist/ui/avatar.js.map +1 -1
  130. package/dist/ui/avatar.mjs +7 -204
  131. package/dist/ui/avatar.mjs.map +1 -1
  132. package/dist/ui/badge/animated.d.mts +22 -0
  133. package/dist/ui/badge/animated.d.ts +22 -0
  134. package/dist/ui/badge/animated.js +50 -0
  135. package/dist/ui/badge/animated.js.map +1 -0
  136. package/dist/ui/badge/animated.mjs +47 -0
  137. package/dist/ui/badge/animated.mjs.map +1 -0
  138. package/dist/ui/badge.d.mts +6 -30
  139. package/dist/ui/badge.d.ts +6 -30
  140. package/dist/ui/badge.js +11 -142
  141. package/dist/ui/badge.js.map +1 -1
  142. package/dist/ui/badge.mjs +6 -141
  143. package/dist/ui/badge.mjs.map +1 -1
  144. package/dist/ui/buttons/animated.d.mts +27 -0
  145. package/dist/ui/buttons/animated.d.ts +27 -0
  146. package/dist/ui/buttons/animated.js +101 -0
  147. package/dist/ui/buttons/animated.js.map +1 -0
  148. package/dist/ui/buttons/animated.mjs +98 -0
  149. package/dist/ui/buttons/animated.mjs.map +1 -0
  150. package/dist/ui/buttons.d.mts +5 -13
  151. package/dist/ui/buttons.d.ts +5 -13
  152. package/dist/ui/buttons.js +7 -45
  153. package/dist/ui/buttons.js.map +1 -1
  154. package/dist/ui/buttons.mjs +8 -45
  155. package/dist/ui/buttons.mjs.map +1 -1
  156. package/dist/ui/card/animated.d.mts +23 -0
  157. package/dist/ui/card/animated.d.ts +23 -0
  158. package/dist/ui/card/animated.js +72 -0
  159. package/dist/ui/card/animated.js.map +1 -0
  160. package/dist/ui/card/animated.mjs +50 -0
  161. package/dist/ui/card/animated.mjs.map +1 -0
  162. package/dist/ui/card.d.mts +6 -70
  163. package/dist/ui/card.d.ts +6 -70
  164. package/dist/ui/card.js +43 -245
  165. package/dist/ui/card.js.map +1 -1
  166. package/dist/ui/card.mjs +5 -235
  167. package/dist/ui/card.mjs.map +1 -1
  168. package/dist/ui/divider/animated.d.mts +19 -0
  169. package/dist/ui/divider/animated.d.ts +19 -0
  170. package/dist/ui/divider/animated.js +41 -0
  171. package/dist/ui/divider/animated.js.map +1 -0
  172. package/dist/ui/divider/animated.mjs +39 -0
  173. package/dist/ui/divider/animated.mjs.map +1 -0
  174. package/dist/ui/divider.d.mts +6 -32
  175. package/dist/ui/divider.d.ts +6 -32
  176. package/dist/ui/divider.js +19 -186
  177. package/dist/ui/divider.js.map +1 -1
  178. package/dist/ui/divider.mjs +6 -183
  179. package/dist/ui/divider.mjs.map +1 -1
  180. package/dist/ui/drawer/animated.d.mts +23 -0
  181. package/dist/ui/drawer/animated.d.ts +23 -0
  182. package/dist/ui/drawer/animated.js +143 -0
  183. package/dist/ui/drawer/animated.js.map +1 -0
  184. package/dist/ui/drawer/animated.mjs +113 -0
  185. package/dist/ui/drawer/animated.mjs.map +1 -0
  186. package/dist/ui/drawer.d.mts +10 -11
  187. package/dist/ui/drawer.d.ts +10 -11
  188. package/dist/ui/drawer.js +44 -357
  189. package/dist/ui/drawer.js.map +1 -1
  190. package/dist/ui/drawer.mjs +3 -349
  191. package/dist/ui/drawer.mjs.map +1 -1
  192. package/dist/ui/empty-state/animated.d.mts +24 -0
  193. package/dist/ui/empty-state/animated.d.ts +24 -0
  194. package/dist/ui/empty-state/animated.js +45 -0
  195. package/dist/ui/empty-state/animated.js.map +1 -0
  196. package/dist/ui/empty-state/animated.mjs +42 -0
  197. package/dist/ui/empty-state/animated.mjs.map +1 -0
  198. package/dist/ui/empty-state.d.mts +11 -32
  199. package/dist/ui/empty-state.d.ts +11 -32
  200. package/dist/ui/empty-state.js +35 -160
  201. package/dist/ui/empty-state.js.map +1 -1
  202. package/dist/ui/empty-state.mjs +5 -153
  203. package/dist/ui/empty-state.mjs.map +1 -1
  204. package/dist/ui/inputs/animated.d.mts +27 -0
  205. package/dist/ui/inputs/animated.d.ts +27 -0
  206. package/dist/ui/inputs/animated.js +141 -0
  207. package/dist/ui/inputs/animated.js.map +1 -0
  208. package/dist/ui/inputs/animated.mjs +138 -0
  209. package/dist/ui/inputs/animated.mjs.map +1 -0
  210. package/dist/ui/inputs.d.mts +7 -21
  211. package/dist/ui/inputs.d.ts +7 -21
  212. package/dist/ui/inputs.js +16 -331
  213. package/dist/ui/inputs.js.map +1 -1
  214. package/dist/ui/inputs.mjs +13 -329
  215. package/dist/ui/inputs.mjs.map +1 -1
  216. package/dist/ui/modal/animated.d.mts +21 -0
  217. package/dist/ui/modal/animated.d.ts +21 -0
  218. package/dist/ui/modal/animated.js +120 -0
  219. package/dist/ui/modal/animated.js.map +1 -0
  220. package/dist/ui/modal/animated.mjs +117 -0
  221. package/dist/ui/modal/animated.mjs.map +1 -0
  222. package/dist/ui/modal.d.mts +10 -48
  223. package/dist/ui/modal.d.ts +10 -48
  224. package/dist/ui/modal.js +47 -361
  225. package/dist/ui/modal.js.map +1 -1
  226. package/dist/ui/modal.mjs +9 -351
  227. package/dist/ui/modal.mjs.map +1 -1
  228. package/dist/ui/progress/animated.d.mts +41 -0
  229. package/dist/ui/progress/animated.d.ts +41 -0
  230. package/dist/ui/progress/animated.js +123 -0
  231. package/dist/ui/progress/animated.js.map +1 -0
  232. package/dist/ui/progress/animated.mjs +112 -0
  233. package/dist/ui/progress/animated.mjs.map +1 -0
  234. package/dist/ui/progress.d.mts +10 -58
  235. package/dist/ui/progress.d.ts +10 -58
  236. package/dist/ui/progress.js +35 -227
  237. package/dist/ui/progress.js.map +1 -1
  238. package/dist/ui/progress.mjs +10 -222
  239. package/dist/ui/progress.mjs.map +1 -1
  240. package/dist/ui/skeleton/animated.d.mts +56 -0
  241. package/dist/ui/skeleton/animated.d.ts +56 -0
  242. package/dist/ui/skeleton/animated.js +126 -0
  243. package/dist/ui/skeleton/animated.js.map +1 -0
  244. package/dist/ui/skeleton/animated.mjs +119 -0
  245. package/dist/ui/skeleton/animated.mjs.map +1 -0
  246. package/dist/ui/skeleton.d.mts +16 -77
  247. package/dist/ui/skeleton.d.ts +16 -77
  248. package/dist/ui/skeleton.js +35 -526
  249. package/dist/ui/skeleton.js.map +1 -1
  250. package/dist/ui/skeleton.mjs +2 -520
  251. package/dist/ui/skeleton.mjs.map +1 -1
  252. package/dist/ui/{spinner.d.mts → spinner/animated.d.mts} +1 -6
  253. package/dist/ui/{spinner.d.ts → spinner/animated.d.ts} +1 -6
  254. package/dist/ui/{spinner.js → spinner/animated.js} +3 -9
  255. package/dist/ui/spinner/animated.js.map +1 -0
  256. package/dist/ui/{spinner.mjs → spinner/animated.mjs} +4 -9
  257. package/dist/ui/spinner/animated.mjs.map +1 -0
  258. package/dist/ui/table/animated.d.mts +21 -0
  259. package/dist/ui/table/animated.d.ts +21 -0
  260. package/dist/ui/table/animated.js +50 -0
  261. package/dist/ui/table/animated.js.map +1 -0
  262. package/dist/ui/table/animated.mjs +24 -0
  263. package/dist/ui/table/animated.mjs.map +1 -0
  264. package/dist/ui/table.d.mts +17 -11
  265. package/dist/ui/table.d.ts +17 -11
  266. package/dist/ui/table.js +55 -278
  267. package/dist/ui/table.js.map +1 -1
  268. package/dist/ui/table.mjs +2 -269
  269. package/dist/ui/table.mjs.map +1 -1
  270. package/dist/ui/tabs/animated.d.mts +25 -0
  271. package/dist/ui/tabs/animated.d.ts +25 -0
  272. package/dist/ui/tabs/animated.js +83 -0
  273. package/dist/ui/tabs/animated.js.map +1 -0
  274. package/dist/ui/tabs/animated.mjs +79 -0
  275. package/dist/ui/tabs/animated.mjs.map +1 -0
  276. package/dist/ui/tabs.d.mts +7 -41
  277. package/dist/ui/tabs.d.ts +7 -41
  278. package/dist/ui/tabs.js +35 -261
  279. package/dist/ui/tabs.js.map +1 -1
  280. package/dist/ui/tabs.mjs +2 -256
  281. package/dist/ui/tabs.mjs.map +1 -1
  282. package/dist/ui/toast/animated.d.mts +23 -0
  283. package/dist/ui/toast/animated.d.ts +23 -0
  284. package/dist/ui/toast/animated.js +103 -0
  285. package/dist/ui/toast/animated.js.map +1 -0
  286. package/dist/ui/toast/animated.mjs +99 -0
  287. package/dist/ui/toast/animated.mjs.map +1 -0
  288. package/dist/ui/toast.d.mts +7 -52
  289. package/dist/ui/toast.d.ts +7 -52
  290. package/dist/ui/toast.js +47 -268
  291. package/dist/ui/toast.js.map +1 -1
  292. package/dist/ui/toast.mjs +2 -259
  293. package/dist/ui/toast.mjs.map +1 -1
  294. package/dist/ui/toggle/animated.d.mts +22 -0
  295. package/dist/ui/toggle/animated.d.ts +22 -0
  296. package/dist/ui/toggle/animated.js +88 -0
  297. package/dist/ui/toggle/animated.js.map +1 -0
  298. package/dist/ui/toggle/animated.mjs +85 -0
  299. package/dist/ui/toggle/animated.mjs.map +1 -0
  300. package/dist/ui/toggle.d.mts +6 -30
  301. package/dist/ui/toggle.d.ts +6 -30
  302. package/dist/ui/toggle.js +19 -83
  303. package/dist/ui/toggle.js.map +1 -1
  304. package/dist/ui/toggle.mjs +12 -80
  305. package/dist/ui/toggle.mjs.map +1 -1
  306. package/dist/ui/tooltip/animated.d.mts +17 -0
  307. package/dist/ui/tooltip/animated.d.ts +17 -0
  308. package/dist/ui/tooltip/animated.js +59 -0
  309. package/dist/ui/tooltip/animated.js.map +1 -0
  310. package/dist/ui/tooltip/animated.mjs +56 -0
  311. package/dist/ui/tooltip/animated.mjs.map +1 -0
  312. package/dist/ui/tooltip.d.mts +6 -33
  313. package/dist/ui/tooltip.d.ts +6 -33
  314. package/dist/ui/tooltip.js +26 -193
  315. package/dist/ui/tooltip.js.map +1 -1
  316. package/dist/ui/tooltip.mjs +2 -192
  317. package/dist/ui/tooltip.mjs.map +1 -1
  318. package/dist/variants-CYODHI8b.d.mts +10 -0
  319. package/dist/variants-CYODHI8b.d.ts +10 -0
  320. package/package.json +1 -3
  321. package/dist/chunk-P6YRSEOY.js.map +0 -1
  322. package/dist/chunk-UJ3AER3U.mjs.map +0 -1
  323. package/dist/ui/spinner.js.map +0 -1
  324. package/dist/ui/spinner.mjs.map +0 -1
package/dist/ui/toast.js CHANGED
@@ -1,275 +1,54 @@
1
1
  "use client";
2
2
  'use strict';
3
3
 
4
- var chunkUOZYPWDZ_js = require('../chunk-UOZYPWDZ.js');
5
- var framerMotion = require('framer-motion');
6
- var react = require('react');
7
- var reactDom = require('react-dom');
8
- var classVarianceAuthority = require('class-variance-authority');
9
- var jsxRuntime = require('react/jsx-runtime');
4
+ var chunkPCK6LX3K_js = require('../chunk-PCK6LX3K.js');
5
+ require('../chunk-UOZYPWDZ.js');
10
6
 
11
- // src/ui/toast/animations.ts
12
- var toastAnimationPresets = {
13
- none: {},
14
- slide: {
15
- initial: { opacity: 0, x: 24 },
16
- animate: { opacity: 1, x: 0 },
17
- exit: { opacity: 0, x: 16 },
18
- transition: { type: "spring", stiffness: 380, damping: 28 }
19
- },
20
- fade: {
21
- initial: { opacity: 0 },
22
- animate: { opacity: 1 },
23
- exit: { opacity: 0 },
24
- transition: { duration: 0.18 }
25
- }
26
- };
27
- var toastViewportVariants = classVarianceAuthority.cva(
28
- "fixed z-[60] flex max-h-screen flex-col gap-2 p-4",
29
- {
30
- variants: {
31
- position: {
32
- "top-left": "left-0 top-0 items-start",
33
- "top-center": "left-1/2 top-0 -translate-x-1/2 items-center",
34
- "top-right": "right-0 top-0 items-end",
35
- "bottom-left": "bottom-0 left-0 items-start",
36
- "bottom-center": "bottom-0 left-1/2 -translate-x-1/2 items-center",
37
- "bottom-right": "bottom-0 right-0 items-end"
38
- }
39
- },
40
- defaultVariants: {
41
- position: "bottom-right"
42
- }
43
- }
44
- );
45
- var toastRootVariants = classVarianceAuthority.cva(
46
- "pointer-events-auto w-[min(100vw-2rem,380px)] rounded-xl border border-white/10 bg-slate-950 p-4 text-slate-50 shadow-[0_18px_48px_rgba(15,23,42,0.45)]",
47
- {
48
- variants: {
49
- appearance: {
50
- default: "bg-slate-950",
51
- success: "border-emerald-500/40 bg-emerald-950",
52
- warning: "border-amber-500/40 bg-amber-950",
53
- error: "border-rose-500/50 bg-rose-950",
54
- info: "border-sky-500/40 bg-sky-950",
55
- ghost: "border-transparent bg-transparent text-slate-200",
56
- purple: "border-purple-600 bg-purple-950/70 backdrop-blur-xl",
57
- pink: "border-pink-600 bg-pink-950/70 backdrop-blur-xl",
58
- orange: "border-orange-600 bg-orange-950/70 backdrop-blur-xl",
59
- yellow: "border-yellow-600 bg-yellow-950/70 backdrop-blur-xl",
60
- teal: "border-teal-600 bg-teal-950/70 backdrop-blur-xl",
61
- indigo: "border-indigo-600 bg-indigo-950/70 backdrop-blur-xl",
62
- emerald: "border-emerald-600 bg-emerald-950/70 backdrop-blur-xl",
63
- gray: "border-gray-600 bg-gray-950/70 backdrop-blur-xl",
64
- amber: "border-amber-600 bg-amber-950/70 backdrop-blur-xl",
65
- violet: "border-violet-600 bg-violet-950/70 backdrop-blur-xl",
66
- "gradient-blue": "border-gradient-to-r from-blue-600 to-purple-600 bg-gradient-to-r from-blue-950/70 to-purple-950/70 backdrop-blur-xl",
67
- "gradient-green": "border-gradient-to-r from-green-600 to-lime-600 bg-gradient-to-r from-green-950/70 to-lime-950/70 backdrop-blur-xl",
68
- "gradient-red": "border-gradient-to-r from-red-600 to-pink-600 bg-gradient-to-r from-red-950/70 to-pink-950/70 backdrop-blur-xl",
69
- "gradient-yellow": "border-gradient-to-r from-yellow-600 to-orange-600 bg-gradient-to-r from-yellow-950/70 to-orange-950/70 backdrop-blur-xl",
70
- "gradient-purple": "border-gradient-to-r from-purple-600 to-pink-600 bg-gradient-to-r from-purple-950/70 to-pink-950/70 backdrop-blur-xl",
71
- "gradient-teal": "border-gradient-to-r from-teal-600 to-cyan-600 bg-gradient-to-r from-teal-950/70 to-cyan-950/70 backdrop-blur-xl",
72
- "gradient-indigo": "border-gradient-to-r from-indigo-600 to-purple-600 bg-gradient-to-r from-indigo-950/70 to-purple-950/70 backdrop-blur-xl",
73
- "gradient-pink": "border-gradient-to-r from-pink-600 to-rose-600 bg-gradient-to-r from-pink-950/70 to-rose-950/70 backdrop-blur-xl",
74
- "gradient-orange": "border-gradient-to-r from-orange-600 to-red-600 bg-gradient-to-r from-orange-950/70 to-red-950/70 backdrop-blur-xl"
75
- },
76
- size: {
77
- sm: "p-3 text-xs",
78
- md: "p-4 text-sm",
79
- lg: "p-5 text-base"
80
- }
81
- },
82
- defaultVariants: {
83
- appearance: "default",
84
- size: "md"
85
- }
86
- }
87
- );
88
- var ToastStoreContext = react.createContext(null);
89
- var toastDispatcher = null;
90
- function toast(input) {
91
- if (!toastDispatcher) {
92
- return "";
93
- }
94
- return toastDispatcher(input);
95
- }
96
- function useToast() {
97
- const ctx = react.useContext(ToastStoreContext);
98
- if (!ctx) {
99
- throw new Error("useToast must be used within <ToastProvider>");
100
- }
101
- return { toast: ctx.push, dismiss: ctx.dismiss };
102
- }
103
- function ToastProvider({ children }) {
104
- const [toasts, setToasts] = react.useState([]);
105
- const timers = react.useRef(/* @__PURE__ */ new Map());
106
- const dismiss = react.useCallback((id) => {
107
- const timerId = timers.current.get(id);
108
- if (timerId) {
109
- window.clearTimeout(timerId);
110
- timers.current.delete(id);
111
- }
112
- setToasts((prev) => prev.filter((toastItem) => toastItem.id !== id));
113
- }, []);
114
- const push = react.useCallback(
115
- (input) => {
116
- const id = input.id ?? `toast-${Math.random().toString(16).slice(2)}`;
117
- const durationMs = input.durationMs ?? 4500;
118
- const record = {
119
- ...input,
120
- id,
121
- durationMs,
122
- animation: input.animation ?? "slide"
123
- };
124
- setToasts((prev) => [...prev, record]);
125
- const timerId = window.setTimeout(() => dismiss(id), durationMs);
126
- timers.current.set(id, timerId);
127
- return id;
128
- },
129
- [dismiss]
130
- );
131
- const ctx = react.useMemo(
132
- () => ({
133
- toasts,
134
- push,
135
- dismiss
136
- }),
137
- [dismiss, push, toasts]
138
- );
139
- react.useEffect(() => {
140
- toastDispatcher = push;
141
- return () => {
142
- toastDispatcher = null;
143
- };
144
- }, [push]);
145
- return /* @__PURE__ */ jsxRuntime.jsx(ToastStoreContext.Provider, { value: ctx, children });
146
- }
147
- ToastProvider.displayName = "ToastProvider";
148
- function ToastViewport({
149
- position = "bottom-right",
150
- className
151
- }) {
152
- const ctx = react.useContext(ToastStoreContext);
153
- if (!ctx) {
154
- throw new Error("ToastViewport must be used within <ToastProvider>");
155
- }
156
- const portalTarget = typeof document !== "undefined" ? document.body : null;
157
- if (!portalTarget) {
158
- return null;
159
- }
160
- return reactDom.createPortal(
161
- /* @__PURE__ */ jsxRuntime.jsx(
162
- "div",
163
- {
164
- className: chunkUOZYPWDZ_js.cn(toastViewportVariants({ position }), className),
165
- "data-slot": "toast-viewport",
166
- children: /* @__PURE__ */ jsxRuntime.jsx(framerMotion.AnimatePresence, { children: ctx.toasts.map((item) => /* @__PURE__ */ jsxRuntime.jsxs(
167
- Toast,
168
- {
169
- toastId: item.id,
170
- appearance: item.appearance,
171
- size: item.size,
172
- animation: item.animation,
173
- children: [
174
- /* @__PURE__ */ jsxRuntime.jsx(ToastTitle, { children: item.title }),
175
- item.description ? /* @__PURE__ */ jsxRuntime.jsx(ToastDescription, { children: item.description }) : null,
176
- /* @__PURE__ */ jsxRuntime.jsx(ToastClose, { onClick: () => ctx.dismiss(item.id) })
177
- ]
178
- },
179
- item.id
180
- )) })
181
- }
182
- ),
183
- portalTarget
184
- );
185
- }
186
- ToastViewport.displayName = "ToastViewport";
187
- function Toast({
188
- toastId: _toastId,
189
- appearance,
190
- size,
191
- animation = "slide",
192
- className,
193
- children
194
- }) {
195
- const motionProps = toastAnimationPresets[animation];
196
- const live = appearance === "error" ? "assertive" : "polite";
197
- return /* @__PURE__ */ jsxRuntime.jsx(
198
- framerMotion.motion.div,
199
- {
200
- layout: true,
201
- "data-slot": "toast",
202
- role: appearance === "error" ? "alert" : "status",
203
- "aria-live": live,
204
- "aria-atomic": "true",
205
- className: chunkUOZYPWDZ_js.cn(
206
- "relative",
207
- toastRootVariants({ appearance, size }),
208
- className
209
- ),
210
- initial: animation === "none" ? false : motionProps.initial,
211
- animate: animation === "none" ? void 0 : motionProps.animate,
212
- exit: animation === "none" ? void 0 : motionProps.exit,
213
- transition: motionProps.transition,
214
- children
215
- }
216
- );
217
- }
218
- Toast.displayName = "Toast";
219
- function ToastTitle({ className, children }) {
220
- return /* @__PURE__ */ jsxRuntime.jsx("div", { "data-slot": "toast-title", className: chunkUOZYPWDZ_js.cn("font-semibold", className), children });
221
- }
222
- ToastTitle.displayName = "ToastTitle";
223
- function ToastDescription({ className, children }) {
224
- return /* @__PURE__ */ jsxRuntime.jsx(
225
- "div",
226
- {
227
- "data-slot": "toast-description",
228
- className: chunkUOZYPWDZ_js.cn("text-sm text-slate-300", className),
229
- children
230
- }
231
- );
232
- }
233
- ToastDescription.displayName = "ToastDescription";
234
- function ToastAction({ className, children }) {
235
- return /* @__PURE__ */ jsxRuntime.jsx("div", { "data-slot": "toast-action", className: chunkUOZYPWDZ_js.cn("mt-3", className), children });
236
- }
237
- ToastAction.displayName = "ToastAction";
238
- function ToastClose({
239
- className,
240
- children,
241
- onClick,
242
- ...rest
243
- }) {
244
- return /* @__PURE__ */ jsxRuntime.jsx(
245
- "button",
246
- {
247
- type: "button",
248
- "data-slot": "toast-close",
249
- "aria-label": "Dismiss notification",
250
- className: chunkUOZYPWDZ_js.cn(
251
- "absolute right-3 top-3 inline-flex size-8 items-center justify-center rounded-md text-slate-200 transition hover:bg-white/10",
252
- className
253
- ),
254
- onClick,
255
- ...rest,
256
- children: children ?? "\xD7"
257
- }
258
- );
259
- }
260
- ToastClose.displayName = "ToastClose";
261
7
 
262
- exports.Toast = Toast;
263
- exports.ToastAction = ToastAction;
264
- exports.ToastClose = ToastClose;
265
- exports.ToastDescription = ToastDescription;
266
- exports.ToastProvider = ToastProvider;
267
- exports.ToastTitle = ToastTitle;
268
- exports.ToastViewport = ToastViewport;
269
- exports.toast = toast;
270
- exports.toastAnimationPresets = toastAnimationPresets;
271
- exports.toastRootVariants = toastRootVariants;
272
- exports.toastViewportVariants = toastViewportVariants;
273
- exports.useToast = useToast;
8
+
9
+ Object.defineProperty(exports, "Toast", {
10
+ enumerable: true,
11
+ get: function () { return chunkPCK6LX3K_js.Toast; }
12
+ });
13
+ Object.defineProperty(exports, "ToastAction", {
14
+ enumerable: true,
15
+ get: function () { return chunkPCK6LX3K_js.ToastAction; }
16
+ });
17
+ Object.defineProperty(exports, "ToastClose", {
18
+ enumerable: true,
19
+ get: function () { return chunkPCK6LX3K_js.ToastClose; }
20
+ });
21
+ Object.defineProperty(exports, "ToastDescription", {
22
+ enumerable: true,
23
+ get: function () { return chunkPCK6LX3K_js.ToastDescription; }
24
+ });
25
+ Object.defineProperty(exports, "ToastProvider", {
26
+ enumerable: true,
27
+ get: function () { return chunkPCK6LX3K_js.ToastProvider; }
28
+ });
29
+ Object.defineProperty(exports, "ToastTitle", {
30
+ enumerable: true,
31
+ get: function () { return chunkPCK6LX3K_js.ToastTitle; }
32
+ });
33
+ Object.defineProperty(exports, "ToastViewport", {
34
+ enumerable: true,
35
+ get: function () { return chunkPCK6LX3K_js.ToastViewport; }
36
+ });
37
+ Object.defineProperty(exports, "toast", {
38
+ enumerable: true,
39
+ get: function () { return chunkPCK6LX3K_js.toast; }
40
+ });
41
+ Object.defineProperty(exports, "toastRootVariants", {
42
+ enumerable: true,
43
+ get: function () { return chunkPCK6LX3K_js.toastRootVariants; }
44
+ });
45
+ Object.defineProperty(exports, "toastViewportVariants", {
46
+ enumerable: true,
47
+ get: function () { return chunkPCK6LX3K_js.toastViewportVariants; }
48
+ });
49
+ Object.defineProperty(exports, "useToast", {
50
+ enumerable: true,
51
+ get: function () { return chunkPCK6LX3K_js.useToast; }
52
+ });
274
53
  //# sourceMappingURL=toast.js.map
275
54
  //# sourceMappingURL=toast.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/ui/toast/animations.ts","../../src/ui/toast/variants.ts","../../src/ui/toast/toast.tsx"],"names":["cva","createContext","useContext","useState","useRef","useCallback","useMemo","useEffect","createPortal","jsx","cn","AnimatePresence","jsxs","motion"],"mappings":";;;;;;;;;;AAcO,IAAM,qBAAA,GAA+C;AAAA,EAC1D,MAAM,EAAC;AAAA,EACP,KAAA,EAAO;AAAA,IACL,OAAA,EAAS,EAAE,OAAA,EAAS,CAAA,EAAG,GAAG,EAAA,EAAG;AAAA,IAC7B,OAAA,EAAS,EAAE,OAAA,EAAS,CAAA,EAAG,GAAG,CAAA,EAAE;AAAA,IAC5B,IAAA,EAAM,EAAE,OAAA,EAAS,CAAA,EAAG,GAAG,EAAA,EAAG;AAAA,IAC1B,YAAY,EAAE,IAAA,EAAM,UAAU,SAAA,EAAW,GAAA,EAAK,SAAS,EAAA;AAAG,GAC5D;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AAA,MACV,YAAA,EAAW,sBAAA;AAAA,MACX,SAAA,EAAWC,mBAAA;AAAA,QACT,8HAAA;AAAA,QACA;AAAA,OACF;AAAA,MACA,OAAA;AAAA,MACC,GAAG,IAAA;AAAA,MAEH,QAAA,EAAA,QAAA,IAAY;AAAA;AAAA,GACf;AAEJ;AAEA,UAAA,CAAW,WAAA,GAAc,YAAA","file":"toast.js","sourcesContent":["import type { HTMLMotionProps } from \"framer-motion\";\n\nexport type ToastAnimation = \"none\" | \"slide\" | \"fade\";\n\ntype ToastPresetMotionProps = Pick<\n HTMLMotionProps<\"div\">,\n \"initial\" | \"animate\" | \"exit\" | \"transition\"\n>;\n\nexport type ToastAnimationPresets = Record<\n ToastAnimation,\n ToastPresetMotionProps\n>;\n\nexport const toastAnimationPresets: ToastAnimationPresets = {\n none: {},\n slide: {\n initial: { opacity: 0, x: 24 },\n animate: { opacity: 1, x: 0 },\n exit: { opacity: 0, x: 16 },\n transition: { type: \"spring\", stiffness: 380, damping: 28 },\n },\n fade: {\n initial: { opacity: 0 },\n animate: { opacity: 1 },\n exit: { opacity: 0 },\n transition: { duration: 0.18 },\n },\n};\n","import { cva } from \"class-variance-authority\";\n\nexport const toastViewportVariants = cva(\n \"fixed z-[60] flex max-h-screen flex-col gap-2 p-4\",\n {\n variants: {\n position: {\n \"top-left\": \"left-0 top-0 items-start\",\n \"top-center\": \"left-1/2 top-0 -translate-x-1/2 items-center\",\n \"top-right\": \"right-0 top-0 items-end\",\n \"bottom-left\": \"bottom-0 left-0 items-start\",\n \"bottom-center\": \"bottom-0 left-1/2 -translate-x-1/2 items-center\",\n \"bottom-right\": \"bottom-0 right-0 items-end\",\n },\n },\n defaultVariants: {\n position: \"bottom-right\",\n },\n },\n);\n\nexport const toastRootVariants = cva(\n \"pointer-events-auto w-[min(100vw-2rem,380px)] rounded-xl border border-white/10 bg-slate-950 p-4 text-slate-50 shadow-[0_18px_48px_rgba(15,23,42,0.45)]\",\n {\n variants: {\n appearance: {\n default: \"bg-slate-950\",\n success: \"border-emerald-500/40 bg-emerald-950\",\n warning: \"border-amber-500/40 bg-amber-950\",\n error: \"border-rose-500/50 bg-rose-950\",\n info: \"border-sky-500/40 bg-sky-950\",\n ghost: \"border-transparent bg-transparent text-slate-200\",\n purple: \"border-purple-600 bg-purple-950/70 backdrop-blur-xl\",\n pink: \"border-pink-600 bg-pink-950/70 backdrop-blur-xl\",\n orange: \"border-orange-600 bg-orange-950/70 backdrop-blur-xl\",\n yellow: \"border-yellow-600 bg-yellow-950/70 backdrop-blur-xl\",\n teal: \"border-teal-600 bg-teal-950/70 backdrop-blur-xl\",\n indigo: \"border-indigo-600 bg-indigo-950/70 backdrop-blur-xl\",\n emerald: \"border-emerald-600 bg-emerald-950/70 backdrop-blur-xl\",\n gray: \"border-gray-600 bg-gray-950/70 backdrop-blur-xl\",\n amber: \"border-amber-600 bg-amber-950/70 backdrop-blur-xl\",\n violet: \"border-violet-600 bg-violet-950/70 backdrop-blur-xl\",\n \"gradient-blue\":\n \"border-gradient-to-r from-blue-600 to-purple-600 bg-gradient-to-r from-blue-950/70 to-purple-950/70 backdrop-blur-xl\",\n \"gradient-green\":\n \"border-gradient-to-r from-green-600 to-lime-600 bg-gradient-to-r from-green-950/70 to-lime-950/70 backdrop-blur-xl\",\n \"gradient-red\":\n \"border-gradient-to-r from-red-600 to-pink-600 bg-gradient-to-r from-red-950/70 to-pink-950/70 backdrop-blur-xl\",\n \"gradient-yellow\":\n \"border-gradient-to-r from-yellow-600 to-orange-600 bg-gradient-to-r from-yellow-950/70 to-orange-950/70 backdrop-blur-xl\",\n \"gradient-purple\":\n \"border-gradient-to-r from-purple-600 to-pink-600 bg-gradient-to-r from-purple-950/70 to-pink-950/70 backdrop-blur-xl\",\n \"gradient-teal\":\n \"border-gradient-to-r from-teal-600 to-cyan-600 bg-gradient-to-r from-teal-950/70 to-cyan-950/70 backdrop-blur-xl\",\n \"gradient-indigo\":\n \"border-gradient-to-r from-indigo-600 to-purple-600 bg-gradient-to-r from-indigo-950/70 to-purple-950/70 backdrop-blur-xl\",\n \"gradient-pink\":\n \"border-gradient-to-r from-pink-600 to-rose-600 bg-gradient-to-r from-pink-950/70 to-rose-950/70 backdrop-blur-xl\",\n \"gradient-orange\":\n \"border-gradient-to-r from-orange-600 to-red-600 bg-gradient-to-r from-orange-950/70 to-red-950/70 backdrop-blur-xl\",\n },\n size: {\n sm: \"p-3 text-xs\",\n md: \"p-4 text-sm\",\n lg: \"p-5 text-base\",\n },\n },\n defaultVariants: {\n appearance: \"default\",\n size: \"md\",\n },\n },\n);\n","\"use client\";\n\nimport { AnimatePresence, motion } from \"framer-motion\";\nimport {\n createContext,\n useCallback,\n useContext,\n useEffect,\n useMemo,\n useRef,\n useState,\n} from \"react\";\nimport { createPortal } from \"react-dom\";\n\nimport { cn } from \"../../lib/utils\";\n\nimport { toastAnimationPresets } from \"./animations\";\nimport type {\n ToastContextValue,\n ToastStoreContextValue,\n InternalToast,\n ToastInput,\n ToastProps,\n ToastProviderProps,\n ToastSectionProps,\n ToastViewportProps,\n} from \"./types\";\nimport { toastRootVariants, toastViewportVariants } from \"./variants\";\n\nconst ToastStoreContext = createContext<ToastStoreContextValue | null>(null);\n\nlet toastDispatcher: ToastStoreContextValue[\"push\"] | null = null;\n\nexport function toast(input: ToastInput) {\n if (!toastDispatcher) {\n return \"\";\n }\n return toastDispatcher(input);\n}\n\nexport function useToast(): ToastContextValue {\n const ctx = useContext(ToastStoreContext);\n if (!ctx) {\n throw new Error(\"useToast must be used within <ToastProvider>\");\n }\n return { toast: ctx.push, dismiss: ctx.dismiss };\n}\n\nexport function ToastProvider({ children }: ToastProviderProps) {\n const [toasts, setToasts] = useState<InternalToast[]>([]);\n const timers = useRef<Map<string, number>>(new Map());\n\n const dismiss = useCallback((id: string) => {\n const timerId = timers.current.get(id);\n if (timerId) {\n window.clearTimeout(timerId);\n timers.current.delete(id);\n }\n setToasts((prev) => prev.filter((toastItem) => toastItem.id !== id));\n }, []);\n\n const push = useCallback(\n (input: ToastInput) => {\n const id = input.id ?? `toast-${Math.random().toString(16).slice(2)}`;\n const durationMs = input.durationMs ?? 4500;\n const record: InternalToast = {\n ...input,\n id,\n durationMs,\n animation: input.animation ?? \"slide\",\n };\n setToasts((prev) => [...prev, record]);\n const timerId = window.setTimeout(() => dismiss(id), durationMs);\n timers.current.set(id, timerId);\n return id;\n },\n [dismiss],\n );\n\n const ctx = useMemo(\n () => ({\n toasts,\n push,\n dismiss,\n }),\n [dismiss, push, toasts],\n );\n\n useEffect(() => {\n toastDispatcher = push;\n return () => {\n toastDispatcher = null;\n };\n }, [push]);\n\n return (\n <ToastStoreContext.Provider value={ctx}>\n {children}\n </ToastStoreContext.Provider>\n );\n}\n\nToastProvider.displayName = \"ToastProvider\";\n\nexport function ToastViewport({\n position = \"bottom-right\",\n className,\n}: ToastViewportProps) {\n const ctx = useContext(ToastStoreContext);\n if (!ctx) {\n throw new Error(\"ToastViewport must be used within <ToastProvider>\");\n }\n\n const portalTarget = typeof document !== \"undefined\" ? document.body : null;\n if (!portalTarget) {\n return null;\n }\n\n return createPortal(\n <div\n className={cn(toastViewportVariants({ position }), className)}\n data-slot=\"toast-viewport\"\n >\n <AnimatePresence>\n {ctx.toasts.map((item) => (\n <Toast\n key={item.id}\n toastId={item.id}\n appearance={item.appearance}\n size={item.size}\n animation={item.animation}\n >\n <ToastTitle>{item.title}</ToastTitle>\n {item.description ? (\n <ToastDescription>{item.description}</ToastDescription>\n ) : null}\n <ToastClose onClick={() => ctx.dismiss(item.id)} />\n </Toast>\n ))}\n </AnimatePresence>\n </div>,\n portalTarget,\n );\n}\n\nToastViewport.displayName = \"ToastViewport\";\n\nexport function Toast({\n toastId: _toastId,\n appearance,\n size,\n animation = \"slide\",\n className,\n children,\n}: ToastProps) {\n const motionProps = toastAnimationPresets[animation];\n const live = appearance === \"error\" ? \"assertive\" : \"polite\";\n\n return (\n <motion.div\n layout\n data-slot=\"toast\"\n role={appearance === \"error\" ? \"alert\" : \"status\"}\n aria-live={live}\n aria-atomic=\"true\"\n className={cn(\n \"relative\",\n toastRootVariants({ appearance, size }),\n className,\n )}\n initial={animation === \"none\" ? false : motionProps.initial}\n animate={animation === \"none\" ? undefined : motionProps.animate}\n exit={animation === \"none\" ? undefined : motionProps.exit}\n transition={motionProps.transition}\n >\n {children}\n </motion.div>\n );\n}\n\nToast.displayName = \"Toast\";\n\nexport function ToastTitle({ className, children }: ToastSectionProps) {\n return (\n <div data-slot=\"toast-title\" className={cn(\"font-semibold\", className)}>\n {children}\n </div>\n );\n}\n\nToastTitle.displayName = \"ToastTitle\";\n\nexport function ToastDescription({ className, children }: ToastSectionProps) {\n return (\n <div\n data-slot=\"toast-description\"\n className={cn(\"text-sm text-slate-300\", className)}\n >\n {children}\n </div>\n );\n}\n\nToastDescription.displayName = \"ToastDescription\";\n\nexport function ToastAction({ className, children }: ToastSectionProps) {\n return (\n <div data-slot=\"toast-action\" className={cn(\"mt-3\", className)}>\n {children}\n </div>\n );\n}\n\nToastAction.displayName = \"ToastAction\";\n\nexport function ToastClose({\n className,\n children,\n onClick,\n ...rest\n}: ToastSectionProps & { onClick?: () => void }) {\n return (\n <button\n type=\"button\"\n data-slot=\"toast-close\"\n aria-label=\"Dismiss notification\"\n className={cn(\n \"absolute right-3 top-3 inline-flex size-8 items-center justify-center rounded-md text-slate-200 transition hover:bg-white/10\",\n className,\n )}\n onClick={onClick}\n {...rest}\n >\n {children ?? \"×\"}\n </button>\n );\n}\n\nToastClose.displayName = \"ToastClose\";\n"]}
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"toast.js"}
package/dist/ui/toast.mjs CHANGED
@@ -1,262 +1,5 @@
1
1
  "use client";
2
- import { cn } from '../chunk-DFEZH7TC.mjs';
3
- import { AnimatePresence, motion } from 'framer-motion';
4
- import { createContext, useContext, useState, useRef, useCallback, useMemo, useEffect } from 'react';
5
- import { createPortal } from 'react-dom';
6
- import { cva } from 'class-variance-authority';
7
- import { jsx, jsxs } from 'react/jsx-runtime';
8
-
9
- // src/ui/toast/animations.ts
10
- var toastAnimationPresets = {
11
- none: {},
12
- slide: {
13
- initial: { opacity: 0, x: 24 },
14
- animate: { opacity: 1, x: 0 },
15
- exit: { opacity: 0, x: 16 },
16
- transition: { type: "spring", stiffness: 380, damping: 28 }
17
- },
18
- fade: {
19
- initial: { opacity: 0 },
20
- animate: { opacity: 1 },
21
- exit: { opacity: 0 },
22
- transition: { duration: 0.18 }
23
- }
24
- };
25
- var toastViewportVariants = cva(
26
- "fixed z-[60] flex max-h-screen flex-col gap-2 p-4",
27
- {
28
- variants: {
29
- position: {
30
- "top-left": "left-0 top-0 items-start",
31
- "top-center": "left-1/2 top-0 -translate-x-1/2 items-center",
32
- "top-right": "right-0 top-0 items-end",
33
- "bottom-left": "bottom-0 left-0 items-start",
34
- "bottom-center": "bottom-0 left-1/2 -translate-x-1/2 items-center",
35
- "bottom-right": "bottom-0 right-0 items-end"
36
- }
37
- },
38
- defaultVariants: {
39
- position: "bottom-right"
40
- }
41
- }
42
- );
43
- var toastRootVariants = cva(
44
- "pointer-events-auto w-[min(100vw-2rem,380px)] rounded-xl border border-white/10 bg-slate-950 p-4 text-slate-50 shadow-[0_18px_48px_rgba(15,23,42,0.45)]",
45
- {
46
- variants: {
47
- appearance: {
48
- default: "bg-slate-950",
49
- success: "border-emerald-500/40 bg-emerald-950",
50
- warning: "border-amber-500/40 bg-amber-950",
51
- error: "border-rose-500/50 bg-rose-950",
52
- info: "border-sky-500/40 bg-sky-950",
53
- ghost: "border-transparent bg-transparent text-slate-200",
54
- purple: "border-purple-600 bg-purple-950/70 backdrop-blur-xl",
55
- pink: "border-pink-600 bg-pink-950/70 backdrop-blur-xl",
56
- orange: "border-orange-600 bg-orange-950/70 backdrop-blur-xl",
57
- yellow: "border-yellow-600 bg-yellow-950/70 backdrop-blur-xl",
58
- teal: "border-teal-600 bg-teal-950/70 backdrop-blur-xl",
59
- indigo: "border-indigo-600 bg-indigo-950/70 backdrop-blur-xl",
60
- emerald: "border-emerald-600 bg-emerald-950/70 backdrop-blur-xl",
61
- gray: "border-gray-600 bg-gray-950/70 backdrop-blur-xl",
62
- amber: "border-amber-600 bg-amber-950/70 backdrop-blur-xl",
63
- violet: "border-violet-600 bg-violet-950/70 backdrop-blur-xl",
64
- "gradient-blue": "border-gradient-to-r from-blue-600 to-purple-600 bg-gradient-to-r from-blue-950/70 to-purple-950/70 backdrop-blur-xl",
65
- "gradient-green": "border-gradient-to-r from-green-600 to-lime-600 bg-gradient-to-r from-green-950/70 to-lime-950/70 backdrop-blur-xl",
66
- "gradient-red": "border-gradient-to-r from-red-600 to-pink-600 bg-gradient-to-r from-red-950/70 to-pink-950/70 backdrop-blur-xl",
67
- "gradient-yellow": "border-gradient-to-r from-yellow-600 to-orange-600 bg-gradient-to-r from-yellow-950/70 to-orange-950/70 backdrop-blur-xl",
68
- "gradient-purple": "border-gradient-to-r from-purple-600 to-pink-600 bg-gradient-to-r from-purple-950/70 to-pink-950/70 backdrop-blur-xl",
69
- "gradient-teal": "border-gradient-to-r from-teal-600 to-cyan-600 bg-gradient-to-r from-teal-950/70 to-cyan-950/70 backdrop-blur-xl",
70
- "gradient-indigo": "border-gradient-to-r from-indigo-600 to-purple-600 bg-gradient-to-r from-indigo-950/70 to-purple-950/70 backdrop-blur-xl",
71
- "gradient-pink": "border-gradient-to-r from-pink-600 to-rose-600 bg-gradient-to-r from-pink-950/70 to-rose-950/70 backdrop-blur-xl",
72
- "gradient-orange": "border-gradient-to-r from-orange-600 to-red-600 bg-gradient-to-r from-orange-950/70 to-red-950/70 backdrop-blur-xl"
73
- },
74
- size: {
75
- sm: "p-3 text-xs",
76
- md: "p-4 text-sm",
77
- lg: "p-5 text-base"
78
- }
79
- },
80
- defaultVariants: {
81
- appearance: "default",
82
- size: "md"
83
- }
84
- }
85
- );
86
- var ToastStoreContext = createContext(null);
87
- var toastDispatcher = null;
88
- function toast(input) {
89
- if (!toastDispatcher) {
90
- return "";
91
- }
92
- return toastDispatcher(input);
93
- }
94
- function useToast() {
95
- const ctx = useContext(ToastStoreContext);
96
- if (!ctx) {
97
- throw new Error("useToast must be used within <ToastProvider>");
98
- }
99
- return { toast: ctx.push, dismiss: ctx.dismiss };
100
- }
101
- function ToastProvider({ children }) {
102
- const [toasts, setToasts] = useState([]);
103
- const timers = useRef(/* @__PURE__ */ new Map());
104
- const dismiss = useCallback((id) => {
105
- const timerId = timers.current.get(id);
106
- if (timerId) {
107
- window.clearTimeout(timerId);
108
- timers.current.delete(id);
109
- }
110
- setToasts((prev) => prev.filter((toastItem) => toastItem.id !== id));
111
- }, []);
112
- const push = useCallback(
113
- (input) => {
114
- const id = input.id ?? `toast-${Math.random().toString(16).slice(2)}`;
115
- const durationMs = input.durationMs ?? 4500;
116
- const record = {
117
- ...input,
118
- id,
119
- durationMs,
120
- animation: input.animation ?? "slide"
121
- };
122
- setToasts((prev) => [...prev, record]);
123
- const timerId = window.setTimeout(() => dismiss(id), durationMs);
124
- timers.current.set(id, timerId);
125
- return id;
126
- },
127
- [dismiss]
128
- );
129
- const ctx = useMemo(
130
- () => ({
131
- toasts,
132
- push,
133
- dismiss
134
- }),
135
- [dismiss, push, toasts]
136
- );
137
- useEffect(() => {
138
- toastDispatcher = push;
139
- return () => {
140
- toastDispatcher = null;
141
- };
142
- }, [push]);
143
- return /* @__PURE__ */ jsx(ToastStoreContext.Provider, { value: ctx, children });
144
- }
145
- ToastProvider.displayName = "ToastProvider";
146
- function ToastViewport({
147
- position = "bottom-right",
148
- className
149
- }) {
150
- const ctx = useContext(ToastStoreContext);
151
- if (!ctx) {
152
- throw new Error("ToastViewport must be used within <ToastProvider>");
153
- }
154
- const portalTarget = typeof document !== "undefined" ? document.body : null;
155
- if (!portalTarget) {
156
- return null;
157
- }
158
- return createPortal(
159
- /* @__PURE__ */ jsx(
160
- "div",
161
- {
162
- className: cn(toastViewportVariants({ position }), className),
163
- "data-slot": "toast-viewport",
164
- children: /* @__PURE__ */ jsx(AnimatePresence, { children: ctx.toasts.map((item) => /* @__PURE__ */ jsxs(
165
- Toast,
166
- {
167
- toastId: item.id,
168
- appearance: item.appearance,
169
- size: item.size,
170
- animation: item.animation,
171
- children: [
172
- /* @__PURE__ */ jsx(ToastTitle, { children: item.title }),
173
- item.description ? /* @__PURE__ */ jsx(ToastDescription, { children: item.description }) : null,
174
- /* @__PURE__ */ jsx(ToastClose, { onClick: () => ctx.dismiss(item.id) })
175
- ]
176
- },
177
- item.id
178
- )) })
179
- }
180
- ),
181
- portalTarget
182
- );
183
- }
184
- ToastViewport.displayName = "ToastViewport";
185
- function Toast({
186
- toastId: _toastId,
187
- appearance,
188
- size,
189
- animation = "slide",
190
- className,
191
- children
192
- }) {
193
- const motionProps = toastAnimationPresets[animation];
194
- const live = appearance === "error" ? "assertive" : "polite";
195
- return /* @__PURE__ */ jsx(
196
- motion.div,
197
- {
198
- layout: true,
199
- "data-slot": "toast",
200
- role: appearance === "error" ? "alert" : "status",
201
- "aria-live": live,
202
- "aria-atomic": "true",
203
- className: cn(
204
- "relative",
205
- toastRootVariants({ appearance, size }),
206
- className
207
- ),
208
- initial: animation === "none" ? false : motionProps.initial,
209
- animate: animation === "none" ? void 0 : motionProps.animate,
210
- exit: animation === "none" ? void 0 : motionProps.exit,
211
- transition: motionProps.transition,
212
- children
213
- }
214
- );
215
- }
216
- Toast.displayName = "Toast";
217
- function ToastTitle({ className, children }) {
218
- return /* @__PURE__ */ jsx("div", { "data-slot": "toast-title", className: cn("font-semibold", className), children });
219
- }
220
- ToastTitle.displayName = "ToastTitle";
221
- function ToastDescription({ className, children }) {
222
- return /* @__PURE__ */ jsx(
223
- "div",
224
- {
225
- "data-slot": "toast-description",
226
- className: cn("text-sm text-slate-300", className),
227
- children
228
- }
229
- );
230
- }
231
- ToastDescription.displayName = "ToastDescription";
232
- function ToastAction({ className, children }) {
233
- return /* @__PURE__ */ jsx("div", { "data-slot": "toast-action", className: cn("mt-3", className), children });
234
- }
235
- ToastAction.displayName = "ToastAction";
236
- function ToastClose({
237
- className,
238
- children,
239
- onClick,
240
- ...rest
241
- }) {
242
- return /* @__PURE__ */ jsx(
243
- "button",
244
- {
245
- type: "button",
246
- "data-slot": "toast-close",
247
- "aria-label": "Dismiss notification",
248
- className: cn(
249
- "absolute right-3 top-3 inline-flex size-8 items-center justify-center rounded-md text-slate-200 transition hover:bg-white/10",
250
- className
251
- ),
252
- onClick,
253
- ...rest,
254
- children: children ?? "\xD7"
255
- }
256
- );
257
- }
258
- ToastClose.displayName = "ToastClose";
259
-
260
- export { Toast, ToastAction, ToastClose, ToastDescription, ToastProvider, ToastTitle, ToastViewport, toast, toastAnimationPresets, toastRootVariants, toastViewportVariants, useToast };
2
+ export { Toast, ToastAction, ToastClose, ToastDescription, ToastProvider, ToastTitle, ToastViewport, toast, toastRootVariants, toastViewportVariants, useToast } from '../chunk-UXGHUBNJ.mjs';
3
+ import '../chunk-DFEZH7TC.mjs';
261
4
  //# sourceMappingURL=toast.mjs.map
262
5
  //# sourceMappingURL=toast.mjs.map