@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.
@@ -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 M, useMemo as z, useContext as j } from "react";
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((r) => typeof r == "string" && r).join(" ").trim() || void 0;
7
+ return n.filter((u) => typeof u == "string" && u).join(" ").trim() || void 0;
8
8
  }
9
- function Y({ size: n = 15, color: r = "currentColor", className: u = "inline", ...e }) {
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: u,
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: r,
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((r) => typeof r == "string" && r).join(" ").trim() || void 0;
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, r] = x(0);
308
+ const [n, u] = x(0);
297
309
  return p(() => {
298
- const u = setInterval(() => {
299
- r((e) => (e + 1) % 3);
310
+ const r = setInterval(() => {
311
+ u((e) => (e + 1) % 3);
300
312
  }, 500);
301
- return () => clearInterval(u);
302
- }, []), /* @__PURE__ */ t("div", { className: "absolute inset-0 inline-flex items-center justify-center gap-x-2 align-middle", children: [0, 1, 2].map((u) => /* @__PURE__ */ t(
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 === u && "transform -translate-y-1"
319
+ n === r && "transform -translate-y-1"
308
320
  )
309
321
  },
310
- u
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: r,
343
- rounded: u = k.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" && !r ? a = "fitted" : a = r || k.size;
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[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, f) => {
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 v = m.props;
385
+ const f = m.props;
374
386
  return g.cloneElement(m, {
375
- key: f,
376
- className: y(e && "invisible", v.className)
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 [r, u] = x(!1), [e, o] = x(!1);
411
+ const [u, r] = x(!1), [e, o] = x(!1);
400
412
  return p(() => {
401
- n ? (o(!0), setTimeout(() => u(!0), 10)) : (u(!1), setTimeout(() => o(!1), 150));
402
- }, [n]), { show: r, shouldRender: e };
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, r) {
416
+ function ll(n, u) {
405
417
  p(() => {
406
- const u = (e) => {
407
- e.key === "Escape" && n && r();
418
+ const r = (e) => {
419
+ e.key === "Escape" && n && u();
408
420
  };
409
- return document.addEventListener("keydown", u), n && (document.body.style.overflow = "hidden"), () => {
410
- document.removeEventListener("keydown", u), document.body.style.overflow = "auto";
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, r]);
424
+ }, [n, u]);
413
425
  }
414
- function nl(n, r) {
415
- const u = Q(null), e = M(() => {
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(() => (r && (u.current = document.activeElement, e()), () => {
438
- document.body.style.overflow = "auto", u.current instanceof HTMLElement && u.current.focus();
439
- }), [r, e]);
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: r,
444
- onClose: u,
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: f = !1,
454
- ariaLabelledBy: v,
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: A, shouldRender: N } = R(r);
458
- if (nl(E, N), ll(N, u), !N) return null;
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": v ?? e ? L : void 0,
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
- f || u();
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
- A ? "opacity-100 scale-100" : "opacity-0 scale-90",
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: u,
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: r,
519
- cancelText: u,
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 = z(() => n === "confirm" ? {
539
+ const c = T(() => n === "confirm" ? {
528
540
  confirm: e || "Confirm",
529
- cancel: u || "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, u]), m = z(
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 r == "string" ? /* @__PURE__ */ t("p", { className: "text-sm", children: r }) : r
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 = j(tl);
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
- }, rl = l(null), ml = () => {
573
- const n = j(rl);
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
- }, T = {
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 fl({
603
+ function vl({
592
604
  id: n,
593
- title: r,
594
- description: u,
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), f = M(() => {
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
- f();
622
+ v();
611
623
  }, i);
612
624
  return () => clearTimeout(w);
613
625
  }
614
- }, [i, n, a, f]), d)
626
+ }, [i, n, a, v]), d)
615
627
  return /* @__PURE__ */ t(
616
628
  d,
617
629
  {
618
630
  id: n,
619
- title: r,
620
- description: u,
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 v = (s == null ? void 0 : s[e]) || T[e] || T.info;
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
- v.className,
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: v.icon }),
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: r }),
643
- u && /* @__PURE__ */ t("div", { className: "mt-1 text-sm opacity-90 leading-5", children: u }),
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: f,
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
- fl as T,
669
- rl as a,
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-DJVcqZ--.js.map
686
+ //# sourceMappingURL=Toast-DU6Oe330.js.map