seam-react 0.9.1 → 0.9.2

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