@pismo/marola 0.0.1-alpha.4 → 0.0.1-alpha.6
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 +17 -5
- package/dist/{Button-C3Qm852g.js → Button-W6tM-_IT.js} +6 -5
- package/dist/Dialog.module-CGVM5V_D.js +15 -0
- package/dist/{ListContext-D6-YwtZn.js → ListContext-Dj2Va7Iv.js} +2 -2
- package/dist/Portal-P3fPvS3-.js +19695 -0
- package/dist/{Tabs.module-_kSbSyth.js → Tabs.module-BA-PC7fA.js} +16 -16
- package/dist/_commonjsHelpers-CT_km90n.js +30 -0
- package/dist/assets/Advice.css +1 -0
- package/dist/assets/Button.css +1 -0
- package/dist/assets/Checkbox.css +1 -0
- package/dist/assets/Dialog.css +1 -1
- package/dist/assets/IconButton.css +1 -0
- package/dist/assets/LoadingSpinner.css +1 -1
- package/dist/assets/PageHeader.css +1 -0
- package/dist/assets/Pagination.css +1 -0
- package/dist/assets/Skeleton.css +1 -0
- package/dist/assets/SortTooltip.css +1 -0
- package/dist/assets/Stepper.css +1 -0
- package/dist/assets/Table.css +1 -0
- package/dist/assets/Tabs.css +1 -1
- package/dist/assets/Tooltip.css +1 -0
- package/dist/assets/Typography.css +1 -1
- package/dist/assets/global.css +1 -0
- package/dist/components/Advice/Advice.d.ts +13 -0
- package/dist/components/Advice/Advice.js +25 -0
- package/dist/components/Button/Button.d.ts +21 -0
- package/dist/components/Button/Button.js +70 -0
- package/dist/components/Checkbox/Checkbox.d.ts +17 -0
- package/dist/components/Checkbox/Checkbox.js +48 -0
- package/dist/components/Dialog/Actions.js +1 -1
- package/dist/components/Dialog/Backdrop.d.ts +1 -1
- package/dist/components/Dialog/Backdrop.js +2 -9
- package/dist/components/Dialog/CloseIconButton.js +12 -124
- package/dist/components/Dialog/Dialog.d.ts +2 -2
- package/dist/components/Dialog/Dialog.js +418 -20077
- package/dist/components/Dialog/Title.js +22 -7
- package/dist/components/Icon/Icon.d.ts +7 -0
- package/dist/components/Icon/Icon.js +9 -0
- package/dist/components/IconButton/IconButton.d.ts +22 -0
- package/dist/components/IconButton/IconButton.js +68 -0
- package/dist/components/LoadingSpinner/LoadingSpinner.js +12 -13
- package/dist/components/PageHeader/PageHeader.d.ts +36 -0
- package/dist/components/PageHeader/PageHeader.js +51 -0
- package/dist/components/PageHeader/PageHeader.stories.d.ts +43 -0
- package/dist/components/PageHeader/PageHeader.stories.js +49 -0
- package/dist/components/Pagination/Pagination.d.ts +36 -0
- package/dist/components/Pagination/Pagination.js +219 -0
- package/dist/components/Skeleton/Skeleton.d.ts +18 -0
- package/dist/components/Skeleton/Skeleton.js +26 -0
- package/dist/components/SortTooltip/SortTooltip.d.ts +26 -0
- package/dist/components/SortTooltip/SortTooltip.js +67 -0
- package/dist/components/Stepper/Stepper.d.ts +16 -0
- package/dist/components/Stepper/Stepper.js +33 -0
- package/dist/components/Table/Table.d.ts +39 -0
- package/dist/components/Table/Table.js +122 -0
- package/dist/components/Table/TableContext.d.ts +19 -0
- package/dist/components/Table/TableContext.js +21 -0
- package/dist/components/Tabs/Tab.d.ts +1 -1
- package/dist/components/Tabs/Tab.js +42 -37
- package/dist/components/Tabs/TabPanel.d.ts +1 -1
- package/dist/components/Tabs/TabPanel.js +20 -21
- package/dist/components/Tabs/Tabs.d.ts +1 -1
- package/dist/components/Tabs/Tabs.js +185 -214
- package/dist/components/Tooltip/Tooltip.d.ts +17 -0
- package/dist/components/Tooltip/Tooltip.js +1463 -0
- package/dist/components/Typography/Typography.d.ts +14 -5
- package/dist/components/Typography/Typography.js +76 -68
- package/dist/components/Typography/Typography.stories.d.ts +18 -0
- package/dist/components/Typography/Typography.stories.js +30 -0
- package/dist/components/Typography/typography.test.d.ts +1 -0
- package/dist/components/Typography/typography.test.js +11360 -0
- package/dist/{index-BZ1lkM_M.js → index-D2P7y2mE.js} +303 -327
- package/dist/magic-string.es-O_8lTkE3.js +738 -0
- package/dist/main.d.ts +5 -1
- package/dist/main.js +30 -21
- package/dist/objectWithoutPropertiesLoose-D7Cp0Pg_.js +26 -0
- package/dist/react-CGNQ6M5x.js +117 -0
- package/dist/test-utils/assertStyles.d.ts +1 -0
- package/dist/test-utils/assertStyles.js +11 -0
- package/dist/types/helpers.d.ts +14 -7
- package/dist/{useButton-CbmjmH5z.js → useButton-JpyBo5M4.js} +17 -16
- package/dist/{useCompoundItem-B7wfGDHQ.js → useCompoundItem-CTYi5M_E.js} +1 -1
- package/dist/useControlled-CCMYYdCM.js +31 -0
- package/dist/utils/styleStrings.d.ts +6 -0
- package/dist/utils/styleStrings.js +10 -0
- package/dist/utils/styleStrings.test.d.ts +1 -0
- package/dist/utils/styleStrings.test.js +41 -0
- package/dist/vi.Y_w82WR8-Df0JUamG.js +9860 -0
- package/package.json +47 -7
- package/dist/Dialog.module-BO0mdB7d.js +0 -15
- package/dist/assets/CallToActionButton.css +0 -1
- package/dist/assets/main.css +0 -1
- package/dist/components/CallToActionButton/CallToActionButton.d.ts +0 -21
- package/dist/components/CallToActionButton/CallToActionButton.js +0 -57
- package/src/playground/Playground.tsx +0 -20
|
@@ -0,0 +1,1463 @@
|
|
|
1
|
+
import '../../assets/Tooltip.css';
|
|
2
|
+
import { jsx as S } from "react/jsx-runtime";
|
|
3
|
+
import * as x from "react";
|
|
4
|
+
import { useLayoutEffect as Qt, useEffect as Lt, useRef as Zt, useState as vt } from "react";
|
|
5
|
+
import { _ as kt, a as et } from "../../objectWithoutPropertiesLoose-D7Cp0Pg_.js";
|
|
6
|
+
import { d as Mt, P as g, g as te, a as ee, u as ne, c as oe, b as ie } from "../../index-D2P7y2mE.js";
|
|
7
|
+
import { u as re, o as pt, e as se, a as ce, r as le, P as ae, H as bt } from "../../Portal-P3fPvS3-.js";
|
|
8
|
+
import { u as fe } from "../../useEnhancedEffect-CJGo-L3B.js";
|
|
9
|
+
import { c as ue } from "../../clsx-DB4S2d7J.js";
|
|
10
|
+
function Et(t) {
|
|
11
|
+
return t.substring(2).toLowerCase();
|
|
12
|
+
}
|
|
13
|
+
function de(t, e) {
|
|
14
|
+
return e.documentElement.clientWidth < t.clientX || e.documentElement.clientHeight < t.clientY;
|
|
15
|
+
}
|
|
16
|
+
function ot(t) {
|
|
17
|
+
const {
|
|
18
|
+
children: e,
|
|
19
|
+
disableReactTree: o = !1,
|
|
20
|
+
mouseEvent: n = "onClick",
|
|
21
|
+
onClickAway: i,
|
|
22
|
+
touchEvent: r = "onTouchEnd"
|
|
23
|
+
} = t, s = x.useRef(!1), c = x.useRef(null), l = x.useRef(!1), a = x.useRef(!1);
|
|
24
|
+
x.useEffect(() => (setTimeout(() => {
|
|
25
|
+
l.current = !0;
|
|
26
|
+
}, 0), () => {
|
|
27
|
+
l.current = !1;
|
|
28
|
+
}), []);
|
|
29
|
+
const u = Mt(
|
|
30
|
+
// @ts-expect-error TODO upstream fix
|
|
31
|
+
e.ref,
|
|
32
|
+
c
|
|
33
|
+
), f = re((m) => {
|
|
34
|
+
const p = a.current;
|
|
35
|
+
a.current = !1;
|
|
36
|
+
const w = pt(c.current);
|
|
37
|
+
if (!l.current || !c.current || "clientX" in m && de(m, w))
|
|
38
|
+
return;
|
|
39
|
+
if (s.current) {
|
|
40
|
+
s.current = !1;
|
|
41
|
+
return;
|
|
42
|
+
}
|
|
43
|
+
let y;
|
|
44
|
+
m.composedPath ? y = m.composedPath().indexOf(c.current) > -1 : y = !w.documentElement.contains(
|
|
45
|
+
// @ts-expect-error returns `false` as intended when not dispatched from a Node
|
|
46
|
+
m.target
|
|
47
|
+
) || c.current.contains(
|
|
48
|
+
// @ts-expect-error returns `false` as intended when not dispatched from a Node
|
|
49
|
+
m.target
|
|
50
|
+
), !y && (o || !p) && i(m);
|
|
51
|
+
}), h = (m) => (p) => {
|
|
52
|
+
a.current = !0;
|
|
53
|
+
const w = e.props[m];
|
|
54
|
+
w && w(p);
|
|
55
|
+
}, d = {
|
|
56
|
+
ref: u
|
|
57
|
+
};
|
|
58
|
+
return r !== !1 && (d[r] = h(r)), x.useEffect(() => {
|
|
59
|
+
if (r !== !1) {
|
|
60
|
+
const m = Et(r), p = pt(c.current), w = () => {
|
|
61
|
+
s.current = !0;
|
|
62
|
+
};
|
|
63
|
+
return p.addEventListener(m, f), p.addEventListener("touchmove", w), () => {
|
|
64
|
+
p.removeEventListener(m, f), p.removeEventListener("touchmove", w);
|
|
65
|
+
};
|
|
66
|
+
}
|
|
67
|
+
}, [f, r]), n !== !1 && (d[n] = h(n)), x.useEffect(() => {
|
|
68
|
+
if (n !== !1) {
|
|
69
|
+
const m = Et(n), p = pt(c.current);
|
|
70
|
+
return p.addEventListener(m, f), () => {
|
|
71
|
+
p.removeEventListener(m, f);
|
|
72
|
+
};
|
|
73
|
+
}
|
|
74
|
+
}, [f, n]), /* @__PURE__ */ S(x.Fragment, {
|
|
75
|
+
children: /* @__PURE__ */ x.cloneElement(e, d)
|
|
76
|
+
});
|
|
77
|
+
}
|
|
78
|
+
process.env.NODE_ENV !== "production" && (ot.propTypes = {
|
|
79
|
+
// ┌────────────────────────────── Warning ──────────────────────────────┐
|
|
80
|
+
// │ These PropTypes are generated from the TypeScript type definitions. │
|
|
81
|
+
// │ To update them, edit the TypeScript types and run `pnpm proptypes`. │
|
|
82
|
+
// └─────────────────────────────────────────────────────────────────────┘
|
|
83
|
+
/**
|
|
84
|
+
* The wrapped element.
|
|
85
|
+
*/
|
|
86
|
+
children: se.isRequired,
|
|
87
|
+
/**
|
|
88
|
+
* If `true`, the React tree is ignored and only the DOM tree is considered.
|
|
89
|
+
* This prop changes how portaled elements are handled.
|
|
90
|
+
* @default false
|
|
91
|
+
*/
|
|
92
|
+
disableReactTree: g.bool,
|
|
93
|
+
/**
|
|
94
|
+
* The mouse event to listen to. You can disable the listener by providing `false`.
|
|
95
|
+
* @default 'onClick'
|
|
96
|
+
*/
|
|
97
|
+
mouseEvent: g.oneOf(["onClick", "onMouseDown", "onMouseUp", "onPointerDown", "onPointerUp", !1]),
|
|
98
|
+
/**
|
|
99
|
+
* Callback fired when a "click away" event is detected.
|
|
100
|
+
*/
|
|
101
|
+
onClickAway: g.func.isRequired,
|
|
102
|
+
/**
|
|
103
|
+
* The touch event to listen to. You can disable the listener by providing `false`.
|
|
104
|
+
* @default 'onTouchEnd'
|
|
105
|
+
*/
|
|
106
|
+
touchEvent: g.oneOf(["onTouchEnd", "onTouchStart", !1])
|
|
107
|
+
});
|
|
108
|
+
process.env.NODE_ENV !== "production" && (ot.propTypes = ce(ot.propTypes));
|
|
109
|
+
const it = Math.min, I = Math.max, rt = Math.round, tt = Math.floor, H = (t) => ({
|
|
110
|
+
x: t,
|
|
111
|
+
y: t
|
|
112
|
+
}), me = {
|
|
113
|
+
left: "right",
|
|
114
|
+
right: "left",
|
|
115
|
+
bottom: "top",
|
|
116
|
+
top: "bottom"
|
|
117
|
+
}, pe = {
|
|
118
|
+
start: "end",
|
|
119
|
+
end: "start"
|
|
120
|
+
};
|
|
121
|
+
function Rt(t, e, o) {
|
|
122
|
+
return I(t, it(e, o));
|
|
123
|
+
}
|
|
124
|
+
function at(t, e) {
|
|
125
|
+
return typeof t == "function" ? t(e) : t;
|
|
126
|
+
}
|
|
127
|
+
function U(t) {
|
|
128
|
+
return t.split("-")[0];
|
|
129
|
+
}
|
|
130
|
+
function ft(t) {
|
|
131
|
+
return t.split("-")[1];
|
|
132
|
+
}
|
|
133
|
+
function Dt(t) {
|
|
134
|
+
return t === "x" ? "y" : "x";
|
|
135
|
+
}
|
|
136
|
+
function Ft(t) {
|
|
137
|
+
return t === "y" ? "height" : "width";
|
|
138
|
+
}
|
|
139
|
+
function ut(t) {
|
|
140
|
+
return ["top", "bottom"].includes(U(t)) ? "y" : "x";
|
|
141
|
+
}
|
|
142
|
+
function Vt(t) {
|
|
143
|
+
return Dt(ut(t));
|
|
144
|
+
}
|
|
145
|
+
function he(t, e, o) {
|
|
146
|
+
o === void 0 && (o = !1);
|
|
147
|
+
const n = ft(t), i = Vt(t), r = Ft(i);
|
|
148
|
+
let s = i === "x" ? n === (o ? "end" : "start") ? "right" : "left" : n === "start" ? "bottom" : "top";
|
|
149
|
+
return e.reference[r] > e.floating[r] && (s = st(s)), [s, st(s)];
|
|
150
|
+
}
|
|
151
|
+
function ge(t) {
|
|
152
|
+
const e = st(t);
|
|
153
|
+
return [ht(t), e, ht(e)];
|
|
154
|
+
}
|
|
155
|
+
function ht(t) {
|
|
156
|
+
return t.replace(/start|end/g, (e) => pe[e]);
|
|
157
|
+
}
|
|
158
|
+
function xe(t, e, o) {
|
|
159
|
+
const n = ["left", "right"], i = ["right", "left"], r = ["top", "bottom"], s = ["bottom", "top"];
|
|
160
|
+
switch (t) {
|
|
161
|
+
case "top":
|
|
162
|
+
case "bottom":
|
|
163
|
+
return o ? e ? i : n : e ? n : i;
|
|
164
|
+
case "left":
|
|
165
|
+
case "right":
|
|
166
|
+
return e ? r : s;
|
|
167
|
+
default:
|
|
168
|
+
return [];
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
function ye(t, e, o, n) {
|
|
172
|
+
const i = ft(t);
|
|
173
|
+
let r = xe(U(t), o === "start", n);
|
|
174
|
+
return i && (r = r.map((s) => s + "-" + i), e && (r = r.concat(r.map(ht)))), r;
|
|
175
|
+
}
|
|
176
|
+
function st(t) {
|
|
177
|
+
return t.replace(/left|right|bottom|top/g, (e) => me[e]);
|
|
178
|
+
}
|
|
179
|
+
function we(t) {
|
|
180
|
+
return {
|
|
181
|
+
top: 0,
|
|
182
|
+
right: 0,
|
|
183
|
+
bottom: 0,
|
|
184
|
+
left: 0,
|
|
185
|
+
...t
|
|
186
|
+
};
|
|
187
|
+
}
|
|
188
|
+
function ve(t) {
|
|
189
|
+
return typeof t != "number" ? we(t) : {
|
|
190
|
+
top: t,
|
|
191
|
+
right: t,
|
|
192
|
+
bottom: t,
|
|
193
|
+
left: t
|
|
194
|
+
};
|
|
195
|
+
}
|
|
196
|
+
function ct(t) {
|
|
197
|
+
const {
|
|
198
|
+
x: e,
|
|
199
|
+
y: o,
|
|
200
|
+
width: n,
|
|
201
|
+
height: i
|
|
202
|
+
} = t;
|
|
203
|
+
return {
|
|
204
|
+
width: n,
|
|
205
|
+
height: i,
|
|
206
|
+
top: o,
|
|
207
|
+
left: e,
|
|
208
|
+
right: e + n,
|
|
209
|
+
bottom: o + i,
|
|
210
|
+
x: e,
|
|
211
|
+
y: o
|
|
212
|
+
};
|
|
213
|
+
}
|
|
214
|
+
function Ct(t, e, o) {
|
|
215
|
+
let {
|
|
216
|
+
reference: n,
|
|
217
|
+
floating: i
|
|
218
|
+
} = t;
|
|
219
|
+
const r = ut(e), s = Vt(e), c = Ft(s), l = U(e), a = r === "y", u = n.x + n.width / 2 - i.width / 2, f = n.y + n.height / 2 - i.height / 2, h = n[c] / 2 - i[c] / 2;
|
|
220
|
+
let d;
|
|
221
|
+
switch (l) {
|
|
222
|
+
case "top":
|
|
223
|
+
d = {
|
|
224
|
+
x: u,
|
|
225
|
+
y: n.y - i.height
|
|
226
|
+
};
|
|
227
|
+
break;
|
|
228
|
+
case "bottom":
|
|
229
|
+
d = {
|
|
230
|
+
x: u,
|
|
231
|
+
y: n.y + n.height
|
|
232
|
+
};
|
|
233
|
+
break;
|
|
234
|
+
case "right":
|
|
235
|
+
d = {
|
|
236
|
+
x: n.x + n.width,
|
|
237
|
+
y: f
|
|
238
|
+
};
|
|
239
|
+
break;
|
|
240
|
+
case "left":
|
|
241
|
+
d = {
|
|
242
|
+
x: n.x - i.width,
|
|
243
|
+
y: f
|
|
244
|
+
};
|
|
245
|
+
break;
|
|
246
|
+
default:
|
|
247
|
+
d = {
|
|
248
|
+
x: n.x,
|
|
249
|
+
y: n.y
|
|
250
|
+
};
|
|
251
|
+
}
|
|
252
|
+
switch (ft(e)) {
|
|
253
|
+
case "start":
|
|
254
|
+
d[s] -= h * (o && a ? -1 : 1);
|
|
255
|
+
break;
|
|
256
|
+
case "end":
|
|
257
|
+
d[s] += h * (o && a ? -1 : 1);
|
|
258
|
+
break;
|
|
259
|
+
}
|
|
260
|
+
return d;
|
|
261
|
+
}
|
|
262
|
+
const be = async (t, e, o) => {
|
|
263
|
+
const {
|
|
264
|
+
placement: n = "bottom",
|
|
265
|
+
strategy: i = "absolute",
|
|
266
|
+
middleware: r = [],
|
|
267
|
+
platform: s
|
|
268
|
+
} = o, c = r.filter(Boolean), l = await (s.isRTL == null ? void 0 : s.isRTL(e));
|
|
269
|
+
let a = await s.getElementRects({
|
|
270
|
+
reference: t,
|
|
271
|
+
floating: e,
|
|
272
|
+
strategy: i
|
|
273
|
+
}), {
|
|
274
|
+
x: u,
|
|
275
|
+
y: f
|
|
276
|
+
} = Ct(a, n, l), h = n, d = {}, m = 0;
|
|
277
|
+
for (let p = 0; p < c.length; p++) {
|
|
278
|
+
const {
|
|
279
|
+
name: w,
|
|
280
|
+
fn: y
|
|
281
|
+
} = c[p], {
|
|
282
|
+
x: v,
|
|
283
|
+
y: b,
|
|
284
|
+
data: E,
|
|
285
|
+
reset: R
|
|
286
|
+
} = await y({
|
|
287
|
+
x: u,
|
|
288
|
+
y: f,
|
|
289
|
+
initialPlacement: n,
|
|
290
|
+
placement: h,
|
|
291
|
+
strategy: i,
|
|
292
|
+
middlewareData: d,
|
|
293
|
+
rects: a,
|
|
294
|
+
platform: s,
|
|
295
|
+
elements: {
|
|
296
|
+
reference: t,
|
|
297
|
+
floating: e
|
|
298
|
+
}
|
|
299
|
+
});
|
|
300
|
+
u = v ?? u, f = b ?? f, d = {
|
|
301
|
+
...d,
|
|
302
|
+
[w]: {
|
|
303
|
+
...d[w],
|
|
304
|
+
...E
|
|
305
|
+
}
|
|
306
|
+
}, R && m <= 50 && (m++, typeof R == "object" && (R.placement && (h = R.placement), R.rects && (a = R.rects === !0 ? await s.getElementRects({
|
|
307
|
+
reference: t,
|
|
308
|
+
floating: e,
|
|
309
|
+
strategy: i
|
|
310
|
+
}) : R.rects), {
|
|
311
|
+
x: u,
|
|
312
|
+
y: f
|
|
313
|
+
} = Ct(a, h, l)), p = -1);
|
|
314
|
+
}
|
|
315
|
+
return {
|
|
316
|
+
x: u,
|
|
317
|
+
y: f,
|
|
318
|
+
placement: h,
|
|
319
|
+
strategy: i,
|
|
320
|
+
middlewareData: d
|
|
321
|
+
};
|
|
322
|
+
};
|
|
323
|
+
async function jt(t, e) {
|
|
324
|
+
var o;
|
|
325
|
+
e === void 0 && (e = {});
|
|
326
|
+
const {
|
|
327
|
+
x: n,
|
|
328
|
+
y: i,
|
|
329
|
+
platform: r,
|
|
330
|
+
rects: s,
|
|
331
|
+
elements: c,
|
|
332
|
+
strategy: l
|
|
333
|
+
} = t, {
|
|
334
|
+
boundary: a = "clippingAncestors",
|
|
335
|
+
rootBoundary: u = "viewport",
|
|
336
|
+
elementContext: f = "floating",
|
|
337
|
+
altBoundary: h = !1,
|
|
338
|
+
padding: d = 0
|
|
339
|
+
} = at(e, t), m = ve(d), w = c[h ? f === "floating" ? "reference" : "floating" : f], y = ct(await r.getClippingRect({
|
|
340
|
+
element: (o = await (r.isElement == null ? void 0 : r.isElement(w))) == null || o ? w : w.contextElement || await (r.getDocumentElement == null ? void 0 : r.getDocumentElement(c.floating)),
|
|
341
|
+
boundary: a,
|
|
342
|
+
rootBoundary: u,
|
|
343
|
+
strategy: l
|
|
344
|
+
})), v = f === "floating" ? {
|
|
345
|
+
x: n,
|
|
346
|
+
y: i,
|
|
347
|
+
width: s.floating.width,
|
|
348
|
+
height: s.floating.height
|
|
349
|
+
} : s.reference, b = await (r.getOffsetParent == null ? void 0 : r.getOffsetParent(c.floating)), E = await (r.isElement == null ? void 0 : r.isElement(b)) ? await (r.getScale == null ? void 0 : r.getScale(b)) || {
|
|
350
|
+
x: 1,
|
|
351
|
+
y: 1
|
|
352
|
+
} : {
|
|
353
|
+
x: 1,
|
|
354
|
+
y: 1
|
|
355
|
+
}, R = ct(r.convertOffsetParentRelativeRectToViewportRelativeRect ? await r.convertOffsetParentRelativeRectToViewportRelativeRect({
|
|
356
|
+
elements: c,
|
|
357
|
+
rect: v,
|
|
358
|
+
offsetParent: b,
|
|
359
|
+
strategy: l
|
|
360
|
+
}) : v);
|
|
361
|
+
return {
|
|
362
|
+
top: (y.top - R.top + m.top) / E.y,
|
|
363
|
+
bottom: (R.bottom - y.bottom + m.bottom) / E.y,
|
|
364
|
+
left: (y.left - R.left + m.left) / E.x,
|
|
365
|
+
right: (R.right - y.right + m.right) / E.x
|
|
366
|
+
};
|
|
367
|
+
}
|
|
368
|
+
const Ee = function(t) {
|
|
369
|
+
return t === void 0 && (t = {}), {
|
|
370
|
+
name: "flip",
|
|
371
|
+
options: t,
|
|
372
|
+
async fn(e) {
|
|
373
|
+
var o, n;
|
|
374
|
+
const {
|
|
375
|
+
placement: i,
|
|
376
|
+
middlewareData: r,
|
|
377
|
+
rects: s,
|
|
378
|
+
initialPlacement: c,
|
|
379
|
+
platform: l,
|
|
380
|
+
elements: a
|
|
381
|
+
} = e, {
|
|
382
|
+
mainAxis: u = !0,
|
|
383
|
+
crossAxis: f = !0,
|
|
384
|
+
fallbackPlacements: h,
|
|
385
|
+
fallbackStrategy: d = "bestFit",
|
|
386
|
+
fallbackAxisSideDirection: m = "none",
|
|
387
|
+
flipAlignment: p = !0,
|
|
388
|
+
...w
|
|
389
|
+
} = at(t, e);
|
|
390
|
+
if ((o = r.arrow) != null && o.alignmentOffset)
|
|
391
|
+
return {};
|
|
392
|
+
const y = U(i), v = U(c) === c, b = await (l.isRTL == null ? void 0 : l.isRTL(a.floating)), E = h || (v || !p ? [st(c)] : ge(c));
|
|
393
|
+
!h && m !== "none" && E.push(...ye(c, p, m, b));
|
|
394
|
+
const R = [c, ...E], T = await jt(e, w), P = [];
|
|
395
|
+
let _ = ((n = r.flip) == null ? void 0 : n.overflows) || [];
|
|
396
|
+
if (u && P.push(T[y]), f) {
|
|
397
|
+
const A = he(i, s, b);
|
|
398
|
+
P.push(T[A[0]], T[A[1]]);
|
|
399
|
+
}
|
|
400
|
+
if (_ = [..._, {
|
|
401
|
+
placement: i,
|
|
402
|
+
overflows: P
|
|
403
|
+
}], !P.every((A) => A <= 0)) {
|
|
404
|
+
var z, j;
|
|
405
|
+
const A = (((z = r.flip) == null ? void 0 : z.index) || 0) + 1, B = R[A];
|
|
406
|
+
if (B)
|
|
407
|
+
return {
|
|
408
|
+
data: {
|
|
409
|
+
index: A,
|
|
410
|
+
overflows: _
|
|
411
|
+
},
|
|
412
|
+
reset: {
|
|
413
|
+
placement: B
|
|
414
|
+
}
|
|
415
|
+
};
|
|
416
|
+
let k = (j = _.filter((O) => O.overflows[0] <= 0).sort((O, M) => O.overflows[1] - M.overflows[1])[0]) == null ? void 0 : j.placement;
|
|
417
|
+
if (!k)
|
|
418
|
+
switch (d) {
|
|
419
|
+
case "bestFit": {
|
|
420
|
+
var W;
|
|
421
|
+
const O = (W = _.map((M) => [M.placement, M.overflows.filter((C) => C > 0).reduce((C, Y) => C + Y, 0)]).sort((M, C) => M[1] - C[1])[0]) == null ? void 0 : W[0];
|
|
422
|
+
O && (k = O);
|
|
423
|
+
break;
|
|
424
|
+
}
|
|
425
|
+
case "initialPlacement":
|
|
426
|
+
k = c;
|
|
427
|
+
break;
|
|
428
|
+
}
|
|
429
|
+
if (i !== k)
|
|
430
|
+
return {
|
|
431
|
+
reset: {
|
|
432
|
+
placement: k
|
|
433
|
+
}
|
|
434
|
+
};
|
|
435
|
+
}
|
|
436
|
+
return {};
|
|
437
|
+
}
|
|
438
|
+
};
|
|
439
|
+
};
|
|
440
|
+
async function Re(t, e) {
|
|
441
|
+
const {
|
|
442
|
+
placement: o,
|
|
443
|
+
platform: n,
|
|
444
|
+
elements: i
|
|
445
|
+
} = t, r = await (n.isRTL == null ? void 0 : n.isRTL(i.floating)), s = U(o), c = ft(o), l = ut(o) === "y", a = ["left", "top"].includes(s) ? -1 : 1, u = r && l ? -1 : 1, f = at(e, t);
|
|
446
|
+
let {
|
|
447
|
+
mainAxis: h,
|
|
448
|
+
crossAxis: d,
|
|
449
|
+
alignmentAxis: m
|
|
450
|
+
} = typeof f == "number" ? {
|
|
451
|
+
mainAxis: f,
|
|
452
|
+
crossAxis: 0,
|
|
453
|
+
alignmentAxis: null
|
|
454
|
+
} : {
|
|
455
|
+
mainAxis: 0,
|
|
456
|
+
crossAxis: 0,
|
|
457
|
+
alignmentAxis: null,
|
|
458
|
+
...f
|
|
459
|
+
};
|
|
460
|
+
return c && typeof m == "number" && (d = c === "end" ? m * -1 : m), l ? {
|
|
461
|
+
x: d * u,
|
|
462
|
+
y: h * a
|
|
463
|
+
} : {
|
|
464
|
+
x: h * a,
|
|
465
|
+
y: d * u
|
|
466
|
+
};
|
|
467
|
+
}
|
|
468
|
+
const Ce = function(t) {
|
|
469
|
+
return t === void 0 && (t = 0), {
|
|
470
|
+
name: "offset",
|
|
471
|
+
options: t,
|
|
472
|
+
async fn(e) {
|
|
473
|
+
var o, n;
|
|
474
|
+
const {
|
|
475
|
+
x: i,
|
|
476
|
+
y: r,
|
|
477
|
+
placement: s,
|
|
478
|
+
middlewareData: c
|
|
479
|
+
} = e, l = await Re(e, t);
|
|
480
|
+
return s === ((o = c.offset) == null ? void 0 : o.placement) && (n = c.arrow) != null && n.alignmentOffset ? {} : {
|
|
481
|
+
x: i + l.x,
|
|
482
|
+
y: r + l.y,
|
|
483
|
+
data: {
|
|
484
|
+
...l,
|
|
485
|
+
placement: s
|
|
486
|
+
}
|
|
487
|
+
};
|
|
488
|
+
}
|
|
489
|
+
};
|
|
490
|
+
}, Te = function(t) {
|
|
491
|
+
return t === void 0 && (t = {}), {
|
|
492
|
+
name: "shift",
|
|
493
|
+
options: t,
|
|
494
|
+
async fn(e) {
|
|
495
|
+
const {
|
|
496
|
+
x: o,
|
|
497
|
+
y: n,
|
|
498
|
+
placement: i
|
|
499
|
+
} = e, {
|
|
500
|
+
mainAxis: r = !0,
|
|
501
|
+
crossAxis: s = !1,
|
|
502
|
+
limiter: c = {
|
|
503
|
+
fn: (w) => {
|
|
504
|
+
let {
|
|
505
|
+
x: y,
|
|
506
|
+
y: v
|
|
507
|
+
} = w;
|
|
508
|
+
return {
|
|
509
|
+
x: y,
|
|
510
|
+
y: v
|
|
511
|
+
};
|
|
512
|
+
}
|
|
513
|
+
},
|
|
514
|
+
...l
|
|
515
|
+
} = at(t, e), a = {
|
|
516
|
+
x: o,
|
|
517
|
+
y: n
|
|
518
|
+
}, u = await jt(e, l), f = ut(U(i)), h = Dt(f);
|
|
519
|
+
let d = a[h], m = a[f];
|
|
520
|
+
if (r) {
|
|
521
|
+
const w = h === "y" ? "top" : "left", y = h === "y" ? "bottom" : "right", v = d + u[w], b = d - u[y];
|
|
522
|
+
d = Rt(v, d, b);
|
|
523
|
+
}
|
|
524
|
+
if (s) {
|
|
525
|
+
const w = f === "y" ? "top" : "left", y = f === "y" ? "bottom" : "right", v = m + u[w], b = m - u[y];
|
|
526
|
+
m = Rt(v, m, b);
|
|
527
|
+
}
|
|
528
|
+
const p = c.fn({
|
|
529
|
+
...e,
|
|
530
|
+
[h]: d,
|
|
531
|
+
[f]: m
|
|
532
|
+
});
|
|
533
|
+
return {
|
|
534
|
+
...p,
|
|
535
|
+
data: {
|
|
536
|
+
x: p.x - o,
|
|
537
|
+
y: p.y - n
|
|
538
|
+
}
|
|
539
|
+
};
|
|
540
|
+
}
|
|
541
|
+
};
|
|
542
|
+
};
|
|
543
|
+
function $(t) {
|
|
544
|
+
return Wt(t) ? (t.nodeName || "").toLowerCase() : "#document";
|
|
545
|
+
}
|
|
546
|
+
function N(t) {
|
|
547
|
+
var e;
|
|
548
|
+
return (t == null || (e = t.ownerDocument) == null ? void 0 : e.defaultView) || window;
|
|
549
|
+
}
|
|
550
|
+
function V(t) {
|
|
551
|
+
var e;
|
|
552
|
+
return (e = (Wt(t) ? t.ownerDocument : t.document) || window.document) == null ? void 0 : e.documentElement;
|
|
553
|
+
}
|
|
554
|
+
function Wt(t) {
|
|
555
|
+
return t instanceof Node || t instanceof N(t).Node;
|
|
556
|
+
}
|
|
557
|
+
function F(t) {
|
|
558
|
+
return t instanceof Element || t instanceof N(t).Element;
|
|
559
|
+
}
|
|
560
|
+
function D(t) {
|
|
561
|
+
return t instanceof HTMLElement || t instanceof N(t).HTMLElement;
|
|
562
|
+
}
|
|
563
|
+
function Tt(t) {
|
|
564
|
+
return typeof ShadowRoot > "u" ? !1 : t instanceof ShadowRoot || t instanceof N(t).ShadowRoot;
|
|
565
|
+
}
|
|
566
|
+
function Z(t) {
|
|
567
|
+
const {
|
|
568
|
+
overflow: e,
|
|
569
|
+
overflowX: o,
|
|
570
|
+
overflowY: n,
|
|
571
|
+
display: i
|
|
572
|
+
} = L(t);
|
|
573
|
+
return /auto|scroll|overlay|hidden|clip/.test(e + n + o) && !["inline", "contents"].includes(i);
|
|
574
|
+
}
|
|
575
|
+
function Ae(t) {
|
|
576
|
+
return ["table", "td", "th"].includes($(t));
|
|
577
|
+
}
|
|
578
|
+
function gt(t) {
|
|
579
|
+
const e = xt(), o = L(t);
|
|
580
|
+
return o.transform !== "none" || o.perspective !== "none" || (o.containerType ? o.containerType !== "normal" : !1) || !e && (o.backdropFilter ? o.backdropFilter !== "none" : !1) || !e && (o.filter ? o.filter !== "none" : !1) || ["transform", "perspective", "filter"].some((n) => (o.willChange || "").includes(n)) || ["paint", "layout", "strict", "content"].some((n) => (o.contain || "").includes(n));
|
|
581
|
+
}
|
|
582
|
+
function Oe(t) {
|
|
583
|
+
let e = J(t);
|
|
584
|
+
for (; D(e) && !dt(e); ) {
|
|
585
|
+
if (gt(e))
|
|
586
|
+
return e;
|
|
587
|
+
e = J(e);
|
|
588
|
+
}
|
|
589
|
+
return null;
|
|
590
|
+
}
|
|
591
|
+
function xt() {
|
|
592
|
+
return typeof CSS > "u" || !CSS.supports ? !1 : CSS.supports("-webkit-backdrop-filter", "none");
|
|
593
|
+
}
|
|
594
|
+
function dt(t) {
|
|
595
|
+
return ["html", "body", "#document"].includes($(t));
|
|
596
|
+
}
|
|
597
|
+
function L(t) {
|
|
598
|
+
return N(t).getComputedStyle(t);
|
|
599
|
+
}
|
|
600
|
+
function mt(t) {
|
|
601
|
+
return F(t) ? {
|
|
602
|
+
scrollLeft: t.scrollLeft,
|
|
603
|
+
scrollTop: t.scrollTop
|
|
604
|
+
} : {
|
|
605
|
+
scrollLeft: t.pageXOffset,
|
|
606
|
+
scrollTop: t.pageYOffset
|
|
607
|
+
};
|
|
608
|
+
}
|
|
609
|
+
function J(t) {
|
|
610
|
+
if ($(t) === "html")
|
|
611
|
+
return t;
|
|
612
|
+
const e = (
|
|
613
|
+
// Step into the shadow DOM of the parent of a slotted node.
|
|
614
|
+
t.assignedSlot || // DOM Element detected.
|
|
615
|
+
t.parentNode || // ShadowRoot detected.
|
|
616
|
+
Tt(t) && t.host || // Fallback.
|
|
617
|
+
V(t)
|
|
618
|
+
);
|
|
619
|
+
return Tt(e) ? e.host : e;
|
|
620
|
+
}
|
|
621
|
+
function Bt(t) {
|
|
622
|
+
const e = J(t);
|
|
623
|
+
return dt(e) ? t.ownerDocument ? t.ownerDocument.body : t.body : D(e) && Z(e) ? e : Bt(e);
|
|
624
|
+
}
|
|
625
|
+
function Q(t, e, o) {
|
|
626
|
+
var n;
|
|
627
|
+
e === void 0 && (e = []), o === void 0 && (o = !0);
|
|
628
|
+
const i = Bt(t), r = i === ((n = t.ownerDocument) == null ? void 0 : n.body), s = N(i);
|
|
629
|
+
return r ? e.concat(s, s.visualViewport || [], Z(i) ? i : [], s.frameElement && o ? Q(s.frameElement) : []) : e.concat(i, Q(i, [], o));
|
|
630
|
+
}
|
|
631
|
+
function Ht(t) {
|
|
632
|
+
const e = L(t);
|
|
633
|
+
let o = parseFloat(e.width) || 0, n = parseFloat(e.height) || 0;
|
|
634
|
+
const i = D(t), r = i ? t.offsetWidth : o, s = i ? t.offsetHeight : n, c = rt(o) !== r || rt(n) !== s;
|
|
635
|
+
return c && (o = r, n = s), {
|
|
636
|
+
width: o,
|
|
637
|
+
height: n,
|
|
638
|
+
$: c
|
|
639
|
+
};
|
|
640
|
+
}
|
|
641
|
+
function yt(t) {
|
|
642
|
+
return F(t) ? t : t.contextElement;
|
|
643
|
+
}
|
|
644
|
+
function G(t) {
|
|
645
|
+
const e = yt(t);
|
|
646
|
+
if (!D(e))
|
|
647
|
+
return H(1);
|
|
648
|
+
const o = e.getBoundingClientRect(), {
|
|
649
|
+
width: n,
|
|
650
|
+
height: i,
|
|
651
|
+
$: r
|
|
652
|
+
} = Ht(e);
|
|
653
|
+
let s = (r ? rt(o.width) : o.width) / n, c = (r ? rt(o.height) : o.height) / i;
|
|
654
|
+
return (!s || !Number.isFinite(s)) && (s = 1), (!c || !Number.isFinite(c)) && (c = 1), {
|
|
655
|
+
x: s,
|
|
656
|
+
y: c
|
|
657
|
+
};
|
|
658
|
+
}
|
|
659
|
+
const Pe = /* @__PURE__ */ H(0);
|
|
660
|
+
function $t(t) {
|
|
661
|
+
const e = N(t);
|
|
662
|
+
return !xt() || !e.visualViewport ? Pe : {
|
|
663
|
+
x: e.visualViewport.offsetLeft,
|
|
664
|
+
y: e.visualViewport.offsetTop
|
|
665
|
+
};
|
|
666
|
+
}
|
|
667
|
+
function Ne(t, e, o) {
|
|
668
|
+
return e === void 0 && (e = !1), !o || e && o !== N(t) ? !1 : e;
|
|
669
|
+
}
|
|
670
|
+
function X(t, e, o, n) {
|
|
671
|
+
e === void 0 && (e = !1), o === void 0 && (o = !1);
|
|
672
|
+
const i = t.getBoundingClientRect(), r = yt(t);
|
|
673
|
+
let s = H(1);
|
|
674
|
+
e && (n ? F(n) && (s = G(n)) : s = G(t));
|
|
675
|
+
const c = Ne(r, o, n) ? $t(r) : H(0);
|
|
676
|
+
let l = (i.left + c.x) / s.x, a = (i.top + c.y) / s.y, u = i.width / s.x, f = i.height / s.y;
|
|
677
|
+
if (r) {
|
|
678
|
+
const h = N(r), d = n && F(n) ? N(n) : n;
|
|
679
|
+
let m = h, p = m.frameElement;
|
|
680
|
+
for (; p && n && d !== m; ) {
|
|
681
|
+
const w = G(p), y = p.getBoundingClientRect(), v = L(p), b = y.left + (p.clientLeft + parseFloat(v.paddingLeft)) * w.x, E = y.top + (p.clientTop + parseFloat(v.paddingTop)) * w.y;
|
|
682
|
+
l *= w.x, a *= w.y, u *= w.x, f *= w.y, l += b, a += E, m = N(p), p = m.frameElement;
|
|
683
|
+
}
|
|
684
|
+
}
|
|
685
|
+
return ct({
|
|
686
|
+
width: u,
|
|
687
|
+
height: f,
|
|
688
|
+
x: l,
|
|
689
|
+
y: a
|
|
690
|
+
});
|
|
691
|
+
}
|
|
692
|
+
const _e = [":popover-open", ":modal"];
|
|
693
|
+
function zt(t) {
|
|
694
|
+
return _e.some((e) => {
|
|
695
|
+
try {
|
|
696
|
+
return t.matches(e);
|
|
697
|
+
} catch {
|
|
698
|
+
return !1;
|
|
699
|
+
}
|
|
700
|
+
});
|
|
701
|
+
}
|
|
702
|
+
function Se(t) {
|
|
703
|
+
let {
|
|
704
|
+
elements: e,
|
|
705
|
+
rect: o,
|
|
706
|
+
offsetParent: n,
|
|
707
|
+
strategy: i
|
|
708
|
+
} = t;
|
|
709
|
+
const r = i === "fixed", s = V(n), c = e ? zt(e.floating) : !1;
|
|
710
|
+
if (n === s || c && r)
|
|
711
|
+
return o;
|
|
712
|
+
let l = {
|
|
713
|
+
scrollLeft: 0,
|
|
714
|
+
scrollTop: 0
|
|
715
|
+
}, a = H(1);
|
|
716
|
+
const u = H(0), f = D(n);
|
|
717
|
+
if ((f || !f && !r) && (($(n) !== "body" || Z(s)) && (l = mt(n)), D(n))) {
|
|
718
|
+
const h = X(n);
|
|
719
|
+
a = G(n), u.x = h.x + n.clientLeft, u.y = h.y + n.clientTop;
|
|
720
|
+
}
|
|
721
|
+
return {
|
|
722
|
+
width: o.width * a.x,
|
|
723
|
+
height: o.height * a.y,
|
|
724
|
+
x: o.x * a.x - l.scrollLeft * a.x + u.x,
|
|
725
|
+
y: o.y * a.y - l.scrollTop * a.y + u.y
|
|
726
|
+
};
|
|
727
|
+
}
|
|
728
|
+
function Le(t) {
|
|
729
|
+
return Array.from(t.getClientRects());
|
|
730
|
+
}
|
|
731
|
+
function It(t) {
|
|
732
|
+
return X(V(t)).left + mt(t).scrollLeft;
|
|
733
|
+
}
|
|
734
|
+
function ke(t) {
|
|
735
|
+
const e = V(t), o = mt(t), n = t.ownerDocument.body, i = I(e.scrollWidth, e.clientWidth, n.scrollWidth, n.clientWidth), r = I(e.scrollHeight, e.clientHeight, n.scrollHeight, n.clientHeight);
|
|
736
|
+
let s = -o.scrollLeft + It(t);
|
|
737
|
+
const c = -o.scrollTop;
|
|
738
|
+
return L(n).direction === "rtl" && (s += I(e.clientWidth, n.clientWidth) - i), {
|
|
739
|
+
width: i,
|
|
740
|
+
height: r,
|
|
741
|
+
x: s,
|
|
742
|
+
y: c
|
|
743
|
+
};
|
|
744
|
+
}
|
|
745
|
+
function Me(t, e) {
|
|
746
|
+
const o = N(t), n = V(t), i = o.visualViewport;
|
|
747
|
+
let r = n.clientWidth, s = n.clientHeight, c = 0, l = 0;
|
|
748
|
+
if (i) {
|
|
749
|
+
r = i.width, s = i.height;
|
|
750
|
+
const a = xt();
|
|
751
|
+
(!a || a && e === "fixed") && (c = i.offsetLeft, l = i.offsetTop);
|
|
752
|
+
}
|
|
753
|
+
return {
|
|
754
|
+
width: r,
|
|
755
|
+
height: s,
|
|
756
|
+
x: c,
|
|
757
|
+
y: l
|
|
758
|
+
};
|
|
759
|
+
}
|
|
760
|
+
function De(t, e) {
|
|
761
|
+
const o = X(t, !0, e === "fixed"), n = o.top + t.clientTop, i = o.left + t.clientLeft, r = D(t) ? G(t) : H(1), s = t.clientWidth * r.x, c = t.clientHeight * r.y, l = i * r.x, a = n * r.y;
|
|
762
|
+
return {
|
|
763
|
+
width: s,
|
|
764
|
+
height: c,
|
|
765
|
+
x: l,
|
|
766
|
+
y: a
|
|
767
|
+
};
|
|
768
|
+
}
|
|
769
|
+
function At(t, e, o) {
|
|
770
|
+
let n;
|
|
771
|
+
if (e === "viewport")
|
|
772
|
+
n = Me(t, o);
|
|
773
|
+
else if (e === "document")
|
|
774
|
+
n = ke(V(t));
|
|
775
|
+
else if (F(e))
|
|
776
|
+
n = De(e, o);
|
|
777
|
+
else {
|
|
778
|
+
const i = $t(t);
|
|
779
|
+
n = {
|
|
780
|
+
...e,
|
|
781
|
+
x: e.x - i.x,
|
|
782
|
+
y: e.y - i.y
|
|
783
|
+
};
|
|
784
|
+
}
|
|
785
|
+
return ct(n);
|
|
786
|
+
}
|
|
787
|
+
function Ut(t, e) {
|
|
788
|
+
const o = J(t);
|
|
789
|
+
return o === e || !F(o) || dt(o) ? !1 : L(o).position === "fixed" || Ut(o, e);
|
|
790
|
+
}
|
|
791
|
+
function Fe(t, e) {
|
|
792
|
+
const o = e.get(t);
|
|
793
|
+
if (o)
|
|
794
|
+
return o;
|
|
795
|
+
let n = Q(t, [], !1).filter((c) => F(c) && $(c) !== "body"), i = null;
|
|
796
|
+
const r = L(t).position === "fixed";
|
|
797
|
+
let s = r ? J(t) : t;
|
|
798
|
+
for (; F(s) && !dt(s); ) {
|
|
799
|
+
const c = L(s), l = gt(s);
|
|
800
|
+
!l && c.position === "fixed" && (i = null), (r ? !l && !i : !l && c.position === "static" && !!i && ["absolute", "fixed"].includes(i.position) || Z(s) && !l && Ut(t, s)) ? n = n.filter((u) => u !== s) : i = c, s = J(s);
|
|
801
|
+
}
|
|
802
|
+
return e.set(t, n), n;
|
|
803
|
+
}
|
|
804
|
+
function Ve(t) {
|
|
805
|
+
let {
|
|
806
|
+
element: e,
|
|
807
|
+
boundary: o,
|
|
808
|
+
rootBoundary: n,
|
|
809
|
+
strategy: i
|
|
810
|
+
} = t;
|
|
811
|
+
const s = [...o === "clippingAncestors" ? Fe(e, this._c) : [].concat(o), n], c = s[0], l = s.reduce((a, u) => {
|
|
812
|
+
const f = At(e, u, i);
|
|
813
|
+
return a.top = I(f.top, a.top), a.right = it(f.right, a.right), a.bottom = it(f.bottom, a.bottom), a.left = I(f.left, a.left), a;
|
|
814
|
+
}, At(e, c, i));
|
|
815
|
+
return {
|
|
816
|
+
width: l.right - l.left,
|
|
817
|
+
height: l.bottom - l.top,
|
|
818
|
+
x: l.left,
|
|
819
|
+
y: l.top
|
|
820
|
+
};
|
|
821
|
+
}
|
|
822
|
+
function je(t) {
|
|
823
|
+
const {
|
|
824
|
+
width: e,
|
|
825
|
+
height: o
|
|
826
|
+
} = Ht(t);
|
|
827
|
+
return {
|
|
828
|
+
width: e,
|
|
829
|
+
height: o
|
|
830
|
+
};
|
|
831
|
+
}
|
|
832
|
+
function We(t, e, o) {
|
|
833
|
+
const n = D(e), i = V(e), r = o === "fixed", s = X(t, !0, r, e);
|
|
834
|
+
let c = {
|
|
835
|
+
scrollLeft: 0,
|
|
836
|
+
scrollTop: 0
|
|
837
|
+
};
|
|
838
|
+
const l = H(0);
|
|
839
|
+
if (n || !n && !r)
|
|
840
|
+
if (($(e) !== "body" || Z(i)) && (c = mt(e)), n) {
|
|
841
|
+
const f = X(e, !0, r, e);
|
|
842
|
+
l.x = f.x + e.clientLeft, l.y = f.y + e.clientTop;
|
|
843
|
+
} else
|
|
844
|
+
i && (l.x = It(i));
|
|
845
|
+
const a = s.left + c.scrollLeft - l.x, u = s.top + c.scrollTop - l.y;
|
|
846
|
+
return {
|
|
847
|
+
x: a,
|
|
848
|
+
y: u,
|
|
849
|
+
width: s.width,
|
|
850
|
+
height: s.height
|
|
851
|
+
};
|
|
852
|
+
}
|
|
853
|
+
function Ot(t, e) {
|
|
854
|
+
return !D(t) || L(t).position === "fixed" ? null : e ? e(t) : t.offsetParent;
|
|
855
|
+
}
|
|
856
|
+
function Xt(t, e) {
|
|
857
|
+
const o = N(t);
|
|
858
|
+
if (!D(t) || zt(t))
|
|
859
|
+
return o;
|
|
860
|
+
let n = Ot(t, e);
|
|
861
|
+
for (; n && Ae(n) && L(n).position === "static"; )
|
|
862
|
+
n = Ot(n, e);
|
|
863
|
+
return n && ($(n) === "html" || $(n) === "body" && L(n).position === "static" && !gt(n)) ? o : n || Oe(t) || o;
|
|
864
|
+
}
|
|
865
|
+
const Be = async function(t) {
|
|
866
|
+
const e = this.getOffsetParent || Xt, o = this.getDimensions, n = await o(t.floating);
|
|
867
|
+
return {
|
|
868
|
+
reference: We(t.reference, await e(t.floating), t.strategy),
|
|
869
|
+
floating: {
|
|
870
|
+
x: 0,
|
|
871
|
+
y: 0,
|
|
872
|
+
width: n.width,
|
|
873
|
+
height: n.height
|
|
874
|
+
}
|
|
875
|
+
};
|
|
876
|
+
};
|
|
877
|
+
function He(t) {
|
|
878
|
+
return L(t).direction === "rtl";
|
|
879
|
+
}
|
|
880
|
+
const $e = {
|
|
881
|
+
convertOffsetParentRelativeRectToViewportRelativeRect: Se,
|
|
882
|
+
getDocumentElement: V,
|
|
883
|
+
getClippingRect: Ve,
|
|
884
|
+
getOffsetParent: Xt,
|
|
885
|
+
getElementRects: Be,
|
|
886
|
+
getClientRects: Le,
|
|
887
|
+
getDimensions: je,
|
|
888
|
+
getScale: G,
|
|
889
|
+
isElement: F,
|
|
890
|
+
isRTL: He
|
|
891
|
+
};
|
|
892
|
+
function ze(t, e) {
|
|
893
|
+
let o = null, n;
|
|
894
|
+
const i = V(t);
|
|
895
|
+
function r() {
|
|
896
|
+
var c;
|
|
897
|
+
clearTimeout(n), (c = o) == null || c.disconnect(), o = null;
|
|
898
|
+
}
|
|
899
|
+
function s(c, l) {
|
|
900
|
+
c === void 0 && (c = !1), l === void 0 && (l = 1), r();
|
|
901
|
+
const {
|
|
902
|
+
left: a,
|
|
903
|
+
top: u,
|
|
904
|
+
width: f,
|
|
905
|
+
height: h
|
|
906
|
+
} = t.getBoundingClientRect();
|
|
907
|
+
if (c || e(), !f || !h)
|
|
908
|
+
return;
|
|
909
|
+
const d = tt(u), m = tt(i.clientWidth - (a + f)), p = tt(i.clientHeight - (u + h)), w = tt(a), v = {
|
|
910
|
+
rootMargin: -d + "px " + -m + "px " + -p + "px " + -w + "px",
|
|
911
|
+
threshold: I(0, it(1, l)) || 1
|
|
912
|
+
};
|
|
913
|
+
let b = !0;
|
|
914
|
+
function E(R) {
|
|
915
|
+
const T = R[0].intersectionRatio;
|
|
916
|
+
if (T !== l) {
|
|
917
|
+
if (!b)
|
|
918
|
+
return s();
|
|
919
|
+
T ? s(!1, T) : n = setTimeout(() => {
|
|
920
|
+
s(!1, 1e-7);
|
|
921
|
+
}, 1e3);
|
|
922
|
+
}
|
|
923
|
+
b = !1;
|
|
924
|
+
}
|
|
925
|
+
try {
|
|
926
|
+
o = new IntersectionObserver(E, {
|
|
927
|
+
...v,
|
|
928
|
+
// Handle <iframe>s
|
|
929
|
+
root: i.ownerDocument
|
|
930
|
+
});
|
|
931
|
+
} catch {
|
|
932
|
+
o = new IntersectionObserver(E, v);
|
|
933
|
+
}
|
|
934
|
+
o.observe(t);
|
|
935
|
+
}
|
|
936
|
+
return s(!0), r;
|
|
937
|
+
}
|
|
938
|
+
function Pt(t, e, o, n) {
|
|
939
|
+
n === void 0 && (n = {});
|
|
940
|
+
const {
|
|
941
|
+
ancestorScroll: i = !0,
|
|
942
|
+
ancestorResize: r = !0,
|
|
943
|
+
elementResize: s = typeof ResizeObserver == "function",
|
|
944
|
+
layoutShift: c = typeof IntersectionObserver == "function",
|
|
945
|
+
animationFrame: l = !1
|
|
946
|
+
} = n, a = yt(t), u = i || r ? [...a ? Q(a) : [], ...Q(e)] : [];
|
|
947
|
+
u.forEach((y) => {
|
|
948
|
+
i && y.addEventListener("scroll", o, {
|
|
949
|
+
passive: !0
|
|
950
|
+
}), r && y.addEventListener("resize", o);
|
|
951
|
+
});
|
|
952
|
+
const f = a && c ? ze(a, o) : null;
|
|
953
|
+
let h = -1, d = null;
|
|
954
|
+
s && (d = new ResizeObserver((y) => {
|
|
955
|
+
let [v] = y;
|
|
956
|
+
v && v.target === a && d && (d.unobserve(e), cancelAnimationFrame(h), h = requestAnimationFrame(() => {
|
|
957
|
+
var b;
|
|
958
|
+
(b = d) == null || b.observe(e);
|
|
959
|
+
})), o();
|
|
960
|
+
}), a && !l && d.observe(a), d.observe(e));
|
|
961
|
+
let m, p = l ? X(t) : null;
|
|
962
|
+
l && w();
|
|
963
|
+
function w() {
|
|
964
|
+
const y = X(t);
|
|
965
|
+
p && (y.x !== p.x || y.y !== p.y || y.width !== p.width || y.height !== p.height) && o(), p = y, m = requestAnimationFrame(w);
|
|
966
|
+
}
|
|
967
|
+
return o(), () => {
|
|
968
|
+
var y;
|
|
969
|
+
u.forEach((v) => {
|
|
970
|
+
i && v.removeEventListener("scroll", o), r && v.removeEventListener("resize", o);
|
|
971
|
+
}), f == null || f(), (y = d) == null || y.disconnect(), d = null, l && cancelAnimationFrame(m);
|
|
972
|
+
};
|
|
973
|
+
}
|
|
974
|
+
const Nt = Ce, Ie = Te, Ue = Ee, Xe = (t, e, o) => {
|
|
975
|
+
const n = /* @__PURE__ */ new Map(), i = {
|
|
976
|
+
platform: $e,
|
|
977
|
+
...o
|
|
978
|
+
}, r = {
|
|
979
|
+
...i.platform,
|
|
980
|
+
_c: n
|
|
981
|
+
};
|
|
982
|
+
return be(t, e, {
|
|
983
|
+
...i,
|
|
984
|
+
platform: r
|
|
985
|
+
});
|
|
986
|
+
};
|
|
987
|
+
var nt = typeof document < "u" ? Qt : Lt;
|
|
988
|
+
function lt(t, e) {
|
|
989
|
+
if (t === e)
|
|
990
|
+
return !0;
|
|
991
|
+
if (typeof t != typeof e)
|
|
992
|
+
return !1;
|
|
993
|
+
if (typeof t == "function" && t.toString() === e.toString())
|
|
994
|
+
return !0;
|
|
995
|
+
let o, n, i;
|
|
996
|
+
if (t && e && typeof t == "object") {
|
|
997
|
+
if (Array.isArray(t)) {
|
|
998
|
+
if (o = t.length, o !== e.length)
|
|
999
|
+
return !1;
|
|
1000
|
+
for (n = o; n-- !== 0; )
|
|
1001
|
+
if (!lt(t[n], e[n]))
|
|
1002
|
+
return !1;
|
|
1003
|
+
return !0;
|
|
1004
|
+
}
|
|
1005
|
+
if (i = Object.keys(t), o = i.length, o !== Object.keys(e).length)
|
|
1006
|
+
return !1;
|
|
1007
|
+
for (n = o; n-- !== 0; )
|
|
1008
|
+
if (!{}.hasOwnProperty.call(e, i[n]))
|
|
1009
|
+
return !1;
|
|
1010
|
+
for (n = o; n-- !== 0; ) {
|
|
1011
|
+
const r = i[n];
|
|
1012
|
+
if (!(r === "_owner" && t.$$typeof) && !lt(t[r], e[r]))
|
|
1013
|
+
return !1;
|
|
1014
|
+
}
|
|
1015
|
+
return !0;
|
|
1016
|
+
}
|
|
1017
|
+
return t !== t && e !== e;
|
|
1018
|
+
}
|
|
1019
|
+
function Yt(t) {
|
|
1020
|
+
return typeof window > "u" ? 1 : (t.ownerDocument.defaultView || window).devicePixelRatio || 1;
|
|
1021
|
+
}
|
|
1022
|
+
function _t(t, e) {
|
|
1023
|
+
const o = Yt(t);
|
|
1024
|
+
return Math.round(e * o) / o;
|
|
1025
|
+
}
|
|
1026
|
+
function St(t) {
|
|
1027
|
+
const e = x.useRef(t);
|
|
1028
|
+
return nt(() => {
|
|
1029
|
+
e.current = t;
|
|
1030
|
+
}), e;
|
|
1031
|
+
}
|
|
1032
|
+
function Ye(t) {
|
|
1033
|
+
t === void 0 && (t = {});
|
|
1034
|
+
const {
|
|
1035
|
+
placement: e = "bottom",
|
|
1036
|
+
strategy: o = "absolute",
|
|
1037
|
+
middleware: n = [],
|
|
1038
|
+
platform: i,
|
|
1039
|
+
elements: {
|
|
1040
|
+
reference: r,
|
|
1041
|
+
floating: s
|
|
1042
|
+
} = {},
|
|
1043
|
+
transform: c = !0,
|
|
1044
|
+
whileElementsMounted: l,
|
|
1045
|
+
open: a
|
|
1046
|
+
} = t, [u, f] = x.useState({
|
|
1047
|
+
x: 0,
|
|
1048
|
+
y: 0,
|
|
1049
|
+
strategy: o,
|
|
1050
|
+
placement: e,
|
|
1051
|
+
middlewareData: {},
|
|
1052
|
+
isPositioned: !1
|
|
1053
|
+
}), [h, d] = x.useState(n);
|
|
1054
|
+
lt(h, n) || d(n);
|
|
1055
|
+
const [m, p] = x.useState(null), [w, y] = x.useState(null), v = x.useCallback((C) => {
|
|
1056
|
+
C !== T.current && (T.current = C, p(C));
|
|
1057
|
+
}, []), b = x.useCallback((C) => {
|
|
1058
|
+
C !== P.current && (P.current = C, y(C));
|
|
1059
|
+
}, []), E = r || m, R = s || w, T = x.useRef(null), P = x.useRef(null), _ = x.useRef(u), z = l != null, j = St(l), W = St(i), A = x.useCallback(() => {
|
|
1060
|
+
if (!T.current || !P.current)
|
|
1061
|
+
return;
|
|
1062
|
+
const C = {
|
|
1063
|
+
placement: e,
|
|
1064
|
+
strategy: o,
|
|
1065
|
+
middleware: h
|
|
1066
|
+
};
|
|
1067
|
+
W.current && (C.platform = W.current), Xe(T.current, P.current, C).then((Y) => {
|
|
1068
|
+
const q = {
|
|
1069
|
+
...Y,
|
|
1070
|
+
isPositioned: !0
|
|
1071
|
+
};
|
|
1072
|
+
B.current && !lt(_.current, q) && (_.current = q, le.flushSync(() => {
|
|
1073
|
+
f(q);
|
|
1074
|
+
}));
|
|
1075
|
+
});
|
|
1076
|
+
}, [h, e, o, W]);
|
|
1077
|
+
nt(() => {
|
|
1078
|
+
a === !1 && _.current.isPositioned && (_.current.isPositioned = !1, f((C) => ({
|
|
1079
|
+
...C,
|
|
1080
|
+
isPositioned: !1
|
|
1081
|
+
})));
|
|
1082
|
+
}, [a]);
|
|
1083
|
+
const B = x.useRef(!1);
|
|
1084
|
+
nt(() => (B.current = !0, () => {
|
|
1085
|
+
B.current = !1;
|
|
1086
|
+
}), []), nt(() => {
|
|
1087
|
+
if (E && (T.current = E), R && (P.current = R), E && R) {
|
|
1088
|
+
if (j.current)
|
|
1089
|
+
return j.current(E, R, A);
|
|
1090
|
+
A();
|
|
1091
|
+
}
|
|
1092
|
+
}, [E, R, A, j, z]);
|
|
1093
|
+
const k = x.useMemo(() => ({
|
|
1094
|
+
reference: T,
|
|
1095
|
+
floating: P,
|
|
1096
|
+
setReference: v,
|
|
1097
|
+
setFloating: b
|
|
1098
|
+
}), [v, b]), O = x.useMemo(() => ({
|
|
1099
|
+
reference: E,
|
|
1100
|
+
floating: R
|
|
1101
|
+
}), [E, R]), M = x.useMemo(() => {
|
|
1102
|
+
const C = {
|
|
1103
|
+
position: o,
|
|
1104
|
+
left: 0,
|
|
1105
|
+
top: 0
|
|
1106
|
+
};
|
|
1107
|
+
if (!O.floating)
|
|
1108
|
+
return C;
|
|
1109
|
+
const Y = _t(O.floating, u.x), q = _t(O.floating, u.y);
|
|
1110
|
+
return c ? {
|
|
1111
|
+
...C,
|
|
1112
|
+
transform: "translate(" + Y + "px, " + q + "px)",
|
|
1113
|
+
...Yt(O.floating) >= 1.5 && {
|
|
1114
|
+
willChange: "transform"
|
|
1115
|
+
}
|
|
1116
|
+
} : {
|
|
1117
|
+
position: o,
|
|
1118
|
+
left: Y,
|
|
1119
|
+
top: q
|
|
1120
|
+
};
|
|
1121
|
+
}, [o, c, O.floating, u.x, u.y]);
|
|
1122
|
+
return x.useMemo(() => ({
|
|
1123
|
+
...u,
|
|
1124
|
+
update: A,
|
|
1125
|
+
refs: k,
|
|
1126
|
+
elements: O,
|
|
1127
|
+
floatingStyles: M
|
|
1128
|
+
}), [u, A, k, O, M]);
|
|
1129
|
+
}
|
|
1130
|
+
const qt = "Popup";
|
|
1131
|
+
function qe(t) {
|
|
1132
|
+
return te(qt, t);
|
|
1133
|
+
}
|
|
1134
|
+
ee(qt, ["root", "open"]);
|
|
1135
|
+
const wt = /* @__PURE__ */ x.createContext(null);
|
|
1136
|
+
process.env.NODE_ENV !== "production" && (wt.displayName = "TransitionContext");
|
|
1137
|
+
function Ke() {
|
|
1138
|
+
const t = x.useContext(wt);
|
|
1139
|
+
if (!t)
|
|
1140
|
+
throw new Error("Missing transition context");
|
|
1141
|
+
const {
|
|
1142
|
+
registerTransition: e,
|
|
1143
|
+
requestedEnter: o,
|
|
1144
|
+
onExited: n
|
|
1145
|
+
} = t;
|
|
1146
|
+
return x.useEffect(() => e(), [e]), {
|
|
1147
|
+
onExited: n,
|
|
1148
|
+
requestedEnter: o
|
|
1149
|
+
};
|
|
1150
|
+
}
|
|
1151
|
+
function Ge(t) {
|
|
1152
|
+
const [e, o] = x.useState(!0), n = x.useRef(!1), i = x.useRef(0), [r, s] = x.useState(!1), c = x.useRef(t);
|
|
1153
|
+
x.useEffect(() => {
|
|
1154
|
+
!t && // checking registeredTransitions.current instead of hasTransition to avoid this effect re-firing whenever hasTransition changes
|
|
1155
|
+
i.current > 0 && // prevents waiting for a pending transition right after mounting
|
|
1156
|
+
c.current !== t && (n.current = !0, o(!1)), c.current = t;
|
|
1157
|
+
}, [t]);
|
|
1158
|
+
const l = x.useCallback(() => {
|
|
1159
|
+
n.current = !1, o(!0);
|
|
1160
|
+
}, []), a = x.useCallback(() => (i.current += 1, s(!0), () => {
|
|
1161
|
+
i.current -= 1, i.current === 0 && s(!1);
|
|
1162
|
+
}), []);
|
|
1163
|
+
let u;
|
|
1164
|
+
return r ? t ? u = !1 : u = !n.current && e : u = !t, {
|
|
1165
|
+
contextValue: x.useMemo(() => ({
|
|
1166
|
+
requestedEnter: t,
|
|
1167
|
+
onExited: l,
|
|
1168
|
+
registerTransition: a,
|
|
1169
|
+
hasExited: u
|
|
1170
|
+
}), [l, t, a, u]),
|
|
1171
|
+
hasExited: u
|
|
1172
|
+
};
|
|
1173
|
+
}
|
|
1174
|
+
const Kt = /* @__PURE__ */ x.createContext(null);
|
|
1175
|
+
process.env.NODE_ENV !== "production" && (Kt.displayName = "PopupContext");
|
|
1176
|
+
const Je = ["anchor", "children", "container", "disablePortal", "keepMounted", "middleware", "offset", "open", "placement", "slotProps", "slots", "strategy"];
|
|
1177
|
+
function Qe(t) {
|
|
1178
|
+
const {
|
|
1179
|
+
open: e
|
|
1180
|
+
} = t;
|
|
1181
|
+
return oe({
|
|
1182
|
+
root: ["root", e && "open"]
|
|
1183
|
+
}, ie(qe));
|
|
1184
|
+
}
|
|
1185
|
+
function Ze(t) {
|
|
1186
|
+
return typeof t == "function" ? t() : t;
|
|
1187
|
+
}
|
|
1188
|
+
const Gt = /* @__PURE__ */ x.forwardRef(function(e, o) {
|
|
1189
|
+
var n;
|
|
1190
|
+
const {
|
|
1191
|
+
anchor: i,
|
|
1192
|
+
children: r,
|
|
1193
|
+
container: s,
|
|
1194
|
+
disablePortal: c = !1,
|
|
1195
|
+
keepMounted: l = !1,
|
|
1196
|
+
middleware: a,
|
|
1197
|
+
offset: u = 0,
|
|
1198
|
+
open: f = !1,
|
|
1199
|
+
placement: h = "bottom",
|
|
1200
|
+
slotProps: d = {},
|
|
1201
|
+
slots: m = {},
|
|
1202
|
+
strategy: p = "absolute"
|
|
1203
|
+
} = e, w = kt(e, Je), {
|
|
1204
|
+
refs: y,
|
|
1205
|
+
elements: v,
|
|
1206
|
+
floatingStyles: b,
|
|
1207
|
+
update: E,
|
|
1208
|
+
placement: R
|
|
1209
|
+
} = Ye({
|
|
1210
|
+
elements: {
|
|
1211
|
+
reference: Ze(i)
|
|
1212
|
+
},
|
|
1213
|
+
open: f,
|
|
1214
|
+
middleware: a ?? [Nt(u ?? 0), Ue(), Ie()],
|
|
1215
|
+
placement: h,
|
|
1216
|
+
strategy: p,
|
|
1217
|
+
whileElementsMounted: l ? void 0 : Pt
|
|
1218
|
+
}), T = Mt(y.setFloating, o);
|
|
1219
|
+
fe(() => {
|
|
1220
|
+
if (l && f && v.reference && v.floating)
|
|
1221
|
+
return Pt(v.reference, v.floating, E);
|
|
1222
|
+
}, [l, f, v, E]);
|
|
1223
|
+
const P = et({}, e, {
|
|
1224
|
+
disablePortal: c,
|
|
1225
|
+
keepMounted: l,
|
|
1226
|
+
offset: Nt,
|
|
1227
|
+
open: f,
|
|
1228
|
+
placement: h,
|
|
1229
|
+
finalPlacement: R,
|
|
1230
|
+
strategy: p
|
|
1231
|
+
}), {
|
|
1232
|
+
contextValue: _,
|
|
1233
|
+
hasExited: z
|
|
1234
|
+
} = Ge(f), j = l && z ? "hidden" : void 0, W = Qe(P), A = (n = m == null ? void 0 : m.root) != null ? n : "div", B = ne({
|
|
1235
|
+
elementType: A,
|
|
1236
|
+
externalSlotProps: d.root,
|
|
1237
|
+
externalForwardedProps: w,
|
|
1238
|
+
ownerState: P,
|
|
1239
|
+
className: W.root,
|
|
1240
|
+
additionalProps: {
|
|
1241
|
+
ref: T,
|
|
1242
|
+
role: "tooltip",
|
|
1243
|
+
style: et({}, b, {
|
|
1244
|
+
visibility: j
|
|
1245
|
+
})
|
|
1246
|
+
}
|
|
1247
|
+
}), k = x.useMemo(() => ({
|
|
1248
|
+
placement: R
|
|
1249
|
+
}), [R]);
|
|
1250
|
+
return l || !z ? /* @__PURE__ */ S(ae, {
|
|
1251
|
+
disablePortal: c,
|
|
1252
|
+
container: s,
|
|
1253
|
+
children: /* @__PURE__ */ S(Kt.Provider, {
|
|
1254
|
+
value: k,
|
|
1255
|
+
children: /* @__PURE__ */ S(wt.Provider, {
|
|
1256
|
+
value: _,
|
|
1257
|
+
children: /* @__PURE__ */ S(A, et({}, B, {
|
|
1258
|
+
children: r
|
|
1259
|
+
}))
|
|
1260
|
+
})
|
|
1261
|
+
})
|
|
1262
|
+
}) : null;
|
|
1263
|
+
});
|
|
1264
|
+
process.env.NODE_ENV !== "production" && (Gt.propTypes = {
|
|
1265
|
+
// ┌────────────────────────────── Warning ──────────────────────────────┐
|
|
1266
|
+
// │ These PropTypes are generated from the TypeScript type definitions. │
|
|
1267
|
+
// │ To update them, edit the TypeScript types and run `pnpm proptypes`. │
|
|
1268
|
+
// └─────────────────────────────────────────────────────────────────────┘
|
|
1269
|
+
/**
|
|
1270
|
+
* An HTML element, [virtual element](https://floating-ui.com/docs/virtual-elements),
|
|
1271
|
+
* or a function that returns either.
|
|
1272
|
+
* It's used to set the position of the popup.
|
|
1273
|
+
*/
|
|
1274
|
+
anchor: g.oneOfType([bt, g.object, g.func]),
|
|
1275
|
+
/**
|
|
1276
|
+
* @ignore
|
|
1277
|
+
*/
|
|
1278
|
+
children: g.oneOfType([g.node, g.func]),
|
|
1279
|
+
/**
|
|
1280
|
+
* An HTML element or function that returns one. The container will have the portal children appended to it.
|
|
1281
|
+
* By default, it uses the body of the top-level document object, so it's `document.body` in these cases.
|
|
1282
|
+
*/
|
|
1283
|
+
container: g.oneOfType([bt, g.func]),
|
|
1284
|
+
/**
|
|
1285
|
+
* If `true`, the popup will be rendered where it is defined, without the use of portals.
|
|
1286
|
+
* @default false
|
|
1287
|
+
*/
|
|
1288
|
+
disablePortal: g.bool,
|
|
1289
|
+
/**
|
|
1290
|
+
* If `true`, the popup will exist in the DOM even if it's closed.
|
|
1291
|
+
* Its visibility will be controlled by the `visibility` CSS property.
|
|
1292
|
+
*
|
|
1293
|
+
* Otherwise, a closed popup will be removed from the DOM.
|
|
1294
|
+
*
|
|
1295
|
+
* @default false
|
|
1296
|
+
*/
|
|
1297
|
+
keepMounted: g.bool,
|
|
1298
|
+
/**
|
|
1299
|
+
* Collection of Floating UI middleware to use when positioning the popup.
|
|
1300
|
+
* If not provided, the [`offset`](https://floating-ui.com/docs/offset)
|
|
1301
|
+
* and [`flip`](https://floating-ui.com/docs/flip) functions will be used.
|
|
1302
|
+
*
|
|
1303
|
+
* @see https://floating-ui.com/docs/computePosition#middleware
|
|
1304
|
+
*/
|
|
1305
|
+
middleware: g.arrayOf(g.oneOfType([g.oneOf([!1]), g.shape({
|
|
1306
|
+
fn: g.func.isRequired,
|
|
1307
|
+
name: g.string.isRequired,
|
|
1308
|
+
options: g.any
|
|
1309
|
+
})])),
|
|
1310
|
+
/**
|
|
1311
|
+
* Distance between a popup and the trigger element.
|
|
1312
|
+
* This prop is ignored when custom `middleware` is provided.
|
|
1313
|
+
*
|
|
1314
|
+
* @default 0
|
|
1315
|
+
* @see https://floating-ui.com/docs/offset
|
|
1316
|
+
*/
|
|
1317
|
+
offset: g.oneOfType([g.func, g.number, g.shape({
|
|
1318
|
+
alignmentAxis: g.number,
|
|
1319
|
+
crossAxis: g.number,
|
|
1320
|
+
mainAxis: g.number
|
|
1321
|
+
})]),
|
|
1322
|
+
/**
|
|
1323
|
+
* If `true`, the popup is visible.
|
|
1324
|
+
*
|
|
1325
|
+
* @default false
|
|
1326
|
+
*/
|
|
1327
|
+
open: g.bool,
|
|
1328
|
+
/**
|
|
1329
|
+
* Determines where to place the popup relative to the trigger element.
|
|
1330
|
+
*
|
|
1331
|
+
* @default 'bottom'
|
|
1332
|
+
* @see https://floating-ui.com/docs/computePosition#placement
|
|
1333
|
+
*/
|
|
1334
|
+
placement: g.oneOf(["bottom-end", "bottom-start", "bottom", "left-end", "left-start", "left", "right-end", "right-start", "right", "top-end", "top-start", "top"]),
|
|
1335
|
+
/**
|
|
1336
|
+
* The props used for each slot inside the Popup.
|
|
1337
|
+
*
|
|
1338
|
+
* @default {}
|
|
1339
|
+
*/
|
|
1340
|
+
slotProps: g.shape({
|
|
1341
|
+
root: g.oneOfType([g.func, g.object])
|
|
1342
|
+
}),
|
|
1343
|
+
/**
|
|
1344
|
+
* The components used for each slot inside the Popup.
|
|
1345
|
+
* Either a string to use a HTML element or a component.
|
|
1346
|
+
*
|
|
1347
|
+
* @default {}
|
|
1348
|
+
*/
|
|
1349
|
+
slots: g.shape({
|
|
1350
|
+
root: g.elementType
|
|
1351
|
+
}),
|
|
1352
|
+
/**
|
|
1353
|
+
* The type of CSS position property to use (absolute or fixed).
|
|
1354
|
+
*
|
|
1355
|
+
* @default 'absolute'
|
|
1356
|
+
* @see https://floating-ui.com/docs/computePosition#strategy
|
|
1357
|
+
*/
|
|
1358
|
+
strategy: g.oneOf(["absolute", "fixed"])
|
|
1359
|
+
});
|
|
1360
|
+
const tn = ["children", "className", "enterAnimationName", "enterClassName", "exitAnimationName", "exitClassName"];
|
|
1361
|
+
function Jt(t) {
|
|
1362
|
+
const {
|
|
1363
|
+
children: e,
|
|
1364
|
+
className: o,
|
|
1365
|
+
enterAnimationName: n,
|
|
1366
|
+
enterClassName: i,
|
|
1367
|
+
exitAnimationName: r,
|
|
1368
|
+
exitClassName: s
|
|
1369
|
+
} = t, c = kt(t, tn), {
|
|
1370
|
+
requestedEnter: l,
|
|
1371
|
+
onExited: a
|
|
1372
|
+
} = Ke(), u = x.useRef(!0);
|
|
1373
|
+
x.useEffect(() => {
|
|
1374
|
+
l && u.current && (u.current = !1);
|
|
1375
|
+
}, [l]);
|
|
1376
|
+
const f = x.useCallback((h) => {
|
|
1377
|
+
h.animationName === r ? (a(), u.current = !0) : h.animationName === n && (u.current = !1);
|
|
1378
|
+
}, [a, r, n]);
|
|
1379
|
+
return /* @__PURE__ */ S("div", et({
|
|
1380
|
+
onAnimationEnd: f,
|
|
1381
|
+
className: ue(o, l ? i : s)
|
|
1382
|
+
}, c, {
|
|
1383
|
+
children: e
|
|
1384
|
+
}));
|
|
1385
|
+
}
|
|
1386
|
+
process.env.NODE_ENV !== "production" && (Jt.propTypes = {
|
|
1387
|
+
children: g.node,
|
|
1388
|
+
className: g.string,
|
|
1389
|
+
enterAnimationName: g.string,
|
|
1390
|
+
enterClassName: g.string,
|
|
1391
|
+
exitAnimationName: g.string,
|
|
1392
|
+
exitClassName: g.string
|
|
1393
|
+
});
|
|
1394
|
+
const en = "_tooltip_1dujm_1", K = {
|
|
1395
|
+
tooltip: en,
|
|
1396
|
+
"tooltip--small-padding": "_tooltip--small-padding_1dujm_5",
|
|
1397
|
+
"tooltip--normal-padding": "_tooltip--normal-padding_1dujm_8",
|
|
1398
|
+
"tooltip--white-theme": "_tooltip--white-theme_1dujm_11",
|
|
1399
|
+
"tooltip--black-theme": "_tooltip--black-theme_1dujm_15",
|
|
1400
|
+
"tooltip--animation": "_tooltip--animation_1dujm_20",
|
|
1401
|
+
"tooltip--anim-open": "_tooltip--anim-open_1dujm_20",
|
|
1402
|
+
"tooltip--open-animation": "_tooltip--open-animation_1dujm_1",
|
|
1403
|
+
"tooltip--anim-close": "_tooltip--anim-close_1dujm_23",
|
|
1404
|
+
"tooltip--close-animation": "_tooltip--close-animation_1dujm_1"
|
|
1405
|
+
}, fn = ({
|
|
1406
|
+
children: t,
|
|
1407
|
+
show: e,
|
|
1408
|
+
anchorRef: o,
|
|
1409
|
+
onClose: n,
|
|
1410
|
+
arialRole: i,
|
|
1411
|
+
position: r = "bottom",
|
|
1412
|
+
theme: s = "black",
|
|
1413
|
+
padding: c = "small",
|
|
1414
|
+
className: l,
|
|
1415
|
+
disableHoverListener: a,
|
|
1416
|
+
...u
|
|
1417
|
+
}) => {
|
|
1418
|
+
const f = Zt(null), [h, d] = vt(e || !1), [m, p] = vt(o || null);
|
|
1419
|
+
Lt(() => {
|
|
1420
|
+
var b;
|
|
1421
|
+
if (!o && (f != null && f.current)) {
|
|
1422
|
+
const E = (b = f == null ? void 0 : f.current) == null ? void 0 : b.parentElement;
|
|
1423
|
+
E && (a || (E.onpointerenter = () => d(!0), E.onpointerleave = () => d(!1)), p(E));
|
|
1424
|
+
}
|
|
1425
|
+
}, [f, a, o]);
|
|
1426
|
+
const w = (b) => {
|
|
1427
|
+
o != null && o.contains(b.target) || (n == null || n(), !a && d(!1));
|
|
1428
|
+
}, y = {
|
|
1429
|
+
padding: r.match(/(bottom|top)/) ? ".25rem 0" : "0 .25rem",
|
|
1430
|
+
zIndex: 1
|
|
1431
|
+
}, v = [
|
|
1432
|
+
K.tooltip,
|
|
1433
|
+
K[`tooltip--${s}-theme`],
|
|
1434
|
+
K[`tooltip--${c}-padding`],
|
|
1435
|
+
l || ""
|
|
1436
|
+
].join(" ").trim();
|
|
1437
|
+
return /* @__PURE__ */ S("span", { ref: f, children: /* @__PURE__ */ S(
|
|
1438
|
+
Gt,
|
|
1439
|
+
{
|
|
1440
|
+
...u,
|
|
1441
|
+
open: e || h,
|
|
1442
|
+
anchor: m,
|
|
1443
|
+
disablePortal: !0,
|
|
1444
|
+
style: y,
|
|
1445
|
+
role: i,
|
|
1446
|
+
placement: r,
|
|
1447
|
+
children: /* @__PURE__ */ S(
|
|
1448
|
+
Jt,
|
|
1449
|
+
{
|
|
1450
|
+
className: K["tooltip--animation"],
|
|
1451
|
+
enterClassName: K["tooltip--anim-open"],
|
|
1452
|
+
exitClassName: K["tooltip--anim-close"],
|
|
1453
|
+
enterAnimationName: "tooltip--open-animation",
|
|
1454
|
+
exitAnimationName: "tooltip--close-animation",
|
|
1455
|
+
children: /* @__PURE__ */ S("div", { className: v, children: /* @__PURE__ */ S(ot, { onClickAway: w, children: /* @__PURE__ */ S("div", { children: t }) }) })
|
|
1456
|
+
}
|
|
1457
|
+
)
|
|
1458
|
+
}
|
|
1459
|
+
) });
|
|
1460
|
+
};
|
|
1461
|
+
export {
|
|
1462
|
+
fn as Tooltip
|
|
1463
|
+
};
|