seam-react 0.9.0 → 0.9.1

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