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