@moondreamsdev/dreamer-ui 1.7.9 → 1.7.10-test.1

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.
Files changed (42) hide show
  1. package/dist/{Toast-B83cGTb3.js → Toast-C0wOVeh0.js} +93 -89
  2. package/dist/Toast-C0wOVeh0.js.map +1 -0
  3. package/dist/Toast-DLFVFkWv.cjs +2 -0
  4. package/dist/Toast-DLFVFkWv.cjs.map +1 -0
  5. package/dist/{QuestionMarkCircled-CY81euqP.js → Window-CT479Oxr.js} +98 -6
  6. package/dist/Window-CT479Oxr.js.map +1 -0
  7. package/dist/Window-oF6fyFBX.cjs +2 -0
  8. package/dist/Window-oF6fyFBX.cjs.map +1 -0
  9. package/dist/components.cjs.js +2 -1
  10. package/dist/components.cjs.js.map +1 -1
  11. package/dist/components.esm.js +1753 -1410
  12. package/dist/components.esm.js.map +1 -1
  13. package/dist/hooks.cjs.js +1 -1
  14. package/dist/hooks.esm.js +6 -3
  15. package/dist/hooks.esm.js.map +1 -1
  16. package/dist/providers.cjs.js +1 -1
  17. package/dist/providers.esm.js +1 -1
  18. package/dist/src/components/code-block/CodeBlock.d.ts +35 -0
  19. package/dist/src/components/code-block/hooks.d.ts +65 -0
  20. package/dist/src/components/code-block/index.d.ts +2 -0
  21. package/dist/src/components/index.d.ts +1 -0
  22. package/dist/src/hooks/index.d.ts +2 -0
  23. package/dist/src/hooks/useCopyToClipboard.d.ts +9 -0
  24. package/dist/src/hooks/useDownloadFile.d.ts +6 -0
  25. package/dist/src/symbols/Copy.d.ts +2 -0
  26. package/dist/src/symbols/Dash.d.ts +2 -0
  27. package/dist/src/symbols/Download.d.ts +2 -0
  28. package/dist/src/symbols/Window.d.ts +2 -0
  29. package/dist/src/symbols/index.d.ts +4 -0
  30. package/dist/symbols.cjs.js +1 -1
  31. package/dist/symbols.esm.js +15 -11
  32. package/dist/useDownloadFile-D7aXoP4p.cjs +2 -0
  33. package/dist/useDownloadFile-D7aXoP4p.cjs.map +1 -0
  34. package/dist/useDownloadFile-fw_TsfK6.js +22 -0
  35. package/dist/useDownloadFile-fw_TsfK6.js.map +1 -0
  36. package/package.json +1 -1
  37. package/dist/QuestionMarkCircled-CY81euqP.js.map +0 -1
  38. package/dist/QuestionMarkCircled-D3gPieJ7.cjs +0 -2
  39. package/dist/QuestionMarkCircled-D3gPieJ7.cjs.map +0 -1
  40. package/dist/Toast-B83cGTb3.js.map +0 -1
  41. package/dist/Toast-BDQ9mOuz.cjs +0 -2
  42. package/dist/Toast-BDQ9mOuz.cjs.map +0 -1
@@ -1,12 +1,12 @@
1
1
  import { jsx as r, Fragment as q, jsxs as b } from "react/jsx-runtime";
2
- import F, { createContext as u, useId as H, useState as v, useEffect as g, useRef as P, useCallback as T, useMemo as E, useContext as K } from "react";
3
- import { createPortal as D } from "react-dom";
4
- import { X as J, C as V, E as X, I as Y } from "./X-CIoyLewf.js";
5
- import { join as Z } from "./utils.esm.js";
2
+ import $, { createContext as o, useId as D, useState as v, useEffect as g, useRef as H, useCallback as L, useMemo as E, useContext as P } from "react";
3
+ import { createPortal as Q } from "react-dom";
4
+ import { X, C as Z, E as F, I as J } from "./X-CIoyLewf.js";
5
+ import { join as K } from "./utils.esm.js";
6
6
  function N(...e) {
7
7
  return e.filter((l) => typeof l == "string" && l).join(" ").trim() || void 0;
8
8
  }
