@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.
@@ -1,12 +1,12 @@
1
- import { jsx as t, Fragment as q, jsxs as v } from "react/jsx-runtime";
2
- import g, { createContext as l, useId as $, useState as x, useEffect as p, useRef as H, useCallback as T, useMemo as L, useContext as j } from "react";
3
- import { createPortal as K } from "react-dom";
4
- import { X as P, C as V, E as _, I as F } from "./X-CIoyLewf.js";
5
- import { j as X } from "./join-BmgR_f4v.js";
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 Z({ size: e = 15, color: r = "currentColor", className: u = "inline", ...n }) {
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 N(...e) {
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
- function G() {
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 J = {
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
- }, Q = {
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
- }, U = {
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 W({
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
- J[e],
297
- Q[d],
298
- U[u],
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(G, {}),
344
+ n && /* @__PURE__ */ t(J, {}),
337
345
  c()
338
346
  ]
339
347
  }
340
348
  );
341
349
  }
342
- function Y(e) {
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 R(e, r) {
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 ll(e, r) {
359
- const u = H(null), n = T(() => {
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 el({
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
- hideCloseButton: a = !1,
395
- actions: c = [],
396
- disableCloseOnOverlayClick: m = !1,
397
- ariaLabelledBy: f,
398
- ariaDescribedBy: b
402
+ containerClassName: a,
403
+ hideCloseButton: c = !1,
404
+ actions: m = [],
405
+ disableCloseOnOverlayClick: f = !1,
406
+ ariaLabelledBy: b,
407
+ ariaDescribedBy: w
399
408
  }) {
400
- const h = $(), C = e || `modal-${h}`, E = e ? `${e}-title` : `modal-title-${h}`, { show: A, shouldRender: w } = Y(r);
401
- if (ll(C, w), R(w, u), !w) return null;
402
- const M = () => n ? g.isValidElement(n) ? /* @__PURE__ */ t("div", { className: "mb-4", children: n }) : /* @__PURE__ */ t("h2", { className: "mb-4 text-xl font-semibold", id: E, children: n }) : null, I = () => c.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: c.map((B, D) => {
403
- const { label: O, ...S } = B;
404
- return /* @__PURE__ */ t(W, { ...S, "data-modal-action": "true", children: O }, D);
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(q, { children: K(
415
+ return /* @__PURE__ */ t(H, { children: P(
407
416
  /* @__PURE__ */ t(
408
417
  "div",
409
418
  {
410
- "aria-labelledby": f ?? n ? E : void 0,
411
- "aria-describedby": b,
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: N("fixed inset-0 bg-black/20 transition-all", s),
428
+ className: h("fixed inset-0 bg-black/20 transition-all", s),
420
429
  onClick: () => {
421
- m || u();
430
+ f || u();
422
431
  }
423
432
  }
424
433
  ),
425
- i && /* @__PURE__ */ t("div", { className: N("relative w-fit", d), children: o }),
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: C,
438
+ id: E,
430
439
  tabIndex: -1,
431
- className: N(
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
- !a && /* @__PURE__ */ t(
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(Z, { size: 18 })
453
+ children: /* @__PURE__ */ t(G, { size: 18 })
445
454
  }
446
455
  ),
447
- M(),
456
+ I(),
448
457
  o,
449
- I()
458
+ B()
450
459
  ]
451
460
  }
452
461
  )
@@ -456,7 +465,7 @@ function el({
456
465
  document.body
457
466
  ) });
458
467
  }
459
- function dl({
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 = L(() => e === "confirm" ? {
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 = L(
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
- el,
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 nl = l(null), sl = () => {
511
- const e = j(nl);
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
- }, tl = l(null), cl = () => {
516
- const e = j(tl);
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
- }, z = {
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(F, { size: 20 })
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(_, { size: 20 })
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(V, { size: 20 })
540
+ icon: /* @__PURE__ */ t(_, { size: 20 })
532
541
  }
533
542
  };
534
- function ml({
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 = T(() => {
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 h = setTimeout(() => {
561
+ const w = setTimeout(() => {
553
562
  f();
554
563
  }, i);
555
- return () => clearTimeout(h);
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]) || z[n] || z.info;
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: X(
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(P, { size: 16 })
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
- dl as A,
610
- nl as D,
611
- ml as T,
612
- tl as a,
613
- cl as b,
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
- sl as u
624
+ cl as u
616
625
  };
617
- //# sourceMappingURL=Toast-CZP-yFBM.js.map
626
+ //# sourceMappingURL=Toast-BzvqSVjP.js.map