@moondreamsdev/dreamer-ui 1.7.10-test.10 → 1.7.10-test.12

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 r, Fragment as S, jsxs as b } from "react/jsx-runtime";
2
- import X, { createContext as i, useId as q, useState as p, useEffect as g, useRef as D, useCallback as T, useMemo as E, useContext as H } from "react";
3
- import { createPortal as P } from "react-dom";
4
- import { X as F, C as J, E as K, I as Q } from "./X-CIoyLewf.js";
5
- import { j as U } from "./join-BmgR_f4v.js";
1
+ import { jsx as l, Fragment as q, jsxs as b } from "react/jsx-runtime";
2
+ import P, { createContext as i, useId as D, useState as v, useEffect as g, useRef as H, useCallback as T, useMemo as E, useContext as X } from "react";
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
6
  function N(...e) {
7
- return e.filter((l) => typeof l == "string" && l).join(" ").trim() || void 0;
7
+ return e.filter((r) => typeof r == "string" && r).join(" ").trim() || void 0;
8
8
  }
9
- function V({ size: e = 15, color: l = "currentColor", className: n = "inline", ...t }) {
10
- return /* @__PURE__ */ r(
9
+ function Y({ size: e = 15, color: r = "currentColor", className: n = "inline", ...t }) {
10
+ return /* @__PURE__ */ l(
11
11
  "svg",
12
12
  {
13
13
  ...t,
@@ -16,11 +16,11 @@ function V({ size: e = 15, color: l = "currentColor", className: n = "inline", .
16
16
  className: n,
17
17
  viewBox: "0 0 15 15",
18
18
  xmlns: "http://www.w3.org/2000/svg",
19
- children: /* @__PURE__ */ r(
19
+ children: /* @__PURE__ */ l(
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: l,
23
+ fill: r,
24
24
  fillRule: "evenodd",
25
25
  clipRule: "evenodd"
26
26
  }
@@ -29,7 +29,7 @@ function V({ size: e = 15, color: l = "currentColor", className: n = "inline", .
29
29
  );
30
30
  }
31
31
  function x(...e) {
32
- return e.filter((l) => typeof l == "string" && l).join(" ").trim() || void 0;
32
+ return e.filter((r) => typeof r == "string" && r).join(" ").trim() || void 0;
33
33
  }
34
34
  i(void 0);
35
35
  i(null);
@@ -57,14 +57,16 @@ i(null);
57
57
  i(null);
58
58
  i(null);
59
59
  i(null);
60
- function Y() {
61
- const [e, l] = p(0);
60
+ i(null);
61
+ i(null);
62
+ function Z() {
63
+ const [e, r] = v(0);
62
64
  return g(() => {
63
65
  const n = setInterval(() => {
64
- l((t) => (t + 1) % 3);
66
+ r((t) => (t + 1) % 3);
65
67
  }, 500);
66
68
  return () => clearInterval(n);
67
- }, []), /* @__PURE__ */ r("div", { className: "absolute inset-0 inline-flex items-center justify-center gap-x-2 align-middle", children: [0, 1, 2].map((n) => /* @__PURE__ */ r(
69
+ }, []), /* @__PURE__ */ l("div", { className: "absolute inset-0 inline-flex items-center justify-center gap-x-2 align-middle", children: [0, 1, 2].map((n) => /* @__PURE__ */ l(
68
70
  "div",
69
71
  {
70
72
  className: N(
@@ -75,7 +77,7 @@ function Y() {
75
77
  n
76
78
  )) });
77
79
  }
78
- const Z = {
80
+ const G = {
79
81
  base: "",
80
82
  primary: "bg-primary text-primary-foreground hover:bg-primary/85 disabled:bg-muted disabled:text-muted-foreground",
81
83
  secondary: "bg-secondary text-secondary-foreground hover:bg-secondary/85 disabled:bg-muted/80 disabled:text-muted-foreground/80",
@@ -83,7 +85,7 @@ const Z = {
83
85
  outline: "border border-primary text-primary hover:border-primary-foreground hover:text-primary-foreground disabled:border-muted disabled:text-muted",
84
86
  link: "underline-offset-4 hover:underline disabled:underline disabled:text-muted",
85
87
  destructive: "bg-destructive text-destructive-foreground hover:bg-destructive/85 disabled:bg-muted disabled:text-muted-foreground"
86
- }, G = {
88
+ }, W = {
87
89
  stripped: "",
88
90
  fitted: "size-fit",
89
91
  sm: "px-2 py-1 text-sm",
@@ -91,7 +93,7 @@ const Z = {
91
93
  lg: "px-6 py-3 text-lg",
92
94
  icon: "p-1 w-fit aspect-square",
93
95
  full: "p-2 w-full"
94
- }, W = {
96
+ }, _ = {
95
97
  none: "rounded-none",
96
98
  sm: "rounded-sm",
97
99
  md: "rounded-md",
@@ -102,9 +104,9 @@ const Z = {
102
104
  size: "md",
103
105
  rounded: "md"
104
106
  };
105
- function _({
107
+ function R({
106
108
  variant: e = w.variant,
107
- size: l,
109
+ size: r,
108
110
  rounded: n = w.rounded,
109
111
  loading: t,
110
112
  linkTo: a,
@@ -114,12 +116,12 @@ function _({
114
116
  ...d
115
117
  }) {
116
118
  let c;
117
- e === "link" && !l ? c = "fitted" : c = l || w.size;
119
+ e === "link" && !r ? c = "fitted" : c = r || w.size;
118
120
  const m = N(
119
121
  "appearance-none focus:outline-none focus:ring not-disabled:hover:cursor-pointer disabled:opacity-50 disabled:cursor-not-allowed transition-all",
120
- Z[e],
121
- G[c],
122
- W[n],
122
+ G[e],
123
+ W[c],
124
+ _[n],
123
125
  t && "relative pointer-events-none",
124
126
  a && "relative",
125
127
  u
@@ -136,9 +138,9 @@ function _({
136
138
  type: s,
137
139
  className: m,
138
140
  children: [
139
- t && /* @__PURE__ */ r(Y, {}),
140
- /* @__PURE__ */ r("span", { className: N(t && "invisible"), children: d.children }),
141
- a && !d.disabled && /* @__PURE__ */ r(
141
+ t && /* @__PURE__ */ l(Z, {}),
142
+ /* @__PURE__ */ l("span", { className: N(t && "invisible"), children: d.children }),
143
+ a && !d.disabled && /* @__PURE__ */ l(
142
144
  "a",
143
145
  {
144
146
  ...o,
@@ -152,24 +154,24 @@ function _({
152
154
  }
153
155
  );
154
156
  }
155
- function R(e) {
156
- const [l, n] = p(!1), [t, a] = p(!1);
157
+ function $(e) {
158
+ const [r, n] = v(!1), [t, a] = v(!1);
157
159
  return g(() => {
158
160
  e ? (a(!0), setTimeout(() => n(!0), 10)) : (n(!1), setTimeout(() => a(!1), 150));
159
- }, [e]), { show: l, shouldRender: t };
161
+ }, [e]), { show: r, shouldRender: t };
160
162
  }
161
- function ee(e, l) {
163
+ function ee(e, r) {
162
164
  g(() => {
163
165
  const n = (t) => {
164
- t.key === "Escape" && e && l();
166
+ t.key === "Escape" && e && r();
165
167
  };
166
168
  return document.addEventListener("keydown", n), e && (document.body.style.overflow = "hidden"), () => {
167
169
  document.removeEventListener("keydown", n), document.body.style.overflow = "auto";
168
170
  };
169
- }, [e, l]);
171
+ }, [e, r]);
170
172
  }
171
- function te(e, l) {
172
- const n = D(null), t = T(() => {
173
+ function te(e, r) {
174
+ const n = H(null), t = T(() => {
173
175
  const a = document.getElementById(e);
174
176
  if (!a) return;
175
177
  const o = a.querySelectorAll('[data-modal-action="true"]');
@@ -191,13 +193,13 @@ function te(e, l) {
191
193
  }
192
194
  a.focus();
193
195
  }, [e]);
194
- g(() => (l && (n.current = document.activeElement, t()), () => {
196
+ g(() => (r && (n.current = document.activeElement, t()), () => {
195
197
  document.body.style.overflow = "auto", n.current instanceof HTMLElement && n.current.focus();
196
- }), [l, t]);
198
+ }), [r, t]);
197
199
  }
198
- function re({
200
+ function le({
199
201
  id: e,
200
- isOpen: l,
202
+ isOpen: r,
201
203
  onClose: n,
202
204
  title: t,
203
205
  children: a,
@@ -210,14 +212,14 @@ function re({
210
212
  ariaLabelledBy: f,
211
213
  ariaDescribedBy: h
212
214
  }) {
213
- const v = q(), k = e || `modal-${v}`, C = e ? `${e}-title` : `modal-title-${v}`, { show: z, shouldRender: y } = R(l);
215
+ const p = D(), k = e || `modal-${p}`, C = e ? `${e}-title` : `modal-title-${p}`, { show: z, shouldRender: y } = $(r);
214
216
  if (te(k, y), ee(y, n), !y) return null;
215
- const j = () => t ? X.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, A = () => 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((I, O) => {
216
- const { label: B, className: $, ...M } = I;
217
- return /* @__PURE__ */ r(_, { className: $, type: "button", ...M, "data-modal-action": "true", children: B }, O);
217
+ const j = () => t ? P.isValidElement(t) ? /* @__PURE__ */ l("div", { className: "mb-4", children: t }) : /* @__PURE__ */ l("h2", { className: "mb-4 text-xl font-semibold", id: C, children: t }) : null, I = () => c.length === 0 ? null : /* @__PURE__ */ l("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) => {
218
+ const { label: O, className: M, ...S } = A;
219
+ return /* @__PURE__ */ l(R, { className: M, type: "button", ...S, "data-modal-action": "true", children: O }, B);
218
220
  }) });
219
- return /* @__PURE__ */ r(S, { children: P(
220
- /* @__PURE__ */ r(
221
+ return /* @__PURE__ */ l(q, { children: F(
222
+ /* @__PURE__ */ l(
221
223
  "div",
222
224
  {
223
225
  "aria-labelledby": f ?? t ? C : void 0,
@@ -226,7 +228,7 @@ function re({
226
228
  "aria-modal": "true",
227
229
  className: "fixed inset-0 z-[100] overflow-y-auto",
228
230
  children: /* @__PURE__ */ b("div", { className: "flex min-h-screen items-center justify-center p-4", children: [
229
- /* @__PURE__ */ r(
231
+ /* @__PURE__ */ l(
230
232
  "div",
231
233
  {
232
234
  className: x("fixed inset-0 bg-black/20 transition-all", u),
@@ -235,7 +237,7 @@ function re({
235
237
  }
236
238
  }
237
239
  ),
238
- o && /* @__PURE__ */ r("div", { className: x("relative w-fit", s), children: a }),
240
+ o && /* @__PURE__ */ l("div", { className: x("relative w-fit", s), children: a }),
239
241
  !o && /* @__PURE__ */ b(
240
242
  "div",
241
243
  {
@@ -247,19 +249,19 @@ function re({
247
249
  s
248
250
  ),
249
251
  children: [
250
- !d && /* @__PURE__ */ r(
252
+ !d && /* @__PURE__ */ l(
251
253
  "button",
252
254
  {
253
255
  type: "button",
254
256
  onClick: n,
255
257
  "data-modal-close-button": "true",
256
258
  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",
257
- children: /* @__PURE__ */ r(V, { size: 18 })
259
+ children: /* @__PURE__ */ l(Y, { size: 18 })
258
260
  }
259
261
  ),
260
262
  j(),
261
263
  a,
262
- A()
264
+ I()
263
265
  ]
264
266
  }
265
267
  )
@@ -271,7 +273,7 @@ function re({
271
273
  }
272
274
  function de({
273
275
  type: e,
274
- message: l,
276
+ message: r,
275
277
  cancelText: n,
276
278
  confirmText: t,
277
279
  onConfirm: a,
@@ -307,8 +309,8 @@ function de({
307
309
  ],
308
310
  [c, s, a, o]
309
311
  );
310
- return /* @__PURE__ */ r(
311
- re,
312
+ return /* @__PURE__ */ l(
313
+ le,
312
314
  {
313
315
  ...d,
314
316
  title: u || c.defaultTitle,
@@ -316,32 +318,32 @@ function de({
316
318
  actions: m,
317
319
  disableCloseOnOverlayClick: e === "confirm",
318
320
  hideCloseButton: e === "confirm",
319
- children: typeof l == "string" ? /* @__PURE__ */ r("p", { className: "text-sm", children: l }) : l
321
+ children: typeof r == "string" ? /* @__PURE__ */ l("p", { className: "text-sm", children: r }) : r
320
322
  }
321
323
  );
322
324
  }
323
- const le = i(null), ue = () => {
324
- const e = H(le);
325
+ const re = i(null), ue = () => {
326
+ const e = X(re);
325
327
  if (!e)
326
328
  throw new Error("Tabs components must be used within a Tabs component");
327
329
  return e;
328
330
  }, L = {
329
331
  info: {
330
332
  className: "bg-blue-50 border-blue-200 text-blue-900 dark:bg-blue-800 dark:border-blue-950 dark:text-blue-100",
331
- icon: /* @__PURE__ */ r(Q, { size: 20 })
333
+ icon: /* @__PURE__ */ l(U, { size: 20 })
332
334
  },
333
335
  warning: {
334
336
  className: "bg-yellow-50 border-yellow-200 text-yellow-900 dark:bg-yellow-800 dark:border-yellow-950 dark:text-yellow-100",
335
- icon: /* @__PURE__ */ r(K, { size: 20 })
337
+ icon: /* @__PURE__ */ l(Q, { size: 20 })
336
338
  },
337
339
  error: {
338
340
  className: "bg-red-50 border-red-200 text-red-900 dark:bg-red-800 dark:border-red-950 dark:text-red-100",
339
- icon: /* @__PURE__ */ r(J, { size: 20 })
341
+ icon: /* @__PURE__ */ l(K, { size: 20 })
340
342
  }
341
343
  };
342
344
  function ce({
343
345
  id: e,
344
- title: l,
346
+ title: r,
345
347
  description: n,
346
348
  type: t = "info",
347
349
  action: a,
@@ -350,24 +352,24 @@ function ce({
350
352
  customTypes: u,
351
353
  customComponent: d
352
354
  }) {
353
- const [c, m] = p(!1), f = T(() => {
355
+ const [c, m] = v(!1), f = T(() => {
354
356
  m(!0), setTimeout(() => {
355
357
  s == null || s(e);
356
358
  }, 150);
357
359
  }, [e, s]);
358
360
  if (g(() => {
359
361
  if (o > 0) {
360
- const v = setTimeout(() => {
362
+ const p = setTimeout(() => {
361
363
  f();
362
364
  }, o);
363
- return () => clearTimeout(v);
365
+ return () => clearTimeout(p);
364
366
  }
365
367
  }, [o, e, s, f]), d)
366
- return /* @__PURE__ */ r(
368
+ return /* @__PURE__ */ l(
367
369
  d,
368
370
  {
369
371
  id: e,
370
- title: l,
372
+ title: r,
371
373
  description: n,
372
374
  type: t,
373
375
  action: a,
@@ -381,18 +383,18 @@ function ce({
381
383
  {
382
384
  role: t === "error" ? "alert" : "status",
383
385
  "aria-live": t === "error" ? void 0 : "polite",
384
- className: U(
386
+ className: V(
385
387
  "relative flex items-start p-4 rounded-lg border shadow-lg transition-all duration-150 ease-in-out",
386
388
  a && "pb-3",
387
389
  h.className,
388
390
  c ? "opacity-0 translate-x-full" : "opacity-100 translate-x-0"
389
391
  ),
390
392
  children: [
391
- /* @__PURE__ */ r("div", { className: "flex-shrink-0 mr-3", children: h.icon }),
393
+ /* @__PURE__ */ l("div", { className: "flex-shrink-0 mr-3", children: h.icon }),
392
394
  /* @__PURE__ */ b("div", { className: "flex-grow min-w-0", children: [
393
- /* @__PURE__ */ r("div", { className: "font-medium text-sm leading-5", children: l }),
394
- n && /* @__PURE__ */ r("div", { className: "mt-1 text-sm opacity-90 leading-5", children: n }),
395
- a && /* @__PURE__ */ r("div", { className: "mt-1.5", children: /* @__PURE__ */ r(
395
+ /* @__PURE__ */ l("div", { className: "font-medium text-sm leading-5", children: r }),
396
+ n && /* @__PURE__ */ l("div", { className: "mt-1 text-sm opacity-90 leading-5", children: n }),
397
+ a && /* @__PURE__ */ l("div", { className: "mt-1.5", children: /* @__PURE__ */ l(
396
398
  "button",
397
399
  {
398
400
  onClick: a.onClick,
@@ -401,12 +403,12 @@ function ce({
401
403
  }
402
404
  ) })
403
405
  ] }),
404
- /* @__PURE__ */ r(
406
+ /* @__PURE__ */ l(
405
407
  "button",
406
408
  {
407
409
  onClick: f,
408
410
  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",
409
- children: /* @__PURE__ */ r(F, { size: 16 })
411
+ children: /* @__PURE__ */ l(J, { size: 16 })
410
412
  }
411
413
  )
412
414
  ]
@@ -416,8 +418,8 @@ function ce({
416
418
  export {
417
419
  de as A,
418
420
  ce as T,
419
- le as a,
421
+ re as a,
420
422
  N as n,
421
423
  ue as u
422
424
  };
423
- //# sourceMappingURL=Toast-CaoOKhAH.js.map
425
+ //# sourceMappingURL=Toast-Bpu_I3to.js.map