@constructive-io/ui 0.6.0 → 0.6.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 (414) hide show
  1. package/dist/button-D4vqTxhp.d.cts +20 -0
  2. package/dist/button-D4vqTxhp.d.ts +20 -0
  3. package/dist/components/alert-dialog.cjs +98 -302
  4. package/dist/components/alert-dialog.cjs.map +1 -1
  5. package/dist/components/alert-dialog.d.cts +22 -21
  6. package/dist/components/alert-dialog.d.ts +22 -21
  7. package/dist/components/alert-dialog.js +96 -281
  8. package/dist/components/alert-dialog.js.map +1 -1
  9. package/dist/components/alert.cjs +51 -108
  10. package/dist/components/alert.cjs.map +1 -1
  11. package/dist/components/alert.d.cts +13 -13
  12. package/dist/components/alert.d.ts +13 -13
  13. package/dist/components/alert.js +49 -87
  14. package/dist/components/alert.js.map +1 -1
  15. package/dist/components/app-bar.cjs +73 -359
  16. package/dist/components/app-bar.cjs.map +1 -1
  17. package/dist/components/app-bar.d.cts +21 -20
  18. package/dist/components/app-bar.d.ts +21 -20
  19. package/dist/components/app-bar.js +71 -338
  20. package/dist/components/app-bar.js.map +1 -1
  21. package/dist/components/app-shell.cjs +252 -1777
  22. package/dist/components/app-shell.cjs.map +1 -1
  23. package/dist/components/app-shell.d.cts +77 -85
  24. package/dist/components/app-shell.d.ts +77 -85
  25. package/dist/components/app-shell.js +249 -1756
  26. package/dist/components/app-shell.js.map +1 -1
  27. package/dist/components/autocomplete.cjs +146 -397
  28. package/dist/components/autocomplete.cjs.map +1 -1
  29. package/dist/components/autocomplete.d.cts +24 -24
  30. package/dist/components/autocomplete.d.ts +24 -24
  31. package/dist/components/autocomplete.js +146 -376
  32. package/dist/components/autocomplete.js.map +1 -1
  33. package/dist/components/avatar.cjs +26 -38
  34. package/dist/components/avatar.cjs.map +1 -1
  35. package/dist/components/avatar.d.cts +11 -10
  36. package/dist/components/avatar.d.ts +11 -10
  37. package/dist/components/avatar.js +24 -37
  38. package/dist/components/avatar.js.map +1 -1
  39. package/dist/components/badge.cjs +42 -60
  40. package/dist/components/badge.cjs.map +1 -1
  41. package/dist/components/badge.d.cts +13 -13
  42. package/dist/components/badge.d.ts +13 -13
  43. package/dist/components/badge.js +39 -38
  44. package/dist/components/badge.js.map +1 -1
  45. package/dist/components/breadcrumb.cjs +65 -94
  46. package/dist/components/breadcrumb.cjs.map +1 -1
  47. package/dist/components/breadcrumb.d.cts +14 -13
  48. package/dist/components/breadcrumb.d.ts +14 -13
  49. package/dist/components/breadcrumb.js +63 -73
  50. package/dist/components/breadcrumb.js.map +1 -1
  51. package/dist/components/button.cjs +68 -162
  52. package/dist/components/button.cjs.map +1 -1
  53. package/dist/components/button.d.cts +2 -20
  54. package/dist/components/button.d.ts +2 -20
  55. package/dist/components/button.js +65 -140
  56. package/dist/components/button.js.map +1 -1
  57. package/dist/components/calendar-rac.cjs +49 -62
  58. package/dist/components/calendar-rac.cjs.map +1 -1
  59. package/dist/components/calendar-rac.d.cts +8 -8
  60. package/dist/components/calendar-rac.d.ts +8 -8
  61. package/dist/components/calendar-rac.js +49 -61
  62. package/dist/components/calendar-rac.js.map +1 -1
  63. package/dist/components/card.cjs +61 -74
  64. package/dist/components/card.cjs.map +1 -1
  65. package/dist/components/card.d.cts +15 -16
  66. package/dist/components/card.d.ts +15 -16
  67. package/dist/components/card.js +58 -72
  68. package/dist/components/card.js.map +1 -1
  69. package/dist/components/checkbox-group.cjs +12 -11
  70. package/dist/components/checkbox-group.cjs.map +1 -1
  71. package/dist/components/checkbox-group.d.cts +5 -5
  72. package/dist/components/checkbox-group.d.ts +5 -5
  73. package/dist/components/checkbox-group.js +12 -10
  74. package/dist/components/checkbox-group.js.map +1 -1
  75. package/dist/components/checkbox.cjs +60 -114
  76. package/dist/components/checkbox.cjs.map +1 -1
  77. package/dist/components/checkbox.d.cts +6 -6
  78. package/dist/components/checkbox.d.ts +6 -6
  79. package/dist/components/checkbox.js +58 -93
  80. package/dist/components/checkbox.js.map +1 -1
  81. package/dist/components/collapsible.cjs +76 -113
  82. package/dist/components/collapsible.cjs.map +1 -1
  83. package/dist/components/collapsible.d.cts +16 -15
  84. package/dist/components/collapsible.d.ts +16 -15
  85. package/dist/components/collapsible.js +74 -92
  86. package/dist/components/collapsible.js.map +1 -1
  87. package/dist/components/combobox.cjs +213 -507
  88. package/dist/components/combobox.cjs.map +1 -1
  89. package/dist/components/combobox.d.cts +36 -35
  90. package/dist/components/combobox.d.ts +36 -35
  91. package/dist/components/combobox.js +229 -504
  92. package/dist/components/combobox.js.map +1 -1
  93. package/dist/components/command.cjs +102 -199
  94. package/dist/components/command.cjs.map +1 -1
  95. package/dist/components/command.d.cts +22 -21
  96. package/dist/components/command.d.ts +22 -21
  97. package/dist/components/command.js +100 -198
  98. package/dist/components/command.js.map +1 -1
  99. package/dist/components/dialog.cjs +110 -402
  100. package/dist/components/dialog.cjs.map +1 -1
  101. package/dist/components/dialog.d.cts +27 -26
  102. package/dist/components/dialog.d.ts +27 -26
  103. package/dist/components/dialog.js +107 -380
  104. package/dist/components/dialog.js.map +1 -1
  105. package/dist/components/dock.cjs +80 -111
  106. package/dist/components/dock.cjs.map +1 -1
  107. package/dist/components/dock.d.cts +25 -25
  108. package/dist/components/dock.d.ts +25 -25
  109. package/dist/components/dock.js +78 -106
  110. package/dist/components/dock.js.map +1 -1
  111. package/dist/components/drawer.cjs +77 -111
  112. package/dist/components/drawer.cjs.map +1 -1
  113. package/dist/components/drawer.d.cts +15 -14
  114. package/dist/components/drawer.d.ts +15 -14
  115. package/dist/components/drawer.js +75 -90
  116. package/dist/components/drawer.js.map +1 -1
  117. package/dist/components/dropdown-menu.cjs +163 -238
  118. package/dist/components/dropdown-menu.cjs.map +1 -1
  119. package/dist/components/dropdown-menu.d.cts +44 -43
  120. package/dist/components/dropdown-menu.d.ts +44 -43
  121. package/dist/components/dropdown-menu.js +161 -217
  122. package/dist/components/dropdown-menu.js.map +1 -1
  123. package/dist/components/empty.cjs +51 -85
  124. package/dist/components/empty.cjs.map +1 -1
  125. package/dist/components/empty.d.cts +13 -13
  126. package/dist/components/empty.d.ts +13 -13
  127. package/dist/components/empty.js +48 -83
  128. package/dist/components/empty.js.map +1 -1
  129. package/dist/components/field.cjs +150 -259
  130. package/dist/components/field.cjs.map +1 -1
  131. package/dist/components/field.d.cts +39 -39
  132. package/dist/components/field.d.ts +39 -39
  133. package/dist/components/field.js +148 -238
  134. package/dist/components/field.js.map +1 -1
  135. package/dist/components/flickering-grid.cjs +143 -166
  136. package/dist/components/flickering-grid.cjs.map +1 -1
  137. package/dist/components/flickering-grid.d.cts +14 -13
  138. package/dist/components/flickering-grid.d.ts +14 -13
  139. package/dist/components/flickering-grid.js +141 -161
  140. package/dist/components/flickering-grid.js.map +1 -1
  141. package/dist/components/flow-zoom-panel.cjs +56 -188
  142. package/dist/components/flow-zoom-panel.cjs.map +1 -1
  143. package/dist/components/flow-zoom-panel.d.cts +9 -9
  144. package/dist/components/flow-zoom-panel.d.ts +9 -9
  145. package/dist/components/flow-zoom-panel.js +56 -168
  146. package/dist/components/flow-zoom-panel.js.map +1 -1
  147. package/dist/components/form-control.cjs +58 -186
  148. package/dist/components/form-control.cjs.map +1 -1
  149. package/dist/components/form-control.d.cts +11 -10
  150. package/dist/components/form-control.d.ts +11 -10
  151. package/dist/components/form-control.js +56 -165
  152. package/dist/components/form-control.js.map +1 -1
  153. package/dist/components/form.cjs +78 -184
  154. package/dist/components/form.cjs.map +1 -1
  155. package/dist/components/form.d.cts +2 -36
  156. package/dist/components/form.d.ts +2 -36
  157. package/dist/components/form.js +76 -163
  158. package/dist/components/form.js.map +1 -1
  159. package/dist/components/input-group.cjs +51 -165
  160. package/dist/components/input-group.cjs.map +1 -1
  161. package/dist/components/input-group.d.cts +14 -15
  162. package/dist/components/input-group.d.ts +14 -15
  163. package/dist/components/input-group.js +51 -164
  164. package/dist/components/input-group.js.map +1 -1
  165. package/dist/components/input.cjs +30 -55
  166. package/dist/components/input.cjs.map +1 -1
  167. package/dist/components/input.d.cts +2 -10
  168. package/dist/components/input.d.ts +2 -10
  169. package/dist/components/input.js +30 -54
  170. package/dist/components/input.js.map +1 -1
  171. package/dist/components/json-input.cjs +133 -337
  172. package/dist/components/json-input.cjs.map +1 -1
  173. package/dist/components/json-input.d.cts +20 -19
  174. package/dist/components/json-input.d.ts +20 -19
  175. package/dist/components/json-input.js +132 -317
  176. package/dist/components/json-input.js.map +1 -1
  177. package/dist/components/label.cjs +19 -21
  178. package/dist/components/label.cjs.map +1 -1
  179. package/dist/components/label.d.cts +6 -5
  180. package/dist/components/label.d.ts +6 -5
  181. package/dist/components/label.js +17 -20
  182. package/dist/components/label.js.map +1 -1
  183. package/dist/components/motion-grid.cjs +61 -101
  184. package/dist/components/motion-grid.cjs.map +1 -1
  185. package/dist/components/motion-grid.d.cts +15 -14
  186. package/dist/components/motion-grid.d.ts +15 -14
  187. package/dist/components/motion-grid.js +59 -80
  188. package/dist/components/motion-grid.js.map +1 -1
  189. package/dist/components/multi-select.cjs +563 -786
  190. package/dist/components/multi-select.cjs.map +1 -1
  191. package/dist/components/multi-select.d.cts +173 -173
  192. package/dist/components/multi-select.d.ts +173 -173
  193. package/dist/components/multi-select.js +561 -765
  194. package/dist/components/multi-select.js.map +1 -1
  195. package/dist/components/page-header.cjs +24 -13
  196. package/dist/components/page-header.cjs.map +1 -1
  197. package/dist/components/page-header.d.cts +11 -11
  198. package/dist/components/page-header.d.ts +11 -11
  199. package/dist/components/page-header.js +23 -11
  200. package/dist/components/page-header.js.map +1 -1
  201. package/dist/components/pagination.cjs +72 -272
  202. package/dist/components/pagination.cjs.map +1 -1
  203. package/dist/components/pagination.d.cts +15 -16
  204. package/dist/components/pagination.d.ts +15 -16
  205. package/dist/components/pagination.js +69 -250
  206. package/dist/components/pagination.js.map +1 -1
  207. package/dist/components/popover.cjs +68 -111
  208. package/dist/components/popover.cjs.map +1 -1
  209. package/dist/components/popover.d.cts +31 -30
  210. package/dist/components/popover.d.ts +31 -30
  211. package/dist/components/popover.js +66 -90
  212. package/dist/components/popover.js.map +1 -1
  213. package/dist/components/portal.cjs +128 -81
  214. package/dist/components/portal.cjs.map +1 -1
  215. package/dist/components/portal.d.cts +24 -23
  216. package/dist/components/portal.d.ts +24 -23
  217. package/dist/components/portal.js +126 -60
  218. package/dist/components/portal.js.map +1 -1
  219. package/dist/components/progress.cjs +23 -24
  220. package/dist/components/progress.cjs.map +1 -1
  221. package/dist/components/progress.d.cts +8 -7
  222. package/dist/components/progress.d.ts +8 -7
  223. package/dist/components/progress.js +21 -23
  224. package/dist/components/progress.js.map +1 -1
  225. package/dist/components/progressive-blur-scroll-container.cjs +70 -138
  226. package/dist/components/progressive-blur-scroll-container.cjs.map +1 -1
  227. package/dist/components/progressive-blur-scroll-container.d.cts +19 -19
  228. package/dist/components/progressive-blur-scroll-container.d.ts +19 -19
  229. package/dist/components/progressive-blur-scroll-container.js +70 -137
  230. package/dist/components/progressive-blur-scroll-container.js.map +1 -1
  231. package/dist/components/progressive-blur.cjs +40 -64
  232. package/dist/components/progressive-blur.cjs.map +1 -1
  233. package/dist/components/progressive-blur.d.cts +15 -14
  234. package/dist/components/progressive-blur.d.ts +15 -14
  235. package/dist/components/progressive-blur.js +38 -63
  236. package/dist/components/progressive-blur.js.map +1 -1
  237. package/dist/components/radio-group.cjs +28 -42
  238. package/dist/components/radio-group.cjs.map +1 -1
  239. package/dist/components/radio-group.d.cts +8 -8
  240. package/dist/components/radio-group.d.ts +8 -8
  241. package/dist/components/radio-group.js +28 -41
  242. package/dist/components/radio-group.js.map +1 -1
  243. package/dist/components/record-picker.cjs +6 -418
  244. package/dist/components/record-picker.d.cts +13 -13
  245. package/dist/components/record-picker.d.ts +13 -13
  246. package/dist/components/record-picker.js +5 -397
  247. package/dist/components/resizable.cjs +32 -58
  248. package/dist/components/resizable.cjs.map +1 -1
  249. package/dist/components/resizable.d.cts +10 -9
  250. package/dist/components/resizable.d.ts +10 -9
  251. package/dist/components/resizable.js +29 -37
  252. package/dist/components/resizable.js.map +1 -1
  253. package/dist/components/responsive-diagram.cjs +50 -61
  254. package/dist/components/responsive-diagram.cjs.map +1 -1
  255. package/dist/components/responsive-diagram.d.cts +7 -7
  256. package/dist/components/responsive-diagram.d.ts +7 -7
  257. package/dist/components/responsive-diagram.js +50 -60
  258. package/dist/components/responsive-diagram.js.map +1 -1
  259. package/dist/components/scroll-area.cjs +37 -83
  260. package/dist/components/scroll-area.cjs.map +1 -1
  261. package/dist/components/scroll-area.d.cts +9 -8
  262. package/dist/components/scroll-area.d.ts +9 -8
  263. package/dist/components/scroll-area.js +35 -62
  264. package/dist/components/scroll-area.js.map +1 -1
  265. package/dist/components/select.cjs +175 -300
  266. package/dist/components/select.cjs.map +1 -1
  267. package/dist/components/select.d.cts +36 -35
  268. package/dist/components/select.d.ts +36 -35
  269. package/dist/components/select.js +172 -278
  270. package/dist/components/select.js.map +1 -1
  271. package/dist/components/separator.cjs +16 -19
  272. package/dist/components/separator.cjs.map +1 -1
  273. package/dist/components/separator.d.cts +2 -10
  274. package/dist/components/separator.d.ts +2 -10
  275. package/dist/components/separator.js +14 -18
  276. package/dist/components/separator.js.map +1 -1
  277. package/dist/components/sheet.cjs +17 -487
  278. package/dist/components/sheet.d.cts +85 -85
  279. package/dist/components/sheet.d.ts +85 -85
  280. package/dist/components/sheet.js +3 -453
  281. package/dist/components/sidebar.cjs +27 -1298
  282. package/dist/components/sidebar.d.cts +62 -65
  283. package/dist/components/sidebar.d.ts +62 -65
  284. package/dist/components/sidebar.js +3 -1254
  285. package/dist/components/skeleton.cjs +18 -30
  286. package/dist/components/skeleton.cjs.map +1 -1
  287. package/dist/components/skeleton.d.cts +6 -5
  288. package/dist/components/skeleton.d.ts +6 -5
  289. package/dist/components/skeleton.js +15 -28
  290. package/dist/components/skeleton.js.map +1 -1
  291. package/dist/components/sonner.cjs +17 -19
  292. package/dist/components/sonner.cjs.map +1 -1
  293. package/dist/components/sonner.d.cts +7 -7
  294. package/dist/components/sonner.d.ts +7 -7
  295. package/dist/components/sonner.js +17 -18
  296. package/dist/components/sonner.js.map +1 -1
  297. package/dist/components/stack/index.cjs +43 -1515
  298. package/dist/components/stack/index.d.cts +2 -672
  299. package/dist/components/stack/index.d.ts +2 -672
  300. package/dist/components/stack/index.js +3 -1455
  301. package/dist/components/stepper.cjs +131 -285
  302. package/dist/components/stepper.cjs.map +1 -1
  303. package/dist/components/stepper.d.cts +27 -26
  304. package/dist/components/stepper.d.ts +27 -26
  305. package/dist/components/stepper.js +130 -265
  306. package/dist/components/stepper.js.map +1 -1
  307. package/dist/components/switch.cjs +21 -32
  308. package/dist/components/switch.cjs.map +1 -1
  309. package/dist/components/switch.d.cts +7 -6
  310. package/dist/components/switch.d.ts +7 -6
  311. package/dist/components/switch.js +19 -31
  312. package/dist/components/switch.js.map +1 -1
  313. package/dist/components/table.cjs +58 -106
  314. package/dist/components/table.cjs.map +1 -1
  315. package/dist/components/table.d.cts +17 -16
  316. package/dist/components/table.d.ts +17 -16
  317. package/dist/components/table.js +55 -104
  318. package/dist/components/table.js.map +1 -1
  319. package/dist/components/tabs.cjs +31 -35
  320. package/dist/components/tabs.cjs.map +1 -1
  321. package/dist/components/tabs.d.cts +9 -8
  322. package/dist/components/tabs.d.ts +9 -8
  323. package/dist/components/tabs.js +29 -34
  324. package/dist/components/tabs.js.map +1 -1
  325. package/dist/components/tags.cjs +114 -433
  326. package/dist/components/tags.cjs.map +1 -1
  327. package/dist/components/tags.d.cts +24 -28
  328. package/dist/components/tags.d.ts +24 -28
  329. package/dist/components/tags.js +114 -413
  330. package/dist/components/tags.js.map +1 -1
  331. package/dist/components/textarea.cjs +27 -49
  332. package/dist/components/textarea.cjs.map +1 -1
  333. package/dist/components/textarea.d.cts +8 -7
  334. package/dist/components/textarea.d.ts +8 -7
  335. package/dist/components/textarea.js +27 -48
  336. package/dist/components/textarea.js.map +1 -1
  337. package/dist/components/toast/index.cjs +9 -612
  338. package/dist/components/toast/index.d.cts +2 -52
  339. package/dist/components/toast/index.d.ts +2 -52
  340. package/dist/components/toast/index.js +3 -586
  341. package/dist/components/tooltip.cjs +47 -72
  342. package/dist/components/tooltip.cjs.map +1 -1
  343. package/dist/components/tooltip.d.cts +2 -28
  344. package/dist/components/tooltip.d.ts +2 -28
  345. package/dist/components/tooltip.js +45 -51
  346. package/dist/components/tooltip.js.map +1 -1
  347. package/dist/components/unlink-button.cjs +19 -192
  348. package/dist/components/unlink-button.cjs.map +1 -1
  349. package/dist/components/unlink-button.d.cts +11 -11
  350. package/dist/components/unlink-button.d.ts +11 -11
  351. package/dist/components/unlink-button.js +18 -170
  352. package/dist/components/unlink-button.js.map +1 -1
  353. package/dist/form-DgRTv7O7.d.ts +54 -0
  354. package/dist/form-DoZEWSzb.d.cts +54 -0
  355. package/dist/index-CjA4CENl.d.cts +684 -0
  356. package/dist/index-CjA4CENl.d.ts +684 -0
  357. package/dist/index-UnM04j0t.d.cts +58 -0
  358. package/dist/index-UnM04j0t.d.ts +58 -0
  359. package/dist/index.cjs +408 -8697
  360. package/dist/index.d.cts +224 -2136
  361. package/dist/index.d.ts +224 -2136
  362. package/dist/index.js +65 -8350
  363. package/dist/input-CBrCuMH8.d.cts +11 -0
  364. package/dist/input-CBrCuMH8.d.ts +11 -0
  365. package/dist/motion-config-COCFHq1L.cjs +271 -0
  366. package/dist/motion-config-COCFHq1L.cjs.map +1 -0
  367. package/dist/motion-config-COsZ6azM.js +241 -0
  368. package/dist/motion-config-COsZ6azM.js.map +1 -0
  369. package/dist/record-picker-BbxngCeV.js +162 -0
  370. package/dist/record-picker-BbxngCeV.js.map +1 -0
  371. package/dist/record-picker-Bz4FApxD.cjs +167 -0
  372. package/dist/record-picker-Bz4FApxD.cjs.map +1 -0
  373. package/dist/rolldown-runtime-D_qnwXdH.cjs +35 -0
  374. package/dist/separator-BQEsr0Rc.d.cts +11 -0
  375. package/dist/separator-BQEsr0Rc.d.ts +11 -0
  376. package/dist/sheet-BLHnhLRH.js +425 -0
  377. package/dist/sheet-BLHnhLRH.js.map +1 -0
  378. package/dist/sheet-BdA0rfIz.cjs +515 -0
  379. package/dist/sheet-BdA0rfIz.cjs.map +1 -0
  380. package/dist/sidebar-CPy_fibW.cjs +608 -0
  381. package/dist/sidebar-CPy_fibW.cjs.map +1 -0
  382. package/dist/sidebar-Cfax0g0_.js +463 -0
  383. package/dist/sidebar-Cfax0g0_.js.map +1 -0
  384. package/dist/slot-C-jEfihz.cjs +122 -0
  385. package/dist/slot-C-jEfihz.cjs.map +1 -0
  386. package/dist/slot-EL8zfLG0.js +97 -0
  387. package/dist/slot-EL8zfLG0.js.map +1 -0
  388. package/dist/stack-DKdvlOM6.cjs +1771 -0
  389. package/dist/stack-DKdvlOM6.cjs.map +1 -0
  390. package/dist/stack-jMdxDrex.js +1531 -0
  391. package/dist/stack-jMdxDrex.js.map +1 -0
  392. package/dist/toast-D6MqijT2.cjs +316 -0
  393. package/dist/toast-D6MqijT2.cjs.map +1 -0
  394. package/dist/toast-D_BOLzm3.js +287 -0
  395. package/dist/toast-D_BOLzm3.js.map +1 -0
  396. package/dist/tooltip-CTRQoN1A.d.cts +29 -0
  397. package/dist/tooltip-CTRQoN1A.d.ts +29 -0
  398. package/dist/utils-BkMLyah9.js +12 -0
  399. package/dist/utils-BkMLyah9.js.map +1 -0
  400. package/dist/utils-CzTQ3-VI.cjs +17 -0
  401. package/dist/utils-CzTQ3-VI.cjs.map +1 -0
  402. package/package.json +5 -5
  403. package/dist/components/record-picker.cjs.map +0 -1
  404. package/dist/components/record-picker.js.map +0 -1
  405. package/dist/components/sheet.cjs.map +0 -1
  406. package/dist/components/sheet.js.map +0 -1
  407. package/dist/components/sidebar.cjs.map +0 -1
  408. package/dist/components/sidebar.js.map +0 -1
  409. package/dist/components/stack/index.cjs.map +0 -1
  410. package/dist/components/stack/index.js.map +0 -1
  411. package/dist/components/toast/index.cjs.map +0 -1
  412. package/dist/components/toast/index.js.map +0 -1
  413. package/dist/index.cjs.map +0 -1
  414. package/dist/index.js.map +0 -1
