seam-react 0.3.0 → 0.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1,339 +1,584 @@
1
- import { jsxs as N, jsx as h } from "react/jsx-runtime";
2
- import { forwardRef as D, useId as z, useRef as _, useEffect as S, useMemo as X, createContext as j, useContext as Y, isValidElement as tt, cloneElement as J, useSyncExternalStore as et, useState as O, useLayoutEffect as nt, useCallback as B } from "react";
3
- import { useReducedMotion as K, useMotionValue as Kt, animate as dt, motion as V, MotionConfig as ot, AnimatePresence as rt, useIsPresent as it } from "motion/react";
4
- import { createPortal as st } from "react-dom";
5
- import { useControllableState as Q, useEventCallback as P, useLockBodyScroll as Gt, useFocusTrap as qt } from "seam-hooks";
6
- function v(...e) {
7
- return e.filter(Boolean).join(" ");
1
+ import { jsxs as C, jsx as c, Fragment as ge } from "react/jsx-runtime";
2
+ import { forwardRef as P, useId as R, useRef as N, useEffect as O, useState as M, useMemo as U, isValidElement as Z, cloneElement as j, createContext as q, useContext as X, useSyncExternalStore as oe, useLayoutEffect as re, useCallback as G } from "react";
3
+ import { useReducedMotion as V, useMotionValue as Xe, animate as fe, motion as E, LayoutGroup as Ye, AnimatePresence as A, MotionConfig as ie, useIsPresent as ae } from "motion/react";
4
+ import { createPortal as se } from "react-dom";
5
+ import { useControllableState as Y, useEventCallback as S, useLockBodyScroll as We, useFocusTrap as Je } from "seam-hooks";
6
+ function k(...t) {
7
+ return t.filter(Boolean).join(" ");
8
8
  }
9
- const ht = D(function({
10
- variant: t = "primary",
9
+ const ye = P(function({
10
+ variant: e = "primary",
11
11
  size: n = "md",
12
12
  loading: o = !1,
13
13
  iconOnly: r = !1,
14
- type: a = "button",
15
- className: s,
16
- children: l,
14
+ type: s = "button",
15
+ className: a,
16
+ children: p,
17
17
  ...d
18
18
  }, i) {
19
- return /* @__PURE__ */ N(
19
+ return /* @__PURE__ */ C(
20
20
  "button",
21
21
  {
22
22
  ...d,
23
23
  ref: i,
24
- type: a,
25
- className: v("uk-button", s),
26
- "data-variant": t,
24
+ type: s,
25
+ className: k("uk-button", a),
26
+ "data-variant": e,
27
27
  "data-size": n,
28
28
  "data-loading": o ? "true" : void 0,
29
29
  "data-icon-only": r ? "true" : void 0,
30
30
  disabled: d.disabled || o,
31
31
  "aria-busy": o || void 0,
32
32
  children: [
33
- o ? /* @__PURE__ */ h("span", { className: "uk-button__spinner", "aria-hidden": "true" }) : null,
34
- l
33
+ o ? /* @__PURE__ */ c("span", { className: "uk-button__spinner", "aria-hidden": "true" }) : null,
34
+ p
35
35
  ]
36
36
  }
37
37
  );
38
- }), Te = D(function({
39
- inputSize: t = "md",
38
+ }), Pt = P(function({
39
+ inputSize: e = "md",
40
40
  invalid: n = !1,
41
41
  className: o,
42
42
  "aria-invalid": r,
43
- ...a
44
- }, s) {
45
- return /* @__PURE__ */ h(
43
+ ...s
44
+ }, a) {
45
+ return /* @__PURE__ */ c(
46
46
  "input",
47
47
  {
48
- ...a,
49
- ref: s,
50
- className: v("uk-input", o),
51
- "data-size": t,
48
+ ...s,
49
+ ref: a,
50
+ className: k("uk-input", o),
51
+ "data-size": e,
52
52
  "aria-invalid": n ? !0 : r
53
53
  }
54
54
  );
55
- }), U = [0.23, 1, 0.32, 1], pt = {
55
+ }), Q = [0.23, 1, 0.32, 1], Qe = [0.77, 0, 0.175, 1], he = {
56
56
  type: "spring",
57
57
  bounce: 0,
58
58
  duration: 0.3
59
- }, ft = {
59
+ }, me = {
60
60
  type: "spring",
61
61
  bounce: 0.04,
62
62
  duration: 0.38
63
- }, Ut = {
63
+ }, ce = {
64
64
  type: "spring",
65
65
  bounce: 0.08,
66
66
  duration: 0.34
67
- }, bt = {
67
+ }, Ze = {
68
+ duration: 0.2,
69
+ ease: Qe
70
+ }, ve = {
68
71
  duration: 0.12,
69
- ease: U
70
- }, Xt = {
72
+ ease: Q
73
+ }, et = {
71
74
  layout: { type: "spring", bounce: 0, duration: 0.22 },
72
- opacity: { duration: 0.12, ease: U },
73
- scale: { duration: 0.12, ease: U }
74
- }, H = {
75
+ opacity: { duration: 0.12, ease: Q },
76
+ scale: { duration: 0.12, ease: Q }
77
+ }, K = {
75
78
  duration: 0.12,
76
- ease: U
77
- }, we = D(function({
78
- checked: t,
79
+ ease: Q
80
+ }, Dt = P(function({
81
+ checked: e,
79
82
  defaultChecked: n,
80
83
  onCheckedChange: o,
81
84
  disabled: r,
82
- className: a,
83
- children: s,
84
- id: l,
85
+ className: s,
86
+ children: a,
87
+ id: p,
85
88
  ...d
86
89
  }, i) {
87
- const m = z(), b = l ?? m, u = K() ?? !1, f = _(!1), p = _(null), [g, y] = Q({
88
- value: t,
90
+ const m = R(), h = p ?? m, f = V() ?? !1, b = N(!1), u = N(null), [g, y] = Y({
91
+ value: e,
89
92
  defaultValue: n ?? !1,
90
93
  onChange: o
91
- }), T = Kt(g ? 16 : 0);
92
- S(() => {
93
- if (p.current)
94
+ }), v = Xe(g ? 16 : 0);
95
+ O(() => {
96
+ if (u.current)
94
97
  return;
95
- const c = dt(
96
- T,
98
+ const l = fe(
99
+ v,
97
100
  g ? 16 : 0,
98
- u ? { duration: 0 } : pt
101
+ f ? { duration: 0 } : he
99
102
  );
100
- return () => c.stop();
101
- }, [g, u, T]);
102
- const C = (c) => {
103
- const w = p.current;
104
- if (!(!w || w.pointerId !== c.pointerId)) {
105
- if (w.moved) {
106
- const I = w.samples[0], k = w.samples[w.samples.length - 1], L = I && k ? Math.max(k.time - I.time, 1) : 1, R = I && k ? (k.x - I.x) / L * 1e3 : 0, x = Math.abs(R) > 220 ? R > 0 : T.get() >= 8;
107
- f.current = !0, p.current = null, y(x), dt(
108
- T,
103
+ return () => l.stop();
104
+ }, [g, f, v]);
105
+ const T = (l) => {
106
+ const I = u.current;
107
+ if (!(!I || I.pointerId !== l.pointerId)) {
108
+ if (I.moved) {
109
+ const w = I.samples[0], _ = I.samples[I.samples.length - 1], $ = w && _ ? Math.max(_.time - w.time, 1) : 1, L = w && _ ? (_.x - w.x) / $ * 1e3 : 0, x = Math.abs(L) > 220 ? L > 0 : v.get() >= 8;
110
+ b.current = !0, u.current = null, y(x), fe(
111
+ v,
109
112
  x ? 16 : 0,
110
- u ? { duration: 0 } : { ...pt, velocity: R }
113
+ f ? { duration: 0 } : { ...he, velocity: L }
111
114
  ), window.setTimeout(() => {
112
- f.current = !1;
115
+ b.current = !1;
113
116
  }, 0);
114
117
  } else
115
- p.current = null;
116
- c.currentTarget.hasPointerCapture(c.pointerId) && typeof c.currentTarget.releasePointerCapture == "function" && c.currentTarget.releasePointerCapture(c.pointerId);
118
+ u.current = null;
119
+ l.currentTarget.hasPointerCapture(l.pointerId) && typeof l.currentTarget.releasePointerCapture == "function" && l.currentTarget.releasePointerCapture(l.pointerId);
117
120
  }
118
121
  };
119
- return /* @__PURE__ */ N(
122
+ return /* @__PURE__ */ C(
120
123
  "label",
121
124
  {
122
- className: v("uk-switch", a),
125
+ className: k("uk-switch", s),
123
126
  "data-disabled": r ? "true" : void 0,
124
- htmlFor: b,
125
- onClickCapture: (c) => {
126
- f.current && (c.preventDefault(), c.stopPropagation());
127
+ htmlFor: h,
128
+ onClickCapture: (l) => {
129
+ b.current && (l.preventDefault(), l.stopPropagation());
127
130
  },
128
131
  children: [
129
- /* @__PURE__ */ h(
132
+ /* @__PURE__ */ c(
130
133
  "input",
131
134
  {
132
135
  ...d,
133
136
  ref: i,
134
- id: b,
137
+ id: h,
135
138
  type: "checkbox",
136
139
  role: "switch",
137
140
  className: "uk-switch__input",
138
141
  checked: g,
139
142
  disabled: r,
140
143
  "aria-checked": g,
141
- onChange: (c) => y(c.target.checked)
144
+ onChange: (l) => y(l.target.checked)
142
145
  }
143
146
  ),
144
- /* @__PURE__ */ h(
147
+ /* @__PURE__ */ c(
145
148
  "span",
146
149
  {
147
150
  className: "uk-switch__track",
148
151
  "aria-hidden": "true",
149
- onPointerDown: (c) => {
150
- r || (p.current = {
151
- pointerId: c.pointerId,
152
- startX: c.clientX,
153
- startValue: T.get(),
152
+ onPointerDown: (l) => {
153
+ r || (u.current = {
154
+ pointerId: l.pointerId,
155
+ startX: l.clientX,
156
+ startValue: v.get(),
154
157
  moved: !1,
155
- samples: [{ x: c.clientX, time: performance.now() }]
156
- }, typeof c.currentTarget.setPointerCapture == "function" && c.currentTarget.setPointerCapture(c.pointerId));
158
+ samples: [{ x: l.clientX, time: performance.now() }]
159
+ }, typeof l.currentTarget.setPointerCapture == "function" && l.currentTarget.setPointerCapture(l.pointerId));
157
160
  },
158
- onPointerMove: (c) => {
159
- const w = p.current;
160
- if (!w || w.pointerId !== c.pointerId)
161
+ onPointerMove: (l) => {
162
+ const I = u.current;
163
+ if (!I || I.pointerId !== l.pointerId)
161
164
  return;
162
- const I = c.clientX - w.startX;
163
- Math.abs(I) > 4 && (w.moved = !0), w.moved && (c.preventDefault(), T.set(Math.max(0, Math.min(16, w.startValue + I))), w.samples.push({ x: c.clientX, time: performance.now() }), w.samples = w.samples.filter(
164
- (k) => performance.now() - k.time < 120
165
+ const w = l.clientX - I.startX;
166
+ Math.abs(w) > 4 && (I.moved = !0), I.moved && (l.preventDefault(), v.set(Math.max(0, Math.min(16, I.startValue + w))), I.samples.push({ x: l.clientX, time: performance.now() }), I.samples = I.samples.filter(
167
+ (_) => performance.now() - _.time < 120
165
168
  ));
166
169
  },
167
- onPointerUp: C,
168
- onPointerCancel: C,
169
- children: /* @__PURE__ */ h(V.span, { className: "uk-switch__thumb", style: { x: T } })
170
+ onPointerUp: T,
171
+ onPointerCancel: T,
172
+ children: /* @__PURE__ */ c(E.span, { className: "uk-switch__thumb", style: { x: v } })
170
173
  }
171
174
  ),
172
- s ? /* @__PURE__ */ h("span", { className: "uk-switch__label", children: s }) : null
175
+ a ? /* @__PURE__ */ c("span", { className: "uk-switch__label", children: a }) : null
173
176
  ]
174
177
  }
175
178
  );
176
- }), gt = j(null);
177
- function at(e) {
178
- const t = Y(gt);
179
- if (!t)
180
- throw new Error(`<${e}> must be rendered inside <Tabs>`);
181
- return t;
179
+ }), Ie = q(null);
180
+ function Te(t) {
181
+ const e = X(Ie);
182
+ if (!e)
183
+ throw new Error(`<${t}> must be rendered inside <Sidebar>`);
184
+ return e;
182
185
  }
183
- function yt(e, t) {
184
- return `${e}-tab-${encodeURIComponent(t)}`;
186
+ function te(t, e) {
187
+ return (n) => {
188
+ t?.(n), n.defaultPrevented || e(n);
189
+ };
185
190
  }
186
- function Tt(e, t) {
187
- return `${e}-panel-${encodeURIComponent(t)}`;
191
+ function tt({
192
+ children: t,
193
+ className: e,
194
+ hoverPreview: n = !0,
195
+ hoverIndicator: o = "rail",
196
+ groupGap: r,
197
+ style: s,
198
+ ...a
199
+ }) {
200
+ const [p, d] = M(null), i = R().replace(/:/g, ""), m = U(
201
+ () => ({
202
+ hoveredId: p,
203
+ setHoveredId: d,
204
+ indicatorBaseId: i,
205
+ hoverPreview: n,
206
+ hoverIndicator: o
207
+ }),
208
+ [p, i, n, o]
209
+ ), h = typeof r == "number" ? `${r}px` : r, f = {
210
+ ...s,
211
+ ...h === void 0 ? {} : { "--uk-sidebar-group-gap": h }
212
+ };
213
+ return /* @__PURE__ */ c(Ie.Provider, { value: m, children: /* @__PURE__ */ c(Ye, { id: `sidebar-${i}`, children: /* @__PURE__ */ c(
214
+ "nav",
215
+ {
216
+ ...a,
217
+ className: k("uk-sidebar", e),
218
+ style: f,
219
+ children: t
220
+ }
221
+ ) }) });
188
222
  }
189
- function jt({
190
- value: e,
191
- defaultValue: t,
223
+ function nt({
224
+ title: t,
225
+ icon: e,
226
+ collapsible: n = !1,
227
+ open: o,
228
+ defaultOpen: r = !0,
229
+ onOpenChange: s,
230
+ children: a,
231
+ className: p,
232
+ ...d
233
+ }) {
234
+ const i = R(), m = R(), h = R(), f = N(null), b = N(null), u = Te("Sidebar.Group"), g = e != null, y = V() ?? !1, [v, T] = Y({
235
+ value: o,
236
+ defaultValue: r,
237
+ onChange: s
238
+ }), l = n ? v : !0, I = u.hoveredId === h;
239
+ O(() => {
240
+ !n || l || b.current?.contains(document.activeElement) && f.current?.focus();
241
+ }, [n, l]);
242
+ const w = /* @__PURE__ */ C(ge, { children: [
243
+ g ? /* @__PURE__ */ c("span", { className: "uk-sidebar__group-icon", "aria-hidden": "true", children: e }) : null,
244
+ /* @__PURE__ */ c("span", { className: "uk-sidebar__group-label", children: t }),
245
+ 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(
246
+ "path",
247
+ {
248
+ d: "m6 3.8 4.2 4.2L6 12.2",
249
+ stroke: "currentColor",
250
+ strokeWidth: "1.35",
251
+ strokeLinecap: "round",
252
+ strokeLinejoin: "round"
253
+ }
254
+ ) }) }) : null
255
+ ] });
256
+ return /* @__PURE__ */ C(
257
+ "section",
258
+ {
259
+ ...d,
260
+ className: k("uk-sidebar__group", p),
261
+ "aria-labelledby": d["aria-labelledby"] ?? i,
262
+ "data-collapsible": n ? "true" : "false",
263
+ "data-has-icon": g ? "true" : "false",
264
+ "data-state": l ? "open" : "closed",
265
+ children: [
266
+ n ? /* @__PURE__ */ C(
267
+ "button",
268
+ {
269
+ ref: f,
270
+ type: "button",
271
+ className: "uk-sidebar__group-title uk-sidebar__group-trigger",
272
+ id: i,
273
+ "aria-controls": m,
274
+ "aria-expanded": l,
275
+ "data-preview": u.hoverIndicator === "background" && I ? "true" : void 0,
276
+ onClick: () => T((_) => !_),
277
+ onPointerEnter: (_) => {
278
+ u.hoverPreview && u.hoverIndicator === "background" && _.pointerType === "mouse" && u.setHoveredId(h);
279
+ },
280
+ onPointerLeave: () => {
281
+ u.hoveredId === h && u.setHoveredId(null);
282
+ },
283
+ onPointerCancel: () => {
284
+ u.hoveredId === h && u.setHoveredId(null);
285
+ },
286
+ children: [
287
+ /* @__PURE__ */ c(A, { initial: !1, children: u.hoverPreview && u.hoverIndicator === "background" && I ? /* @__PURE__ */ c(
288
+ E.span,
289
+ {
290
+ className: "uk-sidebar__group-surface",
291
+ "data-kind": "hover",
292
+ "data-slot": "sidebar-hover-highlight",
293
+ layoutId: `${u.indicatorBaseId}-hover`,
294
+ "aria-hidden": "true",
295
+ initial: { opacity: 0 },
296
+ animate: { opacity: 1 },
297
+ exit: { opacity: 0 },
298
+ transition: y ? { duration: 0 } : ce
299
+ }
300
+ ) : null }),
301
+ w
302
+ ]
303
+ }
304
+ ) : /* @__PURE__ */ c("div", { className: "uk-sidebar__group-title", id: i, children: w }),
305
+ /* @__PURE__ */ c(
306
+ E.div,
307
+ {
308
+ ref: b,
309
+ className: "uk-sidebar__content",
310
+ id: m,
311
+ "data-state": l ? "open" : "closed",
312
+ initial: !1,
313
+ animate: {
314
+ height: l ? "auto" : 0,
315
+ opacity: l ? 1 : 0
316
+ },
317
+ transition: y ? { duration: 0 } : Ze,
318
+ inert: n && !l,
319
+ "aria-hidden": n && !l ? !0 : void 0,
320
+ children: /* @__PURE__ */ c("ul", { className: "uk-sidebar__list", children: a })
321
+ }
322
+ )
323
+ ]
324
+ }
325
+ );
326
+ }
327
+ function ot({
328
+ active: t = !1,
329
+ children: e,
330
+ className: n
331
+ }) {
332
+ const o = Te("Sidebar.Item"), r = R(), a = V() ?? !1 ? { duration: 0 } : ce;
333
+ if (!Z(e))
334
+ throw new Error("<Sidebar.Item> expects a single valid React element");
335
+ const p = e, d = p.props, i = d.className, m = typeof i == "function" ? (y) => k("uk-sidebar__link", i(y), n) : k("uk-sidebar__link", i, n), h = d.onPointerEnter, f = d.onPointerLeave, b = d.onPointerCancel, u = o.hoveredId === r, g = /* @__PURE__ */ C(ge, { children: [
336
+ /* @__PURE__ */ c("span", { className: "uk-sidebar__rail", "aria-hidden": "true" }),
337
+ /* @__PURE__ */ c(A, { initial: !1, children: o.hoverPreview && o.hoverIndicator === "rail" && u ? /* @__PURE__ */ c(
338
+ E.span,
339
+ {
340
+ className: "uk-sidebar__rail-indicator",
341
+ "data-kind": "hover",
342
+ "data-slot": "sidebar-hover-rail-indicator",
343
+ layoutId: `${o.indicatorBaseId}-hover-rail`,
344
+ "aria-hidden": "true",
345
+ initial: { opacity: 0 },
346
+ animate: { opacity: 1 },
347
+ exit: { opacity: 0 },
348
+ transition: a
349
+ }
350
+ ) : null }),
351
+ /* @__PURE__ */ c(A, { initial: !1, children: o.hoverIndicator === "rail" && t ? /* @__PURE__ */ c(
352
+ E.span,
353
+ {
354
+ className: "uk-sidebar__rail-indicator",
355
+ "data-kind": "active",
356
+ "data-slot": "sidebar-active-rail-indicator",
357
+ layoutId: `${o.indicatorBaseId}-active-rail`,
358
+ "aria-hidden": "true",
359
+ initial: { opacity: 0 },
360
+ animate: { opacity: 1 },
361
+ exit: { opacity: 0 },
362
+ transition: a
363
+ }
364
+ ) : null }),
365
+ /* @__PURE__ */ c(A, { initial: !1, children: o.hoverPreview && o.hoverIndicator === "background" && u ? /* @__PURE__ */ c(
366
+ E.span,
367
+ {
368
+ className: "uk-sidebar__surface",
369
+ "data-kind": "hover",
370
+ "data-slot": "sidebar-hover-highlight",
371
+ layoutId: `${o.indicatorBaseId}-hover`,
372
+ "aria-hidden": "true",
373
+ initial: { opacity: 0 },
374
+ animate: { opacity: 1 },
375
+ exit: { opacity: 0 },
376
+ transition: a
377
+ }
378
+ ) : null }),
379
+ /* @__PURE__ */ c(A, { initial: !1, children: o.hoverIndicator === "background" && t ? /* @__PURE__ */ c(
380
+ E.span,
381
+ {
382
+ className: "uk-sidebar__surface",
383
+ "data-kind": "active",
384
+ "data-slot": "sidebar-active-highlight",
385
+ layoutId: `${o.indicatorBaseId}-active`,
386
+ "aria-hidden": "true",
387
+ initial: { opacity: 0 },
388
+ animate: { opacity: 1 },
389
+ exit: { opacity: 0 },
390
+ transition: a
391
+ }
392
+ ) : null }),
393
+ /* @__PURE__ */ c("span", { className: "uk-sidebar__label", children: d.children })
394
+ ] });
395
+ return /* @__PURE__ */ c("li", { className: "uk-sidebar__item", children: j(
396
+ p,
397
+ {
398
+ className: m,
399
+ "data-active": t ? "true" : "false",
400
+ "data-preview": t || u ? "true" : "false",
401
+ "aria-current": d["aria-current"] ?? (t ? "page" : void 0),
402
+ onPointerEnter: te(
403
+ h,
404
+ (y) => {
405
+ o.hoverPreview && y.pointerType === "mouse" && o.setHoveredId(r);
406
+ }
407
+ ),
408
+ onPointerLeave: te(f, () => {
409
+ o.hoveredId === r && o.setHoveredId(null);
410
+ }),
411
+ onPointerCancel: te(b, () => {
412
+ o.hoveredId === r && o.setHoveredId(null);
413
+ })
414
+ },
415
+ g
416
+ ) });
417
+ }
418
+ const Rt = Object.assign(tt, {
419
+ Group: nt,
420
+ Item: ot
421
+ }), ke = q(null);
422
+ function le(t) {
423
+ const e = X(ke);
424
+ if (!e)
425
+ throw new Error(`<${t}> must be rendered inside <Tabs>`);
426
+ return e;
427
+ }
428
+ function we(t, e) {
429
+ return `${t}-tab-${encodeURIComponent(e)}`;
430
+ }
431
+ function _e(t, e) {
432
+ return `${t}-panel-${encodeURIComponent(e)}`;
433
+ }
434
+ function rt({
435
+ value: t,
436
+ defaultValue: e,
192
437
  onValueChange: n,
193
438
  orientation: o = "horizontal",
194
439
  className: r,
195
- children: a
440
+ children: s
196
441
  }) {
197
- const s = z(), [l, d] = Q({
198
- value: e,
199
- defaultValue: t ?? "",
442
+ const a = R(), [p, d] = Y({
443
+ value: t,
444
+ defaultValue: e ?? "",
200
445
  onChange: n
201
- }), i = X(
446
+ }), i = U(
202
447
  () => ({
203
- baseId: s,
204
- value: l,
448
+ baseId: a,
449
+ value: p,
205
450
  setValue: d,
206
451
  orientation: o,
207
- indicatorId: `${s}-indicator`
452
+ indicatorId: `${a}-indicator`
208
453
  }),
209
- [s, l, o, d]
454
+ [a, p, o, d]
210
455
  );
211
- return /* @__PURE__ */ h(gt.Provider, { value: i, children: /* @__PURE__ */ h("div", { className: v("uk-tabs", r), "data-orientation": o, children: a }) });
456
+ return /* @__PURE__ */ c(ke.Provider, { value: i, children: /* @__PURE__ */ c("div", { className: k("uk-tabs", r), "data-orientation": o, children: s }) });
212
457
  }
213
- const Yt = D(function({ className: t, onKeyDown: n, ...o }, r) {
214
- const { orientation: a } = at("Tabs.List");
215
- return /* @__PURE__ */ h(
458
+ const it = P(function({ className: e, onKeyDown: n, ...o }, r) {
459
+ const { orientation: s } = le("Tabs.List");
460
+ return /* @__PURE__ */ c(
216
461
  "div",
217
462
  {
218
463
  ...o,
219
464
  ref: r,
220
465
  role: "tablist",
221
- "aria-orientation": a,
466
+ "aria-orientation": s,
222
467
  tabIndex: -1,
223
- className: v("uk-tabs__list", t),
224
- onKeyDown: (s) => {
225
- if (n?.(s), s.defaultPrevented)
468
+ className: k("uk-tabs__list", e),
469
+ onKeyDown: (a) => {
470
+ if (n?.(a), a.defaultPrevented)
226
471
  return;
227
- const d = s.target?.closest('[role="tab"]');
472
+ const d = a.target?.closest('[role="tab"]');
228
473
  if (!d || d.hasAttribute("disabled"))
229
474
  return;
230
475
  const i = Array.from(
231
- s.currentTarget.querySelectorAll(
476
+ a.currentTarget.querySelectorAll(
232
477
  '[role="tab"]:not([disabled])'
233
478
  )
234
479
  ), m = i.indexOf(d);
235
480
  if (m === -1)
236
481
  return;
237
- const b = a === "horizontal" ? "ArrowRight" : "ArrowDown", u = a === "horizontal" ? "ArrowLeft" : "ArrowUp";
238
- let f = -1;
239
- switch (s.key) {
240
- case b:
241
- f = (m + 1) % i.length;
482
+ const h = s === "horizontal" ? "ArrowRight" : "ArrowDown", f = s === "horizontal" ? "ArrowLeft" : "ArrowUp";
483
+ let b = -1;
484
+ switch (a.key) {
485
+ case h:
486
+ b = (m + 1) % i.length;
242
487
  break;
243
- case u:
244
- f = (m - 1 + i.length) % i.length;
488
+ case f:
489
+ b = (m - 1 + i.length) % i.length;
245
490
  break;
246
491
  case "Home":
247
- f = 0;
492
+ b = 0;
248
493
  break;
249
494
  case "End":
250
- f = i.length - 1;
495
+ b = i.length - 1;
251
496
  break;
252
497
  default:
253
498
  return;
254
499
  }
255
- s.preventDefault();
256
- const p = i[f];
257
- p && (p.focus(), p.click());
500
+ a.preventDefault();
501
+ const u = i[b];
502
+ u && (u.focus(), u.click());
258
503
  }
259
504
  }
260
505
  );
261
- }), Jt = D(function({ value: t, type: n = "button", className: o, onClick: r, children: a, ...s }, l) {
262
- const d = at("Tabs.Trigger"), i = d.value === t, m = K() ?? !1;
263
- return /* @__PURE__ */ N(
506
+ }), at = P(function({ value: e, type: n = "button", className: o, onClick: r, children: s, ...a }, p) {
507
+ const d = le("Tabs.Trigger"), i = d.value === e, m = V() ?? !1;
508
+ return /* @__PURE__ */ C(
264
509
  "button",
265
510
  {
266
- ...s,
267
- ref: l,
511
+ ...a,
512
+ ref: p,
268
513
  type: n,
269
514
  role: "tab",
270
- id: yt(d.baseId, t),
515
+ id: we(d.baseId, e),
271
516
  "aria-selected": i,
272
- "aria-controls": Tt(d.baseId, t),
517
+ "aria-controls": _e(d.baseId, e),
273
518
  tabIndex: i ? 0 : -1,
274
519
  "data-state": i ? "active" : "inactive",
275
- className: v("uk-tabs__trigger", o),
276
- onClick: (b) => {
277
- r?.(b), b.defaultPrevented || d.setValue(t);
520
+ className: k("uk-tabs__trigger", o),
521
+ onClick: (h) => {
522
+ r?.(h), h.defaultPrevented || d.setValue(e);
278
523
  },
279
524
  children: [
280
- a,
281
- i ? /* @__PURE__ */ h(
282
- V.span,
525
+ s,
526
+ i ? /* @__PURE__ */ c(
527
+ E.span,
283
528
  {
284
529
  className: "uk-tabs__indicator",
285
530
  layoutId: d.indicatorId,
286
531
  "aria-hidden": "true",
287
- transition: m ? { duration: 0 } : Ut
532
+ transition: m ? { duration: 0 } : ce
288
533
  }
289
534
  ) : null
290
535
  ]
291
536
  }
292
537
  );
293
- }), Qt = D(function({ value: t, className: n, ...o }, r) {
294
- const a = at("Tabs.Content"), s = a.value === t;
295
- return /* @__PURE__ */ h(
538
+ }), st = P(function({ value: e, className: n, ...o }, r) {
539
+ const s = le("Tabs.Content"), a = s.value === e;
540
+ return /* @__PURE__ */ c(
296
541
  "div",
297
542
  {
298
543
  ...o,
299
544
  ref: r,
300
545
  role: "tabpanel",
301
- id: Tt(a.baseId, t),
302
- "aria-labelledby": yt(a.baseId, t),
303
- hidden: !s,
546
+ id: _e(s.baseId, e),
547
+ "aria-labelledby": we(s.baseId, e),
548
+ hidden: !a,
304
549
  tabIndex: 0,
305
- "data-state": s ? "active" : "inactive",
306
- className: v("uk-tabs__panel", n)
550
+ "data-state": a ? "active" : "inactive",
551
+ className: k("uk-tabs__panel", n)
307
552
  }
308
553
  );
309
- }), Ce = Object.assign(jt, {
310
- List: Yt,
311
- Trigger: Jt,
312
- Content: Qt
313
- }), wt = j(null), Wt = () => () => {
314
- }, Zt = () => !0, te = () => !1;
315
- function G(e) {
316
- const t = Y(wt);
317
- if (!t)
318
- throw new Error(`<${e}> must be rendered inside <Dialog.Root>`);
319
- return t;
554
+ }), Lt = Object.assign(rt, {
555
+ List: it,
556
+ Trigger: at,
557
+ Content: st
558
+ }), xe = q(null), ct = () => () => {
559
+ }, lt = () => !0, ut = () => !1;
560
+ function W(t) {
561
+ const e = X(xe);
562
+ if (!e)
563
+ throw new Error(`<${t}> must be rendered inside <Dialog.Root>`);
564
+ return e;
320
565
  }
321
- function Ct(e, t) {
566
+ function Ce(t, e) {
322
567
  return (n) => {
323
- e?.(n), n.defaultPrevented || t(n);
568
+ t?.(n), n.defaultPrevented || e(n);
324
569
  };
325
570
  }
326
- function vt({
327
- children: e,
328
- open: t,
571
+ function Ee({
572
+ children: t,
573
+ open: e,
329
574
  defaultOpen: n,
330
575
  onOpenChange: o
331
576
  }) {
332
- const r = z(), [a, s] = O(!1), [l, d] = O(!1), [i, m] = Q({
333
- value: t,
577
+ const r = R(), [s, a] = M(!1), [p, d] = M(!1), [i, m] = Y({
578
+ value: e,
334
579
  defaultValue: n ?? !1,
335
580
  onChange: o
336
- }), b = X(
581
+ }), h = U(
337
582
  () => ({
338
583
  open: i,
339
584
  setOpen: m,
@@ -341,193 +586,193 @@ function vt({
341
586
  contentId: `${r}-content`,
342
587
  titleId: `${r}-title`,
343
588
  descriptionId: `${r}-description`,
344
- hasTitle: a,
345
- setHasTitle: s,
346
- hasDescription: l,
589
+ hasTitle: s,
590
+ setHasTitle: a,
591
+ hasDescription: p,
347
592
  setHasDescription: d
348
593
  }),
349
- [r, i, l, a, m]
594
+ [r, i, p, s, m]
350
595
  );
351
- return /* @__PURE__ */ h(wt.Provider, { value: b, children: e });
596
+ return /* @__PURE__ */ c(xe.Provider, { value: h, children: t });
352
597
  }
353
- function ee({ children: e }) {
354
- const t = G("Dialog.Trigger"), n = e, o = n.props.onClick;
355
- return J(n, {
356
- id: t.triggerId,
598
+ function dt({ children: t }) {
599
+ const e = W("Dialog.Trigger"), n = t, o = n.props.onClick;
600
+ return j(n, {
601
+ id: e.triggerId,
357
602
  "aria-haspopup": "dialog",
358
- "aria-expanded": t.open,
359
- "aria-controls": t.open ? t.contentId : void 0,
360
- onClick: Ct(o, () => {
361
- t.setOpen(!t.open);
603
+ "aria-expanded": e.open,
604
+ "aria-controls": e.open ? e.contentId : void 0,
605
+ onClick: Ce(o, () => {
606
+ e.setOpen(!e.open);
362
607
  })
363
608
  });
364
609
  }
365
- function xt({
366
- children: e,
367
- label: t = "Close"
610
+ function Ne({
611
+ children: t,
612
+ label: e = "Close"
368
613
  }) {
369
- const n = G("Dialog.Close");
370
- if (tt(e)) {
371
- const o = e, r = o.props.onClick;
372
- return J(o, {
373
- onClick: Ct(r, () => {
614
+ const n = W("Dialog.Close");
615
+ if (Z(t)) {
616
+ const o = t, r = o.props.onClick;
617
+ return j(o, {
618
+ onClick: Ce(r, () => {
374
619
  n.setOpen(!1);
375
620
  })
376
621
  });
377
622
  }
378
- return /* @__PURE__ */ h(ht, { variant: "ghost", onClick: () => n.setOpen(!1), children: t });
623
+ return /* @__PURE__ */ c(ye, { variant: "ghost", onClick: () => n.setOpen(!1), children: e });
379
624
  }
380
- const It = D(function({ className: t, ...n }, o) {
381
- return /* @__PURE__ */ h(
625
+ const Pe = P(function({ className: e, ...n }, o) {
626
+ return /* @__PURE__ */ c(
382
627
  "header",
383
628
  {
384
629
  ...n,
385
630
  ref: o,
386
- className: v("uk-dialog__header", t)
631
+ className: k("uk-dialog__header", e)
387
632
  }
388
633
  );
389
- }), kt = D(function({ className: t, children: n, ...o }, r) {
390
- const a = G("Dialog.Title"), s = a.setHasTitle;
391
- return S(() => (s(!0), () => s(!1)), [s]), /* @__PURE__ */ h(
634
+ }), De = P(function({ className: e, children: n, ...o }, r) {
635
+ const s = W("Dialog.Title"), a = s.setHasTitle;
636
+ return O(() => (a(!0), () => a(!1)), [a]), /* @__PURE__ */ c(
392
637
  "h2",
393
638
  {
394
639
  ...o,
395
640
  ref: r,
396
- id: a.titleId,
397
- className: v("uk-dialog__title", t),
641
+ id: s.titleId,
642
+ className: k("uk-dialog__title", e),
398
643
  children: n
399
644
  }
400
645
  );
401
- }), Dt = D(
402
- function({ className: t, ...n }, o) {
403
- const r = G("Dialog.Description"), a = r.setHasDescription;
404
- return S(() => (a(!0), () => a(!1)), [a]), /* @__PURE__ */ h(
646
+ }), Re = P(
647
+ function({ className: e, ...n }, o) {
648
+ const r = W("Dialog.Description"), s = r.setHasDescription;
649
+ return O(() => (s(!0), () => s(!1)), [s]), /* @__PURE__ */ c(
405
650
  "p",
406
651
  {
407
652
  ...n,
408
653
  ref: o,
409
654
  id: r.descriptionId,
410
- className: v("uk-dialog__description", t)
655
+ className: k("uk-dialog__description", e)
411
656
  }
412
657
  );
413
658
  }
414
- ), Et = D(function({ className: t, ...n }, o) {
415
- return /* @__PURE__ */ h("div", { ...n, ref: o, className: v("uk-dialog__body", t) });
416
- }), _t = D(function({ className: t, ...n }, o) {
417
- return /* @__PURE__ */ h(
659
+ ), Le = P(function({ className: e, ...n }, o) {
660
+ return /* @__PURE__ */ c("div", { ...n, ref: o, className: k("uk-dialog__body", e) });
661
+ }), Se = P(function({ className: e, ...n }, o) {
662
+ return /* @__PURE__ */ c(
418
663
  "footer",
419
664
  {
420
665
  ...n,
421
666
  ref: o,
422
- className: v("uk-dialog__footer", t)
667
+ className: k("uk-dialog__footer", e)
423
668
  }
424
669
  );
425
670
  });
426
- function ne({
427
- requestClose: e,
428
- contentId: t,
671
+ function pt({
672
+ requestClose: t,
673
+ contentId: e,
429
674
  titleId: n,
430
675
  descriptionId: o,
431
676
  hasTitle: r,
432
- hasDescription: a,
433
- children: s,
434
- closeOnBackdropClick: l = !0,
677
+ hasDescription: s,
678
+ children: a,
679
+ closeOnBackdropClick: p = !0,
435
680
  closeOnEscape: d = !0,
436
681
  initialFocusRef: i,
437
682
  returnFocusRef: m,
438
- className: b,
439
- "aria-label": u,
440
- "aria-labelledby": f,
441
- "aria-describedby": p
683
+ className: h,
684
+ "aria-label": f,
685
+ "aria-labelledby": b,
686
+ "aria-describedby": u
442
687
  }) {
443
- const g = _(null), y = _(null), T = it(), C = K() ?? !1;
444
- return Gt(!0), nt(() => {
445
- const c = g.current;
446
- c && (y.current ?? (y.current = document.activeElement instanceof HTMLElement ? document.activeElement : null), !c.open && (typeof c.showModal == "function" ? c.showModal() : c.setAttribute("open", "")));
447
- }, []), qt({
688
+ const g = N(null), y = N(null), v = ae(), T = V() ?? !1;
689
+ return We(!0), re(() => {
690
+ const l = g.current;
691
+ l && (y.current ?? (y.current = document.activeElement instanceof HTMLElement ? document.activeElement : null), !l.open && (typeof l.showModal == "function" ? l.showModal() : l.setAttribute("open", "")));
692
+ }, []), Je({
448
693
  active: !0,
449
694
  containerRef: g,
450
695
  initialFocusRef: i,
451
696
  returnFocusRef: m ?? y
452
- }), S(() => {
453
- const c = g.current;
454
- if (!c)
697
+ }), O(() => {
698
+ const l = g.current;
699
+ if (!l)
455
700
  return;
456
- const w = () => {
457
- c.open || (typeof c.showModal == "function" ? c.showModal() : c.setAttribute("open", ""));
458
- }, I = () => {
701
+ const I = () => {
702
+ l.open || (typeof l.showModal == "function" ? l.showModal() : l.setAttribute("open", ""));
703
+ }, w = () => {
459
704
  if (!d) {
460
- w();
705
+ I();
461
706
  return;
462
707
  }
463
- e();
464
- }, k = (x) => {
465
- x.preventDefault(), d && e();
466
- }, L = (x) => {
708
+ t();
709
+ }, _ = (x) => {
710
+ x.preventDefault(), d && t();
711
+ }, $ = (x) => {
467
712
  d || x.key !== "Escape" || x.defaultPrevented || (x.preventDefault(), x.stopPropagation());
468
- }, R = (x) => {
469
- l && x.target === c && e();
713
+ }, L = (x) => {
714
+ p && x.target === l && t();
470
715
  };
471
- return c.addEventListener("close", I), c.addEventListener("cancel", k), c.addEventListener("keydown", L, !0), c.addEventListener("click", R), () => {
472
- c.removeEventListener("close", I), c.removeEventListener("cancel", k), c.removeEventListener("keydown", L, !0), c.removeEventListener("click", R);
716
+ return l.addEventListener("close", w), l.addEventListener("cancel", _), l.addEventListener("keydown", $, !0), l.addEventListener("click", L), () => {
717
+ l.removeEventListener("close", w), l.removeEventListener("cancel", _), l.removeEventListener("keydown", $, !0), l.removeEventListener("click", L);
473
718
  };
474
- }, [l, d, e]), /* @__PURE__ */ h(
719
+ }, [p, d, t]), /* @__PURE__ */ c(
475
720
  "dialog",
476
721
  {
477
722
  ref: g,
478
- id: t,
479
- className: v("uk-dialog", b),
480
- closedby: d || l ? "any" : "none",
481
- "data-state": T ? "open" : "closed",
482
- inert: !T,
483
- "aria-label": u,
484
- "aria-labelledby": f ?? (u ? void 0 : r ? n : void 0),
485
- "aria-describedby": p ?? (a ? o : void 0),
486
- children: /* @__PURE__ */ h(
487
- V.div,
723
+ id: e,
724
+ className: k("uk-dialog", h),
725
+ closedby: d || p ? "any" : "none",
726
+ "data-state": v ? "open" : "closed",
727
+ inert: !v,
728
+ "aria-label": f,
729
+ "aria-labelledby": b ?? (f ? void 0 : r ? n : void 0),
730
+ "aria-describedby": u ?? (s ? o : void 0),
731
+ children: /* @__PURE__ */ c(
732
+ E.div,
488
733
  {
489
734
  className: "uk-dialog__panel",
490
- initial: C ? { opacity: 0 } : {
735
+ initial: T ? { opacity: 0 } : {
491
736
  opacity: 0,
492
737
  transform: "translateY(12px) scale(0.96)"
493
738
  },
494
739
  animate: {
495
740
  opacity: 1,
496
741
  transform: "translateY(0px) scale(1)",
497
- transition: C ? H : { ...ft, delay: 0.06 }
742
+ transition: T ? K : { ...me, delay: 0.06 }
498
743
  },
499
- exit: C ? { opacity: 0, transition: H } : {
744
+ exit: T ? { opacity: 0, transition: K } : {
500
745
  opacity: 0,
501
746
  transform: "translateY(8px) scale(0.97)",
502
- transition: ft
747
+ transition: me
503
748
  },
504
- children: s
749
+ children: a
505
750
  }
506
751
  )
507
752
  }
508
753
  );
509
754
  }
510
- function Rt({
511
- children: e,
512
- closeOnBackdropClick: t = !0,
755
+ function Me({
756
+ children: t,
757
+ closeOnBackdropClick: e = !0,
513
758
  closeOnEscape: n = !0,
514
759
  initialFocusRef: o,
515
760
  returnFocusRef: r,
516
- className: a,
517
- "aria-label": s,
518
- "aria-labelledby": l,
761
+ className: s,
762
+ "aria-label": a,
763
+ "aria-labelledby": p,
519
764
  "aria-describedby": d
520
765
  }) {
521
- const i = G("Dialog.Content"), m = P(() => {
766
+ const i = W("Dialog.Content"), m = S(() => {
522
767
  i.setOpen(!1);
523
768
  });
524
- return et(
525
- Wt,
526
- Zt,
527
- te
528
- ) ? st(
529
- /* @__PURE__ */ h(ot, { reducedMotion: "user", children: /* @__PURE__ */ h(rt, { children: i.open ? /* @__PURE__ */ h(
530
- ne,
769
+ return oe(
770
+ ct,
771
+ lt,
772
+ ut
773
+ ) ? se(
774
+ /* @__PURE__ */ c(ie, { reducedMotion: "user", children: /* @__PURE__ */ c(A, { children: i.open ? /* @__PURE__ */ c(
775
+ pt,
531
776
  {
532
777
  requestClose: m,
533
778
  contentId: i.contentId,
@@ -535,68 +780,68 @@ function Rt({
535
780
  descriptionId: i.descriptionId,
536
781
  hasTitle: i.hasTitle,
537
782
  hasDescription: i.hasDescription,
538
- closeOnBackdropClick: t,
783
+ closeOnBackdropClick: e,
539
784
  closeOnEscape: n,
540
785
  initialFocusRef: o,
541
786
  returnFocusRef: r,
542
- className: a,
543
- "aria-label": s,
544
- "aria-labelledby": l,
787
+ className: s,
788
+ "aria-label": a,
789
+ "aria-labelledby": p,
545
790
  "aria-describedby": d,
546
- children: e
791
+ children: t
547
792
  },
548
793
  "uk-dialog"
549
794
  ) : null }) }),
550
795
  document.body
551
796
  ) : null;
552
797
  }
553
- function oe({
554
- open: e,
555
- onOpenChange: t,
798
+ function ft({
799
+ open: t,
800
+ onOpenChange: e,
556
801
  title: n,
557
802
  description: o,
558
803
  footer: r,
559
- children: a,
560
- closeLabel: s = "Close",
561
- showCloseButton: l = !0,
804
+ children: s,
805
+ closeLabel: a = "Close",
806
+ showCloseButton: p = !0,
562
807
  closeOnBackdropClick: d = !0,
563
808
  closeOnEscape: i = !0,
564
809
  initialFocusRef: m,
565
- returnFocusRef: b,
566
- className: u,
567
- "aria-label": f
810
+ returnFocusRef: h,
811
+ className: f,
812
+ "aria-label": b
568
813
  }) {
569
- return /* @__PURE__ */ h(vt, { open: e, onOpenChange: t, children: /* @__PURE__ */ N(
570
- Rt,
814
+ return /* @__PURE__ */ c(Ee, { open: t, onOpenChange: e, children: /* @__PURE__ */ C(
815
+ Me,
571
816
  {
572
- className: u,
817
+ className: f,
573
818
  closeOnBackdropClick: d,
574
819
  closeOnEscape: i,
575
820
  initialFocusRef: m,
576
- returnFocusRef: b,
577
- "aria-label": f,
821
+ returnFocusRef: h,
822
+ "aria-label": b,
578
823
  children: [
579
- n || o || l ? /* @__PURE__ */ N(It, { children: [
580
- /* @__PURE__ */ N("div", { className: "uk-dialog__heading", children: [
581
- n ? /* @__PURE__ */ h(kt, { children: n }) : null,
582
- o ? /* @__PURE__ */ h(Dt, { children: o }) : null
824
+ n || o || p ? /* @__PURE__ */ C(Pe, { children: [
825
+ /* @__PURE__ */ C("div", { className: "uk-dialog__heading", children: [
826
+ n ? /* @__PURE__ */ c(De, { children: n }) : null,
827
+ o ? /* @__PURE__ */ c(Re, { children: o }) : null
583
828
  ] }),
584
- l ? /* @__PURE__ */ h(xt, { children: /* @__PURE__ */ h(
585
- ht,
829
+ p ? /* @__PURE__ */ c(Ne, { children: /* @__PURE__ */ c(
830
+ ye,
586
831
  {
587
832
  variant: "ghost",
588
833
  size: "sm",
589
834
  iconOnly: !0,
590
- "aria-label": s,
835
+ "aria-label": a,
591
836
  className: "uk-dialog__close",
592
- children: /* @__PURE__ */ h(
837
+ children: /* @__PURE__ */ c(
593
838
  "svg",
594
839
  {
595
840
  viewBox: "0 0 20 20",
596
841
  width: "16",
597
842
  height: "16",
598
843
  "aria-hidden": "true",
599
- children: /* @__PURE__ */ h(
844
+ children: /* @__PURE__ */ c(
600
845
  "path",
601
846
  {
602
847
  d: "M5 5l10 10M15 5L5 15",
@@ -610,140 +855,140 @@ function oe({
610
855
  }
611
856
  ) }) : null
612
857
  ] }) : null,
613
- /* @__PURE__ */ h(Et, { children: a }),
614
- r ? /* @__PURE__ */ h(_t, { children: r }) : null
858
+ /* @__PURE__ */ c(Le, { children: s }),
859
+ r ? /* @__PURE__ */ c(Se, { children: r }) : null
615
860
  ]
616
861
  }
617
862
  ) });
618
863
  }
619
- const ve = Object.assign(oe, {
620
- Root: vt,
621
- Trigger: ee,
622
- Content: Rt,
623
- Header: It,
624
- Title: kt,
625
- Description: Dt,
626
- Body: Et,
627
- Footer: _t,
628
- Close: xt
629
- }), Pt = j(null), Nt = () => () => {
630
- }, Lt = () => !0, Mt = () => !1;
631
- function Ot(e) {
632
- const t = Y(Pt);
633
- if (!t)
634
- throw new Error(`<${e}> must be rendered inside <Tooltip.Root>`);
635
- return t;
864
+ const St = Object.assign(ft, {
865
+ Root: Ee,
866
+ Trigger: dt,
867
+ Content: Me,
868
+ Header: Pe,
869
+ Title: De,
870
+ Description: Re,
871
+ Body: Le,
872
+ Footer: Se,
873
+ Close: Ne
874
+ }), Oe = q(null), $e = () => () => {
875
+ }, Be = () => !0, Ae = () => !1;
876
+ function He(t) {
877
+ const e = X(Oe);
878
+ if (!e)
879
+ throw new Error(`<${t}> must be rendered inside <Tooltip.Root>`);
880
+ return e;
636
881
  }
637
- function St(e, t) {
638
- typeof e == "function" ? e(t) : e && (e.current = t);
882
+ function Ve(t, e) {
883
+ typeof t == "function" ? t(e) : t && (t.current = e);
639
884
  }
640
- function $t(e, t) {
641
- const n = typeof e == "string" ? e.split(/\s+/).filter(Boolean) : [];
642
- return Array.from(/* @__PURE__ */ new Set([...n, t])).join(" ");
885
+ function Fe(t, e) {
886
+ const n = typeof t == "string" ? t.split(/\s+/).filter(Boolean) : [];
887
+ return Array.from(/* @__PURE__ */ new Set([...n, e])).join(" ");
643
888
  }
644
- function E(e, t) {
889
+ function D(t, e) {
645
890
  return (n) => {
646
- e?.(n), n.defaultPrevented || t(n);
891
+ t?.(n), n.defaultPrevented || e(n);
647
892
  };
648
893
  }
649
- function re({
650
- children: e,
651
- open: t,
894
+ function ht({
895
+ children: t,
896
+ open: e,
652
897
  defaultOpen: n,
653
898
  onOpenChange: o,
654
899
  delayDuration: r = 300,
655
- closeDelay: a = 80
900
+ closeDelay: s = 80
656
901
  }) {
657
- const s = z(), [l, d] = O(
902
+ const a = R(), [p, d] = M(
658
903
  null
659
- ), i = _(null), m = _(null), [b, u] = Q({
660
- value: t,
904
+ ), i = N(null), m = N(null), [h, f] = Y({
905
+ value: e,
661
906
  defaultValue: n ?? !1,
662
907
  onChange: o
663
- }), f = B(() => {
908
+ }), b = G(() => {
664
909
  i.current !== null && (clearTimeout(i.current), i.current = null);
665
- }, []), p = B(() => {
910
+ }, []), u = G(() => {
666
911
  m.current !== null && (clearTimeout(m.current), m.current = null);
667
- }, []), g = P((c = !1) => {
668
- if (f(), p(), !b) {
669
- if (c || r <= 0) {
670
- u(!0);
912
+ }, []), g = S((l = !1) => {
913
+ if (b(), u(), !h) {
914
+ if (l || r <= 0) {
915
+ f(!0);
671
916
  return;
672
917
  }
673
918
  i.current = setTimeout(() => {
674
- i.current = null, u(!0);
919
+ i.current = null, f(!0);
675
920
  }, r);
676
921
  }
677
- }), y = P(() => {
678
- if (f(), p(), !!b) {
679
- if (a <= 0) {
680
- u(!1);
922
+ }), y = S(() => {
923
+ if (b(), u(), !!h) {
924
+ if (s <= 0) {
925
+ f(!1);
681
926
  return;
682
927
  }
683
928
  m.current = setTimeout(() => {
684
- m.current = null, u(!1);
685
- }, a);
929
+ m.current = null, f(!1);
930
+ }, s);
686
931
  }
687
- }), T = P(() => {
688
- f(), p(), u(!1);
932
+ }), v = S(() => {
933
+ b(), u(), f(!1);
689
934
  });
690
- S(() => {
691
- b ? p() : f();
692
- }, [p, f, b]), S(
935
+ O(() => {
936
+ h ? u() : b();
937
+ }, [u, b, h]), O(
693
938
  () => () => {
694
- f(), p();
939
+ b(), u();
695
940
  },
696
- [p, f]
941
+ [u, b]
697
942
  );
698
- const C = X(
943
+ const T = U(
699
944
  () => ({
700
- open: b,
701
- triggerElement: l,
945
+ open: h,
946
+ triggerElement: p,
702
947
  setTriggerElement: d,
703
- contentId: s,
948
+ contentId: a,
704
949
  requestOpen: g,
705
950
  requestClose: y,
706
- dismiss: T
951
+ dismiss: v
707
952
  }),
708
- [s, b, T, y, g, l]
953
+ [a, h, v, y, g, p]
709
954
  );
710
- return /* @__PURE__ */ h(Pt.Provider, { value: C, children: e });
955
+ return /* @__PURE__ */ c(Oe.Provider, { value: T, children: t });
711
956
  }
712
- function ie({ children: e }) {
713
- const t = Ot("Tooltip.Trigger"), { setTriggerElement: n } = t;
714
- if (!tt(e))
957
+ function mt({ children: t }) {
958
+ const e = He("Tooltip.Trigger"), { setTriggerElement: n } = e;
959
+ if (!Z(t))
715
960
  throw new Error("<Tooltip.Trigger> expects a single valid React element");
716
- const o = e, r = o.props, a = r.ref ?? o.ref, s = r.onPointerEnter, l = r.onPointerLeave, d = r.onFocus, i = r.onBlur, m = r.onKeyDown, b = B(
717
- (u) => {
718
- St(a, u), n(u);
961
+ const o = t, r = o.props, s = r.ref ?? o.ref, a = r.onPointerEnter, p = r.onPointerLeave, d = r.onFocus, i = r.onBlur, m = r.onKeyDown, h = G(
962
+ (f) => {
963
+ Ve(s, f), n(f);
719
964
  },
720
- [a, n]
965
+ [s, n]
721
966
  );
722
- return J(o, {
723
- ref: b,
724
- "aria-describedby": t.open ? $t(r["aria-describedby"], t.contentId) : r["aria-describedby"],
725
- onPointerEnter: E(s, (u) => {
726
- t.requestOpen(u.pointerType === "touch");
967
+ return j(o, {
968
+ ref: h,
969
+ "aria-describedby": e.open ? Fe(r["aria-describedby"], e.contentId) : r["aria-describedby"],
970
+ onPointerEnter: D(a, (f) => {
971
+ e.requestOpen(f.pointerType === "touch");
727
972
  }),
728
- onPointerLeave: E(l, (u) => {
729
- u.pointerType !== "touch" && t.requestClose();
973
+ onPointerLeave: D(p, (f) => {
974
+ f.pointerType !== "touch" && e.requestClose();
730
975
  }),
731
- onFocus: E(d, () => {
732
- t.requestOpen();
976
+ onFocus: D(d, () => {
977
+ e.requestOpen();
733
978
  }),
734
- onBlur: E(i, () => {
735
- t.requestClose();
979
+ onBlur: D(i, () => {
980
+ e.requestClose();
736
981
  }),
737
- onKeyDown: E(m, (u) => {
738
- u.key === "Escape" && t.open && (u.preventDefault(), u.stopPropagation(), t.dismiss());
982
+ onKeyDown: D(m, (f) => {
983
+ f.key === "Escape" && e.open && (f.preventDefault(), f.stopPropagation(), e.dismiss());
739
984
  })
740
985
  });
741
986
  }
742
- function q(e, t, n) {
743
- return n < t ? t : Math.min(Math.max(e, t), n);
987
+ function J(t, e, n) {
988
+ return n < e ? e : Math.min(Math.max(t, e), n);
744
989
  }
745
- function se(e) {
746
- switch (e) {
990
+ function bt(t) {
991
+ switch (t) {
747
992
  case "top":
748
993
  return "bottom";
749
994
  case "right":
@@ -754,164 +999,164 @@ function se(e) {
754
999
  return "right";
755
1000
  }
756
1001
  }
757
- function Z(e, t, n, o, r) {
758
- switch (t) {
1002
+ function ne(t, e, n, o, r) {
1003
+ switch (e) {
759
1004
  case "top":
760
- return e.top - r;
1005
+ return t.top - r;
761
1006
  case "right":
762
- return n - e.right - r;
1007
+ return n - t.right - r;
763
1008
  case "bottom":
764
- return o - e.bottom - r;
1009
+ return o - t.bottom - r;
765
1010
  case "left":
766
- return e.left - r;
1011
+ return t.left - r;
767
1012
  }
768
1013
  }
769
- function mt(e, t, n, o, r, a, s) {
770
- return Z(
771
- e,
1014
+ function be(t, e, n, o, r, s, a) {
1015
+ return ne(
1016
+ t,
772
1017
  n,
773
1018
  r,
774
- a,
775
- s
776
- ) >= (n === "top" || n === "bottom" ? t.height : t.width) + o;
1019
+ s,
1020
+ a
1021
+ ) >= (n === "top" || n === "bottom" ? e.height : e.width) + o;
777
1022
  }
778
- function ae({
779
- trigger: e,
780
- tooltip: t,
1023
+ function gt({
1024
+ trigger: t,
1025
+ tooltip: e,
781
1026
  side: n,
782
1027
  align: o,
783
1028
  sideOffset: r,
784
- collisionPadding: a,
785
- avoidCollisions: s,
786
- viewportWidth: l,
1029
+ collisionPadding: s,
1030
+ avoidCollisions: a,
1031
+ viewportWidth: p,
787
1032
  viewportHeight: d
788
1033
  }) {
789
1034
  let i = n;
790
- if (s && !mt(
791
- e,
1035
+ if (a && !be(
792
1036
  t,
1037
+ e,
793
1038
  n,
794
1039
  r,
795
- l,
1040
+ p,
796
1041
  d,
797
- a
1042
+ s
798
1043
  )) {
799
- const y = se(n), T = mt(
800
- e,
1044
+ const y = bt(n), v = be(
801
1045
  t,
1046
+ e,
802
1047
  y,
803
1048
  r,
804
- l,
1049
+ p,
805
1050
  d,
806
- a
807
- ), C = Z(
808
- e,
1051
+ s
1052
+ ), T = ne(
1053
+ t,
809
1054
  n,
810
- l,
1055
+ p,
811
1056
  d,
812
- a
813
- ), c = Z(
814
- e,
1057
+ s
1058
+ ), l = ne(
1059
+ t,
815
1060
  y,
816
- l,
1061
+ p,
817
1062
  d,
818
- a
1063
+ s
819
1064
  );
820
- (T || c > C) && (i = y);
1065
+ (v || l > T) && (i = y);
821
1066
  }
822
- const m = e.left + e.width / 2, b = e.top + e.height / 2;
823
- let u = 0, f = 0;
1067
+ const m = t.left + t.width / 2, h = t.top + t.height / 2;
1068
+ let f = 0, b = 0;
824
1069
  switch (i) {
825
1070
  case "top":
826
1071
  case "bottom":
827
- u = o === "start" ? e.left : o === "end" ? e.right - t.width : m - t.width / 2, f = i === "top" ? e.top - t.height - r : e.bottom + r;
1072
+ f = o === "start" ? t.left : o === "end" ? t.right - e.width : m - e.width / 2, b = i === "top" ? t.top - e.height - r : t.bottom + r;
828
1073
  break;
829
1074
  case "left":
830
1075
  case "right":
831
- u = i === "left" ? e.left - t.width - r : e.right + r, f = o === "start" ? e.top : o === "end" ? e.bottom - t.height : b - t.height / 2;
1076
+ f = i === "left" ? t.left - e.width - r : t.right + r, b = o === "start" ? t.top : o === "end" ? t.bottom - e.height : h - e.height / 2;
832
1077
  break;
833
1078
  }
834
- s && (u = q(
835
- u,
836
- a,
837
- l - t.width - a
838
- ), f = q(
1079
+ a && (f = J(
839
1080
  f,
840
- a,
841
- d - t.height - a
1081
+ s,
1082
+ p - e.width - s
1083
+ ), b = J(
1084
+ b,
1085
+ s,
1086
+ d - e.height - s
842
1087
  ));
843
- const p = 10, g = i === "top" || i === "bottom" ? q(
844
- m - u,
845
- p,
846
- Math.max(p, t.width - p)
847
- ) : q(
848
- b - f,
849
- p,
850
- Math.max(p, t.height - p)
1088
+ const u = 10, g = i === "top" || i === "bottom" ? J(
1089
+ m - f,
1090
+ u,
1091
+ Math.max(u, e.width - u)
1092
+ ) : J(
1093
+ h - b,
1094
+ u,
1095
+ Math.max(u, e.height - u)
851
1096
  );
852
- return { x: u, y: f, side: i, arrowOffset: g };
1097
+ return { x: f, y: b, side: i, arrowOffset: g };
853
1098
  }
854
- function At(e, t, {
1099
+ function Ge(t, e, {
855
1100
  side: n,
856
1101
  align: o,
857
1102
  sideOffset: r,
858
- collisionPadding: a,
859
- avoidCollisions: s
1103
+ collisionPadding: s,
1104
+ avoidCollisions: a
860
1105
  }) {
861
- const [l, d] = O(null);
862
- return nt(() => {
863
- const i = t.current;
864
- if (!i || !e)
1106
+ const [p, d] = M(null);
1107
+ return re(() => {
1108
+ const i = e.current;
1109
+ if (!i || !t)
865
1110
  return;
866
1111
  const m = () => {
867
- const u = e.getBoundingClientRect(), f = i.getBoundingClientRect();
1112
+ const f = t.getBoundingClientRect(), b = i.getBoundingClientRect();
868
1113
  d(
869
- ae({
870
- trigger: u,
871
- tooltip: f,
1114
+ gt({
1115
+ trigger: f,
1116
+ tooltip: b,
872
1117
  side: n,
873
1118
  align: o,
874
1119
  sideOffset: r,
875
- collisionPadding: a,
876
- avoidCollisions: s,
1120
+ collisionPadding: s,
1121
+ avoidCollisions: a,
877
1122
  viewportWidth: window.innerWidth || document.documentElement.clientWidth,
878
1123
  viewportHeight: window.innerHeight || document.documentElement.clientHeight
879
1124
  })
880
1125
  );
881
1126
  };
882
1127
  m(), window.addEventListener("resize", m), window.addEventListener("scroll", m, !0);
883
- const b = typeof ResizeObserver > "u" ? null : new ResizeObserver(m);
884
- return b?.observe(e), b?.observe(i), () => {
885
- window.removeEventListener("resize", m), window.removeEventListener("scroll", m, !0), b?.disconnect();
1128
+ const h = typeof ResizeObserver > "u" ? null : new ResizeObserver(m);
1129
+ return h?.observe(t), h?.observe(i), () => {
1130
+ window.removeEventListener("resize", m), window.removeEventListener("scroll", m, !0), h?.disconnect();
886
1131
  };
887
1132
  }, [
888
1133
  o,
889
- s,
890
1134
  a,
891
- t,
1135
+ s,
1136
+ e,
892
1137
  n,
893
1138
  r,
894
- e
895
- ]), l;
1139
+ t
1140
+ ]), p;
896
1141
  }
897
- function Bt(e, t, n) {
898
- S(() => {
899
- const o = (s) => {
900
- const l = s.target;
901
- l instanceof Node && (e.contains(l) || t.current?.contains(l) || n());
1142
+ function ze(t, e, n) {
1143
+ O(() => {
1144
+ const o = (a) => {
1145
+ const p = a.target;
1146
+ p instanceof Node && (t.contains(p) || e.current?.contains(p) || n());
902
1147
  }, r = () => {
903
1148
  document.visibilityState === "hidden" && n();
904
- }, a = (s) => {
905
- const l = s.target;
906
- s.key !== "Escape" || l instanceof Node && e.contains(l) || n();
1149
+ }, s = (a) => {
1150
+ const p = a.target;
1151
+ a.key !== "Escape" || p instanceof Node && t.contains(p) || n();
907
1152
  };
908
- return document.addEventListener("pointerdown", o, !0), document.addEventListener("visibilitychange", r), document.addEventListener("keydown", a, !0), window.addEventListener("blur", n), () => {
909
- document.removeEventListener("pointerdown", o, !0), document.removeEventListener("visibilitychange", r), document.removeEventListener("keydown", a, !0), window.removeEventListener("blur", n);
1153
+ return document.addEventListener("pointerdown", o, !0), document.addEventListener("visibilitychange", r), document.addEventListener("keydown", s, !0), window.addEventListener("blur", n), () => {
1154
+ document.removeEventListener("pointerdown", o, !0), document.removeEventListener("visibilitychange", r), document.removeEventListener("keydown", s, !0), window.removeEventListener("blur", n);
910
1155
  };
911
- }, [n, t, e]);
1156
+ }, [n, e, t]);
912
1157
  }
913
- function Vt(e) {
914
- switch (e) {
1158
+ function Ke(t) {
1159
+ switch (t) {
915
1160
  case "top":
916
1161
  return "center bottom";
917
1162
  case "bottom":
@@ -924,58 +1169,58 @@ function Vt(e) {
924
1169
  return "center";
925
1170
  }
926
1171
  }
927
- function ce({
928
- contentId: e,
929
- triggerElement: t,
1172
+ function yt({
1173
+ contentId: t,
1174
+ triggerElement: e,
930
1175
  dismiss: n,
931
1176
  children: o,
932
1177
  className: r,
933
- style: a,
934
- side: s = "top",
935
- align: l = "center",
1178
+ style: s,
1179
+ side: a = "top",
1180
+ align: p = "center",
936
1181
  sideOffset: d = 8,
937
1182
  collisionPadding: i = 8,
938
1183
  avoidCollisions: m = !0,
939
- ...b
1184
+ ...h
940
1185
  }) {
941
- const u = _(null), f = K() ?? !1, p = it(), g = At(t, u, {
942
- side: s,
943
- align: l,
1186
+ const f = N(null), b = V() ?? !1, u = ae(), g = Ge(e, f, {
1187
+ side: a,
1188
+ align: p,
944
1189
  sideOffset: d,
945
1190
  collisionPadding: i,
946
1191
  avoidCollisions: m
947
1192
  });
948
- Bt(t, u, n);
949
- const y = Vt(g?.side ?? s), T = {
950
- ...a,
1193
+ ze(e, f, n);
1194
+ const y = Ke(g?.side ?? a), v = {
1195
+ ...s,
951
1196
  left: g ? `${g.x}px` : 0,
952
1197
  top: g ? `${g.y}px` : 0,
953
1198
  visibility: g ? "visible" : "hidden"
954
1199
  };
955
- return /* @__PURE__ */ h(
1200
+ return /* @__PURE__ */ c(
956
1201
  "div",
957
1202
  {
958
- ...b,
959
- ref: u,
960
- id: e,
1203
+ ...h,
1204
+ ref: f,
1205
+ id: t,
961
1206
  role: "tooltip",
962
- "data-side": g?.side ?? s,
963
- "data-align": l,
964
- "data-state": p ? "open" : "closed",
965
- "aria-hidden": p ? void 0 : !0,
966
- className: v("uk-tooltip", r),
967
- style: T,
968
- children: /* @__PURE__ */ N(
969
- V.div,
1207
+ "data-side": g?.side ?? a,
1208
+ "data-align": p,
1209
+ "data-state": u ? "open" : "closed",
1210
+ "aria-hidden": u ? void 0 : !0,
1211
+ className: k("uk-tooltip", r),
1212
+ style: v,
1213
+ children: /* @__PURE__ */ C(
1214
+ E.div,
970
1215
  {
971
1216
  className: "uk-tooltip__surface",
972
1217
  style: { transformOrigin: y },
973
- initial: f ? { opacity: 0 } : { opacity: 0, scale: 0.96 },
1218
+ initial: b ? { opacity: 0 } : { opacity: 0, scale: 0.96 },
974
1219
  animate: { opacity: 1, scale: 1 },
975
- exit: f ? { opacity: 0 } : { opacity: 0, scale: 0.96 },
976
- transition: f ? H : bt,
1220
+ exit: b ? { opacity: 0 } : { opacity: 0, scale: 0.96 },
1221
+ transition: b ? K : ve,
977
1222
  children: [
978
- /* @__PURE__ */ h(
1223
+ /* @__PURE__ */ c(
979
1224
  "span",
980
1225
  {
981
1226
  className: "uk-tooltip__arrow",
@@ -992,276 +1237,277 @@ function ce({
992
1237
  }
993
1238
  );
994
1239
  }
995
- function le(e) {
996
- const t = Ot("Tooltip.Content"), o = et(
997
- Nt,
998
- Lt,
999
- Mt
1000
- ) && t.triggerElement ? t.triggerElement.closest("dialog") ?? document.body : null;
1001
- return !o || !t.triggerElement ? null : st(
1002
- /* @__PURE__ */ h(ot, { reducedMotion: "user", children: /* @__PURE__ */ h(rt, { children: t.open ? /* @__PURE__ */ h(
1003
- ce,
1240
+ function vt(t) {
1241
+ const e = He("Tooltip.Content"), o = oe(
1242
+ $e,
1243
+ Be,
1244
+ Ae
1245
+ ) && e.triggerElement ? e.triggerElement.closest("dialog") ?? document.body : null;
1246
+ return !o || !e.triggerElement ? null : se(
1247
+ /* @__PURE__ */ c(ie, { reducedMotion: "user", children: /* @__PURE__ */ c(A, { children: e.open ? /* @__PURE__ */ c(
1248
+ yt,
1004
1249
  {
1005
- contentId: t.contentId,
1006
- triggerElement: t.triggerElement,
1007
- dismiss: t.dismiss,
1008
- ...e
1250
+ contentId: e.contentId,
1251
+ triggerElement: e.triggerElement,
1252
+ dismiss: e.dismiss,
1253
+ ...t
1009
1254
  },
1010
1255
  "uk-tooltip"
1011
1256
  ) : null }) }),
1012
1257
  o
1013
1258
  );
1014
1259
  }
1015
- const Ft = j(
1260
+ const Ue = q(
1016
1261
  null
1017
1262
  );
1018
- function ue(e) {
1019
- const t = Y(Ft);
1020
- if (!t)
1021
- throw new Error(`<${e}> must be rendered inside <Tooltip.Group>`);
1022
- return t;
1263
+ function It(t) {
1264
+ const e = X(Ue);
1265
+ if (!e)
1266
+ throw new Error(`<${t}> must be rendered inside <Tooltip.Group>`);
1267
+ return e;
1023
1268
  }
1024
- function de({
1025
- activeValue: e,
1026
- content: t,
1269
+ function Tt({
1270
+ activeValue: t,
1271
+ content: e,
1027
1272
  contentClassName: n,
1028
1273
  contentId: o,
1029
1274
  dismiss: r,
1030
- triggerElement: a,
1031
- side: s,
1032
- align: l,
1275
+ triggerElement: s,
1276
+ side: a,
1277
+ align: p,
1033
1278
  sideOffset: d,
1034
1279
  collisionPadding: i,
1035
1280
  avoidCollisions: m
1036
1281
  }) {
1037
- const b = _(null), u = K() ?? !1, f = it(), p = At(a, b, {
1038
- side: s,
1039
- align: l,
1282
+ const h = N(null), f = V() ?? !1, b = ae(), u = Ge(s, h, {
1283
+ side: a,
1284
+ align: p,
1040
1285
  sideOffset: d,
1041
1286
  collisionPadding: i,
1042
1287
  avoidCollisions: m
1043
1288
  });
1044
- Bt(a, b, r);
1289
+ ze(s, h, r);
1045
1290
  const g = {
1046
- left: p ? `${p.x}px` : 0,
1047
- top: p ? `${p.y}px` : 0,
1048
- transformOrigin: Vt(p?.side ?? s),
1049
- visibility: p ? "visible" : "hidden"
1291
+ left: u ? `${u.x}px` : 0,
1292
+ top: u ? `${u.y}px` : 0,
1293
+ transformOrigin: Ke(u?.side ?? a),
1294
+ visibility: u ? "visible" : "hidden"
1050
1295
  };
1051
- return /* @__PURE__ */ N(
1052
- V.div,
1296
+ return /* @__PURE__ */ C(
1297
+ E.div,
1053
1298
  {
1054
- ref: b,
1299
+ ref: h,
1055
1300
  id: o,
1056
1301
  role: "tooltip",
1057
- layout: !u,
1058
- layoutDependency: e,
1059
- "data-side": p?.side ?? s,
1060
- "data-align": l,
1061
- "data-state": f ? "open" : "closed",
1062
- "aria-hidden": f ? void 0 : !0,
1063
- className: v(
1302
+ layout: !f,
1303
+ layoutDependency: t,
1304
+ "data-side": u?.side ?? a,
1305
+ "data-align": p,
1306
+ "data-state": b ? "open" : "closed",
1307
+ "aria-hidden": b ? void 0 : !0,
1308
+ className: k(
1064
1309
  "uk-tooltip",
1065
1310
  "uk-tooltip__surface",
1066
1311
  "uk-tooltip--group",
1067
1312
  n
1068
1313
  ),
1069
1314
  style: g,
1070
- initial: u ? { opacity: 0 } : { opacity: 0, scale: 0.96 },
1315
+ initial: f ? { opacity: 0 } : { opacity: 0, scale: 0.96 },
1071
1316
  animate: { opacity: 1, scale: 1 },
1072
- exit: u ? { opacity: 0 } : { opacity: 0, scale: 0.96 },
1073
- transition: u ? { ...H, layout: { duration: 0 } } : Xt,
1317
+ exit: f ? { opacity: 0 } : { opacity: 0, scale: 0.96 },
1318
+ transition: f ? { ...K, layout: { duration: 0 } } : et,
1074
1319
  children: [
1075
- /* @__PURE__ */ h(
1320
+ /* @__PURE__ */ c(
1076
1321
  "span",
1077
1322
  {
1078
1323
  className: "uk-tooltip__arrow",
1079
1324
  "aria-hidden": "true",
1080
1325
  style: {
1081
- "--uk-tooltip-arrow-offset": `${p?.arrowOffset ?? 0}px`
1326
+ "--uk-tooltip-arrow-offset": `${u?.arrowOffset ?? 0}px`
1082
1327
  }
1083
1328
  }
1084
1329
  ),
1085
- /* @__PURE__ */ h(
1086
- V.div,
1330
+ /* @__PURE__ */ c(
1331
+ E.div,
1087
1332
  {
1088
1333
  className: "uk-tooltip__content",
1089
1334
  initial: { opacity: 0 },
1090
1335
  animate: { opacity: 1 },
1091
- transition: u ? H : bt,
1092
- children: t
1336
+ transition: f ? K : ve,
1337
+ children: e
1093
1338
  },
1094
- e
1339
+ t
1095
1340
  )
1096
1341
  ]
1097
1342
  }
1098
1343
  );
1099
1344
  }
1100
- function pe({
1101
- children: e,
1102
- side: t = "top",
1345
+ function kt({
1346
+ children: t,
1347
+ side: e = "top",
1103
1348
  align: n = "center",
1104
1349
  sideOffset: o = 8,
1105
1350
  collisionPadding: r = 8,
1106
- avoidCollisions: a = !0,
1107
- delayDuration: s = 180,
1108
- closeDelay: l = 80,
1351
+ avoidCollisions: s = !0,
1352
+ delayDuration: a = 180,
1353
+ closeDelay: p = 80,
1109
1354
  contentClassName: d
1110
1355
  }) {
1111
- const i = z(), [m, b] = O(
1356
+ const i = R(), [m, h] = M(
1112
1357
  () => /* @__PURE__ */ new Map()
1113
- ), [u, f] = O(!1), [p, g] = O(null), y = _(null), T = _(null), C = et(
1114
- Nt,
1115
- Lt,
1116
- Mt
1117
- ), c = B(() => {
1358
+ ), [f, b] = M(!1), [u, g] = M(null), y = N(null), v = N(null), T = oe(
1359
+ $e,
1360
+ Be,
1361
+ Ae
1362
+ ), l = G(() => {
1118
1363
  y.current !== null && (clearTimeout(y.current), y.current = null);
1119
- }, []), w = B(() => {
1120
- T.current !== null && (clearTimeout(T.current), T.current = null);
1121
- }, []), I = P(($, M = !1) => {
1122
- if (c(), w(), g($), !u) {
1123
- if (M || s <= 0) {
1124
- f(!0);
1364
+ }, []), I = G(() => {
1365
+ v.current !== null && (clearTimeout(v.current), v.current = null);
1366
+ }, []), w = S((H, B = !1) => {
1367
+ if (l(), I(), g(H), !f) {
1368
+ if (B || a <= 0) {
1369
+ b(!0);
1125
1370
  return;
1126
1371
  }
1127
1372
  y.current = setTimeout(() => {
1128
- y.current = null, f(!0);
1129
- }, s);
1373
+ y.current = null, b(!0);
1374
+ }, a);
1130
1375
  }
1131
- }), k = P(() => {
1132
- if (c(), w(), !!u) {
1133
- if (l <= 0) {
1134
- f(!1);
1376
+ }), _ = S(() => {
1377
+ if (l(), I(), !!f) {
1378
+ if (p <= 0) {
1379
+ b(!1);
1135
1380
  return;
1136
1381
  }
1137
- T.current = setTimeout(() => {
1138
- T.current = null, f(!1);
1139
- }, l);
1382
+ v.current = setTimeout(() => {
1383
+ v.current = null, b(!1);
1384
+ }, p);
1140
1385
  }
1141
- }), L = P(() => {
1142
- c(), w(), f(!1);
1143
- }), R = P(
1144
- ($, M, F) => {
1145
- b((W) => {
1146
- const lt = W.get($);
1147
- if (lt?.triggerElement === M && Object.is(lt.content, F))
1148
- return W;
1149
- const ut = new Map(W);
1150
- return ut.set($, { triggerElement: M, content: F }), ut;
1386
+ }), $ = S(() => {
1387
+ l(), I(), b(!1);
1388
+ }), L = S(
1389
+ (H, B, z) => {
1390
+ h((ee) => {
1391
+ const de = ee.get(H);
1392
+ if (de?.triggerElement === B && Object.is(de.content, z))
1393
+ return ee;
1394
+ const pe = new Map(ee);
1395
+ return pe.set(H, { triggerElement: B, content: z }), pe;
1151
1396
  });
1152
1397
  }
1153
- ), x = P(($) => {
1154
- b((M) => {
1155
- if (!M.has($))
1156
- return M;
1157
- const F = new Map(M);
1158
- return F.delete($), F;
1398
+ ), x = S((H) => {
1399
+ h((B) => {
1400
+ if (!B.has(H))
1401
+ return B;
1402
+ const z = new Map(B);
1403
+ return z.delete(H), z;
1159
1404
  });
1160
1405
  });
1161
- S(
1406
+ O(
1162
1407
  () => () => {
1163
- c(), w();
1408
+ l(), I();
1164
1409
  },
1165
- [w, c]
1410
+ [I, l]
1166
1411
  );
1167
- const Ht = X(
1412
+ const je = U(
1168
1413
  () => ({
1169
- open: u,
1170
- activeValue: p,
1414
+ open: f,
1415
+ activeValue: u,
1171
1416
  contentId: i,
1172
- activate: I,
1173
- requestClose: k,
1174
- dismiss: L,
1175
- register: R,
1417
+ activate: w,
1418
+ requestClose: _,
1419
+ dismiss: $,
1420
+ register: L,
1176
1421
  unregister: x
1177
1422
  }),
1178
1423
  [
1179
- I,
1180
- p,
1424
+ w,
1425
+ u,
1181
1426
  i,
1427
+ $,
1428
+ f,
1182
1429
  L,
1183
- u,
1184
- R,
1185
- k,
1430
+ _,
1186
1431
  x
1187
1432
  ]
1188
- ), A = p ? m.get(p) : void 0, zt = u && !!A, ct = C && A ? A.triggerElement.closest("dialog") ?? document.body : null;
1189
- return /* @__PURE__ */ N(Ft.Provider, { value: Ht, children: [
1190
- e,
1191
- ct && A ? st(
1192
- /* @__PURE__ */ h(ot, { reducedMotion: "user", children: /* @__PURE__ */ h(rt, { children: zt ? /* @__PURE__ */ h(
1193
- de,
1433
+ ), F = u ? m.get(u) : void 0, qe = f && !!F, ue = T && F ? F.triggerElement.closest("dialog") ?? document.body : null;
1434
+ return /* @__PURE__ */ C(Ue.Provider, { value: je, children: [
1435
+ t,
1436
+ ue && F ? se(
1437
+ /* @__PURE__ */ c(ie, { reducedMotion: "user", children: /* @__PURE__ */ c(A, { children: qe ? /* @__PURE__ */ c(
1438
+ Tt,
1194
1439
  {
1195
- activeValue: p ?? "",
1196
- content: A.content,
1440
+ activeValue: u ?? "",
1441
+ content: F.content,
1197
1442
  contentClassName: d,
1198
1443
  contentId: i,
1199
- dismiss: L,
1200
- triggerElement: A.triggerElement,
1201
- side: t,
1444
+ dismiss: $,
1445
+ triggerElement: F.triggerElement,
1446
+ side: e,
1202
1447
  align: n,
1203
1448
  sideOffset: o,
1204
1449
  collisionPadding: r,
1205
- avoidCollisions: a
1450
+ avoidCollisions: s
1206
1451
  },
1207
1452
  "uk-tooltip-group"
1208
1453
  ) : null }) }),
1209
- ct
1454
+ ue
1210
1455
  ) : null
1211
1456
  ] });
1212
1457
  }
1213
- function fe({
1214
- value: e,
1215
- content: t,
1458
+ function wt({
1459
+ value: t,
1460
+ content: e,
1216
1461
  children: n
1217
1462
  }) {
1218
- const o = ue("Tooltip.Item"), { register: r, unregister: a } = o, [s, l] = O(
1463
+ const o = It("Tooltip.Item"), { register: r, unregister: s } = o, [a, p] = M(
1219
1464
  null
1220
1465
  );
1221
- if (!tt(n))
1466
+ if (!Z(n))
1222
1467
  throw new Error("<Tooltip.Item> expects a single valid React element");
1223
- const d = n, i = d.props, m = i.ref ?? d.ref, b = i.onPointerEnter, u = i.onPointerLeave, f = i.onFocus, p = i.onBlur, g = i.onKeyDown, y = o.open && o.activeValue === e, T = B(
1224
- (C) => {
1225
- St(m, C), l(C);
1468
+ const d = n, i = d.props, m = i.ref ?? d.ref, h = i.onPointerEnter, f = i.onPointerLeave, b = i.onFocus, u = i.onBlur, g = i.onKeyDown, y = o.open && o.activeValue === t, v = G(
1469
+ (T) => {
1470
+ Ve(m, T), p(T);
1226
1471
  },
1227
- [m, l]
1472
+ [m, p]
1228
1473
  );
1229
- return nt(() => {
1230
- if (s)
1231
- return r(e, s, t), () => a(e);
1232
- }, [t, r, s, a, e]), J(d, {
1233
- ref: T,
1234
- "aria-describedby": y ? $t(i["aria-describedby"], o.contentId) : i["aria-describedby"],
1235
- onPointerEnter: E(b, (C) => {
1236
- o.activate(e, C.pointerType === "touch");
1474
+ return re(() => {
1475
+ if (a)
1476
+ return r(t, a, e), () => s(t);
1477
+ }, [e, r, a, s, t]), j(d, {
1478
+ ref: v,
1479
+ "aria-describedby": y ? Fe(i["aria-describedby"], o.contentId) : i["aria-describedby"],
1480
+ onPointerEnter: D(h, (T) => {
1481
+ o.activate(t, T.pointerType === "touch");
1237
1482
  }),
1238
- onPointerLeave: E(u, (C) => {
1239
- C.pointerType !== "touch" && o.requestClose();
1483
+ onPointerLeave: D(f, (T) => {
1484
+ T.pointerType !== "touch" && o.requestClose();
1240
1485
  }),
1241
- onFocus: E(f, () => {
1242
- o.activate(e);
1486
+ onFocus: D(b, () => {
1487
+ o.activate(t);
1243
1488
  }),
1244
- onBlur: E(p, () => {
1489
+ onBlur: D(u, () => {
1245
1490
  o.requestClose();
1246
1491
  }),
1247
- onKeyDown: E(g, (C) => {
1248
- C.key === "Escape" && y && (C.preventDefault(), C.stopPropagation(), o.dismiss());
1492
+ onKeyDown: D(g, (T) => {
1493
+ T.key === "Escape" && y && (T.preventDefault(), T.stopPropagation(), o.dismiss());
1249
1494
  })
1250
1495
  });
1251
1496
  }
1252
- const xe = {
1253
- Root: re,
1254
- Trigger: ie,
1255
- Content: le,
1256
- Group: pe,
1257
- Item: fe
1497
+ const Mt = {
1498
+ Root: ht,
1499
+ Trigger: mt,
1500
+ Content: vt,
1501
+ Group: kt,
1502
+ Item: wt
1258
1503
  };
1259
1504
  export {
1260
- ht as Button,
1261
- ve as Dialog,
1262
- Te as Input,
1263
- we as Switch,
1264
- Ce as Tabs,
1265
- xe as Tooltip
1505
+ ye as Button,
1506
+ St as Dialog,
1507
+ Pt as Input,
1508
+ Rt as Sidebar,
1509
+ Dt as Switch,
1510
+ Lt as Tabs,
1511
+ Mt as Tooltip
1266
1512
  };
1267
1513
  //# sourceMappingURL=index.js.map