@devalok/shilp-sutra 0.34.0 → 0.36.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 (541) hide show
  1. package/LICENSE +21 -21
  2. package/dist/_chunks/badge-group.js +306 -246
  3. package/dist/_chunks/badge-group.js.map +1 -0
  4. package/dist/_chunks/chat.js +518 -0
  5. package/dist/_chunks/chat.js.map +1 -0
  6. package/dist/_chunks/date-picker.js +748 -0
  7. package/dist/_chunks/date-picker.js.map +1 -0
  8. package/dist/_chunks/document-preview.js +109 -90
  9. package/dist/_chunks/document-preview.js.map +1 -0
  10. package/dist/_chunks/file-preview.js +492 -504
  11. package/dist/_chunks/file-preview.js.map +1 -0
  12. package/dist/_chunks/framer.js +5564 -5613
  13. package/dist/_chunks/framer.js.map +1 -0
  14. package/dist/_chunks/image-preview.js +127 -88
  15. package/dist/_chunks/image-preview.js.map +1 -0
  16. package/dist/_chunks/keybinding.js +12 -14
  17. package/dist/_chunks/keybinding.js.map +1 -0
  18. package/dist/_chunks/link-context.js +19 -16
  19. package/dist/_chunks/link-context.js.map +1 -0
  20. package/dist/_chunks/mention-suggestion.js +353 -350
  21. package/dist/_chunks/mention-suggestion.js.map +1 -0
  22. package/dist/_chunks/motion-provider.js +26 -20
  23. package/dist/_chunks/motion-provider.js.map +1 -0
  24. package/dist/_chunks/popover.js +123 -0
  25. package/dist/_chunks/popover.js.map +1 -0
  26. package/dist/_chunks/primitives.js +7585 -6426
  27. package/dist/_chunks/primitives.js.map +1 -0
  28. package/dist/_chunks/rich-chat-input.js +2071 -0
  29. package/dist/_chunks/rich-chat-input.js.map +1 -0
  30. package/dist/_chunks/rolldown-runtime.js +21 -0
  31. package/dist/_chunks/shared.js +126 -0
  32. package/dist/_chunks/shared.js.map +1 -0
  33. package/dist/_chunks/sonner.js +605 -734
  34. package/dist/_chunks/sonner.js.map +1 -0
  35. package/dist/_chunks/stat-row.js +418 -440
  36. package/dist/_chunks/stat-row.js.map +1 -0
  37. package/dist/_chunks/tiptap.js +15850 -19964
  38. package/dist/_chunks/tiptap.js.map +1 -0
  39. package/dist/_chunks/tree-view.js +231 -290
  40. package/dist/_chunks/tree-view.js.map +1 -0
  41. package/dist/_chunks/use-calendar.js +161 -208
  42. package/dist/_chunks/use-calendar.js.map +1 -0
  43. package/dist/_chunks/vendor-client.js +314 -2199
  44. package/dist/_chunks/vendor-client.js.map +1 -0
  45. package/dist/_chunks/vendor-utils.js +1721 -2978
  46. package/dist/_chunks/vendor-utils.js.map +1 -0
  47. package/dist/ai/ai-command-provider.js +23 -17
  48. package/dist/ai/ai-command-provider.js.map +1 -0
  49. package/dist/ai/block-renderer.js +68 -51
  50. package/dist/ai/block-renderer.js.map +1 -0
  51. package/dist/ai/blocks/index.js +2 -12
  52. package/dist/ai/blocks/loading.d.ts.map +1 -1
  53. package/dist/ai/command-bar.js +470 -519
  54. package/dist/ai/command-bar.js.map +1 -0
  55. package/dist/ai/conversation.js +241 -227
  56. package/dist/ai/conversation.js.map +1 -0
  57. package/dist/ai/devadoot-icon.d.ts.map +1 -1
  58. package/dist/ai/index.js +181 -167
  59. package/dist/ai/index.js.map +1 -0
  60. package/dist/ai/types.js +0 -1
  61. package/dist/composed/activity-feed.js +232 -202
  62. package/dist/composed/activity-feed.js.map +1 -0
  63. package/dist/composed/avatar-group.js +164 -222
  64. package/dist/composed/avatar-group.js.map +1 -0
  65. package/dist/composed/bulk-action-bar.js +166 -165
  66. package/dist/composed/bulk-action-bar.js.map +1 -0
  67. package/dist/composed/command-palette.js +290 -308
  68. package/dist/composed/command-palette.js.map +1 -0
  69. package/dist/composed/confirm-dialog.js +28 -48
  70. package/dist/composed/confirm-dialog.js.map +1 -0
  71. package/dist/composed/content-card.js +69 -108
  72. package/dist/composed/content-card.js.map +1 -0
  73. package/dist/composed/date-picker/index.js +3 -13
  74. package/dist/composed/deadline-indicator.js +68 -74
  75. package/dist/composed/deadline-indicator.js.map +1 -0
  76. package/dist/composed/emoji-picker.js +83 -110
  77. package/dist/composed/emoji-picker.js.map +1 -0
  78. package/dist/composed/empty-state.d.ts.map +1 -1
  79. package/dist/composed/empty-state.js +64 -103
  80. package/dist/composed/empty-state.js.map +1 -0
  81. package/dist/composed/error-boundary.js +129 -127
  82. package/dist/composed/error-boundary.js.map +1 -0
  83. package/dist/composed/file-preview.js +2 -12
  84. package/dist/composed/filter-bar.js +98 -130
  85. package/dist/composed/filter-bar.js.map +1 -0
  86. package/dist/composed/form-section.js +61 -45
  87. package/dist/composed/form-section.js.map +1 -0
  88. package/dist/composed/global-loading.js +34 -47
  89. package/dist/composed/global-loading.js.map +1 -0
  90. package/dist/composed/index.js +34 -92
  91. package/dist/composed/inline-edit.js +92 -107
  92. package/dist/composed/inline-edit.js.map +1 -0
  93. package/dist/composed/lib/string-utils.js +8 -8
  94. package/dist/composed/lib/string-utils.js.map +1 -0
  95. package/dist/composed/loading-skeleton.js +103 -171
  96. package/dist/composed/loading-skeleton.js.map +1 -0
  97. package/dist/composed/markdown-viewer.js +187 -139
  98. package/dist/composed/markdown-viewer.js.map +1 -0
  99. package/dist/composed/master-detail.js +147 -156
  100. package/dist/composed/master-detail.js.map +1 -0
  101. package/dist/composed/member-picker.js +46 -49
  102. package/dist/composed/member-picker.js.map +1 -0
  103. package/dist/composed/multi-select-popover.d.ts.map +1 -1
  104. package/dist/composed/multi-select-popover.js +185 -179
  105. package/dist/composed/multi-select-popover.js.map +1 -0
  106. package/dist/composed/page-header.js +54 -76
  107. package/dist/composed/page-header.js.map +1 -0
  108. package/dist/composed/page-skeletons.js +143 -127
  109. package/dist/composed/page-skeletons.js.map +1 -0
  110. package/dist/composed/priority-indicator.js +105 -111
  111. package/dist/composed/priority-indicator.js.map +1 -0
  112. package/dist/composed/responsive-overlay.js +36 -41
  113. package/dist/composed/responsive-overlay.js.map +1 -0
  114. package/dist/composed/rich-chat-input/attachment-strip.d.ts.map +1 -1
  115. package/dist/composed/rich-chat-input/reply-banner.d.ts.map +1 -1
  116. package/dist/composed/rich-chat-input/schedule-send.d.ts.map +1 -1
  117. package/dist/composed/rich-chat-input.d.ts.map +1 -1
  118. package/dist/composed/rich-chat-input.js +2 -1860
  119. package/dist/composed/rich-text-editor.js +561 -424
  120. package/dist/composed/rich-text-editor.js.map +1 -0
  121. package/dist/composed/schedule-view.js +134 -185
  122. package/dist/composed/schedule-view.js.map +1 -0
  123. package/dist/composed/simple-tooltip.js +21 -21
  124. package/dist/composed/simple-tooltip.js.map +1 -0
  125. package/dist/composed/status-badge.d.ts.map +1 -1
  126. package/dist/composed/status-badge.js +133 -137
  127. package/dist/composed/status-badge.js.map +1 -0
  128. package/dist/hooks/index.js +7 -12
  129. package/dist/hooks/use-color-mode.js +28 -25
  130. package/dist/hooks/use-color-mode.js.map +1 -0
  131. package/dist/hooks/use-mobile.js +13 -13
  132. package/dist/hooks/use-mobile.js.map +1 -0
  133. package/dist/hooks/use-toast.js +2 -4
  134. package/dist/hooks/use-touch-device.js +9 -11
  135. package/dist/hooks/use-touch-device.js.map +1 -0
  136. package/dist/hooks/use-viewport-height.js +14 -14
  137. package/dist/hooks/use-viewport-height.js.map +1 -0
  138. package/dist/motion/check-motion-provider.d.ts +3 -0
  139. package/dist/motion/check-motion-provider.d.ts.map +1 -0
  140. package/dist/motion/index.js +17 -11
  141. package/dist/motion/index.js.map +1 -0
  142. package/dist/motion/primitives-index.js +226 -186
  143. package/dist/motion/primitives-index.js.map +1 -0
  144. package/dist/primitives/react-accordion.d.ts +114 -114
  145. package/dist/primitives/react-alert-dialog.d.ts +51 -51
  146. package/dist/primitives/react-aspect-ratio.d.ts +11 -11
  147. package/dist/primitives/react-avatar.d.ts +24 -24
  148. package/dist/primitives/react-checkbox.d.ts +50 -50
  149. package/dist/primitives/react-collapsible.d.ts +33 -33
  150. package/dist/primitives/react-context-menu.d.ts +96 -96
  151. package/dist/primitives/react-dialog.d.ts +103 -103
  152. package/dist/primitives/react-dropdown-menu.d.ts +97 -97
  153. package/dist/primitives/react-hover-card.d.ts +79 -79
  154. package/dist/primitives/react-label.d.ts +10 -10
  155. package/dist/primitives/react-menu.d.ts +169 -169
  156. package/dist/primitives/react-menubar.d.ts +115 -115
  157. package/dist/primitives/react-navigation-menu.d.ts +126 -126
  158. package/dist/primitives/react-popover.d.ts +85 -85
  159. package/dist/primitives/react-progress.d.ts +19 -19
  160. package/dist/primitives/react-radio-group.d.ts +58 -58
  161. package/dist/primitives/react-roving-focus.d.ts +49 -49
  162. package/dist/primitives/react-select.d.ts +137 -137
  163. package/dist/primitives/react-separator.d.ts +21 -21
  164. package/dist/primitives/react-slider.d.ts +75 -75
  165. package/dist/primitives/react-switch.d.ts +21 -21
  166. package/dist/primitives/react-tabs.d.ts +56 -56
  167. package/dist/primitives/react-toast.d.ts +120 -120
  168. package/dist/primitives/react-toggle-group.d.ts +75 -75
  169. package/dist/primitives/react-toggle.d.ts +24 -24
  170. package/dist/primitives/react-tooltip.d.ts +101 -101
  171. package/dist/primitives/react-visually-hidden.d.ts +22 -22
  172. package/dist/shell/app-command-palette.d.ts +2 -0
  173. package/dist/shell/app-command-palette.d.ts.map +1 -1
  174. package/dist/shell/app-command-palette.js +94 -238
  175. package/dist/shell/app-command-palette.js.map +1 -0
  176. package/dist/shell/bottom-navbar.js +150 -190
  177. package/dist/shell/bottom-navbar.js.map +1 -0
  178. package/dist/shell/command-registry.js +13 -14
  179. package/dist/shell/command-registry.js.map +1 -0
  180. package/dist/shell/index.js +10 -20
  181. package/dist/shell/link-context.js +2 -5
  182. package/dist/shell/notification-center.d.ts.map +1 -1
  183. package/dist/shell/notification-center.js +263 -259
  184. package/dist/shell/notification-center.js.map +1 -0
  185. package/dist/shell/notification-preferences.js +241 -184
  186. package/dist/shell/notification-preferences.js.map +1 -0
  187. package/dist/shell/sidebar.js +251 -281
  188. package/dist/shell/sidebar.js.map +1 -0
  189. package/dist/shell/top-bar.js +203 -237
  190. package/dist/shell/top-bar.js.map +1 -0
  191. package/dist/tailwind/index.cjs +473 -442
  192. package/dist/tailwind/index.js +2 -4
  193. package/dist/tailwind/preset.d.ts.map +1 -1
  194. package/dist/tailwind/preset.js +490 -459
  195. package/dist/tailwind/preset.js.map +1 -0
  196. package/dist/tokens/index.css +4 -4
  197. package/dist/tokens/primitives.css +442 -442
  198. package/dist/tokens/semantic.css +742 -547
  199. package/dist/tokens/typography-semantic.css +123 -100
  200. package/dist/tokens/typography.css +422 -422
  201. package/dist/ui/accordion.js +52 -60
  202. package/dist/ui/accordion.js.map +1 -0
  203. package/dist/ui/alert-dialog.d.ts +6 -2
  204. package/dist/ui/alert-dialog.d.ts.map +1 -1
  205. package/dist/ui/alert-dialog.js +112 -156
  206. package/dist/ui/alert-dialog.js.map +1 -0
  207. package/dist/ui/alert.d.ts +3 -2
  208. package/dist/ui/alert.d.ts.map +1 -1
  209. package/dist/ui/alert.js +203 -99
  210. package/dist/ui/alert.js.map +1 -0
  211. package/dist/ui/aspect-ratio.js +13 -16
  212. package/dist/ui/aspect-ratio.js.map +1 -0
  213. package/dist/ui/autocomplete.d.ts.map +1 -1
  214. package/dist/ui/autocomplete.js +137 -148
  215. package/dist/ui/autocomplete.js.map +1 -0
  216. package/dist/ui/avatar.js +196 -169
  217. package/dist/ui/avatar.js.map +1 -0
  218. package/dist/ui/badge-group.js +2 -7
  219. package/dist/ui/badge-indicator.js +42 -51
  220. package/dist/ui/badge-indicator.js.map +1 -0
  221. package/dist/ui/badge.js +2 -15
  222. package/dist/ui/banner.js +76 -68
  223. package/dist/ui/banner.js.map +1 -0
  224. package/dist/ui/breadcrumb.js +65 -84
  225. package/dist/ui/breadcrumb.js.map +1 -0
  226. package/dist/ui/button-group.js +109 -102
  227. package/dist/ui/button-group.js.map +1 -0
  228. package/dist/ui/button-processing.d.ts.map +1 -1
  229. package/dist/ui/button-processing.js +89 -72
  230. package/dist/ui/button-processing.js.map +1 -0
  231. package/dist/ui/button.js +393 -279
  232. package/dist/ui/button.js.map +1 -0
  233. package/dist/ui/card.js +151 -157
  234. package/dist/ui/card.js.map +1 -0
  235. package/dist/ui/charts/bar-chart.d.ts.map +1 -1
  236. package/dist/ui/charts/chart-container.d.ts +2 -0
  237. package/dist/ui/charts/chart-container.d.ts.map +1 -1
  238. package/dist/ui/charts/index.js +1025 -1319
  239. package/dist/ui/charts/index.js.map +1 -0
  240. package/dist/ui/charts/line-chart.d.ts.map +1 -1
  241. package/dist/ui/chat/index.js +2 -11
  242. package/dist/ui/chat/message-input.d.ts.map +1 -1
  243. package/dist/ui/chat/message-list.d.ts +1 -1
  244. package/dist/ui/chat/message-list.d.ts.map +1 -1
  245. package/dist/ui/chat/message.d.ts.map +1 -1
  246. package/dist/ui/chat/system-message.d.ts.map +1 -1
  247. package/dist/ui/checkbox.d.ts.map +1 -1
  248. package/dist/ui/checkbox.js +82 -100
  249. package/dist/ui/checkbox.js.map +1 -0
  250. package/dist/ui/code.js +18 -32
  251. package/dist/ui/code.js.map +1 -0
  252. package/dist/ui/collapsible.js +21 -29
  253. package/dist/ui/collapsible.js.map +1 -0
  254. package/dist/ui/color-input.d.ts.map +1 -1
  255. package/dist/ui/color-input.js +455 -372
  256. package/dist/ui/color-input.js.map +1 -0
  257. package/dist/ui/color-swatch.js +60 -90
  258. package/dist/ui/color-swatch.js.map +1 -0
  259. package/dist/ui/combobox.d.ts +7 -0
  260. package/dist/ui/combobox.d.ts.map +1 -1
  261. package/dist/ui/combobox.js +278 -293
  262. package/dist/ui/combobox.js.map +1 -0
  263. package/dist/ui/container.js +18 -24
  264. package/dist/ui/container.js.map +1 -0
  265. package/dist/ui/context-menu.js +154 -203
  266. package/dist/ui/context-menu.js.map +1 -0
  267. package/dist/ui/data-table-body.js +116 -213
  268. package/dist/ui/data-table-body.js.map +1 -0
  269. package/dist/ui/data-table-bulk-actions.js +43 -59
  270. package/dist/ui/data-table-bulk-actions.js.map +1 -0
  271. package/dist/ui/data-table-card.js +84 -71
  272. package/dist/ui/data-table-card.js.map +1 -0
  273. package/dist/ui/data-table-context.js +39 -42
  274. package/dist/ui/data-table-context.js.map +1 -0
  275. package/dist/ui/data-table-header.js +98 -139
  276. package/dist/ui/data-table-header.js.map +1 -0
  277. package/dist/ui/data-table-pagination.js +69 -82
  278. package/dist/ui/data-table-pagination.js.map +1 -0
  279. package/dist/ui/data-table-toolbar.js +104 -130
  280. package/dist/ui/data-table-toolbar.js.map +1 -0
  281. package/dist/ui/data-table.js +281 -354
  282. package/dist/ui/data-table.js.map +1 -0
  283. package/dist/ui/devalok-grain.js +77 -66
  284. package/dist/ui/devalok-grain.js.map +1 -0
  285. package/dist/ui/dialog.js +118 -151
  286. package/dist/ui/dialog.js.map +1 -0
  287. package/dist/ui/dropdown-menu.js +152 -203
  288. package/dist/ui/dropdown-menu.js.map +1 -0
  289. package/dist/ui/file-upload.js +242 -266
  290. package/dist/ui/file-upload.js.map +1 -0
  291. package/dist/ui/form.d.ts +8 -0
  292. package/dist/ui/form.d.ts.map +1 -1
  293. package/dist/ui/form.js +62 -56
  294. package/dist/ui/form.js.map +1 -0
  295. package/dist/ui/hover-card.js +54 -54
  296. package/dist/ui/hover-card.js.map +1 -0
  297. package/dist/ui/icon-button.js +21 -26
  298. package/dist/ui/icon-button.js.map +1 -0
  299. package/dist/ui/icon-context.js +17 -17
  300. package/dist/ui/icon-context.js.map +1 -0
  301. package/dist/ui/icon-group.js +22 -29
  302. package/dist/ui/icon-group.js.map +1 -0
  303. package/dist/ui/icon.js +201 -121
  304. package/dist/ui/icon.js.map +1 -0
  305. package/dist/ui/index.d.ts +4 -4
  306. package/dist/ui/index.d.ts.map +1 -1
  307. package/dist/ui/index.js +90 -350
  308. package/dist/ui/index.js.map +1 -0
  309. package/dist/ui/input-otp.d.ts +12 -3
  310. package/dist/ui/input-otp.d.ts.map +1 -1
  311. package/dist/ui/input-otp.js +58 -48
  312. package/dist/ui/input-otp.js.map +1 -0
  313. package/dist/ui/input.d.ts.map +1 -1
  314. package/dist/ui/input.js +93 -169
  315. package/dist/ui/input.js.map +1 -0
  316. package/dist/ui/label.d.ts.map +1 -1
  317. package/dist/ui/label.js +23 -23
  318. package/dist/ui/label.js.map +1 -0
  319. package/dist/ui/lib/check-tokens.d.ts +3 -0
  320. package/dist/ui/lib/check-tokens.d.ts.map +1 -0
  321. package/dist/ui/lib/date-utils.js +14 -11
  322. package/dist/ui/lib/date-utils.js.map +1 -0
  323. package/dist/ui/lib/motion.d.ts +15 -4
  324. package/dist/ui/lib/motion.d.ts.map +1 -1
  325. package/dist/ui/lib/motion.js +83 -33
  326. package/dist/ui/lib/motion.js.map +1 -0
  327. package/dist/ui/lib/utils.js +39 -16
  328. package/dist/ui/lib/utils.js.map +1 -0
  329. package/dist/ui/link.js +13 -24
  330. package/dist/ui/link.js.map +1 -0
  331. package/dist/ui/menubar.js +132 -210
  332. package/dist/ui/menubar.js.map +1 -0
  333. package/dist/ui/navigation-menu.js +163 -193
  334. package/dist/ui/navigation-menu.js.map +1 -0
  335. package/dist/ui/number-input.d.ts +16 -1
  336. package/dist/ui/number-input.d.ts.map +1 -1
  337. package/dist/ui/number-input.js +102 -95
  338. package/dist/ui/number-input.js.map +1 -0
  339. package/dist/ui/pagination.js +122 -159
  340. package/dist/ui/pagination.js.map +1 -0
  341. package/dist/ui/popover.js +2 -131
  342. package/dist/ui/progress-ring.d.ts.map +1 -1
  343. package/dist/ui/progress-ring.js +133 -143
  344. package/dist/ui/progress-ring.js.map +1 -0
  345. package/dist/ui/progress.js +51 -95
  346. package/dist/ui/progress.js.map +1 -0
  347. package/dist/ui/radio.d.ts.map +1 -1
  348. package/dist/ui/radio.js +47 -49
  349. package/dist/ui/radio.js.map +1 -0
  350. package/dist/ui/search-input.js +51 -53
  351. package/dist/ui/search-input.js.map +1 -0
  352. package/dist/ui/segmented-control.d.ts +1 -1
  353. package/dist/ui/segmented-control.d.ts.map +1 -1
  354. package/dist/ui/segmented-control.js +95 -114
  355. package/dist/ui/segmented-control.js.map +1 -0
  356. package/dist/ui/select.d.ts.map +1 -1
  357. package/dist/ui/select.js +137 -157
  358. package/dist/ui/select.js.map +1 -0
  359. package/dist/ui/separator.d.ts.map +1 -1
  360. package/dist/ui/separator.js +18 -25
  361. package/dist/ui/separator.js.map +1 -0
  362. package/dist/ui/sheet.js +135 -163
  363. package/dist/ui/sheet.js.map +1 -0
  364. package/dist/ui/sidebar.js +357 -600
  365. package/dist/ui/sidebar.js.map +1 -0
  366. package/dist/ui/skeleton.js +179 -231
  367. package/dist/ui/skeleton.js.map +1 -0
  368. package/dist/ui/slider.d.ts +22 -3
  369. package/dist/ui/slider.d.ts.map +1 -1
  370. package/dist/ui/slider.js +62 -34
  371. package/dist/ui/slider.js.map +1 -0
  372. package/dist/ui/spinner.js +226 -205
  373. package/dist/ui/spinner.js.map +1 -0
  374. package/dist/ui/split-button.d.ts.map +1 -1
  375. package/dist/ui/split-button.js +228 -276
  376. package/dist/ui/split-button.js.map +1 -0
  377. package/dist/ui/stack.js +56 -70
  378. package/dist/ui/stack.js.map +1 -0
  379. package/dist/ui/stat-card.js +259 -251
  380. package/dist/ui/stat-card.js.map +1 -0
  381. package/dist/ui/status-dot.js +67 -63
  382. package/dist/ui/status-dot.js.map +1 -0
  383. package/dist/ui/stepper.d.ts +10 -0
  384. package/dist/ui/stepper.d.ts.map +1 -1
  385. package/dist/ui/stepper.js +124 -168
  386. package/dist/ui/stepper.js.map +1 -0
  387. package/dist/ui/switch.d.ts.map +1 -1
  388. package/dist/ui/switch.js +56 -55
  389. package/dist/ui/switch.js.map +1 -0
  390. package/dist/ui/table.js +57 -90
  391. package/dist/ui/table.js.map +1 -0
  392. package/dist/ui/tabs.d.ts +3 -1
  393. package/dist/ui/tabs.d.ts.map +1 -1
  394. package/dist/ui/tabs.js +159 -156
  395. package/dist/ui/tabs.js.map +1 -0
  396. package/dist/ui/text.d.ts +1 -1
  397. package/dist/ui/text.d.ts.map +1 -1
  398. package/dist/ui/text.js +60 -59
  399. package/dist/ui/text.js.map +1 -0
  400. package/dist/ui/textarea.js +40 -57
  401. package/dist/ui/textarea.js.map +1 -0
  402. package/dist/ui/toast-registry.d.ts +8 -0
  403. package/dist/ui/toast-registry.d.ts.map +1 -0
  404. package/dist/ui/toast-registry.js +13 -0
  405. package/dist/ui/toast-registry.js.map +1 -0
  406. package/dist/ui/toast-types.js +0 -1
  407. package/dist/ui/toast.d.ts.map +1 -1
  408. package/dist/ui/toast.js +559 -536
  409. package/dist/ui/toast.js.map +1 -0
  410. package/dist/ui/toaster.d.ts.map +1 -1
  411. package/dist/ui/toaster.js +24 -33
  412. package/dist/ui/toaster.js.map +1 -0
  413. package/dist/ui/toggle-group.d.ts +2 -0
  414. package/dist/ui/toggle-group.d.ts.map +1 -1
  415. package/dist/ui/toggle-group.js +44 -41
  416. package/dist/ui/toggle-group.js.map +1 -0
  417. package/dist/ui/toggle.d.ts +2 -0
  418. package/dist/ui/toggle.d.ts.map +1 -1
  419. package/dist/ui/toggle.js +44 -40
  420. package/dist/ui/toggle.js.map +1 -0
  421. package/dist/ui/tooltip.js +80 -65
  422. package/dist/ui/tooltip.js.map +1 -0
  423. package/dist/ui/tree-view/index.js +2 -6
  424. package/dist/ui/visually-hidden.js +12 -10
  425. package/dist/ui/visually-hidden.js.map +1 -0
  426. package/docs/components/_header.md +85 -85
  427. package/docs/components/composed/activity-feed.md +62 -62
  428. package/docs/components/composed/avatar-group.md +65 -65
  429. package/docs/components/composed/bulk-action-bar.md +40 -40
  430. package/docs/components/composed/command-palette.md +40 -40
  431. package/docs/components/composed/confirm-dialog.md +46 -46
  432. package/docs/components/composed/content-card.md +36 -36
  433. package/docs/components/composed/date-picker.md +130 -130
  434. package/docs/components/composed/deadline-indicator.md +27 -27
  435. package/docs/components/composed/emoji-picker.md +52 -52
  436. package/docs/components/composed/empty-state.md +53 -53
  437. package/docs/components/composed/error-boundary.md +29 -29
  438. package/docs/components/composed/file-preview.md +40 -40
  439. package/docs/components/composed/filter-bar.md +57 -57
  440. package/docs/components/composed/form-section.md +31 -31
  441. package/docs/components/composed/global-loading.md +27 -27
  442. package/docs/components/composed/inline-edit.md +35 -35
  443. package/docs/components/composed/loading-skeleton.md +51 -51
  444. package/docs/components/composed/markdown-viewer.md +27 -27
  445. package/docs/components/composed/master-detail.md +48 -48
  446. package/docs/components/composed/member-picker.md +35 -35
  447. package/docs/components/composed/multi-select-popover.md +62 -62
  448. package/docs/components/composed/page-header.md +41 -41
  449. package/docs/components/composed/page-skeletons.md +32 -32
  450. package/docs/components/composed/priority-indicator.md +32 -32
  451. package/docs/components/composed/responsive-overlay.md +34 -34
  452. package/docs/components/composed/rich-text-editor.md +82 -82
  453. package/docs/components/composed/schedule-view.md +39 -39
  454. package/docs/components/composed/simple-tooltip.md +33 -33
  455. package/docs/components/composed/status-badge.md +55 -55
  456. package/docs/components/shell/app-command-palette.md +44 -44
  457. package/docs/components/shell/bottom-navbar.md +52 -52
  458. package/docs/components/shell/command-registry.md +48 -48
  459. package/docs/components/shell/link-context.md +41 -41
  460. package/docs/components/shell/notification-center.md +63 -63
  461. package/docs/components/shell/notification-preferences.md +42 -42
  462. package/docs/components/shell/sidebar.md +92 -92
  463. package/docs/components/shell/top-bar.md +143 -143
  464. package/docs/components/ui/accordion.md +51 -51
  465. package/docs/components/ui/alert-dialog.md +61 -61
  466. package/docs/components/ui/alert.md +46 -46
  467. package/docs/components/ui/aspect-ratio.md +25 -25
  468. package/docs/components/ui/autocomplete.md +48 -48
  469. package/docs/components/ui/avatar.md +56 -56
  470. package/docs/components/ui/badge.md +83 -82
  471. package/docs/components/ui/banner.md +42 -42
  472. package/docs/components/ui/breadcrumb.md +37 -37
  473. package/docs/components/ui/button-group.md +41 -41
  474. package/docs/components/ui/button.md +94 -93
  475. package/docs/components/ui/card.md +52 -52
  476. package/docs/components/ui/charts.md +43 -43
  477. package/docs/components/ui/checkbox.md +36 -36
  478. package/docs/components/ui/chip.md +47 -47
  479. package/docs/components/ui/code.md +28 -28
  480. package/docs/components/ui/collapsible.md +40 -40
  481. package/docs/components/ui/color-input.md +91 -91
  482. package/docs/components/ui/color-swatch.md +25 -25
  483. package/docs/components/ui/combobox.md +54 -54
  484. package/docs/components/ui/container.md +26 -26
  485. package/docs/components/ui/context-menu.md +43 -43
  486. package/docs/components/ui/data-table-body.md +1 -1
  487. package/docs/components/ui/data-table-bulk-actions.md +1 -1
  488. package/docs/components/ui/data-table-card.md +1 -1
  489. package/docs/components/ui/data-table-context.md +1 -1
  490. package/docs/components/ui/data-table-header.md +1 -1
  491. package/docs/components/ui/data-table-pagination.md +1 -1
  492. package/docs/components/ui/data-table-toolbar.md +44 -44
  493. package/docs/components/ui/data-table.md +94 -94
  494. package/docs/components/ui/dialog.md +54 -54
  495. package/docs/components/ui/dropdown-menu.md +48 -48
  496. package/docs/components/ui/file-upload.md +41 -41
  497. package/docs/components/ui/form.md +51 -51
  498. package/docs/components/ui/hover-card.md +32 -32
  499. package/docs/components/ui/icon-button.md +40 -40
  500. package/docs/components/ui/input-otp.md +44 -44
  501. package/docs/components/ui/input.md +74 -74
  502. package/docs/components/ui/label.md +25 -25
  503. package/docs/components/ui/link.md +29 -29
  504. package/docs/components/ui/menubar.md +44 -44
  505. package/docs/components/ui/navigation-menu.md +46 -46
  506. package/docs/components/ui/number-input.md +44 -44
  507. package/docs/components/ui/pagination.md +48 -48
  508. package/docs/components/ui/popover.md +30 -30
  509. package/docs/components/ui/progress-ring.md +41 -41
  510. package/docs/components/ui/progress.md +34 -34
  511. package/docs/components/ui/radio.md +34 -34
  512. package/docs/components/ui/search-input.md +43 -43
  513. package/docs/components/ui/segmented-control.md +50 -50
  514. package/docs/components/ui/select.md +53 -53
  515. package/docs/components/ui/separator.md +32 -32
  516. package/docs/components/ui/sheet.md +47 -47
  517. package/docs/components/ui/sidebar.md +72 -72
  518. package/docs/components/ui/skeleton.md +77 -77
  519. package/docs/components/ui/slider.md +29 -29
  520. package/docs/components/ui/spinner.md +54 -54
  521. package/docs/components/ui/stack.md +39 -39
  522. package/docs/components/ui/stat-card.md +61 -61
  523. package/docs/components/ui/status-dot.md +26 -26
  524. package/docs/components/ui/stepper.md +49 -49
  525. package/docs/components/ui/switch.md +47 -47
  526. package/docs/components/ui/table.md +47 -47
  527. package/docs/components/ui/tabs.md +60 -60
  528. package/docs/components/ui/text.md +37 -37
  529. package/docs/components/ui/textarea.md +39 -39
  530. package/docs/components/ui/toast.md +65 -65
  531. package/docs/components/ui/toaster.md +47 -47
  532. package/docs/components/ui/toggle-group.md +43 -43
  533. package/docs/components/ui/toggle.md +37 -37
  534. package/docs/components/ui/tooltip.md +38 -38
  535. package/docs/components/ui/tree-view.md +65 -65
  536. package/docs/components/ui/visually-hidden.md +21 -21
  537. package/llms-full.txt +5266 -5264
  538. package/llms.txt +624 -580
  539. package/package.json +7 -8
  540. package/dist/_chunks/date-time-picker.js +0 -851
  541. package/dist/_chunks/typing-indicator.js +0 -565
