@moondreamsdev/dreamer-ui 1.7.10-test.20 → 1.7.10-test.21
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-DPHHf09f.js → Toast-1h4qbe8J.js} +95 -94
- package/dist/Toast-1h4qbe8J.js.map +1 -0
- package/dist/Toast-BYlSZ0Fu.cjs +2 -0
- package/dist/Toast-BYlSZ0Fu.cjs.map +1 -0
- package/dist/components.cjs.js +2 -2
- package/dist/components.cjs.js.map +1 -1
- package/dist/components.esm.js +706 -699
- package/dist/components.esm.js.map +1 -1
- package/dist/providers.cjs.js +1 -1
- package/dist/providers.esm.js +1 -1
- package/package.json +1 -1
- package/dist/Toast-DPHHf09f.js.map +0 -1
- package/dist/Toast-eJp5Ks3u.cjs +0 -2
- package/dist/Toast-eJp5Ks3u.cjs.map +0 -1
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import { jsx as r, Fragment as q, jsxs as b } from "react/jsx-runtime";
|
|
2
|
-
import
|
|
2
|
+
import H, { createContext as l, useId as D, useState as p, useEffect as g, useRef as P, useCallback as L, useMemo as E, useContext as X } from "react";
|
|
3
3
|
import { createPortal as F } from "react-dom";
|
|
4
|
-
import { X as
|
|
5
|
-
import { j as
|
|
4
|
+
import { X as J, C as K, E as Q, I as U } from "./X-CIoyLewf.js";
|
|
5
|
+
import { j as V } from "./join-BmgR_f4v.js";
|
|
6
6
|
function N(...e) {
|
|
7
7
|
return e.filter((n) => typeof n == "string" && n).join(" ").trim() || void 0;
|
|
8
8
|
}
|
|
9
|
-
function
|
|
9
|
+
function Y({ size: e = 15, color: n = "currentColor", className: i = "inline", ...t }) {
|
|
10
10
|
return /* @__PURE__ */ r(
|
|
11
11
|
"svg",
|
|
12
12
|
{
|
|
13
|
-
...
|
|
13
|
+
...t,
|
|
14
14
|
width: e,
|
|
15
15
|
height: e,
|
|
16
16
|
className: i,
|
|
@@ -31,46 +31,47 @@ function V({ size: e = 15, color: n = "currentColor", className: i = "inline", .
|
|
|
31
31
|
function x(...e) {
|
|
32
32
|
return e.filter((n) => typeof n == "string" && n).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
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
34
|
+
l(void 0);
|
|
35
|
+
l(null);
|
|
36
|
+
l(null);
|
|
37
|
+
l(null);
|
|
38
|
+
l(null);
|
|
39
|
+
l(null);
|
|
40
|
+
l(null);
|
|
41
|
+
l(null);
|
|
42
|
+
l(null);
|
|
43
|
+
l(null);
|
|
44
|
+
l(null);
|
|
45
|
+
l(null);
|
|
46
|
+
l(null);
|
|
47
|
+
l(null);
|
|
48
|
+
l(null);
|
|
49
|
+
l(null);
|
|
50
|
+
l(void 0);
|
|
51
|
+
l(void 0);
|
|
52
|
+
l(null);
|
|
53
|
+
l(void 0);
|
|
54
|
+
l(void 0);
|
|
55
|
+
l(null);
|
|
56
|
+
l(null);
|
|
57
|
+
l(null);
|
|
58
|
+
l(null);
|
|
59
|
+
l(null);
|
|
60
|
+
l(null);
|
|
61
|
+
l(null);
|
|
62
|
+
l(null);
|
|
63
|
+
l(null);
|
|
64
|
+
l(null);
|
|
65
|
+
l(null);
|
|
66
|
+
l(null);
|
|
67
|
+
l(null);
|
|
68
|
+
l(null);
|
|
69
|
+
l(null);
|
|
70
|
+
function Z() {
|
|
70
71
|
const [e, n] = p(0);
|
|
71
72
|
return g(() => {
|
|
72
73
|
const i = setInterval(() => {
|
|
73
|
-
n((
|
|
74
|
+
n((t) => (t + 1) % 3);
|
|
74
75
|
}, 500);
|
|
75
76
|
return () => clearInterval(i);
|
|
76
77
|
}, []), /* @__PURE__ */ r("div", { className: "absolute inset-0 inline-flex items-center justify-center gap-x-2 align-middle", children: [0, 1, 2].map((i) => /* @__PURE__ */ r(
|
|
@@ -84,7 +85,7 @@ function Y() {
|
|
|
84
85
|
i
|
|
85
86
|
)) });
|
|
86
87
|
}
|
|
87
|
-
const
|
|
88
|
+
const G = {
|
|
88
89
|
base: "",
|
|
89
90
|
primary: "bg-primary text-primary-foreground hover:bg-primary/85 disabled:bg-muted disabled:text-muted-foreground",
|
|
90
91
|
secondary: "bg-secondary text-secondary-foreground hover:bg-secondary/85 disabled:bg-muted/80 disabled:text-muted-foreground/80",
|
|
@@ -111,11 +112,11 @@ const Z = {
|
|
|
111
112
|
size: "md",
|
|
112
113
|
rounded: "md"
|
|
113
114
|
};
|
|
114
|
-
function
|
|
115
|
+
function $({
|
|
115
116
|
variant: e = w.variant,
|
|
116
117
|
size: n,
|
|
117
118
|
rounded: i = w.rounded,
|
|
118
|
-
loading:
|
|
119
|
+
loading: t,
|
|
119
120
|
linkTo: a,
|
|
120
121
|
linkProps: o,
|
|
121
122
|
type: s = "button",
|
|
@@ -126,10 +127,10 @@ function R({
|
|
|
126
127
|
e === "link" && !n ? c = "fitted" : c = n || w.size;
|
|
127
128
|
const m = N(
|
|
128
129
|
"appearance-none focus:outline-none focus:ring not-disabled:hover:cursor-pointer disabled:opacity-50 disabled:cursor-not-allowed transition-all",
|
|
129
|
-
|
|
130
|
+
G[e],
|
|
130
131
|
W[c],
|
|
131
132
|
_[i],
|
|
132
|
-
|
|
133
|
+
t && "relative pointer-events-none",
|
|
133
134
|
a && "relative",
|
|
134
135
|
u
|
|
135
136
|
);
|
|
@@ -140,13 +141,13 @@ function R({
|
|
|
140
141
|
role: a ? "link" : d.role,
|
|
141
142
|
"aria-label": d["aria-label"] || (o == null ? void 0 : o["aria-label"]),
|
|
142
143
|
"aria-description": d["aria-description"] || (o == null ? void 0 : o["aria-description"]),
|
|
143
|
-
"aria-disabled": d.disabled ||
|
|
144
|
-
"aria-busy":
|
|
144
|
+
"aria-disabled": d.disabled || t,
|
|
145
|
+
"aria-busy": t,
|
|
145
146
|
type: s,
|
|
146
147
|
className: m,
|
|
147
148
|
children: [
|
|
148
|
-
|
|
149
|
-
/* @__PURE__ */ r("span", { className: N(
|
|
149
|
+
t && /* @__PURE__ */ r(Z, {}),
|
|
150
|
+
/* @__PURE__ */ r("span", { className: N(t && "invisible"), children: d.children }),
|
|
150
151
|
a && !d.disabled && /* @__PURE__ */ r(
|
|
151
152
|
"a",
|
|
152
153
|
{
|
|
@@ -161,24 +162,24 @@ function R({
|
|
|
161
162
|
}
|
|
162
163
|
);
|
|
163
164
|
}
|
|
164
|
-
function
|
|
165
|
-
const [n, i] = p(!1), [
|
|
165
|
+
function R(e) {
|
|
166
|
+
const [n, i] = p(!1), [t, a] = p(!1);
|
|
166
167
|
return g(() => {
|
|
167
168
|
e ? (a(!0), setTimeout(() => i(!0), 10)) : (i(!1), setTimeout(() => a(!1), 150));
|
|
168
|
-
}, [e]), { show: n, shouldRender:
|
|
169
|
+
}, [e]), { show: n, shouldRender: t };
|
|
169
170
|
}
|
|
170
171
|
function ee(e, n) {
|
|
171
172
|
g(() => {
|
|
172
|
-
const i = (
|
|
173
|
-
|
|
173
|
+
const i = (t) => {
|
|
174
|
+
t.key === "Escape" && e && n();
|
|
174
175
|
};
|
|
175
176
|
return document.addEventListener("keydown", i), e && (document.body.style.overflow = "hidden"), () => {
|
|
176
177
|
document.removeEventListener("keydown", i), document.body.style.overflow = "auto";
|
|
177
178
|
};
|
|
178
179
|
}, [e, n]);
|
|
179
180
|
}
|
|
180
|
-
function
|
|
181
|
-
const i = P(null),
|
|
181
|
+
function le(e, n) {
|
|
182
|
+
const i = P(null), t = L(() => {
|
|
182
183
|
const a = document.getElementById(e);
|
|
183
184
|
if (!a) return;
|
|
184
185
|
const o = a.querySelectorAll('[data-modal-action="true"]');
|
|
@@ -200,15 +201,15 @@ function te(e, n) {
|
|
|
200
201
|
}
|
|
201
202
|
a.focus();
|
|
202
203
|
}, [e]);
|
|
203
|
-
g(() => (n && (i.current = document.activeElement,
|
|
204
|
+
g(() => (n && (i.current = document.activeElement, t()), () => {
|
|
204
205
|
document.body.style.overflow = "auto", i.current instanceof HTMLElement && i.current.focus();
|
|
205
|
-
}), [n,
|
|
206
|
+
}), [n, t]);
|
|
206
207
|
}
|
|
207
|
-
function
|
|
208
|
+
function te({
|
|
208
209
|
id: e,
|
|
209
210
|
isOpen: n,
|
|
210
211
|
onClose: i,
|
|
211
|
-
title:
|
|
212
|
+
title: t,
|
|
212
213
|
children: a,
|
|
213
214
|
contentOnly: o = !1,
|
|
214
215
|
className: s,
|
|
@@ -217,20 +218,20 @@ function le({
|
|
|
217
218
|
actions: c = [],
|
|
218
219
|
disableCloseOnOverlayClick: m = !1,
|
|
219
220
|
ariaLabelledBy: f,
|
|
220
|
-
ariaDescribedBy:
|
|
221
|
+
ariaDescribedBy: h
|
|
221
222
|
}) {
|
|
222
|
-
const
|
|
223
|
-
if (
|
|
224
|
-
const j = () =>
|
|
223
|
+
const v = D(), k = e || `modal-${v}`, C = e ? `${e}-title` : `modal-title-${v}`, { show: T, shouldRender: y } = R(n);
|
|
224
|
+
if (le(k, y), ee(y, i), !y) return null;
|
|
225
|
+
const j = () => t ? H.isValidElement(t) ? /* @__PURE__ */ r("div", { className: "mb-4", children: t }) : /* @__PURE__ */ r("h2", { className: "mb-4 text-xl font-semibold", id: C, children: t }) : null, I = () => c.length === 0 ? null : /* @__PURE__ */ r("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, B) => {
|
|
225
226
|
const { label: O, className: M, ...S } = A;
|
|
226
|
-
return /* @__PURE__ */ r(
|
|
227
|
+
return /* @__PURE__ */ r($, { className: M, type: "button", ...S, "data-modal-action": "true", children: O }, B);
|
|
227
228
|
}) });
|
|
228
229
|
return /* @__PURE__ */ r(q, { children: F(
|
|
229
230
|
/* @__PURE__ */ r(
|
|
230
231
|
"div",
|
|
231
232
|
{
|
|
232
|
-
"aria-labelledby": f ??
|
|
233
|
-
"aria-describedby":
|
|
233
|
+
"aria-labelledby": f ?? t ? C : void 0,
|
|
234
|
+
"aria-describedby": h,
|
|
234
235
|
role: "dialog",
|
|
235
236
|
"aria-modal": "true",
|
|
236
237
|
className: "fixed inset-0 z-[100] overflow-y-auto",
|
|
@@ -252,7 +253,7 @@ function le({
|
|
|
252
253
|
tabIndex: -1,
|
|
253
254
|
className: x(
|
|
254
255
|
"relative w-full max-w-xl transform rounded-lg shadow-xl bg-popover transition-all p-6 focus:ring ease-in duration-75",
|
|
255
|
-
|
|
256
|
+
T ? "opacity-100 scale-100" : "opacity-0 scale-90",
|
|
256
257
|
s
|
|
257
258
|
),
|
|
258
259
|
children: [
|
|
@@ -263,7 +264,7 @@ function le({
|
|
|
263
264
|
onClick: i,
|
|
264
265
|
"data-modal-close-button": "true",
|
|
265
266
|
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",
|
|
266
|
-
children: /* @__PURE__ */ r(
|
|
267
|
+
children: /* @__PURE__ */ r(Y, { size: 18 })
|
|
267
268
|
}
|
|
268
269
|
),
|
|
269
270
|
j(),
|
|
@@ -282,7 +283,7 @@ function de({
|
|
|
282
283
|
type: e,
|
|
283
284
|
message: n,
|
|
284
285
|
cancelText: i,
|
|
285
|
-
confirmText:
|
|
286
|
+
confirmText: t,
|
|
286
287
|
onConfirm: a,
|
|
287
288
|
onClose: o,
|
|
288
289
|
destructive: s = !1,
|
|
@@ -290,14 +291,14 @@ function de({
|
|
|
290
291
|
...d
|
|
291
292
|
}) {
|
|
292
293
|
const c = E(() => e === "confirm" ? {
|
|
293
|
-
confirm:
|
|
294
|
+
confirm: t || "Confirm",
|
|
294
295
|
cancel: i || "Cancel",
|
|
295
296
|
defaultTitle: u || "Confirm Action"
|
|
296
297
|
} : {
|
|
297
|
-
confirm:
|
|
298
|
+
confirm: t || "OK",
|
|
298
299
|
cancel: null,
|
|
299
300
|
defaultTitle: u || "Alert"
|
|
300
|
-
}, [e,
|
|
301
|
+
}, [e, t, u, i]), m = E(
|
|
301
302
|
() => [
|
|
302
303
|
...c.cancel ? [
|
|
303
304
|
{
|
|
@@ -317,7 +318,7 @@ function de({
|
|
|
317
318
|
[c, s, a, o]
|
|
318
319
|
);
|
|
319
320
|
return /* @__PURE__ */ r(
|
|
320
|
-
|
|
321
|
+
te,
|
|
321
322
|
{
|
|
322
323
|
...d,
|
|
323
324
|
title: u || c.defaultTitle,
|
|
@@ -329,47 +330,47 @@ function de({
|
|
|
329
330
|
}
|
|
330
331
|
);
|
|
331
332
|
}
|
|
332
|
-
const re =
|
|
333
|
+
const re = l(null), ue = () => {
|
|
333
334
|
const e = X(re);
|
|
334
335
|
if (!e)
|
|
335
336
|
throw new Error("Tabs components must be used within a Tabs component");
|
|
336
337
|
return e;
|
|
337
|
-
},
|
|
338
|
+
}, z = {
|
|
338
339
|
info: {
|
|
339
340
|
className: "bg-blue-50 border-blue-200 text-blue-900 dark:bg-blue-800 dark:border-blue-950 dark:text-blue-100",
|
|
340
|
-
icon: /* @__PURE__ */ r(
|
|
341
|
+
icon: /* @__PURE__ */ r(U, { size: 20 })
|
|
341
342
|
},
|
|
342
343
|
warning: {
|
|
343
344
|
className: "bg-yellow-50 border-yellow-200 text-yellow-900 dark:bg-yellow-800 dark:border-yellow-950 dark:text-yellow-100",
|
|
344
|
-
icon: /* @__PURE__ */ r(
|
|
345
|
+
icon: /* @__PURE__ */ r(Q, { size: 20 })
|
|
345
346
|
},
|
|
346
347
|
error: {
|
|
347
348
|
className: "bg-red-50 border-red-200 text-red-900 dark:bg-red-800 dark:border-red-950 dark:text-red-100",
|
|
348
|
-
icon: /* @__PURE__ */ r(
|
|
349
|
+
icon: /* @__PURE__ */ r(K, { size: 20 })
|
|
349
350
|
}
|
|
350
351
|
};
|
|
351
352
|
function ce({
|
|
352
353
|
id: e,
|
|
353
354
|
title: n,
|
|
354
355
|
description: i,
|
|
355
|
-
type:
|
|
356
|
+
type: t = "info",
|
|
356
357
|
action: a,
|
|
357
358
|
duration: o = 5e3,
|
|
358
359
|
onRemove: s,
|
|
359
360
|
customTypes: u,
|
|
360
361
|
customComponent: d
|
|
361
362
|
}) {
|
|
362
|
-
const [c, m] = p(!1), f =
|
|
363
|
+
const [c, m] = p(!1), f = L(() => {
|
|
363
364
|
m(!0), setTimeout(() => {
|
|
364
365
|
s == null || s(e);
|
|
365
366
|
}, 150);
|
|
366
367
|
}, [e, s]);
|
|
367
368
|
if (g(() => {
|
|
368
369
|
if (o > 0) {
|
|
369
|
-
const
|
|
370
|
+
const v = setTimeout(() => {
|
|
370
371
|
f();
|
|
371
372
|
}, o);
|
|
372
|
-
return () => clearTimeout(
|
|
373
|
+
return () => clearTimeout(v);
|
|
373
374
|
}
|
|
374
375
|
}, [o, e, s, f]), d)
|
|
375
376
|
return /* @__PURE__ */ r(
|
|
@@ -378,26 +379,26 @@ function ce({
|
|
|
378
379
|
id: e,
|
|
379
380
|
title: n,
|
|
380
381
|
description: i,
|
|
381
|
-
type:
|
|
382
|
+
type: t,
|
|
382
383
|
action: a,
|
|
383
384
|
duration: o,
|
|
384
385
|
onRemove: s
|
|
385
386
|
}
|
|
386
387
|
);
|
|
387
|
-
const
|
|
388
|
+
const h = (u == null ? void 0 : u[t]) || z[t] || z.info;
|
|
388
389
|
return /* @__PURE__ */ b(
|
|
389
390
|
"div",
|
|
390
391
|
{
|
|
391
|
-
role:
|
|
392
|
-
"aria-live":
|
|
393
|
-
className:
|
|
392
|
+
role: t === "error" ? "alert" : "status",
|
|
393
|
+
"aria-live": t === "error" ? void 0 : "polite",
|
|
394
|
+
className: V(
|
|
394
395
|
"relative flex items-start p-4 rounded-lg border shadow-lg transition-all duration-150 ease-in-out",
|
|
395
396
|
a && "pb-3",
|
|
396
|
-
|
|
397
|
+
h.className,
|
|
397
398
|
c ? "opacity-0 translate-x-full" : "opacity-100 translate-x-0"
|
|
398
399
|
),
|
|
399
400
|
children: [
|
|
400
|
-
/* @__PURE__ */ r("div", { className: "flex-shrink-0 mr-3", children:
|
|
401
|
+
/* @__PURE__ */ r("div", { className: "flex-shrink-0 mr-3", children: h.icon }),
|
|
401
402
|
/* @__PURE__ */ b("div", { className: "flex-grow min-w-0", children: [
|
|
402
403
|
/* @__PURE__ */ r("div", { className: "font-medium text-sm leading-5", children: n }),
|
|
403
404
|
i && /* @__PURE__ */ r("div", { className: "mt-1 text-sm opacity-90 leading-5", children: i }),
|
|
@@ -415,7 +416,7 @@ function ce({
|
|
|
415
416
|
{
|
|
416
417
|
onClick: f,
|
|
417
418
|
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",
|
|
418
|
-
children: /* @__PURE__ */ r(
|
|
419
|
+
children: /* @__PURE__ */ r(J, { size: 16 })
|
|
419
420
|
}
|
|
420
421
|
)
|
|
421
422
|
]
|
|
@@ -429,4 +430,4 @@ export {
|
|
|
429
430
|
N as n,
|
|
430
431
|
ue as u
|
|
431
432
|
};
|
|
432
|
-
//# sourceMappingURL=Toast-
|
|
433
|
+
//# sourceMappingURL=Toast-1h4qbe8J.js.map
|