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/Sidebar.d.ts +41 -0
- package/dist/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.js +795 -679
- package/dist/index.js.map +1 -1
- package/dist/styles.cjs +149 -0
- package/dist/styles.cjs.map +1 -1
- package/dist/styles.css +1 -1
- package/dist/styles.js +149 -0
- package/dist/styles.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,136 +1,136 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { forwardRef as
|
|
3
|
-
import { useReducedMotion as
|
|
4
|
-
import { createPortal as
|
|
5
|
-
import { useControllableState as
|
|
6
|
-
function
|
|
7
|
-
return
|
|
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
|
|
10
|
-
variant:
|
|
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:
|
|
15
|
-
className:
|
|
16
|
-
children:
|
|
17
|
-
...
|
|
18
|
-
},
|
|
19
|
-
return /* @__PURE__ */
|
|
14
|
+
type: s = "button",
|
|
15
|
+
className: i,
|
|
16
|
+
children: c,
|
|
17
|
+
...l
|
|
18
|
+
}, a) {
|
|
19
|
+
return /* @__PURE__ */ _(
|
|
20
20
|
"button",
|
|
21
21
|
{
|
|
22
|
-
...
|
|
23
|
-
ref:
|
|
24
|
-
type:
|
|
25
|
-
className:
|
|
26
|
-
"data-variant":
|
|
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:
|
|
30
|
+
disabled: l.disabled || o,
|
|
31
31
|
"aria-busy": o || void 0,
|
|
32
32
|
children: [
|
|
33
|
-
o ? /* @__PURE__ */
|
|
34
|
-
|
|
33
|
+
o ? /* @__PURE__ */ p("span", { className: "uk-button__spinner", "aria-hidden": "true" }) : null,
|
|
34
|
+
c
|
|
35
35
|
]
|
|
36
36
|
}
|
|
37
37
|
);
|
|
38
|
-
}),
|
|
39
|
-
inputSize:
|
|
38
|
+
}), Et = E(function({
|
|
39
|
+
inputSize: e = "md",
|
|
40
40
|
invalid: n = !1,
|
|
41
41
|
className: o,
|
|
42
42
|
"aria-invalid": r,
|
|
43
|
-
...
|
|
44
|
-
},
|
|
45
|
-
return /* @__PURE__ */
|
|
43
|
+
...s
|
|
44
|
+
}, i) {
|
|
45
|
+
return /* @__PURE__ */ p(
|
|
46
46
|
"input",
|
|
47
47
|
{
|
|
48
|
-
...
|
|
49
|
-
ref:
|
|
50
|
-
className:
|
|
51
|
-
"data-size":
|
|
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
|
-
}),
|
|
55
|
+
}), Q = [0.23, 1, 0.32, 1], fe = {
|
|
56
56
|
type: "spring",
|
|
57
57
|
bounce: 0,
|
|
58
58
|
duration: 0.3
|
|
59
|
-
},
|
|
59
|
+
}, he = {
|
|
60
60
|
type: "spring",
|
|
61
61
|
bounce: 0.04,
|
|
62
62
|
duration: 0.38
|
|
63
|
-
},
|
|
63
|
+
}, ge = {
|
|
64
64
|
type: "spring",
|
|
65
65
|
bounce: 0.08,
|
|
66
66
|
duration: 0.34
|
|
67
|
-
},
|
|
67
|
+
}, ye = {
|
|
68
68
|
duration: 0.12,
|
|
69
|
-
ease:
|
|
70
|
-
},
|
|
69
|
+
ease: Q
|
|
70
|
+
}, Qe = {
|
|
71
71
|
layout: { type: "spring", bounce: 0, duration: 0.22 },
|
|
72
|
-
opacity: { duration: 0.12, ease:
|
|
73
|
-
scale: { duration: 0.12, ease:
|
|
74
|
-
},
|
|
72
|
+
opacity: { duration: 0.12, ease: Q },
|
|
73
|
+
scale: { duration: 0.12, ease: Q }
|
|
74
|
+
}, K = {
|
|
75
75
|
duration: 0.12,
|
|
76
|
-
ease:
|
|
77
|
-
},
|
|
78
|
-
checked:
|
|
76
|
+
ease: Q
|
|
77
|
+
}, Pt = E(function({
|
|
78
|
+
checked: e,
|
|
79
79
|
defaultChecked: n,
|
|
80
80
|
onCheckedChange: o,
|
|
81
81
|
disabled: r,
|
|
82
|
-
className:
|
|
83
|
-
children:
|
|
84
|
-
id:
|
|
85
|
-
...
|
|
86
|
-
},
|
|
87
|
-
const m =
|
|
88
|
-
value:
|
|
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 =
|
|
92
|
-
|
|
93
|
-
if (
|
|
91
|
+
}), T = Ue(g ? 16 : 0);
|
|
92
|
+
O(() => {
|
|
93
|
+
if (f.current)
|
|
94
94
|
return;
|
|
95
|
-
const
|
|
95
|
+
const d = pe(
|
|
96
96
|
T,
|
|
97
97
|
g ? 16 : 0,
|
|
98
|
-
u ? { duration: 0 } :
|
|
98
|
+
u ? { duration: 0 } : fe
|
|
99
99
|
);
|
|
100
|
-
return () =>
|
|
100
|
+
return () => d.stop();
|
|
101
101
|
}, [g, u, T]);
|
|
102
|
-
const
|
|
103
|
-
const
|
|
104
|
-
if (!(!
|
|
105
|
-
if (
|
|
106
|
-
const
|
|
107
|
-
|
|
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
|
-
|
|
110
|
-
u ? { duration: 0 } : { ...
|
|
109
|
+
k ? 16 : 0,
|
|
110
|
+
u ? { duration: 0 } : { ...fe, velocity: N }
|
|
111
111
|
), window.setTimeout(() => {
|
|
112
|
-
|
|
112
|
+
h.current = !1;
|
|
113
113
|
}, 0);
|
|
114
114
|
} else
|
|
115
|
-
|
|
116
|
-
|
|
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__ */
|
|
119
|
+
return /* @__PURE__ */ _(
|
|
120
120
|
"label",
|
|
121
121
|
{
|
|
122
|
-
className:
|
|
122
|
+
className: I("uk-switch", s),
|
|
123
123
|
"data-disabled": r ? "true" : void 0,
|
|
124
124
|
htmlFor: b,
|
|
125
|
-
onClickCapture: (
|
|
126
|
-
|
|
125
|
+
onClickCapture: (d) => {
|
|
126
|
+
h.current && (d.preventDefault(), d.stopPropagation());
|
|
127
127
|
},
|
|
128
128
|
children: [
|
|
129
|
-
/* @__PURE__ */
|
|
129
|
+
/* @__PURE__ */ p(
|
|
130
130
|
"input",
|
|
131
131
|
{
|
|
132
|
-
...
|
|
133
|
-
ref:
|
|
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: (
|
|
141
|
+
onChange: (d) => y(d.target.checked)
|
|
142
142
|
}
|
|
143
143
|
),
|
|
144
|
-
/* @__PURE__ */
|
|
144
|
+
/* @__PURE__ */ p(
|
|
145
145
|
"span",
|
|
146
146
|
{
|
|
147
147
|
className: "uk-switch__track",
|
|
148
148
|
"aria-hidden": "true",
|
|
149
|
-
onPointerDown: (
|
|
150
|
-
r || (
|
|
151
|
-
pointerId:
|
|
152
|
-
startX:
|
|
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:
|
|
156
|
-
}, typeof
|
|
155
|
+
samples: [{ x: d.clientX, time: performance.now() }]
|
|
156
|
+
}, typeof d.currentTarget.setPointerCapture == "function" && d.currentTarget.setPointerCapture(d.pointerId));
|
|
157
157
|
},
|
|
158
|
-
onPointerMove: (
|
|
159
|
-
const
|
|
160
|
-
if (!
|
|
158
|
+
onPointerMove: (d) => {
|
|
159
|
+
const v = f.current;
|
|
160
|
+
if (!v || v.pointerId !== d.pointerId)
|
|
161
161
|
return;
|
|
162
|
-
const
|
|
163
|
-
Math.abs(
|
|
164
|
-
(
|
|
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:
|
|
168
|
-
onPointerCancel:
|
|
169
|
-
children: /* @__PURE__ */
|
|
167
|
+
onPointerUp: w,
|
|
168
|
+
onPointerCancel: w,
|
|
169
|
+
children: /* @__PURE__ */ p($.span, { className: "uk-switch__thumb", style: { x: T } })
|
|
170
170
|
}
|
|
171
171
|
),
|
|
172
|
-
|
|
172
|
+
i ? /* @__PURE__ */ p("span", { className: "uk-switch__label", children: i }) : null
|
|
173
173
|
]
|
|
174
174
|
}
|
|
175
175
|
);
|
|
176
|
-
}),
|
|
177
|
-
function
|
|
178
|
-
const
|
|
179
|
-
if (!
|
|
180
|
-
throw new Error(`<${
|
|
181
|
-
return
|
|
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
|
|
184
|
-
return
|
|
183
|
+
function te(t, e) {
|
|
184
|
+
return (n) => {
|
|
185
|
+
t?.(n), n.defaultPrevented || e(n);
|
|
186
|
+
};
|
|
185
187
|
}
|
|
186
|
-
function
|
|
187
|
-
|
|
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
|
|
190
|
-
|
|
191
|
-
|
|
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:
|
|
310
|
+
children: s
|
|
196
311
|
}) {
|
|
197
|
-
const
|
|
198
|
-
value:
|
|
199
|
-
defaultValue:
|
|
312
|
+
const i = A(), [c, l] = Z({
|
|
313
|
+
value: t,
|
|
314
|
+
defaultValue: e ?? "",
|
|
200
315
|
onChange: n
|
|
201
|
-
}),
|
|
316
|
+
}), a = j(
|
|
202
317
|
() => ({
|
|
203
|
-
baseId:
|
|
204
|
-
value:
|
|
205
|
-
setValue:
|
|
318
|
+
baseId: i,
|
|
319
|
+
value: c,
|
|
320
|
+
setValue: l,
|
|
206
321
|
orientation: o,
|
|
207
|
-
indicatorId: `${
|
|
322
|
+
indicatorId: `${i}-indicator`
|
|
208
323
|
}),
|
|
209
|
-
[
|
|
324
|
+
[i, c, o, l]
|
|
210
325
|
);
|
|
211
|
-
return /* @__PURE__ */
|
|
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
|
|
214
|
-
const { orientation:
|
|
215
|
-
return /* @__PURE__ */
|
|
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":
|
|
336
|
+
"aria-orientation": s,
|
|
222
337
|
tabIndex: -1,
|
|
223
|
-
className:
|
|
224
|
-
onKeyDown: (
|
|
225
|
-
if (n?.(
|
|
338
|
+
className: I("uk-tabs__list", e),
|
|
339
|
+
onKeyDown: (i) => {
|
|
340
|
+
if (n?.(i), i.defaultPrevented)
|
|
226
341
|
return;
|
|
227
|
-
const
|
|
228
|
-
if (!
|
|
342
|
+
const l = i.target?.closest('[role="tab"]');
|
|
343
|
+
if (!l || l.hasAttribute("disabled"))
|
|
229
344
|
return;
|
|
230
|
-
const
|
|
231
|
-
|
|
345
|
+
const a = Array.from(
|
|
346
|
+
i.currentTarget.querySelectorAll(
|
|
232
347
|
'[role="tab"]:not([disabled])'
|
|
233
348
|
)
|
|
234
|
-
), m =
|
|
349
|
+
), m = a.indexOf(l);
|
|
235
350
|
if (m === -1)
|
|
236
351
|
return;
|
|
237
|
-
const b =
|
|
238
|
-
let
|
|
239
|
-
switch (
|
|
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
|
-
|
|
356
|
+
h = (m + 1) % a.length;
|
|
242
357
|
break;
|
|
243
358
|
case u:
|
|
244
|
-
|
|
359
|
+
h = (m - 1 + a.length) % a.length;
|
|
245
360
|
break;
|
|
246
361
|
case "Home":
|
|
247
|
-
|
|
362
|
+
h = 0;
|
|
248
363
|
break;
|
|
249
364
|
case "End":
|
|
250
|
-
|
|
365
|
+
h = a.length - 1;
|
|
251
366
|
break;
|
|
252
367
|
default:
|
|
253
368
|
return;
|
|
254
369
|
}
|
|
255
|
-
|
|
256
|
-
const
|
|
257
|
-
|
|
370
|
+
i.preventDefault();
|
|
371
|
+
const f = a[h];
|
|
372
|
+
f && (f.focus(), f.click());
|
|
258
373
|
}
|
|
259
374
|
}
|
|
260
375
|
);
|
|
261
|
-
}),
|
|
262
|
-
const
|
|
263
|
-
return /* @__PURE__ */
|
|
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
|
-
...
|
|
267
|
-
ref:
|
|
381
|
+
...i,
|
|
382
|
+
ref: c,
|
|
268
383
|
type: n,
|
|
269
384
|
role: "tab",
|
|
270
|
-
id:
|
|
271
|
-
"aria-selected":
|
|
272
|
-
"aria-controls":
|
|
273
|
-
tabIndex:
|
|
274
|
-
"data-state":
|
|
275
|
-
className:
|
|
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 ||
|
|
392
|
+
r?.(b), b.defaultPrevented || l.setValue(e);
|
|
278
393
|
},
|
|
279
394
|
children: [
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
395
|
+
s,
|
|
396
|
+
a ? /* @__PURE__ */ p(
|
|
397
|
+
$.span,
|
|
283
398
|
{
|
|
284
399
|
className: "uk-tabs__indicator",
|
|
285
|
-
layoutId:
|
|
400
|
+
layoutId: l.indicatorId,
|
|
286
401
|
"aria-hidden": "true",
|
|
287
|
-
transition: m ? { duration: 0 } :
|
|
402
|
+
transition: m ? { duration: 0 } : ge
|
|
288
403
|
}
|
|
289
404
|
) : null
|
|
290
405
|
]
|
|
291
406
|
}
|
|
292
407
|
);
|
|
293
|
-
}),
|
|
294
|
-
const
|
|
295
|
-
return /* @__PURE__ */
|
|
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:
|
|
302
|
-
"aria-labelledby":
|
|
303
|
-
hidden: !
|
|
416
|
+
id: Ie(s.baseId, e),
|
|
417
|
+
"aria-labelledby": we(s.baseId, e),
|
|
418
|
+
hidden: !i,
|
|
304
419
|
tabIndex: 0,
|
|
305
|
-
"data-state":
|
|
306
|
-
className:
|
|
420
|
+
"data-state": i ? "active" : "inactive",
|
|
421
|
+
className: I("uk-tabs__panel", n)
|
|
307
422
|
}
|
|
308
423
|
);
|
|
309
|
-
}),
|
|
310
|
-
List:
|
|
311
|
-
Trigger:
|
|
312
|
-
Content:
|
|
313
|
-
}),
|
|
314
|
-
},
|
|
315
|
-
function
|
|
316
|
-
const
|
|
317
|
-
if (!
|
|
318
|
-
throw new Error(`<${
|
|
319
|
-
return
|
|
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
|
|
436
|
+
function xe(t, e) {
|
|
322
437
|
return (n) => {
|
|
323
|
-
|
|
438
|
+
t?.(n), n.defaultPrevented || e(n);
|
|
324
439
|
};
|
|
325
440
|
}
|
|
326
|
-
function
|
|
327
|
-
children:
|
|
328
|
-
open:
|
|
441
|
+
function Ce({
|
|
442
|
+
children: t,
|
|
443
|
+
open: e,
|
|
329
444
|
defaultOpen: n,
|
|
330
445
|
onOpenChange: o
|
|
331
446
|
}) {
|
|
332
|
-
const r =
|
|
333
|
-
value:
|
|
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 =
|
|
451
|
+
}), b = j(
|
|
337
452
|
() => ({
|
|
338
|
-
open:
|
|
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:
|
|
345
|
-
setHasTitle:
|
|
346
|
-
hasDescription:
|
|
347
|
-
setHasDescription:
|
|
459
|
+
hasTitle: s,
|
|
460
|
+
setHasTitle: i,
|
|
461
|
+
hasDescription: c,
|
|
462
|
+
setHasDescription: l
|
|
348
463
|
}),
|
|
349
|
-
[r,
|
|
464
|
+
[r, a, c, s, m]
|
|
350
465
|
);
|
|
351
|
-
return /* @__PURE__ */
|
|
466
|
+
return /* @__PURE__ */ p(ke.Provider, { value: b, children: t });
|
|
352
467
|
}
|
|
353
|
-
function
|
|
354
|
-
const
|
|
355
|
-
return
|
|
356
|
-
id:
|
|
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":
|
|
359
|
-
"aria-controls":
|
|
360
|
-
onClick:
|
|
361
|
-
|
|
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
|
|
366
|
-
children:
|
|
367
|
-
label:
|
|
480
|
+
function _e({
|
|
481
|
+
children: t,
|
|
482
|
+
label: e = "Close"
|
|
368
483
|
}) {
|
|
369
|
-
const n =
|
|
370
|
-
if (
|
|
371
|
-
const o =
|
|
372
|
-
return
|
|
373
|
-
onClick:
|
|
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__ */
|
|
493
|
+
return /* @__PURE__ */ p(be, { variant: "ghost", onClick: () => n.setOpen(!1), children: e });
|
|
379
494
|
}
|
|
380
|
-
const
|
|
381
|
-
return /* @__PURE__ */
|
|
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:
|
|
501
|
+
className: I("uk-dialog__header", e)
|
|
387
502
|
}
|
|
388
503
|
);
|
|
389
|
-
}),
|
|
390
|
-
const
|
|
391
|
-
return
|
|
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:
|
|
397
|
-
className:
|
|
511
|
+
id: s.titleId,
|
|
512
|
+
className: I("uk-dialog__title", e),
|
|
398
513
|
children: n
|
|
399
514
|
}
|
|
400
515
|
);
|
|
401
|
-
}),
|
|
402
|
-
function({ className:
|
|
403
|
-
const r =
|
|
404
|
-
return
|
|
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:
|
|
525
|
+
className: I("uk-dialog__description", e)
|
|
411
526
|
}
|
|
412
527
|
);
|
|
413
528
|
}
|
|
414
|
-
),
|
|
415
|
-
return /* @__PURE__ */
|
|
416
|
-
}),
|
|
417
|
-
return /* @__PURE__ */
|
|
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:
|
|
537
|
+
className: I("uk-dialog__footer", e)
|
|
423
538
|
}
|
|
424
539
|
);
|
|
425
540
|
});
|
|
426
|
-
function
|
|
427
|
-
requestClose:
|
|
428
|
-
contentId:
|
|
541
|
+
function ut({
|
|
542
|
+
requestClose: t,
|
|
543
|
+
contentId: e,
|
|
429
544
|
titleId: n,
|
|
430
545
|
descriptionId: o,
|
|
431
546
|
hasTitle: r,
|
|
432
|
-
hasDescription:
|
|
433
|
-
children:
|
|
434
|
-
closeOnBackdropClick:
|
|
435
|
-
closeOnEscape:
|
|
436
|
-
initialFocusRef:
|
|
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":
|
|
441
|
-
"aria-describedby":
|
|
555
|
+
"aria-labelledby": h,
|
|
556
|
+
"aria-describedby": f
|
|
442
557
|
}) {
|
|
443
|
-
const g =
|
|
444
|
-
return
|
|
445
|
-
const
|
|
446
|
-
|
|
447
|
-
}, []),
|
|
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:
|
|
565
|
+
initialFocusRef: a,
|
|
451
566
|
returnFocusRef: m ?? y
|
|
452
|
-
}),
|
|
453
|
-
const
|
|
454
|
-
if (!
|
|
567
|
+
}), O(() => {
|
|
568
|
+
const d = g.current;
|
|
569
|
+
if (!d)
|
|
455
570
|
return;
|
|
456
|
-
const
|
|
457
|
-
|
|
458
|
-
},
|
|
459
|
-
if (!
|
|
460
|
-
|
|
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
|
-
|
|
464
|
-
},
|
|
465
|
-
|
|
466
|
-
},
|
|
467
|
-
|
|
468
|
-
},
|
|
469
|
-
|
|
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
|
|
472
|
-
|
|
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
|
-
}, [
|
|
589
|
+
}, [c, l, t]), /* @__PURE__ */ p(
|
|
475
590
|
"dialog",
|
|
476
591
|
{
|
|
477
592
|
ref: g,
|
|
478
|
-
id:
|
|
479
|
-
className:
|
|
480
|
-
closedby:
|
|
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":
|
|
485
|
-
"aria-describedby":
|
|
486
|
-
children: /* @__PURE__ */
|
|
487
|
-
|
|
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:
|
|
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:
|
|
612
|
+
transition: w ? K : { ...he, delay: 0.06 }
|
|
498
613
|
},
|
|
499
|
-
exit:
|
|
614
|
+
exit: w ? { opacity: 0, transition: K } : {
|
|
500
615
|
opacity: 0,
|
|
501
616
|
transform: "translateY(8px) scale(0.97)",
|
|
502
|
-
transition:
|
|
617
|
+
transition: he
|
|
503
618
|
},
|
|
504
|
-
children:
|
|
619
|
+
children: i
|
|
505
620
|
}
|
|
506
621
|
)
|
|
507
622
|
}
|
|
508
623
|
);
|
|
509
624
|
}
|
|
510
|
-
function
|
|
511
|
-
children:
|
|
512
|
-
closeOnBackdropClick:
|
|
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:
|
|
517
|
-
"aria-label":
|
|
518
|
-
"aria-labelledby":
|
|
519
|
-
"aria-describedby":
|
|
631
|
+
className: s,
|
|
632
|
+
"aria-label": i,
|
|
633
|
+
"aria-labelledby": c,
|
|
634
|
+
"aria-describedby": l
|
|
520
635
|
}) {
|
|
521
|
-
const
|
|
522
|
-
|
|
636
|
+
const a = Y("Dialog.Content"), m = R(() => {
|
|
637
|
+
a.setOpen(!1);
|
|
523
638
|
});
|
|
524
|
-
return
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
) ?
|
|
529
|
-
/* @__PURE__ */
|
|
530
|
-
|
|
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:
|
|
534
|
-
titleId:
|
|
535
|
-
descriptionId:
|
|
536
|
-
hasTitle:
|
|
537
|
-
hasDescription:
|
|
538
|
-
closeOnBackdropClick:
|
|
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:
|
|
543
|
-
"aria-label":
|
|
544
|
-
"aria-labelledby":
|
|
545
|
-
"aria-describedby":
|
|
546
|
-
children:
|
|
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
|
|
554
|
-
open:
|
|
555
|
-
onOpenChange:
|
|
668
|
+
function dt({
|
|
669
|
+
open: t,
|
|
670
|
+
onOpenChange: e,
|
|
556
671
|
title: n,
|
|
557
672
|
description: o,
|
|
558
673
|
footer: r,
|
|
559
|
-
children:
|
|
560
|
-
closeLabel:
|
|
561
|
-
showCloseButton:
|
|
562
|
-
closeOnBackdropClick:
|
|
563
|
-
closeOnEscape:
|
|
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":
|
|
682
|
+
"aria-label": h
|
|
568
683
|
}) {
|
|
569
|
-
return /* @__PURE__ */
|
|
570
|
-
|
|
684
|
+
return /* @__PURE__ */ p(Ce, { open: t, onOpenChange: e, children: /* @__PURE__ */ _(
|
|
685
|
+
Le,
|
|
571
686
|
{
|
|
572
687
|
className: u,
|
|
573
|
-
closeOnBackdropClick:
|
|
574
|
-
closeOnEscape:
|
|
688
|
+
closeOnBackdropClick: l,
|
|
689
|
+
closeOnEscape: a,
|
|
575
690
|
initialFocusRef: m,
|
|
576
691
|
returnFocusRef: b,
|
|
577
|
-
"aria-label":
|
|
692
|
+
"aria-label": h,
|
|
578
693
|
children: [
|
|
579
|
-
n || o ||
|
|
580
|
-
/* @__PURE__ */
|
|
581
|
-
n ? /* @__PURE__ */
|
|
582
|
-
o ? /* @__PURE__ */
|
|
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
|
-
|
|
585
|
-
|
|
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":
|
|
705
|
+
"aria-label": i,
|
|
591
706
|
className: "uk-dialog__close",
|
|
592
|
-
children: /* @__PURE__ */
|
|
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__ */
|
|
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__ */
|
|
614
|
-
r ? /* @__PURE__ */
|
|
728
|
+
/* @__PURE__ */ p(Ne, { children: s }),
|
|
729
|
+
r ? /* @__PURE__ */ p(Re, { children: r }) : null
|
|
615
730
|
]
|
|
616
731
|
}
|
|
617
732
|
) });
|
|
618
733
|
}
|
|
619
|
-
const
|
|
620
|
-
Root:
|
|
621
|
-
Trigger:
|
|
622
|
-
Content:
|
|
623
|
-
Header:
|
|
624
|
-
Title:
|
|
625
|
-
Description:
|
|
626
|
-
Body:
|
|
627
|
-
Footer:
|
|
628
|
-
Close:
|
|
629
|
-
}),
|
|
630
|
-
},
|
|
631
|
-
function
|
|
632
|
-
const
|
|
633
|
-
if (!
|
|
634
|
-
throw new Error(`<${
|
|
635
|
-
return
|
|
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
|
|
638
|
-
typeof
|
|
752
|
+
function Be(t, e) {
|
|
753
|
+
typeof t == "function" ? t(e) : t && (t.current = e);
|
|
639
754
|
}
|
|
640
|
-
function
|
|
641
|
-
const n = typeof
|
|
642
|
-
return Array.from(/* @__PURE__ */ new Set([...n,
|
|
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
|
|
759
|
+
function P(t, e) {
|
|
645
760
|
return (n) => {
|
|
646
|
-
|
|
761
|
+
t?.(n), n.defaultPrevented || e(n);
|
|
647
762
|
};
|
|
648
763
|
}
|
|
649
|
-
function
|
|
650
|
-
children:
|
|
651
|
-
open:
|
|
764
|
+
function pt({
|
|
765
|
+
children: t,
|
|
766
|
+
open: e,
|
|
652
767
|
defaultOpen: n,
|
|
653
768
|
onOpenChange: o,
|
|
654
769
|
delayDuration: r = 300,
|
|
655
|
-
closeDelay:
|
|
770
|
+
closeDelay: s = 80
|
|
656
771
|
}) {
|
|
657
|
-
const
|
|
772
|
+
const i = A(), [c, l] = L(
|
|
658
773
|
null
|
|
659
|
-
),
|
|
660
|
-
value:
|
|
774
|
+
), a = D(null), m = D(null), [b, u] = Z({
|
|
775
|
+
value: e,
|
|
661
776
|
defaultValue: n ?? !1,
|
|
662
777
|
onChange: o
|
|
663
|
-
}),
|
|
664
|
-
|
|
665
|
-
}, []),
|
|
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 =
|
|
668
|
-
if (
|
|
669
|
-
if (
|
|
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
|
-
|
|
674
|
-
|
|
788
|
+
a.current = setTimeout(() => {
|
|
789
|
+
a.current = null, u(!0);
|
|
675
790
|
}, r);
|
|
676
791
|
}
|
|
677
|
-
}), y =
|
|
678
|
-
if (
|
|
679
|
-
if (
|
|
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
|
-
},
|
|
800
|
+
}, s);
|
|
686
801
|
}
|
|
687
|
-
}), T =
|
|
688
|
-
|
|
802
|
+
}), T = R(() => {
|
|
803
|
+
h(), f(), u(!1);
|
|
689
804
|
});
|
|
690
|
-
|
|
691
|
-
b ?
|
|
692
|
-
}, [
|
|
805
|
+
O(() => {
|
|
806
|
+
b ? f() : h();
|
|
807
|
+
}, [f, h, b]), O(
|
|
693
808
|
() => () => {
|
|
694
|
-
|
|
809
|
+
h(), f();
|
|
695
810
|
},
|
|
696
|
-
[
|
|
811
|
+
[f, h]
|
|
697
812
|
);
|
|
698
|
-
const
|
|
813
|
+
const w = j(
|
|
699
814
|
() => ({
|
|
700
815
|
open: b,
|
|
701
|
-
triggerElement:
|
|
702
|
-
setTriggerElement:
|
|
703
|
-
contentId:
|
|
816
|
+
triggerElement: c,
|
|
817
|
+
setTriggerElement: l,
|
|
818
|
+
contentId: i,
|
|
704
819
|
requestOpen: g,
|
|
705
820
|
requestClose: y,
|
|
706
821
|
dismiss: T
|
|
707
822
|
}),
|
|
708
|
-
[
|
|
823
|
+
[i, b, T, y, g, c]
|
|
709
824
|
);
|
|
710
|
-
return /* @__PURE__ */
|
|
825
|
+
return /* @__PURE__ */ p(Se.Provider, { value: w, children: t });
|
|
711
826
|
}
|
|
712
|
-
function
|
|
713
|
-
const
|
|
714
|
-
if (!
|
|
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 =
|
|
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
|
-
|
|
833
|
+
Be(s, u), n(u);
|
|
719
834
|
},
|
|
720
|
-
[
|
|
835
|
+
[s, n]
|
|
721
836
|
);
|
|
722
|
-
return
|
|
837
|
+
return q(o, {
|
|
723
838
|
ref: b,
|
|
724
|
-
"aria-describedby":
|
|
725
|
-
onPointerEnter:
|
|
726
|
-
|
|
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:
|
|
729
|
-
u.pointerType !== "touch" &&
|
|
843
|
+
onPointerLeave: P(c, (u) => {
|
|
844
|
+
u.pointerType !== "touch" && e.requestClose();
|
|
730
845
|
}),
|
|
731
|
-
onFocus:
|
|
732
|
-
|
|
846
|
+
onFocus: P(l, () => {
|
|
847
|
+
e.requestOpen();
|
|
733
848
|
}),
|
|
734
|
-
onBlur:
|
|
735
|
-
|
|
849
|
+
onBlur: P(a, () => {
|
|
850
|
+
e.requestClose();
|
|
736
851
|
}),
|
|
737
|
-
onKeyDown:
|
|
738
|
-
u.key === "Escape" &&
|
|
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
|
|
743
|
-
return n <
|
|
857
|
+
function J(t, e, n) {
|
|
858
|
+
return n < e ? e : Math.min(Math.max(t, e), n);
|
|
744
859
|
}
|
|
745
|
-
function
|
|
746
|
-
switch (
|
|
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
|
|
758
|
-
switch (
|
|
872
|
+
function ne(t, e, n, o, r) {
|
|
873
|
+
switch (e) {
|
|
759
874
|
case "top":
|
|
760
|
-
return
|
|
875
|
+
return t.top - r;
|
|
761
876
|
case "right":
|
|
762
|
-
return n -
|
|
877
|
+
return n - t.right - r;
|
|
763
878
|
case "bottom":
|
|
764
|
-
return o -
|
|
879
|
+
return o - t.bottom - r;
|
|
765
880
|
case "left":
|
|
766
|
-
return
|
|
881
|
+
return t.left - r;
|
|
767
882
|
}
|
|
768
883
|
}
|
|
769
|
-
function
|
|
770
|
-
return
|
|
771
|
-
|
|
884
|
+
function me(t, e, n, o, r, s, i) {
|
|
885
|
+
return ne(
|
|
886
|
+
t,
|
|
772
887
|
n,
|
|
773
888
|
r,
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
) >= (n === "top" || n === "bottom" ?
|
|
889
|
+
s,
|
|
890
|
+
i
|
|
891
|
+
) >= (n === "top" || n === "bottom" ? e.height : e.width) + o;
|
|
777
892
|
}
|
|
778
|
-
function
|
|
779
|
-
trigger:
|
|
780
|
-
tooltip:
|
|
893
|
+
function mt({
|
|
894
|
+
trigger: t,
|
|
895
|
+
tooltip: e,
|
|
781
896
|
side: n,
|
|
782
897
|
align: o,
|
|
783
898
|
sideOffset: r,
|
|
784
|
-
collisionPadding:
|
|
785
|
-
avoidCollisions:
|
|
786
|
-
viewportWidth:
|
|
787
|
-
viewportHeight:
|
|
899
|
+
collisionPadding: s,
|
|
900
|
+
avoidCollisions: i,
|
|
901
|
+
viewportWidth: c,
|
|
902
|
+
viewportHeight: l
|
|
788
903
|
}) {
|
|
789
|
-
let
|
|
790
|
-
if (
|
|
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
|
-
|
|
797
|
-
a
|
|
912
|
+
s
|
|
798
913
|
)) {
|
|
799
|
-
const y =
|
|
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
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
e,
|
|
921
|
+
s
|
|
922
|
+
), w = ne(
|
|
923
|
+
t,
|
|
809
924
|
n,
|
|
925
|
+
c,
|
|
810
926
|
l,
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
e,
|
|
927
|
+
s
|
|
928
|
+
), d = ne(
|
|
929
|
+
t,
|
|
815
930
|
y,
|
|
931
|
+
c,
|
|
816
932
|
l,
|
|
817
|
-
|
|
818
|
-
a
|
|
933
|
+
s
|
|
819
934
|
);
|
|
820
|
-
(T ||
|
|
935
|
+
(T || d > w) && (a = y);
|
|
821
936
|
}
|
|
822
|
-
const m =
|
|
823
|
-
let u = 0,
|
|
824
|
-
switch (
|
|
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" ?
|
|
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 =
|
|
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
|
-
|
|
949
|
+
i && (u = J(
|
|
835
950
|
u,
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
),
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
951
|
+
s,
|
|
952
|
+
c - e.width - s
|
|
953
|
+
), h = J(
|
|
954
|
+
h,
|
|
955
|
+
s,
|
|
956
|
+
l - e.height - s
|
|
842
957
|
));
|
|
843
|
-
const
|
|
958
|
+
const f = 10, g = a === "top" || a === "bottom" ? J(
|
|
844
959
|
m - u,
|
|
845
|
-
|
|
846
|
-
Math.max(
|
|
847
|
-
) :
|
|
848
|
-
b -
|
|
849
|
-
|
|
850
|
-
Math.max(
|
|
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:
|
|
967
|
+
return { x: u, y: h, side: a, arrowOffset: g };
|
|
853
968
|
}
|
|
854
|
-
function
|
|
969
|
+
function Fe(t, e, {
|
|
855
970
|
side: n,
|
|
856
971
|
align: o,
|
|
857
972
|
sideOffset: r,
|
|
858
|
-
collisionPadding:
|
|
859
|
-
avoidCollisions:
|
|
973
|
+
collisionPadding: s,
|
|
974
|
+
avoidCollisions: i
|
|
860
975
|
}) {
|
|
861
|
-
const [
|
|
862
|
-
return
|
|
863
|
-
const
|
|
864
|
-
if (!
|
|
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 =
|
|
868
|
-
|
|
869
|
-
|
|
982
|
+
const u = t.getBoundingClientRect(), h = a.getBoundingClientRect();
|
|
983
|
+
l(
|
|
984
|
+
mt({
|
|
870
985
|
trigger: u,
|
|
871
|
-
tooltip:
|
|
986
|
+
tooltip: h,
|
|
872
987
|
side: n,
|
|
873
988
|
align: o,
|
|
874
989
|
sideOffset: r,
|
|
875
|
-
collisionPadding:
|
|
876
|
-
avoidCollisions:
|
|
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(
|
|
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
|
-
|
|
891
|
-
t,
|
|
1006
|
+
e,
|
|
892
1007
|
n,
|
|
893
1008
|
r,
|
|
894
|
-
|
|
895
|
-
]),
|
|
1009
|
+
t
|
|
1010
|
+
]), c;
|
|
896
1011
|
}
|
|
897
|
-
function
|
|
898
|
-
|
|
899
|
-
const o = (
|
|
900
|
-
const
|
|
901
|
-
|
|
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
|
-
},
|
|
905
|
-
const
|
|
906
|
-
|
|
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",
|
|
909
|
-
document.removeEventListener("pointerdown", o, !0), document.removeEventListener("visibilitychange", r), document.removeEventListener("keydown",
|
|
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,
|
|
1026
|
+
}, [n, e, t]);
|
|
912
1027
|
}
|
|
913
|
-
function
|
|
914
|
-
switch (
|
|
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
|
|
928
|
-
contentId:
|
|
929
|
-
triggerElement:
|
|
1042
|
+
function bt({
|
|
1043
|
+
contentId: t,
|
|
1044
|
+
triggerElement: e,
|
|
930
1045
|
dismiss: n,
|
|
931
1046
|
children: o,
|
|
932
1047
|
className: r,
|
|
933
|
-
style:
|
|
934
|
-
side:
|
|
935
|
-
align:
|
|
936
|
-
sideOffset:
|
|
937
|
-
collisionPadding:
|
|
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 =
|
|
942
|
-
side:
|
|
943
|
-
align:
|
|
944
|
-
sideOffset:
|
|
945
|
-
collisionPadding:
|
|
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
|
-
|
|
949
|
-
const y =
|
|
950
|
-
...
|
|
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__ */
|
|
1070
|
+
return /* @__PURE__ */ p(
|
|
956
1071
|
"div",
|
|
957
1072
|
{
|
|
958
1073
|
...b,
|
|
959
1074
|
ref: u,
|
|
960
|
-
id:
|
|
1075
|
+
id: t,
|
|
961
1076
|
role: "tooltip",
|
|
962
|
-
"data-side": g?.side ??
|
|
963
|
-
"data-align":
|
|
964
|
-
"data-state":
|
|
965
|
-
"aria-hidden":
|
|
966
|
-
className:
|
|
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__ */
|
|
969
|
-
|
|
1083
|
+
children: /* @__PURE__ */ _(
|
|
1084
|
+
$.div,
|
|
970
1085
|
{
|
|
971
1086
|
className: "uk-tooltip__surface",
|
|
972
1087
|
style: { transformOrigin: y },
|
|
973
|
-
initial:
|
|
1088
|
+
initial: h ? { opacity: 0 } : { opacity: 0, scale: 0.96 },
|
|
974
1089
|
animate: { opacity: 1, scale: 1 },
|
|
975
|
-
exit:
|
|
976
|
-
transition:
|
|
1090
|
+
exit: h ? { opacity: 0 } : { opacity: 0, scale: 0.96 },
|
|
1091
|
+
transition: h ? K : ye,
|
|
977
1092
|
children: [
|
|
978
|
-
/* @__PURE__ */
|
|
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
|
|
996
|
-
const
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
) &&
|
|
1001
|
-
return !o || !
|
|
1002
|
-
/* @__PURE__ */
|
|
1003
|
-
|
|
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:
|
|
1006
|
-
triggerElement:
|
|
1007
|
-
dismiss:
|
|
1008
|
-
...
|
|
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
|
|
1130
|
+
const ze = U(
|
|
1016
1131
|
null
|
|
1017
1132
|
);
|
|
1018
|
-
function
|
|
1019
|
-
const
|
|
1020
|
-
if (!
|
|
1021
|
-
throw new Error(`<${
|
|
1022
|
-
return
|
|
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
|
|
1025
|
-
activeValue:
|
|
1026
|
-
content:
|
|
1139
|
+
function Tt({
|
|
1140
|
+
activeValue: t,
|
|
1141
|
+
content: e,
|
|
1027
1142
|
contentClassName: n,
|
|
1028
1143
|
contentId: o,
|
|
1029
1144
|
dismiss: r,
|
|
1030
|
-
triggerElement:
|
|
1031
|
-
side:
|
|
1032
|
-
align:
|
|
1033
|
-
sideOffset:
|
|
1034
|
-
collisionPadding:
|
|
1145
|
+
triggerElement: s,
|
|
1146
|
+
side: i,
|
|
1147
|
+
align: c,
|
|
1148
|
+
sideOffset: l,
|
|
1149
|
+
collisionPadding: a,
|
|
1035
1150
|
avoidCollisions: m
|
|
1036
1151
|
}) {
|
|
1037
|
-
const b =
|
|
1038
|
-
side:
|
|
1039
|
-
align:
|
|
1040
|
-
sideOffset:
|
|
1041
|
-
collisionPadding:
|
|
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
|
-
|
|
1159
|
+
Ve(s, b, r);
|
|
1045
1160
|
const g = {
|
|
1046
|
-
left:
|
|
1047
|
-
top:
|
|
1048
|
-
transformOrigin:
|
|
1049
|
-
visibility:
|
|
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__ */
|
|
1052
|
-
|
|
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:
|
|
1059
|
-
"data-side":
|
|
1060
|
-
"data-align":
|
|
1061
|
-
"data-state":
|
|
1062
|
-
"aria-hidden":
|
|
1063
|
-
className:
|
|
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 ? { ...
|
|
1188
|
+
transition: u ? { ...K, layout: { duration: 0 } } : Qe,
|
|
1074
1189
|
children: [
|
|
1075
|
-
/* @__PURE__ */
|
|
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": `${
|
|
1196
|
+
"--uk-tooltip-arrow-offset": `${f?.arrowOffset ?? 0}px`
|
|
1082
1197
|
}
|
|
1083
1198
|
}
|
|
1084
1199
|
),
|
|
1085
|
-
/* @__PURE__ */
|
|
1086
|
-
|
|
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 ?
|
|
1092
|
-
children:
|
|
1206
|
+
transition: u ? K : ye,
|
|
1207
|
+
children: e
|
|
1093
1208
|
},
|
|
1094
|
-
|
|
1209
|
+
t
|
|
1095
1210
|
)
|
|
1096
1211
|
]
|
|
1097
1212
|
}
|
|
1098
1213
|
);
|
|
1099
1214
|
}
|
|
1100
|
-
function
|
|
1101
|
-
children:
|
|
1102
|
-
side:
|
|
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:
|
|
1107
|
-
delayDuration:
|
|
1108
|
-
closeDelay:
|
|
1109
|
-
contentClassName:
|
|
1221
|
+
avoidCollisions: s = !0,
|
|
1222
|
+
delayDuration: i = 180,
|
|
1223
|
+
closeDelay: c = 80,
|
|
1224
|
+
contentClassName: l
|
|
1110
1225
|
}) {
|
|
1111
|
-
const
|
|
1226
|
+
const a = A(), [m, b] = L(
|
|
1112
1227
|
() => /* @__PURE__ */ new Map()
|
|
1113
|
-
), [u,
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
),
|
|
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
|
-
}, []),
|
|
1234
|
+
}, []), v = F(() => {
|
|
1120
1235
|
T.current !== null && (clearTimeout(T.current), T.current = null);
|
|
1121
|
-
}, []),
|
|
1122
|
-
if (
|
|
1123
|
-
if (M ||
|
|
1124
|
-
|
|
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,
|
|
1129
|
-
},
|
|
1243
|
+
y.current = null, h(!0);
|
|
1244
|
+
}, i);
|
|
1130
1245
|
}
|
|
1131
|
-
}),
|
|
1132
|
-
if (
|
|
1133
|
-
if (
|
|
1134
|
-
|
|
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,
|
|
1139
|
-
},
|
|
1253
|
+
T.current = null, h(!1);
|
|
1254
|
+
}, c);
|
|
1140
1255
|
}
|
|
1141
|
-
}),
|
|
1142
|
-
|
|
1143
|
-
}),
|
|
1144
|
-
(
|
|
1145
|
-
b((
|
|
1146
|
-
const
|
|
1147
|
-
if (
|
|
1148
|
-
return
|
|
1149
|
-
const
|
|
1150
|
-
return
|
|
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
|
-
),
|
|
1268
|
+
), k = R((B) => {
|
|
1154
1269
|
b((M) => {
|
|
1155
|
-
if (!M.has(
|
|
1270
|
+
if (!M.has(B))
|
|
1156
1271
|
return M;
|
|
1157
|
-
const
|
|
1158
|
-
return
|
|
1272
|
+
const G = new Map(M);
|
|
1273
|
+
return G.delete(B), G;
|
|
1159
1274
|
});
|
|
1160
1275
|
});
|
|
1161
|
-
|
|
1276
|
+
O(
|
|
1162
1277
|
() => () => {
|
|
1163
|
-
|
|
1278
|
+
d(), v();
|
|
1164
1279
|
},
|
|
1165
|
-
[
|
|
1280
|
+
[v, d]
|
|
1166
1281
|
);
|
|
1167
|
-
const
|
|
1282
|
+
const Ke = j(
|
|
1168
1283
|
() => ({
|
|
1169
1284
|
open: u,
|
|
1170
|
-
activeValue:
|
|
1171
|
-
contentId:
|
|
1172
|
-
activate:
|
|
1173
|
-
requestClose:
|
|
1174
|
-
dismiss:
|
|
1175
|
-
register:
|
|
1176
|
-
unregister:
|
|
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
|
-
|
|
1180
|
-
|
|
1181
|
-
|
|
1182
|
-
|
|
1294
|
+
x,
|
|
1295
|
+
f,
|
|
1296
|
+
a,
|
|
1297
|
+
S,
|
|
1183
1298
|
u,
|
|
1184
|
-
|
|
1185
|
-
|
|
1186
|
-
|
|
1299
|
+
N,
|
|
1300
|
+
C,
|
|
1301
|
+
k
|
|
1187
1302
|
]
|
|
1188
|
-
),
|
|
1189
|
-
return /* @__PURE__ */
|
|
1190
|
-
|
|
1191
|
-
|
|
1192
|
-
/* @__PURE__ */
|
|
1193
|
-
|
|
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:
|
|
1196
|
-
content:
|
|
1197
|
-
contentClassName:
|
|
1198
|
-
contentId:
|
|
1199
|
-
dismiss:
|
|
1200
|
-
triggerElement:
|
|
1201
|
-
side:
|
|
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:
|
|
1320
|
+
avoidCollisions: s
|
|
1206
1321
|
},
|
|
1207
1322
|
"uk-tooltip-group"
|
|
1208
1323
|
) : null }) }),
|
|
1209
|
-
|
|
1324
|
+
le
|
|
1210
1325
|
) : null
|
|
1211
1326
|
] });
|
|
1212
1327
|
}
|
|
1213
|
-
function
|
|
1214
|
-
value:
|
|
1215
|
-
content:
|
|
1328
|
+
function wt({
|
|
1329
|
+
value: t,
|
|
1330
|
+
content: e,
|
|
1216
1331
|
children: n
|
|
1217
1332
|
}) {
|
|
1218
|
-
const o =
|
|
1333
|
+
const o = yt("Tooltip.Item"), { register: r, unregister: s } = o, [i, c] = L(
|
|
1219
1334
|
null
|
|
1220
1335
|
);
|
|
1221
|
-
if (!
|
|
1336
|
+
if (!W(n))
|
|
1222
1337
|
throw new Error("<Tooltip.Item> expects a single valid React element");
|
|
1223
|
-
const
|
|
1224
|
-
(
|
|
1225
|
-
|
|
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,
|
|
1342
|
+
[m, c]
|
|
1228
1343
|
);
|
|
1229
|
-
return
|
|
1230
|
-
if (
|
|
1231
|
-
return r(
|
|
1232
|
-
}, [
|
|
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 ?
|
|
1235
|
-
onPointerEnter:
|
|
1236
|
-
o.activate(
|
|
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:
|
|
1239
|
-
|
|
1353
|
+
onPointerLeave: P(u, (w) => {
|
|
1354
|
+
w.pointerType !== "touch" && o.requestClose();
|
|
1240
1355
|
}),
|
|
1241
|
-
onFocus:
|
|
1242
|
-
o.activate(
|
|
1356
|
+
onFocus: P(h, () => {
|
|
1357
|
+
o.activate(t);
|
|
1243
1358
|
}),
|
|
1244
|
-
onBlur:
|
|
1359
|
+
onBlur: P(f, () => {
|
|
1245
1360
|
o.requestClose();
|
|
1246
1361
|
}),
|
|
1247
|
-
onKeyDown:
|
|
1248
|
-
|
|
1362
|
+
onKeyDown: P(g, (w) => {
|
|
1363
|
+
w.key === "Escape" && y && (w.preventDefault(), w.stopPropagation(), o.dismiss());
|
|
1249
1364
|
})
|
|
1250
1365
|
});
|
|
1251
1366
|
}
|
|
1252
|
-
const
|
|
1253
|
-
Root:
|
|
1254
|
-
Trigger:
|
|
1255
|
-
Content:
|
|
1256
|
-
Group:
|
|
1257
|
-
Item:
|
|
1367
|
+
const Lt = {
|
|
1368
|
+
Root: pt,
|
|
1369
|
+
Trigger: ft,
|
|
1370
|
+
Content: gt,
|
|
1371
|
+
Group: vt,
|
|
1372
|
+
Item: wt
|
|
1258
1373
|
};
|
|
1259
1374
|
export {
|
|
1260
|
-
|
|
1261
|
-
|
|
1262
|
-
|
|
1263
|
-
|
|
1264
|
-
|
|
1265
|
-
|
|
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
|