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