@moondreamsdev/dreamer-ui 1.7.19-test.18 → 1.7.19-test.19

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.
@@ -1,13 +1,13 @@
1
- import { jsx as i, Fragment as q, jsxs as b } from "react/jsx-runtime";
1
+ import { jsx as o, Fragment as q, jsxs as b } from "react/jsx-runtime";
2
2
  import g, { createContext as l, useId as F, 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 Y, C as Z, E as K, I as P } from "./X-CIoyLewf.js";
5
- import { j as Q } from "./join-BmgR_f4v.js";
3
+ import { createPortal as Z } from "react-dom";
4
+ import { X as V, C as K, E as P, I as Q } from "./X-CIoyLewf.js";
5
+ import { j as X } from "./join-BmgR_f4v.js";
6
6
  function y(...n) {
7
- return n.filter((o) => typeof o == "string" && o).join(" ").trim() || void 0;
7
+ return n.filter((i) => typeof i == "string" && i).join(" ").trim() || void 0;
8
8
  }
9
- function X({ size: n = 15, color: o = "currentColor", className: u = "inline", ...e }) {
10
- return /* @__PURE__ */ i(
9
+ function Y({ size: n = 15, color: i = "currentColor", className: u = "inline", ...e }) {
10
+ return /* @__PURE__ */ o(
11
11
  "svg",
12
12
  {
13
13
  ...e,
@@ -16,11 +16,11 @@ function X({ size: n = 15, color: o = "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__ */ i(
19
+ children: /* @__PURE__ */ o(
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: o,
23
+ fill: i,
24
24
  fillRule: "evenodd",
25
25
  clipRule: "evenodd"
26
26
  }
@@ -29,7 +29,7 @@ function X({ size: n = 15, color: o = "currentColor", className: u = "inline", .
29
29
  );
30
30
  }
31
31
  function h(...n) {
32
- return n.filter((o) => typeof o == "string" && o).join(" ").trim() || void 0;
32
+ return n.filter((i) => typeof i == "string" && i).join(" ").trim() || void 0;
33
33
  }
34
34
  l(void 0);
35
35
  l(null);
@@ -476,14 +476,19 @@ l(null);
476
476
  l(void 0);
477
477
  l(void 0);
478
478
  l(void 0);
479
+ l(null);
480
+ l(null);
481
+ l(void 0);
482
+ l(void 0);
483
+ l(void 0);
479
484
  function _() {
480
- const [n, o] = x(0);
485
+ const [n, i] = x(0);
481
486
  return p(() => {
482
487
  const u = setInterval(() => {
483
- o((e) => (e + 1) % 3);
488
+ i((e) => (e + 1) % 3);
484
489
  }, 500);
485
490
  return () => clearInterval(u);
486
- }, []), /* @__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(
491
+ }, []), /* @__PURE__ */ o("div", { className: "absolute inset-0 inline-flex items-center justify-center gap-x-2 align-middle", children: [0, 1, 2].map((u) => /* @__PURE__ */ o(
487
492
  "div",
488
493
  {
489
494
  className: y(
@@ -496,12 +501,12 @@ function _() {
496
501
  }
497
502
  const G = {
498
503
  base: "",
499
- primary: "bg-primary text-primary-foreground hover:bg-primary/80 outline-primary outline-offset-2 disabled:bg-muted disabled:text-muted-foreground",
500
- secondary: "bg-secondary text-secondary-foreground hover:bg-secondary/80 outline-secondary outline-offset-2 disabled:bg-muted/80 disabled:text-muted-foreground/80",
501
- tertiary: "text-primary hover:text-primary/80 disabled:text-muted-foreground outline-primary",
502
- outline: "border border-primary text-primary hover:border-primary/80 hover:text-primary/80 outline-primary outline-offset-2 disabled:border-muted-foreground disabled:text-muted-foreground",
503
- link: "underline-offset-4 hover:underline disabled:underline disabled:text-muted-foreground",
504
- destructive: "bg-destructive text-destructive-foreground hover:bg-destructive/80 outline-destructive outline-offset-2 disabled:bg-muted disabled:text-muted-foreground"
504
+ primary: "bg-primary text-primary-foreground hover:bg-primary/80 focus:outline-primary outline-offset-2 disabled:bg-muted disabled:text-muted-foreground",
505
+ secondary: "bg-secondary text-secondary-foreground hover:bg-secondary/80 focus:outline-secondary outline-offset-2 disabled:bg-muted/80 disabled:text-muted-foreground/80",
506
+ tertiary: "text-primary hover:text-primary/80 disabled:text-muted-foreground focus:outline-primary",
507
+ outline: "border border-primary text-primary hover:border-primary/80 hover:text-primary/80 focus:outline-primary outline-offset-2 disabled:border-muted-foreground disabled:text-muted-foreground",
508
+ link: "underline-offset-4 hover:underline disabled:underline disabled:text-muted-foreground focus:outline-current",
509
+ destructive: "bg-destructive text-destructive-foreground hover:bg-destructive/80 focus:outline-destructive outline-offset-2 disabled:bg-muted disabled:text-muted-foreground"
505
510
  }, J = {
506
511
  stripped: "",
507
512
  fitted: "size-fit leading-0",
@@ -523,16 +528,16 @@ const G = {
523
528
  };
524
529
  function W({
525
530
  variant: n = k.variant,
526
- size: o,
531
+ size: i,
527
532
  rounded: u = k.rounded,
528
533
  loading: e,
529
534
  className: t,
530
535
  ...d
531
536
  }) {
532
537
  let a;
533
- n === "link" && !o ? a = "fitted" : a = o || k.size;
538
+ n === "link" && !i ? a = "fitted" : a = i || k.size;
534
539
  const s = y(
535
- "appearance-none not-disabled:hover:cursor-pointer disabled:opacity-50 disabled:cursor-not-allowed transition-all",
540
+ "appearance-none not-disabled:hover:cursor-pointer outline outline-transparent disabled:opacity-50 disabled:cursor-not-allowed transition-all",
536
541
  G[n],
537
542
  J[a],
538
543
  U[u],
@@ -540,7 +545,7 @@ function W({
540
545
  t
541
546
  );
542
547
  if (d.href && !d.disabled)
543
- return /* @__PURE__ */ i(
548
+ return /* @__PURE__ */ o(
544
549
  "a",
545
550
  {
546
551
  ...d,
@@ -552,12 +557,12 @@ function W({
552
557
  children: d.children
553
558
  }
554
559
  );
555
- const r = d, v = () => r.children ? typeof r.children == "string" || typeof r.children == "number" || typeof r.children == "boolean" ? /* @__PURE__ */ i("span", { className: y(e && "invisible"), children: r.children }) : g.Children.map(r.children, (c, m) => {
560
+ const r = d, v = () => r.children ? typeof r.children == "string" || typeof r.children == "number" || typeof r.children == "boolean" ? /* @__PURE__ */ o("span", { className: y(e && "invisible"), children: r.children }) : g.Children.map(r.children, (c, f) => {
556
561
  if (g.isValidElement(c)) {
557
- const f = c.props;
562
+ const m = c.props;
558
563
  return g.cloneElement(c, {
559
- key: m,
560
- className: y(e && "invisible", f.className)
564
+ key: f,
565
+ className: y(e && "invisible", m.className)
561
566
  });
562
567
  }
563
568
  return c;
@@ -573,29 +578,29 @@ function W({
573
578
  type: r.type ?? "button",
574
579
  className: s,
575
580
  children: [
576
- e && /* @__PURE__ */ i(_, {}),
581
+ e && /* @__PURE__ */ o(_, {}),
577
582
  v()
578
583
  ]
579
584
  }
580
585
  );
581
586
  }
582
587
  function R(n) {
583
- const [o, u] = x(!1), [e, t] = x(!1);
588
+ const [i, u] = x(!1), [e, t] = x(!1);
584
589
  return p(() => {
585
590
  n ? (t(!0), setTimeout(() => u(!0), 10)) : (u(!1), setTimeout(() => t(!1), 150));
586
- }, [n]), { show: o, shouldRender: e };
591
+ }, [n]), { show: i, shouldRender: e };
587
592
  }
588
- function ll(n, o) {
593
+ function ll(n, i) {
589
594
  p(() => {
590
595
  const u = (e) => {
591
- e.key === "Escape" && n && o();
596
+ e.key === "Escape" && n && i();
592
597
  };
593
598
  return document.addEventListener("keydown", u), n && (document.body.style.overflow = "hidden"), () => {
594
599
  document.removeEventListener("keydown", u), document.body.style.overflow = "auto";
595
600
  };
596
- }, [n, o]);
601
+ }, [n, i]);
597
602
  }
598
- function nl(n, o) {
603
+ function nl(n, i) {
599
604
  const u = H(null), e = j(() => {
600
605
  const t = document.getElementById(n);
601
606
  if (!t) return;
@@ -618,13 +623,13 @@ function nl(n, o) {
618
623
  }
619
624
  t.focus();
620
625
  }, [n]);
621
- p(() => (o && (u.current = document.activeElement, e()), () => {
626
+ p(() => (i && (u.current = document.activeElement, e()), () => {
622
627
  document.body.style.overflow = "auto", u.current instanceof HTMLElement && u.current.focus();
623
- }), [o, e]);
628
+ }), [i, e]);
624
629
  }
625
630
  function el({
626
631
  id: n,
627
- isOpen: o,
632
+ isOpen: i,
628
633
  onClose: u,
629
634
  title: e,
630
635
  children: t,
@@ -634,36 +639,36 @@ function el({
634
639
  containerClassName: r,
635
640
  hideCloseButton: v = !1,
636
641
  actions: c = [],
637
- disableCloseOnOverlayClick: m = !1,
638
- ariaLabelledBy: f,
642
+ disableCloseOnOverlayClick: f = !1,
643
+ ariaLabelledBy: m,
639
644
  ariaDescribedBy: w
640
645
  }) {
641
- const C = F(), E = n || `modal-${C}`, L = n ? `${n}-title` : `modal-title-${C}`, { show: M, shouldRender: N } = R(o);
646
+ const C = F(), E = n || `modal-${C}`, L = n ? `${n}-title` : `modal-title-${C}`, { show: M, shouldRender: N } = R(i);
642
647
  if (nl(E, N), ll(N, u), !N) return null;
643
- const I = () => e ? g.isValidElement(e) ? /* @__PURE__ */ i("div", { className: "mb-4", children: e }) : /* @__PURE__ */ i("h2", { className: "mb-4 text-xl font-semibold", id: L, children: e }) : null, B = () => 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) => {
648
+ const I = () => e ? g.isValidElement(e) ? /* @__PURE__ */ o("div", { className: "mb-4", children: e }) : /* @__PURE__ */ o("h2", { className: "mb-4 text-xl font-semibold", id: L, children: e }) : null, B = () => c.length === 0 ? null : /* @__PURE__ */ o("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) => {
644
649
  const { label: S, ...$ } = D;
645
- return /* @__PURE__ */ i(W, { ...$, "data-modal-action": "true", children: S }, O);
650
+ return /* @__PURE__ */ o(W, { ...$, "data-modal-action": "true", children: S }, O);
646
651
  }) });
647
- return /* @__PURE__ */ i(q, { children: V(
648
- /* @__PURE__ */ i(
652
+ return /* @__PURE__ */ o(q, { children: Z(
653
+ /* @__PURE__ */ o(
649
654
  "div",
650
655
  {
651
- "aria-labelledby": f ?? e ? L : void 0,
656
+ "aria-labelledby": m ?? e ? L : void 0,
652
657
  "aria-describedby": w,
653
658
  role: "dialog",
654
659
  "aria-modal": "true",
655
660
  className: "fixed inset-0 z-[100] overflow-y-auto",
656
661
  children: /* @__PURE__ */ b("div", { className: h("flex min-h-screen items-center justify-center p-4", r), children: [
657
- /* @__PURE__ */ i(
662
+ /* @__PURE__ */ o(
658
663
  "div",
659
664
  {
660
665
  className: h("fixed inset-0 bg-black/20 transition-all", s),
661
666
  onClick: () => {
662
- m || u();
667
+ f || u();
663
668
  }
664
669
  }
665
670
  ),
666
- d && /* @__PURE__ */ i("div", { className: h("relative w-fit", a), children: t }),
671
+ d && /* @__PURE__ */ o("div", { className: h("relative w-fit", a), children: t }),
667
672
  !d && /* @__PURE__ */ b(
668
673
  "div",
669
674
  {
@@ -675,14 +680,14 @@ function el({
675
680
  a
676
681
  ),
677
682
  children: [
678
- !v && /* @__PURE__ */ i(
683
+ !v && /* @__PURE__ */ o(
679
684
  "button",
680
685
  {
681
686
  type: "button",
682
687
  onClick: u,
683
688
  "data-modal-close-button": "true",
684
689
  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",
685
- children: /* @__PURE__ */ i(X, { size: 18 })
690
+ children: /* @__PURE__ */ o(Y, { size: 18 })
686
691
  }
687
692
  ),
688
693
  I(),
@@ -699,7 +704,7 @@ function el({
699
704
  }
700
705
  function sl({
701
706
  type: n,
702
- message: o,
707
+ message: i,
703
708
  cancelText: u,
704
709
  confirmText: e,
705
710
  onConfirm: t,
@@ -735,7 +740,7 @@ function sl({
735
740
  ],
736
741
  [v, a, t, d]
737
742
  );
738
- return /* @__PURE__ */ i(
743
+ return /* @__PURE__ */ o(
739
744
  el,
740
745
  {
741
746
  ...r,
@@ -744,37 +749,37 @@ function sl({
744
749
  actions: c,
745
750
  disableCloseOnOverlayClick: n === "confirm",
746
751
  hideCloseButton: n === "confirm",
747
- children: typeof o == "string" ? /* @__PURE__ */ i("p", { className: "text-sm", children: o }) : o
752
+ children: typeof i == "string" ? /* @__PURE__ */ o("p", { className: "text-sm", children: i }) : i
748
753
  }
749
754
  );
750
755
  }
751
- const il = l(null), vl = () => {
752
- const n = A(il);
756
+ const ol = l(null), vl = () => {
757
+ const n = A(ol);
753
758
  if (!n)
754
759
  throw new Error("DropdownMenu components must be used within a DropdownMenu component");
755
760
  return n;
756
- }, ol = l(null), cl = () => {
757
- const n = A(ol);
761
+ }, il = l(null), cl = () => {
762
+ const n = A(il);
758
763
  if (!n)
759
764
  throw new Error("Tabs components must be used within a Tabs component");
760
765
  return n;
761
766
  }, T = {
762
767
  info: {
763
768
  className: "bg-blue-50 border-blue-200 text-blue-900 dark:bg-blue-800 dark:border-blue-950 dark:text-blue-100",
764
- icon: /* @__PURE__ */ i(P, { size: 20 })
769
+ icon: /* @__PURE__ */ o(Q, { size: 20 })
765
770
  },
766
771
  warning: {
767
772
  className: "bg-yellow-50 border-yellow-200 text-yellow-900 dark:bg-yellow-800 dark:border-yellow-950 dark:text-yellow-100",
768
- icon: /* @__PURE__ */ i(K, { size: 20 })
773
+ icon: /* @__PURE__ */ o(P, { size: 20 })
769
774
  },
770
775
  error: {
771
776
  className: "bg-red-50 border-red-200 text-red-900 dark:bg-red-800 dark:border-red-950 dark:text-red-100",
772
- icon: /* @__PURE__ */ i(Z, { size: 20 })
777
+ icon: /* @__PURE__ */ o(K, { size: 20 })
773
778
  }
774
779
  };
775
- function ml({
780
+ function fl({
776
781
  id: n,
777
- title: o,
782
+ title: i,
778
783
  description: u,
779
784
  type: e = "info",
780
785
  action: t,
@@ -783,7 +788,7 @@ function ml({
783
788
  customTypes: s,
784
789
  customComponent: r
785
790
  }) {
786
- const [v, c] = x(!1), m = j(() => {
791
+ const [v, c] = x(!1), f = j(() => {
787
792
  c(!0), setTimeout(() => {
788
793
  a == null || a(n);
789
794
  }, 150);
@@ -791,16 +796,16 @@ function ml({
791
796
  if (p(() => {
792
797
  if (d > 0) {
793
798
  const w = setTimeout(() => {
794
- m();
799
+ f();
795
800
  }, d);
796
801
  return () => clearTimeout(w);
797
802
  }
798
- }, [d, n, a, m]), r)
799
- return /* @__PURE__ */ i(
803
+ }, [d, n, a, f]), r)
804
+ return /* @__PURE__ */ o(
800
805
  r,
801
806
  {
802
807
  id: n,
803
- title: o,
808
+ title: i,
804
809
  description: u,
805
810
  type: e,
806
811
  action: t,
@@ -808,24 +813,24 @@ function ml({
808
813
  onRemove: a
809
814
  }
810
815
  );
811
- const f = (s == null ? void 0 : s[e]) || T[e] || T.info;
816
+ const m = (s == null ? void 0 : s[e]) || T[e] || T.info;
812
817
  return /* @__PURE__ */ b(
813
818
  "div",
814
819
  {
815
820
  role: e === "error" ? "alert" : "status",
816
821
  "aria-live": e === "error" ? void 0 : "polite",
817
- className: Q(
822
+ className: X(
818
823
  "relative flex items-start p-4 rounded-lg border shadow-lg transition-all ease-in-out",
819
824
  t && "pb-3",
820
- f.className,
825
+ m.className,
821
826
  v ? "opacity-0 translate-x-full" : "opacity-100 translate-x-0"
822
827
  ),
823
828
  children: [
824
- /* @__PURE__ */ i("div", { className: "flex-shrink-0 mr-3", children: f.icon }),
829
+ /* @__PURE__ */ o("div", { className: "flex-shrink-0 mr-3", children: m.icon }),
825
830
  /* @__PURE__ */ b("div", { className: "flex-grow min-w-0", children: [
826
- /* @__PURE__ */ i("div", { className: "font-medium text-sm leading-5", children: o }),
827
- u && /* @__PURE__ */ i("div", { className: "mt-1 text-sm opacity-90 leading-5", children: u }),
828
- t && /* @__PURE__ */ i("div", { className: "mt-1.5", children: /* @__PURE__ */ i(
831
+ /* @__PURE__ */ o("div", { className: "font-medium text-sm leading-5", children: i }),
832
+ u && /* @__PURE__ */ o("div", { className: "mt-1 text-sm opacity-90 leading-5", children: u }),
833
+ t && /* @__PURE__ */ o("div", { className: "mt-1.5", children: /* @__PURE__ */ o(
829
834
  "button",
830
835
  {
831
836
  onClick: t.onClick,
@@ -834,12 +839,12 @@ function ml({
834
839
  }
835
840
  ) })
836
841
  ] }),
837
- /* @__PURE__ */ i(
842
+ /* @__PURE__ */ o(
838
843
  "button",
839
844
  {
840
- onClick: m,
845
+ onClick: f,
841
846
  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",
842
- children: /* @__PURE__ */ i(Y, { size: 16 })
847
+ children: /* @__PURE__ */ o(V, { size: 16 })
843
848
  }
844
849
  )
845
850
  ]
@@ -848,11 +853,11 @@ function ml({
848
853
  }
849
854
  export {
850
855
  sl as A,
851
- il as D,
852
- ml as T,
856
+ ol as D,
857
+ fl as T,
853
858
  cl as a,
854
- ol as b,
859
+ il as b,
855
860
  y as n,
856
861
  vl as u
857
862
  };
858
- //# sourceMappingURL=Toast-Bvx_q5ey.js.map
863
+ //# sourceMappingURL=Toast-B5-TSrGE.js.map