@moondreamsdev/dreamer-ui 1.7.10-test.3 → 1.7.10-test.31
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-BSraKTG9.js → Toast-Bsg0i0i0.js} +196 -172
- package/dist/Toast-Bsg0i0i0.js.map +1 -0
- package/dist/Toast-wCUv2GWn.cjs +2 -0
- package/dist/Toast-wCUv2GWn.cjs.map +1 -0
- package/dist/{Window-CT479Oxr.js → Window-7myUuX6Y.js} +161 -112
- package/dist/Window-7myUuX6Y.js.map +1 -0
- package/dist/Window-DvRXD7fx.cjs +2 -0
- package/dist/Window-DvRXD7fx.cjs.map +1 -0
- package/dist/components.cjs.js +2 -2
- package/dist/components.cjs.js.map +1 -1
- package/dist/components.esm.js +1714 -1546
- 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/code-block/CodeBlock.d.ts +4 -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 +0 -52
- package/dist/src/components/code-block/index.d.ts +2 -2
- package/dist/src/components/code-block/tokenize.d.ts +17 -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 +1 -0
- package/dist/src/symbols/CaretCollapse.d.ts +2 -0
- package/dist/src/symbols/CaretExpand.d.ts +2 -0
- package/dist/src/symbols/index.d.ts +2 -0
- package/dist/src/utils/downloadFile.d.ts +1 -1
- package/dist/symbols.cjs.js +1 -1
- package/dist/symbols.esm.js +20 -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-BSraKTG9.js.map +0 -1
- package/dist/Toast-OM0b2tzD.cjs +0 -2
- package/dist/Toast-OM0b2tzD.cjs.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, C 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 $, useState as p, useEffect as g, useRef as H, useCallback as L, useMemo as E, useContext as X } from "react";
|
|
3
|
+
import { createPortal as D } from "react-dom";
|
|
4
|
+
import { X as F, C as J, E as K, I as Q } from "./X-CIoyLewf.js";
|
|
5
|
+
import { j as V } 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 Y({ 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,49 +28,73 @@ 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
|
-
|
|
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
|
+
function Z() {
|
|
80
|
+
const [l, r] = p(0);
|
|
57
81
|
return g(() => {
|
|
58
|
-
const
|
|
59
|
-
|
|
82
|
+
const i = setInterval(() => {
|
|
83
|
+
r((t) => (t + 1) % 3);
|
|
60
84
|
}, 500);
|
|
61
|
-
return () => clearInterval(
|
|
62
|
-
}, []), /* @__PURE__ */
|
|
85
|
+
return () => clearInterval(i);
|
|
86
|
+
}, []), /* @__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(
|
|
63
87
|
"div",
|
|
64
88
|
{
|
|
65
89
|
className: N(
|
|
66
90
|
"rounded-full transition-all duration-500 ease-in-out size-[0.35em] bg-current",
|
|
67
|
-
|
|
91
|
+
l === i && "transform -translate-y-1"
|
|
68
92
|
)
|
|
69
93
|
},
|
|
70
|
-
|
|
94
|
+
i
|
|
71
95
|
)) });
|
|
72
96
|
}
|
|
73
|
-
const
|
|
97
|
+
const G = {
|
|
74
98
|
base: "",
|
|
75
99
|
primary: "bg-primary text-primary-foreground hover:bg-primary/85 disabled:bg-muted disabled:text-muted-foreground",
|
|
76
100
|
secondary: "bg-secondary text-secondary-foreground hover:bg-secondary/85 disabled:bg-muted/80 disabled:text-muted-foreground/80",
|
|
@@ -78,7 +102,7 @@ const _ = {
|
|
|
78
102
|
outline: "border border-primary text-primary hover:border-primary-foreground hover:text-primary-foreground disabled:border-muted disabled:text-muted",
|
|
79
103
|
link: "underline-offset-4 hover:underline disabled:underline disabled:text-muted",
|
|
80
104
|
destructive: "bg-destructive text-destructive-foreground hover:bg-destructive/85 disabled:bg-muted disabled:text-muted-foreground"
|
|
81
|
-
},
|
|
105
|
+
}, U = {
|
|
82
106
|
stripped: "",
|
|
83
107
|
fitted: "size-fit",
|
|
84
108
|
sm: "px-2 py-1 text-sm",
|
|
@@ -97,49 +121,49 @@ const _ = {
|
|
|
97
121
|
size: "md",
|
|
98
122
|
rounded: "md"
|
|
99
123
|
};
|
|
100
|
-
function
|
|
101
|
-
variant:
|
|
102
|
-
size:
|
|
103
|
-
rounded:
|
|
124
|
+
function _({
|
|
125
|
+
variant: l = w.variant,
|
|
126
|
+
size: r,
|
|
127
|
+
rounded: i = w.rounded,
|
|
104
128
|
loading: t,
|
|
105
|
-
linkTo:
|
|
106
|
-
linkProps:
|
|
129
|
+
linkTo: a,
|
|
130
|
+
linkProps: o,
|
|
107
131
|
type: s = "button",
|
|
108
132
|
className: u,
|
|
109
133
|
...d
|
|
110
134
|
}) {
|
|
111
135
|
let c;
|
|
112
|
-
|
|
136
|
+
l === "link" && !r ? c = "fitted" : c = r || w.size;
|
|
113
137
|
const m = N(
|
|
114
138
|
"appearance-none focus:outline-none focus:ring not-disabled:hover:cursor-pointer disabled:opacity-50 disabled:cursor-not-allowed transition-all",
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
W[
|
|
139
|
+
G[l],
|
|
140
|
+
U[c],
|
|
141
|
+
W[i],
|
|
118
142
|
t && "relative pointer-events-none",
|
|
119
|
-
|
|
143
|
+
a && "relative",
|
|
120
144
|
u
|
|
121
145
|
);
|
|
122
146
|
return /* @__PURE__ */ b(
|
|
123
147
|
"button",
|
|
124
148
|
{
|
|
125
149
|
...d,
|
|
126
|
-
role:
|
|
127
|
-
"aria-label": d["aria-label"] || (
|
|
128
|
-
"aria-description": d["aria-description"] || (
|
|
150
|
+
role: a ? "link" : d.role,
|
|
151
|
+
"aria-label": d["aria-label"] || (o == null ? void 0 : o["aria-label"]),
|
|
152
|
+
"aria-description": d["aria-description"] || (o == null ? void 0 : o["aria-description"]),
|
|
129
153
|
"aria-disabled": d.disabled || t,
|
|
130
154
|
"aria-busy": t,
|
|
131
155
|
type: s,
|
|
132
156
|
className: m,
|
|
133
157
|
children: [
|
|
134
|
-
t && /* @__PURE__ */
|
|
135
|
-
/* @__PURE__ */
|
|
136
|
-
|
|
158
|
+
t && /* @__PURE__ */ n(Z, {}),
|
|
159
|
+
/* @__PURE__ */ n("span", { className: N(t && "invisible"), children: d.children }),
|
|
160
|
+
a && !d.disabled && /* @__PURE__ */ n(
|
|
137
161
|
"a",
|
|
138
162
|
{
|
|
139
|
-
...
|
|
163
|
+
...o,
|
|
140
164
|
"aria-hidden": !0,
|
|
141
|
-
href:
|
|
142
|
-
rel: (
|
|
165
|
+
href: a,
|
|
166
|
+
rel: (o == null ? void 0 : o.rel) || "noreferrer",
|
|
143
167
|
className: "absolute inset-0"
|
|
144
168
|
}
|
|
145
169
|
)
|
|
@@ -147,32 +171,32 @@ function Y({
|
|
|
147
171
|
}
|
|
148
172
|
);
|
|
149
173
|
}
|
|
150
|
-
function R(
|
|
151
|
-
const [
|
|
174
|
+
function R(l) {
|
|
175
|
+
const [r, i] = p(!1), [t, a] = p(!1);
|
|
152
176
|
return g(() => {
|
|
153
|
-
|
|
154
|
-
}, [
|
|
177
|
+
l ? (a(!0), setTimeout(() => i(!0), 10)) : (i(!1), setTimeout(() => a(!1), 150));
|
|
178
|
+
}, [l]), { show: r, shouldRender: t };
|
|
155
179
|
}
|
|
156
|
-
function ee(
|
|
180
|
+
function ee(l, r) {
|
|
157
181
|
g(() => {
|
|
158
|
-
const
|
|
159
|
-
t.key === "Escape" &&
|
|
182
|
+
const i = (t) => {
|
|
183
|
+
t.key === "Escape" && l && r();
|
|
160
184
|
};
|
|
161
|
-
return document.addEventListener("keydown",
|
|
162
|
-
document.removeEventListener("keydown",
|
|
185
|
+
return document.addEventListener("keydown", i), l && (document.body.style.overflow = "hidden"), () => {
|
|
186
|
+
document.removeEventListener("keydown", i), document.body.style.overflow = "auto";
|
|
163
187
|
};
|
|
164
|
-
}, [
|
|
188
|
+
}, [l, r]);
|
|
165
189
|
}
|
|
166
|
-
function
|
|
167
|
-
const
|
|
168
|
-
const
|
|
169
|
-
if (!
|
|
170
|
-
const
|
|
171
|
-
if (
|
|
172
|
-
|
|
190
|
+
function le(l, r) {
|
|
191
|
+
const i = H(null), t = L(() => {
|
|
192
|
+
const a = document.getElementById(l);
|
|
193
|
+
if (!a) return;
|
|
194
|
+
const o = a.querySelectorAll('[data-modal-action="true"]');
|
|
195
|
+
if (o.length > 0) {
|
|
196
|
+
o[0].focus();
|
|
173
197
|
return;
|
|
174
198
|
}
|
|
175
|
-
const s =
|
|
199
|
+
const s = a.querySelectorAll(
|
|
176
200
|
'button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])'
|
|
177
201
|
);
|
|
178
202
|
if (s.length > 0) {
|
|
@@ -184,77 +208,77 @@ function te(e, l) {
|
|
|
184
208
|
s[0].focus();
|
|
185
209
|
return;
|
|
186
210
|
}
|
|
187
|
-
|
|
188
|
-
}, [
|
|
189
|
-
g(() => (
|
|
190
|
-
document.body.style.overflow = "auto",
|
|
191
|
-
}), [
|
|
211
|
+
a.focus();
|
|
212
|
+
}, [l]);
|
|
213
|
+
g(() => (r && (i.current = document.activeElement, t()), () => {
|
|
214
|
+
document.body.style.overflow = "auto", i.current instanceof HTMLElement && i.current.focus();
|
|
215
|
+
}), [r, t]);
|
|
192
216
|
}
|
|
193
|
-
function
|
|
194
|
-
id:
|
|
195
|
-
isOpen:
|
|
196
|
-
onClose:
|
|
217
|
+
function te({
|
|
218
|
+
id: l,
|
|
219
|
+
isOpen: r,
|
|
220
|
+
onClose: i,
|
|
197
221
|
title: t,
|
|
198
|
-
children:
|
|
199
|
-
contentOnly:
|
|
222
|
+
children: a,
|
|
223
|
+
contentOnly: o = !1,
|
|
200
224
|
className: s,
|
|
201
225
|
overlayClassName: u,
|
|
202
226
|
hideCloseButton: d = !1,
|
|
203
227
|
actions: c = [],
|
|
204
228
|
disableCloseOnOverlayClick: m = !1,
|
|
205
229
|
ariaLabelledBy: f,
|
|
206
|
-
ariaDescribedBy:
|
|
230
|
+
ariaDescribedBy: h
|
|
207
231
|
}) {
|
|
208
|
-
const
|
|
209
|
-
if (
|
|
210
|
-
const j = () => t ?
|
|
211
|
-
const { label:
|
|
212
|
-
return /* @__PURE__ */
|
|
232
|
+
const v = $(), k = l || `modal-${v}`, C = l ? `${l}-title` : `modal-title-${v}`, { show: T, shouldRender: y } = R(r);
|
|
233
|
+
if (le(k, y), ee(y, i), !y) return null;
|
|
234
|
+
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, I = () => 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((A, O) => {
|
|
235
|
+
const { label: B, className: S, ...M } = A;
|
|
236
|
+
return /* @__PURE__ */ n(_, { className: S, type: "button", ...M, "data-modal-action": "true", children: B }, O);
|
|
213
237
|
}) });
|
|
214
|
-
return /* @__PURE__ */
|
|
215
|
-
/* @__PURE__ */
|
|
238
|
+
return /* @__PURE__ */ n(q, { children: D(
|
|
239
|
+
/* @__PURE__ */ n(
|
|
216
240
|
"div",
|
|
217
241
|
{
|
|
218
242
|
"aria-labelledby": f ?? t ? C : void 0,
|
|
219
|
-
"aria-describedby":
|
|
243
|
+
"aria-describedby": h,
|
|
220
244
|
role: "dialog",
|
|
221
245
|
"aria-modal": "true",
|
|
222
246
|
className: "fixed inset-0 z-[100] overflow-y-auto",
|
|
223
247
|
children: /* @__PURE__ */ b("div", { className: "flex min-h-screen items-center justify-center p-4", children: [
|
|
224
|
-
/* @__PURE__ */
|
|
248
|
+
/* @__PURE__ */ n(
|
|
225
249
|
"div",
|
|
226
250
|
{
|
|
227
251
|
className: x("fixed inset-0 bg-black/20 transition-all", u),
|
|
228
252
|
onClick: () => {
|
|
229
|
-
m ||
|
|
253
|
+
m || i();
|
|
230
254
|
}
|
|
231
255
|
}
|
|
232
256
|
),
|
|
233
|
-
|
|
234
|
-
!
|
|
257
|
+
o && /* @__PURE__ */ n("div", { className: x("relative w-fit", s), children: a }),
|
|
258
|
+
!o && /* @__PURE__ */ b(
|
|
235
259
|
"div",
|
|
236
260
|
{
|
|
237
261
|
id: k,
|
|
238
262
|
tabIndex: -1,
|
|
239
263
|
className: x(
|
|
240
264
|
"relative w-full max-w-xl transform rounded-lg shadow-xl bg-popover transition-all p-6 focus:ring ease-in duration-75",
|
|
241
|
-
|
|
265
|
+
T ? "opacity-100 scale-100" : "opacity-0 scale-90",
|
|
242
266
|
s
|
|
243
267
|
),
|
|
244
268
|
children: [
|
|
245
|
-
!d && /* @__PURE__ */
|
|
269
|
+
!d && /* @__PURE__ */ n(
|
|
246
270
|
"button",
|
|
247
271
|
{
|
|
248
272
|
type: "button",
|
|
249
|
-
onClick:
|
|
273
|
+
onClick: i,
|
|
250
274
|
"data-modal-close-button": "true",
|
|
251
275
|
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",
|
|
252
|
-
children: /* @__PURE__ */
|
|
276
|
+
children: /* @__PURE__ */ n(Y, { size: 18 })
|
|
253
277
|
}
|
|
254
278
|
),
|
|
255
279
|
j(),
|
|
256
|
-
|
|
257
|
-
|
|
280
|
+
a,
|
|
281
|
+
I()
|
|
258
282
|
]
|
|
259
283
|
}
|
|
260
284
|
)
|
|
@@ -265,143 +289,143 @@ function re({
|
|
|
265
289
|
) });
|
|
266
290
|
}
|
|
267
291
|
function de({
|
|
268
|
-
type:
|
|
269
|
-
message:
|
|
270
|
-
cancelText:
|
|
292
|
+
type: l,
|
|
293
|
+
message: r,
|
|
294
|
+
cancelText: i,
|
|
271
295
|
confirmText: t,
|
|
272
|
-
onConfirm:
|
|
273
|
-
onClose:
|
|
296
|
+
onConfirm: a,
|
|
297
|
+
onClose: o,
|
|
274
298
|
destructive: s = !1,
|
|
275
299
|
title: u,
|
|
276
300
|
...d
|
|
277
301
|
}) {
|
|
278
|
-
const c = E(() =>
|
|
302
|
+
const c = E(() => l === "confirm" ? {
|
|
279
303
|
confirm: t || "Confirm",
|
|
280
|
-
cancel:
|
|
304
|
+
cancel: i || "Cancel",
|
|
281
305
|
defaultTitle: u || "Confirm Action"
|
|
282
306
|
} : {
|
|
283
307
|
confirm: t || "OK",
|
|
284
308
|
cancel: null,
|
|
285
309
|
defaultTitle: u || "Alert"
|
|
286
|
-
}, [
|
|
310
|
+
}, [l, t, u, i]), m = E(
|
|
287
311
|
() => [
|
|
288
312
|
...c.cancel ? [
|
|
289
313
|
{
|
|
290
314
|
label: c.cancel,
|
|
291
315
|
variant: "secondary",
|
|
292
|
-
onClick:
|
|
316
|
+
onClick: o
|
|
293
317
|
}
|
|
294
318
|
] : [],
|
|
295
319
|
{
|
|
296
320
|
label: c.confirm,
|
|
297
321
|
variant: s ? "destructive" : "primary",
|
|
298
322
|
onClick: () => {
|
|
299
|
-
|
|
323
|
+
a == null || a(), o();
|
|
300
324
|
}
|
|
301
325
|
}
|
|
302
326
|
],
|
|
303
|
-
[c, s,
|
|
327
|
+
[c, s, a, o]
|
|
304
328
|
);
|
|
305
|
-
return /* @__PURE__ */
|
|
306
|
-
|
|
329
|
+
return /* @__PURE__ */ n(
|
|
330
|
+
te,
|
|
307
331
|
{
|
|
308
332
|
...d,
|
|
309
333
|
title: u || c.defaultTitle,
|
|
310
|
-
onClose:
|
|
334
|
+
onClose: o,
|
|
311
335
|
actions: m,
|
|
312
|
-
disableCloseOnOverlayClick:
|
|
313
|
-
hideCloseButton:
|
|
314
|
-
children: typeof
|
|
336
|
+
disableCloseOnOverlayClick: l === "confirm",
|
|
337
|
+
hideCloseButton: l === "confirm",
|
|
338
|
+
children: typeof r == "string" ? /* @__PURE__ */ n("p", { className: "text-sm", children: r }) : r
|
|
315
339
|
}
|
|
316
340
|
);
|
|
317
341
|
}
|
|
318
|
-
const
|
|
319
|
-
const
|
|
320
|
-
if (!
|
|
342
|
+
const ne = e(null), ue = () => {
|
|
343
|
+
const l = X(ne);
|
|
344
|
+
if (!l)
|
|
321
345
|
throw new Error("Tabs components must be used within a Tabs component");
|
|
322
|
-
return
|
|
323
|
-
},
|
|
346
|
+
return l;
|
|
347
|
+
}, z = {
|
|
324
348
|
info: {
|
|
325
349
|
className: "bg-blue-50 border-blue-200 text-blue-900 dark:bg-blue-800 dark:border-blue-950 dark:text-blue-100",
|
|
326
|
-
icon: /* @__PURE__ */
|
|
350
|
+
icon: /* @__PURE__ */ n(Q, { size: 20 })
|
|
327
351
|
},
|
|
328
352
|
warning: {
|
|
329
353
|
className: "bg-yellow-50 border-yellow-200 text-yellow-900 dark:bg-yellow-800 dark:border-yellow-950 dark:text-yellow-100",
|
|
330
|
-
icon: /* @__PURE__ */
|
|
354
|
+
icon: /* @__PURE__ */ n(K, { size: 20 })
|
|
331
355
|
},
|
|
332
356
|
error: {
|
|
333
357
|
className: "bg-red-50 border-red-200 text-red-900 dark:bg-red-800 dark:border-red-950 dark:text-red-100",
|
|
334
|
-
icon: /* @__PURE__ */
|
|
358
|
+
icon: /* @__PURE__ */ n(J, { size: 20 })
|
|
335
359
|
}
|
|
336
360
|
};
|
|
337
361
|
function ce({
|
|
338
|
-
id:
|
|
339
|
-
title:
|
|
340
|
-
description:
|
|
362
|
+
id: l,
|
|
363
|
+
title: r,
|
|
364
|
+
description: i,
|
|
341
365
|
type: t = "info",
|
|
342
|
-
action:
|
|
343
|
-
duration:
|
|
366
|
+
action: a,
|
|
367
|
+
duration: o = 5e3,
|
|
344
368
|
onRemove: s,
|
|
345
369
|
customTypes: u,
|
|
346
370
|
customComponent: d
|
|
347
371
|
}) {
|
|
348
372
|
const [c, m] = p(!1), f = L(() => {
|
|
349
373
|
m(!0), setTimeout(() => {
|
|
350
|
-
s == null || s(
|
|
374
|
+
s == null || s(l);
|
|
351
375
|
}, 150);
|
|
352
|
-
}, [
|
|
376
|
+
}, [l, s]);
|
|
353
377
|
if (g(() => {
|
|
354
|
-
if (
|
|
355
|
-
const
|
|
378
|
+
if (o > 0) {
|
|
379
|
+
const v = setTimeout(() => {
|
|
356
380
|
f();
|
|
357
|
-
},
|
|
358
|
-
return () => clearTimeout(
|
|
381
|
+
}, o);
|
|
382
|
+
return () => clearTimeout(v);
|
|
359
383
|
}
|
|
360
|
-
}, [
|
|
361
|
-
return /* @__PURE__ */
|
|
384
|
+
}, [o, l, s, f]), d)
|
|
385
|
+
return /* @__PURE__ */ n(
|
|
362
386
|
d,
|
|
363
387
|
{
|
|
364
|
-
id:
|
|
365
|
-
title:
|
|
366
|
-
description:
|
|
388
|
+
id: l,
|
|
389
|
+
title: r,
|
|
390
|
+
description: i,
|
|
367
391
|
type: t,
|
|
368
|
-
action:
|
|
369
|
-
duration:
|
|
392
|
+
action: a,
|
|
393
|
+
duration: o,
|
|
370
394
|
onRemove: s
|
|
371
395
|
}
|
|
372
396
|
);
|
|
373
|
-
const
|
|
397
|
+
const h = (u == null ? void 0 : u[t]) || z[t] || z.info;
|
|
374
398
|
return /* @__PURE__ */ b(
|
|
375
399
|
"div",
|
|
376
400
|
{
|
|
377
401
|
role: t === "error" ? "alert" : "status",
|
|
378
402
|
"aria-live": t === "error" ? void 0 : "polite",
|
|
379
|
-
className:
|
|
403
|
+
className: V(
|
|
380
404
|
"relative flex items-start p-4 rounded-lg border shadow-lg transition-all duration-150 ease-in-out",
|
|
381
|
-
|
|
382
|
-
|
|
405
|
+
a && "pb-3",
|
|
406
|
+
h.className,
|
|
383
407
|
c ? "opacity-0 translate-x-full" : "opacity-100 translate-x-0"
|
|
384
408
|
),
|
|
385
409
|
children: [
|
|
386
|
-
/* @__PURE__ */
|
|
410
|
+
/* @__PURE__ */ n("div", { className: "flex-shrink-0 mr-3", children: h.icon }),
|
|
387
411
|
/* @__PURE__ */ b("div", { className: "flex-grow min-w-0", children: [
|
|
388
|
-
/* @__PURE__ */
|
|
389
|
-
|
|
390
|
-
|
|
412
|
+
/* @__PURE__ */ n("div", { className: "font-medium text-sm leading-5", children: r }),
|
|
413
|
+
i && /* @__PURE__ */ n("div", { className: "mt-1 text-sm opacity-90 leading-5", children: i }),
|
|
414
|
+
a && /* @__PURE__ */ n("div", { className: "mt-1.5", children: /* @__PURE__ */ n(
|
|
391
415
|
"button",
|
|
392
416
|
{
|
|
393
|
-
onClick:
|
|
417
|
+
onClick: a.onClick,
|
|
394
418
|
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",
|
|
395
|
-
children:
|
|
419
|
+
children: a.label
|
|
396
420
|
}
|
|
397
421
|
) })
|
|
398
422
|
] }),
|
|
399
|
-
/* @__PURE__ */
|
|
423
|
+
/* @__PURE__ */ n(
|
|
400
424
|
"button",
|
|
401
425
|
{
|
|
402
426
|
onClick: f,
|
|
403
427
|
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",
|
|
404
|
-
children: /* @__PURE__ */
|
|
428
|
+
children: /* @__PURE__ */ n(F, { size: 16 })
|
|
405
429
|
}
|
|
406
430
|
)
|
|
407
431
|
]
|
|
@@ -411,8 +435,8 @@ function ce({
|
|
|
411
435
|
export {
|
|
412
436
|
de as A,
|
|
413
437
|
ce as T,
|
|
414
|
-
|
|
438
|
+
ne as a,
|
|
415
439
|
N as n,
|
|
416
440
|
ue as u
|
|
417
441
|
};
|
|
418
|
-
//# sourceMappingURL=Toast-
|
|
442
|
+
//# sourceMappingURL=Toast-Bsg0i0i0.js.map
|