@moondreamsdev/dreamer-ui 1.7.10-test.11 → 1.7.10-test.110
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.
- package/dist/Toast-D6zcVVvg.js +524 -0
- package/dist/Toast-D6zcVVvg.js.map +1 -0
- package/dist/Toast-vK28PC0j.cjs +2 -0
- package/dist/Toast-vK28PC0j.cjs.map +1 -0
- package/dist/{Window-DvRXD7fx.cjs → Window-5IZnBJt9.cjs} +2 -2
- package/dist/Window-5IZnBJt9.cjs.map +1 -0
- package/dist/{Window-7myUuX6Y.js → Window-uX5BuBwi.js} +31 -8
- package/dist/Window-uX5BuBwi.js.map +1 -0
- package/dist/components.cjs.js +2 -2
- package/dist/components.cjs.js.map +1 -1
- package/dist/components.esm.js +3889 -2050
- package/dist/components.esm.js.map +1 -1
- package/dist/providers.cjs.js +1 -1
- package/dist/providers.esm.js +1 -1
- package/dist/src/components/avatar/Avatar.d.ts +23 -0
- package/dist/src/components/avatar/icons.d.ts +30 -0
- package/dist/src/components/avatar/index.d.ts +1 -0
- package/dist/src/components/avatar/variants.d.ts +8 -0
- package/dist/src/components/badge/Badge.d.ts +15 -0
- package/dist/src/components/badge/index.d.ts +1 -0
- package/dist/src/components/badge/variants.d.ts +13 -0
- package/dist/src/components/button/Button.d.ts +11 -4
- package/dist/src/components/callout/Callout.d.ts +23 -0
- package/dist/src/components/callout/index.d.ts +1 -0
- package/dist/src/components/callout/variants.d.ts +9 -0
- package/dist/src/components/card/Card.d.ts +29 -0
- package/dist/src/components/card/index.d.ts +1 -0
- package/dist/src/components/card/variants.d.ts +10 -0
- package/dist/src/components/carousel/useScreenSize.d.ts +1 -1
- package/dist/src/components/checkbox/Checkbox.d.ts +2 -1
- package/dist/src/components/code/Code.d.ts +9 -0
- package/dist/src/components/code/hooks.d.ts +8 -0
- package/dist/src/components/code/index.d.ts +1 -0
- package/dist/src/components/code/variants.d.ts +7 -0
- package/dist/src/components/code-block/CodeBlock.d.ts +1 -1
- package/dist/src/components/code-block/classes.d.ts +5 -0
- package/dist/src/components/code-block/constants.d.ts +2 -3
- package/dist/src/components/code-block/format.d.ts +3 -1
- package/dist/src/components/code-block/tokenize.d.ts +14 -3
- package/dist/src/components/code-block/types.d.ts +36 -10
- package/dist/src/components/drawer/Drawer.d.ts +35 -0
- package/dist/src/components/drawer/hooks.d.ts +23 -0
- package/dist/src/components/drawer/index.d.ts +1 -0
- package/dist/src/components/dropdown-menu/DropdownContext.d.ts +16 -0
- package/dist/src/components/dropdown-menu/DropdownMenu.d.ts +9 -0
- package/dist/src/components/dropdown-menu/DropdownMenuBody.d.ts +6 -0
- package/dist/src/components/dropdown-menu/DropdownMenuOption.d.ts +7 -0
- package/dist/src/components/dropdown-menu/DropdownMenuSub.d.ts +6 -0
- package/dist/src/components/dropdown-menu/factories.d.ts +7 -0
- package/dist/src/components/dropdown-menu/hooks.d.ts +12 -0
- package/dist/src/components/dropdown-menu/index.d.ts +3 -0
- package/dist/src/components/dropdown-menu/types.d.ts +26 -0
- package/dist/src/components/error-boundary/ErrorBoundary.d.ts +25 -0
- package/dist/src/components/error-boundary/index.d.ts +1 -0
- package/dist/src/components/error-boundary/variants.d.ts +11 -0
- package/dist/src/components/form/Form.d.ts +5 -0
- package/dist/src/components/form/factories.d.ts +8 -0
- package/dist/src/components/form/hooks.d.ts +9 -0
- package/dist/src/components/form/index.d.ts +3 -0
- package/dist/src/components/form/types.d.ts +81 -0
- package/dist/src/components/form/variants.d.ts +29 -0
- package/dist/src/components/index.d.ts +10 -0
- package/dist/src/components/popover/Popover.d.ts +20 -0
- package/dist/src/components/popover/hooks.d.ts +12 -0
- package/dist/src/components/popover/index.d.ts +2 -0
- package/dist/src/components/popover/variants.d.ts +3 -0
- package/dist/src/symbols/DeepRing.d.ts +2 -0
- package/dist/src/symbols/index.d.ts +1 -0
- package/dist/src/utils/index.d.ts +1 -0
- package/dist/src/utils/mergeRefs.d.ts +2 -0
- package/dist/symbols.cjs.js +1 -1
- package/dist/symbols.esm.js +13 -12
- package/dist/theme.css +5 -2
- package/dist/utils.cjs.js +1 -1
- package/dist/utils.cjs.js.map +1 -1
- package/dist/utils.esm.js +14 -6
- package/dist/utils.esm.js.map +1 -1
- package/package.json +1 -1
- package/dist/Toast-BbAFYlGy.cjs +0 -2
- package/dist/Toast-BbAFYlGy.cjs.map +0 -1
- package/dist/Toast-CYO-13tm.js +0 -424
- package/dist/Toast-CYO-13tm.js.map +0 -1
- package/dist/Window-7myUuX6Y.js.map +0 -1
- package/dist/Window-DvRXD7fx.cjs.map +0 -1
|
@@ -0,0 +1,524 @@
|
|
|
1
|
+
import { jsx as t, Fragment as S, jsxs as b } from "react/jsx-runtime";
|
|
2
|
+
import $, { createContext as l, useId as q, useState as v, useEffect as p, useRef as H, useCallback as L, useMemo as E, useContext as T } from "react";
|
|
3
|
+
import { createPortal as P } from "react-dom";
|
|
4
|
+
import { X, C as F, E as G, I as K } from "./X-CIoyLewf.js";
|
|
5
|
+
import { j as U } from "./join-BmgR_f4v.js";
|
|
6
|
+
function N(...e) {
|
|
7
|
+
return e.filter((r) => typeof r == "string" && r).join(" ").trim() || void 0;
|
|
8
|
+
}
|
|
9
|
+
function V({ size: e = 15, color: r = "currentColor", className: i = "inline", ...n }) {
|
|
10
|
+
return /* @__PURE__ */ t(
|
|
11
|
+
"svg",
|
|
12
|
+
{
|
|
13
|
+
...n,
|
|
14
|
+
width: e,
|
|
15
|
+
height: e,
|
|
16
|
+
className: i,
|
|
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 y(...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
|
+
function Y() {
|
|
156
|
+
const [e, r] = v(0);
|
|
157
|
+
return p(() => {
|
|
158
|
+
const i = setInterval(() => {
|
|
159
|
+
r((n) => (n + 1) % 3);
|
|
160
|
+
}, 500);
|
|
161
|
+
return () => clearInterval(i);
|
|
162
|
+
}, []), /* @__PURE__ */ t("div", { className: "absolute inset-0 inline-flex items-center justify-center gap-x-2 align-middle", children: [0, 1, 2].map((i) => /* @__PURE__ */ t(
|
|
163
|
+
"div",
|
|
164
|
+
{
|
|
165
|
+
className: N(
|
|
166
|
+
"rounded-full transition-all duration-500 ease-in-out size-[0.35em] bg-current",
|
|
167
|
+
e === i && "transform -translate-y-1"
|
|
168
|
+
)
|
|
169
|
+
},
|
|
170
|
+
i
|
|
171
|
+
)) });
|
|
172
|
+
}
|
|
173
|
+
const Z = {
|
|
174
|
+
base: "",
|
|
175
|
+
primary: "bg-primary text-primary-foreground hover:bg-primary/85 disabled:bg-muted disabled:text-muted-foreground",
|
|
176
|
+
secondary: "bg-secondary text-secondary-foreground hover:bg-secondary/85 disabled:bg-muted/80 disabled:text-muted-foreground/80",
|
|
177
|
+
tertiary: "text-primary hover:text-primary-foreground disabled:text-muted",
|
|
178
|
+
outline: "border border-primary text-primary hover:border-primary-foreground hover:text-primary-foreground disabled:border-muted disabled:text-muted",
|
|
179
|
+
link: "underline-offset-4 hover:underline disabled:underline disabled:text-muted",
|
|
180
|
+
destructive: "bg-destructive text-destructive-foreground hover:bg-destructive/85 disabled:bg-muted disabled:text-muted-foreground"
|
|
181
|
+
}, _ = {
|
|
182
|
+
stripped: "",
|
|
183
|
+
fitted: "size-fit",
|
|
184
|
+
sm: "px-2 py-1 text-sm",
|
|
185
|
+
md: "px-4 py-2 text-base",
|
|
186
|
+
lg: "px-6 py-3 text-lg",
|
|
187
|
+
icon: "p-1 w-fit aspect-square",
|
|
188
|
+
full: "p-2 w-full"
|
|
189
|
+
}, J = {
|
|
190
|
+
none: "rounded-none",
|
|
191
|
+
sm: "rounded-sm",
|
|
192
|
+
md: "rounded-md",
|
|
193
|
+
lg: "rounded-lg",
|
|
194
|
+
full: "rounded-full"
|
|
195
|
+
}, w = {
|
|
196
|
+
variant: "primary",
|
|
197
|
+
size: "md",
|
|
198
|
+
rounded: "md"
|
|
199
|
+
};
|
|
200
|
+
function Q({
|
|
201
|
+
variant: e = w.variant,
|
|
202
|
+
size: r,
|
|
203
|
+
rounded: i = w.rounded,
|
|
204
|
+
loading: n,
|
|
205
|
+
className: u,
|
|
206
|
+
...o
|
|
207
|
+
}) {
|
|
208
|
+
let a;
|
|
209
|
+
e === "link" && !r ? a = "fitted" : a = r || w.size;
|
|
210
|
+
const s = N(
|
|
211
|
+
"appearance-none focus:outline-none focus:ring not-disabled:hover:cursor-pointer disabled:opacity-50 disabled:cursor-not-allowed transition-all",
|
|
212
|
+
Z[e],
|
|
213
|
+
_[a],
|
|
214
|
+
J[i],
|
|
215
|
+
n && "relative pointer-events-none",
|
|
216
|
+
u
|
|
217
|
+
);
|
|
218
|
+
if (o.href && !o.disabled)
|
|
219
|
+
return /* @__PURE__ */ t(
|
|
220
|
+
"a",
|
|
221
|
+
{
|
|
222
|
+
...o,
|
|
223
|
+
rel: o.rel ? o.rel : o.target === "_blank" ? "noopener noreferrer" : void 0,
|
|
224
|
+
"aria-label": o["aria-label"],
|
|
225
|
+
"aria-description": o["aria-description"],
|
|
226
|
+
href: o.href,
|
|
227
|
+
className: s,
|
|
228
|
+
children: o.children
|
|
229
|
+
}
|
|
230
|
+
);
|
|
231
|
+
const d = o;
|
|
232
|
+
return /* @__PURE__ */ b(
|
|
233
|
+
"button",
|
|
234
|
+
{
|
|
235
|
+
...d,
|
|
236
|
+
"aria-label": d["aria-label"],
|
|
237
|
+
"aria-description": d["aria-description"],
|
|
238
|
+
"aria-disabled": d.disabled || n,
|
|
239
|
+
"aria-busy": n,
|
|
240
|
+
type: d.type ?? "button",
|
|
241
|
+
className: s,
|
|
242
|
+
children: [
|
|
243
|
+
n && /* @__PURE__ */ t(Y, {}),
|
|
244
|
+
/* @__PURE__ */ t("span", { className: N(n && "invisible"), children: d.children })
|
|
245
|
+
]
|
|
246
|
+
}
|
|
247
|
+
);
|
|
248
|
+
}
|
|
249
|
+
function W(e) {
|
|
250
|
+
const [r, i] = v(!1), [n, u] = v(!1);
|
|
251
|
+
return p(() => {
|
|
252
|
+
e ? (u(!0), setTimeout(() => i(!0), 10)) : (i(!1), setTimeout(() => u(!1), 150));
|
|
253
|
+
}, [e]), { show: r, shouldRender: n };
|
|
254
|
+
}
|
|
255
|
+
function R(e, r) {
|
|
256
|
+
p(() => {
|
|
257
|
+
const i = (n) => {
|
|
258
|
+
n.key === "Escape" && e && r();
|
|
259
|
+
};
|
|
260
|
+
return document.addEventListener("keydown", i), e && (document.body.style.overflow = "hidden"), () => {
|
|
261
|
+
document.removeEventListener("keydown", i), document.body.style.overflow = "auto";
|
|
262
|
+
};
|
|
263
|
+
}, [e, r]);
|
|
264
|
+
}
|
|
265
|
+
function ll(e, r) {
|
|
266
|
+
const i = H(null), n = L(() => {
|
|
267
|
+
const u = document.getElementById(e);
|
|
268
|
+
if (!u) return;
|
|
269
|
+
const o = u.querySelectorAll('[data-modal-action="true"]');
|
|
270
|
+
if (o.length > 0) {
|
|
271
|
+
o[0].focus();
|
|
272
|
+
return;
|
|
273
|
+
}
|
|
274
|
+
const a = u.querySelectorAll(
|
|
275
|
+
'button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])'
|
|
276
|
+
);
|
|
277
|
+
if (a.length > 0) {
|
|
278
|
+
const s = Array.from(a).filter((d) => !(d instanceof HTMLButtonElement && d.getAttribute("data-modal-close-button") === "true"));
|
|
279
|
+
if (s.length > 0) {
|
|
280
|
+
s[0].focus();
|
|
281
|
+
return;
|
|
282
|
+
}
|
|
283
|
+
a[0].focus();
|
|
284
|
+
return;
|
|
285
|
+
}
|
|
286
|
+
u.focus();
|
|
287
|
+
}, [e]);
|
|
288
|
+
p(() => (r && (i.current = document.activeElement, n()), () => {
|
|
289
|
+
document.body.style.overflow = "auto", i.current instanceof HTMLElement && i.current.focus();
|
|
290
|
+
}), [r, n]);
|
|
291
|
+
}
|
|
292
|
+
function el({
|
|
293
|
+
id: e,
|
|
294
|
+
isOpen: r,
|
|
295
|
+
onClose: i,
|
|
296
|
+
title: n,
|
|
297
|
+
children: u,
|
|
298
|
+
contentOnly: o = !1,
|
|
299
|
+
className: a,
|
|
300
|
+
overlayClassName: s,
|
|
301
|
+
hideCloseButton: d = !1,
|
|
302
|
+
actions: c = [],
|
|
303
|
+
disableCloseOnOverlayClick: m = !1,
|
|
304
|
+
ariaLabelledBy: f,
|
|
305
|
+
ariaDescribedBy: g
|
|
306
|
+
}) {
|
|
307
|
+
const h = q(), k = e || `modal-${h}`, C = e ? `${e}-title` : `modal-title-${h}`, { show: j, shouldRender: x } = W(r);
|
|
308
|
+
if (ll(k, x), R(x, i), !x) return null;
|
|
309
|
+
const I = () => n ? $.isValidElement(n) ? /* @__PURE__ */ t("div", { className: "mb-4", children: n }) : /* @__PURE__ */ t("h2", { className: "mb-4 text-xl font-semibold", id: C, children: n }) : null, M = () => 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((A, B) => {
|
|
310
|
+
const { label: O, ...D } = A;
|
|
311
|
+
return /* @__PURE__ */ t(Q, { ...D, "data-modal-action": "true", children: O }, B);
|
|
312
|
+
}) });
|
|
313
|
+
return /* @__PURE__ */ t(S, { children: P(
|
|
314
|
+
/* @__PURE__ */ t(
|
|
315
|
+
"div",
|
|
316
|
+
{
|
|
317
|
+
"aria-labelledby": f ?? n ? C : void 0,
|
|
318
|
+
"aria-describedby": g,
|
|
319
|
+
role: "dialog",
|
|
320
|
+
"aria-modal": "true",
|
|
321
|
+
className: "fixed inset-0 z-[100] overflow-y-auto",
|
|
322
|
+
children: /* @__PURE__ */ b("div", { className: "flex min-h-screen items-center justify-center p-4", children: [
|
|
323
|
+
/* @__PURE__ */ t(
|
|
324
|
+
"div",
|
|
325
|
+
{
|
|
326
|
+
className: y("fixed inset-0 bg-black/20 transition-all", s),
|
|
327
|
+
onClick: () => {
|
|
328
|
+
m || i();
|
|
329
|
+
}
|
|
330
|
+
}
|
|
331
|
+
),
|
|
332
|
+
o && /* @__PURE__ */ t("div", { className: y("relative w-fit", a), children: u }),
|
|
333
|
+
!o && /* @__PURE__ */ b(
|
|
334
|
+
"div",
|
|
335
|
+
{
|
|
336
|
+
id: k,
|
|
337
|
+
tabIndex: -1,
|
|
338
|
+
className: y(
|
|
339
|
+
"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",
|
|
340
|
+
j ? "opacity-100 scale-100" : "opacity-0 scale-90",
|
|
341
|
+
a
|
|
342
|
+
),
|
|
343
|
+
children: [
|
|
344
|
+
!d && /* @__PURE__ */ t(
|
|
345
|
+
"button",
|
|
346
|
+
{
|
|
347
|
+
type: "button",
|
|
348
|
+
onClick: i,
|
|
349
|
+
"data-modal-close-button": "true",
|
|
350
|
+
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",
|
|
351
|
+
children: /* @__PURE__ */ t(V, { size: 18 })
|
|
352
|
+
}
|
|
353
|
+
),
|
|
354
|
+
I(),
|
|
355
|
+
u,
|
|
356
|
+
M()
|
|
357
|
+
]
|
|
358
|
+
}
|
|
359
|
+
)
|
|
360
|
+
] })
|
|
361
|
+
}
|
|
362
|
+
),
|
|
363
|
+
document.body
|
|
364
|
+
) });
|
|
365
|
+
}
|
|
366
|
+
function sl({
|
|
367
|
+
type: e,
|
|
368
|
+
message: r,
|
|
369
|
+
cancelText: i,
|
|
370
|
+
confirmText: n,
|
|
371
|
+
onConfirm: u,
|
|
372
|
+
onClose: o,
|
|
373
|
+
destructive: a = !1,
|
|
374
|
+
title: s,
|
|
375
|
+
...d
|
|
376
|
+
}) {
|
|
377
|
+
const c = E(() => e === "confirm" ? {
|
|
378
|
+
confirm: n || "Confirm",
|
|
379
|
+
cancel: i || "Cancel",
|
|
380
|
+
defaultTitle: s || "Confirm Action"
|
|
381
|
+
} : {
|
|
382
|
+
confirm: n || "OK",
|
|
383
|
+
cancel: null,
|
|
384
|
+
defaultTitle: s || "Alert"
|
|
385
|
+
}, [e, n, s, i]), m = E(
|
|
386
|
+
() => [
|
|
387
|
+
...c.cancel ? [
|
|
388
|
+
{
|
|
389
|
+
label: c.cancel,
|
|
390
|
+
variant: "secondary",
|
|
391
|
+
onClick: o
|
|
392
|
+
}
|
|
393
|
+
] : [],
|
|
394
|
+
{
|
|
395
|
+
label: c.confirm,
|
|
396
|
+
variant: a ? "destructive" : "primary",
|
|
397
|
+
onClick: () => {
|
|
398
|
+
u == null || u(), o();
|
|
399
|
+
}
|
|
400
|
+
}
|
|
401
|
+
],
|
|
402
|
+
[c, a, u, o]
|
|
403
|
+
);
|
|
404
|
+
return /* @__PURE__ */ t(
|
|
405
|
+
el,
|
|
406
|
+
{
|
|
407
|
+
...d,
|
|
408
|
+
title: s || c.defaultTitle,
|
|
409
|
+
onClose: o,
|
|
410
|
+
actions: m,
|
|
411
|
+
disableCloseOnOverlayClick: e === "confirm",
|
|
412
|
+
hideCloseButton: e === "confirm",
|
|
413
|
+
children: typeof r == "string" ? /* @__PURE__ */ t("p", { className: "text-sm", children: r }) : r
|
|
414
|
+
}
|
|
415
|
+
);
|
|
416
|
+
}
|
|
417
|
+
const nl = l(null), dl = () => {
|
|
418
|
+
const e = T(nl);
|
|
419
|
+
if (!e)
|
|
420
|
+
throw new Error("DropdownMenu components must be used within a DropdownMenu component");
|
|
421
|
+
return e;
|
|
422
|
+
}, tl = l(null), cl = () => {
|
|
423
|
+
const e = T(tl);
|
|
424
|
+
if (!e)
|
|
425
|
+
throw new Error("Tabs components must be used within a Tabs component");
|
|
426
|
+
return e;
|
|
427
|
+
}, z = {
|
|
428
|
+
info: {
|
|
429
|
+
className: "bg-blue-50 border-blue-200 text-blue-900 dark:bg-blue-800 dark:border-blue-950 dark:text-blue-100",
|
|
430
|
+
icon: /* @__PURE__ */ t(K, { size: 20 })
|
|
431
|
+
},
|
|
432
|
+
warning: {
|
|
433
|
+
className: "bg-yellow-50 border-yellow-200 text-yellow-900 dark:bg-yellow-800 dark:border-yellow-950 dark:text-yellow-100",
|
|
434
|
+
icon: /* @__PURE__ */ t(G, { size: 20 })
|
|
435
|
+
},
|
|
436
|
+
error: {
|
|
437
|
+
className: "bg-red-50 border-red-200 text-red-900 dark:bg-red-800 dark:border-red-950 dark:text-red-100",
|
|
438
|
+
icon: /* @__PURE__ */ t(F, { size: 20 })
|
|
439
|
+
}
|
|
440
|
+
};
|
|
441
|
+
function ml({
|
|
442
|
+
id: e,
|
|
443
|
+
title: r,
|
|
444
|
+
description: i,
|
|
445
|
+
type: n = "info",
|
|
446
|
+
action: u,
|
|
447
|
+
duration: o = 5e3,
|
|
448
|
+
onRemove: a,
|
|
449
|
+
customTypes: s,
|
|
450
|
+
customComponent: d
|
|
451
|
+
}) {
|
|
452
|
+
const [c, m] = v(!1), f = L(() => {
|
|
453
|
+
m(!0), setTimeout(() => {
|
|
454
|
+
a == null || a(e);
|
|
455
|
+
}, 150);
|
|
456
|
+
}, [e, a]);
|
|
457
|
+
if (p(() => {
|
|
458
|
+
if (o > 0) {
|
|
459
|
+
const h = setTimeout(() => {
|
|
460
|
+
f();
|
|
461
|
+
}, o);
|
|
462
|
+
return () => clearTimeout(h);
|
|
463
|
+
}
|
|
464
|
+
}, [o, e, a, f]), d)
|
|
465
|
+
return /* @__PURE__ */ t(
|
|
466
|
+
d,
|
|
467
|
+
{
|
|
468
|
+
id: e,
|
|
469
|
+
title: r,
|
|
470
|
+
description: i,
|
|
471
|
+
type: n,
|
|
472
|
+
action: u,
|
|
473
|
+
duration: o,
|
|
474
|
+
onRemove: a
|
|
475
|
+
}
|
|
476
|
+
);
|
|
477
|
+
const g = (s == null ? void 0 : s[n]) || z[n] || z.info;
|
|
478
|
+
return /* @__PURE__ */ b(
|
|
479
|
+
"div",
|
|
480
|
+
{
|
|
481
|
+
role: n === "error" ? "alert" : "status",
|
|
482
|
+
"aria-live": n === "error" ? void 0 : "polite",
|
|
483
|
+
className: U(
|
|
484
|
+
"relative flex items-start p-4 rounded-lg border shadow-lg transition-all duration-150 ease-in-out",
|
|
485
|
+
u && "pb-3",
|
|
486
|
+
g.className,
|
|
487
|
+
c ? "opacity-0 translate-x-full" : "opacity-100 translate-x-0"
|
|
488
|
+
),
|
|
489
|
+
children: [
|
|
490
|
+
/* @__PURE__ */ t("div", { className: "flex-shrink-0 mr-3", children: g.icon }),
|
|
491
|
+
/* @__PURE__ */ b("div", { className: "flex-grow min-w-0", children: [
|
|
492
|
+
/* @__PURE__ */ t("div", { className: "font-medium text-sm leading-5", children: r }),
|
|
493
|
+
i && /* @__PURE__ */ t("div", { className: "mt-1 text-sm opacity-90 leading-5", children: i }),
|
|
494
|
+
u && /* @__PURE__ */ t("div", { className: "mt-1.5", children: /* @__PURE__ */ t(
|
|
495
|
+
"button",
|
|
496
|
+
{
|
|
497
|
+
onClick: u.onClick,
|
|
498
|
+
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",
|
|
499
|
+
children: u.label
|
|
500
|
+
}
|
|
501
|
+
) })
|
|
502
|
+
] }),
|
|
503
|
+
/* @__PURE__ */ t(
|
|
504
|
+
"button",
|
|
505
|
+
{
|
|
506
|
+
onClick: f,
|
|
507
|
+
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",
|
|
508
|
+
children: /* @__PURE__ */ t(X, { size: 16 })
|
|
509
|
+
}
|
|
510
|
+
)
|
|
511
|
+
]
|
|
512
|
+
}
|
|
513
|
+
);
|
|
514
|
+
}
|
|
515
|
+
export {
|
|
516
|
+
sl as A,
|
|
517
|
+
nl as D,
|
|
518
|
+
ml as T,
|
|
519
|
+
tl as a,
|
|
520
|
+
cl as b,
|
|
521
|
+
N as n,
|
|
522
|
+
dl as u
|
|
523
|
+
};
|
|
524
|
+
//# sourceMappingURL=Toast-D6zcVVvg.js.map
|