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