@moondreamsdev/dreamer-ui 1.7.10-test.99 → 1.7.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.
Files changed (111) hide show
  1. package/README.md +2 -11
  2. package/dist/Toast-DUpf_XxS.js +754 -0
  3. package/dist/Toast-DUpf_XxS.js.map +1 -0
  4. package/dist/Toast-Dj3X8g0Q.cjs +2 -0
  5. package/dist/Toast-Dj3X8g0Q.cjs.map +1 -0
  6. package/dist/Window-U9c7lCJ4.cjs +2 -0
  7. package/dist/Window-U9c7lCJ4.cjs.map +1 -0
  8. package/dist/{Window-uX5BuBwi.js → Window-bavT8vOT.js} +141 -21
  9. package/dist/Window-bavT8vOT.js.map +1 -0
  10. package/dist/components.cjs.js +2 -2
  11. package/dist/components.cjs.js.map +1 -1
  12. package/dist/components.esm.js +4250 -2867
  13. package/dist/components.esm.js.map +1 -1
  14. package/dist/hooks.cjs.js +1 -1
  15. package/dist/hooks.esm.js +6 -4
  16. package/dist/hooks.esm.js.map +1 -1
  17. package/dist/providers.cjs.js +1 -1
  18. package/dist/providers.esm.js +2 -2
  19. package/dist/src/components/accordion/Accordion.d.ts +36 -0
  20. package/dist/src/components/accordion/AccordionItem.d.ts +20 -0
  21. package/dist/src/components/actionmodal/ActionModal.d.ts +34 -0
  22. package/dist/src/components/avatar/Avatar.d.ts +24 -8
  23. package/dist/src/components/badge/Badge.d.ts +24 -2
  24. package/dist/src/components/button/Button.d.ts +22 -1
  25. package/dist/src/components/button/LoadingDots.d.ts +9 -0
  26. package/dist/src/components/button/variants.d.ts +4 -1
  27. package/dist/src/components/calendar/Calendar.d.ts +105 -0
  28. package/dist/src/components/calendar/hooks.d.ts +40 -0
  29. package/dist/src/components/calendar/index.d.ts +2 -0
  30. package/dist/src/components/calendar/variants.d.ts +41 -0
  31. package/dist/src/components/callout/Callout.d.ts +31 -10
  32. package/dist/src/components/card/Card.d.ts +29 -7
  33. package/dist/src/components/carousel/Carousel.d.ts +24 -1
  34. package/dist/src/components/checkbox/Checkbox.d.ts +37 -1
  35. package/dist/src/components/clickable/Clickable.d.ts +28 -0
  36. package/dist/src/components/code/Code.d.ts +18 -0
  37. package/dist/src/components/code-block/CodeBlock.d.ts +35 -10
  38. package/dist/src/components/code-block/classes.d.ts +2 -1
  39. package/dist/src/components/code-block/format.d.ts +2 -1
  40. package/dist/src/components/code-block/index.d.ts +1 -1
  41. package/dist/src/components/code-block/tokenize.d.ts +6 -2
  42. package/dist/src/components/code-block/types.d.ts +24 -1
  43. package/dist/src/components/disclosure/Disclosure.d.ts +30 -9
  44. package/dist/src/components/drawer/Drawer.d.ts +35 -10
  45. package/dist/src/components/dropdown-menu/DropdownMenu.d.ts +34 -0
  46. package/dist/src/components/dynamic-list/DynamicList.d.ts +68 -0
  47. package/dist/src/components/dynamic-list/hooks.d.ts +19 -0
  48. package/dist/src/components/dynamic-list/index.d.ts +2 -0
  49. package/dist/src/components/dynamic-list/markers.d.ts +8 -0
  50. package/dist/src/components/dynamic-list/variants.d.ts +4 -0
  51. package/dist/src/components/error-boundary/ErrorBoundary.d.ts +32 -9
  52. package/dist/src/components/form/Form.d.ts +28 -0
  53. package/dist/src/components/form/factories.d.ts +8 -0
  54. package/dist/src/components/form/hooks.d.ts +9 -0
  55. package/dist/src/components/form/index.d.ts +3 -0
  56. package/dist/src/components/form/types.d.ts +91 -0
  57. package/dist/src/components/form/variants.d.ts +32 -0
  58. package/dist/src/components/help-icon/HelpIcon.d.ts +48 -0
  59. package/dist/src/components/help-icon/index.d.ts +1 -0
  60. package/dist/src/components/index.d.ts +5 -1
  61. package/dist/src/components/input/Input.d.ts +30 -0
  62. package/dist/src/components/input/variants.d.ts +2 -0
  63. package/dist/src/components/label/Label.d.ts +33 -0
  64. package/dist/src/components/modal/Modal.d.ts +47 -1
  65. package/dist/src/components/pagination/Pagination.d.ts +36 -4
  66. package/dist/src/components/popover/Popover.d.ts +53 -3
  67. package/dist/src/components/radiogroup/RadioGroup.d.ts +33 -0
  68. package/dist/src/components/radiogroup/RadioGroupItem.d.ts +9 -0
  69. package/dist/src/components/scroll-area/ScrollArea.d.ts +25 -0
  70. package/dist/src/components/select/Select.d.ts +49 -0
  71. package/dist/src/components/separator/Separator.d.ts +23 -5
  72. package/dist/src/components/skeleton/Skeleton.d.ts +22 -2
  73. package/dist/src/components/skeleton/variants.d.ts +2 -0
  74. package/dist/src/components/slider/Slider.d.ts +46 -10
  75. package/dist/src/components/table/Table.d.ts +96 -0
  76. package/dist/src/components/table/hooks.d.ts +28 -0
  77. package/dist/src/components/table/index.d.ts +2 -0
  78. package/dist/src/components/table/variants.d.ts +14 -0
  79. package/dist/src/components/tabs/Tabs.d.ts +34 -9
  80. package/dist/src/components/textarea/Textarea.d.ts +37 -0
  81. package/dist/src/components/textarea/variants.d.ts +2 -0
  82. package/dist/src/components/toast/Toast.d.ts +39 -0
  83. package/dist/src/components/toggle/Toggle.d.ts +29 -0
  84. package/dist/src/components/tooltip/Tooltip.d.ts +42 -1
  85. package/dist/src/hooks/index.d.ts +1 -0
  86. package/dist/src/{components/carousel → hooks}/useScreenSize.d.ts +4 -4
  87. package/dist/src/symbols/ChevronUp.d.ts +2 -0
  88. package/dist/src/symbols/GripVertical.d.ts +2 -0
  89. package/dist/src/symbols/InfoCircledFilled.d.ts +2 -0
  90. package/dist/src/symbols/Plus.d.ts +2 -0
  91. package/dist/src/symbols/Trash.d.ts +2 -0
  92. package/dist/src/symbols/index.d.ts +5 -0
  93. package/dist/src/symbols/props.d.ts +2 -2
  94. package/dist/symbols.cjs.js +1 -1
  95. package/dist/symbols.esm.js +21 -16
  96. package/dist/theme.css +4 -1
  97. package/dist/useScreenSize-DiuQZBHb.js +32 -0
  98. package/dist/useScreenSize-DiuQZBHb.js.map +1 -0
  99. package/dist/useScreenSize-UGyolnfn.cjs +2 -0
  100. package/dist/useScreenSize-UGyolnfn.cjs.map +1 -0
  101. package/package.json +5 -1
  102. package/dist/Toast-CRG3g8vr.js +0 -512
  103. package/dist/Toast-CRG3g8vr.js.map +0 -1
  104. package/dist/Toast-wRAL8PRi.cjs +0 -2
  105. package/dist/Toast-wRAL8PRi.cjs.map +0 -1
  106. package/dist/Window-5IZnBJt9.cjs +0 -2
  107. package/dist/Window-5IZnBJt9.cjs.map +0 -1
  108. package/dist/Window-uX5BuBwi.js.map +0 -1
  109. package/dist/src/components/slot/Slot.d.ts +0 -7
  110. package/dist/src/components/slot/index.d.ts +0 -1
  111. package/dist/src/components/tooltip/hooks.d.ts +0 -31