package/dist/ui/toast.js CHANGED
@@ -1,551 +1,574 @@
1
1
  "use client";
2
- import { jsx as t, jsxs as l } from "react/jsx-runtime";
3
- import * as f from "react";
4
- import { t as p } from "../_chunks/sonner.js";
5
- import { IconInfoCircle as P, IconAlertTriangle as j, IconCircleX as L, IconCircleCheck as _, IconCheck as U, IconAlertCircle as E, IconPhoto as G, IconFile as X, IconRefresh as H, IconX as Y, IconUpload as K } from "@tabler/icons-react";
6
- import { cn as k } from "./lib/utils.js";
7
- import { springs as v, tweens as b } from "./lib/motion.js";
8
- import { Spinner as A } from "./spinner.js";
9
- import { Progress as V } from "./progress.js";
10
- import { Icon as g } from "./icon.js";
11
- import { m as o, A as R } from "../_chunks/framer.js";
12
- const F = 5e3, W = 8e3, z = 3e3, D = {
13
- message: {
14
- accentClass: "",
15
- iconClass: "",
16
- icon: null,
17
- timerBarClass: "bg-surface-border"
18
- },
19
- success: {
20
- accentClass: "bg-success-9",
21
- iconClass: "text-success-11",
22
- icon: _,
23
- timerBarClass: "bg-success-9"
24
- },
25
- error: {
26
- accentClass: "bg-error-9",
27
- iconClass: "text-error-11",
28
- icon: L,
29
- timerBarClass: "bg-error-9"
30
- },
31
- warning: {
32
- accentClass: "bg-warning-9",
33
- iconClass: "text-warning-11",
34
- icon: j,
35
- timerBarClass: "bg-warning-9"
36
- },
37
- info: {
38
- accentClass: "bg-info-9",
39
- iconClass: "text-info-11",
40
- icon: P,
41
- timerBarClass: "bg-info-9"
42
- },
43
- loading: {
44
- accentClass: "bg-accent-9",
45
- iconClass: "text-accent-11",
46
- icon: null,
47
- timerBarClass: "bg-accent-9"
48
- }
2
+ import { a as e, c as t } from "../_chunks/framer.js";
3
+ import { springs as n, tweens as r } from "./lib/motion.js";
4
+ import { cn as i } from "./lib/utils.js";
5
+ import { Spinner as a } from "./spinner.js";
6
+ import { Icon as o } from "./icon.js";
7
+ import { n as s } from "../_chunks/sonner.js";
8
+ import { Progress as c } from "./progress.js";
9
+ import { assertToasterMounted as l } from "./toast-registry.js";
10
+ import * as u from "react";
11
+ import { jsx as d, jsxs as f } from "react/jsx-runtime";
12
+ import { IconAlertCircle as p, IconAlertTriangle as m, IconCheck as h, IconCircleCheck as g, IconCircleX as _, IconFile as v, IconInfoCircle as y, IconPhoto as b, IconRefresh as x, IconUpload as S, IconX as C } from "@tabler/icons-react";
13
+ //#region src/ui/toast.tsx
14
+ var w = 5e3, T = 8e3, E = 3e3, D = {
15
+ message: {
16
+ accentClass: "",
17
+ iconClass: "",
18
+ icon: null,
19
+ timerBarClass: "bg-surface-border"
20
+ },
21
+ success: {
22
+ accentClass: "bg-success-9",
23
+ iconClass: "text-success-11",
24
+ icon: g,
25
+ timerBarClass: "bg-success-9"
26
+ },
27
+ error: {
28
+ accentClass: "bg-error-9",
29
+ iconClass: "text-error-11",
30
+ icon: _,
31
+ timerBarClass: "bg-error-9"
32
+ },
33
+ warning: {
34
+ accentClass: "bg-warning-9",
35
+ iconClass: "text-warning-11",
36
+ icon: m,
37
+ timerBarClass: "bg-warning-9"
38
+ },
39
+ info: {
40
+ accentClass: "bg-info-9",
41
+ iconClass: "text-info-11",
42
+ icon: y,
43
+ timerBarClass: "bg-info-9"
44
+ },
45
+ loading: {
46
+ accentClass: "bg-accent-9",
47
+ iconClass: "text-accent-11",
48
+ icon: null,
49
+ timerBarClass: "bg-accent-9"
50
+ }
49
51
  };
50
- function M({
51
- duration: e,
52
- type: s,
53
- paused: a
54
- }) {
55
- const r = D[s];
56
- return /* @__PURE__ */ t("div", { className: "absolute bottom-0 left-0 right-0 h-[2px] overflow-hidden", children: /* @__PURE__ */ t(
57
- "div",
58
- {
59
- className: k(
60
- "h-full w-full origin-left opacity-30",
61
- r.timerBarClass,
62
- "motion-safe:animate-timer-bar"
63
- ),
64
- style: {
65
- animationDuration: `${e}ms`,
66
- animationPlayState: a ? "paused" : "running"
67
- }
68
- }
69
- ) });
52
+ function O({ duration: e, type: t, paused: n }) {
53
+ let r = D[t];
54
+ return /* @__PURE__ */ d("div", {
55
+ className: "absolute bottom-0 left-0 right-0 h-[2px] overflow-hidden",
56
+ children: /* @__PURE__ */ d("div", {
57
+ className: i("h-full w-full origin-left opacity-30", r.timerBarClass, "motion-safe:animate-timer-bar"),
58
+ style: {
59
+ animationDuration: `${e}ms`,
60
+ animationPlayState: n ? "paused" : "running"
61
+ }
62
+ })
63
+ });
70
64
  }
71
- function B({
72
- type: e,
73
- title: s,
74
- description: a,
75
- action: r,
76
- cancel: n,
77
- duration: c = F,
78
- showTimerBar: $ = !0,
79
- selfDismissId: N
80
- }) {
81
- const [I, w] = f.useState(!1), [m, u] = f.useState(!1), h = I || m, x = D[e], T = x.icon, C = f.useRef(c), i = f.useRef(0);
82
- return f.useEffect(() => {
83
- if (N == null || c === 1 / 0) return;
84
- if (h) {
85
- const O = Date.now() - i.current;
86
- C.current = Math.max(0, C.current - O);
87
- return;
88
- }
89
- i.current = Date.now();
90
- const S = setTimeout(() => {
91
- p.dismiss(N);
92
- }, C.current);
93
- return () => clearTimeout(S);
94
- }, [N, c, h]), /* @__PURE__ */ l(
95
- o.div,
96
- {
97
- layout: "position",
98
- role: "status",
99
- "aria-live": "polite",
100
- className: "group relative flex w-full overflow-hidden rounded-ds-md border border-surface-border-strong bg-surface-overlay shadow-floating",
101
- onMouseEnter: () => w(!0),
102
- onMouseLeave: () => w(!1),
103
- onFocusCapture: () => u(!0),
104
- onBlurCapture: () => u(!1),
105
- transition: v.smooth,
106
- children: [
107
- x.accentClass && /* @__PURE__ */ t(
108
- "div",
109
- {
110
- className: k("w-1 shrink-0 rounded-l-ds-md", x.accentClass)
111
- }
112
- ),
113
- /* @__PURE__ */ l("div", { className: "flex min-w-0 flex-1 items-start gap-ds-03 p-ds-04", children: [
114
- /* @__PURE__ */ t(R, { mode: "wait", children: e === "loading" ? /* @__PURE__ */ t(
115
- o.div,
116
- {
117
- initial: { opacity: 0, scale: 0.5 },
118
- animate: { opacity: 1, scale: 1 },
119
- exit: { opacity: 0, scale: 0.5 },
120
- transition: b.fade,
121
- className: "mt-0.5 shrink-0",
122
- children: /* @__PURE__ */ t(A, { size: "sm", className: "h-4 w-4" })
123
- },
124
- "loading"
125
- ) : T ? /* @__PURE__ */ t(
126
- o.div,
127
- {
128
- initial: { opacity: 0, scale: 0.5 },
129
- animate: { opacity: 1, scale: 1 },
130
- exit: { opacity: 0, scale: 0.5 },
131
- transition: v.bouncy,
132
- className: "mt-0.5 shrink-0",
133
- children: /* @__PURE__ */ t(g, { icon: T, size: "sm", className: x.iconClass })
134
- },
135
- e
136
- ) : null }),
137
- /* @__PURE__ */ l("div", { className: "min-w-0 flex-1", children: [
138
- s && /* @__PURE__ */ t("p", { className: "text-ds-md font-semibold text-surface-fg", children: s }),
139
- a && /* @__PURE__ */ t(
140
- "p",
141
- {
142
- className: k(
143
- "text-ds-sm text-surface-fg-muted",
144
- s && "mt-0.5"
145
- ),
146
- children: a
147
- }
148
- ),
149
- (r || n) && /* @__PURE__ */ l("div", { className: "mt-ds-03 flex items-center gap-ds-03", children: [
150
- r && /* @__PURE__ */ t(
151
- "button",
152
- {
153
- type: "button",
154
- onClick: r.onClick,
155
- className: "text-ds-sm font-medium text-accent-11 underline-offset-2 hover:underline hover:bg-surface-raised-hover rounded-ds-sm px-ds-02 py-ds-01 transition-[color,background-color] duration-fast-01 ease-productive-standard focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-accent-9 focus-visible:rounded-ds-sm",
156
- children: r.label
157
- }
158
- ),
159
- n && /* @__PURE__ */ t(
160
- "button",
161
- {
162
- type: "button",
163
- onClick: n.onClick,
164
- className: "text-ds-sm text-surface-fg-muted hover:text-surface-fg focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-accent-9 focus-visible:rounded-ds-sm",
165
- children: n.label
166
- }
167
- )
168
- ] })
169
- ] })
170
- ] }),
171
- $ && e !== "loading" && /* @__PURE__ */ t(M, { duration: c, type: e, paused: h })
172
- ]
173
- }
174
- );
65
+ function k({ type: c, title: l, description: p, action: m, cancel: h, duration: g = w, showTimerBar: _ = !0, selfDismissId: v }) {
66
+ let [y, b] = u.useState(!1), [x, S] = u.useState(!1), C = y || x, T = D[c], E = T.icon, k = u.useRef(g), A = u.useRef(0);
67
+ u.useEffect(() => {
68
+ if (v == null || g === Infinity) return;
69
+ if (C) {
70
+ let e = Date.now() - A.current;
71
+ k.current = Math.max(0, k.current - e);
72
+ return;
73
+ }
74
+ A.current = Date.now();
75
+ let e = setTimeout(() => {
76
+ s.dismiss(v);
77
+ }, k.current);
78
+ return () => clearTimeout(e);
79
+ }, [
80
+ v,
81
+ g,
82
+ C
83
+ ]);
84
+ let j = c === "error";
85
+ return /* @__PURE__ */ f(e.div, {
86
+ layout: "position",
87
+ role: j ? "alert" : "status",
88
+ "aria-live": j ? "assertive" : "polite",
89
+ "aria-atomic": "true",
90
+ className: "group relative flex w-full overflow-hidden rounded-ds-md border border-surface-border-strong bg-surface-overlay shadow-floating",
91
+ onMouseEnter: () => b(!0),
92
+ onMouseLeave: () => b(!1),
93
+ onFocusCapture: () => S(!0),
94
+ onBlurCapture: () => S(!1),
95
+ transition: n.smooth,
96
+ children: [
97
+ T.accentClass && /* @__PURE__ */ d("div", { className: i("w-1 shrink-0 rounded-l-ds-md", T.accentClass) }),
98
+ /* @__PURE__ */ f("div", {
99
+ className: "flex min-w-0 flex-1 items-start gap-ds-03 p-ds-04",
100
+ children: [/* @__PURE__ */ d(t, {
101
+ mode: "wait",
102
+ children: c === "loading" ? /* @__PURE__ */ d(e.div, {
103
+ initial: {
104
+ opacity: 0,
105
+ scale: .5
106
+ },
107
+ animate: {
108
+ opacity: 1,
109
+ scale: 1
110
+ },
111
+ exit: {
112
+ opacity: 0,
113
+ scale: .5
114
+ },
115
+ transition: r.fade,
116
+ className: "mt-0.5 shrink-0",
117
+ children: /* @__PURE__ */ d(a, {
118
+ size: "sm",
119
+ className: "h-4 w-4"
120
+ })
121
+ }, "loading") : E ? /* @__PURE__ */ d(e.div, {
122
+ initial: {
123
+ opacity: 0,
124
+ scale: .5
125
+ },
126
+ animate: {
127
+ opacity: 1,
128
+ scale: 1
129
+ },
130
+ exit: {
131
+ opacity: 0,
132
+ scale: .5
133
+ },
134
+ transition: n.bouncy,
135
+ className: "mt-0.5 shrink-0",
136
+ children: /* @__PURE__ */ d(o, {
137
+ icon: E,
138
+ size: "sm",
139
+ className: T.iconClass
140
+ })
141
+ }, c) : null
142
+ }), /* @__PURE__ */ f("div", {
143
+ className: "min-w-0 flex-1",
144
+ children: [
145
+ l && /* @__PURE__ */ d("p", {
146
+ className: "text-ds-md font-semibold text-surface-fg",
147
+ children: l
148
+ }),
149
+ p && /* @__PURE__ */ d("p", {
150
+ className: i("text-ds-sm text-surface-fg-muted", l && "mt-0.5"),
151
+ children: p
152
+ }),
153
+ (m || h) && /* @__PURE__ */ f("div", {
154
+ className: "mt-ds-03 flex items-center gap-ds-03",
155
+ children: [m && /* @__PURE__ */ d("button", {
156
+ type: "button",
157
+ onClick: m.onClick,
158
+ className: "text-ds-sm font-medium text-accent-11 underline-offset-2 hover:underline hover:bg-surface-raised-hover rounded-ds-sm px-ds-02 py-ds-01 transition-[color,background-color] duration-fast-01 ease-productive-standard focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-accent-9 focus-visible:rounded-ds-sm",
159
+ children: m.label
160
+ }), h && /* @__PURE__ */ d("button", {
161
+ type: "button",
162
+ onClick: h.onClick,
163
+ className: "text-ds-sm text-surface-fg-muted hover:text-surface-fg focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-accent-9 focus-visible:rounded-ds-sm",
164
+ children: h.label
165
+ })]
166
+ })
167
+ ]
168
+ })]
169
+ }),
170
+ _ && c !== "loading" && /* @__PURE__ */ d(O, {
171
+ duration: g,
172
+ type: c,
173
+ paused: C
174
+ })
175
+ ]
176
+ });
175
177
  }
176
- const q = /* @__PURE__ */ new Set([
177
- "jpg",
178
- "jpeg",
179
- "png",
180
- "gif",
181
- "webp",
182
- "svg",
183
- "bmp",
184
- "ico",
185
- "avif"
178
+ var A = new Set([
179
+ "jpg",
180
+ "jpeg",
181
+ "png",
182
+ "gif",
183
+ "webp",
184
+ "svg",
185
+ "bmp",
186
+ "ico",
187
+ "avif"
186
188
  ]);
187
- function J(e) {
188
- if (e.previewUrl) return !0;
189
- const s = e.name.split(".").pop()?.toLowerCase() ?? "";
190
- return q.has(s);
189
+ function j(e) {
190
+ if (e.previewUrl) return !0;
191
+ let t = e.name.split(".").pop()?.toLowerCase() ?? "";
192
+ return A.has(t);
191
193
  }
192
- function Q(e) {
193
- switch (e) {
194
- case "complete":
195
- return "success";
196
- case "error":
197
- return "error";
198
- default:
199
- return "default";
200
- }
194
+ function M(e) {
195
+ switch (e) {
196
+ case "complete": return "success";
197
+ case "error": return "error";
198
+ default: return "default";
199
+ }
201
200
  }
202
- function Z(e) {
203
- switch (e.status) {
204
- case "pending":
205
- return 0;
206
- case "uploading":
207
- return e.progress ?? 0;
208
- case "processing":
209
- return;
210
- case "complete":
211
- return 100;
212
- case "error":
213
- return e.progress ?? 0;
214
- }
201
+ function N(e) {
202
+ switch (e.status) {
203
+ case "pending": return 0;
204
+ case "uploading": return e.progress ?? 0;
205
+ case "processing": return;
206
+ case "complete": return 100;
207
+ case "error": return e.progress ?? 0;
208
+ }
215
209
  }
216
- function ee(e) {
217
- return !e || e < 0 || !Number.isFinite(e) ? "0 B" : e < 1024 ? `${e} B` : e < 1024 * 1024 ? `${(e / 1024).toFixed(1)} KB` : e < 1024 * 1024 * 1024 ? `${(e / (1024 * 1024)).toFixed(1)} MB` : `${(e / (1024 * 1024 * 1024)).toFixed(2)} GB`;
210
+ function P(e) {
211
+ return !e || e < 0 || !Number.isFinite(e) ? "0 B" : e < 1024 ? `${e} B` : e < 1024 * 1024 ? `${(e / 1024).toFixed(1)} KB` : e < 1024 * 1024 * 1024 ? `${(e / (1024 * 1024)).toFixed(1)} MB` : `${(e / (1024 * 1024 * 1024)).toFixed(2)} GB`;
218
212
  }
219
- function te({
220
- file: e,
221
- onRetry: s,
222
- onRemove: a
223
- }) {
224
- const r = e.status === "complete" || e.status === "error", n = e.status === "uploading" || e.status === "processing";
225
- return /* @__PURE__ */ l(
226
- o.div,
227
- {
228
- layout: !0,
229
- className: "flex items-center gap-ds-02 py-1",
230
- initial: !1,
231
- animate: { opacity: 1, y: 0 },
232
- exit: { opacity: 0, x: -20, height: 0 },
233
- transition: v.snappy,
234
- children: [
235
- /* @__PURE__ */ t("div", { className: "flex h-5 w-5 shrink-0 items-center justify-center", children: /* @__PURE__ */ t(R, { mode: "wait", children: e.status === "complete" ? /* @__PURE__ */ t(
236
- o.div,
237
- {
238
- initial: { opacity: 0, scale: 0.5 },
239
- animate: { opacity: 1, scale: 1 },
240
- exit: { opacity: 0, scale: 0.5 },
241
- transition: v.bouncy,
242
- children: /* @__PURE__ */ t(g, { icon: U, size: "xs", className: "text-success-11" })
243
- },
244
- "complete"
245
- ) : e.status === "error" ? /* @__PURE__ */ t(
246
- o.div,
247
- {
248
- initial: { opacity: 0, scale: 0.5 },
249
- animate: { opacity: 1, scale: 1 },
250
- exit: { opacity: 0, scale: 0.5 },
251
- transition: b.fade,
252
- children: /* @__PURE__ */ t(g, { icon: E, size: "xs", className: "text-error-11" })
253
- },
254
- "error"
255
- ) : e.status === "processing" ? /* @__PURE__ */ t(
256
- o.div,
257
- {
258
- initial: { opacity: 0 },
259
- animate: { opacity: 1 },
260
- exit: { opacity: 0 },
261
- transition: b.fade,
262
- children: /* @__PURE__ */ t(A, { size: "sm", className: "h-3.5 w-3.5" })
263
- },
264
- "processing"
265
- ) : J(e) ? /* @__PURE__ */ t(
266
- o.div,
267
- {
268
- initial: { opacity: 0 },
269
- animate: { opacity: 1 },
270
- exit: { opacity: 0 },
271
- transition: b.fade,
272
- children: /* @__PURE__ */ t(g, { icon: G, size: "xs", className: "text-surface-fg-muted" })
273
- },
274
- "image"
275
- ) : /* @__PURE__ */ t(
276
- o.div,
277
- {
278
- initial: { opacity: 0 },
279
- animate: { opacity: 1 },
280
- exit: { opacity: 0 },
281
- transition: b.fade,
282
- children: /* @__PURE__ */ t(g, { icon: X, size: "xs", className: "text-surface-fg-muted" })
283
- },
284
- "file"
285
- ) }) }),
286
- /* @__PURE__ */ t("span", { className: "min-w-0 flex-1 truncate text-ds-xs text-surface-fg", children: e.name }),
287
- n ? /* @__PURE__ */ l("div", { className: "flex w-16 items-center gap-1", children: [
288
- /* @__PURE__ */ t(
289
- V,
290
- {
291
- size: "sm",
292
- color: Q(e.status),
293
- value: Z(e),
294
- className: "flex-1"
295
- }
296
- ),
297
- e.progress !== void 0 && /* @__PURE__ */ l("span", { className: "shrink-0 text-ds-xs tabular-nums text-surface-fg-muted", children: [
298
- e.progress,
299
- "%"
300
- ] })
301
- ] }) : e.status === "complete" ? /* @__PURE__ */ t("span", { className: "text-ds-xs text-success-11", children: "Done" }) : e.status === "error" ? /* @__PURE__ */ t("span", { className: "max-w-[60px] truncate text-ds-xs text-error-11", children: e.error || "Failed" }) : /* @__PURE__ */ t("span", { className: "text-ds-xs text-surface-fg-muted", children: ee(e.size) }),
302
- e.status === "error" && s && /* @__PURE__ */ t(
303
- "button",
304
- {
305
- type: "button",
306
- onClick: () => s(e.id),
307
- className: "touch-target flex min-h-6 min-w-6 items-center justify-center rounded-ds-sm text-surface-fg-muted hover:text-surface-fg",
308
- "aria-label": `Retry ${e.name}`,
309
- title: "Retry",
310
- children: /* @__PURE__ */ t(H, { className: "h-3.5 w-3.5" })
311
- }
312
- ),
313
- !r && a && /* @__PURE__ */ t(
314
- "button",
315
- {
316
- type: "button",
317
- onClick: () => a(e.id),
318
- className: "touch-target flex min-h-6 min-w-6 items-center justify-center rounded-ds-sm text-surface-fg-muted hover:text-surface-fg",
319
- "aria-label": `Cancel ${e.name}`,
320
- title: "Remove",
321
- children: /* @__PURE__ */ t(Y, { className: "h-3.5 w-3.5" })
322
- }
323
- )
324
- ]
325
- }
326
- );
213
+ function F({ file: i, onRetry: s, onRemove: l }) {
214
+ let u = i.status === "complete" || i.status === "error", m = i.status === "uploading" || i.status === "processing";
215
+ return /* @__PURE__ */ f(e.div, {
216
+ layout: !0,
217
+ className: "flex items-center gap-ds-02 py-1",
218
+ initial: !1,
219
+ animate: {
220
+ opacity: 1,
221
+ y: 0
222
+ },
223
+ exit: {
224
+ opacity: 0,
225
+ x: -20,
226
+ height: 0
227
+ },
228
+ transition: n.snappy,
229
+ children: [
230
+ /* @__PURE__ */ d("div", {
231
+ className: "flex h-5 w-5 shrink-0 items-center justify-center",
232
+ children: /* @__PURE__ */ d(t, {
233
+ mode: "wait",
234
+ children: i.status === "complete" ? /* @__PURE__ */ d(e.div, {
235
+ initial: {
236
+ opacity: 0,
237
+ scale: .5
238
+ },
239
+ animate: {
240
+ opacity: 1,
241
+ scale: 1
242
+ },
243
+ exit: {
244
+ opacity: 0,
245
+ scale: .5
246
+ },
247
+ transition: n.bouncy,
248
+ children: /* @__PURE__ */ d(o, {
249
+ icon: h,
250
+ size: "xs",
251
+ className: "text-success-11"
252
+ })
253
+ }, "complete") : i.status === "error" ? /* @__PURE__ */ d(e.div, {
254
+ initial: {
255
+ opacity: 0,
256
+ scale: .5
257
+ },
258
+ animate: {
259
+ opacity: 1,
260
+ scale: 1
261
+ },
262
+ exit: {
263
+ opacity: 0,
264
+ scale: .5
265
+ },
266
+ transition: r.fade,
267
+ children: /* @__PURE__ */ d(o, {
268
+ icon: p,
269
+ size: "xs",
270
+ className: "text-error-11"
271
+ })
272
+ }, "error") : i.status === "processing" ? /* @__PURE__ */ d(e.div, {
273
+ initial: { opacity: 0 },
274
+ animate: { opacity: 1 },
275
+ exit: { opacity: 0 },
276
+ transition: r.fade,
277
+ children: /* @__PURE__ */ d(a, {
278
+ size: "sm",
279
+ className: "h-3.5 w-3.5"
280
+ })
281
+ }, "processing") : j(i) ? /* @__PURE__ */ d(e.div, {
282
+ initial: { opacity: 0 },
283
+ animate: { opacity: 1 },
284
+ exit: { opacity: 0 },
285
+ transition: r.fade,
286
+ children: /* @__PURE__ */ d(o, {
287
+ icon: b,
288
+ size: "xs",
289
+ className: "text-surface-fg-muted"
290
+ })
291
+ }, "image") : /* @__PURE__ */ d(e.div, {
292
+ initial: { opacity: 0 },
293
+ animate: { opacity: 1 },
294
+ exit: { opacity: 0 },
295
+ transition: r.fade,
296
+ children: /* @__PURE__ */ d(o, {
297
+ icon: v,
298
+ size: "xs",
299
+ className: "text-surface-fg-muted"
300
+ })
301
+ }, "file")
302
+ })
303
+ }),
304
+ /* @__PURE__ */ d("span", {
305
+ className: "min-w-0 flex-1 truncate text-ds-xs text-surface-fg",
306
+ children: i.name
307
+ }),
308
+ m ? /* @__PURE__ */ f("div", {
309
+ className: "flex w-16 items-center gap-1",
310
+ children: [/* @__PURE__ */ d(c, {
311
+ size: "sm",
312
+ color: M(i.status),
313
+ value: N(i),
314
+ className: "flex-1"
315
+ }), i.progress !== void 0 && /* @__PURE__ */ f("span", {
316
+ className: "shrink-0 text-ds-xs tabular-nums text-surface-fg-muted",
317
+ children: [i.progress, "%"]
318
+ })]
319
+ }) : i.status === "complete" ? /* @__PURE__ */ d("span", {
320
+ className: "text-ds-xs text-success-11",
321
+ children: "Done"
322
+ }) : i.status === "error" ? /* @__PURE__ */ d("span", {
323
+ className: "max-w-[60px] truncate text-ds-xs text-error-11",
324
+ children: i.error || "Failed"
325
+ }) : /* @__PURE__ */ d("span", {
326
+ className: "text-ds-xs text-surface-fg-muted",
327
+ children: P(i.size)
328
+ }),
329
+ i.status === "error" && s && /* @__PURE__ */ d("button", {
330
+ type: "button",
331
+ onClick: () => s(i.id),
332
+ className: "touch-target flex min-h-6 min-w-6 items-center justify-center rounded-ds-sm text-surface-fg-muted hover:text-surface-fg",
333
+ "aria-label": `Retry ${i.name}`,
334
+ title: "Retry",
335
+ children: /* @__PURE__ */ d(x, { className: "h-3.5 w-3.5" })
336
+ }),
337
+ !u && l && /* @__PURE__ */ d("button", {
338
+ type: "button",
339
+ onClick: () => l(i.id),
340
+ className: "touch-target flex min-h-6 min-w-6 items-center justify-center rounded-ds-sm text-surface-fg-muted hover:text-surface-fg",
341
+ "aria-label": `Cancel ${i.name}`,
342
+ title: "Remove",
343
+ children: /* @__PURE__ */ d(C, { className: "h-3.5 w-3.5" })
344
+ })
345
+ ]
346
+ });
327
347
  }
328
- function se({
329
- files: e,
330
- onRetry: s,
331
- onRemove: a,
332
- selfDismissId: r
333
- }) {
334
- const [n, c] = f.useState(!1), [$, N] = f.useState(!1), I = n || $, w = e.filter((i) => i.status === "complete").length, m = e.filter((i) => i.status === "error").length, u = e.every(
335
- (i) => i.status === "complete" || i.status === "error"
336
- ), h = f.useRef(z), x = f.useRef(0);
337
- f.useEffect(() => {
338
- if (r == null || !u) return;
339
- if (I) {
340
- const S = Date.now() - x.current;
341
- h.current = Math.max(0, h.current - S);
342
- return;
343
- }
344
- x.current = Date.now();
345
- const i = setTimeout(() => {
346
- p.dismiss(r);
347
- }, h.current);
348
- return () => clearTimeout(i);
349
- }, [r, u, I]);
350
- const T = u ? m > 0 ? "bg-error-7" : "bg-success-7" : "bg-accent-9", C = u ? m > 0 ? "error" : "success" : "loading";
351
- return /* @__PURE__ */ l(
352
- o.div,
353
- {
354
- layout: !0,
355
- role: "status",
356
- "aria-live": "polite",
357
- "aria-label": "File uploads",
358
- className: "group relative flex w-full overflow-hidden rounded-ds-md border border-surface-border-strong bg-surface-overlay shadow-floating",
359
- onMouseEnter: () => c(!0),
360
- onMouseLeave: () => c(!1),
361
- onFocusCapture: () => N(!0),
362
- onBlurCapture: () => N(!1),
363
- transition: v.smooth,
364
- children: [
365
- /* @__PURE__ */ t("div", { className: k("w-1 shrink-0 rounded-l-ds-md", T) }),
366
- /* @__PURE__ */ l("div", { className: "min-w-0 flex-1 p-ds-04", children: [
367
- /* @__PURE__ */ l("div", { className: "flex items-center gap-ds-02", children: [
368
- /* @__PURE__ */ t(R, { mode: "wait", children: u ? m > 0 ? /* @__PURE__ */ t(
369
- o.div,
370
- {
371
- initial: { opacity: 0, scale: 0.5 },
372
- animate: { opacity: 1, scale: 1 },
373
- exit: { opacity: 0, scale: 0.5 },
374
- transition: v.bouncy,
375
- children: /* @__PURE__ */ t(g, { icon: E, size: "sm", className: "shrink-0 text-error-11" })
376
- },
377
- "error-icon"
378
- ) : /* @__PURE__ */ t(
379
- o.div,
380
- {
381
- initial: { opacity: 0, scale: 0.5 },
382
- animate: { opacity: 1, scale: 1 },
383
- exit: { opacity: 0, scale: 0.5 },
384
- transition: v.bouncy,
385
- children: /* @__PURE__ */ t(g, { icon: U, size: "sm", className: "shrink-0 text-success-11" })
386
- },
387
- "success-icon"
388
- ) : /* @__PURE__ */ t(
389
- o.div,
390
- {
391
- initial: { opacity: 0 },
392
- animate: { opacity: 1 },
393
- exit: { opacity: 0 },
394
- transition: b.fade,
395
- children: /* @__PURE__ */ t(g, { icon: K, size: "sm", className: "shrink-0 text-surface-fg-muted" })
396
- },
397
- "upload-icon"
398
- ) }),
399
- /* @__PURE__ */ t("p", { className: "text-ds-md font-semibold text-surface-fg", children: u ? m > 0 ? `${w} of ${e.length} uploaded` : `${e.length} file${e.length > 1 ? "s" : ""} uploaded` : `Uploading ${e.length} file${e.length > 1 ? "s" : ""}` })
400
- ] }),
401
- !u && /* @__PURE__ */ l("p", { className: "mt-0.5 text-ds-xs text-surface-fg-muted", children: [
402
- w,
403
- " of ",
404
- e.length,
405
- " complete",
406
- m > 0 && ` · ${m} failed`
407
- ] }),
408
- /* @__PURE__ */ t("div", { className: "mt-ds-02 max-h-[140px] overflow-y-auto", children: /* @__PURE__ */ t(R, { children: e.map((i) => /* @__PURE__ */ t(
409
- te,
410
- {
411
- file: i,
412
- onRetry: s,
413
- onRemove: a
414
- },
415
- i.id
416
- )) }) }),
417
- /* @__PURE__ */ l("div", { className: "sr-only", "aria-live": "polite", children: [
418
- w,
419
- " of ",
420
- e.length,
421
- " files uploaded",
422
- m > 0 && `, ${m} failed`
423
- ] })
424
- ] }),
425
- u && /* @__PURE__ */ t(
426
- M,
427
- {
428
- duration: z,
429
- type: C,
430
- paused: !1
431
- }
432
- )
433
- ]
434
- }
435
- );
348
+ function I({ files: a, onRetry: c, onRemove: l, selfDismissId: m }) {
349
+ let [g, _] = u.useState(!1), [v, y] = u.useState(!1), b = g || v, x = a.filter((e) => e.status === "complete").length, C = a.filter((e) => e.status === "error").length, w = a.every((e) => e.status === "complete" || e.status === "error"), T = u.useRef(E), D = u.useRef(0);
350
+ u.useEffect(() => {
351
+ if (m == null || !w) return;
352
+ if (b) {
353
+ let e = Date.now() - D.current;
354
+ T.current = Math.max(0, T.current - e);
355
+ return;
356
+ }
357
+ D.current = Date.now();
358
+ let e = setTimeout(() => {
359
+ s.dismiss(m);
360
+ }, T.current);
361
+ return () => clearTimeout(e);
362
+ }, [
363
+ m,
364
+ w,
365
+ b
366
+ ]);
367
+ let k = w ? C > 0 ? "bg-error-7" : "bg-success-7" : "bg-accent-9", A = w ? C > 0 ? "error" : "success" : "loading", j = w && C > 0;
368
+ return /* @__PURE__ */ f(e.div, {
369
+ layout: !0,
370
+ role: j ? "alert" : "status",
371
+ "aria-live": j ? "assertive" : "polite",
372
+ "aria-label": "File uploads",
373
+ className: "group relative flex w-full overflow-hidden rounded-ds-md border border-surface-border-strong bg-surface-overlay shadow-floating",
374
+ onMouseEnter: () => _(!0),
375
+ onMouseLeave: () => _(!1),
376
+ onFocusCapture: () => y(!0),
377
+ onBlurCapture: () => y(!1),
378
+ transition: n.smooth,
379
+ children: [
380
+ /* @__PURE__ */ d("div", { className: i("w-1 shrink-0 rounded-l-ds-md", k) }),
381
+ /* @__PURE__ */ f("div", {
382
+ className: "min-w-0 flex-1 p-ds-04",
383
+ children: [
384
+ /* @__PURE__ */ f("div", {
385
+ className: "flex items-center gap-ds-02",
386
+ children: [/* @__PURE__ */ d(t, {
387
+ mode: "wait",
388
+ children: w ? C > 0 ? /* @__PURE__ */ d(e.div, {
389
+ initial: {
390
+ opacity: 0,
391
+ scale: .5
392
+ },
393
+ animate: {
394
+ opacity: 1,
395
+ scale: 1
396
+ },
397
+ exit: {
398
+ opacity: 0,
399
+ scale: .5
400
+ },
401
+ transition: n.bouncy,
402
+ children: /* @__PURE__ */ d(o, {
403
+ icon: p,
404
+ size: "sm",
405
+ className: "shrink-0 text-error-11"
406
+ })
407
+ }, "error-icon") : /* @__PURE__ */ d(e.div, {
408
+ initial: {
409
+ opacity: 0,
410
+ scale: .5
411
+ },
412
+ animate: {
413
+ opacity: 1,
414
+ scale: 1
415
+ },
416
+ exit: {
417
+ opacity: 0,
418
+ scale: .5
419
+ },
420
+ transition: n.bouncy,
421
+ children: /* @__PURE__ */ d(o, {
422
+ icon: h,
423
+ size: "sm",
424
+ className: "shrink-0 text-success-11"
425
+ })
426
+ }, "success-icon") : /* @__PURE__ */ d(e.div, {
427
+ initial: { opacity: 0 },
428
+ animate: { opacity: 1 },
429
+ exit: { opacity: 0 },
430
+ transition: r.fade,
431
+ children: /* @__PURE__ */ d(o, {
432
+ icon: S,
433
+ size: "sm",
434
+ className: "shrink-0 text-surface-fg-muted"
435
+ })
436
+ }, "upload-icon")
437
+ }), /* @__PURE__ */ d("p", {
438
+ className: "text-ds-md font-semibold text-surface-fg",
439
+ children: w ? C > 0 ? `${x} of ${a.length} uploaded` : `${a.length} file${a.length > 1 ? "s" : ""} uploaded` : `Uploading ${a.length} file${a.length > 1 ? "s" : ""}`
440
+ })]
441
+ }),
442
+ !w && /* @__PURE__ */ f("p", {
443
+ className: "mt-0.5 text-ds-xs text-surface-fg-muted",
444
+ children: [
445
+ x,
446
+ " of ",
447
+ a.length,
448
+ " complete",
449
+ C > 0 && ` · ${C} failed`
450
+ ]
451
+ }),
452
+ /* @__PURE__ */ d("div", {
453
+ className: "mt-ds-02 max-h-[140px] overflow-y-auto",
454
+ children: /* @__PURE__ */ d(t, { children: a.map((e) => /* @__PURE__ */ d(F, {
455
+ file: e,
456
+ onRetry: c,
457
+ onRemove: l
458
+ }, e.id)) })
459
+ }),
460
+ /* @__PURE__ */ f("div", {
461
+ className: "sr-only",
462
+ "aria-live": "polite",
463
+ children: [
464
+ x,
465
+ " of ",
466
+ a.length,
467
+ " files uploaded",
468
+ C > 0 && `, ${C} failed`
469
+ ]
470
+ })
471
+ ]
472
+ }),
473
+ w && /* @__PURE__ */ d(O, {
474
+ duration: E,
475
+ type: A,
476
+ paused: !1
477
+ })
478
+ ]
479
+ });
436
480
  }
437
- function ae(e, s) {
438
- return {
439
- id: e?.id,
440
- duration: e?.duration ?? s ?? F,
441
- unstyled: !0,
442
- classNames: { toast: "w-full" }
443
- };
481
+ function L(e, t) {
482
+ return {
483
+ id: e?.id,
484
+ duration: e?.duration ?? t ?? w,
485
+ unstyled: !0,
486
+ classNames: { toast: "w-full" }
487
+ };
444
488
  }
445
- function y(e, s, a) {
446
- const r = a?.duration ?? F;
447
- return p.custom(
448
- () => /* @__PURE__ */ t(
449
- B,
450
- {
451
- type: e,
452
- title: s,
453
- description: a?.description,
454
- action: a?.action,
455
- cancel: a?.cancel,
456
- duration: r
457
- }
458
- ),
459
- ae(a, r)
460
- );
489
+ function R(e, t, n) {
490
+ l();
491
+ let r = n?.duration ?? w;
492
+ return s.custom(() => /* @__PURE__ */ d(k, {
493
+ type: e,
494
+ title: t,
495
+ description: n?.description,
496
+ action: n?.action,
497
+ cancel: n?.cancel,
498
+ duration: r
499
+ }), L(n, r));
461
500
  }
462
- function d(e, s) {
463
- return y("message", e, s);
501
+ function z(e, t) {
502
+ return R("message", e, t);
464
503
  }
465
- d.message = (e, s) => y("message", e, s);
466
- d.success = (e, s) => y("success", e, s);
467
- d.error = (e, s) => y("error", e, s);
468
- d.warning = (e, s) => y("warning", e, s);
469
- d.info = (e, s) => y("info", e, s);
470
- d.loading = (e, s) => y("loading", e, {
471
- ...s,
472
- duration: s?.duration ?? 1 / 0
473
- });
474
- d.promise = (e, s) => {
475
- const a = p.custom(
476
- () => /* @__PURE__ */ t(B, { type: "loading", title: s.loading, showTimerBar: !1 }),
477
- { duration: 1 / 0, unstyled: !0, classNames: { toast: "w-full" } }
478
- ), r = (n, c) => {
479
- p.custom(
480
- () => /* @__PURE__ */ t(
481
- B,
482
- {
483
- type: n,
484
- title: c,
485
- duration: F,
486
- selfDismissId: a
487
- }
488
- ),
489
- { id: a, duration: 1 / 0, unstyled: !0, classNames: { toast: "w-full" } }
490
- );
491
- };
492
- return e.then((n) => {
493
- const c = typeof s.success == "function" ? s.success(n) : s.success;
494
- r("success", c);
495
- }).catch((n) => {
496
- const c = typeof s.error == "function" ? s.error(n) : s.error;
497
- r("error", c);
498
- }), a;
499
- };
500
- d.undo = (e, s) => {
501
- const a = s.duration ?? W;
502
- return p.custom(
503
- () => /* @__PURE__ */ t(
504
- B,
505
- {
506
- type: "message",
507
- title: e,
508
- description: s.description,
509
- action: { label: "Undo", onClick: s.onUndo },
510
- duration: a
511
- }
512
- ),
513
- { duration: a, unstyled: !0, classNames: { toast: "w-full" } }
514
- );
515
- };
516
- d.upload = (e) => {
517
- const s = e.id ?? String(Date.now());
518
- return p.custom(
519
- () => /* @__PURE__ */ t(
520
- se,
521
- {
522
- files: e.files,
523
- onRetry: e.onRetry,
524
- onRemove: e.onRemove,
525
- selfDismissId: s
526
- }
527
- ),
528
- {
529
- id: s,
530
- duration: 1 / 0,
531
- unstyled: !0,
532
- classNames: { toast: "w-full" }
533
- }
534
- ), s;
535
- };
536
- d.custom = (e, s) => p.custom(e, {
537
- ...s,
538
- unstyled: !0,
539
- classNames: { toast: "w-full", ...s?.classNames }
540
- });
541
- d.dismiss = (e) => {
542
- e !== void 0 ? p.dismiss(e) : p.dismiss();
543
- };
544
- export {
545
- M as TimerBar,
546
- B as ToastContent,
547
- te as UploadFileRow,
548
- se as UploadToastContent,
549
- ee as formatFileSize,
550
- d as toast
504
+ z.message = (e, t) => R("message", e, t), z.success = (e, t) => R("success", e, t), z.error = (e, t) => R("error", e, t), z.warning = (e, t) => R("warning", e, t), z.info = (e, t) => R("info", e, t), z.loading = (e, t) => R("loading", e, {
505
+ ...t,
506
+ duration: t?.duration ?? Infinity
507
+ }), z.promise = (e, t) => {
508
+ let n = s.custom(() => /* @__PURE__ */ d(k, {
509
+ type: "loading",
510
+ title: t.loading,
511
+ showTimerBar: !1
512
+ }), {
513
+ duration: Infinity,
514
+ unstyled: !0,
515
+ classNames: { toast: "w-full" }
516
+ }), r = (e, t) => {
517
+ s.custom(() => /* @__PURE__ */ d(k, {
518
+ type: e,
519
+ title: t,
520
+ duration: w,
521
+ selfDismissId: n
522
+ }), {
523
+ id: n,
524
+ duration: Infinity,
525
+ unstyled: !0,
526
+ classNames: { toast: "w-full" }
527
+ });
528
+ };
529
+ return e.then((e) => {
530
+ r("success", typeof t.success == "function" ? t.success(e) : t.success);
531
+ }).catch((e) => {
532
+ r("error", typeof t.error == "function" ? t.error(e) : t.error);
533
+ }), n;
534
+ }, z.undo = (e, t) => {
535
+ let n = t.duration ?? T;
536
+ return s.custom(() => /* @__PURE__ */ d(k, {
537
+ type: "message",
538
+ title: e,
539
+ description: t.description,
540
+ action: {
541
+ label: "Undo",
542
+ onClick: t.onUndo
543
+ },
544
+ duration: n
545
+ }), {
546
+ duration: n,
547
+ unstyled: !0,
548
+ classNames: { toast: "w-full" }
549
+ });
550
+ }, z.upload = (e) => {
551
+ let t = e.id ?? String(Date.now());
552
+ return s.custom(() => /* @__PURE__ */ d(I, {
553
+ files: e.files,
554
+ onRetry: e.onRetry,
555
+ onRemove: e.onRemove,
556
+ selfDismissId: t
557
+ }), {
558
+ id: t,
559
+ duration: Infinity,
560
+ unstyled: !0,
561
+ classNames: { toast: "w-full" }
562
+ }), t;
563
+ }, z.custom = (e, t) => s.custom(e, {
564
+ ...t,
565
+ unstyled: !0,
566
+ classNames: {
567
+ toast: "w-full",
568
+ ...t?.classNames
569
+ }
570
+ }), z.dismiss = (e) => {
571
+ e === void 0 ? s.dismiss() : s.dismiss(e);
551
572
  };
573
+ //#endregion
574
+ export { O as TimerBar, k as ToastContent, F as UploadFileRow, I as UploadToastContent, P as formatFileSize, z as toast };