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