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