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