@devalok/shilp-sutra 0.33.2 → 0.34.1

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