@@ -1,52 +1,2 @@
1
- interface ToastErrorProps {
2
- message: string;
3
- description?: string;
4
- action?: {
5
- label: string;
6
- onClick: () => void;
7
- };
8
- onDismiss?: () => void;
9
- }
10
- declare function showErrorToast(props: ToastErrorProps): string | number;
11
-
12
- interface ToastInfoProps {
13
- message: string;
14
- description?: string;
15
- action?: {
16
- label: string;
17
- onClick: () => void;
18
- };
19
- onDismiss?: () => void;
20
- }
21
- declare function showInfoToast(props: ToastInfoProps): string | number;
22
-
23
- interface ToastSuccessProps {
24
- message: string;
25
- description?: string;
26
- action?: {
27
- label: string;
28
- onClick: () => void;
29
- };
30
- onDismiss?: () => void;
31
- }
32
- declare function showSuccessToast(props: ToastSuccessProps): string | number;
33
-
34
- interface ToastWarningProps {
35
- message: string;
36
- description?: string;
37
- action?: {
38
- label: string;
39
- onClick: () => void;
40
- };
41
- onDismiss?: () => void;
42
- }
43
- declare function showWarningToast(props: ToastWarningProps): string | number;
44
-
45
- declare const toast: {
46
- error: typeof showErrorToast;
47
- info: typeof showInfoToast;
48
- success: typeof showSuccessToast;
49
- warning: typeof showWarningToast;
50
- };
51
-
52
- export { type ToastErrorProps, type ToastInfoProps, type ToastSuccessProps, type ToastWarningProps, showErrorToast, showInfoToast, showSuccessToast, showWarningToast, toast };
1
+ import { a as showSuccessToast, c as ToastErrorProps, i as ToastSuccessProps, l as showErrorToast, n as ToastWarningProps, o as ToastInfoProps, r as showWarningToast, s as showInfoToast, t as toast } from "../../index-UnM04j0t.js";
2
+ export { type ToastErrorProps, type ToastInfoProps, type ToastSuccessProps, type ToastWarningProps, showErrorToast, showInfoToast, showSuccessToast, showWarningToast, toast };
@@ -1,587 +1,4 @@
1
- "use client";
2
- import * as React from 'react';
3
- import { useState } from 'react';
4
- import { InfoIcon, XIcon, CheckCircleIcon, AlertTriangleIcon, AlertCircleIcon, CheckIcon, CopyIcon } from 'lucide-react';
5
- import { toast } from 'sonner';
6
- import { cva } from 'class-variance-authority';
7
- import { jsx, Fragment, jsxs } from 'react/jsx-runtime';
8
- import { clsx } from 'clsx';
9
- import { twMerge } from 'tailwind-merge';
10
- import { Dialog as Dialog$1 } from '@base-ui/react/dialog';
11
- import { ModalPortalScope, useRootPortalContainer } from '@constructive-io/ui/portal';
12
- import { ScrollArea as ScrollArea$1 } from '@base-ui/react/scroll-area';
1
+ 'use client';
2
+ import { a as showErrorToast, i as showInfoToast, n as showWarningToast, r as showSuccessToast, t as toast } from "../../toast-D_BOLzm3.js";
13
3
 
