@tribepad/themis 1.0.0 → 1.0.1

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 (326) hide show
  1. package/dist/elements/Accordion/index.js +325 -66
  2. package/dist/elements/Accordion/index.js.map +1 -1
  3. package/dist/elements/Accordion/index.mjs +317 -3
  4. package/dist/elements/Accordion/index.mjs.map +1 -1
  5. package/dist/elements/Avatar/index.js +461 -45
  6. package/dist/elements/Avatar/index.js.map +1 -1
  7. package/dist/elements/Avatar/index.mjs +456 -3
  8. package/dist/elements/Avatar/index.mjs.map +1 -1
  9. package/dist/elements/Badge/index.js +238 -36
  10. package/dist/elements/Badge/index.js.map +1 -1
  11. package/dist/elements/Badge/index.mjs +234 -4
  12. package/dist/elements/Badge/index.mjs.map +1 -1
  13. package/dist/elements/Breadcrumbs/index.js +808 -39
  14. package/dist/elements/Breadcrumbs/index.js.map +1 -1
  15. package/dist/elements/Breadcrumbs/index.mjs +810 -7
  16. package/dist/elements/Breadcrumbs/index.mjs.map +1 -1
  17. package/dist/elements/Button/index.js +282 -19
  18. package/dist/elements/Button/index.js.map +1 -1
  19. package/dist/elements/Button/index.mjs +283 -4
  20. package/dist/elements/Button/index.mjs.map +1 -1
  21. package/dist/elements/ButtonGroup/index.js +229 -56
  22. package/dist/elements/ButtonGroup/index.js.map +1 -1
  23. package/dist/elements/ButtonGroup/index.mjs +222 -3
  24. package/dist/elements/ButtonGroup/index.mjs.map +1 -1
  25. package/dist/elements/Card/Card.d.ts.map +1 -1
  26. package/dist/elements/Card/index.js +563 -67
  27. package/dist/elements/Card/index.js.map +1 -1
  28. package/dist/elements/Card/index.mjs +560 -6
  29. package/dist/elements/Card/index.mjs.map +1 -1
  30. package/dist/elements/Carousel/index.js +782 -14
  31. package/dist/elements/Carousel/index.js.map +1 -1
  32. package/dist/elements/Carousel/index.mjs +786 -8
  33. package/dist/elements/Carousel/index.mjs.map +1 -1
  34. package/dist/elements/Chart/index.js +1833 -36
  35. package/dist/elements/Chart/index.js.map +1 -1
  36. package/dist/elements/Chart/index.mjs +1832 -4
  37. package/dist/elements/Chart/index.mjs.map +1 -1
  38. package/dist/elements/Checkbox/index.js +310 -39
  39. package/dist/elements/Checkbox/index.js.map +1 -1
  40. package/dist/elements/Checkbox/index.mjs +306 -4
  41. package/dist/elements/Checkbox/index.mjs.map +1 -1
  42. package/dist/elements/CheckboxGroup/index.js +445 -59
  43. package/dist/elements/CheckboxGroup/index.js.map +1 -1
  44. package/dist/elements/CheckboxGroup/index.mjs +439 -4
  45. package/dist/elements/CheckboxGroup/index.mjs.map +1 -1
  46. package/dist/elements/DatePicker/index.js +871 -89
  47. package/dist/elements/DatePicker/index.js.map +1 -1
  48. package/dist/elements/DatePicker/index.mjs +853 -4
  49. package/dist/elements/DatePicker/index.mjs.map +1 -1
  50. package/dist/elements/Dropdown/index.js +189 -35
  51. package/dist/elements/Dropdown/index.js.map +1 -1
  52. package/dist/elements/Dropdown/index.mjs +184 -2
  53. package/dist/elements/Dropdown/index.mjs.map +1 -1
  54. package/dist/elements/FileField/index.js +1532 -129
  55. package/dist/elements/FileField/index.js.map +1 -1
  56. package/dist/elements/FileField/index.mjs +1507 -7
  57. package/dist/elements/FileField/index.mjs.map +1 -1
  58. package/dist/elements/FormLayout/index.js +166 -11
  59. package/dist/elements/FormLayout/index.js.map +1 -1
  60. package/dist/elements/FormLayout/index.mjs +167 -2
  61. package/dist/elements/FormLayout/index.mjs.map +1 -1
  62. package/dist/elements/Modal/index.js +228 -46
  63. package/dist/elements/Modal/index.js.map +1 -1
  64. package/dist/elements/Modal/index.mjs +220 -1
  65. package/dist/elements/Modal/index.mjs.map +1 -1
  66. package/dist/elements/NumberField/index.js +659 -48
  67. package/dist/elements/NumberField/index.js.map +1 -1
  68. package/dist/elements/NumberField/index.mjs +654 -6
  69. package/dist/elements/NumberField/index.mjs.map +1 -1
  70. package/dist/elements/OTPInput/index.js +729 -6
  71. package/dist/elements/OTPInput/index.js.map +1 -1
  72. package/dist/elements/OTPInput/index.mjs +732 -2
  73. package/dist/elements/OTPInput/index.mjs.map +1 -1
  74. package/dist/elements/Panel/index.js +326 -27
  75. package/dist/elements/Panel/index.js.map +1 -1
  76. package/dist/elements/Panel/index.mjs +323 -2
  77. package/dist/elements/Panel/index.mjs.map +1 -1
  78. package/dist/elements/Progress/index.js +181 -22
  79. package/dist/elements/Progress/index.js.map +1 -1
  80. package/dist/elements/Progress/index.mjs +181 -3
  81. package/dist/elements/Progress/index.mjs.map +1 -1
  82. package/dist/elements/RadioGroup/index.js +358 -34
  83. package/dist/elements/RadioGroup/index.js.map +1 -1
  84. package/dist/elements/RadioGroup/index.mjs +359 -4
  85. package/dist/elements/RadioGroup/index.mjs.map +1 -1
  86. package/dist/elements/Resizable/components/ResizableHandle.d.ts +0 -8
  87. package/dist/elements/Resizable/components/ResizableHandle.d.ts.map +1 -1
  88. package/dist/elements/Resizable/components/ResizablePanel.d.ts +0 -8
  89. package/dist/elements/Resizable/components/ResizablePanel.d.ts.map +1 -1
  90. package/dist/elements/Resizable/components/ResizablePanelGroup.d.ts +0 -8
  91. package/dist/elements/Resizable/components/ResizablePanelGroup.d.ts.map +1 -1
  92. package/dist/elements/Resizable/components/ResizablePopover.d.ts +0 -8
  93. package/dist/elements/Resizable/components/ResizablePopover.d.ts.map +1 -1
  94. package/dist/elements/Resizable/index.js +1568 -51
  95. package/dist/elements/Resizable/index.js.map +1 -1
  96. package/dist/elements/Resizable/index.mjs +1566 -6
  97. package/dist/elements/Resizable/index.mjs.map +1 -1
  98. package/dist/elements/Select/index.js +580 -22
  99. package/dist/elements/Select/index.js.map +1 -1
  100. package/dist/elements/Select/index.mjs +582 -2
  101. package/dist/elements/Select/index.mjs.map +1 -1
  102. package/dist/elements/Skeleton/index.js +77 -15
  103. package/dist/elements/Skeleton/index.js.map +1 -1
  104. package/dist/elements/Skeleton/index.mjs +78 -3
  105. package/dist/elements/Skeleton/index.mjs.map +1 -1
  106. package/dist/elements/Switch/index.js +153 -21
  107. package/dist/elements/Switch/index.js.map +1 -1
  108. package/dist/elements/Switch/index.mjs +149 -5
  109. package/dist/elements/Switch/index.mjs.map +1 -1
  110. package/dist/elements/Table/index.js +589 -68
  111. package/dist/elements/Table/index.js.map +1 -1
  112. package/dist/elements/Table/index.mjs +578 -5
  113. package/dist/elements/Table/index.mjs.map +1 -1
  114. package/dist/elements/Tabs/index.js +328 -63
  115. package/dist/elements/Tabs/index.js.map +1 -1
  116. package/dist/elements/Tabs/index.mjs +320 -3
  117. package/dist/elements/Tabs/index.mjs.map +1 -1
  118. package/dist/elements/TextField/index.js +695 -51
  119. package/dist/elements/TextField/index.js.map +1 -1
  120. package/dist/elements/TextField/index.mjs +684 -7
  121. package/dist/elements/TextField/index.mjs.map +1 -1
  122. package/dist/elements/TimeField/index.js +244 -33
  123. package/dist/elements/TimeField/index.js.map +1 -1
  124. package/dist/elements/TimeField/index.mjs +238 -2
  125. package/dist/elements/TimeField/index.mjs.map +1 -1
  126. package/dist/elements/Toast/index.js +727 -48
  127. package/dist/elements/Toast/index.js.map +1 -1
  128. package/dist/elements/Toast/index.mjs +724 -5
  129. package/dist/elements/Toast/index.mjs.map +1 -1
  130. package/dist/elements/Tooltip/index.js +315 -49
  131. package/dist/elements/Tooltip/index.js.map +1 -1
  132. package/dist/elements/Tooltip/index.mjs +310 -4
  133. package/dist/elements/Tooltip/index.mjs.map +1 -1
  134. package/dist/elements/index.js +12417 -799
  135. package/dist/elements/index.js.map +1 -1
  136. package/dist/elements/index.mjs +12233 -40
  137. package/dist/elements/index.mjs.map +1 -1
  138. package/dist/index.js +12452 -825
  139. package/dist/index.js.map +1 -1
  140. package/dist/index.mjs +12262 -42
  141. package/dist/index.mjs.map +1 -1
  142. package/dist/schemas/index.js +47 -21
  143. package/dist/schemas/index.js.map +1 -1
  144. package/dist/schemas/index.mjs +47 -2
  145. package/dist/schemas/index.mjs.map +1 -1
  146. package/dist/styles/index.js +161 -147
  147. package/dist/styles/index.js.map +1 -1
  148. package/dist/styles/index.mjs +128 -2
  149. package/dist/styles/index.mjs.map +1 -1
  150. package/dist/utils/index.js +7 -7
  151. package/dist/utils/index.js.map +1 -1
  152. package/dist/utils/index.mjs +9 -2
  153. package/dist/utils/index.mjs.map +1 -1
  154. package/package.json +1 -1
  155. package/dist/Carousel-NTZX5TOW.js +0 -16
  156. package/dist/Carousel-NTZX5TOW.js.map +0 -1
  157. package/dist/Carousel-YH3DOQJU.mjs +0 -7
  158. package/dist/Carousel-YH3DOQJU.mjs.map +0 -1
  159. package/dist/chunk-2HIUTHMU.mjs +0 -234
  160. package/dist/chunk-2HIUTHMU.mjs.map +0 -1
  161. package/dist/chunk-34GTFTDO.js +0 -431
  162. package/dist/chunk-34GTFTDO.js.map +0 -1
  163. package/dist/chunk-3H7ASYR7.js +0 -250
  164. package/dist/chunk-3H7ASYR7.js.map +0 -1
  165. package/dist/chunk-3IEN7JOP.js +0 -316
  166. package/dist/chunk-3IEN7JOP.js.map +0 -1
  167. package/dist/chunk-3JHN4GAL.js +0 -326
  168. package/dist/chunk-3JHN4GAL.js.map +0 -1
  169. package/dist/chunk-3MJPASQU.js +0 -232
  170. package/dist/chunk-3MJPASQU.js.map +0 -1
  171. package/dist/chunk-3XD2JUL3.js +0 -572
  172. package/dist/chunk-3XD2JUL3.js.map +0 -1
  173. package/dist/chunk-3YOY2VJ6.js +0 -189
  174. package/dist/chunk-3YOY2VJ6.js.map +0 -1
  175. package/dist/chunk-4DU5JSXB.js +0 -408
  176. package/dist/chunk-4DU5JSXB.js.map +0 -1
  177. package/dist/chunk-4E4E2GSS.js +0 -352
  178. package/dist/chunk-4E4E2GSS.js.map +0 -1
  179. package/dist/chunk-4NHAP4AN.mjs +0 -3
  180. package/dist/chunk-4NHAP4AN.mjs.map +0 -1
  181. package/dist/chunk-4S33J5NY.mjs +0 -415
  182. package/dist/chunk-4S33J5NY.mjs.map +0 -1
  183. package/dist/chunk-5SMGRT3G.mjs +0 -354
  184. package/dist/chunk-5SMGRT3G.mjs.map +0 -1
  185. package/dist/chunk-5SVLJN2C.mjs +0 -22
  186. package/dist/chunk-5SVLJN2C.mjs.map +0 -1
  187. package/dist/chunk-66WTU4EB.mjs +0 -299
  188. package/dist/chunk-66WTU4EB.mjs.map +0 -1
  189. package/dist/chunk-6S25NMOT.mjs +0 -335
  190. package/dist/chunk-6S25NMOT.mjs.map +0 -1
  191. package/dist/chunk-6SP7UB3D.js +0 -4
  192. package/dist/chunk-6SP7UB3D.js.map +0 -1
  193. package/dist/chunk-6TYWWQHM.mjs +0 -565
  194. package/dist/chunk-6TYWWQHM.mjs.map +0 -1
  195. package/dist/chunk-A3YUJA6W.mjs +0 -384
  196. package/dist/chunk-A3YUJA6W.mjs.map +0 -1
  197. package/dist/chunk-A6KEDVUR.js +0 -61
  198. package/dist/chunk-A6KEDVUR.js.map +0 -1
  199. package/dist/chunk-A77RUEWL.js +0 -730
  200. package/dist/chunk-A77RUEWL.js.map +0 -1
  201. package/dist/chunk-AA4IKMPE.mjs +0 -3
  202. package/dist/chunk-AA4IKMPE.mjs.map +0 -1
  203. package/dist/chunk-AKIA6GW6.mjs +0 -163
  204. package/dist/chunk-AKIA6GW6.mjs.map +0 -1
  205. package/dist/chunk-AL6P275L.mjs +0 -435
  206. package/dist/chunk-AL6P275L.mjs.map +0 -1
  207. package/dist/chunk-AZ3RJYTB.js +0 -37
  208. package/dist/chunk-AZ3RJYTB.js.map +0 -1
  209. package/dist/chunk-B5Q4UPL6.js +0 -32
  210. package/dist/chunk-B5Q4UPL6.js.map +0 -1
  211. package/dist/chunk-B6DHPMDP.mjs +0 -335
  212. package/dist/chunk-B6DHPMDP.mjs.map +0 -1
  213. package/dist/chunk-BDXKKMBZ.mjs +0 -184
  214. package/dist/chunk-BDXKKMBZ.mjs.map +0 -1
  215. package/dist/chunk-BL6E2DLZ.mjs +0 -52
  216. package/dist/chunk-BL6E2DLZ.mjs.map +0 -1
  217. package/dist/chunk-CGFDS4XS.mjs +0 -121
  218. package/dist/chunk-CGFDS4XS.mjs.map +0 -1
  219. package/dist/chunk-CJIW5TKI.js +0 -139
  220. package/dist/chunk-CJIW5TKI.js.map +0 -1
  221. package/dist/chunk-CKNISJOQ.js +0 -314
  222. package/dist/chunk-CKNISJOQ.js.map +0 -1
  223. package/dist/chunk-D6CBOECS.mjs +0 -1757
  224. package/dist/chunk-D6CBOECS.mjs.map +0 -1
  225. package/dist/chunk-DDWEVC2S.js +0 -166
  226. package/dist/chunk-DDWEVC2S.js.map +0 -1
  227. package/dist/chunk-DZ556D2F.mjs +0 -176
  228. package/dist/chunk-DZ556D2F.mjs.map +0 -1
  229. package/dist/chunk-E2KQFV3O.mjs +0 -10
  230. package/dist/chunk-E2KQFV3O.mjs.map +0 -1
  231. package/dist/chunk-EMMLADSC.js +0 -126
  232. package/dist/chunk-EMMLADSC.js.map +0 -1
  233. package/dist/chunk-EP4WOI5D.mjs +0 -926
  234. package/dist/chunk-EP4WOI5D.mjs.map +0 -1
  235. package/dist/chunk-FJRXLJC2.mjs +0 -160
  236. package/dist/chunk-FJRXLJC2.mjs.map +0 -1
  237. package/dist/chunk-FKQI434R.js +0 -345
  238. package/dist/chunk-FKQI434R.js.map +0 -1
  239. package/dist/chunk-FPKEAJRZ.mjs +0 -100
  240. package/dist/chunk-FPKEAJRZ.mjs.map +0 -1
  241. package/dist/chunk-FWQYB22U.js +0 -183
  242. package/dist/chunk-FWQYB22U.js.map +0 -1
  243. package/dist/chunk-GD5GHTMA.js +0 -189
  244. package/dist/chunk-GD5GHTMA.js.map +0 -1
  245. package/dist/chunk-GE5XTSDZ.js +0 -447
  246. package/dist/chunk-GE5XTSDZ.js.map +0 -1
  247. package/dist/chunk-GVE47ZAX.mjs +0 -32
  248. package/dist/chunk-GVE47ZAX.mjs.map +0 -1
  249. package/dist/chunk-HK46BT5U.mjs +0 -18
  250. package/dist/chunk-HK46BT5U.mjs.map +0 -1
  251. package/dist/chunk-HQVRMR6N.js +0 -365
  252. package/dist/chunk-HQVRMR6N.js.map +0 -1
  253. package/dist/chunk-HSGBJPJO.mjs +0 -398
  254. package/dist/chunk-HSGBJPJO.mjs.map +0 -1
  255. package/dist/chunk-I3AUTOMZ.mjs +0 -125
  256. package/dist/chunk-I3AUTOMZ.mjs.map +0 -1
  257. package/dist/chunk-IEI5LD5C.mjs +0 -1161
  258. package/dist/chunk-IEI5LD5C.mjs.map +0 -1
  259. package/dist/chunk-IIPTC2X7.mjs +0 -118
  260. package/dist/chunk-IIPTC2X7.mjs.map +0 -1
  261. package/dist/chunk-J7TLHF2Q.js +0 -4
  262. package/dist/chunk-J7TLHF2Q.js.map +0 -1
  263. package/dist/chunk-JJOWXFXQ.mjs +0 -765
  264. package/dist/chunk-JJOWXFXQ.mjs.map +0 -1
  265. package/dist/chunk-JPTSS2OA.mjs +0 -3
  266. package/dist/chunk-JPTSS2OA.mjs.map +0 -1
  267. package/dist/chunk-KFXXRLTP.js +0 -396
  268. package/dist/chunk-KFXXRLTP.js.map +0 -1
  269. package/dist/chunk-KPRRBSG6.mjs +0 -272
  270. package/dist/chunk-KPRRBSG6.mjs.map +0 -1
  271. package/dist/chunk-NFSBGRDB.mjs +0 -57
  272. package/dist/chunk-NFSBGRDB.mjs.map +0 -1
  273. package/dist/chunk-NGJVCFTM.js +0 -219
  274. package/dist/chunk-NGJVCFTM.js.map +0 -1
  275. package/dist/chunk-NSQ6MZJ6.mjs +0 -728
  276. package/dist/chunk-NSQ6MZJ6.mjs.map +0 -1
  277. package/dist/chunk-NYQYHT76.mjs +0 -296
  278. package/dist/chunk-NYQYHT76.mjs.map +0 -1
  279. package/dist/chunk-OLJJGI5B.js +0 -1193
  280. package/dist/chunk-OLJJGI5B.js.map +0 -1
  281. package/dist/chunk-Q3572X2J.js +0 -292
  282. package/dist/chunk-Q3572X2J.js.map +0 -1
  283. package/dist/chunk-QH7N7D4I.mjs +0 -210
  284. package/dist/chunk-QH7N7D4I.mjs.map +0 -1
  285. package/dist/chunk-R7XUIV25.js +0 -466
  286. package/dist/chunk-R7XUIV25.js.map +0 -1
  287. package/dist/chunk-RFFO4KPM.js +0 -135
  288. package/dist/chunk-RFFO4KPM.js.map +0 -1
  289. package/dist/chunk-RFX7QKA7.mjs +0 -180
  290. package/dist/chunk-RFX7QKA7.mjs.map +0 -1
  291. package/dist/chunk-SN5LFAP3.js +0 -940
  292. package/dist/chunk-SN5LFAP3.js.map +0 -1
  293. package/dist/chunk-T4COXKQ3.js +0 -24
  294. package/dist/chunk-T4COXKQ3.js.map +0 -1
  295. package/dist/chunk-TS54QM27.js +0 -125
  296. package/dist/chunk-TS54QM27.js.map +0 -1
  297. package/dist/chunk-UE2S4PCX.mjs +0 -220
  298. package/dist/chunk-UE2S4PCX.mjs.map +0 -1
  299. package/dist/chunk-UTW3QX2A.mjs +0 -282
  300. package/dist/chunk-UTW3QX2A.mjs.map +0 -1
  301. package/dist/chunk-V74LGMAE.js +0 -1767
  302. package/dist/chunk-V74LGMAE.js.map +0 -1
  303. package/dist/chunk-VIREG536.js +0 -12
  304. package/dist/chunk-VIREG536.js.map +0 -1
  305. package/dist/chunk-VY7M7346.js +0 -4
  306. package/dist/chunk-VY7M7346.js.map +0 -1
  307. package/dist/chunk-W3TJOO7H.mjs +0 -319
  308. package/dist/chunk-W3TJOO7H.mjs.map +0 -1
  309. package/dist/chunk-WIUOB36M.js +0 -54
  310. package/dist/chunk-WIUOB36M.js.map +0 -1
  311. package/dist/chunk-WJGLM4CY.js +0 -291
  312. package/dist/chunk-WJGLM4CY.js.map +0 -1
  313. package/dist/chunk-WNURH5OO.mjs +0 -453
  314. package/dist/chunk-WNURH5OO.mjs.map +0 -1
  315. package/dist/chunk-X25TNRSD.mjs +0 -364
  316. package/dist/chunk-X25TNRSD.mjs.map +0 -1
  317. package/dist/chunk-Y3GT7ETK.js +0 -108
  318. package/dist/chunk-Y3GT7ETK.js.map +0 -1
  319. package/dist/chunk-Z4FRNOF6.mjs +0 -115
  320. package/dist/chunk-Z4FRNOF6.mjs.map +0 -1
  321. package/dist/chunk-ZMYLD3BN.js +0 -166
  322. package/dist/chunk-ZMYLD3BN.js.map +0 -1
  323. package/dist/chunk-ZP2KV6EX.js +0 -815
  324. package/dist/chunk-ZP2KV6EX.js.map +0 -1
  325. package/dist/chunk-ZVKXFELU.js +0 -366
  326. package/dist/chunk-ZVKXFELU.js.map +0 -1