9
- function $({ size: e = 15, color: l = "currentColor", className: n = "inline", ...t }) {
9
+ function U({ size: e = 15, color: l = "currentColor", className: n = "inline", ...t }) {
10
10
  return /* @__PURE__ */ r(
11
11
  "svg",
12
12
  {
@@ -31,21 +31,25 @@ function $({ size: e = 15, color: l = "currentColor", className: n = "inline", .
31
31
  function x(...e) {
32
32
  return e.filter((l) => typeof l == "string" && l).join(" ").trim() || void 0;
33
33
  }
34
- u(void 0);
35
- u(null);
36
- u(null);
37
- u(null);
38
- u(null);
39
- u(null);
40
- u(null);
41
- u(null);
42
- u(null);
43
- u(null);
44
- u(null);
45
- u(null);
46
- u(null);
47
- u(null);
48
- function G() {
34
+ o(void 0);
35
+ o(null);
36
+ o(null);
37
+ o(null);
38
+ o(null);
39
+ o(null);
40
+ o(null);
41
+ o(null);
42
+ o(null);
43
+ o(null);
44
+ o(null);
45
+ o(null);
46
+ o(null);
47
+ o(null);
48
+ o(null);
49
+ o(null);
50
+ o(void 0);
51
+ o(void 0);
52
+ function V() {
49
53
  const [e, l] = v(0);
50
54
  return g(() => {
51
55
  const n = setInterval(() => {
@@ -63,7 +67,7 @@ function G() {
63
67
  n
64
68
  )) });
65
69
  }
66
- const Q = {
70
+ const _ = {
67
71
  base: "",
68
72
  primary: "bg-primary text-primary-foreground hover:bg-primary/85 disabled:bg-muted disabled:text-muted-foreground",
69
73
  secondary: "bg-secondary text-secondary-foreground hover:bg-secondary/85 disabled:bg-muted/80 disabled:text-muted-foreground/80",
@@ -71,7 +75,7 @@ const Q = {
71
75
  outline: "border border-primary text-primary hover:border-primary-foreground hover:text-primary-foreground disabled:border-muted disabled:text-muted",
72
76
  link: "underline-offset-4 hover:underline disabled:underline disabled:text-muted",
73
77
  destructive: "bg-destructive text-destructive-foreground hover:bg-destructive/85 disabled:bg-muted disabled:text-muted-foreground"
74
- }, U = {
78
+ }, G = {
75
79
  stripped: "",
76
80
  fitted: "size-fit",
77
81
  sm: "px-2 py-1 text-sm",
@@ -90,43 +94,43 @@ const Q = {
90
94
  size: "md",
91
95
  rounded: "md"
92
96
  };
93
- function _({
97
+ function Y({
94
98
  variant: e = w.variant,
95
99
  size: l,
96
100
  rounded: n = w.rounded,
97
101
  loading: t,
98
102
  linkTo: i,
99
103
  linkProps: a,
100
- type: o = "button",
101
- className: d,
102
- ...s
104
+ type: s = "button",
105
+ className: u,
106
+ ...d
103
107
  }) {
104
108
  let c;
105
109
  e === "link" && !l ? c = "fitted" : c = l || w.size;
106
110
  const m = N(
107
111
  "appearance-none focus:outline-none focus:ring not-disabled:hover:cursor-pointer disabled:opacity-50 disabled:cursor-not-allowed transition-all",
108
- Q[e],
109
- U[c],
112
+ _[e],
113
+ G[c],
110
114
  W[n],
111
115
  t && "relative pointer-events-none",
112
116
  i && "relative",
113
- d
117
+ u
114
118
  );
115
119
  return /* @__PURE__ */ b(
116
120
  "button",
117
121
  {
118
- ...s,
119
- role: i ? "link" : s.role,
120
- "aria-label": s["aria-label"] || (a == null ? void 0 : a["aria-label"]),
121
- "aria-description": s["aria-description"] || (a == null ? void 0 : a["aria-description"]),
122
- "aria-disabled": s.disabled || t,
122
+ ...d,
123
+ role: i ? "link" : d.role,
124
+ "aria-label": d["aria-label"] || (a == null ? void 0 : a["aria-label"]),
125
+ "aria-description": d["aria-description"] || (a == null ? void 0 : a["aria-description"]),
126
+ "aria-disabled": d.disabled || t,
123
127
  "aria-busy": t,
124
- type: o,
128
+ type: s,
125
129
  className: m,
126
130
  children: [
127
- t && /* @__PURE__ */ r(G, {}),
128
- /* @__PURE__ */ r("span", { className: N(t && "invisible"), children: s.children }),
129
- i && !s.disabled && /* @__PURE__ */ r(
131
+ t && /* @__PURE__ */ r(V, {}),
132
+ /* @__PURE__ */ r("span", { className: N(t && "invisible"), children: d.children }),
133
+ i && !d.disabled && /* @__PURE__ */ r(
130
134
  "a",
131
135
  {
132
136
  ...a,
@@ -157,7 +161,7 @@ function ee(e, l) {
157
161
  }, [e, l]);
158
162
  }
159
163
  function te(e, l) {
160
- const n = P(null), t = T(() => {
164
+ const n = H(null), t = L(() => {
161
165
  const i = document.getElementById(e);
162
166
  if (!i) return;
163
167
  const a = i.querySelectorAll('[data-modal-action="true"]');
@@ -165,16 +169,16 @@ function te(e, l) {
165
169
  a[0].focus();
166
170
  return;
167
171
  }
168
- const o = i.querySelectorAll(
172
+ const s = i.querySelectorAll(
169
173
  'button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])'
170
174
  );
171
- if (o.length > 0) {
172
- const d = Array.from(o).filter((s) => !(s instanceof HTMLButtonElement && s.getAttribute("data-modal-close-button") === "true"));
173
- if (d.length > 0) {
174
- d[0].focus();
175
+ if (s.length > 0) {
176
+ const u = Array.from(s).filter((d) => !(d instanceof HTMLButtonElement && d.getAttribute("data-modal-close-button") === "true"));
177
+ if (u.length > 0) {
178
+ u[0].focus();
175
179
  return;
176
180
  }
177
- o[0].focus();
181
+ s[0].focus();
178
182
  return;
179
183
  }
180
184
  i.focus();
@@ -190,21 +194,21 @@ function re({
190
194
  title: t,
191
195
  children: i,
192
196
  contentOnly: a = !1,
193
- className: o,
194
- overlayClassName: d,
195
- hideCloseButton: s = !1,
197
+ className: s,
198
+ overlayClassName: u,
199
+ hideCloseButton: d = !1,
196
200
  actions: c = [],
197
201
  disableCloseOnOverlayClick: m = !1,
198
202
  ariaLabelledBy: f,
199
203
  ariaDescribedBy: h
200
204
  }) {
201
- const p = H(), k = e || `modal-${p}`, C = e ? `${e}-title` : `modal-title-${p}`, { show: z, shouldRender: y } = R(l);
205
+ const p = D(), k = e || `modal-${p}`, C = e ? `${e}-title` : `modal-title-${p}`, { show: z, shouldRender: y } = R(l);
202
206
  if (te(k, y), ee(y, n), !y) return null;
203
- const I = () => t ? F.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, j = () => 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) => {
204
- const { label: B, className: M, ...S } = A;
205
- return /* @__PURE__ */ r(_, { className: M, type: "button", ...S, "data-modal-action": "true", children: B }, O);
207
+ const j = () => t ? $.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, B) => {
208
+ const { label: O, className: M, ...S } = I;
209
+ return /* @__PURE__ */ r(Y, { className: M, type: "button", ...S, "data-modal-action": "true", children: O }, B);
206
210
  }) });
207
- return /* @__PURE__ */ r(q, { children: D(
211
+ return /* @__PURE__ */ r(q, { children: Q(
208
212
  /* @__PURE__ */ r(
209
213
  "div",
210
214
  {
@@ -217,13 +221,13 @@ function re({
217
221
  /* @__PURE__ */ r(
218
222
  "div",
219
223
  {
220
- className: x("fixed inset-0 bg-black/20 transition-all", d),
224
+ className: x("fixed inset-0 bg-black/20 transition-all", u),
221
225
  onClick: () => {
222
226
  m || n();
223
227
  }
224
228
  }
225
229
  ),
226
- a && /* @__PURE__ */ r("div", { className: x("relative w-fit", o), children: i }),
230
+ a && /* @__PURE__ */ r("div", { className: x("relative w-fit", s), children: i }),
227
231
  !a && /* @__PURE__ */ b(
228
232
  "div",
229
233
  {
@@ -232,22 +236,22 @@ function re({
232
236
  className: x(
233
237
  "relative w-full max-w-xl transform rounded-lg shadow-xl bg-popover transition-all p-6 focus:ring ease-in duration-75",
234
238
  z ? "opacity-100 scale-100" : "opacity-0 scale-90",
235
- o
239
+ s
236
240
  ),
237
241
  children: [
238
- !s && /* @__PURE__ */ r(
242
+ !d && /* @__PURE__ */ r(
239
243
  "button",
240
244
  {
241
245
  type: "button",
242
246
  onClick: n,
243
247
  "data-modal-close-button": "true",
244
248
  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",
245
- children: /* @__PURE__ */ r($, { size: 18 })
249
+ children: /* @__PURE__ */ r(U, { size: 18 })
246
250
  }
247
251
  ),
248
- I(),
252
+ j(),
249
253
  i,
250
- j()
254
+ A()
251
255
  ]
252
256
  }
253
257
  )
@@ -264,19 +268,19 @@ function de({
264
268
  confirmText: t,
265
269
  onConfirm: i,
266
270
  onClose: a,
267
- destructive: o = !1,
268
- title: d,
269
- ...s
271
+ destructive: s = !1,
272
+ title: u,
273
+ ...d
270
274
  }) {
271
275
  const c = E(() => e === "confirm" ? {
272
276
  confirm: t || "Confirm",
273
277
  cancel: n || "Cancel",
274
- defaultTitle: d || "Confirm Action"
278
+ defaultTitle: u || "Confirm Action"
275
279
  } : {
276
280
  confirm: t || "OK",
277
281
  cancel: null,
278
- defaultTitle: d || "Alert"
279
- }, [e, t, d, n]), m = E(
282
+ defaultTitle: u || "Alert"
283
+ }, [e, t, u, n]), m = E(
280
284
  () => [
281
285
  ...c.cancel ? [
282
286
  {
@@ -287,19 +291,19 @@ function de({
287
291
  ] : [],
288
292
  {
289
293
  label: c.confirm,
290
- variant: o ? "destructive" : "primary",
294
+ variant: s ? "destructive" : "primary",
291
295
  onClick: () => {
292
296
  i == null || i(), a();
293
297
  }
294
298
  }
295
299
  ],
296
- [c, o, i, a]
300
+ [c, s, i, a]
297
301
  );
298
302
  return /* @__PURE__ */ r(
299
303
  re,
300
304
  {
301
- ...s,
302
- title: d || c.defaultTitle,
305
+ ...d,
306
+ title: u || c.defaultTitle,
303
307
  onClose: a,
304
308
  actions: m,
305
309
  disableCloseOnOverlayClick: e === "confirm",
@@ -308,23 +312,23 @@ function de({
308
312
  }
309
313
  );
310
314
  }
311
- const le = u(null), ue = () => {
312
- const e = K(le);
315
+ const le = o(null), ue = () => {
316
+ const e = P(le);
313
317
  if (!e)
314
318
  throw new Error("Tabs components must be used within a Tabs component");
315
319
  return e;
316
- }, L = {
320
+ }, T = {
317
321
  info: {
318
322
  className: "bg-blue-50 border-blue-200 text-blue-900 dark:bg-blue-800 dark:border-blue-950 dark:text-blue-100",
319
- icon: /* @__PURE__ */ r(Y, { size: 20 })
323
+ icon: /* @__PURE__ */ r(J, { size: 20 })
320
324
  },
321
325
  warning: {
322
326
  className: "bg-yellow-50 border-yellow-200 text-yellow-900 dark:bg-yellow-800 dark:border-yellow-950 dark:text-yellow-100",
323
- icon: /* @__PURE__ */ r(X, { size: 20 })
327
+ icon: /* @__PURE__ */ r(F, { size: 20 })
324
328
  },
325
329
  error: {
326
330
  className: "bg-red-50 border-red-200 text-red-900 dark:bg-red-800 dark:border-red-950 dark:text-red-100",
327
- icon: /* @__PURE__ */ r(V, { size: 20 })
331
+ icon: /* @__PURE__ */ r(Z, { size: 20 })
328
332
  }
329
333
  };
330
334
  function ce({
@@ -334,15 +338,15 @@ function ce({
334
338
  type: t = "info",
335
339
  action: i,
336
340
  duration: a = 5e3,
337
- onRemove: o,
338
- customTypes: d,
339
- customComponent: s
341
+ onRemove: s,
342
+ customTypes: u,
343
+ customComponent: d
340
344
  }) {
341
- const [c, m] = v(!1), f = T(() => {
345
+ const [c, m] = v(!1), f = L(() => {
342
346
  m(!0), setTimeout(() => {
343
- o == null || o(e);
347
+ s == null || s(e);
344
348
  }, 150);
345
- }, [e, o]);
349
+ }, [e, s]);
346
350
  if (g(() => {
347
351
  if (a > 0) {
348
352
  const p = setTimeout(() => {
@@ -350,9 +354,9 @@ function ce({
350
354
  }, a);
351
355
  return () => clearTimeout(p);
352
356
  }
353
- }, [a, e, o, f]), s)
357
+ }, [a, e, s, f]), d)
354
358
  return /* @__PURE__ */ r(
355
- s,
359
+ d,
356
360
  {
357
361
  id: e,
358
362
  title: l,
@@ -360,16 +364,16 @@ function ce({
360
364
  type: t,
361
365
  action: i,
362
366
  duration: a,
363
- onRemove: o
367
+ onRemove: s
364
368
  }
365
369
  );
366
- const h = (d == null ? void 0 : d[t]) || L[t] || L.info;
370
+ const h = (u == null ? void 0 : u[t]) || T[t] || T.info;
367
371
  return /* @__PURE__ */ b(
368
372
  "div",
369
373
  {
370
374
  role: t === "error" ? "alert" : "status",
371
375
  "aria-live": t === "error" ? void 0 : "polite",
372
- className: Z(
376
+ className: K(
373
377
  "relative flex items-start p-4 rounded-lg border shadow-lg transition-all duration-150 ease-in-out",
374
378
  i && "pb-3",
375
379
  h.className,
@@ -394,7 +398,7 @@ function ce({
394
398
  {
395
399
  onClick: f,
396
400
  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",
397
- children: /* @__PURE__ */ r(J, { size: 16 })
401
+ children: /* @__PURE__ */ r(X, { size: 16 })
398
402
  }
399
403
  )
400
404
  ]
@@ -408,4 +412,4 @@ export {
408
412
  N as n,
409
413
  ue as u
410
414
  };
411
- //# sourceMappingURL=Toast-B83cGTb3.js.map
415
+ //# sourceMappingURL=Toast-C0wOVeh0.js.map