@moondreamsdev/dreamer-ui 1.7.10-test.21 → 1.7.10-test.23

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 r, Fragment as q, jsxs as b } from "react/jsx-runtime";
2
- import H, { createContext as l, useId as D, useState as p, useEffect as g, useRef as P, useCallback as L, useMemo as E, useContext as X } from "react";
2
+ import H, { createContext as e, useId as D, useState as p, useEffect as g, useRef as P, useCallback as L, useMemo as E, useContext as X } from "react";
3
3
  import { createPortal as F } from "react-dom";
4
- import { X as J, C as K, E as Q, I as U } from "./X-CIoyLewf.js";
5
- import { j as V } from "./join-BmgR_f4v.js";
6
- function N(...e) {
7
- return e.filter((n) => typeof n == "string" && n).join(" ").trim() || void 0;
4
+ import { X as J, C as K, E as Q, I as V } from "./X-CIoyLewf.js";
5
+ import { j as Y } from "./join-BmgR_f4v.js";
6
+ function N(...l) {
7
+ return l.filter((n) => typeof n == "string" && n).join(" ").trim() || void 0;
8
8
  }
9
- function Y({ size: e = 15, color: n = "currentColor", className: i = "inline", ...t }) {
9
+ function Z({ size: l = 15, color: n = "currentColor", className: i = "inline", ...t }) {
10
10
  return /* @__PURE__ */ r(
11
11
  "svg",
12
12
  {
13
13
  ...t,
14
- width: e,
15
- height: e,
14
+ width: l,
15
+ height: l,
16
16
  className: i,
17
17
  viewBox: "0 0 15 15",
18
18
  xmlns: "http://www.w3.org/2000/svg",
@@ -28,47 +28,49 @@ function Y({ size: e = 15, color: n = "currentColor", className: i = "inline", .
28
28
  }
29
29
  );
30
30
  }
31
- function x(...e) {
32
- return e.filter((n) => typeof n == "string" && n).join(" ").trim() || void 0;
31
+ function x(...l) {
32
+ return l.filter((n) => typeof n == "string" && n).join(" ").trim() || void 0;
33
33
  }
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
- function Z() {
71
- const [e, n] = p(0);
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
+ function G() {
73
+ const [l, n] = p(0);
72
74
  return g(() => {
73
75
  const i = setInterval(() => {
74
76
  n((t) => (t + 1) % 3);
@@ -79,13 +81,13 @@ function Z() {
79
81
  {
80
82
  className: N(
81
83
  "rounded-full transition-all duration-500 ease-in-out size-[0.35em] bg-current",
82
- e === i && "transform -translate-y-1"
84
+ l === i && "transform -translate-y-1"
83
85
  )
84
86
  },
85
87
  i
86
88
  )) });
87
89
  }
88
- const G = {
90
+ const U = {
89
91
  base: "",
90
92
  primary: "bg-primary text-primary-foreground hover:bg-primary/85 disabled:bg-muted disabled:text-muted-foreground",
91
93
  secondary: "bg-secondary text-secondary-foreground hover:bg-secondary/85 disabled:bg-muted/80 disabled:text-muted-foreground/80",
@@ -113,7 +115,7 @@ const G = {
113
115
  rounded: "md"
114
116
  };
115
117
  function $({
116
- variant: e = w.variant,
118
+ variant: l = w.variant,
117
119
  size: n,
118
120
  rounded: i = w.rounded,
119
121
  loading: t,
@@ -124,10 +126,10 @@ function $({
124
126
  ...d
125
127
  }) {
126
128
  let c;
127
- e === "link" && !n ? c = "fitted" : c = n || w.size;
129
+ l === "link" && !n ? c = "fitted" : c = n || w.size;
128
130
  const m = N(
129
131
  "appearance-none focus:outline-none focus:ring not-disabled:hover:cursor-pointer disabled:opacity-50 disabled:cursor-not-allowed transition-all",
130
- G[e],
132
+ U[l],
131
133
  W[c],
132
134
  _[i],
133
135
  t && "relative pointer-events-none",
@@ -146,7 +148,7 @@ function $({
146
148
  type: s,
147
149
  className: m,
148
150
  children: [
149
- t && /* @__PURE__ */ r(Z, {}),
151
+ t && /* @__PURE__ */ r(G, {}),
150
152
  /* @__PURE__ */ r("span", { className: N(t && "invisible"), children: d.children }),
151
153
  a && !d.disabled && /* @__PURE__ */ r(
152
154
  "a",
@@ -162,25 +164,25 @@ function $({
162
164
  }
163
165
  );
164
166
  }
165
- function R(e) {
167
+ function R(l) {
166
168
  const [n, i] = p(!1), [t, a] = p(!1);
167
169
  return g(() => {
168
- e ? (a(!0), setTimeout(() => i(!0), 10)) : (i(!1), setTimeout(() => a(!1), 150));
169
- }, [e]), { show: n, shouldRender: t };
170
+ l ? (a(!0), setTimeout(() => i(!0), 10)) : (i(!1), setTimeout(() => a(!1), 150));
171
+ }, [l]), { show: n, shouldRender: t };
170
172
  }
171
- function ee(e, n) {
173
+ function ee(l, n) {
172
174
  g(() => {
173
175
  const i = (t) => {
174
- t.key === "Escape" && e && n();
176
+ t.key === "Escape" && l && n();
175
177
  };
176
- return document.addEventListener("keydown", i), e && (document.body.style.overflow = "hidden"), () => {
178
+ return document.addEventListener("keydown", i), l && (document.body.style.overflow = "hidden"), () => {
177
179
  document.removeEventListener("keydown", i), document.body.style.overflow = "auto";
178
180
  };
179
- }, [e, n]);
181
+ }, [l, n]);
180
182
  }
181
- function le(e, n) {
183
+ function le(l, n) {
182
184
  const i = P(null), t = L(() => {
183
- const a = document.getElementById(e);
185
+ const a = document.getElementById(l);
184
186
  if (!a) return;
185
187
  const o = a.querySelectorAll('[data-modal-action="true"]');
186
188
  if (o.length > 0) {
@@ -200,13 +202,13 @@ function le(e, n) {
200
202
  return;
201
203
  }
202
204
  a.focus();
203
- }, [e]);
205
+ }, [l]);
204
206
  g(() => (n && (i.current = document.activeElement, t()), () => {
205
207
  document.body.style.overflow = "auto", i.current instanceof HTMLElement && i.current.focus();
206
208
  }), [n, t]);
207
209
  }
208
210
  function te({
209
- id: e,
211
+ id: l,
210
212
  isOpen: n,
211
213
  onClose: i,
212
214
  title: t,
@@ -220,11 +222,11 @@ function te({
220
222
  ariaLabelledBy: f,
221
223
  ariaDescribedBy: h
222
224
  }) {
223
- const v = D(), k = e || `modal-${v}`, C = e ? `${e}-title` : `modal-title-${v}`, { show: T, shouldRender: y } = R(n);
225
+ const v = D(), k = l || `modal-${v}`, C = l ? `${l}-title` : `modal-title-${v}`, { show: T, shouldRender: y } = R(n);
224
226
  if (le(k, y), ee(y, i), !y) return null;
225
- const j = () => t ? H.isValidElement(t) ? /* @__PURE__ */ r("div", { className: "mb-4", children: t }) : /* @__PURE__ */ r("h2", { className: "mb-4 text-xl font-semibold", id: C, children: t }) : null, I = () => c.length === 0 ? null : /* @__PURE__ */ r("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((A, B) => {
226
- const { label: O, className: M, ...S } = A;
227
- return /* @__PURE__ */ r($, { className: M, type: "button", ...S, "data-modal-action": "true", children: O }, B);
227
+ const j = () => t ? H.isValidElement(t) ? /* @__PURE__ */ r("div", { className: "mb-4", children: t }) : /* @__PURE__ */ r("h2", { className: "mb-4 text-xl font-semibold", id: C, children: t }) : null, I = () => c.length === 0 ? null : /* @__PURE__ */ r("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((A, O) => {
228
+ const { label: B, className: M, ...S } = A;
229
+ return /* @__PURE__ */ r($, { className: M, type: "button", ...S, "data-modal-action": "true", children: B }, O);
228
230
  }) });
229
231
  return /* @__PURE__ */ r(q, { children: F(
230
232
  /* @__PURE__ */ r(
@@ -264,7 +266,7 @@ function te({
264
266
  onClick: i,
265
267
  "data-modal-close-button": "true",
266
268
  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",
267
- children: /* @__PURE__ */ r(Y, { size: 18 })
269
+ children: /* @__PURE__ */ r(Z, { size: 18 })
268
270
  }
269
271
  ),
270
272
  j(),
@@ -280,7 +282,7 @@ function te({
280
282
  ) });
281
283
  }
282
284
  function de({
283
- type: e,
285
+ type: l,
284
286
  message: n,
285
287
  cancelText: i,
286
288
  confirmText: t,
@@ -290,7 +292,7 @@ function de({
290
292
  title: u,
291
293
  ...d
292
294
  }) {
293
- const c = E(() => e === "confirm" ? {
295
+ const c = E(() => l === "confirm" ? {
294
296
  confirm: t || "Confirm",
295
297
  cancel: i || "Cancel",
296
298
  defaultTitle: u || "Confirm Action"
@@ -298,7 +300,7 @@ function de({
298
300
  confirm: t || "OK",
299
301
  cancel: null,
300
302
  defaultTitle: u || "Alert"
301
- }, [e, t, u, i]), m = E(
303
+ }, [l, t, u, i]), m = E(
302
304
  () => [
303
305
  ...c.cancel ? [
304
306
  {
@@ -324,21 +326,21 @@ function de({
324
326
  title: u || c.defaultTitle,
325
327
  onClose: o,
326
328
  actions: m,
327
- disableCloseOnOverlayClick: e === "confirm",
328
- hideCloseButton: e === "confirm",
329
+ disableCloseOnOverlayClick: l === "confirm",
330
+ hideCloseButton: l === "confirm",
329
331
  children: typeof n == "string" ? /* @__PURE__ */ r("p", { className: "text-sm", children: n }) : n
330
332
  }
331
333
  );
332
334
  }
333
- const re = l(null), ue = () => {
334
- const e = X(re);
335
- if (!e)
335
+ const re = e(null), ue = () => {
336
+ const l = X(re);
337
+ if (!l)
336
338
  throw new Error("Tabs components must be used within a Tabs component");
337
- return e;
339
+ return l;
338
340
  }, z = {
339
341
  info: {
340
342
  className: "bg-blue-50 border-blue-200 text-blue-900 dark:bg-blue-800 dark:border-blue-950 dark:text-blue-100",
341
- icon: /* @__PURE__ */ r(U, { size: 20 })
343
+ icon: /* @__PURE__ */ r(V, { size: 20 })
342
344
  },
343
345
  warning: {
344
346
  className: "bg-yellow-50 border-yellow-200 text-yellow-900 dark:bg-yellow-800 dark:border-yellow-950 dark:text-yellow-100",
@@ -350,7 +352,7 @@ const re = l(null), ue = () => {
350
352
  }
351
353
  };
352
354
  function ce({
353
- id: e,
355
+ id: l,
354
356
  title: n,
355
357
  description: i,
356
358
  type: t = "info",
@@ -362,9 +364,9 @@ function ce({
362
364
  }) {
363
365
  const [c, m] = p(!1), f = L(() => {
364
366
  m(!0), setTimeout(() => {
365
- s == null || s(e);
367
+ s == null || s(l);
366
368
  }, 150);
367
- }, [e, s]);
369
+ }, [l, s]);
368
370
  if (g(() => {
369
371
  if (o > 0) {
370
372
  const v = setTimeout(() => {
@@ -372,11 +374,11 @@ function ce({
372
374
  }, o);
373
375
  return () => clearTimeout(v);
374
376
  }
375
- }, [o, e, s, f]), d)
377
+ }, [o, l, s, f]), d)
376
378
  return /* @__PURE__ */ r(
377
379
  d,
378
380
  {
379
- id: e,
381
+ id: l,
380
382
  title: n,
381
383
  description: i,
382
384
  type: t,
@@ -391,7 +393,7 @@ function ce({
391
393
  {
392
394
  role: t === "error" ? "alert" : "status",
393
395
  "aria-live": t === "error" ? void 0 : "polite",
394
- className: V(
396
+ className: Y(
395
397
  "relative flex items-start p-4 rounded-lg border shadow-lg transition-all duration-150 ease-in-out",
396
398
  a && "pb-3",
397
399
  h.className,
@@ -430,4 +432,4 @@ export {
430
432
  N as n,
431
433
  ue as u
432
434
  };
433
- //# sourceMappingURL=Toast-1h4qbe8J.js.map
435
+ //# sourceMappingURL=Toast-C8kn23N0.js.map