@moondreamsdev/dreamer-ui 1.7.10-test.170 → 1.7.10-test.172
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-DJVcqZ--.js → Toast-DU6Oe330.js} +84 -72
- package/dist/Toast-DU6Oe330.js.map +1 -0
- package/dist/Toast-c-A86_m1.cjs +2 -0
- package/dist/Toast-c-A86_m1.cjs.map +1 -0
- package/dist/components.cjs.js +2 -2
- package/dist/components.cjs.js.map +1 -1
- package/dist/components.esm.js +1220 -1221
- 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/tooltip/hooks.d.ts +1 -1
- package/package.json +4 -1
- package/dist/Toast-CFLcoQ-A.cjs +0 -2
- package/dist/Toast-CFLcoQ-A.cjs.map +0 -1
- package/dist/Toast-DJVcqZ--.js.map +0 -1
|
@@ -1,26 +1,26 @@
|
|
|
1
1
|
import { jsx as t, Fragment as H, jsxs as b } from "react/jsx-runtime";
|
|
2
|
-
import g, { createContext as l, useId as $, useState as x, useEffect as p, useRef as Q, useCallback as
|
|
2
|
+
import g, { createContext as l, useId as $, useState as x, useEffect as p, useRef as Q, useCallback as j, useMemo as T, useContext as A } from "react";
|
|
3
3
|
import { createPortal as V } from "react-dom";
|
|
4
4
|
import { X as Z, C as F, E as K, I as P } from "./X-CIoyLewf.js";
|
|
5
5
|
import { j as X } from "./join-BmgR_f4v.js";
|
|
6
6
|
function y(...n) {
|
|
7
|
-
return n.filter((
|
|
7
|
+
return n.filter((u) => typeof u == "string" && u).join(" ").trim() || void 0;
|
|
8
8
|
}
|
|
9
|
-
function Y({ size: n = 15, color:
|
|
9
|
+
function Y({ size: n = 15, color: u = "currentColor", className: r = "inline", ...e }) {
|
|
10
10
|
return /* @__PURE__ */ t(
|
|
11
11
|
"svg",
|
|
12
12
|
{
|
|
13
13
|
...e,
|
|
14
14
|
width: n,
|
|
15
15
|
height: n,
|
|
16
|
-
className:
|
|
16
|
+
className: r,
|
|
17
17
|
viewBox: "0 0 15 15",
|
|
18
18
|
xmlns: "http://www.w3.org/2000/svg",
|
|
19
19
|
children: /* @__PURE__ */ t(
|
|
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: u,
|
|
24
24
|
fillRule: "evenodd",
|
|
25
25
|
clipRule: "evenodd"
|
|
26
26
|
}
|
|
@@ -29,7 +29,7 @@ function Y({ size: n = 15, color: r = "currentColor", className: u = "inline", .
|
|
|
29
29
|
);
|
|
30
30
|
}
|
|
31
31
|
function h(...n) {
|
|
32
|
-
return n.filter((
|
|
32
|
+
return n.filter((u) => typeof u == "string" && u).join(" ").trim() || void 0;
|
|
33
33
|
}
|
|
34
34
|
l(void 0);
|
|
35
35
|
l(null);
|
|
@@ -292,22 +292,34 @@ l(null);
|
|
|
292
292
|
l(null);
|
|
293
293
|
l(void 0);
|
|
294
294
|
l(void 0);
|
|
295
|
+
l(null);
|
|
296
|
+
l(null);
|
|
297
|
+
l(void 0);
|
|
298
|
+
l(void 0);
|
|
299
|
+
l(null);
|
|
300
|
+
l(null);
|
|
301
|
+
l(void 0);
|
|
302
|
+
l(void 0);
|
|
303
|
+
l(null);
|
|
304
|
+
l(null);
|
|
305
|
+
l(void 0);
|
|
306
|
+
l(void 0);
|
|
295
307
|
function _() {
|
|
296
|
-
const [n,
|
|
308
|
+
const [n, u] = x(0);
|
|
297
309
|
return p(() => {
|
|
298
|
-
const
|
|
299
|
-
|
|
310
|
+
const r = setInterval(() => {
|
|
311
|
+
u((e) => (e + 1) % 3);
|
|
300
312
|
}, 500);
|
|
301
|
-
return () => clearInterval(
|
|
302
|
-
}, []), /* @__PURE__ */ t("div", { className: "absolute inset-0 inline-flex items-center justify-center gap-x-2 align-middle", children: [0, 1, 2].map((
|
|
313
|
+
return () => clearInterval(r);
|
|
314
|
+
}, []), /* @__PURE__ */ t("div", { className: "absolute inset-0 inline-flex items-center justify-center gap-x-2 align-middle", children: [0, 1, 2].map((r) => /* @__PURE__ */ t(
|
|
303
315
|
"div",
|
|
304
316
|
{
|
|
305
317
|
className: y(
|
|
306
318
|
"rounded-full transition-all duration-500 ease-in-out size-[0.35em] bg-current",
|
|
307
|
-
n ===
|
|
319
|
+
n === r && "transform -translate-y-1"
|
|
308
320
|
)
|
|
309
321
|
},
|
|
310
|
-
|
|
322
|
+
r
|
|
311
323
|
)) });
|
|
312
324
|
}
|
|
313
325
|
const G = {
|
|
@@ -339,19 +351,19 @@ const G = {
|
|
|
339
351
|
};
|
|
340
352
|
function W({
|
|
341
353
|
variant: n = k.variant,
|
|
342
|
-
size:
|
|
343
|
-
rounded:
|
|
354
|
+
size: u,
|
|
355
|
+
rounded: r = k.rounded,
|
|
344
356
|
loading: e,
|
|
345
357
|
className: o,
|
|
346
358
|
...i
|
|
347
359
|
}) {
|
|
348
360
|
let a;
|
|
349
|
-
n === "link" && !
|
|
361
|
+
n === "link" && !u ? a = "fitted" : a = u || k.size;
|
|
350
362
|
const s = y(
|
|
351
363
|
"appearance-none focus:outline-none focus:ring not-disabled:hover:cursor-pointer disabled:opacity-50 disabled:cursor-not-allowed transition-all",
|
|
352
364
|
G[n],
|
|
353
365
|
J[a],
|
|
354
|
-
U[
|
|
366
|
+
U[r],
|
|
355
367
|
e && "relative pointer-events-none",
|
|
356
368
|
o
|
|
357
369
|
);
|
|
@@ -368,12 +380,12 @@ function W({
|
|
|
368
380
|
children: i.children
|
|
369
381
|
}
|
|
370
382
|
);
|
|
371
|
-
const d = i, c = () => d.children ? typeof d.children == "string" || typeof d.children == "number" || typeof d.children == "boolean" ? /* @__PURE__ */ t("span", { className: y(e && "invisible"), children: d.children }) : g.Children.map(d.children, (m,
|
|
383
|
+
const d = i, c = () => d.children ? typeof d.children == "string" || typeof d.children == "number" || typeof d.children == "boolean" ? /* @__PURE__ */ t("span", { className: y(e && "invisible"), children: d.children }) : g.Children.map(d.children, (m, v) => {
|
|
372
384
|
if (g.isValidElement(m)) {
|
|
373
|
-
const
|
|
385
|
+
const f = m.props;
|
|
374
386
|
return g.cloneElement(m, {
|
|
375
|
-
key:
|
|
376
|
-
className: y(e && "invisible",
|
|
387
|
+
key: v,
|
|
388
|
+
className: y(e && "invisible", f.className)
|
|
377
389
|
});
|
|
378
390
|
}
|
|
379
391
|
return m;
|
|
@@ -396,23 +408,23 @@ function W({
|
|
|
396
408
|
);
|
|
397
409
|
}
|
|
398
410
|
function R(n) {
|
|
399
|
-
const [
|
|
411
|
+
const [u, r] = x(!1), [e, o] = x(!1);
|
|
400
412
|
return p(() => {
|
|
401
|
-
n ? (o(!0), setTimeout(() =>
|
|
402
|
-
}, [n]), { show:
|
|
413
|
+
n ? (o(!0), setTimeout(() => r(!0), 10)) : (r(!1), setTimeout(() => o(!1), 150));
|
|
414
|
+
}, [n]), { show: u, shouldRender: e };
|
|
403
415
|
}
|
|
404
|
-
function ll(n,
|
|
416
|
+
function ll(n, u) {
|
|
405
417
|
p(() => {
|
|
406
|
-
const
|
|
407
|
-
e.key === "Escape" && n &&
|
|
418
|
+
const r = (e) => {
|
|
419
|
+
e.key === "Escape" && n && u();
|
|
408
420
|
};
|
|
409
|
-
return document.addEventListener("keydown",
|
|
410
|
-
document.removeEventListener("keydown",
|
|
421
|
+
return document.addEventListener("keydown", r), n && (document.body.style.overflow = "hidden"), () => {
|
|
422
|
+
document.removeEventListener("keydown", r), document.body.style.overflow = "auto";
|
|
411
423
|
};
|
|
412
|
-
}, [n,
|
|
424
|
+
}, [n, u]);
|
|
413
425
|
}
|
|
414
|
-
function nl(n,
|
|
415
|
-
const
|
|
426
|
+
function nl(n, u) {
|
|
427
|
+
const r = Q(null), e = j(() => {
|
|
416
428
|
const o = document.getElementById(n);
|
|
417
429
|
if (!o) return;
|
|
418
430
|
const i = o.querySelectorAll('[data-modal-action="true"]');
|
|
@@ -434,14 +446,14 @@ function nl(n, r) {
|
|
|
434
446
|
}
|
|
435
447
|
o.focus();
|
|
436
448
|
}, [n]);
|
|
437
|
-
p(() => (
|
|
438
|
-
document.body.style.overflow = "auto",
|
|
439
|
-
}), [
|
|
449
|
+
p(() => (u && (r.current = document.activeElement, e()), () => {
|
|
450
|
+
document.body.style.overflow = "auto", r.current instanceof HTMLElement && r.current.focus();
|
|
451
|
+
}), [u, e]);
|
|
440
452
|
}
|
|
441
453
|
function el({
|
|
442
454
|
id: n,
|
|
443
|
-
isOpen:
|
|
444
|
-
onClose:
|
|
455
|
+
isOpen: u,
|
|
456
|
+
onClose: r,
|
|
445
457
|
title: e,
|
|
446
458
|
children: o,
|
|
447
459
|
contentOnly: i = !1,
|
|
@@ -450,12 +462,12 @@ function el({
|
|
|
450
462
|
containerClassName: d,
|
|
451
463
|
hideCloseButton: c = !1,
|
|
452
464
|
actions: m = [],
|
|
453
|
-
disableCloseOnOverlayClick:
|
|
454
|
-
ariaLabelledBy:
|
|
465
|
+
disableCloseOnOverlayClick: v = !1,
|
|
466
|
+
ariaLabelledBy: f,
|
|
455
467
|
ariaDescribedBy: w
|
|
456
468
|
}) {
|
|
457
|
-
const C = $(), E = n || `modal-${C}`, L = n ? `${n}-title` : `modal-title-${C}`, { show:
|
|
458
|
-
if (nl(E, N), ll(N,
|
|
469
|
+
const C = $(), E = n || `modal-${C}`, L = n ? `${n}-title` : `modal-title-${C}`, { show: M, shouldRender: N } = R(u);
|
|
470
|
+
if (nl(E, N), ll(N, r), !N) return null;
|
|
459
471
|
const D = () => e ? g.isValidElement(e) ? /* @__PURE__ */ t("div", { className: "mb-4", children: e }) : /* @__PURE__ */ t("h2", { className: "mb-4 text-xl font-semibold", id: L, children: e }) : null, I = () => 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((B, O) => {
|
|
460
472
|
const { label: S, ...q } = B;
|
|
461
473
|
return /* @__PURE__ */ t(W, { ...q, "data-modal-action": "true", children: S }, O);
|
|
@@ -464,7 +476,7 @@ function el({
|
|
|
464
476
|
/* @__PURE__ */ t(
|
|
465
477
|
"div",
|
|
466
478
|
{
|
|
467
|
-
"aria-labelledby":
|
|
479
|
+
"aria-labelledby": f ?? e ? L : void 0,
|
|
468
480
|
"aria-describedby": w,
|
|
469
481
|
role: "dialog",
|
|
470
482
|
"aria-modal": "true",
|
|
@@ -475,7 +487,7 @@ function el({
|
|
|
475
487
|
{
|
|
476
488
|
className: h("fixed inset-0 bg-black/20 transition-all", s),
|
|
477
489
|
onClick: () => {
|
|
478
|
-
|
|
490
|
+
v || r();
|
|
479
491
|
}
|
|
480
492
|
}
|
|
481
493
|
),
|
|
@@ -487,7 +499,7 @@ function el({
|
|
|
487
499
|
tabIndex: -1,
|
|
488
500
|
className: h(
|
|
489
501
|
"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",
|
|
490
|
-
|
|
502
|
+
M ? "opacity-100 scale-100" : "opacity-0 scale-90",
|
|
491
503
|
a
|
|
492
504
|
),
|
|
493
505
|
children: [
|
|
@@ -495,7 +507,7 @@ function el({
|
|
|
495
507
|
"button",
|
|
496
508
|
{
|
|
497
509
|
type: "button",
|
|
498
|
-
onClick:
|
|
510
|
+
onClick: r,
|
|
499
511
|
"data-modal-close-button": "true",
|
|
500
512
|
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",
|
|
501
513
|
children: /* @__PURE__ */ t(Y, { size: 18 })
|
|
@@ -515,8 +527,8 @@ function el({
|
|
|
515
527
|
}
|
|
516
528
|
function sl({
|
|
517
529
|
type: n,
|
|
518
|
-
message:
|
|
519
|
-
cancelText:
|
|
530
|
+
message: u,
|
|
531
|
+
cancelText: r,
|
|
520
532
|
confirmText: e,
|
|
521
533
|
onConfirm: o,
|
|
522
534
|
onClose: i,
|
|
@@ -524,15 +536,15 @@ function sl({
|
|
|
524
536
|
title: s,
|
|
525
537
|
...d
|
|
526
538
|
}) {
|
|
527
|
-
const c =
|
|
539
|
+
const c = T(() => n === "confirm" ? {
|
|
528
540
|
confirm: e || "Confirm",
|
|
529
|
-
cancel:
|
|
541
|
+
cancel: r || "Cancel",
|
|
530
542
|
defaultTitle: s || "Confirm Action"
|
|
531
543
|
} : {
|
|
532
544
|
confirm: e || "OK",
|
|
533
545
|
cancel: null,
|
|
534
546
|
defaultTitle: s || "Alert"
|
|
535
|
-
}, [n, e, s,
|
|
547
|
+
}, [n, e, s, r]), m = T(
|
|
536
548
|
() => [
|
|
537
549
|
...c.cancel ? [
|
|
538
550
|
{
|
|
@@ -560,21 +572,21 @@ function sl({
|
|
|
560
572
|
actions: m,
|
|
561
573
|
disableCloseOnOverlayClick: n === "confirm",
|
|
562
574
|
hideCloseButton: n === "confirm",
|
|
563
|
-
children: typeof
|
|
575
|
+
children: typeof u == "string" ? /* @__PURE__ */ t("p", { className: "text-sm", children: u }) : u
|
|
564
576
|
}
|
|
565
577
|
);
|
|
566
578
|
}
|
|
567
579
|
const tl = l(null), cl = () => {
|
|
568
|
-
const n =
|
|
580
|
+
const n = A(tl);
|
|
569
581
|
if (!n)
|
|
570
582
|
throw new Error("DropdownMenu components must be used within a DropdownMenu component");
|
|
571
583
|
return n;
|
|
572
|
-
},
|
|
573
|
-
const n =
|
|
584
|
+
}, ul = l(null), ml = () => {
|
|
585
|
+
const n = A(ul);
|
|
574
586
|
if (!n)
|
|
575
587
|
throw new Error("Tabs components must be used within a Tabs component");
|
|
576
588
|
return n;
|
|
577
|
-
},
|
|
589
|
+
}, z = {
|
|
578
590
|
info: {
|
|
579
591
|
className: "bg-blue-50 border-blue-200 text-blue-900 dark:bg-blue-800 dark:border-blue-950 dark:text-blue-100",
|
|
580
592
|
icon: /* @__PURE__ */ t(P, { size: 20 })
|
|
@@ -588,10 +600,10 @@ const tl = l(null), cl = () => {
|
|
|
588
600
|
icon: /* @__PURE__ */ t(F, { size: 20 })
|
|
589
601
|
}
|
|
590
602
|
};
|
|
591
|
-
function
|
|
603
|
+
function vl({
|
|
592
604
|
id: n,
|
|
593
|
-
title:
|
|
594
|
-
description:
|
|
605
|
+
title: u,
|
|
606
|
+
description: r,
|
|
595
607
|
type: e = "info",
|
|
596
608
|
action: o,
|
|
597
609
|
duration: i = 5e3,
|
|
@@ -599,7 +611,7 @@ function fl({
|
|
|
599
611
|
customTypes: s,
|
|
600
612
|
customComponent: d
|
|
601
613
|
}) {
|
|
602
|
-
const [c, m] = x(!1),
|
|
614
|
+
const [c, m] = x(!1), v = j(() => {
|
|
603
615
|
m(!0), setTimeout(() => {
|
|
604
616
|
a == null || a(n);
|
|
605
617
|
}, 150);
|
|
@@ -607,24 +619,24 @@ function fl({
|
|
|
607
619
|
if (p(() => {
|
|
608
620
|
if (i > 0) {
|
|
609
621
|
const w = setTimeout(() => {
|
|
610
|
-
|
|
622
|
+
v();
|
|
611
623
|
}, i);
|
|
612
624
|
return () => clearTimeout(w);
|
|
613
625
|
}
|
|
614
|
-
}, [i, n, a,
|
|
626
|
+
}, [i, n, a, v]), d)
|
|
615
627
|
return /* @__PURE__ */ t(
|
|
616
628
|
d,
|
|
617
629
|
{
|
|
618
630
|
id: n,
|
|
619
|
-
title:
|
|
620
|
-
description:
|
|
631
|
+
title: u,
|
|
632
|
+
description: r,
|
|
621
633
|
type: e,
|
|
622
634
|
action: o,
|
|
623
635
|
duration: i,
|
|
624
636
|
onRemove: a
|
|
625
637
|
}
|
|
626
638
|
);
|
|
627
|
-
const
|
|
639
|
+
const f = (s == null ? void 0 : s[e]) || z[e] || z.info;
|
|
628
640
|
return /* @__PURE__ */ b(
|
|
629
641
|
"div",
|
|
630
642
|
{
|
|
@@ -633,14 +645,14 @@ function fl({
|
|
|
633
645
|
className: X(
|
|
634
646
|
"relative flex items-start p-4 rounded-lg border shadow-lg transition-all duration-150 ease-in-out",
|
|
635
647
|
o && "pb-3",
|
|
636
|
-
|
|
648
|
+
f.className,
|
|
637
649
|
c ? "opacity-0 translate-x-full" : "opacity-100 translate-x-0"
|
|
638
650
|
),
|
|
639
651
|
children: [
|
|
640
|
-
/* @__PURE__ */ t("div", { className: "flex-shrink-0 mr-3", children:
|
|
652
|
+
/* @__PURE__ */ t("div", { className: "flex-shrink-0 mr-3", children: f.icon }),
|
|
641
653
|
/* @__PURE__ */ b("div", { className: "flex-grow min-w-0", children: [
|
|
642
|
-
/* @__PURE__ */ t("div", { className: "font-medium text-sm leading-5", children:
|
|
643
|
-
|
|
654
|
+
/* @__PURE__ */ t("div", { className: "font-medium text-sm leading-5", children: u }),
|
|
655
|
+
r && /* @__PURE__ */ t("div", { className: "mt-1 text-sm opacity-90 leading-5", children: r }),
|
|
644
656
|
o && /* @__PURE__ */ t("div", { className: "mt-1.5", children: /* @__PURE__ */ t(
|
|
645
657
|
"button",
|
|
646
658
|
{
|
|
@@ -653,7 +665,7 @@ function fl({
|
|
|
653
665
|
/* @__PURE__ */ t(
|
|
654
666
|
"button",
|
|
655
667
|
{
|
|
656
|
-
onClick:
|
|
668
|
+
onClick: v,
|
|
657
669
|
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",
|
|
658
670
|
children: /* @__PURE__ */ t(Z, { size: 16 })
|
|
659
671
|
}
|
|
@@ -665,10 +677,10 @@ function fl({
|
|
|
665
677
|
export {
|
|
666
678
|
sl as A,
|
|
667
679
|
tl as D,
|
|
668
|
-
|
|
669
|
-
|
|
680
|
+
vl as T,
|
|
681
|
+
ul as a,
|
|
670
682
|
ml as b,
|
|
671
683
|
y as n,
|
|
672
684
|
cl as u
|
|
673
685
|
};
|
|
674
|
-
//# sourceMappingURL=Toast-
|
|
686
|
+
//# sourceMappingURL=Toast-DU6Oe330.js.map
|