@moondreamsdev/dreamer-ui 1.7.10-test.104 → 1.7.10-test.105

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,18 +1,18 @@
1
1
  import { jsx as t, Fragment as S, jsxs as b } from "react/jsx-runtime";
2
- import F, { createContext as e, useId as q, useState as v, useEffect as p, useRef as H, useCallback as L, useMemo as E, useContext as T } from "react";
2
+ import F, { createContext as l, useId as q, useState as v, useEffect as p, useRef as H, useCallback as L, useMemo as E, useContext as T } from "react";
3
3
  import { createPortal as P } from "react-dom";
4
4
  import { X as $, C as K, E as V, I as X } from "./X-CIoyLewf.js";
5
5
  import { j as Z } from "./join-BmgR_f4v.js";
6
- function N(...l) {
7
- return l.filter((r) => typeof r == "string" && r).join(" ").trim() || void 0;
6
+ function N(...e) {
7
+ return e.filter((r) => typeof r == "string" && r).join(" ").trim() || void 0;
8
8
  }
9
- function _({ size: l = 15, color: r = "currentColor", className: o = "inline", ...n }) {
9
+ function _({ size: e = 15, color: r = "currentColor", className: o = "inline", ...n }) {
10
10
  return /* @__PURE__ */ t(
11
11
  "svg",
12
12
  {
13
13
  ...n,
14
- width: l,
15
- height: l,
14
+ width: e,
15
+ height: e,
16
16
  className: o,
17
17
  viewBox: "0 0 15 15",
18
18
  xmlns: "http://www.w3.org/2000/svg",
@@ -28,124 +28,126 @@ function _({ size: l = 15, color: r = "currentColor", className: o = "inline", .
28
28
  }
29
29
  );
30
30
  }
31
- function y(...l) {
32
- return l.filter((r) => typeof r == "string" && r).join(" ").trim() || void 0;
31
+ function y(...e) {
32
+ return e.filter((r) => typeof r == "string" && r).join(" ").trim() || void 0;
33
33
  }
34
- e(void 0);
35
- e(null);
36
- e(null);
37
- e(null);
38
- e(null);
39
- e(null);
40
- e(null);
41
- e(null);
42
- e(null);
43
- e(null);
44
- e(null);
45
- e(null);
46
- e(null);
47
- e(null);
48
- e(null);
49
- e(null);
50
- e(void 0);
51
- e(void 0);
52
- e(null);
53
- e(void 0);
54
- e(void 0);
55
- e(null);
56
- e(null);
57
- e(null);
58
- e(null);
59
- e(null);
60
- e(null);
61
- e(null);
62
- e(null);
63
- e(null);
64
- e(null);
65
- e(null);
66
- e(null);
67
- e(null);
68
- e(null);
69
- e(null);
70
- e(null);
71
- e(null);
72
- e(null);
73
- e(null);
74
- e(null);
75
- e(null);
76
- e(null);
77
- e(null);
78
- e(null);
79
- e(null);
80
- e(null);
81
- e(null);
82
- e(null);
83
- e(null);
84
- e(null);
85
- e(null);
86
- e(null);
87
- e(null);
88
- e(null);
89
- e(null);
90
- e(null);
91
- e(null);
92
- e(null);
93
- e(null);
94
- e(null);
95
- e(null);
96
- e(null);
97
- e(null);
98
- e(null);
99
- e(null);
100
- e(null);
101
- e(null);
102
- e(null);
103
- e(null);
104
- e(null);
105
- e(null);
106
- e(null);
107
- e(null);
108
- e(null);
109
- e(null);
110
- e(null);
111
- e(null);
112
- e(null);
113
- e(null);
114
- e(null);
115
- e(null);
116
- e(null);
117
- e(null);
118
- e(null);
119
- e(null);
120
- e(null);
121
- e(null);
122
- e(null);
123
- e(null);
124
- e(null);
125
- e(null);
126
- e(null);
127
- e(null);
128
- e(null);
129
- e(null);
130
- e(null);
131
- e(null);
132
- e(null);
133
- e(null);
134
- e(null);
135
- e(null);
136
- e(null);
137
- e(null);
138
- e(null);
139
- e(null);
140
- e(null);
141
- e(null);
142
- e(null);
143
- e(null);
144
- e(null);
145
- e(null);
146
- e(null);
34
+ l(void 0);
35
+ l(null);
36
+ l(null);
37
+ l(null);
38
+ l(null);
39
+ l(null);
40
+ l(null);
41
+ l(null);
42
+ l(null);
43
+ l(null);
44
+ l(null);
45
+ l(null);
46
+ l(null);
47
+ l(null);
48
+ l(null);
49
+ l(null);
50
+ l(void 0);
51
+ l(void 0);
52
+ l(null);
53
+ l(void 0);
54
+ l(void 0);
55
+ l(null);
56
+ l(null);
57
+ l(null);
58
+ l(null);
59
+ l(null);
60
+ l(null);
61
+ l(null);
62
+ l(null);
63
+ l(null);
64
+ l(null);
65
+ l(null);
66
+ l(null);
67
+ l(null);
68
+ l(null);
69
+ l(null);
70
+ l(null);
71
+ l(null);
72
+ l(null);
73
+ l(null);
74
+ l(null);
75
+ l(null);
76
+ l(null);
77
+ l(null);
78
+ l(null);
79
+ l(null);
80
+ l(null);
81
+ l(null);
82
+ l(null);
83
+ l(null);
84
+ l(null);
85
+ l(null);
86
+ l(null);
87
+ l(null);
88
+ l(null);
89
+ l(null);
90
+ l(null);
91
+ l(null);
92
+ l(null);
93
+ l(null);
94
+ l(null);
95
+ l(null);
96
+ l(null);
97
+ l(null);
98
+ l(null);
99
+ l(null);
100
+ l(null);
101
+ l(null);
102
+ l(null);
103
+ l(null);
104
+ l(null);
105
+ l(null);
106
+ l(null);
107
+ l(null);
108
+ l(null);
109
+ l(null);
110
+ l(null);
111
+ l(null);
112
+ l(null);
113
+ l(null);
114
+ l(null);
115
+ l(null);
116
+ l(null);
117
+ l(null);
118
+ l(null);
119
+ l(null);
120
+ l(null);
121
+ l(null);
122
+ l(null);
123
+ l(null);
124
+ l(null);
125
+ l(null);
126
+ l(null);
127
+ l(null);
128
+ l(null);
129
+ l(null);
130
+ l(null);
131
+ l(null);
132
+ l(null);
133
+ l(null);
134
+ l(null);
135
+ l(null);
136
+ l(null);
137
+ l(null);
138
+ l(null);
139
+ l(null);
140
+ l(null);
141
+ l(null);
142
+ l(null);
143
+ l(null);
144
+ l(null);
145
+ l(null);
146
+ l(null);
147
+ l(null);
148
+ l(null);
147
149
  function G() {
148
- const [l, r] = v(0);
150
+ const [e, r] = v(0);
149
151
  return p(() => {
150
152
  const o = setInterval(() => {
151
153
  r((n) => (n + 1) % 3);
@@ -156,7 +158,7 @@ function G() {
156
158
  {
157
159
  className: N(
158
160
  "rounded-full transition-all duration-500 ease-in-out size-[0.35em] bg-current",
159
- l === o && "transform -translate-y-1"
161
+ e === o && "transform -translate-y-1"
160
162
  )
161
163
  },
162
164
  o
@@ -190,22 +192,22 @@ const J = {
190
192
  rounded: "md"
191
193
  };
192
194
  function W({
193
- variant: l = w.variant,
195
+ variant: e = w.variant,
194
196
  size: r,
195
197
  rounded: o = w.rounded,
196
198
  loading: n,
197
- className: i,
199
+ className: u,
198
200
  ...a
199
201
  }) {
200
- let u;
201
- l === "link" && !r ? u = "fitted" : u = r || w.size;
202
+ let i;
203
+ e === "link" && !r ? i = "fitted" : i = r || w.size;
202
204
  const s = N(
203
205
  "appearance-none focus:outline-none focus:ring not-disabled:hover:cursor-pointer disabled:opacity-50 disabled:cursor-not-allowed transition-all",
204
- J[l],
205
- Q[u],
206
+ J[e],
207
+ Q[i],
206
208
  U[o],
207
209
  n && "relative pointer-events-none",
208
- i
210
+ u
209
211
  );
210
212
  if (a.href && !a.disabled)
211
213
  return /* @__PURE__ */ t(
@@ -238,57 +240,57 @@ function W({
238
240
  }
239
241
  );
240
242
  }
241
- function Y(l) {
242
- const [r, o] = v(!1), [n, i] = v(!1);
243
+ function Y(e) {
244
+ const [r, o] = v(!1), [n, u] = v(!1);
243
245
  return p(() => {
244
- l ? (i(!0), setTimeout(() => o(!0), 10)) : (o(!1), setTimeout(() => i(!1), 150));
245
- }, [l]), { show: r, shouldRender: n };
246
+ e ? (u(!0), setTimeout(() => o(!0), 10)) : (o(!1), setTimeout(() => u(!1), 150));
247
+ }, [e]), { show: r, shouldRender: n };
246
248
  }
247
- function R(l, r) {
249
+ function R(e, r) {
248
250
  p(() => {
249
251
  const o = (n) => {
250
- n.key === "Escape" && l && r();
252
+ n.key === "Escape" && e && r();
251
253
  };
252
- return document.addEventListener("keydown", o), l && (document.body.style.overflow = "hidden"), () => {
254
+ return document.addEventListener("keydown", o), e && (document.body.style.overflow = "hidden"), () => {
253
255
  document.removeEventListener("keydown", o), document.body.style.overflow = "auto";
254
256
  };
255
- }, [l, r]);
257
+ }, [e, r]);
256
258
  }
257
- function ee(l, r) {
259
+ function ll(e, r) {
258
260
  const o = H(null), n = L(() => {
259
- const i = document.getElementById(l);
260
- if (!i) return;
261
- const a = i.querySelectorAll('[data-modal-action="true"]');
261
+ const u = document.getElementById(e);
262
+ if (!u) return;
263
+ const a = u.querySelectorAll('[data-modal-action="true"]');
262
264
  if (a.length > 0) {
263
265
  a[0].focus();
264
266
  return;
265
267
  }
266
- const u = i.querySelectorAll(
268
+ const i = u.querySelectorAll(
267
269
  'button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])'
268
270
  );
269
- if (u.length > 0) {
270
- const s = Array.from(u).filter((d) => !(d instanceof HTMLButtonElement && d.getAttribute("data-modal-close-button") === "true"));
271
+ if (i.length > 0) {
272
+ const s = Array.from(i).filter((d) => !(d instanceof HTMLButtonElement && d.getAttribute("data-modal-close-button") === "true"));
271
273
  if (s.length > 0) {
272
274
  s[0].focus();
273
275
  return;
274
276
  }
275
- u[0].focus();
277
+ i[0].focus();
276
278
  return;
277
279
  }
278
- i.focus();
279
- }, [l]);
280
+ u.focus();
281
+ }, [e]);
280
282
  p(() => (r && (o.current = document.activeElement, n()), () => {
281
283
  document.body.style.overflow = "auto", o.current instanceof HTMLElement && o.current.focus();
282
284
  }), [r, n]);
283
285
  }
284
- function le({
285
- id: l,
286
+ function el({
287
+ id: e,
286
288
  isOpen: r,
287
289
  onClose: o,
288
290
  title: n,
289
- children: i,
291
+ children: u,
290
292
  contentOnly: a = !1,
291
- className: u,
293
+ className: i,
292
294
  overlayClassName: s,
293
295
  hideCloseButton: d = !1,
294
296
  actions: c = [],
@@ -296,8 +298,8 @@ function le({
296
298
  ariaLabelledBy: f,
297
299
  ariaDescribedBy: g
298
300
  }) {
299
- const h = q(), k = l || `modal-${h}`, C = l ? `${l}-title` : `modal-title-${h}`, { show: A, shouldRender: x } = Y(r);
300
- if (ee(k, x), R(x, o), !x) return null;
301
+ const h = q(), k = e || `modal-${h}`, C = e ? `${e}-title` : `modal-title-${h}`, { show: A, shouldRender: x } = Y(r);
302
+ if (ll(k, x), R(x, o), !x) return null;
301
303
  const j = () => n ? F.isValidElement(n) ? /* @__PURE__ */ t("div", { className: "mb-4", children: n }) : /* @__PURE__ */ t("h2", { className: "mb-4 text-xl font-semibold", id: C, children: n }) : null, M = () => 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((D, I) => {
302
304
  const { label: B, ...O } = D;
303
305
  return /* @__PURE__ */ t(W, { ...O, "data-modal-action": "true", children: B }, I);
@@ -321,7 +323,7 @@ function le({
321
323
  }
322
324
  }
323
325
  ),
324
- a && /* @__PURE__ */ t("div", { className: y("relative w-fit", u), children: i }),
326
+ a && /* @__PURE__ */ t("div", { className: y("relative w-fit", i), children: u }),
325
327
  !a && /* @__PURE__ */ b(
326
328
  "div",
327
329
  {
@@ -330,7 +332,7 @@ function le({
330
332
  className: y(
331
333
  "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",
332
334
  A ? "opacity-100 scale-100" : "opacity-0 scale-90",
333
- u
335
+ i
334
336
  ),
335
337
  children: [
336
338
  !d && /* @__PURE__ */ t(
@@ -344,7 +346,7 @@ function le({
344
346
  }
345
347
  ),
346
348
  j(),
347
- i,
349
+ u,
348
350
  M()
349
351
  ]
350
352
  }
@@ -355,18 +357,18 @@ function le({
355
357
  document.body
356
358
  ) });
357
359
  }
358
- function se({
359
- type: l,
360
+ function sl({
361
+ type: e,
360
362
  message: r,
361
363
  cancelText: o,
362
364
  confirmText: n,
363
- onConfirm: i,
365
+ onConfirm: u,
364
366
  onClose: a,
365
- destructive: u = !1,
367
+ destructive: i = !1,
366
368
  title: s,
367
369
  ...d
368
370
  }) {
369
- const c = E(() => l === "confirm" ? {
371
+ const c = E(() => e === "confirm" ? {
370
372
  confirm: n || "Confirm",
371
373
  cancel: o || "Cancel",
372
374
  defaultTitle: s || "Confirm Action"
@@ -374,7 +376,7 @@ function se({
374
376
  confirm: n || "OK",
375
377
  cancel: null,
376
378
  defaultTitle: s || "Alert"
377
- }, [l, n, s, o]), m = E(
379
+ }, [e, n, s, o]), m = E(
378
380
  () => [
379
381
  ...c.cancel ? [
380
382
  {
@@ -385,37 +387,37 @@ function se({
385
387
  ] : [],
386
388
  {
387
389
  label: c.confirm,
388
- variant: u ? "destructive" : "primary",
390
+ variant: i ? "destructive" : "primary",
389
391
  onClick: () => {
390
- i == null || i(), a();
392
+ u == null || u(), a();
391
393
  }
392
394
  }
393
395
  ],
394
- [c, u, i, a]
396
+ [c, i, u, a]
395
397
  );
396
398
  return /* @__PURE__ */ t(
397
- le,
399
+ el,
398
400
  {
399
401
  ...d,
400
402
  title: s || c.defaultTitle,
401
403
  onClose: a,
402
404
  actions: m,
403
- disableCloseOnOverlayClick: l === "confirm",
404
- hideCloseButton: l === "confirm",
405
+ disableCloseOnOverlayClick: e === "confirm",
406
+ hideCloseButton: e === "confirm",
405
407
  children: typeof r == "string" ? /* @__PURE__ */ t("p", { className: "text-sm", children: r }) : r
406
408
  }
407
409
  );
408
410
  }
409
- const ne = e(null), de = () => {
410
- const l = T(ne);
411
- if (!l)
411
+ const nl = l(null), dl = () => {
412
+ const e = T(nl);
413
+ if (!e)
412
414
  throw new Error("DropdownMenu components must be used within a DropdownMenu component");
413
- return l;
414
- }, te = e(null), ce = () => {
415
- const l = T(te);
416
- if (!l)
415
+ return e;
416
+ }, tl = l(null), cl = () => {
417
+ const e = T(tl);
418
+ if (!e)
417
419
  throw new Error("Tabs components must be used within a Tabs component");
418
- return l;
420
+ return e;
419
421
  }, z = {
420
422
  info: {
421
423
  className: "bg-blue-50 border-blue-200 text-blue-900 dark:bg-blue-800 dark:border-blue-950 dark:text-blue-100",
@@ -430,22 +432,22 @@ const ne = e(null), de = () => {
430
432
  icon: /* @__PURE__ */ t(K, { size: 20 })
431
433
  }
432
434
  };
433
- function me({
434
- id: l,
435
+ function ml({
436
+ id: e,
435
437
  title: r,
436
438
  description: o,
437
439
  type: n = "info",
438
- action: i,
440
+ action: u,
439
441
  duration: a = 5e3,
440
- onRemove: u,
442
+ onRemove: i,
441
443
  customTypes: s,
442
444
  customComponent: d
443
445
  }) {
444
446
  const [c, m] = v(!1), f = L(() => {
445
447
  m(!0), setTimeout(() => {
446
- u == null || u(l);
448
+ i == null || i(e);
447
449
  }, 150);
448
- }, [l, u]);
450
+ }, [e, i]);
449
451
  if (p(() => {
450
452
  if (a > 0) {
451
453
  const h = setTimeout(() => {
@@ -453,17 +455,17 @@ function me({
453
455
  }, a);
454
456
  return () => clearTimeout(h);
455
457
  }
456
- }, [a, l, u, f]), d)
458
+ }, [a, e, i, f]), d)
457
459
  return /* @__PURE__ */ t(
458
460
  d,
459
461
  {
460
- id: l,
462
+ id: e,
461
463
  title: r,
462
464
  description: o,
463
465
  type: n,
464
- action: i,
466
+ action: u,
465
467
  duration: a,
466
- onRemove: u
468
+ onRemove: i
467
469
  }
468
470
  );
469
471
  const g = (s == null ? void 0 : s[n]) || z[n] || z.info;
@@ -474,7 +476,7 @@ function me({
474
476
  "aria-live": n === "error" ? void 0 : "polite",
475
477
  className: Z(
476
478
  "relative flex items-start p-4 rounded-lg border shadow-lg transition-all duration-150 ease-in-out",
477
- i && "pb-3",
479
+ u && "pb-3",
478
480
  g.className,
479
481
  c ? "opacity-0 translate-x-full" : "opacity-100 translate-x-0"
480
482
  ),
@@ -483,12 +485,12 @@ function me({
483
485
  /* @__PURE__ */ b("div", { className: "flex-grow min-w-0", children: [
484
486
  /* @__PURE__ */ t("div", { className: "font-medium text-sm leading-5", children: r }),
485
487
  o && /* @__PURE__ */ t("div", { className: "mt-1 text-sm opacity-90 leading-5", children: o }),
486
- i && /* @__PURE__ */ t("div", { className: "mt-1.5", children: /* @__PURE__ */ t(
488
+ u && /* @__PURE__ */ t("div", { className: "mt-1.5", children: /* @__PURE__ */ t(
487
489
  "button",
488
490
  {
489
- onClick: i.onClick,
491
+ onClick: u.onClick,
490
492
  className: "text-sm font-medium underline hover:no-underline focus:outline-none focus:ring-1 focus:ring-current rounded px-1 py-0.5 hover:cursor-pointer",
491
- children: i.label
493
+ children: u.label
492
494
  }
493
495
  ) })
494
496
  ] }),
@@ -505,12 +507,12 @@ function me({
505
507
  );
506
508
  }
507
509
  export {
508
- se as A,
509
- ne as D,
510
- me as T,
511
- te as a,
512
- ce as b,
510
+ sl as A,
511
+ nl as D,
512
+ ml as T,
513
+ tl as a,
514
+ cl as b,
513
515
  N as n,
514
- de as u
516
+ dl as u
515
517
  };
516
- //# sourceMappingURL=Toast-CqJh-fbM.js.map
518
+ //# sourceMappingURL=Toast-Bbj0QhaH.js.map