@moondreamsdev/dreamer-ui 1.7.10-test.14 → 1.7.10-test.140

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 (125) hide show
  1. package/dist/Toast-BAn23LHw.js +597 -0
  2. package/dist/Toast-BAn23LHw.js.map +1 -0
  3. package/dist/Toast-CcfT-hVh.cjs +2 -0
  4. package/dist/Toast-CcfT-hVh.cjs.map +1 -0
  5. package/dist/Window-DeUS0Imz.cjs +2 -0
  6. package/dist/Window-DeUS0Imz.cjs.map +1 -0
  7. package/dist/{Window-7myUuX6Y.js → Window-jwkN6WT6.js} +138 -23
  8. package/dist/Window-jwkN6WT6.js.map +1 -0
  9. package/dist/components.cjs.js +2 -2
  10. package/dist/components.cjs.js.map +1 -1
  11. package/dist/components.esm.js +4663 -2214
  12. package/dist/components.esm.js.map +1 -1
  13. package/dist/hooks.cjs.js +1 -1
  14. package/dist/hooks.esm.js +6 -4
  15. package/dist/hooks.esm.js.map +1 -1
  16. package/dist/providers.cjs.js +1 -1
  17. package/dist/providers.esm.js +2 -2
  18. package/dist/src/components/accordion/AccordionItem.d.ts +1 -0
  19. package/dist/src/components/avatar/Avatar.d.ts +23 -0
  20. package/dist/src/components/avatar/icons.d.ts +30 -0
  21. package/dist/src/components/avatar/index.d.ts +1 -0
  22. package/dist/src/components/avatar/variants.d.ts +8 -0
  23. package/dist/src/components/badge/Badge.d.ts +15 -0
  24. package/dist/src/components/badge/index.d.ts +1 -0
  25. package/dist/src/components/badge/variants.d.ts +13 -0
  26. package/dist/src/components/button/Button.d.ts +12 -5
  27. package/dist/src/components/button/variants.d.ts +1 -1
  28. package/dist/src/components/callout/Callout.d.ts +23 -0
  29. package/dist/src/components/callout/index.d.ts +1 -0
  30. package/dist/src/components/callout/variants.d.ts +9 -0
  31. package/dist/src/components/card/Card.d.ts +29 -0
  32. package/dist/src/components/card/index.d.ts +1 -0
  33. package/dist/src/components/card/variants.d.ts +10 -0
  34. package/dist/src/components/carousel/Carousel.d.ts +1 -1
  35. package/dist/src/components/carousel/hooks.d.ts +1 -0
  36. package/dist/src/components/checkbox/Checkbox.d.ts +3 -1
  37. package/dist/src/components/clickable/Clickable.d.ts +1 -0
  38. package/dist/src/components/code/Code.d.ts +9 -0
  39. package/dist/src/components/code/hooks.d.ts +8 -0
  40. package/dist/src/components/code/index.d.ts +1 -0
  41. package/dist/src/components/code/variants.d.ts +7 -0
  42. package/dist/src/components/code-block/CodeBlock.d.ts +2 -1
  43. package/dist/src/components/code-block/classes.d.ts +5 -0
  44. package/dist/src/components/code-block/constants.d.ts +2 -3
  45. package/dist/src/components/code-block/format.d.ts +3 -1
  46. package/dist/src/components/code-block/hooks.d.ts +1 -0
  47. package/dist/src/components/code-block/tokenize.d.ts +14 -3
  48. package/dist/src/components/code-block/types.d.ts +36 -10
  49. package/dist/src/components/drawer/Drawer.d.ts +35 -0
  50. package/dist/src/components/drawer/hooks.d.ts +23 -0
  51. package/dist/src/components/drawer/index.d.ts +1 -0
  52. package/dist/src/components/dropdown-menu/DropdownContext.d.ts +16 -0
  53. package/dist/src/components/dropdown-menu/DropdownMenu.d.ts +9 -0
  54. package/dist/src/components/dropdown-menu/DropdownMenuBody.d.ts +6 -0
  55. package/dist/src/components/dropdown-menu/DropdownMenuOption.d.ts +7 -0
  56. package/dist/src/components/dropdown-menu/DropdownMenuSub.d.ts +6 -0
  57. package/dist/src/components/dropdown-menu/factories.d.ts +7 -0
  58. package/dist/src/components/dropdown-menu/hooks.d.ts +12 -0
  59. package/dist/src/components/dropdown-menu/index.d.ts +3 -0
  60. package/dist/src/components/dropdown-menu/types.d.ts +26 -0
  61. package/dist/src/components/dynamic-list/DynamicList.d.ts +41 -0
  62. package/dist/src/components/dynamic-list/hooks.d.ts +19 -0
  63. package/dist/src/components/dynamic-list/index.d.ts +2 -0
  64. package/dist/src/components/dynamic-list/markers.d.ts +8 -0
  65. package/dist/src/components/dynamic-list/variants.d.ts +4 -0
  66. package/dist/src/components/error-boundary/ErrorBoundary.d.ts +25 -0
  67. package/dist/src/components/error-boundary/index.d.ts +1 -0
  68. package/dist/src/components/error-boundary/variants.d.ts +11 -0
  69. package/dist/src/components/form/Form.d.ts +5 -0
  70. package/dist/src/components/form/factories.d.ts +8 -0
  71. package/dist/src/components/form/hooks.d.ts +9 -0
  72. package/dist/src/components/form/index.d.ts +3 -0
  73. package/dist/src/components/form/types.d.ts +81 -0
  74. package/dist/src/components/form/variants.d.ts +29 -0
  75. package/dist/src/components/index.d.ts +12 -1
  76. package/dist/src/components/popover/Popover.d.ts +22 -0
  77. package/dist/src/components/popover/hooks.d.ts +12 -0
  78. package/dist/src/components/popover/index.d.ts +2 -0
  79. package/dist/src/components/popover/variants.d.ts +3 -0
  80. package/dist/src/components/radiogroup/RadioGroupItem.d.ts +1 -0
  81. package/dist/src/components/scroll-area/hooks.d.ts +1 -0
  82. package/dist/src/components/table/Table.d.ts +63 -0
  83. package/dist/src/components/table/hooks.d.ts +28 -0
  84. package/dist/src/components/table/index.d.ts +2 -0
  85. package/dist/src/components/table/variants.d.ts +14 -0
  86. package/dist/src/components/tabs/TabsContent.d.ts +1 -0
  87. package/dist/src/components/tabs/TabsContext.d.ts +1 -0
  88. package/dist/src/components/tabs/TabsList.d.ts +1 -0
  89. package/dist/src/components/tabs/TabsTrigger.d.ts +1 -0
  90. package/dist/src/components/tooltip/hooks.d.ts +1 -0
  91. package/dist/src/hooks/index.d.ts +1 -0
  92. package/dist/src/hooks/useActionModal.d.ts +1 -0
  93. package/dist/src/hooks/useScreenSize.d.ts +15 -0
  94. package/dist/src/hooks/useToast.d.ts +1 -0
  95. package/dist/src/symbols/ChevronUp.d.ts +2 -0
  96. package/dist/src/symbols/DeepRing.d.ts +2 -0
  97. package/dist/src/symbols/GripVertical.d.ts +2 -0
  98. package/dist/src/symbols/Plus.d.ts +2 -0
  99. package/dist/src/symbols/Trash.d.ts +2 -0
  100. package/dist/src/symbols/index.d.ts +5 -0
  101. package/dist/src/symbols/props.d.ts +1 -0
  102. package/dist/src/utils/index.d.ts +1 -0
  103. package/dist/src/utils/mergeRefs.d.ts +2 -0
  104. package/dist/symbols.cjs.js +1 -1
  105. package/dist/symbols.esm.js +22 -17
  106. package/dist/theme.css +5 -2
  107. package/dist/useScreenSize-DiuQZBHb.js +32 -0
  108. package/dist/useScreenSize-DiuQZBHb.js.map +1 -0
  109. package/dist/useScreenSize-UGyolnfn.cjs +2 -0
  110. package/dist/useScreenSize-UGyolnfn.cjs.map +1 -0
  111. package/dist/utils.cjs.js +1 -1
  112. package/dist/utils.cjs.js.map +1 -1
  113. package/dist/utils.esm.js +14 -6
  114. package/dist/utils.esm.js.map +1 -1
  115. package/package.json +1 -1
  116. package/dist/Toast-BmbmaxkI.cjs +0 -2
  117. package/dist/Toast-BmbmaxkI.cjs.map +0 -1
  118. package/dist/Toast-J2t6S1Yp.js +0 -426
  119. package/dist/Toast-J2t6S1Yp.js.map +0 -1
  120. package/dist/Window-7myUuX6Y.js.map +0 -1
  121. package/dist/Window-DvRXD7fx.cjs +0 -2
  122. package/dist/Window-DvRXD7fx.cjs.map +0 -1
  123. package/dist/src/components/carousel/useScreenSize.d.ts +0 -15
  124. package/dist/src/components/slot/Slot.d.ts +0 -7
  125. package/dist/src/components/slot/index.d.ts +0 -1
