@moondreamsdev/dreamer-ui 1.7.10-test.151 → 1.7.10-test.153
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-CZP-yFBM.js → Toast-BzvqSVjP.js} +79 -70
- package/dist/Toast-BzvqSVjP.js.map +1 -0
- package/dist/Toast-DboVz7Qw.cjs +2 -0
- package/dist/Toast-DboVz7Qw.cjs.map +1 -0
- package/dist/components.cjs.js +2 -2
- package/dist/components.cjs.js.map +1 -1
- package/dist/components.esm.js +521 -521
- 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-CZP-yFBM.js.map +0 -1
- package/dist/Toast-DnJHnDxS.cjs +0 -2
- package/dist/Toast-DnJHnDxS.cjs.map +0 -1
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { jsx as t, Fragment as
|
|
2
|
-
import g, { createContext as l, useId as $, useState as x, useEffect as p, useRef as
|
|
3
|
-
import { createPortal as
|
|
4
|
-
import { X as
|
|
5
|
-
import { j as
|
|
1
|
+
import { jsx as t, Fragment as H, jsxs as v } from "react/jsx-runtime";
|
|
2
|
+
import g, { createContext as l, useId as $, useState as x, useEffect as p, useRef as K, useCallback as j, useMemo as z, useContext as M } from "react";
|
|
3
|
+
import { createPortal as P } from "react-dom";
|
|
4
|
+
import { X as V, C as _, E as F, I as X } from "./X-CIoyLewf.js";
|
|
5
|
+
import { j as Z } from "./join-BmgR_f4v.js";
|
|
6
6
|
function y(...e) {
|
|
7
7
|
return e.filter((r) => typeof r == "string" && r).join(" ").trim() || void 0;
|
|
8
8
|
}
|
|
9
|
-
function
|
|
9
|
+
function G({ size: e = 15, color: r = "currentColor", className: u = "inline", ...n }) {
|
|
10
10
|
return /* @__PURE__ */ t(
|
|
11
11
|
"svg",
|
|
12
12
|
{
|
|
@@ -28,7 +28,7 @@ function Z({ size: e = 15, color: r = "currentColor", className: u = "inline", .
|
|
|
28
28
|
}
|
|
29
29
|
);
|
|
30
30
|
}
|
|
31
|
-
function
|
|
31
|
+
function h(...e) {
|
|
32
32
|
return e.filter((r) => typeof r == "string" && r).join(" ").trim() || void 0;
|
|
33
33
|
}
|
|
34
34
|
l(void 0);
|
|
@@ -236,7 +236,15 @@ l(null);
|
|
|
236
236
|
l(null);
|
|
237
237
|
l(void 0);
|
|
238
238
|
l(void 0);
|
|
239
|
-
|
|
239
|
+
l(null);
|
|
240
|
+
l(null);
|
|
241
|
+
l(void 0);
|
|
242
|
+
l(void 0);
|
|
243
|
+
l(null);
|
|
244
|
+
l(null);
|
|
245
|
+
l(void 0);
|
|
246
|
+
l(void 0);
|
|
247
|
+
function J() {
|
|
240
248
|
const [e, r] = x(0);
|
|
241
249
|
return p(() => {
|
|
242
250
|
const u = setInterval(() => {
|
|
@@ -254,7 +262,7 @@ function G() {
|
|
|
254
262
|
u
|
|
255
263
|
)) });
|
|
256
264
|
}
|
|
257
|
-
const
|
|
265
|
+
const Q = {
|
|
258
266
|
base: "",
|
|
259
267
|
primary: "bg-primary text-primary-foreground hover:bg-primary/85 disabled:bg-muted disabled:text-muted-foreground",
|
|
260
268
|
secondary: "bg-secondary text-secondary-foreground hover:bg-secondary/85 disabled:bg-muted/80 disabled:text-muted-foreground/80",
|
|
@@ -262,7 +270,7 @@ const J = {
|
|
|
262
270
|
outline: "border border-primary text-primary hover:border-primary-foreground hover:text-primary-foreground disabled:border-muted disabled:text-muted",
|
|
263
271
|
link: "underline-offset-4 hover:underline disabled:underline disabled:text-muted",
|
|
264
272
|
destructive: "bg-destructive text-destructive-foreground hover:bg-destructive/85 disabled:bg-muted disabled:text-muted-foreground"
|
|
265
|
-
},
|
|
273
|
+
}, U = {
|
|
266
274
|
stripped: "",
|
|
267
275
|
fitted: "size-fit leading-0",
|
|
268
276
|
sm: "px-2 py-1 text-sm",
|
|
@@ -270,7 +278,7 @@ const J = {
|
|
|
270
278
|
lg: "px-6 py-3 text-lg",
|
|
271
279
|
icon: "p-1 w-fit aspect-square",
|
|
272
280
|
full: "p-2 w-full"
|
|
273
|
-
},
|
|
281
|
+
}, W = {
|
|
274
282
|
none: "rounded-none",
|
|
275
283
|
sm: "rounded-sm",
|
|
276
284
|
md: "rounded-md",
|
|
@@ -281,7 +289,7 @@ const J = {
|
|
|
281
289
|
size: "md",
|
|
282
290
|
rounded: "md"
|
|
283
291
|
};
|
|
284
|
-
function
|
|
292
|
+
function Y({
|
|
285
293
|
variant: e = k.variant,
|
|
286
294
|
size: r,
|
|
287
295
|
rounded: u = k.rounded,
|
|
@@ -293,9 +301,9 @@ function W({
|
|
|
293
301
|
e === "link" && !r ? d = "fitted" : d = r || k.size;
|
|
294
302
|
const s = y(
|
|
295
303
|
"appearance-none focus:outline-none focus:ring not-disabled:hover:cursor-pointer disabled:opacity-50 disabled:cursor-not-allowed transition-all",
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
304
|
+
Q[e],
|
|
305
|
+
U[d],
|
|
306
|
+
W[u],
|
|
299
307
|
n && "relative pointer-events-none",
|
|
300
308
|
o
|
|
301
309
|
);
|
|
@@ -333,19 +341,19 @@ function W({
|
|
|
333
341
|
type: a.type ?? "button",
|
|
334
342
|
className: s,
|
|
335
343
|
children: [
|
|
336
|
-
n && /* @__PURE__ */ t(
|
|
344
|
+
n && /* @__PURE__ */ t(J, {}),
|
|
337
345
|
c()
|
|
338
346
|
]
|
|
339
347
|
}
|
|
340
348
|
);
|
|
341
349
|
}
|
|
342
|
-
function
|
|
350
|
+
function R(e) {
|
|
343
351
|
const [r, u] = x(!1), [n, o] = x(!1);
|
|
344
352
|
return p(() => {
|
|
345
353
|
e ? (o(!0), setTimeout(() => u(!0), 10)) : (u(!1), setTimeout(() => o(!1), 150));
|
|
346
354
|
}, [e]), { show: r, shouldRender: n };
|
|
347
355
|
}
|
|
348
|
-
function
|
|
356
|
+
function ll(e, r) {
|
|
349
357
|
p(() => {
|
|
350
358
|
const u = (n) => {
|
|
351
359
|
n.key === "Escape" && e && r();
|
|
@@ -355,8 +363,8 @@ function R(e, r) {
|
|
|
355
363
|
};
|
|
356
364
|
}, [e, r]);
|
|
357
365
|
}
|
|
358
|
-
function
|
|
359
|
-
const u =
|
|
366
|
+
function el(e, r) {
|
|
367
|
+
const u = K(null), n = j(() => {
|
|
360
368
|
const o = document.getElementById(e);
|
|
361
369
|
if (!o) return;
|
|
362
370
|
const i = o.querySelectorAll('[data-modal-action="true"]');
|
|
@@ -382,7 +390,7 @@ function ll(e, r) {
|
|
|
382
390
|
document.body.style.overflow = "auto", u.current instanceof HTMLElement && u.current.focus();
|
|
383
391
|
}), [r, n]);
|
|
384
392
|
}
|
|
385
|
-
function
|
|
393
|
+
function nl({
|
|
386
394
|
id: e,
|
|
387
395
|
isOpen: r,
|
|
388
396
|
onClose: u,
|
|
@@ -391,62 +399,63 @@ function el({
|
|
|
391
399
|
contentOnly: i = !1,
|
|
392
400
|
className: d,
|
|
393
401
|
overlayClassName: s,
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
402
|
+
containerClassName: a,
|
|
403
|
+
hideCloseButton: c = !1,
|
|
404
|
+
actions: m = [],
|
|
405
|
+
disableCloseOnOverlayClick: f = !1,
|
|
406
|
+
ariaLabelledBy: b,
|
|
407
|
+
ariaDescribedBy: w
|
|
399
408
|
}) {
|
|
400
|
-
const
|
|
401
|
-
if (
|
|
402
|
-
const
|
|
403
|
-
const { label:
|
|
404
|
-
return /* @__PURE__ */ t(
|
|
409
|
+
const C = $(), E = e || `modal-${C}`, L = e ? `${e}-title` : `modal-title-${C}`, { show: A, shouldRender: N } = R(r);
|
|
410
|
+
if (el(E, N), ll(N, u), !N) return null;
|
|
411
|
+
const I = () => n ? g.isValidElement(n) ? /* @__PURE__ */ t("div", { className: "mb-4", children: n }) : /* @__PURE__ */ t("h2", { className: "mb-4 text-xl font-semibold", id: L, children: n }) : null, B = () => m.length === 0 ? null : /* @__PURE__ */ t("div", { className: "mt-6 not-sm:grid gap-y-2 sm:flex sm:justify-start sm:flex-row-reverse sm:gap-x-3", children: m.map((D, O) => {
|
|
412
|
+
const { label: S, ...q } = D;
|
|
413
|
+
return /* @__PURE__ */ t(Y, { ...q, "data-modal-action": "true", children: S }, O);
|
|
405
414
|
}) });
|
|
406
|
-
return /* @__PURE__ */ t(
|
|
415
|
+
return /* @__PURE__ */ t(H, { children: P(
|
|
407
416
|
/* @__PURE__ */ t(
|
|
408
417
|
"div",
|
|
409
418
|
{
|
|
410
|
-
"aria-labelledby":
|
|
411
|
-
"aria-describedby":
|
|
419
|
+
"aria-labelledby": b ?? n ? L : void 0,
|
|
420
|
+
"aria-describedby": w,
|
|
412
421
|
role: "dialog",
|
|
413
422
|
"aria-modal": "true",
|
|
414
423
|
className: "fixed inset-0 z-[100] overflow-y-auto",
|
|
415
|
-
children: /* @__PURE__ */ v("div", { className: "flex min-h-screen items-center justify-center p-4", children: [
|
|
424
|
+
children: /* @__PURE__ */ v("div", { className: h("flex min-h-screen items-center justify-center p-4", a), children: [
|
|
416
425
|
/* @__PURE__ */ t(
|
|
417
426
|
"div",
|
|
418
427
|
{
|
|
419
|
-
className:
|
|
428
|
+
className: h("fixed inset-0 bg-black/20 transition-all", s),
|
|
420
429
|
onClick: () => {
|
|
421
|
-
|
|
430
|
+
f || u();
|
|
422
431
|
}
|
|
423
432
|
}
|
|
424
433
|
),
|
|
425
|
-
i && /* @__PURE__ */ t("div", { className:
|
|
434
|
+
i && /* @__PURE__ */ t("div", { className: h("relative w-fit", d), children: o }),
|
|
426
435
|
!i && /* @__PURE__ */ v(
|
|
427
436
|
"div",
|
|
428
437
|
{
|
|
429
|
-
id:
|
|
438
|
+
id: E,
|
|
430
439
|
tabIndex: -1,
|
|
431
|
-
className:
|
|
440
|
+
className: h(
|
|
432
441
|
"relative w-full max-w-xl transform rounded-lg shadow-xl bg-popover text-popover-foreground transition-all p-6 focus:ring ease-in duration-75",
|
|
433
442
|
A ? "opacity-100 scale-100" : "opacity-0 scale-90",
|
|
434
443
|
d
|
|
435
444
|
),
|
|
436
445
|
children: [
|
|
437
|
-
!
|
|
446
|
+
!c && /* @__PURE__ */ t(
|
|
438
447
|
"button",
|
|
439
448
|
{
|
|
440
449
|
type: "button",
|
|
441
450
|
onClick: u,
|
|
442
451
|
"data-modal-close-button": "true",
|
|
443
452
|
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",
|
|
444
|
-
children: /* @__PURE__ */ t(
|
|
453
|
+
children: /* @__PURE__ */ t(G, { size: 18 })
|
|
445
454
|
}
|
|
446
455
|
),
|
|
447
|
-
|
|
456
|
+
I(),
|
|
448
457
|
o,
|
|
449
|
-
|
|
458
|
+
B()
|
|
450
459
|
]
|
|
451
460
|
}
|
|
452
461
|
)
|
|
@@ -456,7 +465,7 @@ function el({
|
|
|
456
465
|
document.body
|
|
457
466
|
) });
|
|
458
467
|
}
|
|
459
|
-
function
|
|
468
|
+
function sl({
|
|
460
469
|
type: e,
|
|
461
470
|
message: r,
|
|
462
471
|
cancelText: u,
|
|
@@ -467,7 +476,7 @@ function dl({
|
|
|
467
476
|
title: s,
|
|
468
477
|
...a
|
|
469
478
|
}) {
|
|
470
|
-
const c =
|
|
479
|
+
const c = z(() => e === "confirm" ? {
|
|
471
480
|
confirm: n || "Confirm",
|
|
472
481
|
cancel: u || "Cancel",
|
|
473
482
|
defaultTitle: s || "Confirm Action"
|
|
@@ -475,7 +484,7 @@ function dl({
|
|
|
475
484
|
confirm: n || "OK",
|
|
476
485
|
cancel: null,
|
|
477
486
|
defaultTitle: s || "Alert"
|
|
478
|
-
}, [e, n, s, u]), m =
|
|
487
|
+
}, [e, n, s, u]), m = z(
|
|
479
488
|
() => [
|
|
480
489
|
...c.cancel ? [
|
|
481
490
|
{
|
|
@@ -495,7 +504,7 @@ function dl({
|
|
|
495
504
|
[c, d, o, i]
|
|
496
505
|
);
|
|
497
506
|
return /* @__PURE__ */ t(
|
|
498
|
-
|
|
507
|
+
nl,
|
|
499
508
|
{
|
|
500
509
|
...a,
|
|
501
510
|
title: s || c.defaultTitle,
|
|
@@ -507,31 +516,31 @@ function dl({
|
|
|
507
516
|
}
|
|
508
517
|
);
|
|
509
518
|
}
|
|
510
|
-
const
|
|
511
|
-
const e =
|
|
519
|
+
const tl = l(null), cl = () => {
|
|
520
|
+
const e = M(tl);
|
|
512
521
|
if (!e)
|
|
513
522
|
throw new Error("DropdownMenu components must be used within a DropdownMenu component");
|
|
514
523
|
return e;
|
|
515
|
-
},
|
|
516
|
-
const e =
|
|
524
|
+
}, rl = l(null), ml = () => {
|
|
525
|
+
const e = M(rl);
|
|
517
526
|
if (!e)
|
|
518
527
|
throw new Error("Tabs components must be used within a Tabs component");
|
|
519
528
|
return e;
|
|
520
|
-
},
|
|
529
|
+
}, T = {
|
|
521
530
|
info: {
|
|
522
531
|
className: "bg-blue-50 border-blue-200 text-blue-900 dark:bg-blue-800 dark:border-blue-950 dark:text-blue-100",
|
|
523
|
-
icon: /* @__PURE__ */ t(
|
|
532
|
+
icon: /* @__PURE__ */ t(X, { size: 20 })
|
|
524
533
|
},
|
|
525
534
|
warning: {
|
|
526
535
|
className: "bg-yellow-50 border-yellow-200 text-yellow-900 dark:bg-yellow-800 dark:border-yellow-950 dark:text-yellow-100",
|
|
527
|
-
icon: /* @__PURE__ */ t(
|
|
536
|
+
icon: /* @__PURE__ */ t(F, { size: 20 })
|
|
528
537
|
},
|
|
529
538
|
error: {
|
|
530
539
|
className: "bg-red-50 border-red-200 text-red-900 dark:bg-red-800 dark:border-red-950 dark:text-red-100",
|
|
531
|
-
icon: /* @__PURE__ */ t(
|
|
540
|
+
icon: /* @__PURE__ */ t(_, { size: 20 })
|
|
532
541
|
}
|
|
533
542
|
};
|
|
534
|
-
function
|
|
543
|
+
function fl({
|
|
535
544
|
id: e,
|
|
536
545
|
title: r,
|
|
537
546
|
description: u,
|
|
@@ -542,17 +551,17 @@ function ml({
|
|
|
542
551
|
customTypes: s,
|
|
543
552
|
customComponent: a
|
|
544
553
|
}) {
|
|
545
|
-
const [c, m] = x(!1), f =
|
|
554
|
+
const [c, m] = x(!1), f = j(() => {
|
|
546
555
|
m(!0), setTimeout(() => {
|
|
547
556
|
d == null || d(e);
|
|
548
557
|
}, 150);
|
|
549
558
|
}, [e, d]);
|
|
550
559
|
if (p(() => {
|
|
551
560
|
if (i > 0) {
|
|
552
|
-
const
|
|
561
|
+
const w = setTimeout(() => {
|
|
553
562
|
f();
|
|
554
563
|
}, i);
|
|
555
|
-
return () => clearTimeout(
|
|
564
|
+
return () => clearTimeout(w);
|
|
556
565
|
}
|
|
557
566
|
}, [i, e, d, f]), a)
|
|
558
567
|
return /* @__PURE__ */ t(
|
|
@@ -567,13 +576,13 @@ function ml({
|
|
|
567
576
|
onRemove: d
|
|
568
577
|
}
|
|
569
578
|
);
|
|
570
|
-
const b = (s == null ? void 0 : s[n]) ||
|
|
579
|
+
const b = (s == null ? void 0 : s[n]) || T[n] || T.info;
|
|
571
580
|
return /* @__PURE__ */ v(
|
|
572
581
|
"div",
|
|
573
582
|
{
|
|
574
583
|
role: n === "error" ? "alert" : "status",
|
|
575
584
|
"aria-live": n === "error" ? void 0 : "polite",
|
|
576
|
-
className:
|
|
585
|
+
className: Z(
|
|
577
586
|
"relative flex items-start p-4 rounded-lg border shadow-lg transition-all duration-150 ease-in-out",
|
|
578
587
|
o && "pb-3",
|
|
579
588
|
b.className,
|
|
@@ -598,7 +607,7 @@ function ml({
|
|
|
598
607
|
{
|
|
599
608
|
onClick: f,
|
|
600
609
|
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",
|
|
601
|
-
children: /* @__PURE__ */ t(
|
|
610
|
+
children: /* @__PURE__ */ t(V, { size: 16 })
|
|
602
611
|
}
|
|
603
612
|
)
|
|
604
613
|
]
|
|
@@ -606,12 +615,12 @@ function ml({
|
|
|
606
615
|
);
|
|
607
616
|
}
|
|
608
617
|
export {
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
618
|
+
sl as A,
|
|
619
|
+
tl as D,
|
|
620
|
+
fl as T,
|
|
621
|
+
rl as a,
|
|
622
|
+
ml as b,
|
|
614
623
|
y as n,
|
|
615
|
-
|
|
624
|
+
cl as u
|
|
616
625
|
};
|
|
617
|
-
//# sourceMappingURL=Toast-
|
|
626
|
+
//# sourceMappingURL=Toast-BzvqSVjP.js.map
|