14
- // src/components/toast/toast-error.tsx
15
- function composeRefs(...refs) {
16
- return (node) => {
17
- refs.forEach((ref) => {
18
- if (typeof ref === "function") {
19
- ref(node);
20
- } else if (ref != null) {
21
- ref.current = node;
22
- }
23
- });
24
- };
25
- }
26
- function mergeProps(slotProps, childProps) {
27
- const overrideProps = { ...childProps };
28
- for (const propName in childProps) {
29
- if (propName === "ref") continue;
30
- const slotPropValue = slotProps[propName];
31
- const childPropValue = childProps[propName];
32
- if (/^on[A-Z]/.test(propName) && typeof slotPropValue === "function" && typeof childPropValue === "function") {
33
- overrideProps[propName] = (...args) => {
34
- childPropValue(...args);
35
- slotPropValue(...args);
36
- };
37
- } else if (propName === "className" && typeof slotPropValue === "string" && typeof childPropValue === "string") {
38
- overrideProps[propName] = `${slotPropValue} ${childPropValue}`.trim();
39
- } else if (propName === "style" && typeof slotPropValue === "object" && typeof childPropValue === "object") {
40
- overrideProps[propName] = { ...slotPropValue, ...childPropValue };
41
- }
42
- }
43
- return { ...slotProps, ...overrideProps };
44
- }
45
- function isSlottable(child) {
46
- return React.isValidElement(child);
47
- }
48
- var Slot = React.forwardRef((props, forwardedRef) => {
49
- const { children, ...slotProps } = props;
50
- if (isSlottable(children)) {
51
- const childProps = children.props;
52
- const childRef = childProps.ref;
53
- return React.cloneElement(children, {
54
- ...mergeProps(slotProps, childProps),
55
- ref: forwardedRef ? composeRefs(forwardedRef, childRef) : childRef
56
- });
57
- }
58
- if (React.Children.count(children) > 1) {
59
- const childrenArray = React.Children.toArray(children);
60
- const slottableChild = childrenArray.find(
61
- (child) => React.isValidElement(child) && child.type === Slottable
62
- );
63
- if (slottableChild) {
64
- const newElement = slottableChild.props.children;
65
- if (isSlottable(newElement)) {
66
- const newElementProps = newElement.props;
67
- const newChildren = childrenArray.map((child) => {
68
- if (child === slottableChild) {
69
- return React.Children.count(newElementProps.children) > 1 ? React.Children.only(null) : newElementProps.children;
70
- }
71
- return child;
72
- });
73
- const childRef = newElementProps.ref;
74
- return React.cloneElement(newElement, {
75
- ...mergeProps(slotProps, newElementProps),
76
- ref: forwardedRef ? composeRefs(forwardedRef, childRef) : childRef,
77
- children: newChildren
78
- });
79
- }
80
- }
81
- }
82
- return /* @__PURE__ */ jsx(Fragment, { children });
83
- });
84
- Slot.displayName = "Slot";
85
- function Slottable({ children }) {
86
- return /* @__PURE__ */ jsx(Fragment, { children });
87
- }
88
- function cn(...inputs) {
89
- return twMerge(clsx(inputs));
90
- }
91
- var buttonVariants = cva(
92
- "[&_svg]:-mx-0.5 relative inline-flex shrink-0 cursor-pointer items-center justify-center gap-2 whitespace-nowrap rounded-lg border font-medium text-sm outline-none transition-[box-shadow,scale] duration-150 ease-out before:pointer-events-none before:absolute before:inset-0 before:rounded-[calc(var(--radius-lg)-1px)] focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-1 focus-visible:ring-offset-background disabled:pointer-events-none disabled:opacity-64 motion-reduce:transition-shadow [&_svg:not([class*='opacity-'])]:opacity-80 [&_svg:not([class*='size-'])]:size-4 [&_svg]:pointer-events-none [&_svg]:shrink-0",
93
- {
94
- defaultVariants: {
95
- size: "default",
96
- static: false,
97
- variant: "default"
98
- },
99
- variants: {
100
- static: {
101
- false: "motion-safe:active:not-disabled:scale-[0.96]",
102
- true: null
103
- },
104
- size: {
105
- default: "h-10 min-w-10 px-[calc(--spacing(3)-1px)] pointer-coarse:min-h-11 pointer-coarse:min-w-11",
106
- icon: "size-10 pointer-coarse:size-11",
107
- "icon-lg": "size-11",
108
- "icon-sm": "size-8 pointer-coarse:size-11",
109
- "icon-xl": 'size-11 [&_svg:not([class*="size-"])]:size-5',
110
- "icon-xs": 'size-7 rounded-md before:rounded-[calc(var(--radius-md)-1px)] pointer-coarse:size-11 not-in-data-[slot=input-group]:[&_svg:not([class*="size-"])]:size-4',
111
- lg: "h-11 min-w-11 px-[calc(--spacing(3.5)-1px)]",
112
- sm: "h-8 gap-1.5 px-[calc(--spacing(2.5)-1px)] pointer-coarse:min-h-11 pointer-coarse:min-w-11",
113
- xl: 'h-12 min-w-12 px-[calc(--spacing(4)-1px)] text-lg [&_svg:not([class*="size-"])]:size-5',
114
- xs: 'h-7 gap-1 rounded-md px-[calc(--spacing(2)-1px)] text-xs before:rounded-[calc(var(--radius-md)-1px)] pointer-coarse:min-h-11 pointer-coarse:min-w-11 [&_svg:not([class*="size-"])]:size-3.5'
115
- },
116
- variant: {
117
- default: "not-disabled:inset-shadow-[0_1px_--theme(--color-white/16%)] border-primary bg-primary text-primary-foreground shadow-primary/24 shadow-xs hover:bg-primary/90 [:active,[data-pressed]]:inset-shadow-[0_1px_--theme(--color-black/8%)] [:disabled,:active,[data-pressed]]:shadow-none",
118
- destructive: "not-disabled:inset-shadow-[0_1px_--theme(--color-white/16%)] border-destructive bg-destructive text-white shadow-destructive/24 shadow-xs hover:bg-destructive/90 [:active,[data-pressed]]:inset-shadow-[0_1px_--theme(--color-black/8%)] [:disabled,:active,[data-pressed]]:shadow-none",
119
- "destructive-outline": "border-destructive/40 bg-transparent bg-clip-padding text-destructive shadow-xs not-disabled:not-active:not-data-pressed:before:shadow-[0_1px_--theme(--color-black/4%)] dark:bg-input/32 dark:not-in-data-[slot=group]:bg-clip-border dark:not-disabled:before:shadow-[0_-1px_--theme(--color-white/4%)] dark:not-disabled:not-active:not-data-pressed:before:shadow-[0_-1px_--theme(--color-white/8%)] [:disabled,:active,[data-pressed]]:shadow-none [:hover,[data-pressed]]:border-destructive/60 [:hover,[data-pressed]]:bg-destructive/8",
120
- ghost: "border-transparent hover:bg-accent data-pressed:bg-accent",
121
- link: "border-transparent underline-offset-4 hover:underline",
122
- outline: "border-border bg-background bg-clip-padding shadow-xs not-disabled:not-active:not-data-pressed:before:shadow-[0_1px_--theme(--color-black/4%)] dark:bg-input/32 dark:not-in-data-[slot=group]:bg-clip-border dark:not-disabled:before:shadow-[0_-1px_--theme(--color-white/4%)] dark:not-disabled:not-active:not-data-pressed:before:shadow-[0_-1px_--theme(--color-white/8%)] [:disabled,:active,[data-pressed]]:shadow-none [:hover,[data-pressed]]:bg-accent/50 dark:[:hover,[data-pressed]]:bg-input/64",
123
- secondary: "border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/90 [:active,[data-pressed]]:bg-secondary/80"
124
- }
125
- }
126
- }
127
- );
128
- var Button = React.forwardRef(
129
- ({ className, variant, size, static: isStatic, asChild, children, type = "button", ...props }, ref) => {
130
- const buttonClasses = cn(buttonVariants({ className, size, static: isStatic, variant }));
131
- const Comp = asChild ? Slot : "button";
132
- if (asChild) {
133
- const SlottedComp = Comp;
134
- return /* @__PURE__ */ jsx(
135
- SlottedComp,
136
- {
137
- ref,
138
- className: buttonClasses,
139
- "data-slot": "button",
140
- ...props,
141
- children
142
- }
143
- );
144
- }
145
- return /* @__PURE__ */ jsx("button", { ref, type, className: buttonClasses, "data-slot": "button", ...props, children });
146
- }
147
- );
148
- Button.displayName = "Button";
149
- var ScrollArea = React.forwardRef(
150
- ({ className, children, scrollFade = false, scrollbarGutter = false, ...props }, ref) => {
151
- return /* @__PURE__ */ jsxs(
152
- ScrollArea$1.Root,
153
- {
154
- ref,
155
- className: cn("size-full min-h-0", className),
156
- ...props,
157
- children: [
158
- /* @__PURE__ */ jsx(
159
- ScrollArea$1.Viewport,
160
- {
161
- className: cn(
162
- "h-full overscroll-contain rounded-[inherit] outline-none transition-shadows focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-1 focus-visible:ring-offset-background",
163
- scrollFade && "mask-t-from-[calc(100%-min(var(--fade-size),var(--scroll-area-overflow-y-start)))] mask-b-from-[calc(100%-min(var(--fade-size),var(--scroll-area-overflow-y-end)))] mask-l-from-[calc(100%-min(var(--fade-size),var(--scroll-area-overflow-x-start)))] mask-r-from-[calc(100%-min(var(--fade-size),var(--scroll-area-overflow-x-end)))] [--fade-size:1.5rem]",
164
- scrollbarGutter && "data-has-overflow-y:pe-2.5 data-has-overflow-x:pb-2.5"
165
- ),
166
- "data-slot": "scroll-area-viewport",
167
- children
168
- }
169
- ),
170
- /* @__PURE__ */ jsx(ScrollBar, { orientation: "vertical" }),
171
- /* @__PURE__ */ jsx(ScrollBar, { orientation: "horizontal" }),
172
- /* @__PURE__ */ jsx(ScrollArea$1.Corner, { "data-slot": "scroll-area-corner" })
173
- ]
174
- }
175
- );
176
- }
177
- );
178
- ScrollArea.displayName = "ScrollArea";
179
- function ScrollBar({
180
- className,
181
- orientation = "vertical",
182
- ...props
183
- }) {
184
- return /* @__PURE__ */ jsx(
185
- ScrollArea$1.Scrollbar,
186
- {
187
- className: cn(
188
- "m-1 flex opacity-0 transition-opacity delay-300 data-[orientation=horizontal]:h-1.5 data-[orientation=vertical]:w-1.5 data-[orientation=horizontal]:flex-col data-hovering:opacity-100 data-scrolling:opacity-100 data-hovering:delay-0 data-scrolling:delay-0 data-hovering:duration-100 data-scrolling:duration-100",
189
- className
190
- ),
191
- "data-slot": "scroll-area-scrollbar",
192
- orientation,
193
- ...props,
194
- children: /* @__PURE__ */ jsx(
195
- ScrollArea$1.Thumb,
196
- {
197
- className: "relative flex-1 rounded-full bg-foreground/20",
198
- "data-slot": "scroll-area-thumb"
199
- }
200
- )
201
- }
202
- );
203
- }
204
- var Dialog = Dialog$1.Root;
205
- function DialogPortal({ container: containerProp, ...props }) {
206
- const rootContainer = useRootPortalContainer();
207
- const container = containerProp === void 0 ? rootContainer ?? void 0 : containerProp;
208
- const style = {
209
- ...props.style ?? {},
210
- // Ensure floating overlays inside dialogs (select/menu/popover/tooltip) stack above the dialog.
211
- // Nested Base UI portals inherit this var via Base UI portal nesting.
212
- ["--z-layer-floating"]: "var(--z-layer-floating-elevated)"
213
- };
214
- return /* @__PURE__ */ jsx(Dialog$1.Portal, { container, ...props, style });
215
- }
216
- function DialogClose({ asChild, children, render, nativeButton, ...props }) {
217
- const childRender = render === void 0 && asChild && React.isValidElement(children) ? children : void 0;
218
- return /* @__PURE__ */ jsx(
219
- Dialog$1.Close,
220
- {
221
- "data-slot": "dialog-close",
222
- nativeButton: nativeButton ?? (childRender ? true : void 0),
223
- render: render ?? childRender,
224
- ...props,
225
- children: childRender ? void 0 : children
226
- }
227
- );
228
- }
229
- function DialogBackdrop({
230
- className,
231
- ...props
232
- }) {
233
- return /* @__PURE__ */ jsx(
234
- Dialog$1.Backdrop,
235
- {
236
- className: cn(
237
- "fixed inset-0 z-[var(--z-layer-modal-backdrop)] bg-black/32 backdrop-blur-sm transition-opacity duration-200 data-ending-style:opacity-0 data-starting-style:opacity-0",
238
- className
239
- ),
240
- "data-slot": "dialog-backdrop",
241
- ...props
242
- }
243
- );
244
- }
245
- function DialogViewport({
246
- className,
247
- ...props
248
- }) {
249
- return /* @__PURE__ */ jsx(
250
- Dialog$1.Viewport,
251
- {
252
- className: cn(
253
- "fixed inset-0 z-[var(--z-layer-modal-content)] grid grid-rows-[1fr_auto_3fr] justify-items-center p-4",
254
- className
255
- ),
256
- "data-slot": "dialog-viewport",
257
- ...props
258
- }
259
- );
260
- }
261
- function DialogPopup({
262
- className,
263
- children,
264
- showCloseButton = true,
265
- bottomStickOnMobile = true,
266
- ...props
267
- }) {
268
- return /* @__PURE__ */ jsxs(DialogPortal, { children: [
269
- /* @__PURE__ */ jsx(DialogBackdrop, {}),
270
- /* @__PURE__ */ jsx(
271
- DialogViewport,
272
- {
273
- className: cn(
274
- bottomStickOnMobile && "max-sm:grid-rows-[1fr_auto] max-sm:pt-12"
275
- ),
276
- children: /* @__PURE__ */ jsxs(
277
- Dialog$1.Popup,
278
- {
279
- className: cn(
280
- "-translate-y-[calc(1.25rem*var(--nested-dialogs))] relative row-start-2 flex max-h-full min-h-0 w-full min-w-0 max-w-lg scale-[calc(1-0.1*var(--nested-dialogs))] flex-col rounded-2xl border bg-popover bg-clip-padding text-popover-foreground opacity-[calc(1-0.1*var(--nested-dialogs))] shadow-lg transition-[scale,opacity,translate] duration-200 ease-in-out before:pointer-events-none before:absolute before:inset-0 before:rounded-[calc(var(--radius-2xl)-1px)] before:shadow-[0_1px_--theme(--color-black/4%)] data-nested:data-ending-style:translate-y-8 data-nested:data-starting-style:translate-y-8 data-nested-dialog-open:origin-top data-ending-style:scale-98 data-starting-style:scale-98 data-ending-style:opacity-0 data-starting-style:opacity-0 dark:bg-clip-border dark:before:shadow-[0_-1px_--theme(--color-white/8%)]",
281
- bottomStickOnMobile && "max-sm:rounded-none max-sm:border-x-0 max-sm:border-t max-sm:border-b-0 max-sm:opacity-[calc(1-min(var(--nested-dialogs),1))] max-sm:data-ending-style:translate-y-4 max-sm:data-starting-style:translate-y-4 max-sm:before:hidden max-sm:before:rounded-none",
282
- className
283
- ),
284
- "data-slot": "dialog-popup",
285
- ...props,
286
- children: [
287
- /* @__PURE__ */ jsx(ModalPortalScope, { children }),
288
- showCloseButton && /* @__PURE__ */ jsx(
289
- Dialog$1.Close,
290
- {
291
- "aria-label": "Close",
292
- nativeButton: true,
293
- render: (closeProps) => {
294
- const { nativeButton: _, ...rest } = closeProps;
295
- return /* @__PURE__ */ jsx(
296
- Button,
297
- {
298
- ...rest,
299
- className: "absolute end-2 top-2",
300
- size: "icon",
301
- variant: "ghost",
302
- children: /* @__PURE__ */ jsx(XIcon, {})
303
- }
304
- );
305
- }
306
- }
307
- )
308
- ]
309
- }
310
- )
311
- }
312
- )
313
- ] });
314
- }
315
- function DialogHeader({ className, ...props }) {
316
- return /* @__PURE__ */ jsx(
317
- "div",
318
- {
319
- className: cn(
320
- "flex flex-col gap-2 p-6 in-[[data-slot=dialog-popup]:has([data-slot=dialog-panel])]:pb-3 max-sm:pb-4",
321
- className
322
- ),
323
- "data-slot": "dialog-header",
324
- ...props
325
- }
326
- );
327
- }
328
- function DialogFooter({
329
- className,
330
- variant = "default",
331
- ...props
332
- }) {
333
- return /* @__PURE__ */ jsx(
334
- "div",
335
- {
336
- className: cn(
337
- "flex flex-col-reverse gap-2 px-6 sm:flex-row sm:justify-end sm:rounded-b-[calc(var(--radius-2xl)-1px)]",
338
- variant === "default" && "border-t bg-muted/50 py-4",
339
- variant === "bare" && "in-[[data-slot=dialog-popup]:has([data-slot=dialog-panel])]:pt-3 pt-4 pb-6",
340
- className
341
- ),
342
- "data-slot": "dialog-footer",
343
- ...props
344
- }
345
- );
346
- }
347
- function DialogTitle({ className, ...props }) {
348
- return /* @__PURE__ */ jsx(
349
- Dialog$1.Title,
350
- {
351
- className: cn("font-heading text-xl leading-none", className),
352
- "data-slot": "dialog-title",
353
- ...props
354
- }
355
- );
356
- }
357
- function DialogPanel({ className, ...props }) {
358
- return /* @__PURE__ */ jsx(ScrollArea, { children: /* @__PURE__ */ jsx(
359
- "div",
360
- {
361
- className: cn(
362
- "px-6 in-[[data-slot=dialog-popup]:has([data-slot=dialog-header])]:pt-1 in-[[data-slot=dialog-popup]:not(:has([data-slot=dialog-header]))]:pt-6 in-[[data-slot=dialog-popup]:not(:has([data-slot=dialog-footer]))]:pb-6! in-[[data-slot=dialog-popup]:not(:has([data-slot=dialog-footer].border-t))]:pb-1 pb-6",
363
- className
364
- ),
365
- "data-slot": "dialog-panel",
366
- ...props
367
- }
368
- ) });
369
- }
370
- var LONG_DESCRIPTION_THRESHOLD = 140;
371
- function isLongDescription(description) {
372
- if (!description) return false;
373
- return description.length > LONG_DESCRIPTION_THRESHOLD || description.includes("\n");
374
- }
375
- function ToastErrorContent({
376
- toastId,
377
- message,
378
- description,
379
- action,
380
- onDismiss
381
- }) {
382
- const [detailsOpen, setDetailsOpen] = useState(false);
383
- const [copied, setCopied] = useState(false);
384
- const showDetails = isLongDescription(description);
385
- const handleCopy = async () => {
386
- if (!description) return;
387
- try {
388
- await navigator.clipboard.writeText(description);
389
- setCopied(true);
390
- setTimeout(() => setCopied(false), 1500);
391
- } catch {
392
- }
393
- };
394
- return /* @__PURE__ */ jsxs(Fragment, { children: [
395
- /* @__PURE__ */ jsx(
396
- "div",
397
- {
398
- className: "bg-background text-foreground border-destructive/20 w-full rounded-md border px-4 py-3 shadow-lg\n sm:w-[var(--width)]",
399
- children: /* @__PURE__ */ jsxs("div", { className: "flex gap-2", children: [
400
- /* @__PURE__ */ jsxs("div", { className: "flex min-w-0 grow gap-3", children: [
401
- /* @__PURE__ */ jsx(AlertCircleIcon, { className: "text-destructive mt-0.5 shrink-0", size: 16, "aria-hidden": "true" }),
402
- /* @__PURE__ */ jsxs("div", { className: "flex min-w-0 grow flex-col gap-1", children: [
403
- /* @__PURE__ */ jsx("p", { className: "text-destructive text-sm font-medium break-words", children: message }),
404
- description && /* @__PURE__ */ jsx("p", { className: "text-muted-foreground line-clamp-3 text-sm break-words", children: description }),
405
- (showDetails || action) && /* @__PURE__ */ jsxs("div", { className: "flex flex-wrap gap-x-4 gap-y-1", children: [
406
- showDetails && /* @__PURE__ */ jsx(
407
- "button",
408
- {
409
- className: "text-muted-foreground hover:text-foreground text-xs font-medium underline underline-offset-2 decoration-dotted",
410
- onClick: () => setDetailsOpen(true),
411
- children: "View details"
412
- }
413
- ),
414
- action && /* @__PURE__ */ jsx(
415
- "button",
416
- {
417
- className: "text-destructive text-sm font-medium hover:underline",
418
- onClick: action.onClick,
419
- children: action.label
420
- }
421
- )
422
- ] })
423
- ] })
424
- ] }),
425
- /* @__PURE__ */ jsx(
426
- Button,
427
- {
428
- variant: "ghost",
429
- className: "group -my-1.5 -me-2 size-8 shrink-0 p-0 hover:bg-transparent",
430
- onClick: () => {
431
- toast.dismiss(toastId);
432
- onDismiss?.();
433
- },
434
- "aria-label": "Close error notification",
435
- children: /* @__PURE__ */ jsx(XIcon, { size: 16, className: "opacity-60 transition-opacity group-hover:opacity-100", "aria-hidden": "true" })
436
- }
437
- )
438
- ] })
439
- }
440
- ),
441
- showDetails && description && /* @__PURE__ */ jsx(Dialog, { open: detailsOpen, onOpenChange: setDetailsOpen, children: /* @__PURE__ */ jsxs(DialogPopup, { className: "max-w-2xl", children: [
442
- /* @__PURE__ */ jsx(DialogHeader, { children: /* @__PURE__ */ jsx(DialogTitle, { children: message }) }),
443
- /* @__PURE__ */ jsx(DialogPanel, { children: /* @__PURE__ */ jsx("pre", { className: "bg-muted text-foreground rounded-md p-3 text-xs break-words whitespace-pre-wrap", children: description }) }),
444
- /* @__PURE__ */ jsxs(DialogFooter, { children: [
445
- /* @__PURE__ */ jsxs(Button, { variant: "outline", size: "sm", onClick: handleCopy, children: [
446
- copied ? /* @__PURE__ */ jsx(CheckIcon, { size: 14, "aria-hidden": "true" }) : /* @__PURE__ */ jsx(CopyIcon, { size: 14, "aria-hidden": "true" }),
447
- copied ? "Copied" : "Copy"
448
- ] }),
449
- /* @__PURE__ */ jsx(DialogClose, { asChild: true, children: /* @__PURE__ */ jsx(Button, { size: "sm", children: "Close" }) })
450
- ] })
451
- ] }) })
452
- ] });
453
- }
454
- function showErrorToast(props) {
455
- return toast.custom((t) => /* @__PURE__ */ jsx(ToastErrorContent, { toastId: t, ...props }), {
456
- duration: Infinity
457
- });
458
- }
459
- function showInfoToast(props) {
460
- const { message, description, action, onDismiss } = props;
461
- return toast.custom((t) => /* @__PURE__ */ jsx(
462
- "div",
463
- {
464
- className: "bg-background text-foreground border-primary/20 w-full rounded-md border px-4 py-3 shadow-lg\n sm:w-[var(--width)]",
465
- children: /* @__PURE__ */ jsxs("div", { className: "flex gap-2", children: [
466
- /* @__PURE__ */ jsxs("div", { className: "flex grow gap-3", children: [
467
- /* @__PURE__ */ jsx(InfoIcon, { className: "text-primary mt-0.5 shrink-0", size: 16, "aria-hidden": "true" }),
468
- /* @__PURE__ */ jsxs("div", { className: "flex grow flex-col gap-1", children: [
469
- /* @__PURE__ */ jsx("p", { className: "text-primary text-sm font-medium", children: message }),
470
- description && /* @__PURE__ */ jsx("p", { className: "text-muted-foreground text-sm", children: description }),
471
- action && /* @__PURE__ */ jsx("div", { className: "mt-2", children: /* @__PURE__ */ jsx("button", { className: "text-primary text-sm font-medium hover:underline", onClick: action.onClick, children: action.label }) })
472
- ] })
473
- ] }),
474
- /* @__PURE__ */ jsx(
475
- Button,
476
- {
477
- variant: "ghost",
478
- className: "group -my-1.5 -me-2 size-8 shrink-0 p-0 hover:bg-transparent",
479
- onClick: () => {
480
- toast.dismiss(t);
481
- onDismiss?.();
482
- },
483
- "aria-label": "Close info notification",
484
- children: /* @__PURE__ */ jsx(XIcon, { size: 16, className: "opacity-60 transition-opacity group-hover:opacity-100", "aria-hidden": "true" })
485
- }
486
- )
487
- ] })
488
- }
489
- ));
490
- }
491
- function showSuccessToast(props) {
492
- const { message, description, action, onDismiss } = props;
493
- return toast.custom((t) => /* @__PURE__ */ jsx(
494
- "div",
495
- {
496
- className: "bg-background text-foreground w-full rounded-md border border-green-200/60 px-4 py-3 shadow-lg\n sm:w-[var(--width)] dark:border-green-800/50",
497
- children: /* @__PURE__ */ jsxs("div", { className: "flex gap-2", children: [
498
- /* @__PURE__ */ jsxs("div", { className: "flex grow gap-3", children: [
499
- /* @__PURE__ */ jsx(
500
- CheckCircleIcon,
501
- {
502
- className: "mt-0.5 shrink-0 text-green-600 dark:text-green-500",
503
- size: 16,
504
- "aria-hidden": "true"
505
- }
506
- ),
507
- /* @__PURE__ */ jsxs("div", { className: "flex grow flex-col gap-1", children: [
508
- /* @__PURE__ */ jsx("p", { className: "text-sm font-medium text-green-700 dark:text-green-400", children: message }),
509
- description && /* @__PURE__ */ jsx("p", { className: "text-muted-foreground text-sm", children: description }),
510
- action && /* @__PURE__ */ jsx("div", { className: "mt-2", children: /* @__PURE__ */ jsx(
511
- "button",
512
- {
513
- className: "text-sm font-medium text-green-700 hover:underline dark:text-green-400",
514
- onClick: action.onClick,
515
- children: action.label
516
- }
517
- ) })
518
- ] })
519
- ] }),
520
- /* @__PURE__ */ jsx(
521
- Button,
522
- {
523
- variant: "ghost",
524
- className: "group -my-1.5 -me-2 size-8 shrink-0 p-0 hover:bg-transparent",
525
- onClick: () => {
526
- toast.dismiss(t);
527
- onDismiss?.();
528
- },
529
- "aria-label": "Close success notification",
530
- children: /* @__PURE__ */ jsx(XIcon, { size: 16, className: "opacity-60 transition-opacity group-hover:opacity-100", "aria-hidden": "true" })
531
- }
532
- )
533
- ] })
534
- }
535
- ));
536
- }
537
- function showWarningToast(props) {
538
- const { message, description, action, onDismiss } = props;
539
- return toast.custom((t) => /* @__PURE__ */ jsx(
540
- "div",
541
- {
542
- className: "bg-background text-foreground w-full rounded-md border border-amber-200/60 px-4 py-3 shadow-lg\n sm:w-[var(--width)] dark:border-amber-800/50",
543
- children: /* @__PURE__ */ jsxs("div", { className: "flex gap-2", children: [
544
- /* @__PURE__ */ jsxs("div", { className: "flex grow gap-3", children: [
545
- /* @__PURE__ */ jsx(AlertTriangleIcon, { className: "mt-0.5 shrink-0 text-amber-500", size: 16, "aria-hidden": "true" }),
546
- /* @__PURE__ */ jsxs("div", { className: "flex grow flex-col gap-1", children: [
547
- /* @__PURE__ */ jsx("p", { className: "text-sm font-medium text-amber-700 dark:text-amber-400", children: message }),
548
- description && /* @__PURE__ */ jsx("p", { className: "text-muted-foreground text-sm", children: description }),
549
- action && /* @__PURE__ */ jsx("div", { className: "mt-2", children: /* @__PURE__ */ jsx(
550
- "button",
551
- {
552
- className: "text-sm font-medium text-amber-700 hover:underline dark:text-amber-400",
553
- onClick: action.onClick,
554
- children: action.label
555
- }
556
- ) })
557
- ] })
558
- ] }),
559
- /* @__PURE__ */ jsx(
560
- Button,
561
- {
562
- variant: "ghost",
563
- className: "group -my-1.5 -me-2 size-8 shrink-0 p-0 hover:bg-transparent",
564
- onClick: () => {
565
- toast.dismiss(t);
566
- onDismiss?.();
567
- },
568
- "aria-label": "Close warning notification",
569
- children: /* @__PURE__ */ jsx(XIcon, { size: 16, className: "opacity-60 transition-opacity group-hover:opacity-100", "aria-hidden": "true" })
570
- }
571
- )
572
- ] })
573
- }
574
- ));
575
- }
576
-
577
- // src/components/toast/index.ts
578
- var toast5 = {
579
- error: showErrorToast,
580
- info: showInfoToast,
581
- success: showSuccessToast,
582
- warning: showWarningToast
583
- };
584
-
585
- export { showErrorToast, showInfoToast, showSuccessToast, showWarningToast, toast5 as toast };
586
- //# sourceMappingURL=index.js.map
587
- //# sourceMappingURL=index.js.map
4
+ export { showErrorToast, showInfoToast, showSuccessToast, showWarningToast, toast };