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