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