seam-react 0.7.0 → 0.9.0

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