@moondreamsdev/dreamer-ui 1.7.10-test.5 → 1.7.10-test.50
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/{Toast-DElyOOHL.js → Toast-B-GbqaJS.js} +193 -157
- package/dist/Toast-B-GbqaJS.js.map +1 -0
- package/dist/Toast-CDEvB3gi.cjs +2 -0
- package/dist/Toast-CDEvB3gi.cjs.map +1 -0
- package/dist/Window-5IZnBJt9.cjs +2 -0
- package/dist/Window-5IZnBJt9.cjs.map +1 -0
- package/dist/{Window-CT479Oxr.js → Window-uX5BuBwi.js} +184 -112
- package/dist/Window-uX5BuBwi.js.map +1 -0
- package/dist/components.cjs.js +2 -2
- package/dist/components.cjs.js.map +1 -1
- package/dist/components.esm.js +1667 -1385
- package/dist/components.esm.js.map +1 -1
- package/dist/providers.cjs.js +1 -1
- package/dist/providers.esm.js +1 -1
- package/dist/src/components/accordion/AccordionItem.d.ts +1 -0
- package/dist/src/components/callout/Callout.d.ts +23 -0
- package/dist/src/components/callout/index.d.ts +1 -0
- package/dist/src/components/callout/variants.d.ts +9 -0
- package/dist/src/components/carousel/hooks.d.ts +1 -0
- package/dist/src/components/clickable/Clickable.d.ts +1 -0
- package/dist/src/components/code-block/CodeBlock.d.ts +5 -3
- package/dist/src/components/code-block/classes.d.ts +5 -0
- package/dist/src/components/code-block/constants.d.ts +2 -0
- package/dist/src/components/code-block/format.d.ts +5 -0
- package/dist/src/components/code-block/hooks.d.ts +1 -52
- package/dist/src/components/code-block/index.d.ts +2 -2
- package/dist/src/components/code-block/tokenize.d.ts +20 -0
- package/dist/src/components/code-block/types.d.ts +54 -0
- package/dist/src/components/code-block/util.d.ts +2 -0
- package/dist/src/components/disclosure/Disclosure.d.ts +22 -0
- package/dist/src/components/disclosure/index.d.ts +1 -0
- package/dist/src/components/index.d.ts +2 -0
- package/dist/src/components/radiogroup/RadioGroupItem.d.ts +1 -0
- package/dist/src/components/scroll-area/hooks.d.ts +1 -0
- package/dist/src/components/tabs/TabsContent.d.ts +1 -0
- package/dist/src/components/tabs/TabsContext.d.ts +1 -0
- package/dist/src/components/tabs/TabsList.d.ts +1 -0
- package/dist/src/components/tabs/TabsTrigger.d.ts +1 -0
- package/dist/src/components/tooltip/hooks.d.ts +1 -0
- package/dist/src/hooks/useActionModal.d.ts +1 -0
- package/dist/src/hooks/useToast.d.ts +1 -0
- package/dist/src/symbols/CaretCollapse.d.ts +2 -0
- package/dist/src/symbols/CaretExpand.d.ts +2 -0
- package/dist/src/symbols/DeepRing.d.ts +2 -0
- package/dist/src/symbols/index.d.ts +3 -0
- package/dist/src/symbols/props.d.ts +1 -0
- package/dist/src/utils/downloadFile.d.ts +1 -1
- package/dist/symbols.cjs.js +1 -1
- package/dist/symbols.esm.js +21 -18
- package/dist/utils.cjs.js.map +1 -1
- package/dist/utils.esm.js.map +1 -1
- package/package.json +1 -1
- package/dist/Toast-B56CHRFH.cjs +0 -2
- package/dist/Toast-B56CHRFH.cjs.map +0 -1
- package/dist/Toast-DElyOOHL.js.map +0 -1
- package/dist/Window-CT479Oxr.js.map +0 -1
- package/dist/Window-oF6fyFBX.cjs +0 -2
- package/dist/Window-oF6fyFBX.cjs.map +0 -1
|
@@ -1,26 +1,26 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import
|
|
3
|
-
import { createPortal as
|
|
4
|
-
import { X as
|
|
5
|
-
import { j as
|
|
6
|
-
function N(...
|
|
7
|
-
return
|
|
1
|
+
import { jsx as n, Fragment as q, jsxs as b } from "react/jsx-runtime";
|
|
2
|
+
import P, { createContext as e, useId as H, useState as h, useEffect as g, useRef as D, useCallback as z, useMemo as E, useContext as F } from "react";
|
|
3
|
+
import { createPortal as K } from "react-dom";
|
|
4
|
+
import { X as V, C as X, E as Y, I as Z } from "./X-CIoyLewf.js";
|
|
5
|
+
import { j as G } from "./join-BmgR_f4v.js";
|
|
6
|
+
function N(...l) {
|
|
7
|
+
return l.filter((r) => typeof r == "string" && r).join(" ").trim() || void 0;
|
|
8
8
|
}
|
|
9
|
-
function
|
|
10
|
-
return /* @__PURE__ */
|
|
9
|
+
function J({ size: l = 15, color: r = "currentColor", className: i = "inline", ...t }) {
|
|
10
|
+
return /* @__PURE__ */ n(
|
|
11
11
|
"svg",
|
|
12
12
|
{
|
|
13
13
|
...t,
|
|
14
|
-
width:
|
|
15
|
-
height:
|
|
16
|
-
className:
|
|
14
|
+
width: l,
|
|
15
|
+
height: l,
|
|
16
|
+
className: i,
|
|
17
17
|
viewBox: "0 0 15 15",
|
|
18
18
|
xmlns: "http://www.w3.org/2000/svg",
|
|
19
|
-
children: /* @__PURE__ */
|
|
19
|
+
children: /* @__PURE__ */ n(
|
|
20
20
|
"path",
|
|
21
21
|
{
|
|
22
22
|
d: "M11.7816 4.03157C12.0062 3.80702 12.0062 3.44295 11.7816 3.2184C11.5571 2.99385 11.193 2.99385 10.9685 3.2184L7.50005 6.68682L4.03164 3.2184C3.80708 2.99385 3.44301 2.99385 3.21846 3.2184C2.99391 3.44295 2.99391 3.80702 3.21846 4.03157L6.68688 7.49999L3.21846 10.9684C2.99391 11.193 2.99391 11.557 3.21846 11.7816C3.44301 12.0061 3.80708 12.0061 4.03164 11.7816L7.50005 8.31316L10.9685 11.7816C11.193 12.0061 11.5571 12.0061 11.7816 11.7816C12.0062 11.557 12.0062 11.193 11.7816 10.9684L8.31322 7.49999L11.7816 4.03157Z",
|
|
23
|
-
fill:
|
|
23
|
+
fill: r,
|
|
24
24
|
fillRule: "evenodd",
|
|
25
25
|
clipRule: "evenodd"
|
|
26
26
|
}
|
|
@@ -28,51 +28,87 @@ function U({ size: e = 15, color: l = "currentColor", className: n = "inline", .
|
|
|
28
28
|
}
|
|
29
29
|
);
|
|
30
30
|
}
|
|
31
|
-
function x(...
|
|
32
|
-
return
|
|
31
|
+
function x(...l) {
|
|
32
|
+
return l.filter((r) => typeof r == "string" && r).join(" ").trim() || void 0;
|
|
33
33
|
}
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
34
|
+
e(void 0);
|
|
35
|
+
e(null);
|
|
36
|
+
e(null);
|
|
37
|
+
e(null);
|
|
38
|
+
e(null);
|
|
39
|
+
e(null);
|
|
40
|
+
e(null);
|
|
41
|
+
e(null);
|
|
42
|
+
e(null);
|
|
43
|
+
e(null);
|
|
44
|
+
e(null);
|
|
45
|
+
e(null);
|
|
46
|
+
e(null);
|
|
47
|
+
e(null);
|
|
48
|
+
e(null);
|
|
49
|
+
e(null);
|
|
50
|
+
e(void 0);
|
|
51
|
+
e(void 0);
|
|
52
|
+
e(null);
|
|
53
|
+
e(void 0);
|
|
54
|
+
e(void 0);
|
|
55
|
+
e(null);
|
|
56
|
+
e(null);
|
|
57
|
+
e(null);
|
|
58
|
+
e(null);
|
|
59
|
+
e(null);
|
|
60
|
+
e(null);
|
|
61
|
+
e(null);
|
|
62
|
+
e(null);
|
|
63
|
+
e(null);
|
|
64
|
+
e(null);
|
|
65
|
+
e(null);
|
|
66
|
+
e(null);
|
|
67
|
+
e(null);
|
|
68
|
+
e(null);
|
|
69
|
+
e(null);
|
|
70
|
+
e(null);
|
|
71
|
+
e(null);
|
|
72
|
+
e(null);
|
|
73
|
+
e(null);
|
|
74
|
+
e(null);
|
|
75
|
+
e(null);
|
|
76
|
+
e(null);
|
|
77
|
+
e(null);
|
|
78
|
+
e(null);
|
|
79
|
+
e(null);
|
|
80
|
+
e(null);
|
|
81
|
+
e(null);
|
|
82
|
+
e(null);
|
|
83
|
+
e(null);
|
|
84
|
+
e(null);
|
|
85
|
+
e(null);
|
|
86
|
+
e(null);
|
|
87
|
+
e(null);
|
|
88
|
+
e(null);
|
|
89
|
+
e(null);
|
|
90
|
+
e(null);
|
|
91
|
+
e(null);
|
|
92
|
+
e(null);
|
|
93
|
+
function Q() {
|
|
94
|
+
const [l, r] = h(0);
|
|
59
95
|
return g(() => {
|
|
60
|
-
const
|
|
61
|
-
|
|
96
|
+
const i = setInterval(() => {
|
|
97
|
+
r((t) => (t + 1) % 3);
|
|
62
98
|
}, 500);
|
|
63
|
-
return () => clearInterval(
|
|
64
|
-
}, []), /* @__PURE__ */
|
|
99
|
+
return () => clearInterval(i);
|
|
100
|
+
}, []), /* @__PURE__ */ n("div", { className: "absolute inset-0 inline-flex items-center justify-center gap-x-2 align-middle", children: [0, 1, 2].map((i) => /* @__PURE__ */ n(
|
|
65
101
|
"div",
|
|
66
102
|
{
|
|
67
103
|
className: N(
|
|
68
104
|
"rounded-full transition-all duration-500 ease-in-out size-[0.35em] bg-current",
|
|
69
|
-
|
|
105
|
+
l === i && "transform -translate-y-1"
|
|
70
106
|
)
|
|
71
107
|
},
|
|
72
|
-
|
|
108
|
+
i
|
|
73
109
|
)) });
|
|
74
110
|
}
|
|
75
|
-
const
|
|
111
|
+
const U = {
|
|
76
112
|
base: "",
|
|
77
113
|
primary: "bg-primary text-primary-foreground hover:bg-primary/85 disabled:bg-muted disabled:text-muted-foreground",
|
|
78
114
|
secondary: "bg-secondary text-secondary-foreground hover:bg-secondary/85 disabled:bg-muted/80 disabled:text-muted-foreground/80",
|
|
@@ -80,7 +116,7 @@ const G = {
|
|
|
80
116
|
outline: "border border-primary text-primary hover:border-primary-foreground hover:text-primary-foreground disabled:border-muted disabled:text-muted",
|
|
81
117
|
link: "underline-offset-4 hover:underline disabled:underline disabled:text-muted",
|
|
82
118
|
destructive: "bg-destructive text-destructive-foreground hover:bg-destructive/85 disabled:bg-muted disabled:text-muted-foreground"
|
|
83
|
-
},
|
|
119
|
+
}, W = {
|
|
84
120
|
stripped: "",
|
|
85
121
|
fitted: "size-fit",
|
|
86
122
|
sm: "px-2 py-1 text-sm",
|
|
@@ -88,7 +124,7 @@ const G = {
|
|
|
88
124
|
lg: "px-6 py-3 text-lg",
|
|
89
125
|
icon: "p-1 w-fit aspect-square",
|
|
90
126
|
full: "p-2 w-full"
|
|
91
|
-
},
|
|
127
|
+
}, _ = {
|
|
92
128
|
none: "rounded-none",
|
|
93
129
|
sm: "rounded-sm",
|
|
94
130
|
md: "rounded-md",
|
|
@@ -99,33 +135,33 @@ const G = {
|
|
|
99
135
|
size: "md",
|
|
100
136
|
rounded: "md"
|
|
101
137
|
};
|
|
102
|
-
function
|
|
103
|
-
variant:
|
|
104
|
-
size:
|
|
105
|
-
rounded:
|
|
138
|
+
function $({
|
|
139
|
+
variant: l = w.variant,
|
|
140
|
+
size: r,
|
|
141
|
+
rounded: i = w.rounded,
|
|
106
142
|
loading: t,
|
|
107
|
-
linkTo:
|
|
143
|
+
linkTo: a,
|
|
108
144
|
linkProps: o,
|
|
109
145
|
type: s = "button",
|
|
110
146
|
className: u,
|
|
111
147
|
...d
|
|
112
148
|
}) {
|
|
113
149
|
let c;
|
|
114
|
-
|
|
150
|
+
l === "link" && !r ? c = "fitted" : c = r || w.size;
|
|
115
151
|
const m = N(
|
|
116
152
|
"appearance-none focus:outline-none focus:ring not-disabled:hover:cursor-pointer disabled:opacity-50 disabled:cursor-not-allowed transition-all",
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
153
|
+
U[l],
|
|
154
|
+
W[c],
|
|
155
|
+
_[i],
|
|
120
156
|
t && "relative pointer-events-none",
|
|
121
|
-
|
|
157
|
+
a && "relative",
|
|
122
158
|
u
|
|
123
159
|
);
|
|
124
160
|
return /* @__PURE__ */ b(
|
|
125
161
|
"button",
|
|
126
162
|
{
|
|
127
163
|
...d,
|
|
128
|
-
role:
|
|
164
|
+
role: a ? "link" : d.role,
|
|
129
165
|
"aria-label": d["aria-label"] || (o == null ? void 0 : o["aria-label"]),
|
|
130
166
|
"aria-description": d["aria-description"] || (o == null ? void 0 : o["aria-description"]),
|
|
131
167
|
"aria-disabled": d.disabled || t,
|
|
@@ -133,14 +169,14 @@ function Y({
|
|
|
133
169
|
type: s,
|
|
134
170
|
className: m,
|
|
135
171
|
children: [
|
|
136
|
-
t && /* @__PURE__ */
|
|
137
|
-
/* @__PURE__ */
|
|
138
|
-
|
|
172
|
+
t && /* @__PURE__ */ n(Q, {}),
|
|
173
|
+
/* @__PURE__ */ n("span", { className: N(t && "invisible"), children: d.children }),
|
|
174
|
+
a && !d.disabled && /* @__PURE__ */ n(
|
|
139
175
|
"a",
|
|
140
176
|
{
|
|
141
177
|
...o,
|
|
142
178
|
"aria-hidden": !0,
|
|
143
|
-
href:
|
|
179
|
+
href: a,
|
|
144
180
|
rel: (o == null ? void 0 : o.rel) || "noreferrer",
|
|
145
181
|
className: "absolute inset-0"
|
|
146
182
|
}
|
|
@@ -149,32 +185,32 @@ function Y({
|
|
|
149
185
|
}
|
|
150
186
|
);
|
|
151
187
|
}
|
|
152
|
-
function R(
|
|
153
|
-
const [
|
|
188
|
+
function R(l) {
|
|
189
|
+
const [r, i] = h(!1), [t, a] = h(!1);
|
|
154
190
|
return g(() => {
|
|
155
|
-
|
|
156
|
-
}, [
|
|
191
|
+
l ? (a(!0), setTimeout(() => i(!0), 10)) : (i(!1), setTimeout(() => a(!1), 150));
|
|
192
|
+
}, [l]), { show: r, shouldRender: t };
|
|
157
193
|
}
|
|
158
|
-
function ee(
|
|
194
|
+
function ee(l, r) {
|
|
159
195
|
g(() => {
|
|
160
|
-
const
|
|
161
|
-
t.key === "Escape" &&
|
|
196
|
+
const i = (t) => {
|
|
197
|
+
t.key === "Escape" && l && r();
|
|
162
198
|
};
|
|
163
|
-
return document.addEventListener("keydown",
|
|
164
|
-
document.removeEventListener("keydown",
|
|
199
|
+
return document.addEventListener("keydown", i), l && (document.body.style.overflow = "hidden"), () => {
|
|
200
|
+
document.removeEventListener("keydown", i), document.body.style.overflow = "auto";
|
|
165
201
|
};
|
|
166
|
-
}, [
|
|
202
|
+
}, [l, r]);
|
|
167
203
|
}
|
|
168
|
-
function
|
|
169
|
-
const
|
|
170
|
-
const
|
|
171
|
-
if (!
|
|
172
|
-
const o =
|
|
204
|
+
function le(l, r) {
|
|
205
|
+
const i = D(null), t = z(() => {
|
|
206
|
+
const a = document.getElementById(l);
|
|
207
|
+
if (!a) return;
|
|
208
|
+
const o = a.querySelectorAll('[data-modal-action="true"]');
|
|
173
209
|
if (o.length > 0) {
|
|
174
210
|
o[0].focus();
|
|
175
211
|
return;
|
|
176
212
|
}
|
|
177
|
-
const s =
|
|
213
|
+
const s = a.querySelectorAll(
|
|
178
214
|
'button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])'
|
|
179
215
|
);
|
|
180
216
|
if (s.length > 0) {
|
|
@@ -186,18 +222,18 @@ function te(e, l) {
|
|
|
186
222
|
s[0].focus();
|
|
187
223
|
return;
|
|
188
224
|
}
|
|
189
|
-
|
|
190
|
-
}, [
|
|
191
|
-
g(() => (
|
|
192
|
-
document.body.style.overflow = "auto",
|
|
193
|
-
}), [
|
|
225
|
+
a.focus();
|
|
226
|
+
}, [l]);
|
|
227
|
+
g(() => (r && (i.current = document.activeElement, t()), () => {
|
|
228
|
+
document.body.style.overflow = "auto", i.current instanceof HTMLElement && i.current.focus();
|
|
229
|
+
}), [r, t]);
|
|
194
230
|
}
|
|
195
|
-
function
|
|
196
|
-
id:
|
|
197
|
-
isOpen:
|
|
198
|
-
onClose:
|
|
231
|
+
function te({
|
|
232
|
+
id: l,
|
|
233
|
+
isOpen: r,
|
|
234
|
+
onClose: i,
|
|
199
235
|
title: t,
|
|
200
|
-
children:
|
|
236
|
+
children: a,
|
|
201
237
|
contentOnly: o = !1,
|
|
202
238
|
className: s,
|
|
203
239
|
overlayClassName: u,
|
|
@@ -207,14 +243,14 @@ function re({
|
|
|
207
243
|
ariaLabelledBy: f,
|
|
208
244
|
ariaDescribedBy: v
|
|
209
245
|
}) {
|
|
210
|
-
const
|
|
211
|
-
if (
|
|
212
|
-
const j = () => t ?
|
|
213
|
-
const { label:
|
|
214
|
-
return /* @__PURE__ */
|
|
246
|
+
const p = H(), k = l || `modal-${p}`, C = l ? `${l}-title` : `modal-title-${p}`, { show: L, shouldRender: y } = R(r);
|
|
247
|
+
if (le(k, y), ee(y, i), !y) return null;
|
|
248
|
+
const j = () => t ? P.isValidElement(t) ? /* @__PURE__ */ n("div", { className: "mb-4", children: t }) : /* @__PURE__ */ n("h2", { className: "mb-4 text-xl font-semibold", id: C, children: t }) : null, A = () => c.length === 0 ? null : /* @__PURE__ */ n("div", { className: "mt-6 not-sm:grid gap-y-2 sm:flex sm:justify-start sm:flex-row-reverse sm:gap-x-3", children: c.map((I, O) => {
|
|
249
|
+
const { label: B, className: S, ...M } = I;
|
|
250
|
+
return /* @__PURE__ */ n($, { className: S, type: "button", ...M, "data-modal-action": "true", children: B }, O);
|
|
215
251
|
}) });
|
|
216
|
-
return /* @__PURE__ */
|
|
217
|
-
/* @__PURE__ */
|
|
252
|
+
return /* @__PURE__ */ n(q, { children: K(
|
|
253
|
+
/* @__PURE__ */ n(
|
|
218
254
|
"div",
|
|
219
255
|
{
|
|
220
256
|
"aria-labelledby": f ?? t ? C : void 0,
|
|
@@ -223,16 +259,16 @@ function re({
|
|
|
223
259
|
"aria-modal": "true",
|
|
224
260
|
className: "fixed inset-0 z-[100] overflow-y-auto",
|
|
225
261
|
children: /* @__PURE__ */ b("div", { className: "flex min-h-screen items-center justify-center p-4", children: [
|
|
226
|
-
/* @__PURE__ */
|
|
262
|
+
/* @__PURE__ */ n(
|
|
227
263
|
"div",
|
|
228
264
|
{
|
|
229
265
|
className: x("fixed inset-0 bg-black/20 transition-all", u),
|
|
230
266
|
onClick: () => {
|
|
231
|
-
m ||
|
|
267
|
+
m || i();
|
|
232
268
|
}
|
|
233
269
|
}
|
|
234
270
|
),
|
|
235
|
-
o && /* @__PURE__ */
|
|
271
|
+
o && /* @__PURE__ */ n("div", { className: x("relative w-fit", s), children: a }),
|
|
236
272
|
!o && /* @__PURE__ */ b(
|
|
237
273
|
"div",
|
|
238
274
|
{
|
|
@@ -240,23 +276,23 @@ function re({
|
|
|
240
276
|
tabIndex: -1,
|
|
241
277
|
className: x(
|
|
242
278
|
"relative w-full max-w-xl transform rounded-lg shadow-xl bg-popover transition-all p-6 focus:ring ease-in duration-75",
|
|
243
|
-
|
|
279
|
+
L ? "opacity-100 scale-100" : "opacity-0 scale-90",
|
|
244
280
|
s
|
|
245
281
|
),
|
|
246
282
|
children: [
|
|
247
|
-
!d && /* @__PURE__ */
|
|
283
|
+
!d && /* @__PURE__ */ n(
|
|
248
284
|
"button",
|
|
249
285
|
{
|
|
250
286
|
type: "button",
|
|
251
|
-
onClick:
|
|
287
|
+
onClick: i,
|
|
252
288
|
"data-modal-close-button": "true",
|
|
253
289
|
className: "rounded-md p-0.5 top-2.5 right-2.5 absolute opacity-80 hover:opacity-100 transition-opacity focus:outline-none focus:ring-2 focus:ring-gray-500 leading-0",
|
|
254
|
-
children: /* @__PURE__ */
|
|
290
|
+
children: /* @__PURE__ */ n(J, { size: 18 })
|
|
255
291
|
}
|
|
256
292
|
),
|
|
257
293
|
j(),
|
|
258
|
-
|
|
259
|
-
|
|
294
|
+
a,
|
|
295
|
+
A()
|
|
260
296
|
]
|
|
261
297
|
}
|
|
262
298
|
)
|
|
@@ -267,25 +303,25 @@ function re({
|
|
|
267
303
|
) });
|
|
268
304
|
}
|
|
269
305
|
function de({
|
|
270
|
-
type:
|
|
271
|
-
message:
|
|
272
|
-
cancelText:
|
|
306
|
+
type: l,
|
|
307
|
+
message: r,
|
|
308
|
+
cancelText: i,
|
|
273
309
|
confirmText: t,
|
|
274
|
-
onConfirm:
|
|
310
|
+
onConfirm: a,
|
|
275
311
|
onClose: o,
|
|
276
312
|
destructive: s = !1,
|
|
277
313
|
title: u,
|
|
278
314
|
...d
|
|
279
315
|
}) {
|
|
280
|
-
const c = E(() =>
|
|
316
|
+
const c = E(() => l === "confirm" ? {
|
|
281
317
|
confirm: t || "Confirm",
|
|
282
|
-
cancel:
|
|
318
|
+
cancel: i || "Cancel",
|
|
283
319
|
defaultTitle: u || "Confirm Action"
|
|
284
320
|
} : {
|
|
285
321
|
confirm: t || "OK",
|
|
286
322
|
cancel: null,
|
|
287
323
|
defaultTitle: u || "Alert"
|
|
288
|
-
}, [
|
|
324
|
+
}, [l, t, u, i]), m = E(
|
|
289
325
|
() => [
|
|
290
326
|
...c.cancel ? [
|
|
291
327
|
{
|
|
@@ -298,112 +334,112 @@ function de({
|
|
|
298
334
|
label: c.confirm,
|
|
299
335
|
variant: s ? "destructive" : "primary",
|
|
300
336
|
onClick: () => {
|
|
301
|
-
|
|
337
|
+
a == null || a(), o();
|
|
302
338
|
}
|
|
303
339
|
}
|
|
304
340
|
],
|
|
305
|
-
[c, s,
|
|
341
|
+
[c, s, a, o]
|
|
306
342
|
);
|
|
307
|
-
return /* @__PURE__ */
|
|
308
|
-
|
|
343
|
+
return /* @__PURE__ */ n(
|
|
344
|
+
te,
|
|
309
345
|
{
|
|
310
346
|
...d,
|
|
311
347
|
title: u || c.defaultTitle,
|
|
312
348
|
onClose: o,
|
|
313
349
|
actions: m,
|
|
314
|
-
disableCloseOnOverlayClick:
|
|
315
|
-
hideCloseButton:
|
|
316
|
-
children: typeof
|
|
350
|
+
disableCloseOnOverlayClick: l === "confirm",
|
|
351
|
+
hideCloseButton: l === "confirm",
|
|
352
|
+
children: typeof r == "string" ? /* @__PURE__ */ n("p", { className: "text-sm", children: r }) : r
|
|
317
353
|
}
|
|
318
354
|
);
|
|
319
355
|
}
|
|
320
|
-
const
|
|
321
|
-
const
|
|
322
|
-
if (!
|
|
356
|
+
const ne = e(null), ue = () => {
|
|
357
|
+
const l = F(ne);
|
|
358
|
+
if (!l)
|
|
323
359
|
throw new Error("Tabs components must be used within a Tabs component");
|
|
324
|
-
return
|
|
325
|
-
},
|
|
360
|
+
return l;
|
|
361
|
+
}, T = {
|
|
326
362
|
info: {
|
|
327
363
|
className: "bg-blue-50 border-blue-200 text-blue-900 dark:bg-blue-800 dark:border-blue-950 dark:text-blue-100",
|
|
328
|
-
icon: /* @__PURE__ */
|
|
364
|
+
icon: /* @__PURE__ */ n(Z, { size: 20 })
|
|
329
365
|
},
|
|
330
366
|
warning: {
|
|
331
367
|
className: "bg-yellow-50 border-yellow-200 text-yellow-900 dark:bg-yellow-800 dark:border-yellow-950 dark:text-yellow-100",
|
|
332
|
-
icon: /* @__PURE__ */
|
|
368
|
+
icon: /* @__PURE__ */ n(Y, { size: 20 })
|
|
333
369
|
},
|
|
334
370
|
error: {
|
|
335
371
|
className: "bg-red-50 border-red-200 text-red-900 dark:bg-red-800 dark:border-red-950 dark:text-red-100",
|
|
336
|
-
icon: /* @__PURE__ */
|
|
372
|
+
icon: /* @__PURE__ */ n(X, { size: 20 })
|
|
337
373
|
}
|
|
338
374
|
};
|
|
339
375
|
function ce({
|
|
340
|
-
id:
|
|
341
|
-
title:
|
|
342
|
-
description:
|
|
376
|
+
id: l,
|
|
377
|
+
title: r,
|
|
378
|
+
description: i,
|
|
343
379
|
type: t = "info",
|
|
344
|
-
action:
|
|
380
|
+
action: a,
|
|
345
381
|
duration: o = 5e3,
|
|
346
382
|
onRemove: s,
|
|
347
383
|
customTypes: u,
|
|
348
384
|
customComponent: d
|
|
349
385
|
}) {
|
|
350
|
-
const [c, m] =
|
|
386
|
+
const [c, m] = h(!1), f = z(() => {
|
|
351
387
|
m(!0), setTimeout(() => {
|
|
352
|
-
s == null || s(
|
|
388
|
+
s == null || s(l);
|
|
353
389
|
}, 150);
|
|
354
|
-
}, [
|
|
390
|
+
}, [l, s]);
|
|
355
391
|
if (g(() => {
|
|
356
392
|
if (o > 0) {
|
|
357
|
-
const
|
|
393
|
+
const p = setTimeout(() => {
|
|
358
394
|
f();
|
|
359
395
|
}, o);
|
|
360
|
-
return () => clearTimeout(
|
|
396
|
+
return () => clearTimeout(p);
|
|
361
397
|
}
|
|
362
|
-
}, [o,
|
|
363
|
-
return /* @__PURE__ */
|
|
398
|
+
}, [o, l, s, f]), d)
|
|
399
|
+
return /* @__PURE__ */ n(
|
|
364
400
|
d,
|
|
365
401
|
{
|
|
366
|
-
id:
|
|
367
|
-
title:
|
|
368
|
-
description:
|
|
402
|
+
id: l,
|
|
403
|
+
title: r,
|
|
404
|
+
description: i,
|
|
369
405
|
type: t,
|
|
370
|
-
action:
|
|
406
|
+
action: a,
|
|
371
407
|
duration: o,
|
|
372
408
|
onRemove: s
|
|
373
409
|
}
|
|
374
410
|
);
|
|
375
|
-
const v = (u == null ? void 0 : u[t]) ||
|
|
411
|
+
const v = (u == null ? void 0 : u[t]) || T[t] || T.info;
|
|
376
412
|
return /* @__PURE__ */ b(
|
|
377
413
|
"div",
|
|
378
414
|
{
|
|
379
415
|
role: t === "error" ? "alert" : "status",
|
|
380
416
|
"aria-live": t === "error" ? void 0 : "polite",
|
|
381
|
-
className:
|
|
417
|
+
className: G(
|
|
382
418
|
"relative flex items-start p-4 rounded-lg border shadow-lg transition-all duration-150 ease-in-out",
|
|
383
|
-
|
|
419
|
+
a && "pb-3",
|
|
384
420
|
v.className,
|
|
385
421
|
c ? "opacity-0 translate-x-full" : "opacity-100 translate-x-0"
|
|
386
422
|
),
|
|
387
423
|
children: [
|
|
388
|
-
/* @__PURE__ */
|
|
424
|
+
/* @__PURE__ */ n("div", { className: "flex-shrink-0 mr-3", children: v.icon }),
|
|
389
425
|
/* @__PURE__ */ b("div", { className: "flex-grow min-w-0", children: [
|
|
390
|
-
/* @__PURE__ */
|
|
391
|
-
|
|
392
|
-
|
|
426
|
+
/* @__PURE__ */ n("div", { className: "font-medium text-sm leading-5", children: r }),
|
|
427
|
+
i && /* @__PURE__ */ n("div", { className: "mt-1 text-sm opacity-90 leading-5", children: i }),
|
|
428
|
+
a && /* @__PURE__ */ n("div", { className: "mt-1.5", children: /* @__PURE__ */ n(
|
|
393
429
|
"button",
|
|
394
430
|
{
|
|
395
|
-
onClick:
|
|
431
|
+
onClick: a.onClick,
|
|
396
432
|
className: "text-sm font-medium underline hover:no-underline focus:outline-none focus:ring-1 focus:ring-current rounded px-1 py-0.5 hover:cursor-pointer",
|
|
397
|
-
children:
|
|
433
|
+
children: a.label
|
|
398
434
|
}
|
|
399
435
|
) })
|
|
400
436
|
] }),
|
|
401
|
-
/* @__PURE__ */
|
|
437
|
+
/* @__PURE__ */ n(
|
|
402
438
|
"button",
|
|
403
439
|
{
|
|
404
440
|
onClick: f,
|
|
405
441
|
className: "flex-shrink-0 ml-3 p-1 rounded-md hover:bg-black/10 dark:hover:bg-white/10 focus:outline-none focus:ring-1 focus:ring-current leading-0",
|
|
406
|
-
children: /* @__PURE__ */
|
|
442
|
+
children: /* @__PURE__ */ n(V, { size: 16 })
|
|
407
443
|
}
|
|
408
444
|
)
|
|
409
445
|
]
|
|
@@ -413,8 +449,8 @@ function ce({
|
|
|
413
449
|
export {
|
|
414
450
|
de as A,
|
|
415
451
|
ce as T,
|
|
416
|
-
|
|
452
|
+
ne as a,
|
|
417
453
|
N as n,
|
|
418
454
|
ue as u
|
|
419
455
|
};
|
|
420
|
-
//# sourceMappingURL=Toast-
|
|
456
|
+
//# sourceMappingURL=Toast-B-GbqaJS.js.map
|