seam-react 0.9.0 → 0.9.2

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