visits-style 2.2.10 → 2.3.0
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/index.es.js
CHANGED
|
@@ -1,42 +1,42 @@
|
|
|
1
1
|
import e from "clsx";
|
|
2
2
|
import { twMerge as t } from "tailwind-merge";
|
|
3
|
-
import {
|
|
4
|
-
import { Fragment as
|
|
5
|
-
import { FloatingOverlay as
|
|
6
|
-
import { createPortal as
|
|
3
|
+
import { createContext as n, createElement as r, forwardRef as i, startTransition as a, useCallback as o, useContext as s, useEffect as c, useImperativeHandle as l, useLayoutEffect as u, useMemo as d, useRef as f, useState as p } from "react";
|
|
4
|
+
import { Fragment as m, jsx as h, jsxs as g } from "react/jsx-runtime";
|
|
5
|
+
import { FloatingOverlay as _, autoUpdate as v, flip as y, offset as b, shift as x, useClick as S, useClientPoint as C, useDismiss as w, useFloating as T, useHover as E, useId as D, useInteractions as O, useTransitionStyles as k } from "@floating-ui/react";
|
|
6
|
+
import { createPortal as A } from "react-dom";
|
|
7
7
|
//#region src/utils/merge.ts
|
|
8
|
-
var
|
|
9
|
-
function
|
|
8
|
+
var j = e;
|
|
9
|
+
function M(e, n) {
|
|
10
10
|
return n ? t(e, n) : e;
|
|
11
11
|
}
|
|
12
12
|
//#endregion
|
|
13
13
|
//#region src/elements/Base.tsx
|
|
14
|
-
function
|
|
15
|
-
let o =
|
|
14
|
+
function N({ as: e, classList: t = [], className: n, override: i, ...a }) {
|
|
15
|
+
let o = d(() => i ? n : M(j(t), n), [
|
|
16
16
|
t,
|
|
17
17
|
n,
|
|
18
|
-
|
|
18
|
+
i
|
|
19
19
|
]);
|
|
20
|
-
return
|
|
20
|
+
return r(e || "div", {
|
|
21
21
|
className: o,
|
|
22
|
-
...
|
|
22
|
+
...a
|
|
23
23
|
});
|
|
24
24
|
}
|
|
25
|
-
function
|
|
26
|
-
let
|
|
27
|
-
let o =
|
|
28
|
-
return
|
|
25
|
+
function P(e, t, n = {}) {
|
|
26
|
+
let i = ({ className: i, ...a }) => {
|
|
27
|
+
let o = d(() => M(t, i), [i]);
|
|
28
|
+
return r(e, {
|
|
29
29
|
className: o,
|
|
30
30
|
...n,
|
|
31
|
-
...
|
|
31
|
+
...a
|
|
32
32
|
});
|
|
33
33
|
};
|
|
34
|
-
return
|
|
34
|
+
return i.displayName = `Styled${typeof e == "string" ? e : "Component"}`, i;
|
|
35
35
|
}
|
|
36
36
|
//#endregion
|
|
37
37
|
//#region src/forms/Field/FormLabel.tsx
|
|
38
|
-
function
|
|
39
|
-
return /* @__PURE__ */
|
|
38
|
+
function F(e) {
|
|
39
|
+
return /* @__PURE__ */ h(N, {
|
|
40
40
|
as: "label",
|
|
41
41
|
classList: ["leading-none peer-disabled:opacity-70"],
|
|
42
42
|
...e
|
|
@@ -44,47 +44,40 @@ function L(e) {
|
|
|
44
44
|
}
|
|
45
45
|
//#endregion
|
|
46
46
|
//#region src/forms/Field/FormField.tsx
|
|
47
|
-
function
|
|
48
|
-
let l =
|
|
49
|
-
return /* @__PURE__ */
|
|
47
|
+
function I({ label: e, render: t, required: n, htmlFor: r, error: i, help: a, helpBefore: o, innerClass: s, ...c }) {
|
|
48
|
+
let l = d(() => j("font-medium", n ? "after:content-[\"*\"] after:text-danger after:text-sm after:pl-0.5" : ""), [n]);
|
|
49
|
+
return /* @__PURE__ */ g(N, {
|
|
50
50
|
classList: "flex flex-col space-y-2",
|
|
51
51
|
...c,
|
|
52
52
|
children: [
|
|
53
|
-
e ? /* @__PURE__ */
|
|
53
|
+
e ? /* @__PURE__ */ h(F, {
|
|
54
54
|
className: l,
|
|
55
55
|
htmlFor: r,
|
|
56
56
|
children: e
|
|
57
57
|
}) : null,
|
|
58
|
-
a && o ? /* @__PURE__ */
|
|
58
|
+
a && o ? /* @__PURE__ */ h("p", {
|
|
59
59
|
className: "text-xs text-muted pb-2",
|
|
60
60
|
children: a
|
|
61
61
|
}) : null,
|
|
62
|
-
/* @__PURE__ */
|
|
62
|
+
/* @__PURE__ */ h("div", {
|
|
63
63
|
className: s,
|
|
64
|
-
children:
|
|
64
|
+
children: t(!!i)
|
|
65
65
|
}),
|
|
66
|
-
a && !o && !i ? /* @__PURE__ */
|
|
66
|
+
a && !o && !i ? /* @__PURE__ */ h("p", {
|
|
67
67
|
className: "text-xs text-muted",
|
|
68
68
|
children: a
|
|
69
69
|
}) : null,
|
|
70
|
-
i ? /* @__PURE__ */
|
|
70
|
+
i ? /* @__PURE__ */ h("p", {
|
|
71
71
|
className: "text-xs text-danger",
|
|
72
72
|
children: i
|
|
73
73
|
}) : null
|
|
74
74
|
]
|
|
75
75
|
});
|
|
76
76
|
}
|
|
77
|
-
function z(e, t) {
|
|
78
|
-
let i = n.count(e);
|
|
79
|
-
if (!i) return null;
|
|
80
|
-
if (i === 1) return r(e, { error: t });
|
|
81
|
-
let a = n.toArray(e);
|
|
82
|
-
return a[0] = r(a[0], { error: t }), a;
|
|
83
|
-
}
|
|
84
77
|
//#endregion
|
|
85
78
|
//#region src/forms/Field/InputField.tsx
|
|
86
|
-
function
|
|
87
|
-
return /* @__PURE__ */
|
|
79
|
+
function L({ error: e, ...t }) {
|
|
80
|
+
return /* @__PURE__ */ h(N, {
|
|
88
81
|
as: "fieldset",
|
|
89
82
|
classList: [
|
|
90
83
|
"flex rounded-md border bg-background px-3 py-2 w-full [&_input]:placeholder:text-muted",
|
|
@@ -96,8 +89,8 @@ function ee({ error: e, ...t }) {
|
|
|
96
89
|
}
|
|
97
90
|
//#endregion
|
|
98
91
|
//#region src/forms/Input/index.tsx
|
|
99
|
-
function
|
|
100
|
-
return /* @__PURE__ */
|
|
92
|
+
function R({ type: e, error: t, ...n }) {
|
|
93
|
+
return /* @__PURE__ */ h(N, {
|
|
101
94
|
as: "input",
|
|
102
95
|
type: e,
|
|
103
96
|
classList: [
|
|
@@ -111,8 +104,8 @@ function B({ type: e, error: t, ...n }) {
|
|
|
111
104
|
}
|
|
112
105
|
//#endregion
|
|
113
106
|
//#region src/forms/Textarea/index.tsx
|
|
114
|
-
function
|
|
115
|
-
return /* @__PURE__ */
|
|
107
|
+
function z({ error: e, ...t }) {
|
|
108
|
+
return /* @__PURE__ */ h(N, {
|
|
116
109
|
as: "textarea",
|
|
117
110
|
classList: [
|
|
118
111
|
"flex rounded-md border bg-background px-3 py-2 w-full",
|
|
@@ -124,13 +117,13 @@ function V({ error: e, ...t }) {
|
|
|
124
117
|
}
|
|
125
118
|
//#endregion
|
|
126
119
|
//#region src/forms/Checkbox/index.tsx
|
|
127
|
-
function
|
|
128
|
-
return /* @__PURE__ */
|
|
120
|
+
function B() {
|
|
121
|
+
return /* @__PURE__ */ h("svg", {
|
|
129
122
|
xmlns: "http://www.w3.org/2000/svg",
|
|
130
123
|
width: "30",
|
|
131
124
|
height: "30",
|
|
132
125
|
viewBox: "0 0 30 30",
|
|
133
|
-
children: /* @__PURE__ */
|
|
126
|
+
children: /* @__PURE__ */ h("rect", {
|
|
134
127
|
width: "20",
|
|
135
128
|
height: "3",
|
|
136
129
|
y: "13.5",
|
|
@@ -141,11 +134,11 @@ function H() {
|
|
|
141
134
|
})
|
|
142
135
|
});
|
|
143
136
|
}
|
|
144
|
-
function
|
|
137
|
+
function V({ checked: e, indeterminate: t, id: n, name: r, onChange: i, value: a, checkIcon: o, error: s, ...c }) {
|
|
145
138
|
let l = () => {
|
|
146
139
|
c.disabled || i?.(!e);
|
|
147
140
|
};
|
|
148
|
-
return /* @__PURE__ */
|
|
141
|
+
return /* @__PURE__ */ g(N, {
|
|
149
142
|
as: "button",
|
|
150
143
|
type: "button",
|
|
151
144
|
role: "checkbox",
|
|
@@ -164,8 +157,8 @@ function U({ checked: e, indeterminate: t, id: n, name: r, onChange: i, value: a
|
|
|
164
157
|
...c,
|
|
165
158
|
children: [
|
|
166
159
|
e ? o : null,
|
|
167
|
-
t && !e ? /* @__PURE__ */
|
|
168
|
-
/* @__PURE__ */
|
|
160
|
+
t && !e ? /* @__PURE__ */ h(B, {}) : null,
|
|
161
|
+
/* @__PURE__ */ h("input", {
|
|
169
162
|
type: "checkbox",
|
|
170
163
|
"aria-hidden": "true",
|
|
171
164
|
name: r,
|
|
@@ -188,52 +181,52 @@ function U({ checked: e, indeterminate: t, id: n, name: r, onChange: i, value: a
|
|
|
188
181
|
}
|
|
189
182
|
//#endregion
|
|
190
183
|
//#region src/hooks/useIsomorphicLayoutEffect.ts
|
|
191
|
-
var
|
|
184
|
+
var H = typeof window < "u" && window.document !== void 0 && window.document.createElement !== void 0 ? u : c;
|
|
192
185
|
//#endregion
|
|
193
186
|
//#region src/components/Portal/index.tsx
|
|
194
|
-
function
|
|
195
|
-
let [r, i] =
|
|
196
|
-
return
|
|
187
|
+
function U({ children: e, container: t, disabled: n }) {
|
|
188
|
+
let [r, i] = p(null);
|
|
189
|
+
return H(() => {
|
|
197
190
|
if (!t) {
|
|
198
191
|
let e = document.getElementById("visits-style-portals");
|
|
199
192
|
return e || (e = document.createElement("div"), e.id = "visits-style-portals", document.body.appendChild(e)), i(e);
|
|
200
193
|
}
|
|
201
194
|
i(t);
|
|
202
|
-
}, [t]), n || !r ? null :
|
|
195
|
+
}, [t]), n || !r ? null : A(e, r);
|
|
203
196
|
}
|
|
204
197
|
//#endregion
|
|
205
198
|
//#region src/utils/stopPropagation.ts
|
|
206
|
-
function
|
|
199
|
+
function W(e) {
|
|
207
200
|
e && (e.stopPropagation(), e.preventDefault());
|
|
208
201
|
}
|
|
209
202
|
//#endregion
|
|
210
203
|
//#region src/components/Popover/index.tsx
|
|
211
|
-
var
|
|
204
|
+
var ee = {
|
|
212
205
|
open: 150,
|
|
213
206
|
close: 75
|
|
214
207
|
};
|
|
215
|
-
function
|
|
208
|
+
function G({ ref: e, position: t, render: n, children: r, disabled: i, offset: a = {
|
|
216
209
|
x: 0,
|
|
217
210
|
y: 6
|
|
218
|
-
}, onOpen:
|
|
219
|
-
let [
|
|
220
|
-
nodeId:
|
|
211
|
+
}, onOpen: s, onClose: u, onManualClose: d, timeout: C = ee, override: w, zIndex: E = 9996, role: A, ...j }) {
|
|
212
|
+
let [M, N] = p(!1), P = D(), F = f(s), I = f(u), { refs: L, floatingStyles: R, context: z } = T({
|
|
213
|
+
nodeId: P,
|
|
221
214
|
placement: t,
|
|
222
215
|
middleware: [
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
mainAxis:
|
|
227
|
-
crossAxis:
|
|
216
|
+
x(),
|
|
217
|
+
y({ fallbackAxisSideDirection: "end" }),
|
|
218
|
+
b({
|
|
219
|
+
mainAxis: a.y,
|
|
220
|
+
crossAxis: a.x
|
|
228
221
|
})
|
|
229
222
|
],
|
|
230
|
-
open:
|
|
223
|
+
open: M,
|
|
231
224
|
onOpenChange: (e) => {
|
|
232
|
-
e ?
|
|
225
|
+
e ? F.current?.(L.reference.current, L.floating.current) : I.current?.(L.reference.current, L.floating.current), N(e);
|
|
233
226
|
},
|
|
234
|
-
whileElementsMounted:
|
|
235
|
-
}), { isMounted:
|
|
236
|
-
duration:
|
|
227
|
+
whileElementsMounted: v
|
|
228
|
+
}), { isMounted: B, styles: V } = k(z, {
|
|
229
|
+
duration: C,
|
|
237
230
|
initial({ side: e }) {
|
|
238
231
|
let t = "";
|
|
239
232
|
return t = e === "top" ? "translateY(5%) scale(0.95)" : e === "bottom" ? "translateY(-5%) scale(0.95)" : e === "left" ? "translateX(5%) scale(0.95)" : "translateX(-5%) scale(0.95)", {
|
|
@@ -241,54 +234,53 @@ function q({ ref: e, position: t, label: i, children: a, disabled: o, offset: s
|
|
|
241
234
|
transform: t
|
|
242
235
|
};
|
|
243
236
|
}
|
|
244
|
-
}),
|
|
245
|
-
if (
|
|
246
|
-
|
|
247
|
-
}, [
|
|
248
|
-
|
|
249
|
-
if (
|
|
250
|
-
}, [
|
|
237
|
+
}), H = o((e) => {
|
|
238
|
+
if (W(e), d) return d();
|
|
239
|
+
N(!1), I.current?.(L.reference.current, L.floating.current);
|
|
240
|
+
}, [d]);
|
|
241
|
+
c(() => {
|
|
242
|
+
if (i && M) return N(!1);
|
|
243
|
+
}, [i, M]), l(e, () => ({
|
|
251
244
|
open: () => {
|
|
252
|
-
|
|
245
|
+
N(!0), F.current?.(L.reference.current, L.floating.current);
|
|
253
246
|
},
|
|
254
247
|
close: () => {
|
|
255
|
-
|
|
248
|
+
N(!1), I.current?.(L.reference.current, L.floating.current);
|
|
256
249
|
}
|
|
257
250
|
}), []);
|
|
258
|
-
let { getFloatingProps:
|
|
259
|
-
return
|
|
260
|
-
ref:
|
|
251
|
+
let { getFloatingProps: G, getReferenceProps: K } = O([S(z, { enabled: !i })]);
|
|
252
|
+
return F.current = s, I.current = u, /* @__PURE__ */ g(m, { children: [n(K({
|
|
253
|
+
ref: L.setReference,
|
|
261
254
|
tabIndex: 0,
|
|
262
|
-
|
|
263
|
-
"aria-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
children: /* @__PURE__ */ _(y, {
|
|
255
|
+
"aria-expanded": M,
|
|
256
|
+
"aria-disabled": i,
|
|
257
|
+
onClick: W
|
|
258
|
+
})), /* @__PURE__ */ h(U, {
|
|
259
|
+
disabled: i || !B,
|
|
260
|
+
children: /* @__PURE__ */ h(_, {
|
|
269
261
|
"data-testid": "vs-popover-shadow",
|
|
270
|
-
onClick:
|
|
271
|
-
style: { zIndex:
|
|
262
|
+
onClick: H,
|
|
263
|
+
style: { zIndex: E },
|
|
272
264
|
autoFocus: !0,
|
|
273
|
-
children: /* @__PURE__ */
|
|
274
|
-
role:
|
|
275
|
-
ref:
|
|
276
|
-
style:
|
|
277
|
-
children: /* @__PURE__ */
|
|
278
|
-
override:
|
|
279
|
-
styles:
|
|
280
|
-
...
|
|
281
|
-
...
|
|
282
|
-
onClick:
|
|
265
|
+
children: /* @__PURE__ */ h("div", {
|
|
266
|
+
role: A || "region",
|
|
267
|
+
ref: L.setFloating,
|
|
268
|
+
style: R,
|
|
269
|
+
children: /* @__PURE__ */ h(te, {
|
|
270
|
+
override: w,
|
|
271
|
+
styles: V,
|
|
272
|
+
...G({
|
|
273
|
+
...j,
|
|
274
|
+
onClick: W
|
|
283
275
|
}),
|
|
284
|
-
children:
|
|
276
|
+
children: r
|
|
285
277
|
})
|
|
286
278
|
})
|
|
287
279
|
})
|
|
288
280
|
})] });
|
|
289
281
|
}
|
|
290
|
-
function
|
|
291
|
-
return /* @__PURE__ */
|
|
282
|
+
function te({ override: e, styles: t, style: n = {}, ...r }) {
|
|
283
|
+
return /* @__PURE__ */ h(N, {
|
|
292
284
|
classList: ["z-20 w-auto h-auto outline-none transition-transform ease-in-out", e ? null : "border border-accent rounded-md shadow-lg p-1 bg-background"],
|
|
293
285
|
style: {
|
|
294
286
|
...t,
|
|
@@ -299,58 +291,58 @@ function ne({ override: e, styles: t, style: n = {}, ...r }) {
|
|
|
299
291
|
}
|
|
300
292
|
//#endregion
|
|
301
293
|
//#region src/forms/Select/index.tsx
|
|
302
|
-
function
|
|
303
|
-
let k =
|
|
304
|
-
|
|
305
|
-
}, [
|
|
294
|
+
function K({ ref: e, className: t, placeholder: n = "", options: r = [], error: i, disabled: a, value: s, maxHeight: c = 408, arrowIcon: u, closeIcon: m, checkIcon: _, onChange: v, onClear: y, renderItem: b, sectionLabelStyle: x, buttonAreaStyle: S, clearLabelText: C, optionStyle: w, popoverStyle: T, popoverPosition: E, labelStyle: D, ...O }) {
|
|
295
|
+
let k = f(null), [A, j] = p(0), M = d(() => Array.isArray(s), []), P = o((e, t) => {
|
|
296
|
+
v?.(e, t), M || k.current?.close();
|
|
297
|
+
}, [v, M]), F = o((e) => Array.isArray(s) ? s.indexOf(e) > -1 : s === e, [s]), I = d(() => {
|
|
306
298
|
let e = {}, t = r.filter((e) => typeof e != "string");
|
|
307
299
|
for (let n = 0, r = t.length; n < r; n += 1) {
|
|
308
300
|
let r = t[n];
|
|
309
301
|
e[`${r.value}`] = r.label;
|
|
310
302
|
}
|
|
311
303
|
return e;
|
|
312
|
-
}, [r]), L =
|
|
313
|
-
if (!
|
|
314
|
-
if (Array.isArray(
|
|
315
|
-
if (!
|
|
316
|
-
let e = [...
|
|
304
|
+
}, [r]), L = d(() => {
|
|
305
|
+
if (!s) return n;
|
|
306
|
+
if (Array.isArray(s)) {
|
|
307
|
+
if (!s.length) return n;
|
|
308
|
+
let e = [...s].sort(), t = [];
|
|
317
309
|
for (let n = 0, r = e.length; n < r; n += 1) t[n] = I[`${e[n]}`] || "";
|
|
318
310
|
return t.filter(Boolean).join(",") || n;
|
|
319
311
|
}
|
|
320
|
-
return I[`${
|
|
312
|
+
return I[`${s}`] || n;
|
|
321
313
|
}, [
|
|
322
314
|
n,
|
|
323
|
-
|
|
315
|
+
s,
|
|
324
316
|
I
|
|
325
|
-
]), R =
|
|
317
|
+
]), R = d(() => s == null ? !0 : Array.isArray(s) ? !s.length : !1, [s]), z = o((e, t) => b ? typeof e == "string" ? b(e, {
|
|
326
318
|
index: t,
|
|
327
319
|
selected: !1,
|
|
328
320
|
onChange: () => {}
|
|
329
321
|
}) : b(e, {
|
|
330
322
|
index: t,
|
|
331
|
-
selected:
|
|
332
|
-
onChange: () =>
|
|
333
|
-
}) : typeof e == "string" ? /* @__PURE__ */
|
|
323
|
+
selected: F(e.value),
|
|
324
|
+
onChange: () => P(e.value, e)
|
|
325
|
+
}) : typeof e == "string" ? /* @__PURE__ */ h(N, {
|
|
334
326
|
as: "h5",
|
|
335
327
|
classList: ["font-normal py-1 px-2 text-muted"],
|
|
336
328
|
className: x,
|
|
337
329
|
children: e
|
|
338
|
-
}, `optionheader-${t}`) : /* @__PURE__ */
|
|
339
|
-
selected:
|
|
340
|
-
onChange:
|
|
341
|
-
checkIcon:
|
|
330
|
+
}, `optionheader-${t}`) : /* @__PURE__ */ h(ne, {
|
|
331
|
+
selected: F(e.value),
|
|
332
|
+
onChange: P,
|
|
333
|
+
checkIcon: _,
|
|
342
334
|
className: w,
|
|
343
335
|
data: e
|
|
344
336
|
}, e.label), [
|
|
345
337
|
b,
|
|
346
|
-
N,
|
|
347
338
|
P,
|
|
339
|
+
F,
|
|
348
340
|
x,
|
|
349
341
|
w,
|
|
350
|
-
|
|
342
|
+
_
|
|
351
343
|
]);
|
|
352
|
-
return
|
|
353
|
-
|
|
344
|
+
return l(e, () => k.current, []), /* @__PURE__ */ h(G, {
|
|
345
|
+
render: (e) => /* @__PURE__ */ g(N, {
|
|
354
346
|
as: "button",
|
|
355
347
|
type: "button",
|
|
356
348
|
classList: [
|
|
@@ -360,16 +352,17 @@ function re({ ref: e, className: t, placeholder: n = "", options: r = [], error:
|
|
|
360
352
|
],
|
|
361
353
|
className: t,
|
|
362
354
|
disabled: a,
|
|
355
|
+
...e,
|
|
363
356
|
...O,
|
|
364
|
-
children: [/* @__PURE__ */
|
|
357
|
+
children: [/* @__PURE__ */ h(N, {
|
|
365
358
|
as: "span",
|
|
366
359
|
classList: ["overflow-hidden text-ellipsis whitespace-nowrap", R ? "text-muted" : "text-text"],
|
|
367
360
|
className: D,
|
|
368
361
|
children: L
|
|
369
|
-
}), /* @__PURE__ */
|
|
362
|
+
}), /* @__PURE__ */ g(N, {
|
|
370
363
|
classList: "relative flex items-center space-x-2",
|
|
371
364
|
className: S,
|
|
372
|
-
children: [y && !R ? /* @__PURE__ */
|
|
365
|
+
children: [y && !R ? /* @__PURE__ */ h("div", {
|
|
373
366
|
tabIndex: -1,
|
|
374
367
|
role: "button",
|
|
375
368
|
className: "size-6 p-1.5 rounded hover:bg-accent cursor-pointer",
|
|
@@ -380,8 +373,8 @@ function re({ ref: e, className: t, placeholder: n = "", options: r = [], error:
|
|
|
380
373
|
onClick: (e) => {
|
|
381
374
|
e.stopPropagation(), y();
|
|
382
375
|
},
|
|
383
|
-
children:
|
|
384
|
-
}) : null,
|
|
376
|
+
children: m
|
|
377
|
+
}) : null, u]
|
|
385
378
|
})]
|
|
386
379
|
}),
|
|
387
380
|
ref: k,
|
|
@@ -389,20 +382,20 @@ function re({ ref: e, className: t, placeholder: n = "", options: r = [], error:
|
|
|
389
382
|
className: T,
|
|
390
383
|
position: E,
|
|
391
384
|
disabled: a,
|
|
392
|
-
children: /* @__PURE__ */
|
|
385
|
+
children: /* @__PURE__ */ h("div", {
|
|
393
386
|
className: "overflow-y-auto flex flex-col",
|
|
394
387
|
role: "listbox",
|
|
395
388
|
style: {
|
|
396
389
|
minWidth: A,
|
|
397
390
|
maxWidth: "calc(100vw - 3rem)",
|
|
398
|
-
maxHeight:
|
|
391
|
+
maxHeight: c
|
|
399
392
|
},
|
|
400
393
|
children: r.map(z)
|
|
401
394
|
})
|
|
402
395
|
});
|
|
403
396
|
}
|
|
404
|
-
function
|
|
405
|
-
return /* @__PURE__ */
|
|
397
|
+
function ne({ className: e, data: t, selected: n, checkIcon: r, onChange: i }) {
|
|
398
|
+
return /* @__PURE__ */ g(N, {
|
|
406
399
|
as: "button",
|
|
407
400
|
type: "button",
|
|
408
401
|
role: "option",
|
|
@@ -410,16 +403,16 @@ function ie({ className: e, data: t, selected: n, checkIcon: r, onChange: i }) {
|
|
|
410
403
|
className: e,
|
|
411
404
|
"aria-selected": n,
|
|
412
405
|
onClick: () => i?.(t.value, t),
|
|
413
|
-
children: [r === null || n && r ? r : /* @__PURE__ */
|
|
406
|
+
children: [r === null || n && r ? r : /* @__PURE__ */ h("div", { className: "w-5 h-1 mr-1" }), t.label]
|
|
414
407
|
});
|
|
415
408
|
}
|
|
416
409
|
//#endregion
|
|
417
410
|
//#region src/forms/Radio/index.tsx
|
|
418
|
-
function
|
|
411
|
+
function re({ checked: e, className: t, id: n, name: r, onChange: i, value: a, error: o, ...s }) {
|
|
419
412
|
let c = () => {
|
|
420
413
|
s.disabled || i?.(!e);
|
|
421
414
|
};
|
|
422
|
-
return /* @__PURE__ */
|
|
415
|
+
return /* @__PURE__ */ g(N, {
|
|
423
416
|
as: "button",
|
|
424
417
|
type: "button",
|
|
425
418
|
role: "radio",
|
|
@@ -434,13 +427,13 @@ function ae({ checked: e, className: t, id: n, name: r, onChange: i, value: a, e
|
|
|
434
427
|
onClick: c,
|
|
435
428
|
"aria-checked": e,
|
|
436
429
|
...s,
|
|
437
|
-
children: [/* @__PURE__ */
|
|
430
|
+
children: [/* @__PURE__ */ h("i", {
|
|
438
431
|
className: "block w-2.5 h-2.5 rounded-full transition-transform",
|
|
439
432
|
style: {
|
|
440
433
|
transform: e ? "" : "scale(0.8)",
|
|
441
434
|
opacity: +!!e
|
|
442
435
|
}
|
|
443
|
-
}), /* @__PURE__ */
|
|
436
|
+
}), /* @__PURE__ */ h("input", {
|
|
444
437
|
type: "radio",
|
|
445
438
|
"aria-hidden": "true",
|
|
446
439
|
name: r,
|
|
@@ -462,11 +455,11 @@ function ae({ checked: e, className: t, id: n, name: r, onChange: i, value: a, e
|
|
|
462
455
|
}
|
|
463
456
|
//#endregion
|
|
464
457
|
//#region src/forms/Switch/index.tsx
|
|
465
|
-
function
|
|
458
|
+
function ie({ checked: e, onChange: t, value: n, id: r, name: i, error: a, ref: o, ...s }) {
|
|
466
459
|
let c = () => {
|
|
467
460
|
s.disabled || t?.(!e);
|
|
468
461
|
};
|
|
469
|
-
return /* @__PURE__ */
|
|
462
|
+
return /* @__PURE__ */ g(N, {
|
|
470
463
|
as: "button",
|
|
471
464
|
type: "button",
|
|
472
465
|
role: "switch",
|
|
@@ -481,10 +474,10 @@ function oe({ checked: e, onChange: t, value: n, id: r, name: i, error: a, ref:
|
|
|
481
474
|
"aria-checked": e,
|
|
482
475
|
"aria-invalid": a,
|
|
483
476
|
...s,
|
|
484
|
-
children: [/* @__PURE__ */
|
|
477
|
+
children: [/* @__PURE__ */ h("span", {
|
|
485
478
|
className: "pointer-events-none block h-5 w-5 rounded-full bg-background shadow-lg ring-0 transition-transform",
|
|
486
479
|
style: { transform: e ? "translateX(100%)" : "" }
|
|
487
|
-
}), /* @__PURE__ */
|
|
480
|
+
}), /* @__PURE__ */ h("input", {
|
|
488
481
|
ref: o,
|
|
489
482
|
type: "checkbox",
|
|
490
483
|
"aria-hidden": "true",
|
|
@@ -507,14 +500,14 @@ function oe({ checked: e, onChange: t, value: n, id: r, name: i, error: a, ref:
|
|
|
507
500
|
}
|
|
508
501
|
//#endregion
|
|
509
502
|
//#region src/components/Accordion/index.tsx
|
|
510
|
-
function
|
|
511
|
-
let a =
|
|
512
|
-
return
|
|
503
|
+
function ae({ header: e, show: t, children: n, timeout: r = 300, ...i }) {
|
|
504
|
+
let a = f(null), o = f(0), s = f(0), l = f(!0);
|
|
505
|
+
return c(() => {
|
|
513
506
|
s.current = r;
|
|
514
|
-
}, [r]),
|
|
507
|
+
}, [r]), H(() => {
|
|
515
508
|
if (!a.current) return;
|
|
516
|
-
if (a.current.style.overflow = "hidden", a.current.style.opacity = "1",
|
|
517
|
-
|
|
509
|
+
if (a.current.style.overflow = "hidden", a.current.style.opacity = "1", l.current) {
|
|
510
|
+
l.current = !1, a.current.style.height = t ? "auto" : "0px", t ? window.requestAnimationFrame(() => {
|
|
518
511
|
a.current && (o.current = a.current.offsetHeight);
|
|
519
512
|
}) : (window.requestAnimationFrame(() => {
|
|
520
513
|
a.current && (a.current.style.height = "auto", o.current = a.current.offsetHeight, a.current.style.height = "0px");
|
|
@@ -536,9 +529,9 @@ function se({ header: e, show: t, children: n, timeout: r = 300, ...i }) {
|
|
|
536
529
|
return s.current === 0 ? r() : n = window.setTimeout(r, s.current), () => {
|
|
537
530
|
e.forEach(window.cancelAnimationFrame), n && window.clearTimeout(n);
|
|
538
531
|
};
|
|
539
|
-
}, [t]), /* @__PURE__ */
|
|
532
|
+
}, [t]), /* @__PURE__ */ g("div", {
|
|
540
533
|
...i,
|
|
541
|
-
children: [e, /* @__PURE__ */
|
|
534
|
+
children: [e, /* @__PURE__ */ h("div", {
|
|
542
535
|
className: "transition-all ease-in-out overflow-hidden",
|
|
543
536
|
role: "region",
|
|
544
537
|
"aria-hidden": !t,
|
|
@@ -550,72 +543,70 @@ function se({ header: e, show: t, children: n, timeout: r = 300, ...i }) {
|
|
|
550
543
|
}
|
|
551
544
|
//#endregion
|
|
552
545
|
//#region src/components/Tooltip/index.tsx
|
|
553
|
-
var
|
|
546
|
+
var q = i(({ render: e, position: t = "bottom", label: n, className: r, timeout: i = 150, offset: a = {
|
|
554
547
|
x: 0,
|
|
555
548
|
y: 6
|
|
556
|
-
}, clientPoint:
|
|
557
|
-
let [
|
|
558
|
-
nodeId:
|
|
559
|
-
open:
|
|
549
|
+
}, clientPoint: o = !1, disabled: s }, u) => {
|
|
550
|
+
let [d, f] = p(!1), _ = D(), { refs: S, floatingStyles: w, context: A } = T({
|
|
551
|
+
nodeId: _,
|
|
552
|
+
open: d,
|
|
560
553
|
placement: t,
|
|
561
554
|
middleware: [
|
|
562
|
-
C(),
|
|
563
555
|
x(),
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
556
|
+
y(),
|
|
557
|
+
b({
|
|
558
|
+
mainAxis: a.y,
|
|
559
|
+
crossAxis: a.x
|
|
567
560
|
})
|
|
568
561
|
],
|
|
569
|
-
whileElementsMounted:
|
|
570
|
-
onOpenChange:
|
|
571
|
-
}), { getReferenceProps:
|
|
572
|
-
duration:
|
|
562
|
+
whileElementsMounted: s ? void 0 : v,
|
|
563
|
+
onOpenChange: f
|
|
564
|
+
}), { getReferenceProps: j, getFloatingProps: M } = O([E(A, { enabled: !s }), C(A, { enabled: o })]), { isMounted: N, styles: P } = k(A, {
|
|
565
|
+
duration: i,
|
|
573
566
|
initial: {
|
|
574
567
|
opacity: 0,
|
|
575
568
|
transform: "scale(0.8)"
|
|
576
569
|
}
|
|
577
570
|
});
|
|
578
|
-
|
|
579
|
-
floating:
|
|
580
|
-
reference:
|
|
581
|
-
open: () =>
|
|
582
|
-
close: () =>
|
|
583
|
-
})),
|
|
584
|
-
|
|
585
|
-
}, [
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
disabled: l || !F,
|
|
592
|
-
children: /* @__PURE__ */ _("div", {
|
|
571
|
+
return l(u, () => ({
|
|
572
|
+
floating: S.floating,
|
|
573
|
+
reference: S.reference,
|
|
574
|
+
open: () => f(!0),
|
|
575
|
+
close: () => f(!1)
|
|
576
|
+
})), c(() => {
|
|
577
|
+
s && f(!1);
|
|
578
|
+
}, [s]), /* @__PURE__ */ g(m, { children: [e({
|
|
579
|
+
ref: S.setReference,
|
|
580
|
+
...j()
|
|
581
|
+
}), /* @__PURE__ */ h(U, {
|
|
582
|
+
disabled: s || !N,
|
|
583
|
+
children: /* @__PURE__ */ h("div", {
|
|
593
584
|
role: "tooltip",
|
|
594
585
|
className: "z-9999",
|
|
595
|
-
ref:
|
|
596
|
-
...
|
|
597
|
-
children: /* @__PURE__ */
|
|
598
|
-
className:
|
|
599
|
-
style:
|
|
600
|
-
children:
|
|
586
|
+
ref: S.setFloating,
|
|
587
|
+
...M({ style: w }),
|
|
588
|
+
children: /* @__PURE__ */ h(J, {
|
|
589
|
+
className: r,
|
|
590
|
+
style: P,
|
|
591
|
+
children: n
|
|
601
592
|
})
|
|
602
593
|
})
|
|
603
594
|
})] });
|
|
604
595
|
});
|
|
605
|
-
|
|
606
|
-
var
|
|
607
|
-
let i =
|
|
608
|
-
return /* @__PURE__ */
|
|
596
|
+
q.displayName = "Tooltip";
|
|
597
|
+
var J = i(({ className: e, custom: t, ...n }, r) => {
|
|
598
|
+
let i = d(() => M(j("relative w-auto h-auto outline-none transition-transform ease-in-out whitespace-pre", t ? null : "border border-accent rounded shadow-md px-3 py-1 bg-background"), e), [e, t]);
|
|
599
|
+
return /* @__PURE__ */ h("div", {
|
|
609
600
|
ref: r,
|
|
610
601
|
className: i,
|
|
611
602
|
...n
|
|
612
603
|
});
|
|
613
604
|
});
|
|
614
|
-
|
|
605
|
+
J.displayName = "TooltipContent";
|
|
615
606
|
//#endregion
|
|
616
607
|
//#region src/elements/Button/index.tsx
|
|
617
|
-
function
|
|
618
|
-
return
|
|
608
|
+
function Y({ variant: e, size: t }) {
|
|
609
|
+
return j("inline-flex items-center justify-center whitespace-nowrap transition-colors rounded-md cursor-pointer", "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring", "disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-auto", {
|
|
619
610
|
"bg-primary text-inverted hover:bg-primary-fore": !e || e === "primary",
|
|
620
611
|
"bg-info text-inverted hover:bg-info-fore": e === "info",
|
|
621
612
|
"bg-warn text-inverted hover:bg-warn-fore": e === "warn",
|
|
@@ -628,8 +619,8 @@ function X({ variant: e, size: t }) {
|
|
|
628
619
|
"p-1.5": t === "icon"
|
|
629
620
|
});
|
|
630
621
|
}
|
|
631
|
-
function
|
|
632
|
-
let i =
|
|
622
|
+
function oe({ size: e, variant: t, className: n, ...r }) {
|
|
623
|
+
let i = d(() => M(Y({
|
|
633
624
|
size: e,
|
|
634
625
|
variant: t
|
|
635
626
|
}), n), [
|
|
@@ -637,7 +628,7 @@ function ce({ size: e, variant: t, className: n, ...r }) {
|
|
|
637
628
|
t,
|
|
638
629
|
n
|
|
639
630
|
]);
|
|
640
|
-
return /* @__PURE__ */
|
|
631
|
+
return /* @__PURE__ */ h("button", {
|
|
641
632
|
className: i,
|
|
642
633
|
type: "button",
|
|
643
634
|
...r
|
|
@@ -645,57 +636,57 @@ function ce({ size: e, variant: t, className: n, ...r }) {
|
|
|
645
636
|
}
|
|
646
637
|
//#endregion
|
|
647
638
|
//#region src/components/Dialog/index.tsx
|
|
648
|
-
var
|
|
639
|
+
var se = {
|
|
649
640
|
open: 150,
|
|
650
641
|
close: 75
|
|
651
642
|
};
|
|
652
|
-
function
|
|
653
|
-
let
|
|
643
|
+
function ce({ open: e, children: t, timeout: n = se, padding: r = "0.85rem", verticalAlign: i = "center", closeOnOverlay: a, closeOnEsc: s, onExited: l, className: u, onOpenChange: p, size: m, ...g }) {
|
|
644
|
+
let v = f(l), y = f(!1), b = D(), { refs: x, context: S } = T({
|
|
654
645
|
open: e,
|
|
655
|
-
onOpenChange:
|
|
646
|
+
onOpenChange: p,
|
|
656
647
|
nodeId: b
|
|
657
|
-
}), { getFloatingProps: C } =
|
|
658
|
-
enabled:
|
|
659
|
-
escapeKey:
|
|
648
|
+
}), { getFloatingProps: C } = O([w(S, {
|
|
649
|
+
enabled: s,
|
|
650
|
+
escapeKey: s,
|
|
660
651
|
outsidePress: !1
|
|
661
|
-
})]), { isMounted:
|
|
652
|
+
})]), { isMounted: E, styles: A } = k(S, {
|
|
662
653
|
duration: n,
|
|
663
654
|
initial: {
|
|
664
655
|
opacity: 0,
|
|
665
656
|
transform: "scale(0.8)"
|
|
666
657
|
}
|
|
667
658
|
});
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
}, [
|
|
671
|
-
let
|
|
672
|
-
a &&
|
|
673
|
-
}, [
|
|
674
|
-
|
|
675
|
-
let
|
|
659
|
+
c(() => {
|
|
660
|
+
y.current !== E && (y.current = E, !E && v.current?.());
|
|
661
|
+
}, [E]);
|
|
662
|
+
let M = o(() => {
|
|
663
|
+
a && p?.(!1);
|
|
664
|
+
}, [p, a]);
|
|
665
|
+
v.current = l;
|
|
666
|
+
let N = d(() => j("grid bg-backdrop z-40 justify-items-center transition ease-in-out", {
|
|
676
667
|
"place-items-start items-start": i === "start",
|
|
677
668
|
"place-items-end": i === "end",
|
|
678
669
|
"place-items-center": i === "center" || !i
|
|
679
670
|
}), [i]);
|
|
680
|
-
return /* @__PURE__ */
|
|
681
|
-
disabled: !
|
|
682
|
-
children: /* @__PURE__ */ _
|
|
683
|
-
className:
|
|
671
|
+
return /* @__PURE__ */ h(U, {
|
|
672
|
+
disabled: !E,
|
|
673
|
+
children: /* @__PURE__ */ h(_, {
|
|
674
|
+
className: N,
|
|
684
675
|
"data-testid": "vs-dialog-overlay",
|
|
685
|
-
onClick:
|
|
676
|
+
onClick: M,
|
|
686
677
|
style: {
|
|
687
678
|
padding: r,
|
|
688
|
-
opacity:
|
|
679
|
+
opacity: A.opacity
|
|
689
680
|
},
|
|
690
681
|
lockScroll: !0,
|
|
691
|
-
children: /* @__PURE__ */
|
|
682
|
+
children: /* @__PURE__ */ h(le, {
|
|
692
683
|
ref: x.setFloating,
|
|
693
|
-
className:
|
|
684
|
+
className: u,
|
|
694
685
|
role: "dialog",
|
|
695
|
-
size:
|
|
686
|
+
size: m,
|
|
696
687
|
...C({
|
|
697
|
-
...
|
|
698
|
-
style:
|
|
688
|
+
...g,
|
|
689
|
+
style: A,
|
|
699
690
|
onClick: (e) => e?.stopPropagation()
|
|
700
691
|
}),
|
|
701
692
|
children: t
|
|
@@ -703,8 +694,8 @@ function ue({ open: e, children: t, timeout: n = le, padding: r = "0.85rem", ver
|
|
|
703
694
|
})
|
|
704
695
|
});
|
|
705
696
|
}
|
|
706
|
-
function
|
|
707
|
-
return /* @__PURE__ */
|
|
697
|
+
function le({ size: e, ...t }) {
|
|
698
|
+
return /* @__PURE__ */ h(N, {
|
|
708
699
|
classList: [e ? "flex flex-col bg-background shadow-lg p-5 rounded" : null, {
|
|
709
700
|
"w-full max-w-dialog-sm": e === "small",
|
|
710
701
|
"w-full max-w-dialog-md": e === "medium",
|
|
@@ -715,16 +706,16 @@ function de({ size: e, ...t }) {
|
|
|
715
706
|
}
|
|
716
707
|
//#endregion
|
|
717
708
|
//#region src/elements/Skeleton/index.tsx
|
|
718
|
-
function
|
|
719
|
-
return /* @__PURE__ */
|
|
709
|
+
function ue(e) {
|
|
710
|
+
return /* @__PURE__ */ h(N, {
|
|
720
711
|
classList: "inline-block animate-pulse rounded-md bg-accent",
|
|
721
712
|
...e
|
|
722
713
|
});
|
|
723
714
|
}
|
|
724
715
|
//#endregion
|
|
725
716
|
//#region src/elements/Button/ButtonGroup.tsx
|
|
726
|
-
function
|
|
727
|
-
return /* @__PURE__ */
|
|
717
|
+
function de(e) {
|
|
718
|
+
return /* @__PURE__ */ h(N, {
|
|
728
719
|
role: "group",
|
|
729
720
|
classList: [
|
|
730
721
|
"flex items-center justify-center",
|
|
@@ -736,8 +727,8 @@ function pe(e) {
|
|
|
736
727
|
}
|
|
737
728
|
//#endregion
|
|
738
729
|
//#region src/elements/Spinner/index.tsx
|
|
739
|
-
function
|
|
740
|
-
return /* @__PURE__ */
|
|
730
|
+
function fe({ label: e = "Loading...", ...t }) {
|
|
731
|
+
return /* @__PURE__ */ g(N, {
|
|
741
732
|
as: "svg",
|
|
742
733
|
classList: "fill-accent animate-spin text-primary",
|
|
743
734
|
"aria-label": e,
|
|
@@ -748,10 +739,10 @@ function me({ label: e = "Loading...", ...t }) {
|
|
|
748
739
|
fill: "none",
|
|
749
740
|
xmlns: "http://www.w3.org/2000/svg",
|
|
750
741
|
...t,
|
|
751
|
-
children: [/* @__PURE__ */
|
|
742
|
+
children: [/* @__PURE__ */ h("path", {
|
|
752
743
|
d: "M100 50.6a50 50 0 1 1-100 0 50 50 0 0 1 100 0Zm-91 0a41 41 0 1 0 82 0 41 41 0 0 0-82 0Z",
|
|
753
744
|
fill: "currentFill"
|
|
754
|
-
}), /* @__PURE__ */
|
|
745
|
+
}), /* @__PURE__ */ h("path", {
|
|
755
746
|
d: "M94 39a4.2 4.2 0 0 0 3-5.4A50 50 0 0 0 41.7 1.3c-2.4.4-3.9 2.9-3.2 5.3a5 5 0 0 0 5.6 3.5A41 41 0 0 1 88 36 5 5 0 0 0 94 39Z",
|
|
756
747
|
fill: "currentColor"
|
|
757
748
|
})]
|
|
@@ -759,15 +750,15 @@ function me({ label: e = "Loading...", ...t }) {
|
|
|
759
750
|
}
|
|
760
751
|
//#endregion
|
|
761
752
|
//#region src/elements/Progress/index.tsx
|
|
762
|
-
function
|
|
763
|
-
let r =
|
|
764
|
-
return /* @__PURE__ */
|
|
753
|
+
function pe({ value: e, max: t, ...n }) {
|
|
754
|
+
let r = d(() => e ? Math.min(100, Math.round(e / t * 100)) : 0, [e, t]);
|
|
755
|
+
return /* @__PURE__ */ h(N, {
|
|
765
756
|
role: "progressbar",
|
|
766
757
|
classList: "relative overflow-hidden rounded-full bg-primary",
|
|
767
758
|
"aria-valuemax": t,
|
|
768
759
|
"aria-valuemin": 0,
|
|
769
760
|
...n,
|
|
770
|
-
children: /* @__PURE__ */
|
|
761
|
+
children: /* @__PURE__ */ h(N, {
|
|
771
762
|
className: "h-full w-full flex-1 bg-input transition-all origin-right",
|
|
772
763
|
style: { transform: `translateX(${r}%)` }
|
|
773
764
|
})
|
|
@@ -775,8 +766,8 @@ function he({ value: e, max: t, ...n }) {
|
|
|
775
766
|
}
|
|
776
767
|
//#endregion
|
|
777
768
|
//#region src/elements/Divider/index.tsx
|
|
778
|
-
function
|
|
779
|
-
return /* @__PURE__ */
|
|
769
|
+
function me({ orientation: e = "horizontal", ...t }) {
|
|
770
|
+
return /* @__PURE__ */ h(N, {
|
|
780
771
|
as: "hr",
|
|
781
772
|
role: "none",
|
|
782
773
|
classList: ["border-0 p-0 shrink-0 bg-input", e === "horizontal" ? "h-px w-full" : "w-px h-full"],
|
|
@@ -785,16 +776,16 @@ function ge({ orientation: e = "horizontal", ...t }) {
|
|
|
785
776
|
}
|
|
786
777
|
//#endregion
|
|
787
778
|
//#region src/components/Sheet/index.tsx
|
|
788
|
-
var
|
|
779
|
+
var he = {
|
|
789
780
|
open: 250,
|
|
790
781
|
close: 150
|
|
791
782
|
};
|
|
792
|
-
function
|
|
793
|
-
let
|
|
783
|
+
function ge({ open: e, timeout: t = he, onOpenChange: n, position: r = "right", overlay: i, onExited: a, onOpen: o, ...s }) {
|
|
784
|
+
let l = D(), u = f(!1), d = f(o), p = f(a), { refs: m, context: v } = T({
|
|
794
785
|
open: e,
|
|
795
786
|
onOpenChange: n,
|
|
796
|
-
nodeId:
|
|
797
|
-
}), { isMounted:
|
|
787
|
+
nodeId: l
|
|
788
|
+
}), { isMounted: y, styles: b } = k(v, {
|
|
798
789
|
duration: t,
|
|
799
790
|
initial() {
|
|
800
791
|
let e = "translateX(75%)";
|
|
@@ -804,22 +795,22 @@ function ve({ open: e, timeout: t = _e, onOpenChange: n, position: r = "right",
|
|
|
804
795
|
};
|
|
805
796
|
}
|
|
806
797
|
});
|
|
807
|
-
return
|
|
808
|
-
if (
|
|
809
|
-
if (
|
|
798
|
+
return c(() => {
|
|
799
|
+
if (u.current !== y) {
|
|
800
|
+
if (u.current = y, y) {
|
|
810
801
|
d.current?.();
|
|
811
802
|
return;
|
|
812
803
|
}
|
|
813
|
-
|
|
804
|
+
p.current?.();
|
|
814
805
|
}
|
|
815
|
-
}, [
|
|
816
|
-
disabled: !
|
|
817
|
-
children: [i ? /* @__PURE__ */ _
|
|
806
|
+
}, [y]), p.current = a, d.current = o, /* @__PURE__ */ g(U, {
|
|
807
|
+
disabled: !y,
|
|
808
|
+
children: [i ? /* @__PURE__ */ h(_, {
|
|
818
809
|
className: i === "transparent" ? "" : "bg-backdrop",
|
|
819
810
|
style: { opacity: b.opacity },
|
|
820
811
|
onClick: () => n?.(!1)
|
|
821
|
-
}) : null, /* @__PURE__ */
|
|
822
|
-
ref:
|
|
812
|
+
}) : null, /* @__PURE__ */ h(N, {
|
|
813
|
+
ref: m.setFloating,
|
|
823
814
|
role: "complementary",
|
|
824
815
|
classList: ["fixed transition-transform z-1", {
|
|
825
816
|
"top-0 right-0 h-full max-h-screen": r === "right",
|
|
@@ -828,23 +819,23 @@ function ve({ open: e, timeout: t = _e, onOpenChange: n, position: r = "right",
|
|
|
828
819
|
"bottom-0 left-0 right-0 w-full max-w-screen": r === "bottom"
|
|
829
820
|
}],
|
|
830
821
|
style: b,
|
|
831
|
-
children: /* @__PURE__ */
|
|
822
|
+
children: /* @__PURE__ */ h(_e, { ...s })
|
|
832
823
|
})]
|
|
833
824
|
});
|
|
834
825
|
}
|
|
835
|
-
function
|
|
836
|
-
return /* @__PURE__ */
|
|
826
|
+
function _e(e) {
|
|
827
|
+
return /* @__PURE__ */ h(N, {
|
|
837
828
|
classList: "relative bg-background min-w-full min-h-full border border-input shadow-lg",
|
|
838
829
|
...e
|
|
839
830
|
});
|
|
840
831
|
}
|
|
841
832
|
//#endregion
|
|
842
833
|
//#region src/components/Toast/ToastItem.tsx
|
|
843
|
-
function
|
|
844
|
-
let { icons: r } =
|
|
845
|
-
return /* @__PURE__ */
|
|
834
|
+
function X({ type: e, label: t, message: n }) {
|
|
835
|
+
let { icons: r } = ye();
|
|
836
|
+
return /* @__PURE__ */ g("div", {
|
|
846
837
|
className: "flex items-center px-4 py-3 w-80 text-sm bg-background border border-input rounded-lg shadow-md m-2",
|
|
847
|
-
children: [e ? /* @__PURE__ */
|
|
838
|
+
children: [e ? /* @__PURE__ */ g("figure", {
|
|
848
839
|
className: "mr-2",
|
|
849
840
|
children: [
|
|
850
841
|
e === "success" && r?.success ? r.success : null,
|
|
@@ -853,23 +844,23 @@ function Z({ type: e, label: t, message: n }) {
|
|
|
853
844
|
e === "warn" && r?.warn ? r.warn : null,
|
|
854
845
|
e === "loading" ? r?.loading : null
|
|
855
846
|
]
|
|
856
|
-
}) : null, /* @__PURE__ */
|
|
847
|
+
}) : null, /* @__PURE__ */ g("div", {
|
|
857
848
|
className: "space-y-2",
|
|
858
|
-
children: [/* @__PURE__ */
|
|
849
|
+
children: [/* @__PURE__ */ h("p", {
|
|
859
850
|
className: "font-medium leading-none",
|
|
860
851
|
children: t
|
|
861
|
-
}), n ? /* @__PURE__ */
|
|
852
|
+
}), n ? /* @__PURE__ */ h("p", { children: n }) : null]
|
|
862
853
|
})]
|
|
863
854
|
});
|
|
864
855
|
}
|
|
865
856
|
//#endregion
|
|
866
857
|
//#region src/components/Toast/observer.ts
|
|
867
|
-
function
|
|
868
|
-
var
|
|
869
|
-
notify =
|
|
858
|
+
function Z() {}
|
|
859
|
+
var Q = new class {
|
|
860
|
+
notify = Z;
|
|
870
861
|
lastId = 0;
|
|
871
862
|
subscribe = (e) => (this.notify = e, () => {
|
|
872
|
-
this.notify =
|
|
863
|
+
this.notify = Z;
|
|
873
864
|
});
|
|
874
865
|
add = (e, t = {}) => {
|
|
875
866
|
this.lastId += 1;
|
|
@@ -903,96 +894,96 @@ var $ = new class {
|
|
|
903
894
|
}();
|
|
904
895
|
//#endregion
|
|
905
896
|
//#region src/components/Toast/ToastFloat.tsx
|
|
906
|
-
function
|
|
907
|
-
let
|
|
897
|
+
function ve({ id: t, type: n, index: r, duration: i = 5e3, className: a, children: s, inverted: l, timeout: m = 250, max: g = 3 }) {
|
|
898
|
+
let _ = f(!1), [v, y] = p(!1), { context: b, refs: x } = T({
|
|
908
899
|
open: v,
|
|
909
900
|
onOpenChange: y,
|
|
910
901
|
nodeId: t
|
|
911
|
-
}), { isMounted: S, styles: C } =
|
|
912
|
-
duration:
|
|
902
|
+
}), { isMounted: S, styles: C } = k(b, {
|
|
903
|
+
duration: m,
|
|
913
904
|
initial: {
|
|
914
905
|
opacity: 0,
|
|
915
|
-
transform: `translateY(${
|
|
906
|
+
transform: `translateY(${l ? "" : "-"}50%)`
|
|
916
907
|
}
|
|
917
908
|
});
|
|
918
|
-
|
|
919
|
-
y(r <=
|
|
920
|
-
}, [r,
|
|
921
|
-
|
|
922
|
-
}, [S, t]),
|
|
909
|
+
u(() => {
|
|
910
|
+
y(r <= g);
|
|
911
|
+
}, [r, g]), c(() => {
|
|
912
|
+
_.current !== S && (S || Q.remove(t), _.current = S);
|
|
913
|
+
}, [S, t]), c(() => {
|
|
923
914
|
if (!i) return;
|
|
924
915
|
let e = window.setTimeout(() => y(!1), i);
|
|
925
916
|
return () => window.clearTimeout(e);
|
|
926
917
|
}, [i, t]);
|
|
927
|
-
let w =
|
|
918
|
+
let w = o(() => {
|
|
928
919
|
n !== "loading" && y(!1);
|
|
929
|
-
}, [n]),
|
|
930
|
-
return S ? /* @__PURE__ */
|
|
920
|
+
}, [n]), E = d(() => e("relative flex w-fit transition-transform ease-in-out cursor-pointer", a), [a]);
|
|
921
|
+
return S ? /* @__PURE__ */ h("li", {
|
|
931
922
|
role: "log",
|
|
932
923
|
tabIndex: -1,
|
|
933
924
|
ref: x.setFloating,
|
|
934
|
-
className:
|
|
925
|
+
className: E,
|
|
935
926
|
style: C,
|
|
936
927
|
onClick: w,
|
|
937
|
-
children:
|
|
928
|
+
children: s
|
|
938
929
|
}) : null;
|
|
939
930
|
}
|
|
940
931
|
//#endregion
|
|
941
932
|
//#region src/components/Toast/index.tsx
|
|
942
|
-
var
|
|
943
|
-
function
|
|
944
|
-
return
|
|
933
|
+
var $ = n({});
|
|
934
|
+
function ye() {
|
|
935
|
+
return s($);
|
|
945
936
|
}
|
|
946
|
-
function
|
|
947
|
-
let l =
|
|
937
|
+
function be({ className: t, offset: n = {}, position: i = "top-left", max: o, ListItem: s = X, icons: c }) {
|
|
938
|
+
let l = d(() => {
|
|
948
939
|
let e = {
|
|
949
940
|
position: "fixed",
|
|
950
941
|
...n
|
|
951
942
|
};
|
|
952
|
-
return Object.keys(n).length || (
|
|
953
|
-
}, [n,
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
if (e.type === "add")
|
|
943
|
+
return Object.keys(n).length || (i.indexOf("top") > -1 ? e.top = "16px" : i.indexOf("bottom") > -1 && (e.bottom = "16px"), i.indexOf("left") > -1 ? e.left = "16px" : i.indexOf("right") > -1 && (e.right = "16px")), i.indexOf("left") > -1 ? e.alignItems = "flex-start" : i.indexOf("right") > -1 ? e.alignItems = "flex-end" : (e.left = "50%", e.alignItems = "center", e.transform = "translateX(-50%)"), e;
|
|
944
|
+
}, [n, i]), u = d(() => e("flex flex-col z-40 overflow-hidden", t), [t]), m = d(() => i?.startsWith("bottom") || !1, [i]), g = f(/* @__PURE__ */ new Map()), [_, v] = p([]), y = p(0)[1];
|
|
945
|
+
H(() => Q.subscribe((e) => {
|
|
946
|
+
a(() => {
|
|
947
|
+
if (e.type === "add") g.current.set(e.id, e.config), v((t) => [...t, e.id]);
|
|
957
948
|
else if (e.type === "remove") {
|
|
958
|
-
if (!
|
|
949
|
+
if (!g.current.delete(e.id)) return;
|
|
959
950
|
v((t) => {
|
|
960
951
|
let n = new Set(t);
|
|
961
952
|
return n.has(e.id) ? (n.delete(e.id), Array.from(n)) : t;
|
|
962
953
|
});
|
|
963
954
|
} else if (e.type === "update") {
|
|
964
|
-
let t =
|
|
955
|
+
let t = g.current.get(e.id);
|
|
965
956
|
if (!t) return;
|
|
966
|
-
|
|
957
|
+
g.current.set(e.id, {
|
|
967
958
|
...t,
|
|
968
959
|
...e.config
|
|
969
960
|
}), y((e) => e + 1);
|
|
970
961
|
}
|
|
971
962
|
});
|
|
972
963
|
}), []);
|
|
973
|
-
let b =
|
|
974
|
-
return /* @__PURE__ */
|
|
964
|
+
let b = d(() => ({ icons: c }), [c]), x = _.length;
|
|
965
|
+
return /* @__PURE__ */ h(U, { children: /* @__PURE__ */ h("ol", {
|
|
975
966
|
className: u,
|
|
976
967
|
style: l,
|
|
977
968
|
"aria-live": "polite",
|
|
978
|
-
children: /* @__PURE__ */
|
|
969
|
+
children: /* @__PURE__ */ h($.Provider, {
|
|
979
970
|
value: b,
|
|
980
|
-
children:
|
|
981
|
-
let n =
|
|
971
|
+
children: _.map((e, t) => {
|
|
972
|
+
let n = g.current.get(e);
|
|
982
973
|
if (!n) return null;
|
|
983
|
-
let { className:
|
|
984
|
-
return /* @__PURE__ */
|
|
974
|
+
let { className: i, duration: a, ...c } = n;
|
|
975
|
+
return /* @__PURE__ */ h(ve, {
|
|
985
976
|
id: e,
|
|
986
977
|
index: x - t,
|
|
987
|
-
className:
|
|
988
|
-
duration:
|
|
989
|
-
inverted:
|
|
990
|
-
max:
|
|
991
|
-
children:
|
|
978
|
+
className: i,
|
|
979
|
+
duration: a,
|
|
980
|
+
inverted: m,
|
|
981
|
+
max: o,
|
|
982
|
+
children: r(s, c)
|
|
992
983
|
}, e);
|
|
993
984
|
})
|
|
994
985
|
})
|
|
995
986
|
}) });
|
|
996
987
|
}
|
|
997
988
|
//#endregion
|
|
998
|
-
export {
|
|
989
|
+
export { ae as Accordion, N as Base, oe as Button, de as ButtonGroup, V as Checkbox, ce as Dialog, me as Divider, I as FormField, F as FormLabel, R as Input, L as InputField, G as Popover, U as Portal, pe as Progress, re as Radio, K as Select, ge as Sheet, ue as Skeleton, fe as Spinner, ie as Switch, z as Textarea, be as Toast, X as ToastItem, q as Tooltip, j as cn, P as element, M as merge, Q as toast, Y as varientButton };
|