@@ -0,0 +1,597 @@
1
+ import { jsx as t, Fragment as q, jsxs as v } from "react/jsx-runtime";
2
+ import g, { createContext as l, useId as $, useState as x, useEffect as h, useRef as H, useCallback as T, useMemo as L, useContext as j } from "react";
3
+ import { createPortal as K } from "react-dom";
4
+ import { X as P, C as V, E as _, I as F } from "./X-CIoyLewf.js";
5
+ import { j as X } from "./join-BmgR_f4v.js";
6
+ function y(...e) {
7
+ return e.filter((r) => typeof r == "string" && r).join(" ").trim() || void 0;
8
+ }
9
+ function Z({ size: e = 15, color: r = "currentColor", className: u = "inline", ...n }) {
10
+ return /* @__PURE__ */ t(
11
+ "svg",
12
+ {
13
+ ...n,
14
+ width: e,
15
+ height: e,
16
+ className: u,
17
+ viewBox: "0 0 15 15",
18
+ xmlns: "http://www.w3.org/2000/svg",
19
+ children: /* @__PURE__ */ t(
20
+ "path",
21
+ {
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: r,
24
+ fillRule: "evenodd",
25
+ clipRule: "evenodd"
26
+ }
27
+ )
28
+ }
29
+ );
30
+ }
31
+ function N(...e) {
32
+ return e.filter((r) => typeof r == "string" && r).join(" ").trim() || void 0;
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
+ 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);
149
+ l(null);
150
+ l(null);
151
+ l(null);
152
+ l(null);
153
+ l(null);
154
+ l(null);
155
+ l(null);
156
+ l(null);
157
+ l(null);
158
+ l(null);
159
+ l(null);
160
+ l(null);
161
+ l(null);
162
+ l(null);
163
+ l(null);
164
+ l(null);
165
+ l(null);
166
+ l(null);
167
+ l(null);
168
+ l(null);
169
+ l(null);
170
+ l(null);
171
+ l(null);
172
+ l(null);
173
+ l(null);
174
+ l(null);
175
+ l(null);
176
+ l(null);
177
+ l(void 0);
178
+ l(void 0);
179
+ l(null);
180
+ l(null);
181
+ l(void 0);
182
+ l(void 0);
183
+ l(null);
184
+ l(null);
185
+ l(void 0);
186
+ l(void 0);
187
+ l(null);
188
+ l(null);
189
+ l(void 0);
190
+ l(void 0);
191
+ l(null);
192
+ l(null);
193
+ l(void 0);
194
+ l(void 0);
195
+ l(null);
196
+ l(null);
197
+ l(void 0);
198
+ l(void 0);
199
+ l(null);
200
+ l(null);
201
+ l(void 0);
202
+ l(void 0);
203
+ l(null);
204
+ l(null);
205
+ l(void 0);
206
+ l(void 0);
207
+ l(null);
208
+ l(null);
209
+ l(void 0);
210
+ l(void 0);
211
+ l(null);
212
+ l(null);
213
+ l(void 0);
214
+ l(void 0);
215
+ l(null);
216
+ l(null);
217
+ l(void 0);
218
+ l(void 0);
219
+ function G() {
220
+ const [e, r] = x(0);
221
+ return h(() => {
222
+ const u = setInterval(() => {
223
+ r((n) => (n + 1) % 3);
224
+ }, 500);
225
+ return () => clearInterval(u);
226
+ }, []), /* @__PURE__ */ t("div", { className: "absolute inset-0 inline-flex items-center justify-center gap-x-2 align-middle", children: [0, 1, 2].map((u) => /* @__PURE__ */ t(
227
+ "div",
228
+ {
229
+ className: y(
230
+ "rounded-full transition-all duration-500 ease-in-out size-[0.35em] bg-current",
231
+ e === u && "transform -translate-y-1"
232
+ )
233
+ },
234
+ u
235
+ )) });
236
+ }
237
+ const J = {
238
+ base: "",
239
+ primary: "bg-primary text-primary-foreground hover:bg-primary/85 disabled:bg-muted disabled:text-muted-foreground",
240
+ secondary: "bg-secondary text-secondary-foreground hover:bg-secondary/85 disabled:bg-muted/80 disabled:text-muted-foreground/80",
241
+ tertiary: "text-primary hover:text-primary-foreground disabled:text-muted",
242
+ outline: "border border-primary text-primary hover:border-primary-foreground hover:text-primary-foreground disabled:border-muted disabled:text-muted",
243
+ link: "underline-offset-4 hover:underline disabled:underline disabled:text-muted",
244
+ destructive: "bg-destructive text-destructive-foreground hover:bg-destructive/85 disabled:bg-muted disabled:text-muted-foreground"
245
+ }, Q = {
246
+ stripped: "",
247
+ fitted: "size-fit leading-0",
248
+ sm: "px-2 py-1 text-sm",
249
+ md: "px-4 py-2 text-base",
250
+ lg: "px-6 py-3 text-lg",
251
+ icon: "p-1 w-fit aspect-square",
252
+ full: "p-2 w-full"
253
+ }, U = {
254
+ none: "rounded-none",
255
+ sm: "rounded-sm",
256
+ md: "rounded-md",
257
+ lg: "rounded-lg",
258
+ full: "rounded-full"
259
+ }, k = {
260
+ variant: "primary",
261
+ size: "md",
262
+ rounded: "md"
263
+ };
264
+ function W({
265
+ variant: e = k.variant,
266
+ size: r,
267
+ rounded: u = k.rounded,
268
+ loading: n,
269
+ className: o,
270
+ ...i
271
+ }) {
272
+ let d;
273
+ e === "link" && !r ? d = "fitted" : d = r || k.size;
274
+ const s = y(
275
+ "appearance-none focus:outline-none focus:ring not-disabled:hover:cursor-pointer disabled:opacity-50 disabled:cursor-not-allowed transition-all",
276
+ J[e],
277
+ Q[d],
278
+ U[u],
279
+ n && "relative pointer-events-none",
280
+ o
281
+ );
282
+ if (i.href && !i.disabled)
283
+ return /* @__PURE__ */ t(
284
+ "a",
285
+ {
286
+ ...i,
287
+ rel: i.rel ? i.rel : i.target === "_blank" ? "noopener noreferrer" : void 0,
288
+ "aria-label": i["aria-label"],
289
+ "aria-description": i["aria-description"],
290
+ href: i.href,
291
+ className: s,
292
+ children: i.children
293
+ }
294
+ );
295
+ const a = i, c = () => a.children ? typeof a.children == "string" || typeof a.children == "number" || typeof a.children == "boolean" ? /* @__PURE__ */ t("span", { className: y(n && "invisible"), children: a.children }) : g.Children.map(a.children, (m, f) => {
296
+ if (g.isValidElement(m)) {
297
+ const b = m.props;
298
+ return g.cloneElement(m, {
299
+ key: f,
300
+ className: y(n && "invisible", b.className)
301
+ });
302
+ }
303
+ return m;
304
+ }) : null;
305
+ return /* @__PURE__ */ v(
306
+ "button",
307
+ {
308
+ ...a,
309
+ "aria-label": a["aria-label"],
310
+ "aria-description": a["aria-description"],
311
+ "aria-disabled": a.disabled || n,
312
+ "aria-busy": n,
313
+ type: a.type ?? "button",
314
+ className: s,
315
+ children: [
316
+ n && /* @__PURE__ */ t(G, {}),
317
+ c()
318
+ ]
319
+ }
320
+ );
321
+ }
322
+ function Y(e) {
323
+ const [r, u] = x(!1), [n, o] = x(!1);
324
+ return h(() => {
325
+ e ? (o(!0), setTimeout(() => u(!0), 10)) : (u(!1), setTimeout(() => o(!1), 150));
326
+ }, [e]), { show: r, shouldRender: n };
327
+ }
328
+ function R(e, r) {
329
+ h(() => {
330
+ const u = (n) => {
331
+ n.key === "Escape" && e && r();
332
+ };
333
+ return document.addEventListener("keydown", u), e && (document.body.style.overflow = "hidden"), () => {
334
+ document.removeEventListener("keydown", u), document.body.style.overflow = "auto";
335
+ };
336
+ }, [e, r]);
337
+ }
338
+ function ll(e, r) {
339
+ const u = H(null), n = T(() => {
340
+ const o = document.getElementById(e);
341
+ if (!o) return;
342
+ const i = o.querySelectorAll('[data-modal-action="true"]');
343
+ if (i.length > 0) {
344
+ i[0].focus();
345
+ return;
346
+ }
347
+ const d = o.querySelectorAll(
348
+ 'button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])'
349
+ );
350
+ if (d.length > 0) {
351
+ const s = Array.from(d).filter((a) => !(a instanceof HTMLButtonElement && a.getAttribute("data-modal-close-button") === "true"));
352
+ if (s.length > 0) {
353
+ s[0].focus();
354
+ return;
355
+ }
356
+ d[0].focus();
357
+ return;
358
+ }
359
+ o.focus();
360
+ }, [e]);
361
+ h(() => (r && (u.current = document.activeElement, n()), () => {
362
+ document.body.style.overflow = "auto", u.current instanceof HTMLElement && u.current.focus();
363
+ }), [r, n]);
364
+ }
365
+ function el({
366
+ id: e,
367
+ isOpen: r,
368
+ onClose: u,
369
+ title: n,
370
+ children: o,
371
+ contentOnly: i = !1,
372
+ className: d,
373
+ overlayClassName: s,
374
+ hideCloseButton: a = !1,
375
+ actions: c = [],
376
+ disableCloseOnOverlayClick: m = !1,
377
+ ariaLabelledBy: f,
378
+ ariaDescribedBy: b
379
+ }) {
380
+ const p = $(), C = e || `modal-${p}`, E = e ? `${e}-title` : `modal-title-${p}`, { show: I, shouldRender: w } = Y(r);
381
+ if (ll(C, w), R(w, u), !w) return null;
382
+ const M = () => n ? g.isValidElement(n) ? /* @__PURE__ */ t("div", { className: "mb-4", children: n }) : /* @__PURE__ */ t("h2", { className: "mb-4 text-xl font-semibold", id: E, children: n }) : null, A = () => 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((B, D) => {
383
+ const { label: O, ...S } = B;
384
+ return /* @__PURE__ */ t(W, { ...S, "data-modal-action": "true", children: O }, D);
385
+ }) });
386
+ return /* @__PURE__ */ t(q, { children: K(
387
+ /* @__PURE__ */ t(
388
+ "div",
389
+ {
390
+ "aria-labelledby": f ?? n ? E : void 0,
391
+ "aria-describedby": b,
392
+ role: "dialog",
393
+ "aria-modal": "true",
394
+ className: "fixed inset-0 z-[100] overflow-y-auto",
395
+ children: /* @__PURE__ */ v("div", { className: "flex min-h-screen items-center justify-center p-4", children: [
396
+ /* @__PURE__ */ t(
397
+ "div",
398
+ {
399
+ className: N("fixed inset-0 bg-black/20 transition-all", s),
400
+ onClick: () => {
401
+ m || u();
402
+ }
403
+ }
404
+ ),
405
+ i && /* @__PURE__ */ t("div", { className: N("relative w-fit", d), children: o }),
406
+ !i && /* @__PURE__ */ v(
407
+ "div",
408
+ {
409
+ id: C,
410
+ tabIndex: -1,
411
+ className: N(
412
+ "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",
413
+ I ? "opacity-100 scale-100" : "opacity-0 scale-90",
414
+ d
415
+ ),
416
+ children: [
417
+ !a && /* @__PURE__ */ t(
418
+ "button",
419
+ {
420
+ type: "button",
421
+ onClick: u,
422
+ "data-modal-close-button": "true",
423
+ 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",
424
+ children: /* @__PURE__ */ t(Z, { size: 18 })
425
+ }
426
+ ),
427
+ M(),
428
+ o,
429
+ A()
430
+ ]
431
+ }
432
+ )
433
+ ] })
434
+ }
435
+ ),
436
+ document.body
437
+ ) });
438
+ }
439
+ function dl({
440
+ type: e,
441
+ message: r,
442
+ cancelText: u,
443
+ confirmText: n,
444
+ onConfirm: o,
445
+ onClose: i,
446
+ destructive: d = !1,
447
+ title: s,
448
+ ...a
449
+ }) {
450
+ const c = L(() => e === "confirm" ? {
451
+ confirm: n || "Confirm",
452
+ cancel: u || "Cancel",
453
+ defaultTitle: s || "Confirm Action"
454
+ } : {
455
+ confirm: n || "OK",
456
+ cancel: null,
457
+ defaultTitle: s || "Alert"
458
+ }, [e, n, s, u]), m = L(
459
+ () => [
460
+ ...c.cancel ? [
461
+ {
462
+ label: c.cancel,
463
+ variant: "secondary",
464
+ onClick: i
465
+ }
466
+ ] : [],
467
+ {
468
+ label: c.confirm,
469
+ variant: d ? "destructive" : "primary",
470
+ onClick: () => {
471
+ o == null || o(), i();
472
+ }
473
+ }
474
+ ],
475
+ [c, d, o, i]
476
+ );
477
+ return /* @__PURE__ */ t(
478
+ el,
479
+ {
480
+ ...a,
481
+ title: s || c.defaultTitle,
482
+ onClose: i,
483
+ actions: m,
484
+ disableCloseOnOverlayClick: e === "confirm",
485
+ hideCloseButton: e === "confirm",
486
+ children: typeof r == "string" ? /* @__PURE__ */ t("p", { className: "text-sm", children: r }) : r
487
+ }
488
+ );
489
+ }
490
+ const nl = l(null), sl = () => {
491
+ const e = j(nl);
492
+ if (!e)
493
+ throw new Error("DropdownMenu components must be used within a DropdownMenu component");
494
+ return e;
495
+ }, tl = l(null), cl = () => {
496
+ const e = j(tl);
497
+ if (!e)
498
+ throw new Error("Tabs components must be used within a Tabs component");
499
+ return e;
500
+ }, z = {
501
+ info: {
502
+ className: "bg-blue-50 border-blue-200 text-blue-900 dark:bg-blue-800 dark:border-blue-950 dark:text-blue-100",
503
+ icon: /* @__PURE__ */ t(F, { size: 20 })
504
+ },
505
+ warning: {
506
+ className: "bg-yellow-50 border-yellow-200 text-yellow-900 dark:bg-yellow-800 dark:border-yellow-950 dark:text-yellow-100",
507
+ icon: /* @__PURE__ */ t(_, { size: 20 })
508
+ },
509
+ error: {
510
+ className: "bg-red-50 border-red-200 text-red-900 dark:bg-red-800 dark:border-red-950 dark:text-red-100",
511
+ icon: /* @__PURE__ */ t(V, { size: 20 })
512
+ }
513
+ };
514
+ function ml({
515
+ id: e,
516
+ title: r,
517
+ description: u,
518
+ type: n = "info",
519
+ action: o,
520
+ duration: i = 5e3,
521
+ onRemove: d,
522
+ customTypes: s,
523
+ customComponent: a
524
+ }) {
525
+ const [c, m] = x(!1), f = T(() => {
526
+ m(!0), setTimeout(() => {
527
+ d == null || d(e);
528
+ }, 150);
529
+ }, [e, d]);
530
+ if (h(() => {
531
+ if (i > 0) {
532
+ const p = setTimeout(() => {
533
+ f();
534
+ }, i);
535
+ return () => clearTimeout(p);
536
+ }
537
+ }, [i, e, d, f]), a)
538
+ return /* @__PURE__ */ t(
539
+ a,
540
+ {
541
+ id: e,
542
+ title: r,
543
+ description: u,
544
+ type: n,
545
+ action: o,
546
+ duration: i,
547
+ onRemove: d
548
+ }
549
+ );
550
+ const b = (s == null ? void 0 : s[n]) || z[n] || z.info;
551
+ return /* @__PURE__ */ v(
552
+ "div",
553
+ {
554
+ role: n === "error" ? "alert" : "status",
555
+ "aria-live": n === "error" ? void 0 : "polite",
556
+ className: X(
557
+ "relative flex items-start p-4 rounded-lg border shadow-lg transition-all duration-150 ease-in-out",
558
+ o && "pb-3",
559
+ b.className,
560
+ c ? "opacity-0 translate-x-full" : "opacity-100 translate-x-0"
561
+ ),
562
+ children: [
563
+ /* @__PURE__ */ t("div", { className: "flex-shrink-0 mr-3", children: b.icon }),
564
+ /* @__PURE__ */ v("div", { className: "flex-grow min-w-0", children: [
565
+ /* @__PURE__ */ t("div", { className: "font-medium text-sm leading-5", children: r }),
566
+ u && /* @__PURE__ */ t("div", { className: "mt-1 text-sm opacity-90 leading-5", children: u }),
567
+ o && /* @__PURE__ */ t("div", { className: "mt-1.5", children: /* @__PURE__ */ t(
568
+ "button",
569
+ {
570
+ onClick: o.onClick,
571
+ 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",
572
+ children: o.label
573
+ }
574
+ ) })
575
+ ] }),
576
+ /* @__PURE__ */ t(
577
+ "button",
578
+ {
579
+ onClick: f,
580
+ 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",
581
+ children: /* @__PURE__ */ t(P, { size: 16 })
582
+ }
583
+ )
584
+ ]
585
+ }
586
+ );
587
+ }
588
+ export {
589
+ dl as A,
590
+ nl as D,
591
+ ml as T,
592
+ tl as a,
593
+ cl as b,
594
+ y as n,
595
+ sl as u
596
+ };
597
+ //# sourceMappingURL=Toast-BAn23LHw.js.map