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