@moondreamsdev/dreamer-ui 1.7.10-test.30 → 1.7.10-test.31

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 q, jsxs as b } from "react/jsx-runtime";
2
- import P, { createContext as e, useId as D, useState as p, useEffect as g, useRef as H, useCallback as L, 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 V } from "./X-CIoyLewf.js";
5
- import { j as Y } from "./join-BmgR_f4v.js";
1
+ import { jsx as n, Fragment as q, jsxs as b } from "react/jsx-runtime";
2
+ import P, { createContext as e, useId as $, useState as p, useEffect as g, useRef as H, useCallback as L, useMemo as E, useContext as X } from "react";
3
+ import { createPortal as D } 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 V } from "./join-BmgR_f4v.js";
6
6
  function N(...l) {
7
- return l.filter((n) => typeof n == "string" && n).join(" ").trim() || void 0;
7
+ return l.filter((r) => typeof r == "string" && r).join(" ").trim() || void 0;
8
8
  }
9
- function Z({ size: l = 15, color: n = "currentColor", className: i = "inline", ...t }) {
10
- return /* @__PURE__ */ r(
9
+ function Y({ size: l = 15, color: r = "currentColor", className: i = "inline", ...t }) {
10
+ return /* @__PURE__ */ n(
11
11
  "svg",
12
12
  {
13
13
  ...t,
@@ -16,11 +16,11 @@ function Z({ size: l = 15, color: n = "currentColor", className: i = "inline", .
16
16
  className: i,
17
17
  viewBox: "0 0 15 15",
18
18
  xmlns: "http://www.w3.org/2000/svg",
19
- children: /* @__PURE__ */ r(
19
+ children: /* @__PURE__ */ n(
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: n,
23
+ fill: r,
24
24
  fillRule: "evenodd",
25
25
  clipRule: "evenodd"
26
26
  }
@@ -29,7 +29,7 @@ function Z({ size: l = 15, color: n = "currentColor", className: i = "inline", .
29
29
  );
30
30
  }
31
31
  function x(...l) {
32
- return l.filter((n) => typeof n == "string" && n).join(" ").trim() || void 0;
32
+ return l.filter((r) => typeof r == "string" && r).join(" ").trim() || void 0;
33
33
  }
34
34
  e(void 0);
35
35
  e(null);
@@ -75,14 +75,15 @@ e(null);
75
75
  e(null);
76
76
  e(null);
77
77
  e(null);
78
- function G() {
79
- const [l, n] = p(0);
78
+ e(null);
79
+ function Z() {
80
+ const [l, r] = p(0);
80
81
  return g(() => {
81
82
  const i = setInterval(() => {
82
- n((t) => (t + 1) % 3);
83
+ r((t) => (t + 1) % 3);
83
84
  }, 500);
84
85
  return () => clearInterval(i);
85
- }, []), /* @__PURE__ */ r("div", { className: "absolute inset-0 inline-flex items-center justify-center gap-x-2 align-middle", children: [0, 1, 2].map((i) => /* @__PURE__ */ r(
86
+ }, []), /* @__PURE__ */ n("div", { className: "absolute inset-0 inline-flex items-center justify-center gap-x-2 align-middle", children: [0, 1, 2].map((i) => /* @__PURE__ */ n(
86
87
  "div",
87
88
  {
88
89
  className: N(
@@ -93,7 +94,7 @@ function G() {
93
94
  i
94
95
  )) });
95
96
  }
96
- const U = {
97
+ const G = {
97
98
  base: "",
98
99
  primary: "bg-primary text-primary-foreground hover:bg-primary/85 disabled:bg-muted disabled:text-muted-foreground",
99
100
  secondary: "bg-secondary text-secondary-foreground hover:bg-secondary/85 disabled:bg-muted/80 disabled:text-muted-foreground/80",
@@ -101,7 +102,7 @@ const U = {
101
102
  outline: "border border-primary text-primary hover:border-primary-foreground hover:text-primary-foreground disabled:border-muted disabled:text-muted",
102
103
  link: "underline-offset-4 hover:underline disabled:underline disabled:text-muted",
103
104
  destructive: "bg-destructive text-destructive-foreground hover:bg-destructive/85 disabled:bg-muted disabled:text-muted-foreground"
104
- }, W = {
105
+ }, U = {
105
106
  stripped: "",
106
107
  fitted: "size-fit",
107
108
  sm: "px-2 py-1 text-sm",
@@ -109,7 +110,7 @@ const U = {
109
110
  lg: "px-6 py-3 text-lg",
110
111
  icon: "p-1 w-fit aspect-square",
111
112
  full: "p-2 w-full"
112
- }, _ = {
113
+ }, W = {
113
114
  none: "rounded-none",
114
115
  sm: "rounded-sm",
115
116
  md: "rounded-md",
@@ -120,9 +121,9 @@ const U = {
120
121
  size: "md",
121
122
  rounded: "md"
122
123
  };
123
- function $({
124
+ function _({
124
125
  variant: l = w.variant,
125
- size: n,
126
+ size: r,
126
127
  rounded: i = w.rounded,
127
128
  loading: t,
128
129
  linkTo: a,
@@ -132,12 +133,12 @@ function $({
132
133
  ...d
133
134
  }) {
134
135
  let c;
135
- l === "link" && !n ? c = "fitted" : c = n || w.size;
136
+ l === "link" && !r ? c = "fitted" : c = r || w.size;
136
137
  const m = N(
137
138
  "appearance-none focus:outline-none focus:ring not-disabled:hover:cursor-pointer disabled:opacity-50 disabled:cursor-not-allowed transition-all",
138
- U[l],
139
- W[c],
140
- _[i],
139
+ G[l],
140
+ U[c],
141
+ W[i],
141
142
  t && "relative pointer-events-none",
142
143
  a && "relative",
143
144
  u
@@ -154,9 +155,9 @@ function $({
154
155
  type: s,
155
156
  className: m,
156
157
  children: [
157
- t && /* @__PURE__ */ r(G, {}),
158
- /* @__PURE__ */ r("span", { className: N(t && "invisible"), children: d.children }),
159
- a && !d.disabled && /* @__PURE__ */ r(
158
+ t && /* @__PURE__ */ n(Z, {}),
159
+ /* @__PURE__ */ n("span", { className: N(t && "invisible"), children: d.children }),
160
+ a && !d.disabled && /* @__PURE__ */ n(
160
161
  "a",
161
162
  {
162
163
  ...o,
@@ -171,22 +172,22 @@ function $({
171
172
  );
172
173
  }
173
174
  function R(l) {
174
- const [n, i] = p(!1), [t, a] = p(!1);
175
+ const [r, i] = p(!1), [t, a] = p(!1);
175
176
  return g(() => {
176
177
  l ? (a(!0), setTimeout(() => i(!0), 10)) : (i(!1), setTimeout(() => a(!1), 150));
177
- }, [l]), { show: n, shouldRender: t };
178
+ }, [l]), { show: r, shouldRender: t };
178
179
  }
179
- function ee(l, n) {
180
+ function ee(l, r) {
180
181
  g(() => {
181
182
  const i = (t) => {
182
- t.key === "Escape" && l && n();
183
+ t.key === "Escape" && l && r();
183
184
  };
184
185
  return document.addEventListener("keydown", i), l && (document.body.style.overflow = "hidden"), () => {
185
186
  document.removeEventListener("keydown", i), document.body.style.overflow = "auto";
186
187
  };
187
- }, [l, n]);
188
+ }, [l, r]);
188
189
  }
189
- function le(l, n) {
190
+ function le(l, r) {
190
191
  const i = H(null), t = L(() => {
191
192
  const a = document.getElementById(l);
192
193
  if (!a) return;
@@ -209,13 +210,13 @@ function le(l, n) {
209
210
  }
210
211
  a.focus();
211
212
  }, [l]);
212
- g(() => (n && (i.current = document.activeElement, t()), () => {
213
+ g(() => (r && (i.current = document.activeElement, t()), () => {
213
214
  document.body.style.overflow = "auto", i.current instanceof HTMLElement && i.current.focus();
214
- }), [n, t]);
215
+ }), [r, t]);
215
216
  }
216
217
  function te({
217
218
  id: l,
218
- isOpen: n,
219
+ isOpen: r,
219
220
  onClose: i,
220
221
  title: t,
221
222
  children: a,
@@ -228,14 +229,14 @@ function te({
228
229
  ariaLabelledBy: f,
229
230
  ariaDescribedBy: h
230
231
  }) {
231
- const v = D(), k = l || `modal-${v}`, C = l ? `${l}-title` : `modal-title-${v}`, { show: T, shouldRender: y } = R(n);
232
+ const v = $(), k = l || `modal-${v}`, C = l ? `${l}-title` : `modal-title-${v}`, { show: T, shouldRender: y } = R(r);
232
233
  if (le(k, y), ee(y, i), !y) return null;
233
- const j = () => t ? P.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) => {
234
- const { label: B, className: M, ...S } = A;
235
- return /* @__PURE__ */ r($, { className: M, type: "button", ...S, "data-modal-action": "true", children: B }, O);
234
+ const j = () => t ? P.isValidElement(t) ? /* @__PURE__ */ n("div", { className: "mb-4", children: t }) : /* @__PURE__ */ n("h2", { className: "mb-4 text-xl font-semibold", id: C, children: t }) : null, I = () => c.length === 0 ? null : /* @__PURE__ */ n("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) => {
235
+ const { label: B, className: S, ...M } = A;
236
+ return /* @__PURE__ */ n(_, { className: S, type: "button", ...M, "data-modal-action": "true", children: B }, O);
236
237
  }) });
237
- return /* @__PURE__ */ r(q, { children: F(
238
- /* @__PURE__ */ r(
238
+ return /* @__PURE__ */ n(q, { children: D(
239
+ /* @__PURE__ */ n(
239
240
  "div",
240
241
  {
241
242
  "aria-labelledby": f ?? t ? C : void 0,
@@ -244,7 +245,7 @@ function te({
244
245
  "aria-modal": "true",
245
246
  className: "fixed inset-0 z-[100] overflow-y-auto",
246
247
  children: /* @__PURE__ */ b("div", { className: "flex min-h-screen items-center justify-center p-4", children: [
247
- /* @__PURE__ */ r(
248
+ /* @__PURE__ */ n(
248
249
  "div",
249
250
  {
250
251
  className: x("fixed inset-0 bg-black/20 transition-all", u),
@@ -253,7 +254,7 @@ function te({
253
254
  }
254
255
  }
255
256
  ),
256
- o && /* @__PURE__ */ r("div", { className: x("relative w-fit", s), children: a }),
257
+ o && /* @__PURE__ */ n("div", { className: x("relative w-fit", s), children: a }),
257
258
  !o && /* @__PURE__ */ b(
258
259
  "div",
259
260
  {
@@ -265,14 +266,14 @@ function te({
265
266
  s
266
267
  ),
267
268
  children: [
268
- !d && /* @__PURE__ */ r(
269
+ !d && /* @__PURE__ */ n(
269
270
  "button",
270
271
  {
271
272
  type: "button",
272
273
  onClick: i,
273
274
  "data-modal-close-button": "true",
274
275
  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",
275
- children: /* @__PURE__ */ r(Z, { size: 18 })
276
+ children: /* @__PURE__ */ n(Y, { size: 18 })
276
277
  }
277
278
  ),
278
279
  j(),
@@ -289,7 +290,7 @@ function te({
289
290
  }
290
291
  function de({
291
292
  type: l,
292
- message: n,
293
+ message: r,
293
294
  cancelText: i,
294
295
  confirmText: t,
295
296
  onConfirm: a,
@@ -325,7 +326,7 @@ function de({
325
326
  ],
326
327
  [c, s, a, o]
327
328
  );
328
- return /* @__PURE__ */ r(
329
+ return /* @__PURE__ */ n(
329
330
  te,
330
331
  {
331
332
  ...d,
@@ -334,32 +335,32 @@ function de({
334
335
  actions: m,
335
336
  disableCloseOnOverlayClick: l === "confirm",
336
337
  hideCloseButton: l === "confirm",
337
- children: typeof n == "string" ? /* @__PURE__ */ r("p", { className: "text-sm", children: n }) : n
338
+ children: typeof r == "string" ? /* @__PURE__ */ n("p", { className: "text-sm", children: r }) : r
338
339
  }
339
340
  );
340
341
  }
341
- const re = e(null), ue = () => {
342
- const l = X(re);
342
+ const ne = e(null), ue = () => {
343
+ const l = X(ne);
343
344
  if (!l)
344
345
  throw new Error("Tabs components must be used within a Tabs component");
345
346
  return l;
346
347
  }, z = {
347
348
  info: {
348
349
  className: "bg-blue-50 border-blue-200 text-blue-900 dark:bg-blue-800 dark:border-blue-950 dark:text-blue-100",
349
- icon: /* @__PURE__ */ r(V, { size: 20 })
350
+ icon: /* @__PURE__ */ n(Q, { size: 20 })
350
351
  },
351
352
  warning: {
352
353
  className: "bg-yellow-50 border-yellow-200 text-yellow-900 dark:bg-yellow-800 dark:border-yellow-950 dark:text-yellow-100",
353
- icon: /* @__PURE__ */ r(Q, { size: 20 })
354
+ icon: /* @__PURE__ */ n(K, { size: 20 })
354
355
  },
355
356
  error: {
356
357
  className: "bg-red-50 border-red-200 text-red-900 dark:bg-red-800 dark:border-red-950 dark:text-red-100",
357
- icon: /* @__PURE__ */ r(K, { size: 20 })
358
+ icon: /* @__PURE__ */ n(J, { size: 20 })
358
359
  }
359
360
  };
360
361
  function ce({
361
362
  id: l,
362
- title: n,
363
+ title: r,
363
364
  description: i,
364
365
  type: t = "info",
365
366
  action: a,
@@ -381,11 +382,11 @@ function ce({
381
382
  return () => clearTimeout(v);
382
383
  }
383
384
  }, [o, l, s, f]), d)
384
- return /* @__PURE__ */ r(
385
+ return /* @__PURE__ */ n(
385
386
  d,
386
387
  {
387
388
  id: l,
388
- title: n,
389
+ title: r,
389
390
  description: i,
390
391
  type: t,
391
392
  action: a,
@@ -399,18 +400,18 @@ function ce({
399
400
  {
400
401
  role: t === "error" ? "alert" : "status",
401
402
  "aria-live": t === "error" ? void 0 : "polite",
402
- className: Y(
403
+ className: V(
403
404
  "relative flex items-start p-4 rounded-lg border shadow-lg transition-all duration-150 ease-in-out",
404
405
  a && "pb-3",
405
406
  h.className,
406
407
  c ? "opacity-0 translate-x-full" : "opacity-100 translate-x-0"
407
408
  ),
408
409
  children: [
409
- /* @__PURE__ */ r("div", { className: "flex-shrink-0 mr-3", children: h.icon }),
410
+ /* @__PURE__ */ n("div", { className: "flex-shrink-0 mr-3", children: h.icon }),
410
411
  /* @__PURE__ */ b("div", { className: "flex-grow min-w-0", children: [
411
- /* @__PURE__ */ r("div", { className: "font-medium text-sm leading-5", children: n }),
412
- i && /* @__PURE__ */ r("div", { className: "mt-1 text-sm opacity-90 leading-5", children: i }),
413
- a && /* @__PURE__ */ r("div", { className: "mt-1.5", children: /* @__PURE__ */ r(
412
+ /* @__PURE__ */ n("div", { className: "font-medium text-sm leading-5", children: r }),
413
+ i && /* @__PURE__ */ n("div", { className: "mt-1 text-sm opacity-90 leading-5", children: i }),
414
+ a && /* @__PURE__ */ n("div", { className: "mt-1.5", children: /* @__PURE__ */ n(
414
415
  "button",
415
416
  {
416
417
  onClick: a.onClick,
@@ -419,12 +420,12 @@ function ce({
419
420
  }
420
421
  ) })
421
422
  ] }),
422
- /* @__PURE__ */ r(
423
+ /* @__PURE__ */ n(
423
424
  "button",
424
425
  {
425
426
  onClick: f,
426
427
  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",
427
- children: /* @__PURE__ */ r(J, { size: 16 })
428
+ children: /* @__PURE__ */ n(F, { size: 16 })
428
429
  }
429
430
  )
430
431
  ]
@@ -434,8 +435,8 @@ function ce({
434
435
  export {
435
436
  de as A,
436
437
  ce as T,
437
- re as a,
438
+ ne as a,
438
439
  N as n,
439
440
  ue as u
440
441
  };
441
- //# sourceMappingURL=Toast-Cd0c5LD7.js.map
442
+ //# sourceMappingURL=Toast-Bsg0i0i0.js.map