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