@@ -0,0 +1,754 @@
1
+ import { jsx as u, Fragment as q, jsxs as b } from "react/jsx-runtime";
2
+ import g, { createContext as l, useId as F, useState as x, useEffect as p, useRef as H, useCallback as j, useMemo as z, useContext as A } from "react";
3
+ import { createPortal as Z } from "react-dom";
4
+ import { X as V, C as K, E as P, I as Q } from "./X-CIoyLewf.js";
5
+ import { j as X } from "./join-BmgR_f4v.js";
6
+ function y(...n) {
7
+ return n.filter((i) => typeof i == "string" && i).join(" ").trim() || void 0;
8
+ }
9
+ function Y({ size: n = 15, color: i = "currentColor", className: o = "inline", ...e }) {
10
+ return /* @__PURE__ */ u(
11
+ "svg",
12
+ {
13
+ ...e,
14
+ width: n,
15
+ height: n,
16
+ className: o,
17
+ viewBox: "0 0 15 15",
18
+ xmlns: "http://www.w3.org/2000/svg",
19
+ children: /* @__PURE__ */ u(
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: i,
24
+ fillRule: "evenodd",
25
+ clipRule: "evenodd"
26
+ }
27
+ )
28
+ }
29
+ );
30
+ }
31
+ function h(...n) {
32
+ return n.filter((i) => typeof i == "string" && i).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
+ l(null);
220
+ l(null);
221
+ l(void 0);
222
+ l(void 0);
223
+ l(null);
224
+ l(null);
225
+ l(void 0);
226
+ l(void 0);
227
+ l(null);
228
+ l(null);
229
+ l(void 0);
230
+ l(void 0);
231
+ l(null);
232
+ l(null);
233
+ l(void 0);
234
+ l(void 0);
235
+ l(null);
236
+ l(null);
237
+ l(void 0);
238
+ l(void 0);
239
+ l(null);
240
+ l(null);
241
+ l(void 0);
242
+ l(void 0);
243
+ l(null);
244
+ l(null);
245
+ l(void 0);
246
+ l(void 0);
247
+ l(null);
248
+ l(null);
249
+ l(void 0);
250
+ l(void 0);
251
+ l(null);
252
+ l(null);
253
+ l(void 0);
254
+ l(void 0);
255
+ l(null);
256
+ l(null);
257
+ l(void 0);
258
+ l(void 0);
259
+ l(null);
260
+ l(null);
261
+ l(void 0);
262
+ l(void 0);
263
+ l(null);
264
+ l(null);
265
+ l(void 0);
266
+ l(void 0);
267
+ l(null);
268
+ l(null);
269
+ l(void 0);
270
+ l(void 0);
271
+ l(null);
272
+ l(null);
273
+ l(void 0);
274
+ l(void 0);
275
+ l(null);
276
+ l(null);
277
+ l(void 0);
278
+ l(void 0);
279
+ l(null);
280
+ l(null);
281
+ l(void 0);
282
+ l(void 0);
283
+ l(null);
284
+ l(null);
285
+ l(void 0);
286
+ l(void 0);
287
+ l(null);
288
+ l(null);
289
+ l(void 0);
290
+ l(void 0);
291
+ l(null);
292
+ l(null);
293
+ l(void 0);
294
+ l(void 0);
295
+ l(null);
296
+ l(null);
297
+ l(void 0);
298
+ l(void 0);
299
+ l(null);
300
+ l(null);
301
+ l(void 0);
302
+ l(void 0);
303
+ l(null);
304
+ l(null);
305
+ l(void 0);
306
+ l(void 0);
307
+ l(null);
308
+ l(null);
309
+ l(void 0);
310
+ l(void 0);
311
+ l(null);
312
+ l(null);
313
+ l(void 0);
314
+ l(void 0);
315
+ l(null);
316
+ l(null);
317
+ l(void 0);
318
+ l(void 0);
319
+ l(null);
320
+ l(null);
321
+ l(void 0);
322
+ l(void 0);
323
+ l(null);
324
+ l(null);
325
+ l(void 0);
326
+ l(void 0);
327
+ l(null);
328
+ l(null);
329
+ l(void 0);
330
+ l(void 0);
331
+ l(null);
332
+ l(null);
333
+ l(void 0);
334
+ l(void 0);
335
+ l(null);
336
+ l(null);
337
+ l(void 0);
338
+ l(void 0);
339
+ l(null);
340
+ l(null);
341
+ l(void 0);
342
+ l(void 0);
343
+ l(null);
344
+ l(null);
345
+ l(void 0);
346
+ l(void 0);
347
+ l(null);
348
+ l(null);
349
+ l(void 0);
350
+ l(void 0);
351
+ l(null);
352
+ l(null);
353
+ l(void 0);
354
+ l(void 0);
355
+ l(null);
356
+ l(null);
357
+ l(void 0);
358
+ l(void 0);
359
+ l(null);
360
+ l(null);
361
+ l(void 0);
362
+ l(void 0);
363
+ l(null);
364
+ l(null);
365
+ l(void 0);
366
+ l(void 0);
367
+ l(null);
368
+ l(null);
369
+ l(void 0);
370
+ l(void 0);
371
+ l(null);
372
+ l(null);
373
+ l(void 0);
374
+ l(void 0);
375
+ function _() {
376
+ const [n, i] = x(0);
377
+ return p(() => {
378
+ const o = setInterval(() => {
379
+ i((e) => (e + 1) % 3);
380
+ }, 500);
381
+ return () => clearInterval(o);
382
+ }, []), /* @__PURE__ */ u("div", { className: "absolute inset-0 inline-flex items-center justify-center gap-x-2 align-middle", children: [0, 1, 2].map((o) => /* @__PURE__ */ u(
383
+ "div",
384
+ {
385
+ className: y(
386
+ "rounded-full transition-all duration-500 ease-in-out size-[0.35em] bg-current",
387
+ n === o && "transform -translate-y-1"
388
+ )
389
+ },
390
+ o
391
+ )) });
392
+ }
393
+ const G = {
394
+ base: "",
395
+ primary: "bg-primary text-primary-foreground hover:bg-primary/85 disabled:bg-muted disabled:text-muted-foreground",
396
+ secondary: "bg-secondary text-secondary-foreground hover:bg-secondary/85 disabled:bg-muted/80 disabled:text-muted-foreground/80",
397
+ tertiary: "text-primary hover:text-primary-foreground disabled:text-muted",
398
+ outline: "border border-primary text-primary hover:border-primary-foreground hover:text-primary-foreground disabled:border-muted disabled:text-muted",
399
+ link: "underline-offset-4 hover:underline disabled:underline disabled:text-muted",
400
+ destructive: "bg-destructive text-destructive-foreground hover:bg-destructive/85 disabled:bg-muted disabled:text-muted-foreground"
401
+ }, J = {
402
+ stripped: "",
403
+ fitted: "size-fit leading-0",
404
+ sm: "px-2 py-1 text-sm",
405
+ md: "px-4 py-2 text-base",
406
+ lg: "px-6 py-3 text-lg",
407
+ icon: "p-1 w-fit aspect-square",
408
+ full: "p-2 w-full"
409
+ }, U = {
410
+ none: "rounded-none",
411
+ sm: "rounded-sm",
412
+ md: "rounded-md",
413
+ lg: "rounded-lg",
414
+ full: "rounded-full"
415
+ }, k = {
416
+ variant: "primary",
417
+ size: "md",
418
+ rounded: "md"
419
+ };
420
+ function W({
421
+ variant: n = k.variant,
422
+ size: i,
423
+ rounded: o = k.rounded,
424
+ loading: e,
425
+ className: r,
426
+ ...t
427
+ }) {
428
+ let a;
429
+ n === "link" && !i ? a = "fitted" : a = i || k.size;
430
+ const s = y(
431
+ "appearance-none focus:outline-none focus:ring not-disabled:hover:cursor-pointer disabled:opacity-50 disabled:cursor-not-allowed transition-all",
432
+ G[n],
433
+ J[a],
434
+ U[o],
435
+ e && "relative pointer-events-none",
436
+ r
437
+ );
438
+ if (t.href && !t.disabled)
439
+ return /* @__PURE__ */ u(
440
+ "a",
441
+ {
442
+ ...t,
443
+ rel: t.rel ? t.rel : t.target === "_blank" ? "noopener noreferrer" : void 0,
444
+ "aria-label": t["aria-label"],
445
+ "aria-description": t["aria-description"],
446
+ href: t.href,
447
+ className: s,
448
+ children: t.children
449
+ }
450
+ );
451
+ const d = t, c = () => d.children ? typeof d.children == "string" || typeof d.children == "number" || typeof d.children == "boolean" ? /* @__PURE__ */ u("span", { className: y(e && "invisible"), children: d.children }) : g.Children.map(d.children, (v, m) => {
452
+ if (g.isValidElement(v)) {
453
+ const f = v.props;
454
+ return g.cloneElement(v, {
455
+ key: m,
456
+ className: y(e && "invisible", f.className)
457
+ });
458
+ }
459
+ return v;
460
+ }) : null;
461
+ return /* @__PURE__ */ b(
462
+ "button",
463
+ {
464
+ ...d,
465
+ "aria-label": d["aria-label"],
466
+ "aria-description": d["aria-description"],
467
+ "aria-disabled": d.disabled || e,
468
+ "aria-busy": e,
469
+ type: d.type ?? "button",
470
+ className: s,
471
+ children: [
472
+ e && /* @__PURE__ */ u(_, {}),
473
+ c()
474
+ ]
475
+ }
476
+ );
477
+ }
478
+ function R(n) {
479
+ const [i, o] = x(!1), [e, r] = x(!1);
480
+ return p(() => {
481
+ n ? (r(!0), setTimeout(() => o(!0), 10)) : (o(!1), setTimeout(() => r(!1), 150));
482
+ }, [n]), { show: i, shouldRender: e };
483
+ }
484
+ function ll(n, i) {
485
+ p(() => {
486
+ const o = (e) => {
487
+ e.key === "Escape" && n && i();
488
+ };
489
+ return document.addEventListener("keydown", o), n && (document.body.style.overflow = "hidden"), () => {
490
+ document.removeEventListener("keydown", o), document.body.style.overflow = "auto";
491
+ };
492
+ }, [n, i]);
493
+ }
494
+ function nl(n, i) {
495
+ const o = H(null), e = j(() => {
496
+ const r = document.getElementById(n);
497
+ if (!r) return;
498
+ const t = r.querySelectorAll('[data-modal-action="true"]');
499
+ if (t.length > 0) {
500
+ t[0].focus();
501
+ return;
502
+ }
503
+ const a = r.querySelectorAll(
504
+ 'button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])'
505
+ );
506
+ if (a.length > 0) {
507
+ const s = Array.from(a).filter((d) => !(d instanceof HTMLButtonElement && d.getAttribute("data-modal-close-button") === "true"));
508
+ if (s.length > 0) {
509
+ s[0].focus();
510
+ return;
511
+ }
512
+ a[0].focus();
513
+ return;
514
+ }
515
+ r.focus();
516
+ }, [n]);
517
+ p(() => (i && (o.current = document.activeElement, e()), () => {
518
+ document.body.style.overflow = "auto", o.current instanceof HTMLElement && o.current.focus();
519
+ }), [i, e]);
520
+ }
521
+ function el({
522
+ id: n,
523
+ isOpen: i,
524
+ onClose: o,
525
+ title: e,
526
+ children: r,
527
+ contentOnly: t = !1,
528
+ className: a,
529
+ overlayClassName: s,
530
+ containerClassName: d,
531
+ hideCloseButton: c = !1,
532
+ actions: v = [],
533
+ disableCloseOnOverlayClick: m = !1,
534
+ ariaLabelledBy: f,
535
+ ariaDescribedBy: w
536
+ }) {
537
+ const C = F(), E = n || `modal-${C}`, L = n ? `${n}-title` : `modal-title-${C}`, { show: M, shouldRender: N } = R(i);
538
+ if (nl(E, N), ll(N, o), !N) return null;
539
+ const I = () => e ? g.isValidElement(e) ? /* @__PURE__ */ u("div", { className: "mb-4", children: e }) : /* @__PURE__ */ u("h2", { className: "mb-4 text-xl font-semibold", id: L, children: e }) : null, B = () => v.length === 0 ? null : /* @__PURE__ */ u("div", { className: "mt-6 not-sm:grid gap-y-2 sm:flex sm:justify-start sm:flex-row-reverse sm:gap-x-3", children: v.map((D, O) => {
540
+ const { label: S, ...$ } = D;
541
+ return /* @__PURE__ */ u(W, { ...$, "data-modal-action": "true", children: S }, O);
542
+ }) });
543
+ return /* @__PURE__ */ u(q, { children: Z(
544
+ /* @__PURE__ */ u(
545
+ "div",
546
+ {
547
+ "aria-labelledby": f ?? e ? L : void 0,
548
+ "aria-describedby": w,
549
+ role: "dialog",
550
+ "aria-modal": "true",
551
+ className: "fixed inset-0 z-[100] overflow-y-auto",
552
+ children: /* @__PURE__ */ b("div", { className: h("flex min-h-screen items-center justify-center p-4", d), children: [
553
+ /* @__PURE__ */ u(
554
+ "div",
555
+ {
556
+ className: h("fixed inset-0 bg-black/20 transition-all", s),
557
+ onClick: () => {
558
+ m || o();
559
+ }
560
+ }
561
+ ),
562
+ t && /* @__PURE__ */ u("div", { className: h("relative w-fit", a), children: r }),
563
+ !t && /* @__PURE__ */ b(
564
+ "div",
565
+ {
566
+ id: E,
567
+ tabIndex: -1,
568
+ className: h(
569
+ "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",
570
+ M ? "opacity-100 scale-100" : "opacity-0 scale-90",
571
+ a
572
+ ),
573
+ children: [
574
+ !c && /* @__PURE__ */ u(
575
+ "button",
576
+ {
577
+ type: "button",
578
+ onClick: o,
579
+ "data-modal-close-button": "true",
580
+ 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",
581
+ children: /* @__PURE__ */ u(Y, { size: 18 })
582
+ }
583
+ ),
584
+ I(),
585
+ r,
586
+ B()
587
+ ]
588
+ }
589
+ )
590
+ ] })
591
+ }
592
+ ),
593
+ document.body
594
+ ) });
595
+ }
596
+ function sl({
597
+ type: n,
598
+ message: i,
599
+ cancelText: o,
600
+ confirmText: e,
601
+ onConfirm: r,
602
+ onClose: t,
603
+ destructive: a = !1,
604
+ title: s,
605
+ ...d
606
+ }) {
607
+ const c = z(() => n === "confirm" ? {
608
+ confirm: e || "Confirm",
609
+ cancel: o || "Cancel",
610
+ defaultTitle: s || "Confirm Action"
611
+ } : {
612
+ confirm: e || "OK",
613
+ cancel: null,
614
+ defaultTitle: s || "Alert"
615
+ }, [n, e, s, o]), v = z(
616
+ () => [
617
+ ...c.cancel ? [
618
+ {
619
+ label: c.cancel,
620
+ variant: "secondary",
621
+ onClick: t
622
+ }
623
+ ] : [],
624
+ {
625
+ label: c.confirm,
626
+ variant: a ? "destructive" : "primary",
627
+ onClick: () => {
628
+ r == null || r(), t();
629
+ }
630
+ }
631
+ ],
632
+ [c, a, r, t]
633
+ );
634
+ return /* @__PURE__ */ u(
635
+ el,
636
+ {
637
+ ...d,
638
+ title: s || c.defaultTitle,
639
+ onClose: t,
640
+ actions: v,
641
+ disableCloseOnOverlayClick: n === "confirm",
642
+ hideCloseButton: n === "confirm",
643
+ children: typeof i == "string" ? /* @__PURE__ */ u("p", { className: "text-sm", children: i }) : i
644
+ }
645
+ );
646
+ }
647
+ const ul = l(null), cl = () => {
648
+ const n = A(ul);
649
+ if (!n)
650
+ throw new Error("DropdownMenu components must be used within a DropdownMenu component");
651
+ return n;
652
+ }, il = l(null), vl = () => {
653
+ const n = A(il);
654
+ if (!n)
655
+ throw new Error("Tabs components must be used within a Tabs component");
656
+ return n;
657
+ }, T = {
658
+ info: {
659
+ className: "bg-blue-50 border-blue-200 text-blue-900 dark:bg-blue-800 dark:border-blue-950 dark:text-blue-100",
660
+ icon: /* @__PURE__ */ u(Q, { size: 20 })
661
+ },
662
+ warning: {
663
+ className: "bg-yellow-50 border-yellow-200 text-yellow-900 dark:bg-yellow-800 dark:border-yellow-950 dark:text-yellow-100",
664
+ icon: /* @__PURE__ */ u(P, { size: 20 })
665
+ },
666
+ error: {
667
+ className: "bg-red-50 border-red-200 text-red-900 dark:bg-red-800 dark:border-red-950 dark:text-red-100",
668
+ icon: /* @__PURE__ */ u(K, { size: 20 })
669
+ }
670
+ };
671
+ function ml({
672
+ id: n,
673
+ title: i,
674
+ description: o,
675
+ type: e = "info",
676
+ action: r,
677
+ duration: t = 5e3,
678
+ onRemove: a,
679
+ customTypes: s,
680
+ customComponent: d
681
+ }) {
682
+ const [c, v] = x(!1), m = j(() => {
683
+ v(!0), setTimeout(() => {
684
+ a == null || a(n);
685
+ }, 150);
686
+ }, [n, a]);
687
+ if (p(() => {
688
+ if (t > 0) {
689
+ const w = setTimeout(() => {
690
+ m();
691
+ }, t);
692
+ return () => clearTimeout(w);
693
+ }
694
+ }, [t, n, a, m]), d)
695
+ return /* @__PURE__ */ u(
696
+ d,
697
+ {
698
+ id: n,
699
+ title: i,
700
+ description: o,
701
+ type: e,
702
+ action: r,
703
+ duration: t,
704
+ onRemove: a
705
+ }
706
+ );
707
+ const f = (s == null ? void 0 : s[e]) || T[e] || T.info;
708
+ return /* @__PURE__ */ b(
709
+ "div",
710
+ {
711
+ role: e === "error" ? "alert" : "status",
712
+ "aria-live": e === "error" ? void 0 : "polite",
713
+ className: X(
714
+ "relative flex items-start p-4 rounded-lg border shadow-lg transition-all duration-150 ease-in-out",
715
+ r && "pb-3",
716
+ f.className,
717
+ c ? "opacity-0 translate-x-full" : "opacity-100 translate-x-0"
718
+ ),
719
+ children: [
720
+ /* @__PURE__ */ u("div", { className: "flex-shrink-0 mr-3", children: f.icon }),
721
+ /* @__PURE__ */ b("div", { className: "flex-grow min-w-0", children: [
722
+ /* @__PURE__ */ u("div", { className: "font-medium text-sm leading-5", children: i }),
723
+ o && /* @__PURE__ */ u("div", { className: "mt-1 text-sm opacity-90 leading-5", children: o }),
724
+ r && /* @__PURE__ */ u("div", { className: "mt-1.5", children: /* @__PURE__ */ u(
725
+ "button",
726
+ {
727
+ onClick: r.onClick,
728
+ 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",
729
+ children: r.label
730
+ }
731
+ ) })
732
+ ] }),
733
+ /* @__PURE__ */ u(
734
+ "button",
735
+ {
736
+ onClick: m,
737
+ 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",
738
+ children: /* @__PURE__ */ u(V, { size: 16 })
739
+ }
740
+ )
741
+ ]
742
+ }
743
+ );
744
+ }
745
+ export {
746
+ sl as A,
747
+ ul as D,
748
+ ml as T,
749
+ il as a,
750
+ vl as b,
751
+ y as n,
752
+ cl as u
753
+ };
754
+ //# sourceMappingURL=Toast-DUpf_XxS.js.map