@moondreamsdev/dreamer-ui 1.7.19-test.55 → 1.7.19-test.56
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-BKPAmlx3.js → Toast-Cqhy4i4q.js} +68 -63
- package/dist/Toast-Cqhy4i4q.js.map +1 -0
- package/dist/{Toast-Cc565Mvl.cjs → Toast-T19Ucjlt.cjs} +2 -2
- package/dist/Toast-T19Ucjlt.cjs.map +1 -0
- package/dist/components.cjs.js +1 -1
- package/dist/components.esm.js +63 -63
- package/dist/providers.cjs.js +1 -1
- package/dist/providers.cjs.js.map +1 -1
- package/dist/providers.esm.js +73 -72
- package/dist/providers.esm.js.map +1 -1
- package/package.json +1 -1
- package/dist/Toast-BKPAmlx3.js.map +0 -1
- package/dist/Toast-Cc565Mvl.cjs.map +0 -1
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import g, { createContext as l, useId as
|
|
3
|
-
import { createPortal as
|
|
4
|
-
import { X as
|
|
5
|
-
import { j as
|
|
1
|
+
import { jsx as i, Fragment as q, jsxs as b } from "react/jsx-runtime";
|
|
2
|
+
import g, { createContext as l, useId as X, useState as x, useEffect as p, useRef as H, useCallback as j, useMemo as z, useContext as A } from "react";
|
|
3
|
+
import { createPortal as V } from "react-dom";
|
|
4
|
+
import { X as F, C as K, E as P, I as Z } from "./X-CIoyLewf.js";
|
|
5
|
+
import { j as _ } from "./join-BmgR_f4v.js";
|
|
6
6
|
function y(...n) {
|
|
7
|
-
return n.filter((
|
|
7
|
+
return n.filter((e) => typeof e == "string" && e).join(" ").trim() || void 0;
|
|
8
8
|
}
|
|
9
|
-
function
|
|
10
|
-
return /* @__PURE__ */
|
|
9
|
+
function G({ size: n = 15, color: e = "currentColor", className: u = "inline", ...o }) {
|
|
10
|
+
return /* @__PURE__ */ i(
|
|
11
11
|
"svg",
|
|
12
12
|
{
|
|
13
13
|
...o,
|
|
@@ -16,11 +16,11 @@ function _({ size: n = 15, color: i = "currentColor", className: u = "inline", .
|
|
|
16
16
|
className: u,
|
|
17
17
|
viewBox: "0 0 15 15",
|
|
18
18
|
xmlns: "http://www.w3.org/2000/svg",
|
|
19
|
-
children: /* @__PURE__ */
|
|
19
|
+
children: /* @__PURE__ */ i(
|
|
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: e,
|
|
24
24
|
fillRule: "evenodd",
|
|
25
25
|
clipRule: "evenodd"
|
|
26
26
|
}
|
|
@@ -29,7 +29,7 @@ function _({ size: n = 15, color: i = "currentColor", className: u = "inline", .
|
|
|
29
29
|
);
|
|
30
30
|
}
|
|
31
31
|
function h(...n) {
|
|
32
|
-
return n.filter((
|
|
32
|
+
return n.filter((e) => typeof e == "string" && e).join(" ").trim() || void 0;
|
|
33
33
|
}
|
|
34
34
|
l(void 0);
|
|
35
35
|
l(null);
|
|
@@ -606,14 +606,19 @@ l(null);
|
|
|
606
606
|
l(void 0);
|
|
607
607
|
l(void 0);
|
|
608
608
|
l(void 0);
|
|
609
|
-
|
|
610
|
-
|
|
609
|
+
l(null);
|
|
610
|
+
l(null);
|
|
611
|
+
l(void 0);
|
|
612
|
+
l(void 0);
|
|
613
|
+
l(void 0);
|
|
614
|
+
function J() {
|
|
615
|
+
const [n, e] = x(0);
|
|
611
616
|
return p(() => {
|
|
612
617
|
const u = setInterval(() => {
|
|
613
|
-
|
|
618
|
+
e((o) => (o + 1) % 3);
|
|
614
619
|
}, 500);
|
|
615
620
|
return () => clearInterval(u);
|
|
616
|
-
}, []), /* @__PURE__ */
|
|
621
|
+
}, []), /* @__PURE__ */ i("div", { className: "absolute inset-0 inline-flex items-center justify-center gap-x-2 align-middle", children: [0, 1, 2].map((u) => /* @__PURE__ */ i(
|
|
617
622
|
"div",
|
|
618
623
|
{
|
|
619
624
|
className: y(
|
|
@@ -653,14 +658,14 @@ const Q = {
|
|
|
653
658
|
};
|
|
654
659
|
function Y({
|
|
655
660
|
variant: n = k.variant,
|
|
656
|
-
size:
|
|
661
|
+
size: e,
|
|
657
662
|
rounded: u = k.rounded,
|
|
658
663
|
loading: o,
|
|
659
664
|
className: t,
|
|
660
665
|
...d
|
|
661
666
|
}) {
|
|
662
667
|
let a;
|
|
663
|
-
n === "link" && !
|
|
668
|
+
n === "link" && !e ? a = "fitted" : a = e || k.size;
|
|
664
669
|
const v = y(
|
|
665
670
|
"appearance-none not-disabled:hover:cursor-pointer outline outline-transparent disabled:opacity-50 disabled:cursor-not-allowed transition-all",
|
|
666
671
|
Q[n],
|
|
@@ -670,7 +675,7 @@ function Y({
|
|
|
670
675
|
t
|
|
671
676
|
);
|
|
672
677
|
if (d.href && !d.disabled)
|
|
673
|
-
return /* @__PURE__ */
|
|
678
|
+
return /* @__PURE__ */ i(
|
|
674
679
|
"a",
|
|
675
680
|
{
|
|
676
681
|
...d,
|
|
@@ -682,7 +687,7 @@ function Y({
|
|
|
682
687
|
children: d.children
|
|
683
688
|
}
|
|
684
689
|
);
|
|
685
|
-
const r = d, s = () => r.children ? typeof r.children == "string" || typeof r.children == "number" || typeof r.children == "boolean" ? /* @__PURE__ */
|
|
690
|
+
const r = d, s = () => r.children ? typeof r.children == "string" || typeof r.children == "number" || typeof r.children == "boolean" ? /* @__PURE__ */ i("span", { className: y(o && "invisible"), children: r.children }) : g.Children.map(r.children, (c, f) => {
|
|
686
691
|
if (g.isValidElement(c)) {
|
|
687
692
|
const m = c.props;
|
|
688
693
|
return g.cloneElement(c, {
|
|
@@ -703,30 +708,30 @@ function Y({
|
|
|
703
708
|
type: r.type ?? "button",
|
|
704
709
|
className: v,
|
|
705
710
|
children: [
|
|
706
|
-
o && /* @__PURE__ */
|
|
711
|
+
o && /* @__PURE__ */ i(J, {}),
|
|
707
712
|
s()
|
|
708
713
|
]
|
|
709
714
|
}
|
|
710
715
|
);
|
|
711
716
|
}
|
|
712
717
|
function R(n) {
|
|
713
|
-
const [
|
|
718
|
+
const [e, u] = x(!1), [o, t] = x(!1);
|
|
714
719
|
return p(() => {
|
|
715
720
|
n ? (t(!0), setTimeout(() => u(!0), 10)) : (u(!1), setTimeout(() => t(!1), 150));
|
|
716
|
-
}, [n]), { show:
|
|
721
|
+
}, [n]), { show: e, shouldRender: o };
|
|
717
722
|
}
|
|
718
|
-
function ll(n,
|
|
723
|
+
function ll(n, e) {
|
|
719
724
|
p(() => {
|
|
720
725
|
const u = (o) => {
|
|
721
|
-
o.key === "Escape" && n &&
|
|
726
|
+
o.key === "Escape" && n && e();
|
|
722
727
|
};
|
|
723
728
|
return document.addEventListener("keydown", u), n && (document.body.style.overflow = "hidden"), () => {
|
|
724
729
|
document.removeEventListener("keydown", u), document.body.style.overflow = "auto";
|
|
725
730
|
};
|
|
726
|
-
}, [n,
|
|
731
|
+
}, [n, e]);
|
|
727
732
|
}
|
|
728
|
-
function nl(n,
|
|
729
|
-
const u =
|
|
733
|
+
function nl(n, e) {
|
|
734
|
+
const u = H(null), o = j(() => {
|
|
730
735
|
const t = document.getElementById(n);
|
|
731
736
|
if (!t) return;
|
|
732
737
|
const d = t.querySelectorAll('[data-modal-action="true"]');
|
|
@@ -748,13 +753,13 @@ function nl(n, i) {
|
|
|
748
753
|
}
|
|
749
754
|
t.focus();
|
|
750
755
|
}, [n]);
|
|
751
|
-
p(() => (
|
|
756
|
+
p(() => (e && (u.current = document.activeElement, o()), () => {
|
|
752
757
|
document.body.style.overflow = "auto", u.current instanceof HTMLElement && u.current.focus();
|
|
753
|
-
}), [
|
|
758
|
+
}), [e, o]);
|
|
754
759
|
}
|
|
755
760
|
function ol({
|
|
756
761
|
id: n,
|
|
757
|
-
isOpen:
|
|
762
|
+
isOpen: e,
|
|
758
763
|
onClose: u,
|
|
759
764
|
title: o,
|
|
760
765
|
children: t,
|
|
@@ -768,14 +773,14 @@ function ol({
|
|
|
768
773
|
ariaLabelledBy: m,
|
|
769
774
|
ariaDescribedBy: w
|
|
770
775
|
}) {
|
|
771
|
-
const C =
|
|
776
|
+
const C = X(), E = n || `modal-${C}`, L = n ? `${n}-title` : `modal-title-${C}`, { show: M, shouldRender: N } = R(e);
|
|
772
777
|
if (nl(E, N), ll(N, u), !N) return null;
|
|
773
|
-
const B = () => o ? g.isValidElement(o) ? /* @__PURE__ */
|
|
774
|
-
const { label: S
|
|
775
|
-
return /* @__PURE__ */
|
|
778
|
+
const B = () => o ? g.isValidElement(o) ? /* @__PURE__ */ i("div", { className: "mb-4", children: o }) : /* @__PURE__ */ i("h2", { className: "mb-4 text-xl font-semibold", id: L, children: o }) : null, I = () => c.length === 0 ? null : /* @__PURE__ */ i("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((D, O) => {
|
|
779
|
+
const { label: $, ...S } = D;
|
|
780
|
+
return /* @__PURE__ */ i(Y, { ...S, "data-modal-action": "true", children: $ }, O);
|
|
776
781
|
}) });
|
|
777
|
-
return /* @__PURE__ */
|
|
778
|
-
/* @__PURE__ */
|
|
782
|
+
return /* @__PURE__ */ i(q, { children: V(
|
|
783
|
+
/* @__PURE__ */ i(
|
|
779
784
|
"div",
|
|
780
785
|
{
|
|
781
786
|
"aria-labelledby": m ?? o ? L : void 0,
|
|
@@ -784,7 +789,7 @@ function ol({
|
|
|
784
789
|
"aria-modal": "true",
|
|
785
790
|
className: "fixed inset-0 z-[100] overflow-y-auto",
|
|
786
791
|
children: /* @__PURE__ */ b("div", { className: h("flex min-h-screen items-center justify-center p-4", r), children: [
|
|
787
|
-
/* @__PURE__ */
|
|
792
|
+
/* @__PURE__ */ i(
|
|
788
793
|
"div",
|
|
789
794
|
{
|
|
790
795
|
className: h("fixed inset-0 bg-black/20 transition-all", v),
|
|
@@ -793,7 +798,7 @@ function ol({
|
|
|
793
798
|
}
|
|
794
799
|
}
|
|
795
800
|
),
|
|
796
|
-
d && /* @__PURE__ */
|
|
801
|
+
d && /* @__PURE__ */ i("div", { className: h("relative w-fit", a), children: t }),
|
|
797
802
|
!d && /* @__PURE__ */ b(
|
|
798
803
|
"div",
|
|
799
804
|
{
|
|
@@ -805,14 +810,14 @@ function ol({
|
|
|
805
810
|
a
|
|
806
811
|
),
|
|
807
812
|
children: [
|
|
808
|
-
!s && /* @__PURE__ */
|
|
813
|
+
!s && /* @__PURE__ */ i(
|
|
809
814
|
"button",
|
|
810
815
|
{
|
|
811
816
|
type: "button",
|
|
812
817
|
onClick: u,
|
|
813
818
|
"data-modal-close-button": "true",
|
|
814
819
|
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",
|
|
815
|
-
children: /* @__PURE__ */
|
|
820
|
+
children: /* @__PURE__ */ i(G, { size: 18 })
|
|
816
821
|
}
|
|
817
822
|
),
|
|
818
823
|
B(),
|
|
@@ -829,7 +834,7 @@ function ol({
|
|
|
829
834
|
}
|
|
830
835
|
function vl({
|
|
831
836
|
type: n,
|
|
832
|
-
message:
|
|
837
|
+
message: e,
|
|
833
838
|
cancelText: u,
|
|
834
839
|
confirmText: o,
|
|
835
840
|
onConfirm: t,
|
|
@@ -865,7 +870,7 @@ function vl({
|
|
|
865
870
|
],
|
|
866
871
|
[s, a, t, d]
|
|
867
872
|
);
|
|
868
|
-
return /* @__PURE__ */
|
|
873
|
+
return /* @__PURE__ */ i(
|
|
869
874
|
ol,
|
|
870
875
|
{
|
|
871
876
|
...r,
|
|
@@ -874,37 +879,37 @@ function vl({
|
|
|
874
879
|
actions: c,
|
|
875
880
|
disableCloseOnOverlayClick: n === "confirm",
|
|
876
881
|
hideCloseButton: n === "confirm",
|
|
877
|
-
children: typeof
|
|
882
|
+
children: typeof e == "string" ? /* @__PURE__ */ i("p", { className: "text-sm", children: e }) : e
|
|
878
883
|
}
|
|
879
884
|
);
|
|
880
885
|
}
|
|
881
|
-
const
|
|
882
|
-
const n = A(
|
|
886
|
+
const il = l(null), sl = () => {
|
|
887
|
+
const n = A(il);
|
|
883
888
|
if (!n)
|
|
884
889
|
throw new Error("DropdownMenu components must be used within a DropdownMenu component");
|
|
885
890
|
return n;
|
|
886
|
-
},
|
|
887
|
-
const n = A(
|
|
891
|
+
}, el = l(null), cl = () => {
|
|
892
|
+
const n = A(el);
|
|
888
893
|
if (!n)
|
|
889
894
|
throw new Error("Tabs components must be used within a Tabs component");
|
|
890
895
|
return n;
|
|
891
896
|
}, T = {
|
|
892
897
|
info: {
|
|
893
898
|
className: "bg-blue-50 border-blue-200 text-blue-900 dark:bg-blue-800 dark:border-blue-950 dark:text-blue-100",
|
|
894
|
-
icon: /* @__PURE__ */
|
|
899
|
+
icon: /* @__PURE__ */ i(Z, { size: 20 })
|
|
895
900
|
},
|
|
896
901
|
warning: {
|
|
897
902
|
className: "bg-yellow-50 border-yellow-200 text-yellow-900 dark:bg-yellow-800 dark:border-yellow-950 dark:text-yellow-100",
|
|
898
|
-
icon: /* @__PURE__ */
|
|
903
|
+
icon: /* @__PURE__ */ i(P, { size: 20 })
|
|
899
904
|
},
|
|
900
905
|
error: {
|
|
901
906
|
className: "bg-red-50 border-red-200 text-red-900 dark:bg-red-800 dark:border-red-950 dark:text-red-100",
|
|
902
|
-
icon: /* @__PURE__ */
|
|
907
|
+
icon: /* @__PURE__ */ i(K, { size: 20 })
|
|
903
908
|
}
|
|
904
909
|
};
|
|
905
910
|
function fl({
|
|
906
911
|
id: n,
|
|
907
|
-
title:
|
|
912
|
+
title: e,
|
|
908
913
|
description: u,
|
|
909
914
|
type: o = "info",
|
|
910
915
|
action: t,
|
|
@@ -926,11 +931,11 @@ function fl({
|
|
|
926
931
|
return () => clearTimeout(w);
|
|
927
932
|
}
|
|
928
933
|
}, [d, n, a, f]), r)
|
|
929
|
-
return /* @__PURE__ */
|
|
934
|
+
return /* @__PURE__ */ i(
|
|
930
935
|
r,
|
|
931
936
|
{
|
|
932
937
|
id: n,
|
|
933
|
-
title:
|
|
938
|
+
title: e,
|
|
934
939
|
description: u,
|
|
935
940
|
type: o,
|
|
936
941
|
action: t,
|
|
@@ -944,18 +949,18 @@ function fl({
|
|
|
944
949
|
{
|
|
945
950
|
role: o === "error" ? "alert" : "status",
|
|
946
951
|
"aria-live": o === "error" ? void 0 : "polite",
|
|
947
|
-
className:
|
|
952
|
+
className: _(
|
|
948
953
|
"relative flex items-start p-4 rounded-lg border shadow-lg transition-all ease-in-out",
|
|
949
954
|
t && "pb-3",
|
|
950
955
|
m.className,
|
|
951
956
|
s ? "opacity-0 translate-x-full" : "opacity-100 translate-x-0"
|
|
952
957
|
),
|
|
953
958
|
children: [
|
|
954
|
-
/* @__PURE__ */
|
|
959
|
+
/* @__PURE__ */ i("div", { className: "flex-shrink-0 mr-3", children: m.icon }),
|
|
955
960
|
/* @__PURE__ */ b("div", { className: "flex-grow min-w-0", children: [
|
|
956
|
-
/* @__PURE__ */
|
|
957
|
-
u && /* @__PURE__ */
|
|
958
|
-
t && /* @__PURE__ */
|
|
961
|
+
/* @__PURE__ */ i("div", { className: "font-medium text-sm leading-5", children: e }),
|
|
962
|
+
u && /* @__PURE__ */ i("div", { className: "mt-1 text-sm opacity-90 leading-5", children: u }),
|
|
963
|
+
t && /* @__PURE__ */ i("div", { className: "mt-1.5", children: /* @__PURE__ */ i(
|
|
959
964
|
"button",
|
|
960
965
|
{
|
|
961
966
|
onClick: t.onClick,
|
|
@@ -964,12 +969,12 @@ function fl({
|
|
|
964
969
|
}
|
|
965
970
|
) })
|
|
966
971
|
] }),
|
|
967
|
-
/* @__PURE__ */
|
|
972
|
+
/* @__PURE__ */ i(
|
|
968
973
|
"button",
|
|
969
974
|
{
|
|
970
975
|
onClick: f,
|
|
971
976
|
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",
|
|
972
|
-
children: /* @__PURE__ */
|
|
977
|
+
children: /* @__PURE__ */ i(F, { size: 16 })
|
|
973
978
|
}
|
|
974
979
|
)
|
|
975
980
|
]
|
|
@@ -978,11 +983,11 @@ function fl({
|
|
|
978
983
|
}
|
|
979
984
|
export {
|
|
980
985
|
vl as A,
|
|
981
|
-
|
|
986
|
+
il as D,
|
|
982
987
|
fl as T,
|
|
983
988
|
cl as a,
|
|
984
|
-
|
|
989
|
+
el as b,
|
|
985
990
|
y as n,
|
|
986
991
|
sl as u
|
|
987
992
|
};
|
|
988
|
-
//# sourceMappingURL=Toast-
|
|
993
|
+
//# sourceMappingURL=Toast-Cqhy4i4q.js.map
|