@@ -1,7 +1,726 @@
1
- export { DismissReasonSchema, ToastOptionsSchema, ToastProvider, ToastProviderPropsSchema, ToastVariantSchema, Toaster, ToasterPositionSchema, ToasterPropsSchema, toast, toastQueue, toastVariants, toasterVariants } from '../../chunk-WNURH5OO.mjs';
2
- import '../../chunk-BDXKKMBZ.mjs';
3
- import '../../chunk-FPKEAJRZ.mjs';
4
- import '../../chunk-HK46BT5U.mjs';
5
- import '../../chunk-E2KQFV3O.mjs';
1
+ "use client";
2
+ import { createContext, memo, forwardRef, useId, useRef, useState, useCallback, useSyncExternalStore, useContext, useMemo } from 'react';
3
+ import { useToast, useToastRegion } from 'react-aria';
4
+ import { ToastQueue, useToastQueue } from 'react-stately';
5
+ import { cva } from 'class-variance-authority';
6
+ import { Loader2, Zap, X } from 'lucide-react';
7
+ import { clsx } from 'clsx';
8
+ import { twMerge } from 'tailwind-merge';
9
+ import { Button as Button$1 } from 'react-aria-components';
10
+ import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
11
+ import { z } from 'zod';
12
+
13
+ // src/elements/Toast/Toast.tsx
14
+ function cn(...inputs) {
15
+ return twMerge(clsx(inputs));
16
+ }
17
+ var PRESSED_STYLES = "data-[pressed]:scale-[0.97]";
18
+ var HOVER_STYLES = "data-[hovered]:shadow-md";
19
+ var HIGH_CONTRAST_HOVER = "hc:data-[hovered]:outline hc:data-[hovered]:outline-2 hc:data-[hovered]:outline-foreground";
20
+ var HIGH_CONTRAST_PRESSED = "hc:data-[pressed]:outline hc:data-[pressed]:outline-2 hc:data-[pressed]:outline-offset-1 hc:data-[pressed]:outline-foreground";
21
+ var ButtonGroupContext = createContext(null);
22
+ ButtonGroupContext.displayName = "ButtonGroupContext";
23
+ function useButtonGroupContext() {
24
+ return useContext(ButtonGroupContext);
25
+ }
26
+ var ButtonGroupItemContext = createContext(null);
27
+ ButtonGroupItemContext.displayName = "ButtonGroupItemContext";
28
+ function useButtonGroupItemContext() {
29
+ return useContext(ButtonGroupItemContext);
30
+ }
31
+ cva("inline-flex items-center gap-0", {
32
+ variants: {
33
+ orientation: {
34
+ horizontal: "flex-row",
35
+ vertical: "flex-col w-full"
36
+ }
37
+ },
38
+ defaultVariants: {
39
+ orientation: "horizontal"
40
+ }
41
+ });
42
+ var buttonGroupItemVariants = cva("", {
43
+ variants: {
44
+ orientation: {
45
+ // min-w-[44px] ensures visual layer fills touch target width (for icon buttons)
46
+ horizontal: "min-w-[44px]",
47
+ // flex (overrides inline-flex) + min-h-[44px] makes visual layer fill touch target,
48
+ // eliminating gaps between stacked buttons in vertical orientation
49
+ vertical: "flex min-h-[44px]"
50
+ },
51
+ position: {
52
+ first: "",
53
+ middle: "",
54
+ last: "",
55
+ only: ""
56
+ // Single button - no modifications needed
57
+ }
58
+ },
59
+ compoundVariants: [
60
+ // ==========================================================================
61
+ // Horizontal Orientation
62
+ // ==========================================================================
63
+ {
64
+ orientation: "horizontal",
65
+ position: "first",
66
+ className: "rounded-r-none border-r-0"
67
+ },
68
+ {
69
+ orientation: "horizontal",
70
+ position: "middle",
71
+ className: "rounded-none border-r-0"
72
+ },
73
+ {
74
+ orientation: "horizontal",
75
+ position: "last",
76
+ className: "rounded-l-none"
77
+ },
78
+ // ==========================================================================
79
+ // Vertical Orientation
80
+ // Note: w-full is handled by Button's effectiveFullWidth for both layers
81
+ // ==========================================================================
82
+ {
83
+ orientation: "vertical",
84
+ position: "first",
85
+ className: "rounded-b-none border-b-0"
86
+ },
87
+ {
88
+ orientation: "vertical",
89
+ position: "middle",
90
+ className: "rounded-none border-b-0"
91
+ },
92
+ {
93
+ orientation: "vertical",
94
+ position: "last",
95
+ className: "rounded-t-none"
96
+ }
97
+ ],
98
+ defaultVariants: {
99
+ orientation: "horizontal",
100
+ position: "only"
101
+ }
102
+ });
103
+ cva("bg-[var(--border)]", {
104
+ variants: {
105
+ orientation: {
106
+ horizontal: "w-px h-6 mx-1",
107
+ vertical: "h-px w-full my-1"
108
+ }
109
+ },
110
+ defaultVariants: {
111
+ orientation: "horizontal"
112
+ }
113
+ });
114
+ var buttonOuterVariants = cva(
115
+ "inline-flex justify-center min-h-[44px] min-w-[44px] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--ring)] focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:pointer-events-none disabled:opacity-50",
116
+ {
117
+ variants: {
118
+ fullWidth: {
119
+ true: "w-full",
120
+ false: ""
121
+ },
122
+ inVerticalGroup: {
123
+ true: "items-stretch",
124
+ false: "items-center"
125
+ }
126
+ },
127
+ defaultVariants: {
128
+ fullWidth: false,
129
+ inVerticalGroup: false
130
+ }
131
+ }
132
+ );
133
+ var buttonVisualVariants = cva(
134
+ "inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0 relative cursor-pointer",
135
+ {
136
+ variants: {
137
+ variant: {
138
+ default: "bg-[var(--primary-action)] text-[var(--primary-action-foreground)] shadow-md hover:bg-[var(--primary-action-hover)] data-[pressed]:bg-[var(--primary-action)]/80",
139
+ destructive: "bg-[var(--destructive-background)] text-[var(--destructive-foreground)] shadow-md hover:bg-[var(--destructive-background)]/90 data-[pressed]:bg-[var(--destructive-background)]/80",
140
+ outline: "border border-[var(--input-border)] bg-[var(--page-background)] hover:bg-[var(--input-border)] data-[pressed]:bg-[var(--input-border)]",
141
+ secondary: "bg-[var(--secondary)] text-[var(--secondary-foreground)] shadow-md hover:bg-[var(--secondary)]/80 data-[pressed]:bg-[var(--secondary)]/70",
142
+ ghost: "hover:bg-[var(--accent)] hover:text-[var(--accent-foreground)] data-[pressed]:bg-[var(--accent)]",
143
+ link: "text-[var(--text-link)] underline-offset-4 hover:underline data-[pressed]:text-[var(--text-link-hover)]"
144
+ },
145
+ fullWidth: {
146
+ true: "w-full",
147
+ false: ""
148
+ },
149
+ visualSize: {
150
+ default: "h-10 px-4 py-2",
151
+ sm: "h-9 rounded-md px-3 text-xs",
152
+ lg: "h-11 rounded-md px-8",
153
+ icon: "h-10 w-10",
154
+ dot: "h-5 w-5 rounded-full p-0 min-h-0 min-w-0"
155
+ },
156
+ paywall: {
157
+ true: "!bg-[var(--paywall)] !text-[var(--paywall-foreground)] !shadow-md hover:!bg-[var(--paywall)]/90 !cursor-not-allowed !border-transparent",
158
+ false: ""
159
+ }
160
+ },
161
+ defaultVariants: {
162
+ variant: "default",
163
+ visualSize: "default",
164
+ paywall: false
165
+ }
166
+ }
167
+ );
168
+ var Button = memo(forwardRef(
169
+ ({
170
+ className,
171
+ buttonVisualClassName,
172
+ variant,
173
+ size,
174
+ visualSize,
175
+ fullWidth,
176
+ loading = false,
177
+ loadingText = "Loading...",
178
+ shortcut,
179
+ children,
180
+ isDisabled,
181
+ paywall = false,
182
+ paywallRedirect,
183
+ paywallDescription,
184
+ onPress,
185
+ ...props
186
+ }, ref) => {
187
+ const paywallDescriptionId = useId();
188
+ const groupContext = useButtonGroupContext();
189
+ const itemContext = useButtonGroupItemContext();
190
+ const effectiveVariant = variant ?? groupContext?.variant ?? "default";
191
+ const effectiveSize = size ?? groupContext?.size;
192
+ const effectiveIsDisabled = isDisabled ?? groupContext?.isDisabled ?? false;
193
+ const isInVerticalGroup = groupContext?.orientation === "vertical";
194
+ const effectiveFullWidth = fullWidth || isInVerticalGroup;
195
+ const positionClassName = itemContext ? buttonGroupItemVariants({
196
+ orientation: groupContext?.orientation ?? "horizontal",
197
+ position: itemContext.position
198
+ }) : "";
199
+ const effectiveVisualSize = visualSize ?? effectiveSize ?? "default";
200
+ if (process.env.NODE_ENV !== "production") {
201
+ if ((effectiveVisualSize === "dot" || effectiveVisualSize === "icon") && !props["aria-label"] && !children) {
202
+ console.warn(
203
+ '[Button] visualSize="dot" or "icon" requires aria-label when no visible text is provided (WCAG 1.1.1)'
204
+ );
205
+ }
206
+ }
207
+ const handlePress = (e) => {
208
+ if (paywall) {
209
+ if (paywallRedirect) {
210
+ window.open(paywallRedirect, "_blank", "noopener,noreferrer");
211
+ }
212
+ return;
213
+ }
214
+ onPress?.(e);
215
+ };
216
+ const computedIsDisabled = effectiveIsDisabled || loading || void 0;
217
+ return /* @__PURE__ */ jsx(
218
+ Button$1,
219
+ {
220
+ ref,
221
+ isDisabled: computedIsDisabled,
222
+ "aria-disabled": paywall ? true : void 0,
223
+ "aria-describedby": paywall ? paywallDescriptionId : void 0,
224
+ onPress: handlePress,
225
+ className: cn(buttonOuterVariants({ fullWidth: effectiveFullWidth, inVerticalGroup: isInVerticalGroup }), className),
226
+ ...props,
227
+ children: (renderProps) => (
228
+ /* Layer 2: Visual Button */
229
+ /* @__PURE__ */ jsxs(
230
+ "span",
231
+ {
232
+ className: cn(
233
+ buttonVisualVariants({
234
+ variant: effectiveVariant,
235
+ visualSize: effectiveVisualSize,
236
+ paywall,
237
+ fullWidth: effectiveFullWidth
238
+ }),
239
+ // Position styling from ButtonGroup context (border-radius adjustments)
240
+ positionClassName,
241
+ buttonVisualClassName,
242
+ // Layer 2 interaction styles (no focus - focus ring is on Layer 1)
243
+ PRESSED_STYLES,
244
+ HOVER_STYLES,
245
+ HIGH_CONTRAST_HOVER,
246
+ HIGH_CONTRAST_PRESSED
247
+ ),
248
+ "data-pressed": renderProps.isPressed || void 0,
249
+ children: [
250
+ loading && /* @__PURE__ */ jsxs(Fragment, { children: [
251
+ /* @__PURE__ */ jsx(Loader2, { className: "motion-safe:animate-spin", "aria-hidden": "true" }),
252
+ /* @__PURE__ */ jsx("span", { className: "sr-only", "aria-live": "polite", children: loadingText })
253
+ ] }),
254
+ !loading && children,
255
+ paywall && /* @__PURE__ */ jsx(
256
+ Zap,
257
+ {
258
+ "data-testid": "zap-icon",
259
+ "aria-hidden": "true",
260
+ className: "ml-1"
261
+ }
262
+ ),
263
+ paywall && /* @__PURE__ */ jsxs("span", { id: paywallDescriptionId, className: "sr-only", children: [
264
+ "Premium feature: ",
265
+ paywallDescription || "Upgrade required to access this feature"
266
+ ] }),
267
+ renderProps.isFocusVisible && shortcut && /* @__PURE__ */ jsx("kbd", { className: "ml-auto hidden text-xs opacity-60 lg:inline", children: shortcut }),
268
+ renderProps.isPressed && /* @__PURE__ */ jsx(
269
+ "span",
270
+ {
271
+ className: "absolute inset-0 rounded-[inherit] bg-current opacity-10 motion-safe:animate-in motion-safe:zoom-in-95",
272
+ "aria-hidden": "true"
273
+ }
274
+ )
275
+ ]
276
+ }
277
+ )
278
+ )
279
+ }
280
+ );
281
+ }
282
+ ));
283
+ Button.displayName = "Button";
284
+ var DismissReasonSchema = z.enum(["timeout", "user", "programmatic"]);
285
+ var ToastVariantSchema = z.enum([
286
+ "default",
287
+ "primary",
288
+ "destructive",
289
+ "accent"
290
+ ]);
291
+ var ToasterPositionSchema = z.enum([
292
+ "top-left",
293
+ "top-center",
294
+ "top-right",
295
+ "bottom-left",
296
+ "bottom-center",
297
+ "bottom-right"
298
+ ]);
299
+ var ToastOptionsSchema = z.object({
300
+ /**
301
+ * Visual variant determining background and foreground colors
302
+ * @default 'default'
303
+ */
304
+ variant: ToastVariantSchema.default("default"),
305
+ /**
306
+ * Auto-dismiss timeout in milliseconds
307
+ * - Values 1-4999ms are clamped to 5000ms (WCAG 2.2 timing requirement)
308
+ * - Set to 0 for persistent toasts (no auto-dismiss)
309
+ * @default 5000
310
+ */
311
+ timeout: z.number().min(0).default(5e3),
312
+ /**
313
+ * Callback fired when toast is dismissed
314
+ * @param key - Unique identifier of the toast
315
+ * @param reason - Why the toast was dismissed ('timeout' | 'user' | 'programmatic')
316
+ */
317
+ onClose: z.function().optional()
318
+ });
319
+ var ToastProviderPropsSchema = z.object({
320
+ /**
321
+ * Maximum number of toasts visible at once
322
+ * Additional toasts are queued and shown as others dismiss
323
+ * @default 3
324
+ */
325
+ maxVisibleToasts: z.number().min(1).default(3)
326
+ });
327
+ var ToasterPropsSchema = z.object({
328
+ /**
329
+ * Position of the toast region on screen
330
+ * @default 'bottom-right'
331
+ */
332
+ position: ToasterPositionSchema.default("bottom-right"),
333
+ /**
334
+ * Accessible label for the toast region landmark
335
+ * Used by screen readers to identify the notification area
336
+ * @default 'Notifications'
337
+ */
338
+ "aria-label": z.string().default("Notifications"),
339
+ /**
340
+ * Additional CSS classes for the toast region
341
+ */
342
+ className: z.string().optional()
343
+ });
344
+ var toastVariants = cva(
345
+ [
346
+ // Fixed width for consistent appearance
347
+ "pointer-events-auto relative flex w-[356px] items-center justify-between",
348
+ "space-x-4 overflow-hidden rounded-lg border p-4 pr-12 shadow-lg",
349
+ // Animations with reduced-motion support
350
+ "transition-all duration-300",
351
+ "motion-reduce:transition-none motion-reduce:animate-none",
352
+ "data-[entering]:animate-in data-[entering]:slide-in-from-left",
353
+ "data-[exiting]:animate-out data-[exiting]:slide-out-to-right-full",
354
+ "data-[exiting]:fade-out-80",
355
+ // Touch interaction for swipe
356
+ "touch-pan-y"
357
+ ],
358
+ {
359
+ variants: {
360
+ variant: {
361
+ default: [
362
+ "bg-[var(--content-background)]",
363
+ "text-[var(--content-foreground)]",
364
+ "border-[var(--border)]"
365
+ ],
366
+ primary: [
367
+ "bg-[var(--primary)]",
368
+ "text-[var(--primary-foreground)]",
369
+ "border-[var(--primary)]"
370
+ ],
371
+ destructive: [
372
+ "bg-[var(--destructive-background)]",
373
+ "text-[var(--destructive-foreground)]",
374
+ "border-[var(--destructive-background)]"
375
+ ],
376
+ accent: [
377
+ "bg-[var(--accent-background)]",
378
+ "text-[var(--accent-foreground)]",
379
+ "border-[var(--accent-background)]"
380
+ ]
381
+ }
382
+ },
383
+ defaultVariants: {
384
+ variant: "default"
385
+ }
386
+ }
387
+ );
388
+ var toasterVariants = cva(
389
+ [
390
+ "fixed z-50 flex flex-col gap-2 p-4",
391
+ "pointer-events-none",
392
+ "max-h-screen overflow-hidden"
393
+ ],
394
+ {
395
+ variants: {
396
+ position: {
397
+ "top-left": "top-0 left-0 items-start",
398
+ "top-center": "top-0 left-1/2 -translate-x-1/2 items-center",
399
+ "top-right": "top-0 right-0 items-end",
400
+ "bottom-left": "bottom-0 left-0 items-start",
401
+ "bottom-center": "bottom-0 left-1/2 -translate-x-1/2 items-center",
402
+ "bottom-right": "bottom-0 right-0 items-end"
403
+ }
404
+ },
405
+ defaultVariants: {
406
+ position: "bottom-right"
407
+ }
408
+ }
409
+ );
410
+ var CloseButton = memo(
411
+ forwardRef(
412
+ ({ variant = "default", className, onPress }, ref) => {
413
+ const hoverStyles = variant === "default" ? "hover:bg-[var(--accent-background)]/20" : "hover:bg-white/20";
414
+ return /* @__PURE__ */ jsx(
415
+ Button,
416
+ {
417
+ ref,
418
+ variant: "ghost",
419
+ visualSize: "icon",
420
+ onPress,
421
+ className: cn(
422
+ "absolute right-2 top-2",
423
+ hoverStyles,
424
+ className
425
+ ),
426
+ "aria-label": "Dismiss notification",
427
+ children: /* @__PURE__ */ jsx(X, { className: "h-4 w-4", "aria-hidden": "true" })
428
+ }
429
+ );
430
+ }
431
+ )
432
+ );
433
+ CloseButton.displayName = "CloseButton";
434
+ var internalQueue = new ToastQueue({
435
+ maxVisibleToasts: 3
436
+ });
437
+ var totalActiveToasts = 0;
438
+ var toastCountListeners = /* @__PURE__ */ new Set();
439
+ function incrementTotalToasts() {
440
+ totalActiveToasts++;
441
+ toastCountListeners.forEach((fn) => fn());
442
+ }
443
+ function decrementTotalToasts() {
444
+ totalActiveToasts = Math.max(0, totalActiveToasts - 1);
445
+ toastCountListeners.forEach((fn) => fn());
446
+ }
447
+ function getTotalActiveToasts() {
448
+ return totalActiveToasts;
449
+ }
450
+ function subscribeToTotalCount(fn) {
451
+ toastCountListeners.add(fn);
452
+ return () => toastCountListeners.delete(fn);
453
+ }
454
+ var toastQueue = {
455
+ /**
456
+ * Add a toast to the queue
457
+ */
458
+ add: (content, options) => internalQueue.add(content, options),
459
+ /**
460
+ * Close a specific toast by key
461
+ */
462
+ close: (key) => {
463
+ internalQueue.close(key);
464
+ },
465
+ /**
466
+ * Close all toasts (visible and queued)
467
+ */
468
+ closeAll: () => {
469
+ internalQueue.visibleToasts.forEach((toast2) => {
470
+ internalQueue.close(toast2.key);
471
+ });
472
+ },
473
+ /**
474
+ * Pause all toast timers
475
+ */
476
+ pauseAll: () => {
477
+ internalQueue.pauseAll();
478
+ },
479
+ /**
480
+ * Resume all toast timers
481
+ */
482
+ resumeAll: () => {
483
+ internalQueue.resumeAll();
484
+ },
485
+ /**
486
+ * Get the visible toasts
487
+ */
488
+ get visibleToasts() {
489
+ return internalQueue.visibleToasts;
490
+ },
491
+ /**
492
+ * Subscribe to queue changes
493
+ */
494
+ subscribe: (fn) => internalQueue.subscribe(fn),
495
+ /**
496
+ * Get total active toasts (visible + queued)
497
+ */
498
+ get totalCount() {
499
+ return totalActiveToasts;
500
+ }
501
+ };
502
+ function getInternalQueue() {
503
+ return internalQueue;
504
+ }
505
+ function enforceMinTimeout(timeout) {
506
+ if (timeout === 0) return 0;
507
+ return Math.max(timeout, 5e3);
508
+ }
509
+ function toast(content, options) {
510
+ const validated = ToastOptionsSchema.parse(options ?? {});
511
+ const timeout = enforceMinTimeout(validated.timeout);
512
+ const dismissReason = "timeout";
513
+ incrementTotalToasts();
514
+ const key = toastQueue.add(
515
+ {
516
+ key: "",
517
+ // Will be set by queue
518
+ content,
519
+ variant: validated.variant,
520
+ timeout,
521
+ onClose: validated.onClose
522
+ },
523
+ {
524
+ timeout,
525
+ onClose: () => {
526
+ decrementTotalToasts();
527
+ if (validated.onClose) {
528
+ validated.onClose(
529
+ key,
530
+ dismissReason
531
+ );
532
+ }
533
+ }
534
+ }
535
+ );
536
+ return key;
537
+ }
538
+ var ToastItem = memo(
539
+ forwardRef(({ toast: toast2, state }, forwardedRef) => {
540
+ const internalRef = useRef(null);
541
+ const ref = forwardedRef || internalRef;
542
+ const { toastProps, contentProps } = useToast(
543
+ { toast: toast2 },
544
+ state,
545
+ ref
546
+ );
547
+ const [touchStart, setTouchStart] = useState(null);
548
+ const [translateX, setTranslateX] = useState(0);
549
+ const SWIPE_THRESHOLD = 50;
550
+ const handleTouchStart = useCallback((e) => {
551
+ const touch = e.touches[0];
552
+ if (touch) {
553
+ setTouchStart(touch.clientX);
554
+ }
555
+ }, []);
556
+ const handleTouchMove = useCallback(
557
+ (e) => {
558
+ if (touchStart === null) return;
559
+ const touch = e.touches[0];
560
+ if (!touch) return;
561
+ const diff = touch.clientX - touchStart;
562
+ if (diff > 0) {
563
+ setTranslateX(diff);
564
+ }
565
+ },
566
+ [touchStart]
567
+ );
568
+ const handleTouchEnd = useCallback(() => {
569
+ if (translateX > SWIPE_THRESHOLD) {
570
+ state.close(toast2.key);
571
+ }
572
+ setTranslateX(0);
573
+ setTouchStart(null);
574
+ }, [translateX, state, toast2.key]);
575
+ const handleCloseClick = useCallback(() => {
576
+ state.close(toast2.key);
577
+ }, [state, toast2.key]);
578
+ const { content } = toast2;
579
+ const variant = content.variant ?? "default";
580
+ const accessibleName = typeof content.content === "string" ? content.content : "Notification";
581
+ return /* @__PURE__ */ jsxs(
582
+ "div",
583
+ {
584
+ ...toastProps,
585
+ ref,
586
+ className: cn(toastVariants({ variant })),
587
+ "aria-label": accessibleName,
588
+ style: {
589
+ transform: translateX > 0 ? `translateX(${translateX}px)` : void 0,
590
+ opacity: translateX > 0 ? 1 - translateX / 200 : void 0
591
+ },
592
+ onTouchStart: handleTouchStart,
593
+ onTouchMove: handleTouchMove,
594
+ onTouchEnd: handleTouchEnd,
595
+ children: [
596
+ /* @__PURE__ */ jsx("div", { ...contentProps, className: "flex-1 min-w-0", children: typeof content.content === "string" ? /* @__PURE__ */ jsx("p", { className: "text-sm font-medium", children: content.content }) : content.content }),
597
+ /* @__PURE__ */ jsx(
598
+ CloseButton,
599
+ {
600
+ variant,
601
+ onPress: handleCloseClick
602
+ }
603
+ )
604
+ ]
605
+ }
606
+ );
607
+ })
608
+ );
609
+ ToastItem.displayName = "ToastItem";
610
+ var ToastContext = createContext(null);
611
+ function ToastProvider({
612
+ children,
613
+ maxVisibleToasts = 3
614
+ }) {
615
+ ToastProviderPropsSchema.parse({ maxVisibleToasts });
616
+ const queue = useMemo(() => {
617
+ return getInternalQueue();
618
+ }, []);
619
+ return /* @__PURE__ */ jsx(ToastContext.Provider, { value: queue, children });
620
+ }
621
+ ToastProvider.displayName = "ToastProvider";
622
+ function StackedToastIndicator({ queuedCount }) {
623
+ if (queuedCount <= 0) return null;
624
+ const stackLayers = Math.min(queuedCount, 2);
625
+ return /* @__PURE__ */ jsxs("div", { className: "relative w-[356px] pointer-events-none", "aria-hidden": "true", children: [
626
+ /* @__PURE__ */ jsx(
627
+ "div",
628
+ {
629
+ className: cn(
630
+ "absolute left-1/2 -translate-x-1/2 w-[340px] h-4 rounded-lg shadow-lg",
631
+ "bg-[var(--content-background)] border border-[var(--border)]",
632
+ "opacity-60",
633
+ "transition-all duration-200"
634
+ ),
635
+ style: { top: 0 }
636
+ }
637
+ ),
638
+ stackLayers >= 2 && /* @__PURE__ */ jsx(
639
+ "div",
640
+ {
641
+ className: cn(
642
+ "absolute left-1/2 -translate-x-1/2 w-[324px] h-2 rounded-b-lg shadow-lg",
643
+ "bg-[var(--content-background)] border border-t-0 border-[var(--border)]",
644
+ "opacity-40",
645
+ "transition-all duration-200"
646
+ ),
647
+ style: { top: 14 }
648
+ }
649
+ ),
650
+ /* @__PURE__ */ jsx("div", { className: "h-4" }),
651
+ /* @__PURE__ */ jsxs(
652
+ "div",
653
+ {
654
+ className: "text-sm text-[var(--content-foreground)] opacity-70 text-center py-2 pointer-events-auto",
655
+ "aria-live": "polite",
656
+ children: [
657
+ "+",
658
+ queuedCount,
659
+ " more notification",
660
+ queuedCount > 1 ? "s" : ""
661
+ ]
662
+ }
663
+ )
664
+ ] });
665
+ }
666
+ var Toaster = memo(
667
+ forwardRef((props, forwardedRef) => {
668
+ const validated = ToasterPropsSchema.parse(props);
669
+ const {
670
+ position = "bottom-right",
671
+ "aria-label": ariaLabel = "Notifications",
672
+ className
673
+ } = validated;
674
+ const internalRef = useRef(null);
675
+ const ref = forwardedRef || internalRef;
676
+ const internalQueueRef = getInternalQueue();
677
+ const state = useToastQueue(internalQueueRef);
678
+ const totalCount = useSyncExternalStore(
679
+ subscribeToTotalCount,
680
+ getTotalActiveToasts,
681
+ getTotalActiveToasts
682
+ );
683
+ const { regionProps } = useToastRegion(
684
+ { "aria-label": ariaLabel },
685
+ state,
686
+ ref
687
+ );
688
+ const queuedCount = Math.max(0, totalCount - state.visibleToasts.length);
689
+ const handleClearAll = useCallback(() => {
690
+ state.visibleToasts.forEach((toast2) => {
691
+ state.close(toast2.key);
692
+ });
693
+ }, [state]);
694
+ if (state.visibleToasts.length === 0) {
695
+ return null;
696
+ }
697
+ return /* @__PURE__ */ jsxs(
698
+ "div",
699
+ {
700
+ ...regionProps,
701
+ ref,
702
+ className: cn(toasterVariants({ position }), className),
703
+ children: [
704
+ state.visibleToasts.map((toast2) => /* @__PURE__ */ jsx(ToastItem, { toast: toast2, state }, toast2.key)),
705
+ /* @__PURE__ */ jsx(StackedToastIndicator, { queuedCount }),
706
+ state.visibleToasts.length >= 2 && /* @__PURE__ */ jsx(
707
+ Button,
708
+ {
709
+ variant: "secondary",
710
+ visualSize: "sm",
711
+ onPress: handleClearAll,
712
+ "aria-label": "Clear all notifications",
713
+ className: "mt-2 pointer-events-auto",
714
+ children: "Clear All"
715
+ }
716
+ )
717
+ ]
718
+ }
719
+ );
720
+ })
721
+ );
722
+ Toaster.displayName = "Toaster";
723
+
724
+ export { DismissReasonSchema, ToastOptionsSchema, ToastProvider, ToastProviderPropsSchema, ToastVariantSchema, Toaster, ToasterPositionSchema, ToasterPropsSchema, toast, toastQueue, toastVariants, toasterVariants };
6
725
  //# sourceMappingURL=index.mjs.map
7
726
  //# sourceMappingURL=index.mjs.map