seam-react 0.7.0 → 0.9.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/Select.d.ts +54 -0
- package/dist/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.js +1338 -868
- package/dist/index.js.map +1 -1
- package/dist/motion.d.ts +5 -0
- package/dist/styles.cjs +350 -2
- package/dist/styles.cjs.map +1 -1
- package/dist/styles.css +1 -1
- package/dist/styles.js +351 -3
- package/dist/styles.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,78 +1,78 @@
|
|
|
1
|
-
import { jsxs as C, jsx as
|
|
2
|
-
import { forwardRef as
|
|
3
|
-
import { useControllableState as
|
|
4
|
-
import { useReducedMotion as
|
|
5
|
-
import { createPortal as
|
|
6
|
-
function
|
|
1
|
+
import { jsxs as C, jsx as l, Fragment as _e } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as S, useId as O, useState as $, useCallback as V, useMemo as U, useRef as R, useEffect as A, createContext as W, useContext as X, useSyncExternalStore as oe, useLayoutEffect as re, isValidElement as Q, cloneElement as Z, Children as nt } from "react";
|
|
3
|
+
import { useControllableState as F, useEventCallback as D, useLockBodyScroll as ot, useFocusTrap as rt } from "seam-hooks";
|
|
4
|
+
import { useReducedMotion as H, AnimatePresence as M, motion as L, useIsPresent as ie, LayoutGroup as Te, useMotionValue as it, animate as ye, MotionConfig as pe } from "motion/react";
|
|
5
|
+
import { createPortal as ae } from "react-dom";
|
|
6
|
+
function _(...t) {
|
|
7
7
|
return t.filter(Boolean).join(" ");
|
|
8
8
|
}
|
|
9
|
-
const
|
|
9
|
+
const Ce = S(function({
|
|
10
10
|
variant: e = "primary",
|
|
11
11
|
size: n = "md",
|
|
12
|
-
loading:
|
|
13
|
-
iconOnly:
|
|
12
|
+
loading: r = !1,
|
|
13
|
+
iconOnly: i = !1,
|
|
14
14
|
type: s = "button",
|
|
15
|
-
className:
|
|
16
|
-
children:
|
|
17
|
-
...
|
|
18
|
-
},
|
|
15
|
+
className: c,
|
|
16
|
+
children: d,
|
|
17
|
+
...h
|
|
18
|
+
}, u) {
|
|
19
19
|
return /* @__PURE__ */ C(
|
|
20
20
|
"button",
|
|
21
21
|
{
|
|
22
|
-
...
|
|
23
|
-
ref:
|
|
22
|
+
...h,
|
|
23
|
+
ref: u,
|
|
24
24
|
type: s,
|
|
25
|
-
className:
|
|
25
|
+
className: _("uk-button", c),
|
|
26
26
|
"data-variant": e,
|
|
27
27
|
"data-size": n,
|
|
28
|
-
"data-loading":
|
|
29
|
-
"data-icon-only":
|
|
30
|
-
disabled:
|
|
31
|
-
"aria-busy":
|
|
28
|
+
"data-loading": r ? "true" : void 0,
|
|
29
|
+
"data-icon-only": i ? "true" : void 0,
|
|
30
|
+
disabled: h.disabled || r,
|
|
31
|
+
"aria-busy": r || void 0,
|
|
32
32
|
children: [
|
|
33
|
-
|
|
34
|
-
|
|
33
|
+
r ? /* @__PURE__ */ l("span", { className: "uk-button__spinner", "aria-hidden": "true" }) : null,
|
|
34
|
+
d
|
|
35
35
|
]
|
|
36
36
|
}
|
|
37
37
|
);
|
|
38
|
-
}),
|
|
38
|
+
}), at = S(function({
|
|
39
39
|
checked: e,
|
|
40
40
|
defaultChecked: n,
|
|
41
|
-
onCheckedChange:
|
|
42
|
-
disabled:
|
|
41
|
+
onCheckedChange: r,
|
|
42
|
+
disabled: i,
|
|
43
43
|
className: s,
|
|
44
|
-
children:
|
|
45
|
-
id:
|
|
46
|
-
...
|
|
47
|
-
},
|
|
48
|
-
const
|
|
44
|
+
children: c,
|
|
45
|
+
id: d,
|
|
46
|
+
...h
|
|
47
|
+
}, u) {
|
|
48
|
+
const o = O(), m = d ?? o, [p, b] = F({
|
|
49
49
|
value: e,
|
|
50
50
|
defaultValue: n ?? !1,
|
|
51
|
-
onChange:
|
|
51
|
+
onChange: r
|
|
52
52
|
});
|
|
53
53
|
return /* @__PURE__ */ C(
|
|
54
54
|
"label",
|
|
55
55
|
{
|
|
56
|
-
className:
|
|
57
|
-
"data-disabled":
|
|
56
|
+
className: _("uk-checkbox", s),
|
|
57
|
+
"data-disabled": i ? "true" : void 0,
|
|
58
58
|
htmlFor: m,
|
|
59
59
|
children: [
|
|
60
|
-
/* @__PURE__ */
|
|
60
|
+
/* @__PURE__ */ l(
|
|
61
61
|
"input",
|
|
62
62
|
{
|
|
63
|
-
...
|
|
64
|
-
ref:
|
|
63
|
+
...h,
|
|
64
|
+
ref: u,
|
|
65
65
|
id: m,
|
|
66
66
|
type: "checkbox",
|
|
67
67
|
className: "uk-checkbox__input",
|
|
68
|
-
checked:
|
|
69
|
-
disabled:
|
|
70
|
-
onChange: (
|
|
71
|
-
|
|
68
|
+
checked: p,
|
|
69
|
+
disabled: i,
|
|
70
|
+
onChange: (f) => {
|
|
71
|
+
i || b(f.target.checked);
|
|
72
72
|
}
|
|
73
73
|
}
|
|
74
74
|
),
|
|
75
|
-
/* @__PURE__ */
|
|
75
|
+
/* @__PURE__ */ l("span", { className: "uk-checkbox__box", "aria-hidden": "true", children: /* @__PURE__ */ l(
|
|
76
76
|
"svg",
|
|
77
77
|
{
|
|
78
78
|
className: "uk-checkbox__check",
|
|
@@ -82,223 +82,692 @@ const ye = N(function({
|
|
|
82
82
|
strokeWidth: 3.2,
|
|
83
83
|
strokeLinecap: "round",
|
|
84
84
|
strokeLinejoin: "round",
|
|
85
|
-
children: /* @__PURE__ */
|
|
85
|
+
children: /* @__PURE__ */ l("path", { d: "M4 12.5 L9.5 18 L20 7", pathLength: 1 })
|
|
86
86
|
}
|
|
87
87
|
) }),
|
|
88
|
-
|
|
88
|
+
c ? /* @__PURE__ */ l("span", { className: "uk-checkbox__label", children: c }) : null
|
|
89
89
|
]
|
|
90
90
|
}
|
|
91
91
|
);
|
|
92
92
|
});
|
|
93
|
-
|
|
94
|
-
const
|
|
95
|
-
inputSize: e = "md",
|
|
96
|
-
invalid: n = !1,
|
|
97
|
-
className: o,
|
|
98
|
-
"aria-invalid": r,
|
|
99
|
-
...s
|
|
100
|
-
}, a) {
|
|
101
|
-
return /* @__PURE__ */ c(
|
|
102
|
-
"input",
|
|
103
|
-
{
|
|
104
|
-
...s,
|
|
105
|
-
ref: a,
|
|
106
|
-
className: T("uk-input", o),
|
|
107
|
-
"data-size": e,
|
|
108
|
-
"aria-invalid": n ? !0 : r
|
|
109
|
-
}
|
|
110
|
-
);
|
|
111
|
-
}), Z = [0.23, 1, 0.32, 1], et = [0.77, 0, 0.175, 1], he = {
|
|
93
|
+
at.displayName = "CheckBox";
|
|
94
|
+
const J = [0.23, 1, 0.32, 1], ue = [0.77, 0, 0.175, 1], ve = {
|
|
112
95
|
type: "spring",
|
|
113
96
|
bounce: 0,
|
|
114
97
|
duration: 0.3
|
|
115
|
-
},
|
|
98
|
+
}, ke = {
|
|
116
99
|
type: "spring",
|
|
117
100
|
bounce: 0.04,
|
|
118
101
|
duration: 0.38
|
|
119
|
-
},
|
|
102
|
+
}, se = {
|
|
120
103
|
type: "spring",
|
|
121
104
|
bounce: 0.08,
|
|
122
105
|
duration: 0.34
|
|
123
|
-
},
|
|
106
|
+
}, Ne = {
|
|
124
107
|
duration: 0.2,
|
|
125
|
-
ease:
|
|
126
|
-
},
|
|
108
|
+
ease: ue
|
|
109
|
+
}, st = {
|
|
110
|
+
layout: { duration: 0.16, ease: ue },
|
|
111
|
+
opacity: { duration: 0.16, ease: J },
|
|
112
|
+
x: { duration: 0.16, ease: ue }
|
|
113
|
+
}, Pe = {
|
|
127
114
|
duration: 0.12,
|
|
128
|
-
ease:
|
|
129
|
-
},
|
|
115
|
+
ease: J
|
|
116
|
+
}, ct = {
|
|
130
117
|
layout: { type: "spring", bounce: 0, duration: 0.22 },
|
|
131
|
-
opacity: { duration: 0.12, ease:
|
|
132
|
-
scale: { duration: 0.12, ease:
|
|
133
|
-
},
|
|
118
|
+
opacity: { duration: 0.12, ease: J },
|
|
119
|
+
scale: { duration: 0.12, ease: J }
|
|
120
|
+
}, j = {
|
|
134
121
|
duration: 0.12,
|
|
135
|
-
ease:
|
|
136
|
-
},
|
|
122
|
+
ease: J
|
|
123
|
+
}, Ee = W(null);
|
|
124
|
+
function fe(t) {
|
|
125
|
+
const e = X(Ee);
|
|
126
|
+
if (!e)
|
|
127
|
+
throw new Error(`<${t}> must be rendered inside <Select>`);
|
|
128
|
+
return e;
|
|
129
|
+
}
|
|
130
|
+
const lt = () => () => {
|
|
131
|
+
}, ut = () => !0, dt = () => !1;
|
|
132
|
+
function Ie(t, e) {
|
|
133
|
+
return (n) => {
|
|
134
|
+
t?.(n), n.defaultPrevented || e(n);
|
|
135
|
+
};
|
|
136
|
+
}
|
|
137
|
+
function pt(t, e, n) {
|
|
138
|
+
return n < e ? e : Math.min(Math.max(t, e), n);
|
|
139
|
+
}
|
|
140
|
+
function we(t, e) {
|
|
141
|
+
const n = e ? t ?? [] : t == null ? [] : [t];
|
|
142
|
+
return Array.from(new Set(n));
|
|
143
|
+
}
|
|
144
|
+
function ft(t) {
|
|
145
|
+
return t === "bottom" ? "center top" : "center bottom";
|
|
146
|
+
}
|
|
147
|
+
function ht({
|
|
148
|
+
options: t,
|
|
149
|
+
value: e,
|
|
150
|
+
defaultValue: n = null,
|
|
151
|
+
onValueChange: r,
|
|
152
|
+
multiple: i = !1,
|
|
153
|
+
children: s
|
|
154
|
+
}) {
|
|
155
|
+
const c = O(), d = we(e, i), h = we(n, i), [u, o] = F({
|
|
156
|
+
value: e === void 0 ? void 0 : d,
|
|
157
|
+
defaultValue: h,
|
|
158
|
+
onChange: (w) => {
|
|
159
|
+
r?.(i ? w : w[0] ?? "");
|
|
160
|
+
}
|
|
161
|
+
}), [m, p] = $(!1), b = t.findIndex(
|
|
162
|
+
(w) => w.value === u[0]
|
|
163
|
+
), [f, I] = $(
|
|
164
|
+
null
|
|
165
|
+
), g = f ?? Math.max(b, 0), k = V((w) => {
|
|
166
|
+
I(w);
|
|
167
|
+
}, []), v = D((w) => {
|
|
168
|
+
const T = t[w];
|
|
169
|
+
!T || T.disabled || (o((N) => i ? N.includes(T.value) ? N.filter((P) => P !== T.value) : [...N, T.value] : N[0] === T.value ? N : [T.value]), i || (p(!1), I(null)));
|
|
170
|
+
}), a = D((w) => {
|
|
171
|
+
o(
|
|
172
|
+
(T) => T.filter((N) => N !== w)
|
|
173
|
+
);
|
|
174
|
+
}), y = D(() => {
|
|
175
|
+
o([]);
|
|
176
|
+
}), x = U(
|
|
177
|
+
() => ({
|
|
178
|
+
values: u,
|
|
179
|
+
multiple: i,
|
|
180
|
+
activeIndex: g,
|
|
181
|
+
open: m,
|
|
182
|
+
setOpen: p,
|
|
183
|
+
setActiveIndex: k,
|
|
184
|
+
commit: v,
|
|
185
|
+
removeValue: a,
|
|
186
|
+
clearValues: y,
|
|
187
|
+
triggerId: `${c}-trigger`,
|
|
188
|
+
contentId: `${c}-content`,
|
|
189
|
+
options: t
|
|
190
|
+
}),
|
|
191
|
+
[
|
|
192
|
+
g,
|
|
193
|
+
c,
|
|
194
|
+
v,
|
|
195
|
+
i,
|
|
196
|
+
m,
|
|
197
|
+
t,
|
|
198
|
+
a,
|
|
199
|
+
y,
|
|
200
|
+
k,
|
|
201
|
+
u
|
|
202
|
+
]
|
|
203
|
+
);
|
|
204
|
+
return /* @__PURE__ */ l(Ee.Provider, { value: x, children: s });
|
|
205
|
+
}
|
|
206
|
+
function te(t, e, n, r = !0) {
|
|
207
|
+
const i = t.length;
|
|
208
|
+
if (i === 0)
|
|
209
|
+
return -1;
|
|
210
|
+
for (let s = 1; s <= i; s += 1) {
|
|
211
|
+
const c = r ? (e + n * s + i * s) % i : e + n * s;
|
|
212
|
+
if (c < 0 || c >= i)
|
|
213
|
+
break;
|
|
214
|
+
if (!t[c]?.disabled)
|
|
215
|
+
return c;
|
|
216
|
+
}
|
|
217
|
+
return e;
|
|
218
|
+
}
|
|
219
|
+
const mt = S(function({
|
|
220
|
+
className: e,
|
|
221
|
+
placeholder: n = "请选择",
|
|
222
|
+
size: r = "md",
|
|
223
|
+
clear: i = !1,
|
|
224
|
+
disabled: s,
|
|
225
|
+
onPointerDown: c,
|
|
226
|
+
onKeyDown: d,
|
|
227
|
+
...h
|
|
228
|
+
}, u) {
|
|
229
|
+
const o = fe("Select.Trigger"), m = H() ?? !1, p = o.values.map((a) => o.options.find((x) => x.value === a) ?? { value: a, label: a }), b = p[0], f = R({ search: "", timer: null }), I = V(() => {
|
|
230
|
+
f.current.timer && (clearTimeout(f.current.timer), f.current.timer = null), f.current.search = "";
|
|
231
|
+
}, []);
|
|
232
|
+
A(() => I, [I]);
|
|
233
|
+
const g = D((a) => {
|
|
234
|
+
const y = f.current;
|
|
235
|
+
y.timer && clearTimeout(y.timer), y.search += a.toLowerCase(), y.timer = setTimeout(I, 500);
|
|
236
|
+
const x = o.options.map((E) => {
|
|
237
|
+
const G = E.label;
|
|
238
|
+
return (typeof G == "string" ? G : E.value).toLowerCase();
|
|
239
|
+
}), w = o.open && o.activeIndex >= 0 ? o.activeIndex + 1 : 0, T = Array.from(
|
|
240
|
+
{ length: x.length },
|
|
241
|
+
(E, G) => (w + G) % x.length
|
|
242
|
+
), N = T.find(
|
|
243
|
+
(E) => !o.options[E]?.disabled && x[E]?.startsWith(y.search)
|
|
244
|
+
), P = T.find(
|
|
245
|
+
(E) => !o.options[E]?.disabled && x[E]?.includes(y.search)
|
|
246
|
+
), q = N ?? P;
|
|
247
|
+
q !== void 0 && (o.open ? o.setActiveIndex(q) : o.multiple ? (o.setActiveIndex(q), o.setOpen(!0)) : o.commit(q));
|
|
248
|
+
}), k = D(
|
|
249
|
+
(a) => {
|
|
250
|
+
s || o.setOpen(!o.open);
|
|
251
|
+
}
|
|
252
|
+
), v = D(
|
|
253
|
+
(a) => {
|
|
254
|
+
if (!s) {
|
|
255
|
+
if (a.key.length === 1 && !a.metaKey && !a.ctrlKey && !a.altKey) {
|
|
256
|
+
a.preventDefault(), g(a.key);
|
|
257
|
+
return;
|
|
258
|
+
}
|
|
259
|
+
if (a.key === "Backspace" && o.multiple) {
|
|
260
|
+
const y = o.values[o.values.length - 1];
|
|
261
|
+
y && (a.preventDefault(), o.removeValue(y));
|
|
262
|
+
return;
|
|
263
|
+
}
|
|
264
|
+
if (!o.open) {
|
|
265
|
+
["ArrowDown", "ArrowUp", "Enter", " "].includes(a.key) && (a.preventDefault(), o.setOpen(!0), o.setActiveIndex(
|
|
266
|
+
o.activeIndex >= 0 ? o.activeIndex : te(o.options, -1, 1)
|
|
267
|
+
));
|
|
268
|
+
return;
|
|
269
|
+
}
|
|
270
|
+
if (a.key === "Escape" || a.key === "Tab") {
|
|
271
|
+
o.setOpen(!1), a.currentTarget.focus();
|
|
272
|
+
return;
|
|
273
|
+
}
|
|
274
|
+
if (a.key === "Enter" || a.key === " ") {
|
|
275
|
+
a.preventDefault(), o.commit(o.activeIndex), a.currentTarget.focus();
|
|
276
|
+
return;
|
|
277
|
+
}
|
|
278
|
+
if (a.key === "ArrowDown") {
|
|
279
|
+
a.preventDefault(), o.setActiveIndex(
|
|
280
|
+
te(o.options, o.activeIndex, 1)
|
|
281
|
+
);
|
|
282
|
+
return;
|
|
283
|
+
}
|
|
284
|
+
if (a.key === "ArrowUp") {
|
|
285
|
+
a.preventDefault(), o.setActiveIndex(
|
|
286
|
+
te(o.options, o.activeIndex, -1)
|
|
287
|
+
);
|
|
288
|
+
return;
|
|
289
|
+
}
|
|
290
|
+
if (a.key === "Home" || a.key === "End") {
|
|
291
|
+
a.preventDefault();
|
|
292
|
+
const y = a.key === "Home" ? 1 : -1, x = a.key === "Home" ? -1 : o.options.length;
|
|
293
|
+
o.setActiveIndex(
|
|
294
|
+
te(o.options, x, y, !1)
|
|
295
|
+
);
|
|
296
|
+
}
|
|
297
|
+
}
|
|
298
|
+
}
|
|
299
|
+
);
|
|
300
|
+
return /* @__PURE__ */ C(
|
|
301
|
+
"div",
|
|
302
|
+
{
|
|
303
|
+
...h,
|
|
304
|
+
ref: u,
|
|
305
|
+
id: o.triggerId,
|
|
306
|
+
role: "combobox",
|
|
307
|
+
tabIndex: s ? -1 : 0,
|
|
308
|
+
"aria-disabled": s || void 0,
|
|
309
|
+
"aria-expanded": o.open,
|
|
310
|
+
"aria-haspopup": "listbox",
|
|
311
|
+
"aria-controls": o.open ? o.contentId : void 0,
|
|
312
|
+
"aria-activedescendant": o.open && o.options[o.activeIndex] ? `${o.contentId}-option-${o.activeIndex}` : void 0,
|
|
313
|
+
"data-size": r,
|
|
314
|
+
"data-multiple": o.multiple || void 0,
|
|
315
|
+
className: _("uk-select__trigger", e),
|
|
316
|
+
onPointerDown: Ie(c, k),
|
|
317
|
+
onKeyDown: Ie(d, v),
|
|
318
|
+
children: [
|
|
319
|
+
o.multiple ? /* @__PURE__ */ C("span", { className: "uk-select__tags", children: [
|
|
320
|
+
/* @__PURE__ */ l(M, { initial: !1, children: p.map((a) => {
|
|
321
|
+
const y = a.label ?? a.value, x = typeof y == "string" ? y : a.value;
|
|
322
|
+
return /* @__PURE__ */ C(
|
|
323
|
+
L.span,
|
|
324
|
+
{
|
|
325
|
+
className: "uk-select__tag",
|
|
326
|
+
"data-slot": "select-tag",
|
|
327
|
+
layout: !0,
|
|
328
|
+
initial: m ? { opacity: 0 } : { opacity: 0, x: 12 },
|
|
329
|
+
animate: m ? { opacity: 1 } : { opacity: 1, x: 0 },
|
|
330
|
+
exit: m ? { opacity: 0 } : { opacity: 0, x: 4 },
|
|
331
|
+
transition: m ? { duration: 0 } : st,
|
|
332
|
+
children: [
|
|
333
|
+
/* @__PURE__ */ l("span", { className: "uk-select__tag-label", children: y }),
|
|
334
|
+
/* @__PURE__ */ l(
|
|
335
|
+
"button",
|
|
336
|
+
{
|
|
337
|
+
type: "button",
|
|
338
|
+
className: "uk-select__tag-remove",
|
|
339
|
+
disabled: s,
|
|
340
|
+
"aria-label": `移除 ${x}`,
|
|
341
|
+
onPointerDown: (w) => w.stopPropagation(),
|
|
342
|
+
onKeyDown: (w) => {
|
|
343
|
+
w.key === "Backspace" && w.stopPropagation();
|
|
344
|
+
},
|
|
345
|
+
onClick: (w) => {
|
|
346
|
+
w.stopPropagation(), o.removeValue(a.value);
|
|
347
|
+
},
|
|
348
|
+
children: /* @__PURE__ */ l("svg", { viewBox: "0 0 16 16", fill: "none", "aria-hidden": "true", children: /* @__PURE__ */ l(
|
|
349
|
+
"path",
|
|
350
|
+
{
|
|
351
|
+
d: "M5 5l6 6M11 5l-6 6",
|
|
352
|
+
stroke: "currentColor",
|
|
353
|
+
strokeWidth: "1.5",
|
|
354
|
+
strokeLinecap: "round"
|
|
355
|
+
}
|
|
356
|
+
) })
|
|
357
|
+
}
|
|
358
|
+
)
|
|
359
|
+
]
|
|
360
|
+
},
|
|
361
|
+
a.value
|
|
362
|
+
);
|
|
363
|
+
}) }),
|
|
364
|
+
p.length === 0 ? /* @__PURE__ */ l("span", { className: "uk-select__placeholder", children: n }) : null
|
|
365
|
+
] }) : /* @__PURE__ */ l("span", { className: "uk-select__value", children: b?.label ?? o.values[0] ?? n }),
|
|
366
|
+
/* @__PURE__ */ C("span", { className: "uk-select__actions", children: [
|
|
367
|
+
i && !s && o.values.length > 0 ? /* @__PURE__ */ l(
|
|
368
|
+
"button",
|
|
369
|
+
{
|
|
370
|
+
type: "button",
|
|
371
|
+
className: "uk-select__clear",
|
|
372
|
+
"aria-label": "清空",
|
|
373
|
+
onPointerDown: (a) => a.stopPropagation(),
|
|
374
|
+
onKeyDown: (a) => {
|
|
375
|
+
["Backspace", " "].includes(a.key) && a.stopPropagation();
|
|
376
|
+
},
|
|
377
|
+
onClick: (a) => {
|
|
378
|
+
a.stopPropagation(), document.getElementById(o.triggerId)?.focus(), o.clearValues();
|
|
379
|
+
},
|
|
380
|
+
children: /* @__PURE__ */ C(
|
|
381
|
+
"svg",
|
|
382
|
+
{
|
|
383
|
+
viewBox: "0 0 24 24",
|
|
384
|
+
fill: "none",
|
|
385
|
+
stroke: "currentColor",
|
|
386
|
+
strokeWidth: "2",
|
|
387
|
+
strokeLinecap: "round",
|
|
388
|
+
strokeLinejoin: "round",
|
|
389
|
+
"aria-hidden": "true",
|
|
390
|
+
children: [
|
|
391
|
+
/* @__PURE__ */ l("path", { d: "M18 6 6 18" }),
|
|
392
|
+
/* @__PURE__ */ l("path", { d: "m6 6 12 12" })
|
|
393
|
+
]
|
|
394
|
+
}
|
|
395
|
+
)
|
|
396
|
+
}
|
|
397
|
+
) : null,
|
|
398
|
+
/* @__PURE__ */ l("span", { "aria-hidden": "true", className: "uk-select__chevron", children: /* @__PURE__ */ l("svg", { viewBox: "0 0 16 16", fill: "none", children: /* @__PURE__ */ l(
|
|
399
|
+
"path",
|
|
400
|
+
{
|
|
401
|
+
d: "m4 6.2 4 4 4-4",
|
|
402
|
+
stroke: "currentColor",
|
|
403
|
+
strokeWidth: "1.5",
|
|
404
|
+
strokeLinecap: "round",
|
|
405
|
+
strokeLinejoin: "round"
|
|
406
|
+
}
|
|
407
|
+
) }) })
|
|
408
|
+
] })
|
|
409
|
+
]
|
|
410
|
+
}
|
|
411
|
+
);
|
|
412
|
+
});
|
|
413
|
+
function bt(t, e) {
|
|
414
|
+
const [n, r] = $(null), i = V(() => {
|
|
415
|
+
const s = e.current;
|
|
416
|
+
if (!t || !s)
|
|
417
|
+
return;
|
|
418
|
+
const c = t.getBoundingClientRect(), d = s.getBoundingClientRect(), h = window.innerHeight - c.bottom - 8, u = c.top - 8, o = h >= Math.min(d.height, 320) || h >= u ? "bottom" : "top", m = o === "bottom" ? c.bottom + 6 : c.top - d.height - 6, p = pt(
|
|
419
|
+
c.left,
|
|
420
|
+
8,
|
|
421
|
+
Math.max(8, window.innerWidth - c.width - 8)
|
|
422
|
+
);
|
|
423
|
+
r({ x: p, y: m, side: o });
|
|
424
|
+
}, [e, t]);
|
|
425
|
+
return re(() => {
|
|
426
|
+
if (!t)
|
|
427
|
+
return;
|
|
428
|
+
i(), window.addEventListener("resize", i), window.addEventListener("scroll", i, !0);
|
|
429
|
+
const s = typeof ResizeObserver > "u" ? null : new ResizeObserver(i);
|
|
430
|
+
return s?.observe(t), s?.observe(e.current ?? t), () => {
|
|
431
|
+
window.removeEventListener("resize", i), window.removeEventListener("scroll", i, !0), s?.disconnect();
|
|
432
|
+
};
|
|
433
|
+
}, [e, t, i]), n;
|
|
434
|
+
}
|
|
435
|
+
function gt({
|
|
436
|
+
emptyText: t
|
|
437
|
+
}) {
|
|
438
|
+
const e = fe("Select.Content"), n = e.triggerId, r = document.getElementById(
|
|
439
|
+
n
|
|
440
|
+
), i = R(null), s = H() ?? !1, c = ie(), d = bt(r, i), h = oe(
|
|
441
|
+
lt,
|
|
442
|
+
ut,
|
|
443
|
+
dt
|
|
444
|
+
);
|
|
445
|
+
if (A(() => {
|
|
446
|
+
if (!e.open)
|
|
447
|
+
return;
|
|
448
|
+
const o = (b) => {
|
|
449
|
+
const f = b.target;
|
|
450
|
+
f instanceof Node && (r?.contains(f) || i.current?.contains(f) || (e.setOpen(!1), r?.focus()));
|
|
451
|
+
};
|
|
452
|
+
document.addEventListener("pointerdown", o, !0);
|
|
453
|
+
const m = (b) => {
|
|
454
|
+
b.key === "Escape" && (e.setOpen(!1), r?.focus());
|
|
455
|
+
}, p = () => {
|
|
456
|
+
e.setOpen(!1);
|
|
457
|
+
};
|
|
458
|
+
return document.addEventListener("keydown", m, !0), window.addEventListener("blur", p), () => {
|
|
459
|
+
document.removeEventListener("pointerdown", o, !0), document.removeEventListener("keydown", m, !0), window.removeEventListener("blur", p);
|
|
460
|
+
};
|
|
461
|
+
}, [e, r]), !h)
|
|
462
|
+
return null;
|
|
463
|
+
const u = r?.closest("dialog") ?? document.body;
|
|
464
|
+
return ae(
|
|
465
|
+
/* @__PURE__ */ l(
|
|
466
|
+
"div",
|
|
467
|
+
{
|
|
468
|
+
ref: i,
|
|
469
|
+
className: "uk-select",
|
|
470
|
+
"data-side": d?.side ?? "bottom",
|
|
471
|
+
"data-state": c ? "open" : "closed",
|
|
472
|
+
"aria-hidden": c ? void 0 : !0,
|
|
473
|
+
style: {
|
|
474
|
+
left: d ? `${d.x}px` : 0,
|
|
475
|
+
top: d ? `${d.y}px` : 0,
|
|
476
|
+
"--uk-select-width": `${r?.offsetWidth ?? 220}px`,
|
|
477
|
+
visibility: d ? "visible" : "hidden"
|
|
478
|
+
},
|
|
479
|
+
children: /* @__PURE__ */ l(
|
|
480
|
+
L.div,
|
|
481
|
+
{
|
|
482
|
+
className: "uk-select__surface",
|
|
483
|
+
style: { transformOrigin: ft(d?.side ?? "bottom") },
|
|
484
|
+
initial: s ? { opacity: 0 } : { opacity: 0, scale: 0.97, y: -4 },
|
|
485
|
+
animate: s ? { opacity: 1 } : { opacity: 1, scale: 1, y: 0 },
|
|
486
|
+
exit: s ? { opacity: 0 } : { opacity: 0, scale: 0.97, y: -2 },
|
|
487
|
+
transition: s ? j : Ne,
|
|
488
|
+
children: e.options.length === 0 ? /* @__PURE__ */ l("p", { className: "uk-select__empty", children: t }) : /* @__PURE__ */ l(Te, { id: `select-${e.contentId}`, children: /* @__PURE__ */ l(
|
|
489
|
+
"ul",
|
|
490
|
+
{
|
|
491
|
+
id: e.contentId,
|
|
492
|
+
className: "uk-select__list",
|
|
493
|
+
role: "listbox",
|
|
494
|
+
"aria-labelledby": n,
|
|
495
|
+
children: e.options.map((o, m) => /* @__PURE__ */ C(
|
|
496
|
+
"li",
|
|
497
|
+
{
|
|
498
|
+
id: `${e.contentId}-option-${m}`,
|
|
499
|
+
role: "option",
|
|
500
|
+
"aria-disabled": o.disabled || void 0,
|
|
501
|
+
"aria-selected": e.values.includes(o.value),
|
|
502
|
+
"data-disabled": o.disabled || void 0,
|
|
503
|
+
"data-selected": e.values.includes(o.value) || void 0,
|
|
504
|
+
"data-active": m === e.activeIndex || void 0,
|
|
505
|
+
className: "uk-select__option",
|
|
506
|
+
onPointerEnter: (p) => {
|
|
507
|
+
p.pointerType === "mouse" && !o.disabled && e.setActiveIndex(m);
|
|
508
|
+
},
|
|
509
|
+
onClick: (p) => {
|
|
510
|
+
p.stopPropagation(), e.commit(m);
|
|
511
|
+
},
|
|
512
|
+
children: [
|
|
513
|
+
/* @__PURE__ */ l(M, { initial: !1, children: m === e.activeIndex ? /* @__PURE__ */ l(
|
|
514
|
+
L.span,
|
|
515
|
+
{
|
|
516
|
+
className: "uk-select__option-highlight",
|
|
517
|
+
"data-slot": "select-active-highlight",
|
|
518
|
+
layoutId: `${e.contentId}-active`,
|
|
519
|
+
"aria-hidden": "true",
|
|
520
|
+
initial: { opacity: 0 },
|
|
521
|
+
animate: { opacity: 1 },
|
|
522
|
+
exit: { opacity: 0 },
|
|
523
|
+
transition: s ? { duration: 0 } : se
|
|
524
|
+
}
|
|
525
|
+
) : null }),
|
|
526
|
+
/* @__PURE__ */ l("span", { className: "uk-select__option-label", children: o.label ?? o.value }),
|
|
527
|
+
/* @__PURE__ */ l("span", { "aria-hidden": "true", className: "uk-select__check" })
|
|
528
|
+
]
|
|
529
|
+
},
|
|
530
|
+
o.value
|
|
531
|
+
))
|
|
532
|
+
}
|
|
533
|
+
) })
|
|
534
|
+
}
|
|
535
|
+
)
|
|
536
|
+
}
|
|
537
|
+
),
|
|
538
|
+
u
|
|
539
|
+
);
|
|
540
|
+
}
|
|
541
|
+
const Wt = S(function({
|
|
542
|
+
options: e,
|
|
543
|
+
multiple: n,
|
|
544
|
+
value: r,
|
|
545
|
+
defaultValue: i,
|
|
546
|
+
onValueChange: s,
|
|
547
|
+
placeholder: c,
|
|
548
|
+
size: d = "md",
|
|
549
|
+
clear: h,
|
|
550
|
+
disabled: u,
|
|
551
|
+
invalid: o,
|
|
552
|
+
emptyText: m = "暂无可选项",
|
|
553
|
+
className: p,
|
|
554
|
+
...b
|
|
555
|
+
}, f) {
|
|
556
|
+
return /* @__PURE__ */ C(
|
|
557
|
+
ht,
|
|
558
|
+
{
|
|
559
|
+
options: e,
|
|
560
|
+
multiple: n,
|
|
561
|
+
value: r,
|
|
562
|
+
defaultValue: i,
|
|
563
|
+
onValueChange: s,
|
|
564
|
+
children: [
|
|
565
|
+
/* @__PURE__ */ l(
|
|
566
|
+
mt,
|
|
567
|
+
{
|
|
568
|
+
...b,
|
|
569
|
+
ref: f,
|
|
570
|
+
placeholder: c,
|
|
571
|
+
size: d,
|
|
572
|
+
clear: h,
|
|
573
|
+
disabled: u,
|
|
574
|
+
"aria-invalid": o || void 0,
|
|
575
|
+
"data-size": d,
|
|
576
|
+
className: p
|
|
577
|
+
}
|
|
578
|
+
),
|
|
579
|
+
/* @__PURE__ */ l(yt, { emptyText: m })
|
|
580
|
+
]
|
|
581
|
+
}
|
|
582
|
+
);
|
|
583
|
+
});
|
|
584
|
+
function yt({ emptyText: t }) {
|
|
585
|
+
const e = fe("Select.Content");
|
|
586
|
+
return /* @__PURE__ */ l(M, { children: e.open ? /* @__PURE__ */ l(gt, { emptyText: t }, "select-layer") : null });
|
|
587
|
+
}
|
|
588
|
+
const Xt = S(function({
|
|
589
|
+
inputSize: e = "md",
|
|
590
|
+
invalid: n = !1,
|
|
591
|
+
className: r,
|
|
592
|
+
"aria-invalid": i,
|
|
593
|
+
...s
|
|
594
|
+
}, c) {
|
|
595
|
+
return /* @__PURE__ */ l(
|
|
596
|
+
"input",
|
|
597
|
+
{
|
|
598
|
+
...s,
|
|
599
|
+
ref: c,
|
|
600
|
+
className: _("uk-input", r),
|
|
601
|
+
"data-size": e,
|
|
602
|
+
"aria-invalid": n ? !0 : i
|
|
603
|
+
}
|
|
604
|
+
);
|
|
605
|
+
}), Yt = S(function({
|
|
137
606
|
checked: e,
|
|
138
607
|
defaultChecked: n,
|
|
139
|
-
onCheckedChange:
|
|
140
|
-
disabled:
|
|
608
|
+
onCheckedChange: r,
|
|
609
|
+
disabled: i,
|
|
141
610
|
className: s,
|
|
142
|
-
children:
|
|
143
|
-
id:
|
|
144
|
-
...
|
|
145
|
-
},
|
|
146
|
-
const
|
|
611
|
+
children: c,
|
|
612
|
+
id: d,
|
|
613
|
+
...h
|
|
614
|
+
}, u) {
|
|
615
|
+
const o = O(), m = d ?? o, p = H() ?? !1, b = R(!1), f = R(null), [I, g] = F({
|
|
147
616
|
value: e,
|
|
148
617
|
defaultValue: n ?? !1,
|
|
149
|
-
onChange:
|
|
150
|
-
}),
|
|
151
|
-
|
|
152
|
-
if (
|
|
618
|
+
onChange: r
|
|
619
|
+
}), k = it(I ? 16 : 0);
|
|
620
|
+
A(() => {
|
|
621
|
+
if (f.current)
|
|
153
622
|
return;
|
|
154
|
-
const
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
623
|
+
const a = ye(
|
|
624
|
+
k,
|
|
625
|
+
I ? 16 : 0,
|
|
626
|
+
p ? { duration: 0 } : ve
|
|
158
627
|
);
|
|
159
|
-
return () =>
|
|
160
|
-
}, [
|
|
161
|
-
const
|
|
162
|
-
const
|
|
163
|
-
if (!(!
|
|
164
|
-
if (
|
|
165
|
-
const
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
628
|
+
return () => a.stop();
|
|
629
|
+
}, [I, p, k]);
|
|
630
|
+
const v = (a) => {
|
|
631
|
+
const y = f.current;
|
|
632
|
+
if (!(!y || y.pointerId !== a.pointerId)) {
|
|
633
|
+
if (y.moved) {
|
|
634
|
+
const x = y.samples[0], w = y.samples[y.samples.length - 1], T = x && w ? Math.max(w.time - x.time, 1) : 1, N = x && w ? (w.x - x.x) / T * 1e3 : 0, P = Math.abs(N) > 220 ? N > 0 : k.get() >= 8;
|
|
635
|
+
b.current = !0, f.current = null, g(P), ye(
|
|
636
|
+
k,
|
|
637
|
+
P ? 16 : 0,
|
|
638
|
+
p ? { duration: 0 } : { ...ve, velocity: N }
|
|
170
639
|
), window.setTimeout(() => {
|
|
171
|
-
|
|
640
|
+
b.current = !1;
|
|
172
641
|
}, 0);
|
|
173
642
|
} else
|
|
174
|
-
|
|
175
|
-
|
|
643
|
+
f.current = null;
|
|
644
|
+
a.currentTarget.hasPointerCapture(a.pointerId) && typeof a.currentTarget.releasePointerCapture == "function" && a.currentTarget.releasePointerCapture(a.pointerId);
|
|
176
645
|
}
|
|
177
646
|
};
|
|
178
647
|
return /* @__PURE__ */ C(
|
|
179
648
|
"label",
|
|
180
649
|
{
|
|
181
|
-
className:
|
|
182
|
-
"data-disabled":
|
|
650
|
+
className: _("uk-switch", s),
|
|
651
|
+
"data-disabled": i ? "true" : void 0,
|
|
183
652
|
htmlFor: m,
|
|
184
|
-
onClickCapture: (
|
|
185
|
-
|
|
653
|
+
onClickCapture: (a) => {
|
|
654
|
+
b.current && (a.preventDefault(), a.stopPropagation());
|
|
186
655
|
},
|
|
187
656
|
children: [
|
|
188
|
-
/* @__PURE__ */
|
|
657
|
+
/* @__PURE__ */ l(
|
|
189
658
|
"input",
|
|
190
659
|
{
|
|
191
|
-
...
|
|
192
|
-
ref:
|
|
660
|
+
...h,
|
|
661
|
+
ref: u,
|
|
193
662
|
id: m,
|
|
194
663
|
type: "checkbox",
|
|
195
664
|
role: "switch",
|
|
196
665
|
className: "uk-switch__input",
|
|
197
|
-
checked:
|
|
198
|
-
disabled:
|
|
199
|
-
"aria-checked":
|
|
200
|
-
onChange: (
|
|
666
|
+
checked: I,
|
|
667
|
+
disabled: i,
|
|
668
|
+
"aria-checked": I,
|
|
669
|
+
onChange: (a) => g(a.target.checked)
|
|
201
670
|
}
|
|
202
671
|
),
|
|
203
|
-
/* @__PURE__ */
|
|
672
|
+
/* @__PURE__ */ l(
|
|
204
673
|
"span",
|
|
205
674
|
{
|
|
206
675
|
className: "uk-switch__track",
|
|
207
676
|
"aria-hidden": "true",
|
|
208
|
-
onPointerDown: (
|
|
209
|
-
|
|
210
|
-
pointerId:
|
|
211
|
-
startX:
|
|
212
|
-
startValue:
|
|
677
|
+
onPointerDown: (a) => {
|
|
678
|
+
i || (f.current = {
|
|
679
|
+
pointerId: a.pointerId,
|
|
680
|
+
startX: a.clientX,
|
|
681
|
+
startValue: k.get(),
|
|
213
682
|
moved: !1,
|
|
214
|
-
samples: [{ x:
|
|
215
|
-
}, typeof
|
|
683
|
+
samples: [{ x: a.clientX, time: performance.now() }]
|
|
684
|
+
}, typeof a.currentTarget.setPointerCapture == "function" && a.currentTarget.setPointerCapture(a.pointerId));
|
|
216
685
|
},
|
|
217
|
-
onPointerMove: (
|
|
218
|
-
const
|
|
219
|
-
if (!
|
|
686
|
+
onPointerMove: (a) => {
|
|
687
|
+
const y = f.current;
|
|
688
|
+
if (!y || y.pointerId !== a.pointerId)
|
|
220
689
|
return;
|
|
221
|
-
const
|
|
222
|
-
Math.abs(
|
|
690
|
+
const x = a.clientX - y.startX;
|
|
691
|
+
Math.abs(x) > 4 && (y.moved = !0), y.moved && (a.preventDefault(), k.set(Math.max(0, Math.min(16, y.startValue + x))), y.samples.push({ x: a.clientX, time: performance.now() }), y.samples = y.samples.filter(
|
|
223
692
|
(w) => performance.now() - w.time < 120
|
|
224
693
|
));
|
|
225
694
|
},
|
|
226
|
-
onPointerUp:
|
|
227
|
-
onPointerCancel:
|
|
228
|
-
children: /* @__PURE__ */
|
|
695
|
+
onPointerUp: v,
|
|
696
|
+
onPointerCancel: v,
|
|
697
|
+
children: /* @__PURE__ */ l(L.span, { className: "uk-switch__thumb", style: { x: k } })
|
|
229
698
|
}
|
|
230
699
|
),
|
|
231
|
-
|
|
700
|
+
c ? /* @__PURE__ */ l("span", { className: "uk-switch__label", children: c }) : null
|
|
232
701
|
]
|
|
233
702
|
}
|
|
234
703
|
);
|
|
235
|
-
}),
|
|
236
|
-
function
|
|
237
|
-
const e =
|
|
704
|
+
}), De = W(null);
|
|
705
|
+
function Le(t) {
|
|
706
|
+
const e = X(De);
|
|
238
707
|
if (!e)
|
|
239
708
|
throw new Error(`<${t}> must be rendered inside <Sidebar>`);
|
|
240
709
|
return e;
|
|
241
710
|
}
|
|
242
|
-
function
|
|
711
|
+
function le(t, e) {
|
|
243
712
|
return (n) => {
|
|
244
713
|
t?.(n), n.defaultPrevented || e(n);
|
|
245
714
|
};
|
|
246
715
|
}
|
|
247
|
-
function
|
|
716
|
+
function vt({
|
|
248
717
|
children: t,
|
|
249
718
|
className: e,
|
|
250
719
|
hoverPreview: n = !0,
|
|
251
|
-
hoverIndicator:
|
|
252
|
-
groupGap:
|
|
720
|
+
hoverIndicator: r = "rail",
|
|
721
|
+
groupGap: i,
|
|
253
722
|
style: s,
|
|
254
|
-
...
|
|
723
|
+
...c
|
|
255
724
|
}) {
|
|
256
|
-
const [
|
|
725
|
+
const [d, h] = $(null), u = O().replace(/:/g, ""), o = U(
|
|
257
726
|
() => ({
|
|
258
|
-
hoveredId:
|
|
259
|
-
setHoveredId:
|
|
260
|
-
indicatorBaseId:
|
|
727
|
+
hoveredId: d,
|
|
728
|
+
setHoveredId: h,
|
|
729
|
+
indicatorBaseId: u,
|
|
261
730
|
hoverPreview: n,
|
|
262
|
-
hoverIndicator:
|
|
731
|
+
hoverIndicator: r
|
|
263
732
|
}),
|
|
264
|
-
[
|
|
265
|
-
), m = typeof
|
|
733
|
+
[d, u, n, r]
|
|
734
|
+
), m = typeof i == "number" ? `${i}px` : i, p = {
|
|
266
735
|
...s,
|
|
267
736
|
...m === void 0 ? {} : { "--uk-sidebar-group-gap": m }
|
|
268
737
|
};
|
|
269
|
-
return /* @__PURE__ */
|
|
738
|
+
return /* @__PURE__ */ l(De.Provider, { value: o, children: /* @__PURE__ */ l(Te, { id: `sidebar-${u}`, children: /* @__PURE__ */ l(
|
|
270
739
|
"nav",
|
|
271
740
|
{
|
|
272
|
-
...
|
|
273
|
-
className:
|
|
274
|
-
style:
|
|
741
|
+
...c,
|
|
742
|
+
className: _("uk-sidebar", e),
|
|
743
|
+
style: p,
|
|
275
744
|
children: t
|
|
276
745
|
}
|
|
277
746
|
) }) });
|
|
278
747
|
}
|
|
279
|
-
function
|
|
748
|
+
function kt({
|
|
280
749
|
title: t,
|
|
281
750
|
icon: e,
|
|
282
751
|
collapsible: n = !1,
|
|
283
|
-
open:
|
|
284
|
-
defaultOpen:
|
|
752
|
+
open: r,
|
|
753
|
+
defaultOpen: i = !0,
|
|
285
754
|
onOpenChange: s,
|
|
286
|
-
children:
|
|
287
|
-
className:
|
|
288
|
-
...
|
|
755
|
+
children: c,
|
|
756
|
+
className: d,
|
|
757
|
+
...h
|
|
289
758
|
}) {
|
|
290
|
-
const
|
|
291
|
-
value:
|
|
292
|
-
defaultValue:
|
|
759
|
+
const u = O(), o = O(), m = O(), p = R(null), b = R(null), f = Le("Sidebar.Group"), I = e != null, g = H() ?? !1, [k, v] = F({
|
|
760
|
+
value: r,
|
|
761
|
+
defaultValue: i,
|
|
293
762
|
onChange: s
|
|
294
|
-
}),
|
|
295
|
-
|
|
296
|
-
!n ||
|
|
297
|
-
}, [n,
|
|
298
|
-
const
|
|
299
|
-
|
|
300
|
-
/* @__PURE__ */
|
|
301
|
-
n ? /* @__PURE__ */
|
|
763
|
+
}), a = n ? k : !0, y = f.hoveredId === m;
|
|
764
|
+
A(() => {
|
|
765
|
+
!n || a || b.current?.contains(document.activeElement) && p.current?.focus();
|
|
766
|
+
}, [n, a]);
|
|
767
|
+
const x = /* @__PURE__ */ C(_e, { children: [
|
|
768
|
+
I ? /* @__PURE__ */ l("span", { className: "uk-sidebar__group-icon", "aria-hidden": "true", children: e }) : null,
|
|
769
|
+
/* @__PURE__ */ l("span", { className: "uk-sidebar__group-label", children: t }),
|
|
770
|
+
n ? /* @__PURE__ */ l("span", { className: "uk-sidebar__chevron", "aria-hidden": "true", children: /* @__PURE__ */ l("svg", { viewBox: "0 0 16 16", width: "12", height: "12", fill: "none", children: /* @__PURE__ */ l(
|
|
302
771
|
"path",
|
|
303
772
|
{
|
|
304
773
|
d: "m6 3.8 4.2 4.2L6 12.2",
|
|
@@ -312,538 +781,538 @@ function rt({
|
|
|
312
781
|
return /* @__PURE__ */ C(
|
|
313
782
|
"section",
|
|
314
783
|
{
|
|
315
|
-
...
|
|
316
|
-
className:
|
|
317
|
-
"aria-labelledby":
|
|
784
|
+
...h,
|
|
785
|
+
className: _("uk-sidebar__group", d),
|
|
786
|
+
"aria-labelledby": h["aria-labelledby"] ?? u,
|
|
318
787
|
"data-collapsible": n ? "true" : "false",
|
|
319
|
-
"data-has-icon":
|
|
320
|
-
"data-state":
|
|
788
|
+
"data-has-icon": I ? "true" : "false",
|
|
789
|
+
"data-state": a ? "open" : "closed",
|
|
321
790
|
children: [
|
|
322
791
|
n ? /* @__PURE__ */ C(
|
|
323
792
|
"button",
|
|
324
793
|
{
|
|
325
|
-
ref:
|
|
794
|
+
ref: p,
|
|
326
795
|
type: "button",
|
|
327
796
|
className: "uk-sidebar__group-title uk-sidebar__group-trigger",
|
|
328
|
-
id:
|
|
329
|
-
"aria-controls":
|
|
330
|
-
"aria-expanded":
|
|
331
|
-
"data-preview":
|
|
332
|
-
onClick: () =>
|
|
797
|
+
id: u,
|
|
798
|
+
"aria-controls": o,
|
|
799
|
+
"aria-expanded": a,
|
|
800
|
+
"data-preview": f.hoverIndicator === "background" && y ? "true" : void 0,
|
|
801
|
+
onClick: () => v((w) => !w),
|
|
333
802
|
onPointerEnter: (w) => {
|
|
334
|
-
|
|
803
|
+
f.hoverPreview && f.hoverIndicator === "background" && w.pointerType === "mouse" && f.setHoveredId(m);
|
|
335
804
|
},
|
|
336
805
|
onPointerLeave: () => {
|
|
337
|
-
|
|
806
|
+
f.hoveredId === m && f.setHoveredId(null);
|
|
338
807
|
},
|
|
339
808
|
onPointerCancel: () => {
|
|
340
|
-
|
|
809
|
+
f.hoveredId === m && f.setHoveredId(null);
|
|
341
810
|
},
|
|
342
811
|
children: [
|
|
343
|
-
/* @__PURE__ */
|
|
344
|
-
|
|
812
|
+
/* @__PURE__ */ l(M, { initial: !1, children: f.hoverPreview && f.hoverIndicator === "background" && y ? /* @__PURE__ */ l(
|
|
813
|
+
L.span,
|
|
345
814
|
{
|
|
346
815
|
className: "uk-sidebar__group-surface",
|
|
347
816
|
"data-kind": "hover",
|
|
348
817
|
"data-slot": "sidebar-hover-highlight",
|
|
349
|
-
layoutId: `${
|
|
818
|
+
layoutId: `${f.indicatorBaseId}-hover`,
|
|
350
819
|
"aria-hidden": "true",
|
|
351
820
|
initial: { opacity: 0 },
|
|
352
821
|
animate: { opacity: 1 },
|
|
353
822
|
exit: { opacity: 0 },
|
|
354
|
-
transition:
|
|
823
|
+
transition: g ? { duration: 0 } : se
|
|
355
824
|
}
|
|
356
825
|
) : null }),
|
|
357
|
-
|
|
826
|
+
x
|
|
358
827
|
]
|
|
359
828
|
}
|
|
360
|
-
) : /* @__PURE__ */
|
|
361
|
-
/* @__PURE__ */
|
|
362
|
-
|
|
829
|
+
) : /* @__PURE__ */ l("div", { className: "uk-sidebar__group-title", id: u, children: x }),
|
|
830
|
+
/* @__PURE__ */ l(
|
|
831
|
+
L.div,
|
|
363
832
|
{
|
|
364
|
-
ref:
|
|
833
|
+
ref: b,
|
|
365
834
|
className: "uk-sidebar__content",
|
|
366
|
-
id:
|
|
367
|
-
"data-state":
|
|
835
|
+
id: o,
|
|
836
|
+
"data-state": a ? "open" : "closed",
|
|
368
837
|
initial: !1,
|
|
369
838
|
animate: {
|
|
370
|
-
height:
|
|
371
|
-
opacity:
|
|
839
|
+
height: a ? "auto" : 0,
|
|
840
|
+
opacity: a ? 1 : 0
|
|
372
841
|
},
|
|
373
|
-
transition:
|
|
374
|
-
inert: n && !
|
|
375
|
-
"aria-hidden": n && !
|
|
376
|
-
children: /* @__PURE__ */
|
|
842
|
+
transition: g ? { duration: 0 } : Ne,
|
|
843
|
+
inert: n && !a,
|
|
844
|
+
"aria-hidden": n && !a ? !0 : void 0,
|
|
845
|
+
children: /* @__PURE__ */ l("ul", { className: "uk-sidebar__list", children: c })
|
|
377
846
|
}
|
|
378
847
|
)
|
|
379
848
|
]
|
|
380
849
|
}
|
|
381
850
|
);
|
|
382
851
|
}
|
|
383
|
-
function
|
|
852
|
+
function It({
|
|
384
853
|
active: t = !1,
|
|
385
854
|
children: e,
|
|
386
855
|
className: n
|
|
387
856
|
}) {
|
|
388
|
-
const
|
|
389
|
-
if (!
|
|
857
|
+
const r = Le("Sidebar.Item"), i = O(), c = H() ?? !1 ? { duration: 0 } : se;
|
|
858
|
+
if (!Q(e))
|
|
390
859
|
throw new Error("<Sidebar.Item> expects a single valid React element");
|
|
391
|
-
const
|
|
392
|
-
/* @__PURE__ */
|
|
393
|
-
/* @__PURE__ */
|
|
394
|
-
|
|
860
|
+
const d = e, h = d.props, u = h.className, o = typeof u == "function" ? (g) => _("uk-sidebar__link", u(g), n) : _("uk-sidebar__link", u, n), m = h.onPointerEnter, p = h.onPointerLeave, b = h.onPointerCancel, f = r.hoveredId === i, I = /* @__PURE__ */ C(_e, { children: [
|
|
861
|
+
/* @__PURE__ */ l("span", { className: "uk-sidebar__rail", "aria-hidden": "true" }),
|
|
862
|
+
/* @__PURE__ */ l(M, { initial: !1, children: r.hoverPreview && r.hoverIndicator === "rail" && f ? /* @__PURE__ */ l(
|
|
863
|
+
L.span,
|
|
395
864
|
{
|
|
396
865
|
className: "uk-sidebar__rail-indicator",
|
|
397
866
|
"data-kind": "hover",
|
|
398
867
|
"data-slot": "sidebar-hover-rail-indicator",
|
|
399
|
-
layoutId: `${
|
|
868
|
+
layoutId: `${r.indicatorBaseId}-hover-rail`,
|
|
400
869
|
"aria-hidden": "true",
|
|
401
870
|
initial: { opacity: 0 },
|
|
402
871
|
animate: { opacity: 1 },
|
|
403
872
|
exit: { opacity: 0 },
|
|
404
|
-
transition:
|
|
873
|
+
transition: c
|
|
405
874
|
}
|
|
406
875
|
) : null }),
|
|
407
|
-
/* @__PURE__ */
|
|
408
|
-
|
|
876
|
+
/* @__PURE__ */ l(M, { initial: !1, children: r.hoverIndicator === "rail" && t ? /* @__PURE__ */ l(
|
|
877
|
+
L.span,
|
|
409
878
|
{
|
|
410
879
|
className: "uk-sidebar__rail-indicator",
|
|
411
880
|
"data-kind": "active",
|
|
412
881
|
"data-slot": "sidebar-active-rail-indicator",
|
|
413
|
-
layoutId: `${
|
|
882
|
+
layoutId: `${r.indicatorBaseId}-active-rail`,
|
|
414
883
|
"aria-hidden": "true",
|
|
415
884
|
initial: { opacity: 0 },
|
|
416
885
|
animate: { opacity: 1 },
|
|
417
886
|
exit: { opacity: 0 },
|
|
418
|
-
transition:
|
|
887
|
+
transition: c
|
|
419
888
|
}
|
|
420
889
|
) : null }),
|
|
421
|
-
/* @__PURE__ */
|
|
422
|
-
|
|
890
|
+
/* @__PURE__ */ l(M, { initial: !1, children: r.hoverPreview && r.hoverIndicator === "background" && f ? /* @__PURE__ */ l(
|
|
891
|
+
L.span,
|
|
423
892
|
{
|
|
424
893
|
className: "uk-sidebar__surface",
|
|
425
894
|
"data-kind": "hover",
|
|
426
895
|
"data-slot": "sidebar-hover-highlight",
|
|
427
|
-
layoutId: `${
|
|
896
|
+
layoutId: `${r.indicatorBaseId}-hover`,
|
|
428
897
|
"aria-hidden": "true",
|
|
429
898
|
initial: { opacity: 0 },
|
|
430
899
|
animate: { opacity: 1 },
|
|
431
900
|
exit: { opacity: 0 },
|
|
432
|
-
transition:
|
|
901
|
+
transition: c
|
|
433
902
|
}
|
|
434
903
|
) : null }),
|
|
435
|
-
/* @__PURE__ */
|
|
436
|
-
|
|
904
|
+
/* @__PURE__ */ l(M, { initial: !1, children: r.hoverIndicator === "background" && t ? /* @__PURE__ */ l(
|
|
905
|
+
L.span,
|
|
437
906
|
{
|
|
438
907
|
className: "uk-sidebar__surface",
|
|
439
908
|
"data-kind": "active",
|
|
440
909
|
"data-slot": "sidebar-active-highlight",
|
|
441
|
-
layoutId: `${
|
|
910
|
+
layoutId: `${r.indicatorBaseId}-active`,
|
|
442
911
|
"aria-hidden": "true",
|
|
443
912
|
initial: { opacity: 0 },
|
|
444
913
|
animate: { opacity: 1 },
|
|
445
914
|
exit: { opacity: 0 },
|
|
446
|
-
transition:
|
|
915
|
+
transition: c
|
|
447
916
|
}
|
|
448
917
|
) : null }),
|
|
449
|
-
/* @__PURE__ */
|
|
918
|
+
/* @__PURE__ */ l("span", { className: "uk-sidebar__label", children: h.children })
|
|
450
919
|
] });
|
|
451
|
-
return /* @__PURE__ */
|
|
452
|
-
|
|
920
|
+
return /* @__PURE__ */ l("li", { className: "uk-sidebar__item", children: Z(
|
|
921
|
+
d,
|
|
453
922
|
{
|
|
454
|
-
className:
|
|
923
|
+
className: o,
|
|
455
924
|
"data-active": t ? "true" : "false",
|
|
456
|
-
"data-preview": t ||
|
|
457
|
-
"aria-current":
|
|
458
|
-
onPointerEnter:
|
|
925
|
+
"data-preview": t || f ? "true" : "false",
|
|
926
|
+
"aria-current": h["aria-current"] ?? (t ? "page" : void 0),
|
|
927
|
+
onPointerEnter: le(
|
|
459
928
|
m,
|
|
460
|
-
(
|
|
461
|
-
|
|
929
|
+
(g) => {
|
|
930
|
+
r.hoverPreview && g.pointerType === "mouse" && r.setHoveredId(i);
|
|
462
931
|
}
|
|
463
932
|
),
|
|
464
|
-
onPointerLeave:
|
|
465
|
-
|
|
933
|
+
onPointerLeave: le(p, () => {
|
|
934
|
+
r.hoveredId === i && r.setHoveredId(null);
|
|
466
935
|
}),
|
|
467
|
-
onPointerCancel:
|
|
468
|
-
|
|
936
|
+
onPointerCancel: le(b, () => {
|
|
937
|
+
r.hoveredId === i && r.setHoveredId(null);
|
|
469
938
|
})
|
|
470
939
|
},
|
|
471
|
-
|
|
940
|
+
I
|
|
472
941
|
) });
|
|
473
942
|
}
|
|
474
|
-
const
|
|
475
|
-
Group:
|
|
476
|
-
Item:
|
|
477
|
-
}),
|
|
478
|
-
function
|
|
479
|
-
const e =
|
|
943
|
+
const Jt = Object.assign(vt, {
|
|
944
|
+
Group: kt,
|
|
945
|
+
Item: It
|
|
946
|
+
}), Se = W(null);
|
|
947
|
+
function he(t) {
|
|
948
|
+
const e = X(Se);
|
|
480
949
|
if (!e)
|
|
481
950
|
throw new Error(`<${t}> must be rendered inside <Tabs>`);
|
|
482
951
|
return e;
|
|
483
952
|
}
|
|
484
|
-
function
|
|
953
|
+
function Re(t, e) {
|
|
485
954
|
return `${t}-tab-${encodeURIComponent(e)}`;
|
|
486
955
|
}
|
|
487
|
-
function
|
|
956
|
+
function Oe(t, e) {
|
|
488
957
|
return `${t}-panel-${encodeURIComponent(e)}`;
|
|
489
958
|
}
|
|
490
|
-
function
|
|
959
|
+
function wt({
|
|
491
960
|
value: t,
|
|
492
961
|
defaultValue: e,
|
|
493
962
|
onValueChange: n,
|
|
494
|
-
orientation:
|
|
495
|
-
className:
|
|
963
|
+
orientation: r = "horizontal",
|
|
964
|
+
className: i,
|
|
496
965
|
children: s
|
|
497
966
|
}) {
|
|
498
|
-
const
|
|
967
|
+
const c = O(), [d, h] = F({
|
|
499
968
|
value: t,
|
|
500
969
|
defaultValue: e ?? "",
|
|
501
970
|
onChange: n
|
|
502
|
-
}),
|
|
971
|
+
}), u = U(
|
|
503
972
|
() => ({
|
|
504
|
-
baseId:
|
|
505
|
-
value:
|
|
506
|
-
setValue:
|
|
507
|
-
orientation:
|
|
508
|
-
indicatorId: `${
|
|
973
|
+
baseId: c,
|
|
974
|
+
value: d,
|
|
975
|
+
setValue: h,
|
|
976
|
+
orientation: r,
|
|
977
|
+
indicatorId: `${c}-indicator`
|
|
509
978
|
}),
|
|
510
|
-
[
|
|
979
|
+
[c, d, r, h]
|
|
511
980
|
);
|
|
512
|
-
return /* @__PURE__ */
|
|
981
|
+
return /* @__PURE__ */ l(Se.Provider, { value: u, children: /* @__PURE__ */ l("div", { className: _("uk-tabs", i), "data-orientation": r, children: s }) });
|
|
513
982
|
}
|
|
514
|
-
const
|
|
515
|
-
const { orientation: s } =
|
|
516
|
-
return /* @__PURE__ */
|
|
983
|
+
const xt = S(function({ className: e, onKeyDown: n, ...r }, i) {
|
|
984
|
+
const { orientation: s } = he("Tabs.List");
|
|
985
|
+
return /* @__PURE__ */ l(
|
|
517
986
|
"div",
|
|
518
987
|
{
|
|
519
|
-
...
|
|
520
|
-
ref:
|
|
988
|
+
...r,
|
|
989
|
+
ref: i,
|
|
521
990
|
role: "tablist",
|
|
522
991
|
"aria-orientation": s,
|
|
523
992
|
tabIndex: -1,
|
|
524
|
-
className:
|
|
525
|
-
onKeyDown: (
|
|
526
|
-
if (n?.(
|
|
993
|
+
className: _("uk-tabs__list", e),
|
|
994
|
+
onKeyDown: (c) => {
|
|
995
|
+
if (n?.(c), c.defaultPrevented)
|
|
527
996
|
return;
|
|
528
|
-
const
|
|
529
|
-
if (!
|
|
997
|
+
const h = c.target?.closest('[role="tab"]');
|
|
998
|
+
if (!h || h.hasAttribute("disabled"))
|
|
530
999
|
return;
|
|
531
|
-
const
|
|
532
|
-
|
|
1000
|
+
const u = Array.from(
|
|
1001
|
+
c.currentTarget.querySelectorAll(
|
|
533
1002
|
'[role="tab"]:not([disabled])'
|
|
534
1003
|
)
|
|
535
|
-
),
|
|
536
|
-
if (
|
|
1004
|
+
), o = u.indexOf(h);
|
|
1005
|
+
if (o === -1)
|
|
537
1006
|
return;
|
|
538
|
-
const m = s === "horizontal" ? "ArrowRight" : "ArrowDown",
|
|
539
|
-
let
|
|
540
|
-
switch (
|
|
1007
|
+
const m = s === "horizontal" ? "ArrowRight" : "ArrowDown", p = s === "horizontal" ? "ArrowLeft" : "ArrowUp";
|
|
1008
|
+
let b = -1;
|
|
1009
|
+
switch (c.key) {
|
|
541
1010
|
case m:
|
|
542
|
-
|
|
1011
|
+
b = (o + 1) % u.length;
|
|
543
1012
|
break;
|
|
544
|
-
case
|
|
545
|
-
|
|
1013
|
+
case p:
|
|
1014
|
+
b = (o - 1 + u.length) % u.length;
|
|
546
1015
|
break;
|
|
547
1016
|
case "Home":
|
|
548
|
-
|
|
1017
|
+
b = 0;
|
|
549
1018
|
break;
|
|
550
1019
|
case "End":
|
|
551
|
-
|
|
1020
|
+
b = u.length - 1;
|
|
552
1021
|
break;
|
|
553
1022
|
default:
|
|
554
1023
|
return;
|
|
555
1024
|
}
|
|
556
|
-
|
|
557
|
-
const
|
|
558
|
-
|
|
1025
|
+
c.preventDefault();
|
|
1026
|
+
const f = u[b];
|
|
1027
|
+
f && (f.focus(), f.click());
|
|
559
1028
|
}
|
|
560
1029
|
}
|
|
561
1030
|
);
|
|
562
|
-
}),
|
|
563
|
-
const
|
|
1031
|
+
}), _t = S(function({ value: e, type: n = "button", className: r, onClick: i, children: s, ...c }, d) {
|
|
1032
|
+
const h = he("Tabs.Trigger"), u = h.value === e, o = H() ?? !1;
|
|
564
1033
|
return /* @__PURE__ */ C(
|
|
565
1034
|
"button",
|
|
566
1035
|
{
|
|
567
|
-
...
|
|
568
|
-
ref:
|
|
1036
|
+
...c,
|
|
1037
|
+
ref: d,
|
|
569
1038
|
type: n,
|
|
570
1039
|
role: "tab",
|
|
571
|
-
id:
|
|
572
|
-
"aria-selected":
|
|
573
|
-
"aria-controls":
|
|
574
|
-
tabIndex:
|
|
575
|
-
"data-state":
|
|
576
|
-
className:
|
|
1040
|
+
id: Re(h.baseId, e),
|
|
1041
|
+
"aria-selected": u,
|
|
1042
|
+
"aria-controls": Oe(h.baseId, e),
|
|
1043
|
+
tabIndex: u ? 0 : -1,
|
|
1044
|
+
"data-state": u ? "active" : "inactive",
|
|
1045
|
+
className: _("uk-tabs__trigger", r),
|
|
577
1046
|
onClick: (m) => {
|
|
578
|
-
|
|
1047
|
+
i?.(m), m.defaultPrevented || h.setValue(e);
|
|
579
1048
|
},
|
|
580
1049
|
children: [
|
|
581
1050
|
s,
|
|
582
|
-
|
|
583
|
-
|
|
1051
|
+
u ? /* @__PURE__ */ l(
|
|
1052
|
+
L.span,
|
|
584
1053
|
{
|
|
585
1054
|
className: "uk-tabs__indicator",
|
|
586
|
-
layoutId:
|
|
1055
|
+
layoutId: h.indicatorId,
|
|
587
1056
|
"aria-hidden": "true",
|
|
588
|
-
transition:
|
|
1057
|
+
transition: o ? { duration: 0 } : se
|
|
589
1058
|
}
|
|
590
1059
|
) : null
|
|
591
1060
|
]
|
|
592
1061
|
}
|
|
593
1062
|
);
|
|
594
|
-
}),
|
|
595
|
-
const s =
|
|
596
|
-
return /* @__PURE__ */
|
|
1063
|
+
}), Tt = S(function({ value: e, className: n, ...r }, i) {
|
|
1064
|
+
const s = he("Tabs.Content"), c = s.value === e;
|
|
1065
|
+
return /* @__PURE__ */ l(
|
|
597
1066
|
"div",
|
|
598
1067
|
{
|
|
599
|
-
...
|
|
600
|
-
ref:
|
|
1068
|
+
...r,
|
|
1069
|
+
ref: i,
|
|
601
1070
|
role: "tabpanel",
|
|
602
|
-
id:
|
|
603
|
-
"aria-labelledby":
|
|
604
|
-
hidden: !
|
|
1071
|
+
id: Oe(s.baseId, e),
|
|
1072
|
+
"aria-labelledby": Re(s.baseId, e),
|
|
1073
|
+
hidden: !c,
|
|
605
1074
|
tabIndex: 0,
|
|
606
|
-
"data-state":
|
|
607
|
-
className:
|
|
1075
|
+
"data-state": c ? "active" : "inactive",
|
|
1076
|
+
className: _("uk-tabs__panel", n)
|
|
608
1077
|
}
|
|
609
1078
|
);
|
|
610
|
-
}),
|
|
611
|
-
List:
|
|
612
|
-
Trigger:
|
|
613
|
-
Content:
|
|
614
|
-
}),
|
|
615
|
-
},
|
|
616
|
-
function
|
|
617
|
-
const e =
|
|
1079
|
+
}), Qt = Object.assign(wt, {
|
|
1080
|
+
List: xt,
|
|
1081
|
+
Trigger: _t,
|
|
1082
|
+
Content: Tt
|
|
1083
|
+
}), $e = W(null), Ct = () => () => {
|
|
1084
|
+
}, Nt = () => !0, Pt = () => !1;
|
|
1085
|
+
function ee(t) {
|
|
1086
|
+
const e = X($e);
|
|
618
1087
|
if (!e)
|
|
619
1088
|
throw new Error(`<${t}> must be rendered inside <Dialog.Root>`);
|
|
620
1089
|
return e;
|
|
621
1090
|
}
|
|
622
|
-
function
|
|
1091
|
+
function Me(t, e) {
|
|
623
1092
|
return (n) => {
|
|
624
1093
|
t?.(n), n.defaultPrevented || e(n);
|
|
625
1094
|
};
|
|
626
1095
|
}
|
|
627
|
-
function
|
|
1096
|
+
function Ae({
|
|
628
1097
|
children: t,
|
|
629
1098
|
open: e,
|
|
630
1099
|
defaultOpen: n,
|
|
631
|
-
onOpenChange:
|
|
1100
|
+
onOpenChange: r
|
|
632
1101
|
}) {
|
|
633
|
-
const
|
|
1102
|
+
const i = O(), [s, c] = $(!1), [d, h] = $(!1), [u, o] = F({
|
|
634
1103
|
value: e,
|
|
635
1104
|
defaultValue: n ?? !1,
|
|
636
|
-
onChange:
|
|
637
|
-
}), m =
|
|
1105
|
+
onChange: r
|
|
1106
|
+
}), m = U(
|
|
638
1107
|
() => ({
|
|
639
|
-
open:
|
|
640
|
-
setOpen:
|
|
641
|
-
triggerId: `${
|
|
642
|
-
contentId: `${
|
|
643
|
-
titleId: `${
|
|
644
|
-
descriptionId: `${
|
|
1108
|
+
open: u,
|
|
1109
|
+
setOpen: o,
|
|
1110
|
+
triggerId: `${i}-trigger`,
|
|
1111
|
+
contentId: `${i}-content`,
|
|
1112
|
+
titleId: `${i}-title`,
|
|
1113
|
+
descriptionId: `${i}-description`,
|
|
645
1114
|
hasTitle: s,
|
|
646
|
-
setHasTitle:
|
|
647
|
-
hasDescription:
|
|
648
|
-
setHasDescription:
|
|
1115
|
+
setHasTitle: c,
|
|
1116
|
+
hasDescription: d,
|
|
1117
|
+
setHasDescription: h
|
|
649
1118
|
}),
|
|
650
|
-
[
|
|
1119
|
+
[i, u, d, s, o]
|
|
651
1120
|
);
|
|
652
|
-
return /* @__PURE__ */
|
|
1121
|
+
return /* @__PURE__ */ l($e.Provider, { value: m, children: t });
|
|
653
1122
|
}
|
|
654
|
-
function
|
|
655
|
-
const e =
|
|
656
|
-
return
|
|
1123
|
+
function Et({ children: t }) {
|
|
1124
|
+
const e = ee("Dialog.Trigger"), n = t, r = n.props.onClick;
|
|
1125
|
+
return Z(n, {
|
|
657
1126
|
id: e.triggerId,
|
|
658
1127
|
"aria-haspopup": "dialog",
|
|
659
1128
|
"aria-expanded": e.open,
|
|
660
1129
|
"aria-controls": e.open ? e.contentId : void 0,
|
|
661
|
-
onClick:
|
|
1130
|
+
onClick: Me(r, () => {
|
|
662
1131
|
e.setOpen(!e.open);
|
|
663
1132
|
})
|
|
664
1133
|
});
|
|
665
1134
|
}
|
|
666
|
-
function
|
|
1135
|
+
function Be({
|
|
667
1136
|
children: t,
|
|
668
1137
|
label: e = "Close"
|
|
669
1138
|
}) {
|
|
670
|
-
const n =
|
|
671
|
-
if (
|
|
672
|
-
const
|
|
673
|
-
return
|
|
674
|
-
onClick:
|
|
1139
|
+
const n = ee("Dialog.Close");
|
|
1140
|
+
if (Q(t)) {
|
|
1141
|
+
const r = t, i = r.props.onClick;
|
|
1142
|
+
return Z(r, {
|
|
1143
|
+
onClick: Me(i, () => {
|
|
675
1144
|
n.setOpen(!1);
|
|
676
1145
|
})
|
|
677
1146
|
});
|
|
678
1147
|
}
|
|
679
|
-
return /* @__PURE__ */
|
|
1148
|
+
return /* @__PURE__ */ l(Ce, { variant: "ghost", onClick: () => n.setOpen(!1), children: e });
|
|
680
1149
|
}
|
|
681
|
-
const
|
|
682
|
-
return /* @__PURE__ */
|
|
1150
|
+
const Ve = S(function({ className: e, ...n }, r) {
|
|
1151
|
+
return /* @__PURE__ */ l(
|
|
683
1152
|
"header",
|
|
684
1153
|
{
|
|
685
1154
|
...n,
|
|
686
|
-
ref:
|
|
687
|
-
className:
|
|
1155
|
+
ref: r,
|
|
1156
|
+
className: _("uk-dialog__header", e)
|
|
688
1157
|
}
|
|
689
1158
|
);
|
|
690
|
-
}),
|
|
691
|
-
const s =
|
|
692
|
-
return
|
|
1159
|
+
}), He = S(function({ className: e, children: n, ...r }, i) {
|
|
1160
|
+
const s = ee("Dialog.Title"), c = s.setHasTitle;
|
|
1161
|
+
return A(() => (c(!0), () => c(!1)), [c]), /* @__PURE__ */ l(
|
|
693
1162
|
"h2",
|
|
694
1163
|
{
|
|
695
|
-
...
|
|
696
|
-
ref:
|
|
1164
|
+
...r,
|
|
1165
|
+
ref: i,
|
|
697
1166
|
id: s.titleId,
|
|
698
|
-
className:
|
|
1167
|
+
className: _("uk-dialog__title", e),
|
|
699
1168
|
children: n
|
|
700
1169
|
}
|
|
701
1170
|
);
|
|
702
|
-
}),
|
|
703
|
-
function({ className: e, ...n },
|
|
704
|
-
const
|
|
705
|
-
return
|
|
1171
|
+
}), ze = S(
|
|
1172
|
+
function({ className: e, ...n }, r) {
|
|
1173
|
+
const i = ee("Dialog.Description"), s = i.setHasDescription;
|
|
1174
|
+
return A(() => (s(!0), () => s(!1)), [s]), /* @__PURE__ */ l(
|
|
706
1175
|
"p",
|
|
707
1176
|
{
|
|
708
1177
|
...n,
|
|
709
|
-
ref:
|
|
710
|
-
id:
|
|
711
|
-
className:
|
|
1178
|
+
ref: r,
|
|
1179
|
+
id: i.descriptionId,
|
|
1180
|
+
className: _("uk-dialog__description", e)
|
|
712
1181
|
}
|
|
713
1182
|
);
|
|
714
1183
|
}
|
|
715
|
-
),
|
|
716
|
-
return /* @__PURE__ */
|
|
717
|
-
}),
|
|
718
|
-
return /* @__PURE__ */
|
|
1184
|
+
), Ke = S(function({ className: e, ...n }, r) {
|
|
1185
|
+
return /* @__PURE__ */ l("div", { ...n, ref: r, className: _("uk-dialog__body", e) });
|
|
1186
|
+
}), Fe = S(function({ className: e, ...n }, r) {
|
|
1187
|
+
return /* @__PURE__ */ l(
|
|
719
1188
|
"footer",
|
|
720
1189
|
{
|
|
721
1190
|
...n,
|
|
722
|
-
ref:
|
|
723
|
-
className:
|
|
1191
|
+
ref: r,
|
|
1192
|
+
className: _("uk-dialog__footer", e)
|
|
724
1193
|
}
|
|
725
1194
|
);
|
|
726
1195
|
});
|
|
727
|
-
function
|
|
1196
|
+
function Dt({
|
|
728
1197
|
requestClose: t,
|
|
729
1198
|
contentId: e,
|
|
730
1199
|
titleId: n,
|
|
731
|
-
descriptionId:
|
|
732
|
-
hasTitle:
|
|
1200
|
+
descriptionId: r,
|
|
1201
|
+
hasTitle: i,
|
|
733
1202
|
hasDescription: s,
|
|
734
|
-
children:
|
|
735
|
-
closeOnBackdropClick:
|
|
736
|
-
closeOnEscape:
|
|
737
|
-
initialFocusRef:
|
|
738
|
-
returnFocusRef:
|
|
1203
|
+
children: c,
|
|
1204
|
+
closeOnBackdropClick: d = !0,
|
|
1205
|
+
closeOnEscape: h = !0,
|
|
1206
|
+
initialFocusRef: u,
|
|
1207
|
+
returnFocusRef: o,
|
|
739
1208
|
className: m,
|
|
740
|
-
"aria-label":
|
|
741
|
-
"aria-labelledby":
|
|
742
|
-
"aria-describedby":
|
|
1209
|
+
"aria-label": p,
|
|
1210
|
+
"aria-labelledby": b,
|
|
1211
|
+
"aria-describedby": f
|
|
743
1212
|
}) {
|
|
744
|
-
const
|
|
745
|
-
return
|
|
746
|
-
const
|
|
747
|
-
|
|
748
|
-
}, []),
|
|
1213
|
+
const I = R(null), g = R(null), k = ie(), v = H() ?? !1;
|
|
1214
|
+
return ot(!0), re(() => {
|
|
1215
|
+
const a = I.current;
|
|
1216
|
+
a && (g.current ?? (g.current = document.activeElement instanceof HTMLElement ? document.activeElement : null), !a.open && (typeof a.showModal == "function" ? a.showModal() : a.setAttribute("open", "")));
|
|
1217
|
+
}, []), rt({
|
|
749
1218
|
active: !0,
|
|
750
|
-
containerRef:
|
|
751
|
-
initialFocusRef:
|
|
752
|
-
returnFocusRef:
|
|
753
|
-
}),
|
|
754
|
-
const
|
|
755
|
-
if (!
|
|
1219
|
+
containerRef: I,
|
|
1220
|
+
initialFocusRef: u,
|
|
1221
|
+
returnFocusRef: o ?? g
|
|
1222
|
+
}), A(() => {
|
|
1223
|
+
const a = I.current;
|
|
1224
|
+
if (!a)
|
|
756
1225
|
return;
|
|
757
|
-
const
|
|
758
|
-
|
|
759
|
-
},
|
|
760
|
-
if (!
|
|
761
|
-
|
|
1226
|
+
const y = () => {
|
|
1227
|
+
a.open || (typeof a.showModal == "function" ? a.showModal() : a.setAttribute("open", ""));
|
|
1228
|
+
}, x = () => {
|
|
1229
|
+
if (!h) {
|
|
1230
|
+
y();
|
|
762
1231
|
return;
|
|
763
1232
|
}
|
|
764
1233
|
t();
|
|
765
|
-
}, w = (
|
|
766
|
-
|
|
767
|
-
},
|
|
768
|
-
|
|
769
|
-
},
|
|
770
|
-
|
|
1234
|
+
}, w = (P) => {
|
|
1235
|
+
P.preventDefault(), h && t();
|
|
1236
|
+
}, T = (P) => {
|
|
1237
|
+
h || P.key !== "Escape" || P.defaultPrevented || (P.preventDefault(), P.stopPropagation());
|
|
1238
|
+
}, N = (P) => {
|
|
1239
|
+
d && P.target === a && t();
|
|
771
1240
|
};
|
|
772
|
-
return
|
|
773
|
-
|
|
1241
|
+
return a.addEventListener("close", x), a.addEventListener("cancel", w), a.addEventListener("keydown", T, !0), a.addEventListener("click", N), () => {
|
|
1242
|
+
a.removeEventListener("close", x), a.removeEventListener("cancel", w), a.removeEventListener("keydown", T, !0), a.removeEventListener("click", N);
|
|
774
1243
|
};
|
|
775
|
-
}, [
|
|
1244
|
+
}, [d, h, t]), /* @__PURE__ */ l(
|
|
776
1245
|
"dialog",
|
|
777
1246
|
{
|
|
778
|
-
ref:
|
|
1247
|
+
ref: I,
|
|
779
1248
|
id: e,
|
|
780
|
-
className:
|
|
781
|
-
closedby:
|
|
782
|
-
"data-state":
|
|
783
|
-
inert: !
|
|
784
|
-
"aria-label":
|
|
785
|
-
"aria-labelledby":
|
|
786
|
-
"aria-describedby":
|
|
787
|
-
children: /* @__PURE__ */
|
|
788
|
-
|
|
1249
|
+
className: _("uk-dialog", m),
|
|
1250
|
+
closedby: h || d ? "any" : "none",
|
|
1251
|
+
"data-state": k ? "open" : "closed",
|
|
1252
|
+
inert: !k,
|
|
1253
|
+
"aria-label": p,
|
|
1254
|
+
"aria-labelledby": b ?? (p ? void 0 : i ? n : void 0),
|
|
1255
|
+
"aria-describedby": f ?? (s ? r : void 0),
|
|
1256
|
+
children: /* @__PURE__ */ l(
|
|
1257
|
+
L.div,
|
|
789
1258
|
{
|
|
790
1259
|
className: "uk-dialog__panel",
|
|
791
|
-
initial:
|
|
1260
|
+
initial: v ? { opacity: 0 } : {
|
|
792
1261
|
opacity: 0,
|
|
793
1262
|
transform: "translateY(12px) scale(0.96)"
|
|
794
1263
|
},
|
|
795
1264
|
animate: {
|
|
796
1265
|
opacity: 1,
|
|
797
1266
|
transform: "translateY(0px) scale(1)",
|
|
798
|
-
transition:
|
|
1267
|
+
transition: v ? j : { ...ke, delay: 0.06 }
|
|
799
1268
|
},
|
|
800
|
-
exit:
|
|
1269
|
+
exit: v ? { opacity: 0, transition: j } : {
|
|
801
1270
|
opacity: 0,
|
|
802
1271
|
transform: "translateY(8px) scale(0.97)",
|
|
803
|
-
transition:
|
|
1272
|
+
transition: ke
|
|
804
1273
|
},
|
|
805
|
-
children:
|
|
1274
|
+
children: c
|
|
806
1275
|
}
|
|
807
1276
|
)
|
|
808
1277
|
}
|
|
809
1278
|
);
|
|
810
1279
|
}
|
|
811
|
-
function
|
|
1280
|
+
function qe({
|
|
812
1281
|
children: t,
|
|
813
1282
|
closeOnBackdropClick: e = !0,
|
|
814
1283
|
closeOnEscape: n = !0,
|
|
815
|
-
initialFocusRef:
|
|
816
|
-
returnFocusRef:
|
|
1284
|
+
initialFocusRef: r,
|
|
1285
|
+
returnFocusRef: i,
|
|
817
1286
|
className: s,
|
|
818
|
-
"aria-label":
|
|
819
|
-
"aria-labelledby":
|
|
820
|
-
"aria-describedby":
|
|
1287
|
+
"aria-label": c,
|
|
1288
|
+
"aria-labelledby": d,
|
|
1289
|
+
"aria-describedby": h
|
|
821
1290
|
}) {
|
|
822
|
-
const
|
|
823
|
-
|
|
1291
|
+
const u = ee("Dialog.Content"), o = D(() => {
|
|
1292
|
+
u.setOpen(!1);
|
|
824
1293
|
});
|
|
825
1294
|
return oe(
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
) ?
|
|
830
|
-
/* @__PURE__ */
|
|
831
|
-
|
|
1295
|
+
Ct,
|
|
1296
|
+
Nt,
|
|
1297
|
+
Pt
|
|
1298
|
+
) ? ae(
|
|
1299
|
+
/* @__PURE__ */ l(pe, { reducedMotion: "user", children: /* @__PURE__ */ l(M, { children: u.open ? /* @__PURE__ */ l(
|
|
1300
|
+
Dt,
|
|
832
1301
|
{
|
|
833
|
-
requestClose:
|
|
834
|
-
contentId:
|
|
835
|
-
titleId:
|
|
836
|
-
descriptionId:
|
|
837
|
-
hasTitle:
|
|
838
|
-
hasDescription:
|
|
1302
|
+
requestClose: o,
|
|
1303
|
+
contentId: u.contentId,
|
|
1304
|
+
titleId: u.titleId,
|
|
1305
|
+
descriptionId: u.descriptionId,
|
|
1306
|
+
hasTitle: u.hasTitle,
|
|
1307
|
+
hasDescription: u.hasDescription,
|
|
839
1308
|
closeOnBackdropClick: e,
|
|
840
1309
|
closeOnEscape: n,
|
|
841
|
-
initialFocusRef:
|
|
842
|
-
returnFocusRef:
|
|
1310
|
+
initialFocusRef: r,
|
|
1311
|
+
returnFocusRef: i,
|
|
843
1312
|
className: s,
|
|
844
|
-
"aria-label":
|
|
845
|
-
"aria-labelledby":
|
|
846
|
-
"aria-describedby":
|
|
1313
|
+
"aria-label": c,
|
|
1314
|
+
"aria-labelledby": d,
|
|
1315
|
+
"aria-describedby": h,
|
|
847
1316
|
children: t
|
|
848
1317
|
},
|
|
849
1318
|
"uk-dialog"
|
|
@@ -851,53 +1320,53 @@ function Me({
|
|
|
851
1320
|
document.body
|
|
852
1321
|
) : null;
|
|
853
1322
|
}
|
|
854
|
-
function
|
|
1323
|
+
function Lt({
|
|
855
1324
|
open: t,
|
|
856
1325
|
onOpenChange: e,
|
|
857
1326
|
title: n,
|
|
858
|
-
description:
|
|
859
|
-
footer:
|
|
1327
|
+
description: r,
|
|
1328
|
+
footer: i,
|
|
860
1329
|
children: s,
|
|
861
|
-
closeLabel:
|
|
862
|
-
showCloseButton:
|
|
863
|
-
closeOnBackdropClick:
|
|
864
|
-
closeOnEscape:
|
|
865
|
-
initialFocusRef:
|
|
1330
|
+
closeLabel: c = "Close",
|
|
1331
|
+
showCloseButton: d = !0,
|
|
1332
|
+
closeOnBackdropClick: h = !0,
|
|
1333
|
+
closeOnEscape: u = !0,
|
|
1334
|
+
initialFocusRef: o,
|
|
866
1335
|
returnFocusRef: m,
|
|
867
|
-
className:
|
|
868
|
-
"aria-label":
|
|
1336
|
+
className: p,
|
|
1337
|
+
"aria-label": b
|
|
869
1338
|
}) {
|
|
870
|
-
return /* @__PURE__ */
|
|
871
|
-
|
|
1339
|
+
return /* @__PURE__ */ l(Ae, { open: t, onOpenChange: e, children: /* @__PURE__ */ C(
|
|
1340
|
+
qe,
|
|
872
1341
|
{
|
|
873
|
-
className:
|
|
874
|
-
closeOnBackdropClick:
|
|
875
|
-
closeOnEscape:
|
|
876
|
-
initialFocusRef:
|
|
1342
|
+
className: p,
|
|
1343
|
+
closeOnBackdropClick: h,
|
|
1344
|
+
closeOnEscape: u,
|
|
1345
|
+
initialFocusRef: o,
|
|
877
1346
|
returnFocusRef: m,
|
|
878
|
-
"aria-label":
|
|
1347
|
+
"aria-label": b,
|
|
879
1348
|
children: [
|
|
880
|
-
n ||
|
|
1349
|
+
n || r || d ? /* @__PURE__ */ C(Ve, { children: [
|
|
881
1350
|
/* @__PURE__ */ C("div", { className: "uk-dialog__heading", children: [
|
|
882
|
-
n ? /* @__PURE__ */
|
|
883
|
-
|
|
1351
|
+
n ? /* @__PURE__ */ l(He, { children: n }) : null,
|
|
1352
|
+
r ? /* @__PURE__ */ l(ze, { children: r }) : null
|
|
884
1353
|
] }),
|
|
885
|
-
|
|
886
|
-
|
|
1354
|
+
d ? /* @__PURE__ */ l(Be, { children: /* @__PURE__ */ l(
|
|
1355
|
+
Ce,
|
|
887
1356
|
{
|
|
888
1357
|
variant: "ghost",
|
|
889
1358
|
size: "sm",
|
|
890
1359
|
iconOnly: !0,
|
|
891
|
-
"aria-label":
|
|
1360
|
+
"aria-label": c,
|
|
892
1361
|
className: "uk-dialog__close",
|
|
893
|
-
children: /* @__PURE__ */
|
|
1362
|
+
children: /* @__PURE__ */ l(
|
|
894
1363
|
"svg",
|
|
895
1364
|
{
|
|
896
1365
|
viewBox: "0 0 20 20",
|
|
897
1366
|
width: "16",
|
|
898
1367
|
height: "16",
|
|
899
1368
|
"aria-hidden": "true",
|
|
900
|
-
children: /* @__PURE__ */
|
|
1369
|
+
children: /* @__PURE__ */ l(
|
|
901
1370
|
"path",
|
|
902
1371
|
{
|
|
903
1372
|
d: "M5 5l10 10M15 5L5 15",
|
|
@@ -911,24 +1380,24 @@ function mt({
|
|
|
911
1380
|
}
|
|
912
1381
|
) }) : null
|
|
913
1382
|
] }) : null,
|
|
914
|
-
/* @__PURE__ */
|
|
915
|
-
|
|
1383
|
+
/* @__PURE__ */ l(Ke, { children: s }),
|
|
1384
|
+
i ? /* @__PURE__ */ l(Fe, { children: i }) : null
|
|
916
1385
|
]
|
|
917
1386
|
}
|
|
918
1387
|
) });
|
|
919
1388
|
}
|
|
920
|
-
const
|
|
921
|
-
Root:
|
|
922
|
-
Trigger:
|
|
923
|
-
Content:
|
|
924
|
-
Header:
|
|
925
|
-
Title:
|
|
926
|
-
Description:
|
|
927
|
-
Body:
|
|
928
|
-
Footer:
|
|
929
|
-
Close:
|
|
1389
|
+
const Zt = Object.assign(Lt, {
|
|
1390
|
+
Root: Ae,
|
|
1391
|
+
Trigger: Et,
|
|
1392
|
+
Content: qe,
|
|
1393
|
+
Header: Ve,
|
|
1394
|
+
Title: He,
|
|
1395
|
+
Description: ze,
|
|
1396
|
+
Body: Ke,
|
|
1397
|
+
Footer: Fe,
|
|
1398
|
+
Close: Be
|
|
930
1399
|
});
|
|
931
|
-
function
|
|
1400
|
+
function St(t, e) {
|
|
932
1401
|
if (!(e instanceof Element))
|
|
933
1402
|
return !1;
|
|
934
1403
|
const n = e.closest(
|
|
@@ -936,196 +1405,196 @@ function bt(t, e) {
|
|
|
936
1405
|
);
|
|
937
1406
|
return n !== null && n !== t;
|
|
938
1407
|
}
|
|
939
|
-
const
|
|
1408
|
+
const en = S(function({
|
|
940
1409
|
children: e,
|
|
941
1410
|
className: n,
|
|
942
|
-
direction:
|
|
943
|
-
speed:
|
|
1411
|
+
direction: r = "left",
|
|
1412
|
+
speed: i = 30,
|
|
944
1413
|
pauseOnHover: s = !0,
|
|
945
|
-
gap:
|
|
946
|
-
fade:
|
|
947
|
-
paused:
|
|
948
|
-
items:
|
|
949
|
-
onItemClick:
|
|
1414
|
+
gap: c = "1rem",
|
|
1415
|
+
fade: d = !0,
|
|
1416
|
+
paused: h = !1,
|
|
1417
|
+
items: u,
|
|
1418
|
+
onItemClick: o,
|
|
950
1419
|
...m
|
|
951
|
-
},
|
|
952
|
-
const
|
|
953
|
-
key:
|
|
954
|
-
content:
|
|
955
|
-
data:
|
|
956
|
-
})) :
|
|
957
|
-
key:
|
|
958
|
-
content:
|
|
1420
|
+
}, p) {
|
|
1421
|
+
const b = u ? u.map((g) => ({
|
|
1422
|
+
key: g.key,
|
|
1423
|
+
content: g.content,
|
|
1424
|
+
data: g.data
|
|
1425
|
+
})) : nt.toArray(e).map((g, k) => ({
|
|
1426
|
+
key: Q(g) ? g.key ?? null : null,
|
|
1427
|
+
content: g,
|
|
959
1428
|
data: void 0
|
|
960
|
-
})),
|
|
961
|
-
!
|
|
962
|
-
},
|
|
963
|
-
!
|
|
1429
|
+
})), f = (g, k, v) => {
|
|
1430
|
+
!o || v.defaultPrevented || St(v.currentTarget, v.target) || o({ index: k, key: g.key, data: g.data }, v);
|
|
1431
|
+
}, I = (g, k, v) => {
|
|
1432
|
+
!o || v.defaultPrevented || (v.key === "Enter" || v.key === " ") && (v.preventDefault(), o({ index: k, key: g.key, data: g.data }, v));
|
|
964
1433
|
};
|
|
965
|
-
return /* @__PURE__ */
|
|
1434
|
+
return /* @__PURE__ */ l(
|
|
966
1435
|
"div",
|
|
967
1436
|
{
|
|
968
1437
|
...m,
|
|
969
|
-
ref:
|
|
970
|
-
className:
|
|
971
|
-
"data-direction":
|
|
972
|
-
"data-fade":
|
|
1438
|
+
ref: p,
|
|
1439
|
+
className: _("uk-marquee", n),
|
|
1440
|
+
"data-direction": r,
|
|
1441
|
+
"data-fade": d ? "true" : void 0,
|
|
973
1442
|
"data-pause-on-hover": s ? "true" : void 0,
|
|
974
|
-
"data-paused":
|
|
1443
|
+
"data-paused": h ? "true" : "false",
|
|
975
1444
|
style: {
|
|
976
1445
|
...m.style,
|
|
977
|
-
"--uk-marquee-gap":
|
|
978
|
-
"--uk-marquee-duration": `${
|
|
979
|
-
gap:
|
|
1446
|
+
"--uk-marquee-gap": c,
|
|
1447
|
+
"--uk-marquee-duration": `${i}s`,
|
|
1448
|
+
gap: c
|
|
980
1449
|
},
|
|
981
|
-
children: [!1, !0].map((
|
|
1450
|
+
children: [!1, !0].map((g) => /* @__PURE__ */ l(
|
|
982
1451
|
"div",
|
|
983
1452
|
{
|
|
984
|
-
"aria-hidden":
|
|
1453
|
+
"aria-hidden": g,
|
|
985
1454
|
className: "uk-marquee__track",
|
|
986
|
-
"data-duplicate":
|
|
987
|
-
inert:
|
|
988
|
-
role:
|
|
989
|
-
onFocusCapture:
|
|
990
|
-
|
|
1455
|
+
"data-duplicate": g ? "true" : void 0,
|
|
1456
|
+
inert: g && !o,
|
|
1457
|
+
role: g ? "presentation" : void 0,
|
|
1458
|
+
onFocusCapture: g ? (k) => {
|
|
1459
|
+
k.target instanceof HTMLElement && k.target.blur();
|
|
991
1460
|
} : void 0,
|
|
992
|
-
children:
|
|
1461
|
+
children: b.map((k, v) => /* @__PURE__ */ l(
|
|
993
1462
|
"div",
|
|
994
1463
|
{
|
|
995
1464
|
className: "uk-marquee__item",
|
|
996
|
-
"data-clickable":
|
|
997
|
-
...
|
|
998
|
-
role:
|
|
999
|
-
tabIndex:
|
|
1000
|
-
onClick: (
|
|
1001
|
-
onKeyDown:
|
|
1465
|
+
"data-clickable": o ? "true" : void 0,
|
|
1466
|
+
...o ? {
|
|
1467
|
+
role: g ? void 0 : "button",
|
|
1468
|
+
tabIndex: g ? -1 : 0,
|
|
1469
|
+
onClick: (a) => f(k, v, a),
|
|
1470
|
+
onKeyDown: g ? void 0 : (a) => I(k, v, a)
|
|
1002
1471
|
} : {},
|
|
1003
|
-
children:
|
|
1472
|
+
children: k.content
|
|
1004
1473
|
},
|
|
1005
|
-
|
|
1474
|
+
g ? `duplicate-${v}` : k.key ?? v
|
|
1006
1475
|
))
|
|
1007
1476
|
},
|
|
1008
|
-
|
|
1477
|
+
g ? "duplicate" : "primary"
|
|
1009
1478
|
))
|
|
1010
1479
|
}
|
|
1011
1480
|
);
|
|
1012
|
-
}),
|
|
1013
|
-
},
|
|
1014
|
-
function
|
|
1015
|
-
const e =
|
|
1481
|
+
}), Ge = W(null), je = () => () => {
|
|
1482
|
+
}, Ue = () => !0, We = () => !1;
|
|
1483
|
+
function Xe(t) {
|
|
1484
|
+
const e = X(Ge);
|
|
1016
1485
|
if (!e)
|
|
1017
1486
|
throw new Error(`<${t}> must be rendered inside <Tooltip.Root>`);
|
|
1018
1487
|
return e;
|
|
1019
1488
|
}
|
|
1020
|
-
function
|
|
1489
|
+
function Ye(t, e) {
|
|
1021
1490
|
typeof t == "function" ? t(e) : t && (t.current = e);
|
|
1022
1491
|
}
|
|
1023
|
-
function
|
|
1492
|
+
function Je(t, e) {
|
|
1024
1493
|
const n = typeof t == "string" ? t.split(/\s+/).filter(Boolean) : [];
|
|
1025
1494
|
return Array.from(/* @__PURE__ */ new Set([...n, e])).join(" ");
|
|
1026
1495
|
}
|
|
1027
|
-
function
|
|
1496
|
+
function B(t, e) {
|
|
1028
1497
|
return (n) => {
|
|
1029
1498
|
t?.(n), n.defaultPrevented || e(n);
|
|
1030
1499
|
};
|
|
1031
1500
|
}
|
|
1032
|
-
function
|
|
1501
|
+
function Rt({
|
|
1033
1502
|
children: t,
|
|
1034
1503
|
open: e,
|
|
1035
1504
|
defaultOpen: n,
|
|
1036
|
-
onOpenChange:
|
|
1037
|
-
delayDuration:
|
|
1505
|
+
onOpenChange: r,
|
|
1506
|
+
delayDuration: i = 300,
|
|
1038
1507
|
closeDelay: s = 80
|
|
1039
1508
|
}) {
|
|
1040
|
-
const
|
|
1509
|
+
const c = O(), [d, h] = $(
|
|
1041
1510
|
null
|
|
1042
|
-
),
|
|
1511
|
+
), u = R(null), o = R(null), [m, p] = F({
|
|
1043
1512
|
value: e,
|
|
1044
1513
|
defaultValue: n ?? !1,
|
|
1045
|
-
onChange:
|
|
1046
|
-
}),
|
|
1047
|
-
|
|
1048
|
-
}, []),
|
|
1049
|
-
|
|
1050
|
-
}, []),
|
|
1051
|
-
if (
|
|
1052
|
-
if (
|
|
1053
|
-
|
|
1514
|
+
onChange: r
|
|
1515
|
+
}), b = V(() => {
|
|
1516
|
+
u.current !== null && (clearTimeout(u.current), u.current = null);
|
|
1517
|
+
}, []), f = V(() => {
|
|
1518
|
+
o.current !== null && (clearTimeout(o.current), o.current = null);
|
|
1519
|
+
}, []), I = D((a = !1) => {
|
|
1520
|
+
if (b(), f(), !m) {
|
|
1521
|
+
if (a || i <= 0) {
|
|
1522
|
+
p(!0);
|
|
1054
1523
|
return;
|
|
1055
1524
|
}
|
|
1056
|
-
|
|
1057
|
-
|
|
1058
|
-
},
|
|
1525
|
+
u.current = setTimeout(() => {
|
|
1526
|
+
u.current = null, p(!0);
|
|
1527
|
+
}, i);
|
|
1059
1528
|
}
|
|
1060
|
-
}),
|
|
1061
|
-
if (
|
|
1529
|
+
}), g = D(() => {
|
|
1530
|
+
if (b(), f(), !!m) {
|
|
1062
1531
|
if (s <= 0) {
|
|
1063
|
-
|
|
1532
|
+
p(!1);
|
|
1064
1533
|
return;
|
|
1065
1534
|
}
|
|
1066
|
-
|
|
1067
|
-
|
|
1535
|
+
o.current = setTimeout(() => {
|
|
1536
|
+
o.current = null, p(!1);
|
|
1068
1537
|
}, s);
|
|
1069
1538
|
}
|
|
1070
|
-
}),
|
|
1071
|
-
|
|
1539
|
+
}), k = D(() => {
|
|
1540
|
+
b(), f(), p(!1);
|
|
1072
1541
|
});
|
|
1073
|
-
|
|
1074
|
-
m ?
|
|
1075
|
-
}, [
|
|
1542
|
+
A(() => {
|
|
1543
|
+
m ? f() : b();
|
|
1544
|
+
}, [f, b, m]), A(
|
|
1076
1545
|
() => () => {
|
|
1077
|
-
|
|
1546
|
+
b(), f();
|
|
1078
1547
|
},
|
|
1079
|
-
[
|
|
1548
|
+
[f, b]
|
|
1080
1549
|
);
|
|
1081
|
-
const
|
|
1550
|
+
const v = U(
|
|
1082
1551
|
() => ({
|
|
1083
1552
|
open: m,
|
|
1084
|
-
triggerElement:
|
|
1085
|
-
setTriggerElement:
|
|
1086
|
-
contentId:
|
|
1087
|
-
requestOpen:
|
|
1088
|
-
requestClose:
|
|
1089
|
-
dismiss:
|
|
1553
|
+
triggerElement: d,
|
|
1554
|
+
setTriggerElement: h,
|
|
1555
|
+
contentId: c,
|
|
1556
|
+
requestOpen: I,
|
|
1557
|
+
requestClose: g,
|
|
1558
|
+
dismiss: k
|
|
1090
1559
|
}),
|
|
1091
|
-
[
|
|
1560
|
+
[c, m, k, g, I, d]
|
|
1092
1561
|
);
|
|
1093
|
-
return /* @__PURE__ */
|
|
1562
|
+
return /* @__PURE__ */ l(Ge.Provider, { value: v, children: t });
|
|
1094
1563
|
}
|
|
1095
|
-
function
|
|
1096
|
-
const e =
|
|
1097
|
-
if (!
|
|
1564
|
+
function Ot({ children: t }) {
|
|
1565
|
+
const e = Xe("Tooltip.Trigger"), { setTriggerElement: n } = e;
|
|
1566
|
+
if (!Q(t))
|
|
1098
1567
|
throw new Error("<Tooltip.Trigger> expects a single valid React element");
|
|
1099
|
-
const
|
|
1100
|
-
(
|
|
1101
|
-
|
|
1568
|
+
const r = t, i = r.props, s = i.ref ?? r.ref, c = i.onPointerEnter, d = i.onPointerLeave, h = i.onFocus, u = i.onBlur, o = i.onKeyDown, m = V(
|
|
1569
|
+
(p) => {
|
|
1570
|
+
Ye(s, p), n(p);
|
|
1102
1571
|
},
|
|
1103
1572
|
[s, n]
|
|
1104
1573
|
);
|
|
1105
|
-
return
|
|
1574
|
+
return Z(r, {
|
|
1106
1575
|
ref: m,
|
|
1107
|
-
"aria-describedby": e.open ?
|
|
1108
|
-
onPointerEnter:
|
|
1109
|
-
e.requestOpen(
|
|
1576
|
+
"aria-describedby": e.open ? Je(i["aria-describedby"], e.contentId) : i["aria-describedby"],
|
|
1577
|
+
onPointerEnter: B(c, (p) => {
|
|
1578
|
+
e.requestOpen(p.pointerType === "touch");
|
|
1110
1579
|
}),
|
|
1111
|
-
onPointerLeave:
|
|
1112
|
-
|
|
1580
|
+
onPointerLeave: B(d, (p) => {
|
|
1581
|
+
p.pointerType !== "touch" && e.requestClose();
|
|
1113
1582
|
}),
|
|
1114
|
-
onFocus:
|
|
1583
|
+
onFocus: B(h, () => {
|
|
1115
1584
|
e.requestOpen();
|
|
1116
1585
|
}),
|
|
1117
|
-
onBlur:
|
|
1586
|
+
onBlur: B(u, () => {
|
|
1118
1587
|
e.requestClose();
|
|
1119
1588
|
}),
|
|
1120
|
-
onKeyDown:
|
|
1121
|
-
|
|
1589
|
+
onKeyDown: B(o, (p) => {
|
|
1590
|
+
p.key === "Escape" && e.open && (p.preventDefault(), p.stopPropagation(), e.dismiss());
|
|
1122
1591
|
})
|
|
1123
1592
|
});
|
|
1124
1593
|
}
|
|
1125
|
-
function
|
|
1594
|
+
function ne(t, e, n) {
|
|
1126
1595
|
return n < e ? e : Math.min(Math.max(t, e), n);
|
|
1127
1596
|
}
|
|
1128
|
-
function
|
|
1597
|
+
function $t(t) {
|
|
1129
1598
|
switch (t) {
|
|
1130
1599
|
case "top":
|
|
1131
1600
|
return "bottom";
|
|
@@ -1137,163 +1606,163 @@ function vt(t) {
|
|
|
1137
1606
|
return "right";
|
|
1138
1607
|
}
|
|
1139
1608
|
}
|
|
1140
|
-
function
|
|
1609
|
+
function de(t, e, n, r, i) {
|
|
1141
1610
|
switch (e) {
|
|
1142
1611
|
case "top":
|
|
1143
|
-
return t.top -
|
|
1612
|
+
return t.top - i;
|
|
1144
1613
|
case "right":
|
|
1145
|
-
return n - t.right -
|
|
1614
|
+
return n - t.right - i;
|
|
1146
1615
|
case "bottom":
|
|
1147
|
-
return
|
|
1616
|
+
return r - t.bottom - i;
|
|
1148
1617
|
case "left":
|
|
1149
|
-
return t.left -
|
|
1618
|
+
return t.left - i;
|
|
1150
1619
|
}
|
|
1151
1620
|
}
|
|
1152
|
-
function
|
|
1153
|
-
return
|
|
1621
|
+
function xe(t, e, n, r, i, s, c) {
|
|
1622
|
+
return de(
|
|
1154
1623
|
t,
|
|
1155
1624
|
n,
|
|
1156
|
-
|
|
1625
|
+
i,
|
|
1157
1626
|
s,
|
|
1158
|
-
|
|
1159
|
-
) >= (n === "top" || n === "bottom" ? e.height : e.width) +
|
|
1627
|
+
c
|
|
1628
|
+
) >= (n === "top" || n === "bottom" ? e.height : e.width) + r;
|
|
1160
1629
|
}
|
|
1161
|
-
function
|
|
1630
|
+
function Mt({
|
|
1162
1631
|
trigger: t,
|
|
1163
1632
|
tooltip: e,
|
|
1164
1633
|
side: n,
|
|
1165
|
-
align:
|
|
1166
|
-
sideOffset:
|
|
1634
|
+
align: r,
|
|
1635
|
+
sideOffset: i,
|
|
1167
1636
|
collisionPadding: s,
|
|
1168
|
-
avoidCollisions:
|
|
1169
|
-
viewportWidth:
|
|
1170
|
-
viewportHeight:
|
|
1637
|
+
avoidCollisions: c,
|
|
1638
|
+
viewportWidth: d,
|
|
1639
|
+
viewportHeight: h
|
|
1171
1640
|
}) {
|
|
1172
|
-
let
|
|
1173
|
-
if (
|
|
1641
|
+
let u = n;
|
|
1642
|
+
if (c && !xe(
|
|
1174
1643
|
t,
|
|
1175
1644
|
e,
|
|
1176
1645
|
n,
|
|
1177
|
-
|
|
1178
|
-
p,
|
|
1646
|
+
i,
|
|
1179
1647
|
d,
|
|
1648
|
+
h,
|
|
1180
1649
|
s
|
|
1181
1650
|
)) {
|
|
1182
|
-
const
|
|
1651
|
+
const g = $t(n), k = xe(
|
|
1183
1652
|
t,
|
|
1184
1653
|
e,
|
|
1185
|
-
|
|
1186
|
-
|
|
1187
|
-
p,
|
|
1654
|
+
g,
|
|
1655
|
+
i,
|
|
1188
1656
|
d,
|
|
1657
|
+
h,
|
|
1189
1658
|
s
|
|
1190
|
-
),
|
|
1659
|
+
), v = de(
|
|
1191
1660
|
t,
|
|
1192
1661
|
n,
|
|
1193
|
-
p,
|
|
1194
1662
|
d,
|
|
1663
|
+
h,
|
|
1195
1664
|
s
|
|
1196
|
-
),
|
|
1665
|
+
), a = de(
|
|
1197
1666
|
t,
|
|
1198
|
-
|
|
1199
|
-
p,
|
|
1667
|
+
g,
|
|
1200
1668
|
d,
|
|
1669
|
+
h,
|
|
1201
1670
|
s
|
|
1202
1671
|
);
|
|
1203
|
-
(
|
|
1672
|
+
(k || a > v) && (u = g);
|
|
1204
1673
|
}
|
|
1205
|
-
const
|
|
1206
|
-
let
|
|
1207
|
-
switch (
|
|
1674
|
+
const o = t.left + t.width / 2, m = t.top + t.height / 2;
|
|
1675
|
+
let p = 0, b = 0;
|
|
1676
|
+
switch (u) {
|
|
1208
1677
|
case "top":
|
|
1209
1678
|
case "bottom":
|
|
1210
|
-
|
|
1679
|
+
p = r === "start" ? t.left : r === "end" ? t.right - e.width : o - e.width / 2, b = u === "top" ? t.top - e.height - i : t.bottom + i;
|
|
1211
1680
|
break;
|
|
1212
1681
|
case "left":
|
|
1213
1682
|
case "right":
|
|
1214
|
-
|
|
1683
|
+
p = u === "left" ? t.left - e.width - i : t.right + i, b = r === "start" ? t.top : r === "end" ? t.bottom - e.height : m - e.height / 2;
|
|
1215
1684
|
break;
|
|
1216
1685
|
}
|
|
1217
|
-
|
|
1218
|
-
|
|
1686
|
+
c && (p = ne(
|
|
1687
|
+
p,
|
|
1219
1688
|
s,
|
|
1220
|
-
|
|
1221
|
-
),
|
|
1222
|
-
|
|
1689
|
+
d - e.width - s
|
|
1690
|
+
), b = ne(
|
|
1691
|
+
b,
|
|
1223
1692
|
s,
|
|
1224
|
-
|
|
1693
|
+
h - e.height - s
|
|
1225
1694
|
));
|
|
1226
|
-
const
|
|
1227
|
-
|
|
1228
|
-
|
|
1229
|
-
Math.max(
|
|
1230
|
-
) :
|
|
1231
|
-
m -
|
|
1232
|
-
|
|
1233
|
-
Math.max(
|
|
1695
|
+
const f = 10, I = u === "top" || u === "bottom" ? ne(
|
|
1696
|
+
o - p,
|
|
1697
|
+
f,
|
|
1698
|
+
Math.max(f, e.width - f)
|
|
1699
|
+
) : ne(
|
|
1700
|
+
m - b,
|
|
1701
|
+
f,
|
|
1702
|
+
Math.max(f, e.height - f)
|
|
1234
1703
|
);
|
|
1235
|
-
return { x:
|
|
1704
|
+
return { x: p, y: b, side: u, arrowOffset: I };
|
|
1236
1705
|
}
|
|
1237
|
-
function
|
|
1706
|
+
function Qe(t, e, {
|
|
1238
1707
|
side: n,
|
|
1239
|
-
align:
|
|
1240
|
-
sideOffset:
|
|
1708
|
+
align: r,
|
|
1709
|
+
sideOffset: i,
|
|
1241
1710
|
collisionPadding: s,
|
|
1242
|
-
avoidCollisions:
|
|
1711
|
+
avoidCollisions: c
|
|
1243
1712
|
}) {
|
|
1244
|
-
const [
|
|
1713
|
+
const [d, h] = $(null);
|
|
1245
1714
|
return re(() => {
|
|
1246
|
-
const
|
|
1247
|
-
if (!
|
|
1715
|
+
const u = e.current;
|
|
1716
|
+
if (!u || !t)
|
|
1248
1717
|
return;
|
|
1249
|
-
const
|
|
1250
|
-
const
|
|
1251
|
-
|
|
1252
|
-
|
|
1253
|
-
trigger:
|
|
1254
|
-
tooltip:
|
|
1718
|
+
const o = () => {
|
|
1719
|
+
const p = t.getBoundingClientRect(), b = u.getBoundingClientRect();
|
|
1720
|
+
h(
|
|
1721
|
+
Mt({
|
|
1722
|
+
trigger: p,
|
|
1723
|
+
tooltip: b,
|
|
1255
1724
|
side: n,
|
|
1256
|
-
align:
|
|
1257
|
-
sideOffset:
|
|
1725
|
+
align: r,
|
|
1726
|
+
sideOffset: i,
|
|
1258
1727
|
collisionPadding: s,
|
|
1259
|
-
avoidCollisions:
|
|
1728
|
+
avoidCollisions: c,
|
|
1260
1729
|
viewportWidth: window.innerWidth || document.documentElement.clientWidth,
|
|
1261
1730
|
viewportHeight: window.innerHeight || document.documentElement.clientHeight
|
|
1262
1731
|
})
|
|
1263
1732
|
);
|
|
1264
1733
|
};
|
|
1265
|
-
|
|
1266
|
-
const m = typeof ResizeObserver > "u" ? null : new ResizeObserver(
|
|
1267
|
-
return m?.observe(t), m?.observe(
|
|
1268
|
-
window.removeEventListener("resize",
|
|
1734
|
+
o(), window.addEventListener("resize", o), window.addEventListener("scroll", o, !0);
|
|
1735
|
+
const m = typeof ResizeObserver > "u" ? null : new ResizeObserver(o);
|
|
1736
|
+
return m?.observe(t), m?.observe(u), () => {
|
|
1737
|
+
window.removeEventListener("resize", o), window.removeEventListener("scroll", o, !0), m?.disconnect();
|
|
1269
1738
|
};
|
|
1270
1739
|
}, [
|
|
1271
|
-
|
|
1272
|
-
|
|
1740
|
+
r,
|
|
1741
|
+
c,
|
|
1273
1742
|
s,
|
|
1274
1743
|
e,
|
|
1275
1744
|
n,
|
|
1276
|
-
|
|
1745
|
+
i,
|
|
1277
1746
|
t
|
|
1278
|
-
]),
|
|
1747
|
+
]), d;
|
|
1279
1748
|
}
|
|
1280
|
-
function
|
|
1281
|
-
|
|
1282
|
-
const
|
|
1283
|
-
const
|
|
1284
|
-
|
|
1285
|
-
},
|
|
1749
|
+
function Ze(t, e, n) {
|
|
1750
|
+
A(() => {
|
|
1751
|
+
const r = (c) => {
|
|
1752
|
+
const d = c.target;
|
|
1753
|
+
d instanceof Node && (t.contains(d) || e.current?.contains(d) || n());
|
|
1754
|
+
}, i = () => {
|
|
1286
1755
|
document.visibilityState === "hidden" && n();
|
|
1287
|
-
}, s = (
|
|
1288
|
-
const
|
|
1289
|
-
|
|
1756
|
+
}, s = (c) => {
|
|
1757
|
+
const d = c.target;
|
|
1758
|
+
c.key !== "Escape" || d instanceof Node && t.contains(d) || n();
|
|
1290
1759
|
};
|
|
1291
|
-
return document.addEventListener("pointerdown",
|
|
1292
|
-
document.removeEventListener("pointerdown",
|
|
1760
|
+
return document.addEventListener("pointerdown", r, !0), document.addEventListener("visibilitychange", i), document.addEventListener("keydown", s, !0), window.addEventListener("blur", n), () => {
|
|
1761
|
+
document.removeEventListener("pointerdown", r, !0), document.removeEventListener("visibilitychange", i), document.removeEventListener("keydown", s, !0), window.removeEventListener("blur", n);
|
|
1293
1762
|
};
|
|
1294
1763
|
}, [n, e, t]);
|
|
1295
1764
|
}
|
|
1296
|
-
function
|
|
1765
|
+
function et(t) {
|
|
1297
1766
|
switch (t) {
|
|
1298
1767
|
case "top":
|
|
1299
1768
|
return "center bottom";
|
|
@@ -1307,83 +1776,83 @@ function Ke(t) {
|
|
|
1307
1776
|
return "center";
|
|
1308
1777
|
}
|
|
1309
1778
|
}
|
|
1310
|
-
function
|
|
1779
|
+
function At({
|
|
1311
1780
|
contentId: t,
|
|
1312
1781
|
triggerElement: e,
|
|
1313
1782
|
dismiss: n,
|
|
1314
|
-
children:
|
|
1315
|
-
className:
|
|
1783
|
+
children: r,
|
|
1784
|
+
className: i,
|
|
1316
1785
|
style: s,
|
|
1317
|
-
side:
|
|
1318
|
-
align:
|
|
1319
|
-
sideOffset:
|
|
1320
|
-
collisionPadding:
|
|
1321
|
-
avoidCollisions:
|
|
1786
|
+
side: c = "top",
|
|
1787
|
+
align: d = "center",
|
|
1788
|
+
sideOffset: h = 8,
|
|
1789
|
+
collisionPadding: u = 8,
|
|
1790
|
+
avoidCollisions: o = !0,
|
|
1322
1791
|
...m
|
|
1323
1792
|
}) {
|
|
1324
|
-
const
|
|
1325
|
-
side:
|
|
1326
|
-
align:
|
|
1327
|
-
sideOffset:
|
|
1328
|
-
collisionPadding:
|
|
1329
|
-
avoidCollisions:
|
|
1793
|
+
const p = R(null), b = H() ?? !1, f = ie(), I = Qe(e, p, {
|
|
1794
|
+
side: c,
|
|
1795
|
+
align: d,
|
|
1796
|
+
sideOffset: h,
|
|
1797
|
+
collisionPadding: u,
|
|
1798
|
+
avoidCollisions: o
|
|
1330
1799
|
});
|
|
1331
|
-
|
|
1332
|
-
const
|
|
1800
|
+
Ze(e, p, n);
|
|
1801
|
+
const g = et(I?.side ?? c), k = {
|
|
1333
1802
|
...s,
|
|
1334
|
-
left:
|
|
1335
|
-
top:
|
|
1336
|
-
visibility:
|
|
1803
|
+
left: I ? `${I.x}px` : 0,
|
|
1804
|
+
top: I ? `${I.y}px` : 0,
|
|
1805
|
+
visibility: I ? "visible" : "hidden"
|
|
1337
1806
|
};
|
|
1338
|
-
return /* @__PURE__ */
|
|
1807
|
+
return /* @__PURE__ */ l(
|
|
1339
1808
|
"div",
|
|
1340
1809
|
{
|
|
1341
1810
|
...m,
|
|
1342
|
-
ref:
|
|
1811
|
+
ref: p,
|
|
1343
1812
|
id: t,
|
|
1344
1813
|
role: "tooltip",
|
|
1345
|
-
"data-side":
|
|
1346
|
-
"data-align":
|
|
1347
|
-
"data-state":
|
|
1348
|
-
"aria-hidden":
|
|
1349
|
-
className:
|
|
1350
|
-
style:
|
|
1814
|
+
"data-side": I?.side ?? c,
|
|
1815
|
+
"data-align": d,
|
|
1816
|
+
"data-state": f ? "open" : "closed",
|
|
1817
|
+
"aria-hidden": f ? void 0 : !0,
|
|
1818
|
+
className: _("uk-tooltip", i),
|
|
1819
|
+
style: k,
|
|
1351
1820
|
children: /* @__PURE__ */ C(
|
|
1352
|
-
|
|
1821
|
+
L.div,
|
|
1353
1822
|
{
|
|
1354
1823
|
className: "uk-tooltip__surface",
|
|
1355
|
-
style: { transformOrigin:
|
|
1356
|
-
initial:
|
|
1824
|
+
style: { transformOrigin: g },
|
|
1825
|
+
initial: b ? { opacity: 0 } : { opacity: 0, scale: 0.96 },
|
|
1357
1826
|
animate: { opacity: 1, scale: 1 },
|
|
1358
|
-
exit:
|
|
1359
|
-
transition:
|
|
1827
|
+
exit: b ? { opacity: 0 } : { opacity: 0, scale: 0.96 },
|
|
1828
|
+
transition: b ? j : Pe,
|
|
1360
1829
|
children: [
|
|
1361
|
-
/* @__PURE__ */
|
|
1830
|
+
/* @__PURE__ */ l(
|
|
1362
1831
|
"span",
|
|
1363
1832
|
{
|
|
1364
1833
|
className: "uk-tooltip__arrow",
|
|
1365
1834
|
"aria-hidden": "true",
|
|
1366
1835
|
style: {
|
|
1367
|
-
"--uk-tooltip-arrow-offset": `${
|
|
1836
|
+
"--uk-tooltip-arrow-offset": `${I?.arrowOffset ?? 0}px`
|
|
1368
1837
|
}
|
|
1369
1838
|
}
|
|
1370
1839
|
),
|
|
1371
|
-
|
|
1840
|
+
r
|
|
1372
1841
|
]
|
|
1373
1842
|
}
|
|
1374
1843
|
)
|
|
1375
1844
|
}
|
|
1376
1845
|
);
|
|
1377
1846
|
}
|
|
1378
|
-
function
|
|
1379
|
-
const e =
|
|
1380
|
-
|
|
1381
|
-
|
|
1382
|
-
|
|
1847
|
+
function Bt(t) {
|
|
1848
|
+
const e = Xe("Tooltip.Content"), r = oe(
|
|
1849
|
+
je,
|
|
1850
|
+
Ue,
|
|
1851
|
+
We
|
|
1383
1852
|
) && e.triggerElement ? e.triggerElement.closest("dialog") ?? document.body : null;
|
|
1384
|
-
return !
|
|
1385
|
-
/* @__PURE__ */
|
|
1386
|
-
|
|
1853
|
+
return !r || !e.triggerElement ? null : ae(
|
|
1854
|
+
/* @__PURE__ */ l(pe, { reducedMotion: "user", children: /* @__PURE__ */ l(M, { children: e.open ? /* @__PURE__ */ l(
|
|
1855
|
+
At,
|
|
1387
1856
|
{
|
|
1388
1857
|
contentId: e.contentId,
|
|
1389
1858
|
triggerElement: e.triggerElement,
|
|
@@ -1392,86 +1861,86 @@ function Tt(t) {
|
|
|
1392
1861
|
},
|
|
1393
1862
|
"uk-tooltip"
|
|
1394
1863
|
) : null }) }),
|
|
1395
|
-
|
|
1864
|
+
r
|
|
1396
1865
|
);
|
|
1397
1866
|
}
|
|
1398
|
-
const
|
|
1867
|
+
const tt = W(
|
|
1399
1868
|
null
|
|
1400
1869
|
);
|
|
1401
|
-
function
|
|
1402
|
-
const e =
|
|
1870
|
+
function Vt(t) {
|
|
1871
|
+
const e = X(tt);
|
|
1403
1872
|
if (!e)
|
|
1404
1873
|
throw new Error(`<${t}> must be rendered inside <Tooltip.Group>`);
|
|
1405
1874
|
return e;
|
|
1406
1875
|
}
|
|
1407
|
-
function
|
|
1876
|
+
function Ht({
|
|
1408
1877
|
activeValue: t,
|
|
1409
1878
|
content: e,
|
|
1410
1879
|
contentClassName: n,
|
|
1411
|
-
contentId:
|
|
1412
|
-
dismiss:
|
|
1880
|
+
contentId: r,
|
|
1881
|
+
dismiss: i,
|
|
1413
1882
|
triggerElement: s,
|
|
1414
|
-
side:
|
|
1415
|
-
align:
|
|
1416
|
-
sideOffset:
|
|
1417
|
-
collisionPadding:
|
|
1418
|
-
avoidCollisions:
|
|
1883
|
+
side: c,
|
|
1884
|
+
align: d,
|
|
1885
|
+
sideOffset: h,
|
|
1886
|
+
collisionPadding: u,
|
|
1887
|
+
avoidCollisions: o
|
|
1419
1888
|
}) {
|
|
1420
|
-
const m =
|
|
1421
|
-
side:
|
|
1422
|
-
align:
|
|
1423
|
-
sideOffset:
|
|
1424
|
-
collisionPadding:
|
|
1425
|
-
avoidCollisions:
|
|
1889
|
+
const m = R(null), p = H() ?? !1, b = ie(), f = Qe(s, m, {
|
|
1890
|
+
side: c,
|
|
1891
|
+
align: d,
|
|
1892
|
+
sideOffset: h,
|
|
1893
|
+
collisionPadding: u,
|
|
1894
|
+
avoidCollisions: o
|
|
1426
1895
|
});
|
|
1427
|
-
|
|
1428
|
-
const
|
|
1429
|
-
left:
|
|
1430
|
-
top:
|
|
1431
|
-
transformOrigin:
|
|
1432
|
-
visibility:
|
|
1896
|
+
Ze(s, m, i);
|
|
1897
|
+
const I = {
|
|
1898
|
+
left: f ? `${f.x}px` : 0,
|
|
1899
|
+
top: f ? `${f.y}px` : 0,
|
|
1900
|
+
transformOrigin: et(f?.side ?? c),
|
|
1901
|
+
visibility: f ? "visible" : "hidden"
|
|
1433
1902
|
};
|
|
1434
1903
|
return /* @__PURE__ */ C(
|
|
1435
|
-
|
|
1904
|
+
L.div,
|
|
1436
1905
|
{
|
|
1437
1906
|
ref: m,
|
|
1438
|
-
id:
|
|
1907
|
+
id: r,
|
|
1439
1908
|
role: "tooltip",
|
|
1440
|
-
layout: !
|
|
1909
|
+
layout: !p,
|
|
1441
1910
|
layoutDependency: t,
|
|
1442
|
-
"data-side":
|
|
1443
|
-
"data-align":
|
|
1444
|
-
"data-state":
|
|
1445
|
-
"aria-hidden":
|
|
1446
|
-
className:
|
|
1911
|
+
"data-side": f?.side ?? c,
|
|
1912
|
+
"data-align": d,
|
|
1913
|
+
"data-state": b ? "open" : "closed",
|
|
1914
|
+
"aria-hidden": b ? void 0 : !0,
|
|
1915
|
+
className: _(
|
|
1447
1916
|
"uk-tooltip",
|
|
1448
1917
|
"uk-tooltip__surface",
|
|
1449
1918
|
"uk-tooltip--group",
|
|
1450
1919
|
n
|
|
1451
1920
|
),
|
|
1452
|
-
style:
|
|
1453
|
-
initial:
|
|
1921
|
+
style: I,
|
|
1922
|
+
initial: p ? { opacity: 0 } : { opacity: 0, scale: 0.96 },
|
|
1454
1923
|
animate: { opacity: 1, scale: 1 },
|
|
1455
|
-
exit:
|
|
1456
|
-
transition:
|
|
1924
|
+
exit: p ? { opacity: 0 } : { opacity: 0, scale: 0.96 },
|
|
1925
|
+
transition: p ? { ...j, layout: { duration: 0 } } : ct,
|
|
1457
1926
|
children: [
|
|
1458
|
-
/* @__PURE__ */
|
|
1927
|
+
/* @__PURE__ */ l(
|
|
1459
1928
|
"span",
|
|
1460
1929
|
{
|
|
1461
1930
|
className: "uk-tooltip__arrow",
|
|
1462
1931
|
"aria-hidden": "true",
|
|
1463
1932
|
style: {
|
|
1464
|
-
"--uk-tooltip-arrow-offset": `${
|
|
1933
|
+
"--uk-tooltip-arrow-offset": `${f?.arrowOffset ?? 0}px`
|
|
1465
1934
|
}
|
|
1466
1935
|
}
|
|
1467
1936
|
),
|
|
1468
|
-
/* @__PURE__ */
|
|
1469
|
-
|
|
1937
|
+
/* @__PURE__ */ l(
|
|
1938
|
+
L.div,
|
|
1470
1939
|
{
|
|
1471
1940
|
className: "uk-tooltip__content",
|
|
1472
1941
|
initial: { opacity: 0 },
|
|
1473
1942
|
animate: { opacity: 1 },
|
|
1474
|
-
transition:
|
|
1943
|
+
transition: p ? j : Pe,
|
|
1475
1944
|
children: e
|
|
1476
1945
|
},
|
|
1477
1946
|
t
|
|
@@ -1480,174 +1949,175 @@ function wt({
|
|
|
1480
1949
|
}
|
|
1481
1950
|
);
|
|
1482
1951
|
}
|
|
1483
|
-
function
|
|
1952
|
+
function zt({
|
|
1484
1953
|
children: t,
|
|
1485
1954
|
side: e = "top",
|
|
1486
1955
|
align: n = "center",
|
|
1487
|
-
sideOffset:
|
|
1488
|
-
collisionPadding:
|
|
1956
|
+
sideOffset: r = 8,
|
|
1957
|
+
collisionPadding: i = 8,
|
|
1489
1958
|
avoidCollisions: s = !0,
|
|
1490
|
-
delayDuration:
|
|
1491
|
-
closeDelay:
|
|
1492
|
-
contentClassName:
|
|
1959
|
+
delayDuration: c = 180,
|
|
1960
|
+
closeDelay: d = 80,
|
|
1961
|
+
contentClassName: h
|
|
1493
1962
|
}) {
|
|
1494
|
-
const
|
|
1963
|
+
const u = O(), [o, m] = $(
|
|
1495
1964
|
() => /* @__PURE__ */ new Map()
|
|
1496
|
-
), [
|
|
1497
|
-
|
|
1498
|
-
|
|
1499
|
-
|
|
1500
|
-
),
|
|
1501
|
-
|
|
1502
|
-
}, []),
|
|
1503
|
-
|
|
1504
|
-
}, []),
|
|
1505
|
-
if (
|
|
1506
|
-
if (
|
|
1507
|
-
|
|
1965
|
+
), [p, b] = $(!1), [f, I] = $(null), g = R(null), k = R(null), v = oe(
|
|
1966
|
+
je,
|
|
1967
|
+
Ue,
|
|
1968
|
+
We
|
|
1969
|
+
), a = V(() => {
|
|
1970
|
+
g.current !== null && (clearTimeout(g.current), g.current = null);
|
|
1971
|
+
}, []), y = V(() => {
|
|
1972
|
+
k.current !== null && (clearTimeout(k.current), k.current = null);
|
|
1973
|
+
}, []), x = D((K, z = !1) => {
|
|
1974
|
+
if (a(), y(), I(K), !p) {
|
|
1975
|
+
if (z || c <= 0) {
|
|
1976
|
+
b(!0);
|
|
1508
1977
|
return;
|
|
1509
1978
|
}
|
|
1510
|
-
|
|
1511
|
-
|
|
1512
|
-
},
|
|
1979
|
+
g.current = setTimeout(() => {
|
|
1980
|
+
g.current = null, b(!0);
|
|
1981
|
+
}, c);
|
|
1513
1982
|
}
|
|
1514
|
-
}), w =
|
|
1515
|
-
if (
|
|
1516
|
-
if (
|
|
1517
|
-
|
|
1983
|
+
}), w = D(() => {
|
|
1984
|
+
if (a(), y(), !!p) {
|
|
1985
|
+
if (d <= 0) {
|
|
1986
|
+
b(!1);
|
|
1518
1987
|
return;
|
|
1519
1988
|
}
|
|
1520
|
-
|
|
1521
|
-
|
|
1522
|
-
},
|
|
1989
|
+
k.current = setTimeout(() => {
|
|
1990
|
+
k.current = null, b(!1);
|
|
1991
|
+
}, d);
|
|
1523
1992
|
}
|
|
1524
|
-
}),
|
|
1525
|
-
|
|
1526
|
-
}),
|
|
1527
|
-
(
|
|
1528
|
-
m((
|
|
1529
|
-
const
|
|
1530
|
-
if (
|
|
1531
|
-
return
|
|
1532
|
-
const
|
|
1533
|
-
return
|
|
1993
|
+
}), T = D(() => {
|
|
1994
|
+
a(), y(), b(!1);
|
|
1995
|
+
}), N = D(
|
|
1996
|
+
(K, z, Y) => {
|
|
1997
|
+
m((ce) => {
|
|
1998
|
+
const be = ce.get(K);
|
|
1999
|
+
if (be?.triggerElement === z && Object.is(be.content, Y))
|
|
2000
|
+
return ce;
|
|
2001
|
+
const ge = new Map(ce);
|
|
2002
|
+
return ge.set(K, { triggerElement: z, content: Y }), ge;
|
|
1534
2003
|
});
|
|
1535
2004
|
}
|
|
1536
|
-
),
|
|
1537
|
-
m((
|
|
1538
|
-
if (!
|
|
1539
|
-
return
|
|
1540
|
-
const
|
|
1541
|
-
return
|
|
2005
|
+
), P = D((K) => {
|
|
2006
|
+
m((z) => {
|
|
2007
|
+
if (!z.has(K))
|
|
2008
|
+
return z;
|
|
2009
|
+
const Y = new Map(z);
|
|
2010
|
+
return Y.delete(K), Y;
|
|
1542
2011
|
});
|
|
1543
2012
|
});
|
|
1544
|
-
|
|
2013
|
+
A(
|
|
1545
2014
|
() => () => {
|
|
1546
|
-
|
|
2015
|
+
a(), y();
|
|
1547
2016
|
},
|
|
1548
|
-
[
|
|
2017
|
+
[y, a]
|
|
1549
2018
|
);
|
|
1550
|
-
const
|
|
2019
|
+
const q = U(
|
|
1551
2020
|
() => ({
|
|
1552
|
-
open:
|
|
1553
|
-
activeValue:
|
|
1554
|
-
contentId:
|
|
1555
|
-
activate:
|
|
2021
|
+
open: p,
|
|
2022
|
+
activeValue: f,
|
|
2023
|
+
contentId: u,
|
|
2024
|
+
activate: x,
|
|
1556
2025
|
requestClose: w,
|
|
1557
|
-
dismiss:
|
|
1558
|
-
register:
|
|
1559
|
-
unregister:
|
|
2026
|
+
dismiss: T,
|
|
2027
|
+
register: N,
|
|
2028
|
+
unregister: P
|
|
1560
2029
|
}),
|
|
1561
2030
|
[
|
|
1562
|
-
|
|
1563
|
-
u,
|
|
1564
|
-
i,
|
|
1565
|
-
$,
|
|
2031
|
+
x,
|
|
1566
2032
|
f,
|
|
1567
|
-
|
|
2033
|
+
u,
|
|
2034
|
+
T,
|
|
2035
|
+
p,
|
|
2036
|
+
N,
|
|
1568
2037
|
w,
|
|
1569
|
-
|
|
2038
|
+
P
|
|
1570
2039
|
]
|
|
1571
|
-
),
|
|
1572
|
-
return /* @__PURE__ */ C(
|
|
2040
|
+
), E = f ? o.get(f) : void 0, G = p && !!E, me = v && E ? E.triggerElement.closest("dialog") ?? document.body : null;
|
|
2041
|
+
return /* @__PURE__ */ C(tt.Provider, { value: q, children: [
|
|
1573
2042
|
t,
|
|
1574
|
-
|
|
1575
|
-
/* @__PURE__ */
|
|
1576
|
-
|
|
2043
|
+
me && E ? ae(
|
|
2044
|
+
/* @__PURE__ */ l(pe, { reducedMotion: "user", children: /* @__PURE__ */ l(M, { children: G ? /* @__PURE__ */ l(
|
|
2045
|
+
Ht,
|
|
1577
2046
|
{
|
|
1578
|
-
activeValue:
|
|
1579
|
-
content:
|
|
1580
|
-
contentClassName:
|
|
1581
|
-
contentId:
|
|
1582
|
-
dismiss:
|
|
1583
|
-
triggerElement:
|
|
2047
|
+
activeValue: f ?? "",
|
|
2048
|
+
content: E.content,
|
|
2049
|
+
contentClassName: h,
|
|
2050
|
+
contentId: u,
|
|
2051
|
+
dismiss: T,
|
|
2052
|
+
triggerElement: E.triggerElement,
|
|
1584
2053
|
side: e,
|
|
1585
2054
|
align: n,
|
|
1586
|
-
sideOffset:
|
|
1587
|
-
collisionPadding:
|
|
2055
|
+
sideOffset: r,
|
|
2056
|
+
collisionPadding: i,
|
|
1588
2057
|
avoidCollisions: s
|
|
1589
2058
|
},
|
|
1590
2059
|
"uk-tooltip-group"
|
|
1591
2060
|
) : null }) }),
|
|
1592
|
-
|
|
2061
|
+
me
|
|
1593
2062
|
) : null
|
|
1594
2063
|
] });
|
|
1595
2064
|
}
|
|
1596
|
-
function
|
|
2065
|
+
function Kt({
|
|
1597
2066
|
value: t,
|
|
1598
2067
|
content: e,
|
|
1599
2068
|
children: n
|
|
1600
2069
|
}) {
|
|
1601
|
-
const
|
|
2070
|
+
const r = Vt("Tooltip.Item"), { register: i, unregister: s } = r, [c, d] = $(
|
|
1602
2071
|
null
|
|
1603
2072
|
);
|
|
1604
|
-
if (!
|
|
2073
|
+
if (!Q(n))
|
|
1605
2074
|
throw new Error("<Tooltip.Item> expects a single valid React element");
|
|
1606
|
-
const
|
|
1607
|
-
(
|
|
1608
|
-
|
|
2075
|
+
const h = n, u = h.props, o = u.ref ?? h.ref, m = u.onPointerEnter, p = u.onPointerLeave, b = u.onFocus, f = u.onBlur, I = u.onKeyDown, g = r.open && r.activeValue === t, k = V(
|
|
2076
|
+
(v) => {
|
|
2077
|
+
Ye(o, v), d(v);
|
|
1609
2078
|
},
|
|
1610
|
-
[
|
|
2079
|
+
[o, d]
|
|
1611
2080
|
);
|
|
1612
2081
|
return re(() => {
|
|
1613
|
-
if (
|
|
1614
|
-
return
|
|
1615
|
-
}, [e,
|
|
1616
|
-
ref:
|
|
1617
|
-
"aria-describedby":
|
|
1618
|
-
onPointerEnter:
|
|
1619
|
-
|
|
2082
|
+
if (c)
|
|
2083
|
+
return i(t, c, e), () => s(t);
|
|
2084
|
+
}, [e, i, c, s, t]), Z(h, {
|
|
2085
|
+
ref: k,
|
|
2086
|
+
"aria-describedby": g ? Je(u["aria-describedby"], r.contentId) : u["aria-describedby"],
|
|
2087
|
+
onPointerEnter: B(m, (v) => {
|
|
2088
|
+
r.activate(t, v.pointerType === "touch");
|
|
1620
2089
|
}),
|
|
1621
|
-
onPointerLeave:
|
|
1622
|
-
|
|
2090
|
+
onPointerLeave: B(p, (v) => {
|
|
2091
|
+
v.pointerType !== "touch" && r.requestClose();
|
|
1623
2092
|
}),
|
|
1624
|
-
onFocus:
|
|
1625
|
-
|
|
2093
|
+
onFocus: B(b, () => {
|
|
2094
|
+
r.activate(t);
|
|
1626
2095
|
}),
|
|
1627
|
-
onBlur:
|
|
1628
|
-
|
|
2096
|
+
onBlur: B(f, () => {
|
|
2097
|
+
r.requestClose();
|
|
1629
2098
|
}),
|
|
1630
|
-
onKeyDown:
|
|
1631
|
-
|
|
2099
|
+
onKeyDown: B(I, (v) => {
|
|
2100
|
+
v.key === "Escape" && g && (v.preventDefault(), v.stopPropagation(), r.dismiss());
|
|
1632
2101
|
})
|
|
1633
2102
|
});
|
|
1634
2103
|
}
|
|
1635
|
-
const
|
|
1636
|
-
Root:
|
|
1637
|
-
Trigger:
|
|
1638
|
-
Content:
|
|
1639
|
-
Group:
|
|
1640
|
-
Item:
|
|
2104
|
+
const tn = {
|
|
2105
|
+
Root: Rt,
|
|
2106
|
+
Trigger: Ot,
|
|
2107
|
+
Content: Bt,
|
|
2108
|
+
Group: zt,
|
|
2109
|
+
Item: Kt
|
|
1641
2110
|
};
|
|
1642
2111
|
export {
|
|
1643
|
-
|
|
1644
|
-
|
|
1645
|
-
|
|
1646
|
-
|
|
1647
|
-
|
|
1648
|
-
|
|
1649
|
-
|
|
1650
|
-
|
|
1651
|
-
|
|
2112
|
+
Ce as Button,
|
|
2113
|
+
at as CheckBox,
|
|
2114
|
+
Zt as Dialog,
|
|
2115
|
+
Xt as Input,
|
|
2116
|
+
en as Marquee,
|
|
2117
|
+
Wt as Select,
|
|
2118
|
+
Jt as Sidebar,
|
|
2119
|
+
Yt as Switch,
|
|
2120
|
+
Qt as Tabs,
|
|
2121
|
+
tn as Tooltip
|
|
1652
2122
|
};
|
|
1653
2123
|
//# sourceMappingURL=index.js.map
|