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