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