@purpurds/tooltip 5.7.0 → 5.8.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/.rush/temp/ci_build/@purpurds/tooltip/{a0d4bb1ddf80548684d69776c7acad5e7317fef6.untar.log → 3960d0defc3f346e8d7b248f295d65c77b250512.untar.log} +2 -2
- package/.rush/temp/operation/ci_build/all.log +4 -4
- package/.rush/temp/operation/ci_build/state.json +1 -1
- package/.rush/temp/operation/test_unit/all.log +3 -3
- package/.rush/temp/operation/test_unit/state.json +1 -1
- package/dist/LICENSE.txt +5 -5
- package/dist/tooltip.cjs.js +4 -4
- package/dist/tooltip.cjs.js.map +1 -1
- package/dist/tooltip.es.js +100 -100
- package/dist/tooltip.es.js.map +1 -1
- package/package.json +6 -6
package/dist/tooltip.es.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsxs as Ue, jsx as I } from "react/jsx-runtime";
|
|
2
2
|
import * as N from "react";
|
|
3
|
-
import { forwardRef as M, useCallback as k, createContext as Ve, useMemo as $e, createElement as _, useContext as
|
|
3
|
+
import { forwardRef as M, useCallback as k, createContext as Ve, useMemo as $e, createElement as _, useContext as At, Fragment as bn, Children as ie, isValidElement as Me, cloneElement as Ze, useEffect as R, useRef as L, useState as j, useLayoutEffect as Ct, useReducer as xn } from "react";
|
|
4
4
|
import * as $n from "react-dom";
|
|
5
5
|
import wn, { flushSync as Et } from "react-dom";
|
|
6
6
|
const _n = {
|
|
@@ -16,7 +16,7 @@ const _n = {
|
|
|
16
16
|
MD: "md",
|
|
17
17
|
LG: "lg"
|
|
18
18
|
};
|
|
19
|
-
function
|
|
19
|
+
function On(e) {
|
|
20
20
|
return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
|
|
21
21
|
}
|
|
22
22
|
var Tt = { exports: {} };
|
|
@@ -55,8 +55,8 @@ var Tt = { exports: {} };
|
|
|
55
55
|
e.exports ? (n.default = n, e.exports = n) : window.classNames = n;
|
|
56
56
|
})();
|
|
57
57
|
})(Tt);
|
|
58
|
-
var
|
|
59
|
-
const ft = /* @__PURE__ */ An
|
|
58
|
+
var An = Tt.exports;
|
|
59
|
+
const ft = /* @__PURE__ */ On(An), Cn = "_rotate_1xozj_1", En = "_dash_1xozj_1", ve = {
|
|
60
60
|
"purpur-spinner": "_purpur-spinner_1xozj_1",
|
|
61
61
|
rotate: Cn,
|
|
62
62
|
"purpur-spinner--xxs": "_purpur-spinner--xxs_1xozj_4",
|
|
@@ -376,7 +376,7 @@ const Zn = /* @__PURE__ */ qn(Kn), be = {
|
|
|
376
376
|
ADDITIONAL100MEDIUM: "additional-100-medium",
|
|
377
377
|
OVERLINE100: "overline-100",
|
|
378
378
|
OVERLINE200: "overline-200"
|
|
379
|
-
}, xe = "purpur-paragraph",
|
|
379
|
+
}, xe = "purpur-paragraph", Qn = ({
|
|
380
380
|
["data-testid"]: e,
|
|
381
381
|
children: t,
|
|
382
382
|
className: n = "",
|
|
@@ -397,7 +397,7 @@ const Zn = /* @__PURE__ */ qn(Kn), be = {
|
|
|
397
397
|
}
|
|
398
398
|
]);
|
|
399
399
|
return /* @__PURE__ */ I("p", { ...a, className: c, "data-testid": e, children: t });
|
|
400
|
-
},
|
|
400
|
+
}, Jn = "400ms";
|
|
401
401
|
function S() {
|
|
402
402
|
return S = Object.assign ? Object.assign.bind() : function(e) {
|
|
403
403
|
for (var t = 1; t < arguments.length; t++) {
|
|
@@ -443,7 +443,7 @@ function Ft(e, t = []) {
|
|
|
443
443
|
}, f);
|
|
444
444
|
}
|
|
445
445
|
function u(d, p) {
|
|
446
|
-
const f = (p == null ? void 0 : p[e][c]) || a, h =
|
|
446
|
+
const f = (p == null ? void 0 : p[e][c]) || a, h = At(f);
|
|
447
447
|
if (h)
|
|
448
448
|
return h;
|
|
449
449
|
if (s !== void 0)
|
|
@@ -623,7 +623,7 @@ const lr = /* @__PURE__ */ Ve({
|
|
|
623
623
|
branches: /* @__PURE__ */ new Set()
|
|
624
624
|
}), ur = /* @__PURE__ */ M((e, t) => {
|
|
625
625
|
var n;
|
|
626
|
-
const { disableOutsidePointerEvents: o = !1, onEscapeKeyDown: i, onPointerDownOutside: r, onFocusOutside: s, onInteractOutside: a, onDismiss: c, ...l } = e, u =
|
|
626
|
+
const { disableOutsidePointerEvents: o = !1, onEscapeKeyDown: i, onPointerDownOutside: r, onFocusOutside: s, onInteractOutside: a, onDismiss: c, ...l } = e, u = At(lr), [d, p] = j(null), f = (n = d == null ? void 0 : d.ownerDocument) !== null && n !== void 0 ? n : globalThis == null ? void 0 : globalThis.document, [, h] = j({}), m = fe(
|
|
627
627
|
t,
|
|
628
628
|
(P) => p(P)
|
|
629
629
|
), g = Array.from(u.layers), [v] = [
|
|
@@ -635,7 +635,7 @@ const lr = /* @__PURE__ */ Ve({
|
|
|
635
635
|
(E) => E.contains(T)
|
|
636
636
|
);
|
|
637
637
|
!b || F || (r == null || r(P), a == null || a(P), P.defaultPrevented || c == null || c());
|
|
638
|
-
}, f),
|
|
638
|
+
}, f), A = fr((P) => {
|
|
639
639
|
const T = P.target;
|
|
640
640
|
[
|
|
641
641
|
...u.branches
|
|
@@ -669,8 +669,8 @@ const lr = /* @__PURE__ */ Ve({
|
|
|
669
669
|
pointerEvents: $ ? b ? "auto" : "none" : void 0,
|
|
670
670
|
...e.style
|
|
671
671
|
},
|
|
672
|
-
onFocusCapture: G(e.onFocusCapture,
|
|
673
|
-
onBlurCapture: G(e.onBlurCapture,
|
|
672
|
+
onFocusCapture: G(e.onFocusCapture, A.onFocusCapture),
|
|
673
|
+
onBlurCapture: G(e.onBlurCapture, A.onBlurCapture),
|
|
674
674
|
onPointerDownCapture: G(e.onPointerDownCapture, w.onPointerDownCapture)
|
|
675
675
|
}));
|
|
676
676
|
});
|
|
@@ -779,21 +779,21 @@ function Y(e) {
|
|
|
779
779
|
function he(e) {
|
|
780
780
|
return e.split("-")[1];
|
|
781
781
|
}
|
|
782
|
-
function
|
|
782
|
+
function Qe(e) {
|
|
783
783
|
return e === "x" ? "y" : "x";
|
|
784
784
|
}
|
|
785
|
-
function
|
|
785
|
+
function Je(e) {
|
|
786
786
|
return e === "y" ? "height" : "width";
|
|
787
787
|
}
|
|
788
788
|
function me(e) {
|
|
789
789
|
return ["top", "bottom"].includes(Y(e)) ? "y" : "x";
|
|
790
790
|
}
|
|
791
791
|
function et(e) {
|
|
792
|
-
return
|
|
792
|
+
return Qe(me(e));
|
|
793
793
|
}
|
|
794
794
|
function br(e, t, n) {
|
|
795
795
|
n === void 0 && (n = !1);
|
|
796
|
-
const o = he(e), i = et(e), r =
|
|
796
|
+
const o = he(e), i = et(e), r = Je(i);
|
|
797
797
|
let s = i === "x" ? o === (n ? "end" : "start") ? "right" : "left" : o === "start" ? "bottom" : "top";
|
|
798
798
|
return t.reference[r] > t.floating[r] && (s = Fe(s)), [s, Fe(s)];
|
|
799
799
|
}
|
|
@@ -856,7 +856,7 @@ function gt(e, t, n) {
|
|
|
856
856
|
reference: o,
|
|
857
857
|
floating: i
|
|
858
858
|
} = e;
|
|
859
|
-
const r = me(t), s = et(t), a =
|
|
859
|
+
const r = me(t), s = et(t), a = Je(s), c = Y(t), l = r === "y", u = o.x + o.width / 2 - i.width / 2, d = o.y + o.height / 2 - i.height / 2, p = o[a] / 2 - i[a] / 2;
|
|
860
860
|
let f;
|
|
861
861
|
switch (c) {
|
|
862
862
|
case "top":
|
|
@@ -1026,19 +1026,19 @@ const vt = (e) => ({
|
|
|
1026
1026
|
const u = jt(l), d = {
|
|
1027
1027
|
x: n,
|
|
1028
1028
|
y: o
|
|
1029
|
-
}, p = et(i), f =
|
|
1029
|
+
}, p = et(i), f = Je(p), h = await s.getDimensions(c), m = p === "y", g = m ? "top" : "left", v = m ? "bottom" : "right", y = m ? "clientHeight" : "clientWidth", x = r.reference[f] + r.reference[p] - d[p] - r.floating[f], $ = d[p] - r.reference[p], b = await (s.getOffsetParent == null ? void 0 : s.getOffsetParent(c));
|
|
1030
1030
|
let w = b ? b[y] : 0;
|
|
1031
1031
|
(!w || !await (s.isElement == null ? void 0 : s.isElement(b))) && (w = a.floating[y] || r.floating[f]);
|
|
1032
|
-
const
|
|
1032
|
+
const A = x / 2 - $ / 2, P = w / 2 - h[f] / 2 - 1, T = ee(u[g], P), F = ee(u[v], P), E = T, H = w - h[f] - F, D = w / 2 - h[f] / 2 + A, C = Ye(E, D, H), O = he(i) != null && D != C && r.reference[f] / 2 - (D < E ? T : F) - h[f] / 2 < 0 ? D < E ? E - D : H - D : 0;
|
|
1033
1033
|
return {
|
|
1034
|
-
[p]: d[p] -
|
|
1034
|
+
[p]: d[p] - O,
|
|
1035
1035
|
data: {
|
|
1036
1036
|
[p]: C,
|
|
1037
|
-
centerOffset: D - C +
|
|
1037
|
+
centerOffset: D - C + O
|
|
1038
1038
|
}
|
|
1039
1039
|
};
|
|
1040
1040
|
}
|
|
1041
|
-
}),
|
|
1041
|
+
}), Or = function(e) {
|
|
1042
1042
|
return e === void 0 && (e = {}), {
|
|
1043
1043
|
name: "flip",
|
|
1044
1044
|
options: e,
|
|
@@ -1062,12 +1062,12 @@ const vt = (e) => ({
|
|
|
1062
1062
|
} = X(e, t), g = Y(o), v = Y(s) === s, y = await (a.isRTL == null ? void 0 : a.isRTL(c.floating)), x = d || (v || !h ? [Fe(s)] : xr(s));
|
|
1063
1063
|
!d && f !== "none" && x.push(...wr(s, h, f, y));
|
|
1064
1064
|
const $ = [s, ...x], b = await we(t, m), w = [];
|
|
1065
|
-
let
|
|
1065
|
+
let A = ((n = i.flip) == null ? void 0 : n.overflows) || [];
|
|
1066
1066
|
if (l && w.push(b[g]), u) {
|
|
1067
1067
|
const E = br(o, r, y);
|
|
1068
1068
|
w.push(b[E[0]], b[E[1]]);
|
|
1069
1069
|
}
|
|
1070
|
-
if (
|
|
1070
|
+
if (A = [...A, {
|
|
1071
1071
|
placement: o,
|
|
1072
1072
|
overflows: w
|
|
1073
1073
|
}], !w.every((E) => E <= 0)) {
|
|
@@ -1077,18 +1077,18 @@ const vt = (e) => ({
|
|
|
1077
1077
|
return {
|
|
1078
1078
|
data: {
|
|
1079
1079
|
index: E,
|
|
1080
|
-
overflows:
|
|
1080
|
+
overflows: A
|
|
1081
1081
|
},
|
|
1082
1082
|
reset: {
|
|
1083
1083
|
placement: H
|
|
1084
1084
|
}
|
|
1085
1085
|
};
|
|
1086
|
-
let D = (T =
|
|
1086
|
+
let D = (T = A.filter((C) => C.overflows[0] <= 0).sort((C, W) => C.overflows[1] - W.overflows[1])[0]) == null ? void 0 : T.placement;
|
|
1087
1087
|
if (!D)
|
|
1088
1088
|
switch (p) {
|
|
1089
1089
|
case "bestFit": {
|
|
1090
1090
|
var F;
|
|
1091
|
-
const C = (F =
|
|
1091
|
+
const C = (F = A.map((W) => [W.placement, W.overflows.filter((O) => O > 0).reduce((O, Z) => O + Z, 0)]).sort((W, O) => W[1] - O[1])[0]) == null ? void 0 : F[0];
|
|
1092
1092
|
C && (D = C);
|
|
1093
1093
|
break;
|
|
1094
1094
|
}
|
|
@@ -1118,7 +1118,7 @@ function yt(e, t) {
|
|
|
1118
1118
|
function bt(e) {
|
|
1119
1119
|
return gr.some((t) => e[t] >= 0);
|
|
1120
1120
|
}
|
|
1121
|
-
const
|
|
1121
|
+
const Ar = function(e) {
|
|
1122
1122
|
return e === void 0 && (e = {}), {
|
|
1123
1123
|
name: "hide",
|
|
1124
1124
|
options: e,
|
|
@@ -1232,7 +1232,7 @@ const Er = function(e) {
|
|
|
1232
1232
|
} = X(e, t), l = {
|
|
1233
1233
|
x: n,
|
|
1234
1234
|
y: o
|
|
1235
|
-
}, u = await we(t, c), d = me(Y(i)), p =
|
|
1235
|
+
}, u = await we(t, c), d = me(Y(i)), p = Qe(d);
|
|
1236
1236
|
let f = l[p], h = l[d];
|
|
1237
1237
|
if (r) {
|
|
1238
1238
|
const g = p === "y" ? "top" : "left", v = p === "y" ? "bottom" : "right", y = f + u[g], x = f - u[v];
|
|
@@ -1273,7 +1273,7 @@ const Er = function(e) {
|
|
|
1273
1273
|
} = X(e, t), u = {
|
|
1274
1274
|
x: n,
|
|
1275
1275
|
y: o
|
|
1276
|
-
}, d = me(i), p =
|
|
1276
|
+
}, d = me(i), p = Qe(d);
|
|
1277
1277
|
let f = u[p], h = u[d];
|
|
1278
1278
|
const m = X(a, t), g = typeof m == "number" ? {
|
|
1279
1279
|
mainAxis: m,
|
|
@@ -1328,8 +1328,8 @@ const Er = function(e) {
|
|
|
1328
1328
|
x = u || y ? ee(g, w) : w;
|
|
1329
1329
|
}
|
|
1330
1330
|
if (y && !u) {
|
|
1331
|
-
const w = B(c.left, 0),
|
|
1332
|
-
d ? $ = p - 2 * (w !== 0 ||
|
|
1331
|
+
const w = B(c.left, 0), A = B(c.right, 0), P = B(c.top, 0), T = B(c.bottom, 0);
|
|
1332
|
+
d ? $ = p - 2 * (w !== 0 || A !== 0 ? w + A : B(c.left, c.right)) : x = f - 2 * (P !== 0 || T !== 0 ? P + T : B(c.top, c.bottom));
|
|
1333
1333
|
}
|
|
1334
1334
|
await s({
|
|
1335
1335
|
...t,
|
|
@@ -1368,7 +1368,7 @@ function V(e) {
|
|
|
1368
1368
|
function xt(e) {
|
|
1369
1369
|
return typeof ShadowRoot > "u" ? !1 : e instanceof ShadowRoot || e instanceof z(e).ShadowRoot;
|
|
1370
1370
|
}
|
|
1371
|
-
function
|
|
1371
|
+
function Oe(e) {
|
|
1372
1372
|
const {
|
|
1373
1373
|
overflow: t,
|
|
1374
1374
|
overflowX: n,
|
|
@@ -1425,13 +1425,13 @@ function de(e) {
|
|
|
1425
1425
|
}
|
|
1426
1426
|
function Wt(e) {
|
|
1427
1427
|
const t = de(e);
|
|
1428
|
-
return Be(t) ? e.ownerDocument ? e.ownerDocument.body : e.body : V(t) &&
|
|
1428
|
+
return Be(t) ? e.ownerDocument ? e.ownerDocument.body : e.body : V(t) && Oe(t) ? t : Wt(t);
|
|
1429
1429
|
}
|
|
1430
1430
|
function _e(e, t) {
|
|
1431
1431
|
var n;
|
|
1432
1432
|
t === void 0 && (t = []);
|
|
1433
1433
|
const o = Wt(e), i = o === ((n = e.ownerDocument) == null ? void 0 : n.body), r = z(o);
|
|
1434
|
-
return i ? t.concat(r, r.visualViewport || [],
|
|
1434
|
+
return i ? t.concat(r, r.visualViewport || [], Oe(o) ? o : [], r.frameElement ? _e(r.frameElement) : []) : t.concat(o, _e(o));
|
|
1435
1435
|
}
|
|
1436
1436
|
function Ut(e) {
|
|
1437
1437
|
const t = U(e);
|
|
@@ -1508,7 +1508,7 @@ function Ir(e) {
|
|
|
1508
1508
|
scrollTop: 0
|
|
1509
1509
|
}, a = te(1);
|
|
1510
1510
|
const c = te(0);
|
|
1511
|
-
if ((i || !i && o !== "fixed") && ((ne(n) !== "body" ||
|
|
1511
|
+
if ((i || !i && o !== "fixed") && ((ne(n) !== "body" || Oe(r)) && (s = je(n)), V(n))) {
|
|
1512
1512
|
const l = se(n);
|
|
1513
1513
|
a = le(n), c.x = l.x + n.clientLeft, c.y = l.y + n.clientTop;
|
|
1514
1514
|
}
|
|
@@ -1591,7 +1591,7 @@ function jr(e, t) {
|
|
|
1591
1591
|
let s = r ? de(e) : e;
|
|
1592
1592
|
for (; q(s) && !Be(s); ) {
|
|
1593
1593
|
const a = U(s), c = tt(s);
|
|
1594
|
-
!c && a.position === "fixed" && (i = null), (r ? !c && !i : !c && a.position === "static" && !!i && ["absolute", "fixed"].includes(i.position) ||
|
|
1594
|
+
!c && a.position === "fixed" && (i = null), (r ? !c && !i : !c && a.position === "static" && !!i && ["absolute", "fixed"].includes(i.position) || Oe(s) && !c && Xt(e, s)) ? o = o.filter((u) => u !== s) : i = a, s = de(s);
|
|
1595
1595
|
}
|
|
1596
1596
|
return t.set(e, o), o;
|
|
1597
1597
|
}
|
|
@@ -1624,7 +1624,7 @@ function Ur(e, t, n) {
|
|
|
1624
1624
|
};
|
|
1625
1625
|
const c = te(0);
|
|
1626
1626
|
if (o || !o && !r)
|
|
1627
|
-
if ((ne(t) !== "body" ||
|
|
1627
|
+
if ((ne(t) !== "body" || Oe(i)) && (a = je(t)), o) {
|
|
1628
1628
|
const l = se(t, !0, r, t);
|
|
1629
1629
|
c.x = l.x + t.clientLeft, c.y = l.y + t.clientTop;
|
|
1630
1630
|
} else
|
|
@@ -1837,7 +1837,7 @@ function Pt(e) {
|
|
|
1837
1837
|
t.current = e;
|
|
1838
1838
|
}), t;
|
|
1839
1839
|
}
|
|
1840
|
-
function
|
|
1840
|
+
function Qr(e) {
|
|
1841
1841
|
e === void 0 && (e = {});
|
|
1842
1842
|
const {
|
|
1843
1843
|
placement: t = "bottom",
|
|
@@ -1860,31 +1860,31 @@ function Jr(e) {
|
|
|
1860
1860
|
isPositioned: !1
|
|
1861
1861
|
}), [p, f] = N.useState(o);
|
|
1862
1862
|
He(p, o) || f(o);
|
|
1863
|
-
const [h, m] = N.useState(null), [g, v] = N.useState(null), y = N.useCallback((
|
|
1864
|
-
|
|
1865
|
-
}, [m]), x = N.useCallback((
|
|
1866
|
-
|
|
1867
|
-
}, [v]), $ = r || h, b = s || g, w = N.useRef(null),
|
|
1868
|
-
if (!w.current || !
|
|
1863
|
+
const [h, m] = N.useState(null), [g, v] = N.useState(null), y = N.useCallback((O) => {
|
|
1864
|
+
O != w.current && (w.current = O, m(O));
|
|
1865
|
+
}, [m]), x = N.useCallback((O) => {
|
|
1866
|
+
O !== A.current && (A.current = O, v(O));
|
|
1867
|
+
}, [v]), $ = r || h, b = s || g, w = N.useRef(null), A = N.useRef(null), P = N.useRef(u), T = Pt(c), F = Pt(i), E = N.useCallback(() => {
|
|
1868
|
+
if (!w.current || !A.current)
|
|
1869
1869
|
return;
|
|
1870
|
-
const
|
|
1870
|
+
const O = {
|
|
1871
1871
|
placement: t,
|
|
1872
1872
|
strategy: n,
|
|
1873
1873
|
middleware: p
|
|
1874
1874
|
};
|
|
1875
|
-
F.current && (
|
|
1876
|
-
const
|
|
1875
|
+
F.current && (O.platform = F.current), Kr(w.current, A.current, O).then((Z) => {
|
|
1876
|
+
const Q = {
|
|
1877
1877
|
...Z,
|
|
1878
1878
|
isPositioned: !0
|
|
1879
1879
|
};
|
|
1880
|
-
H.current && !He(P.current,
|
|
1881
|
-
d(
|
|
1880
|
+
H.current && !He(P.current, Q) && (P.current = Q, $n.flushSync(() => {
|
|
1881
|
+
d(Q);
|
|
1882
1882
|
}));
|
|
1883
1883
|
});
|
|
1884
1884
|
}, [p, t, n, F]);
|
|
1885
1885
|
Le(() => {
|
|
1886
|
-
l === !1 && P.current.isPositioned && (P.current.isPositioned = !1, d((
|
|
1887
|
-
...
|
|
1886
|
+
l === !1 && P.current.isPositioned && (P.current.isPositioned = !1, d((O) => ({
|
|
1887
|
+
...O,
|
|
1888
1888
|
isPositioned: !1
|
|
1889
1889
|
})));
|
|
1890
1890
|
}, [l]);
|
|
@@ -1892,7 +1892,7 @@ function Jr(e) {
|
|
|
1892
1892
|
Le(() => (H.current = !0, () => {
|
|
1893
1893
|
H.current = !1;
|
|
1894
1894
|
}), []), Le(() => {
|
|
1895
|
-
if ($ && (w.current = $), b && (
|
|
1895
|
+
if ($ && (w.current = $), b && (A.current = b), $ && b) {
|
|
1896
1896
|
if (T.current)
|
|
1897
1897
|
return T.current($, b, E);
|
|
1898
1898
|
E();
|
|
@@ -1900,31 +1900,31 @@ function Jr(e) {
|
|
|
1900
1900
|
}, [$, b, E, T]);
|
|
1901
1901
|
const D = N.useMemo(() => ({
|
|
1902
1902
|
reference: w,
|
|
1903
|
-
floating:
|
|
1903
|
+
floating: A,
|
|
1904
1904
|
setReference: y,
|
|
1905
1905
|
setFloating: x
|
|
1906
1906
|
}), [y, x]), C = N.useMemo(() => ({
|
|
1907
1907
|
reference: $,
|
|
1908
1908
|
floating: b
|
|
1909
1909
|
}), [$, b]), W = N.useMemo(() => {
|
|
1910
|
-
const
|
|
1910
|
+
const O = {
|
|
1911
1911
|
position: n,
|
|
1912
1912
|
left: 0,
|
|
1913
1913
|
top: 0
|
|
1914
1914
|
};
|
|
1915
1915
|
if (!C.floating)
|
|
1916
|
-
return
|
|
1917
|
-
const Z = _t(C.floating, u.x),
|
|
1916
|
+
return O;
|
|
1917
|
+
const Z = _t(C.floating, u.x), Q = _t(C.floating, u.y);
|
|
1918
1918
|
return a ? {
|
|
1919
|
-
...
|
|
1920
|
-
transform: "translate(" + Z + "px, " +
|
|
1919
|
+
...O,
|
|
1920
|
+
transform: "translate(" + Z + "px, " + Q + "px)",
|
|
1921
1921
|
...qt(C.floating) >= 1.5 && {
|
|
1922
1922
|
willChange: "transform"
|
|
1923
1923
|
}
|
|
1924
1924
|
} : {
|
|
1925
1925
|
position: n,
|
|
1926
1926
|
left: Z,
|
|
1927
|
-
top:
|
|
1927
|
+
top: Q
|
|
1928
1928
|
};
|
|
1929
1929
|
}, [n, a, C.floating, u.x, u.y]);
|
|
1930
1930
|
return N.useMemo(() => ({
|
|
@@ -1935,7 +1935,7 @@ function Jr(e) {
|
|
|
1935
1935
|
floatingStyles: W
|
|
1936
1936
|
}), [u, E, D, C, W]);
|
|
1937
1937
|
}
|
|
1938
|
-
const
|
|
1938
|
+
const Jr = /* @__PURE__ */ M((e, t) => {
|
|
1939
1939
|
const { children: n, width: o = 10, height: i = 5, ...r } = e;
|
|
1940
1940
|
return /* @__PURE__ */ _(ae.svg, S({}, r, {
|
|
1941
1941
|
ref: t,
|
|
@@ -1946,7 +1946,7 @@ const Qr = /* @__PURE__ */ M((e, t) => {
|
|
|
1946
1946
|
}), e.asChild ? n : /* @__PURE__ */ _("polygon", {
|
|
1947
1947
|
points: "0,0 30,0 15,10"
|
|
1948
1948
|
}));
|
|
1949
|
-
}), eo =
|
|
1949
|
+
}), eo = Jr;
|
|
1950
1950
|
function to(e) {
|
|
1951
1951
|
const [t, n] = j(void 0);
|
|
1952
1952
|
return ue(() => {
|
|
@@ -1979,7 +1979,7 @@ function to(e) {
|
|
|
1979
1979
|
e
|
|
1980
1980
|
]), t;
|
|
1981
1981
|
}
|
|
1982
|
-
const Kt = "Popper", [Zt,
|
|
1982
|
+
const Kt = "Popper", [Zt, Qt] = Ft(Kt), [no, Jt] = Zt(Kt), ro = (e) => {
|
|
1983
1983
|
const { __scopePopper: t, children: n } = e, [o, i] = j(null);
|
|
1984
1984
|
return /* @__PURE__ */ _(no, {
|
|
1985
1985
|
scope: t,
|
|
@@ -1987,7 +1987,7 @@ const Kt = "Popper", [Zt, Jt] = Ft(Kt), [no, Qt] = Zt(Kt), ro = (e) => {
|
|
|
1987
1987
|
onAnchorChange: i
|
|
1988
1988
|
}, n);
|
|
1989
1989
|
}, oo = "PopperAnchor", io = /* @__PURE__ */ M((e, t) => {
|
|
1990
|
-
const { __scopePopper: n, virtualRef: o, ...i } = e, r =
|
|
1990
|
+
const { __scopePopper: n, virtualRef: o, ...i } = e, r = Jt(oo, n), s = L(null), a = fe(t, s);
|
|
1991
1991
|
return R(() => {
|
|
1992
1992
|
r.onAnchorChange((o == null ? void 0 : o.current) || s.current);
|
|
1993
1993
|
}), o ? null : /* @__PURE__ */ _(ae.div, S({}, i, {
|
|
@@ -1995,10 +1995,10 @@ const Kt = "Popper", [Zt, Jt] = Ft(Kt), [no, Qt] = Zt(Kt), ro = (e) => {
|
|
|
1995
1995
|
}));
|
|
1996
1996
|
}), en = "PopperContent", [so, ao] = Zt(en), co = /* @__PURE__ */ M((e, t) => {
|
|
1997
1997
|
var n, o, i, r, s, a, c, l;
|
|
1998
|
-
const { __scopePopper: u, side: d = "bottom", sideOffset: p = 0, align: f = "center", alignOffset: h = 0, arrowPadding: m = 0, avoidCollisions: g = !0, collisionBoundary: v = [], collisionPadding: y = 0, sticky: x = "partial", hideWhenDetached: $ = !1, updatePositionStrategy: b = "optimized", onPlaced: w, ...
|
|
1998
|
+
const { __scopePopper: u, side: d = "bottom", sideOffset: p = 0, align: f = "center", alignOffset: h = 0, arrowPadding: m = 0, avoidCollisions: g = !0, collisionBoundary: v = [], collisionPadding: y = 0, sticky: x = "partial", hideWhenDetached: $ = !1, updatePositionStrategy: b = "optimized", onPlaced: w, ...A } = e, P = Jt(en, u), [T, F] = j(null), E = fe(
|
|
1999
1999
|
t,
|
|
2000
2000
|
(ge) => F(ge)
|
|
2001
|
-
), [H, D] = j(null), C = to(H), W = (n = C == null ? void 0 : C.width) !== null && n !== void 0 ? n : 0,
|
|
2001
|
+
), [H, D] = j(null), C = to(H), W = (n = C == null ? void 0 : C.width) !== null && n !== void 0 ? n : 0, O = (o = C == null ? void 0 : C.height) !== null && o !== void 0 ? o : 0, Z = d + (f !== "center" ? "-" + f : ""), Q = typeof y == "number" ? y : {
|
|
2002
2002
|
top: 0,
|
|
2003
2003
|
right: 0,
|
|
2004
2004
|
bottom: 0,
|
|
@@ -2007,11 +2007,11 @@ const Kt = "Popper", [Zt, Jt] = Ft(Kt), [no, Qt] = Zt(Kt), ro = (e) => {
|
|
|
2007
2007
|
}, at = Array.isArray(v) ? v : [
|
|
2008
2008
|
v
|
|
2009
2009
|
], sn = at.length > 0, Ce = {
|
|
2010
|
-
padding:
|
|
2010
|
+
padding: Q,
|
|
2011
2011
|
boundary: at.filter(po),
|
|
2012
2012
|
// with `strategy: 'fixed'`, this is the only way to get it to respect boundaries
|
|
2013
2013
|
altBoundary: sn
|
|
2014
|
-
}, { refs: an, floatingStyles: ct, placement: cn, isPositioned: Ee, middlewareData: ce } =
|
|
2014
|
+
}, { refs: an, floatingStyles: ct, placement: cn, isPositioned: Ee, middlewareData: ce } = Qr({
|
|
2015
2015
|
// default to `fixed` strategy so users don't have to pick and we also avoid focus scroll issues
|
|
2016
2016
|
strategy: "fixed",
|
|
2017
2017
|
placement: Z,
|
|
@@ -2023,7 +2023,7 @@ const Kt = "Popper", [Zt, Jt] = Ft(Kt), [no, Qt] = Zt(Kt), ro = (e) => {
|
|
|
2023
2023
|
},
|
|
2024
2024
|
middleware: [
|
|
2025
2025
|
Er({
|
|
2026
|
-
mainAxis: p +
|
|
2026
|
+
mainAxis: p + O,
|
|
2027
2027
|
alignmentAxis: h
|
|
2028
2028
|
}),
|
|
2029
2029
|
g && Tr({
|
|
@@ -2032,7 +2032,7 @@ const Kt = "Popper", [Zt, Jt] = Ft(Kt), [no, Qt] = Zt(Kt), ro = (e) => {
|
|
|
2032
2032
|
limiter: x === "partial" ? Rr() : void 0,
|
|
2033
2033
|
...Ce
|
|
2034
2034
|
}),
|
|
2035
|
-
g &&
|
|
2035
|
+
g && Or({
|
|
2036
2036
|
...Ce
|
|
2037
2037
|
}),
|
|
2038
2038
|
Sr({
|
|
@@ -2048,9 +2048,9 @@ const Kt = "Popper", [Zt, Jt] = Ft(Kt), [no, Qt] = Zt(Kt), ro = (e) => {
|
|
|
2048
2048
|
}),
|
|
2049
2049
|
ho({
|
|
2050
2050
|
arrowWidth: W,
|
|
2051
|
-
arrowHeight:
|
|
2051
|
+
arrowHeight: O
|
|
2052
2052
|
}),
|
|
2053
|
-
$ &&
|
|
2053
|
+
$ && Ar({
|
|
2054
2054
|
strategy: "referenceHidden",
|
|
2055
2055
|
...Ce
|
|
2056
2056
|
})
|
|
@@ -2092,10 +2092,10 @@ const Kt = "Popper", [Zt, Jt] = Ft(Kt), [no, Qt] = Zt(Kt), ro = (e) => {
|
|
|
2092
2092
|
}, /* @__PURE__ */ _(ae.div, S({
|
|
2093
2093
|
"data-side": lt,
|
|
2094
2094
|
"data-align": ln
|
|
2095
|
-
},
|
|
2095
|
+
}, A, {
|
|
2096
2096
|
ref: E,
|
|
2097
2097
|
style: {
|
|
2098
|
-
...
|
|
2098
|
+
...A.style,
|
|
2099
2099
|
// if the PopperContent hasn't been placed yet (not all measurements done)
|
|
2100
2100
|
// we prevent animations so that users's animation don't kick in too early referring wrong sides
|
|
2101
2101
|
animation: Ee ? void 0 : "none",
|
|
@@ -2303,9 +2303,9 @@ const Po = /* @__PURE__ */ M((e, t) => /* @__PURE__ */ _(ae.span, S({}, e, {
|
|
|
2303
2303
|
wordWrap: "normal",
|
|
2304
2304
|
...e.style
|
|
2305
2305
|
}
|
|
2306
|
-
}))),
|
|
2307
|
-
|
|
2308
|
-
]), We =
|
|
2306
|
+
}))), Oo = Po, [ze, pi] = Ft("Tooltip", [
|
|
2307
|
+
Qt
|
|
2308
|
+
]), We = Qt(), Ao = "TooltipProvider", Co = 700, Ke = "tooltip.open", [Eo, it] = ze(Ao), To = (e) => {
|
|
2309
2309
|
const { __scopeTooltip: t, delayDuration: n = Co, skipDelayDuration: o = 300, disableHoverableContent: i = !1, children: r } = e, [s, a] = j(!0), c = L(!1), l = L(0);
|
|
2310
2310
|
return R(() => {
|
|
2311
2311
|
const u = l.current;
|
|
@@ -2331,12 +2331,12 @@ const Po = /* @__PURE__ */ M((e, t) => /* @__PURE__ */ _(ae.span, S({}, e, {
|
|
|
2331
2331
|
}, []),
|
|
2332
2332
|
disableHoverableContent: i
|
|
2333
2333
|
}, r);
|
|
2334
|
-
}, st = "Tooltip", [Ro,
|
|
2334
|
+
}, st = "Tooltip", [Ro, Ae] = ze(st), So = (e) => {
|
|
2335
2335
|
const { __scopeTooltip: t, children: n, open: o, defaultOpen: i = !1, onOpenChange: r, disableHoverableContent: s, delayDuration: a } = e, c = it(st, e.__scopeTooltip), l = We(t), [u, d] = j(null), p = mr(), f = L(0), h = s ?? c.disableHoverableContent, m = a ?? c.delayDuration, g = L(!1), [v = !1, y] = wo({
|
|
2336
2336
|
prop: o,
|
|
2337
2337
|
defaultProp: i,
|
|
2338
|
-
onChange: (
|
|
2339
|
-
|
|
2338
|
+
onChange: (A) => {
|
|
2339
|
+
A ? (c.onOpen(), document.dispatchEvent(new CustomEvent(Ke))) : c.onClose(), r == null || r(A);
|
|
2340
2340
|
}
|
|
2341
2341
|
}), x = $e(() => v ? g.current ? "delayed-open" : "instant-open" : "closed", [
|
|
2342
2342
|
v
|
|
@@ -2380,8 +2380,8 @@ const Po = /* @__PURE__ */ M((e, t) => /* @__PURE__ */ _(ae.span, S({}, e, {
|
|
|
2380
2380
|
onClose: b,
|
|
2381
2381
|
disableHoverableContent: h
|
|
2382
2382
|
}, n));
|
|
2383
|
-
},
|
|
2384
|
-
const { __scopeTooltip: n, ...o } = e, i =
|
|
2383
|
+
}, Ot = "TooltipTrigger", Do = /* @__PURE__ */ M((e, t) => {
|
|
2384
|
+
const { __scopeTooltip: n, ...o } = e, i = Ae(Ot, n), r = it(Ot, n), s = We(n), a = L(null), c = fe(t, a, i.onTriggerChange), l = L(!1), u = L(!1), d = k(
|
|
2385
2385
|
() => l.current = !1,
|
|
2386
2386
|
[]
|
|
2387
2387
|
);
|
|
@@ -2416,7 +2416,7 @@ const Po = /* @__PURE__ */ M((e, t) => /* @__PURE__ */ _(ae.span, S({}, e, {
|
|
|
2416
2416
|
}), nn = "TooltipPortal", [No, Lo] = ze(nn, {
|
|
2417
2417
|
forceMount: void 0
|
|
2418
2418
|
}), Mo = (e) => {
|
|
2419
|
-
const { __scopeTooltip: t, forceMount: n, children: o, container: i } = e, r =
|
|
2419
|
+
const { __scopeTooltip: t, forceMount: n, children: o, container: i } = e, r = Ae(nn, t);
|
|
2420
2420
|
return /* @__PURE__ */ _(No, {
|
|
2421
2421
|
scope: t,
|
|
2422
2422
|
forceMount: n
|
|
@@ -2427,7 +2427,7 @@ const Po = /* @__PURE__ */ M((e, t) => /* @__PURE__ */ _(ae.span, S({}, e, {
|
|
|
2427
2427
|
container: i
|
|
2428
2428
|
}, o)));
|
|
2429
2429
|
}, Pe = "TooltipContent", Io = /* @__PURE__ */ M((e, t) => {
|
|
2430
|
-
const n = Lo(Pe, e.__scopeTooltip), { forceMount: o = n.forceMount, side: i = "top", ...r } = e, s =
|
|
2430
|
+
const n = Lo(Pe, e.__scopeTooltip), { forceMount: o = n.forceMount, side: i = "top", ...r } = e, s = Ae(Pe, e.__scopeTooltip);
|
|
2431
2431
|
return /* @__PURE__ */ _(ot, {
|
|
2432
2432
|
present: o || s.open
|
|
2433
2433
|
}, s.disableHoverableContent ? /* @__PURE__ */ _(rn, S({
|
|
@@ -2440,7 +2440,7 @@ const Po = /* @__PURE__ */ M((e, t) => /* @__PURE__ */ _(ae.span, S({}, e, {
|
|
|
2440
2440
|
ref: t
|
|
2441
2441
|
})));
|
|
2442
2442
|
}), Fo = /* @__PURE__ */ M((e, t) => {
|
|
2443
|
-
const n =
|
|
2443
|
+
const n = Ae(Pe, e.__scopeTooltip), o = it(Pe, e.__scopeTooltip), i = L(null), r = fe(t, i), [s, a] = j(null), { trigger: c, onClose: l } = n, u = i.current, { onPointerInTransitChange: d } = o, p = k(() => {
|
|
2444
2444
|
a(null), d(!1);
|
|
2445
2445
|
}, [
|
|
2446
2446
|
d
|
|
@@ -2493,7 +2493,7 @@ const Po = /* @__PURE__ */ M((e, t) => /* @__PURE__ */ _(ae.span, S({}, e, {
|
|
|
2493
2493
|
}), [ko, Ho] = ze(st, {
|
|
2494
2494
|
isInside: !1
|
|
2495
2495
|
}), rn = /* @__PURE__ */ M((e, t) => {
|
|
2496
|
-
const { __scopeTooltip: n, children: o, "aria-label": i, onEscapeKeyDown: r, onPointerDownOutside: s, ...a } = e, c =
|
|
2496
|
+
const { __scopeTooltip: n, children: o, "aria-label": i, onEscapeKeyDown: r, onPointerDownOutside: s, ...a } = e, c = Ae(Pe, n), l = We(n), { onClose: u } = c;
|
|
2497
2497
|
return R(() => (document.addEventListener(Ke, u), () => document.removeEventListener(Ke, u)), [
|
|
2498
2498
|
u
|
|
2499
2499
|
]), R(() => {
|
|
@@ -2533,7 +2533,7 @@ const Po = /* @__PURE__ */ M((e, t) => /* @__PURE__ */ _(ae.span, S({}, e, {
|
|
|
2533
2533
|
}), /* @__PURE__ */ _(Ht, null, o), /* @__PURE__ */ _(ko, {
|
|
2534
2534
|
scope: n,
|
|
2535
2535
|
isInside: !0
|
|
2536
|
-
}, /* @__PURE__ */ _(
|
|
2536
|
+
}, /* @__PURE__ */ _(Oo, {
|
|
2537
2537
|
id: c.contentId,
|
|
2538
2538
|
role: "tooltip"
|
|
2539
2539
|
}, i || o))));
|
|
@@ -2664,7 +2664,7 @@ function Xo(e) {
|
|
|
2664
2664
|
}
|
|
2665
2665
|
return n.pop(), t.length === 1 && n.length === 1 && t[0].x === n[0].x && t[0].y === n[0].y ? t : t.concat(n);
|
|
2666
2666
|
}
|
|
2667
|
-
const Yo = To, qo = So, Ko = Do, Zo = Mo,
|
|
2667
|
+
const Yo = To, qo = So, Ko = Do, Zo = Mo, Qo = Io, Jo = jo;
|
|
2668
2668
|
function ei(e) {
|
|
2669
2669
|
return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
|
|
2670
2670
|
}
|
|
@@ -2727,7 +2727,7 @@ const ni = /* @__PURE__ */ ei(ti), ri = "_slideDownAndFade_1dyp8_1", oi = "_slid
|
|
|
2727
2727
|
START: "start",
|
|
2728
2728
|
CENTER: "center",
|
|
2729
2729
|
END: "end"
|
|
2730
|
-
},
|
|
2730
|
+
}, J = "purpur-tooltip", li = M(
|
|
2731
2731
|
({
|
|
2732
2732
|
["data-testid"]: e,
|
|
2733
2733
|
buttonSize: t = _n.MD,
|
|
@@ -2743,8 +2743,8 @@ const ni = /* @__PURE__ */ ei(ti), ri = "_slideDownAndFade_1dyp8_1", oi = "_slid
|
|
|
2743
2743
|
}, d) => {
|
|
2744
2744
|
const [p, f] = j(!1), h = Ne([
|
|
2745
2745
|
o,
|
|
2746
|
-
|
|
2747
|
-
`${
|
|
2746
|
+
J,
|
|
2747
|
+
`${J}--primary${r ? "-negative" : ""}`
|
|
2748
2748
|
]), m = /* @__PURE__ */ I(
|
|
2749
2749
|
St,
|
|
2750
2750
|
{
|
|
@@ -2758,7 +2758,7 @@ const ni = /* @__PURE__ */ ei(ti), ri = "_slideDownAndFade_1dyp8_1", oi = "_slid
|
|
|
2758
2758
|
children: /* @__PURE__ */ I(Nt, { size: "md" })
|
|
2759
2759
|
}
|
|
2760
2760
|
);
|
|
2761
|
-
return /* @__PURE__ */ I("div", { "data-testid": e, className: h, children: /* @__PURE__ */ I(Yo, { delayDuration: parseInt(
|
|
2761
|
+
return /* @__PURE__ */ I("div", { "data-testid": e, className: h, children: /* @__PURE__ */ I(Yo, { delayDuration: parseInt(Jn), children: /* @__PURE__ */ Ue(qo, { open: p, onOpenChange: f, ...u, children: [
|
|
2762
2762
|
/* @__PURE__ */ I(
|
|
2763
2763
|
Ko,
|
|
2764
2764
|
{
|
|
@@ -2770,24 +2770,24 @@ const ni = /* @__PURE__ */ ei(ti), ri = "_slideDownAndFade_1dyp8_1", oi = "_slid
|
|
|
2770
2770
|
}
|
|
2771
2771
|
),
|
|
2772
2772
|
/* @__PURE__ */ I(Zo, { children: /* @__PURE__ */ Ue(
|
|
2773
|
-
|
|
2773
|
+
Qo,
|
|
2774
2774
|
{
|
|
2775
2775
|
side: s,
|
|
2776
2776
|
align: a,
|
|
2777
2777
|
className: Ne([
|
|
2778
2778
|
i,
|
|
2779
|
-
oe[`${
|
|
2780
|
-
oe[`${
|
|
2779
|
+
oe[`${J}__content`],
|
|
2780
|
+
oe[`${J}__content--primary${r ? "-negative" : ""}`]
|
|
2781
2781
|
]),
|
|
2782
2782
|
sideOffset: -5,
|
|
2783
2783
|
"data-testid": `${e}-content`,
|
|
2784
2784
|
children: [
|
|
2785
2785
|
typeof n == "string" ? /* @__PURE__ */ I(
|
|
2786
|
-
|
|
2786
|
+
Qn,
|
|
2787
2787
|
{
|
|
2788
2788
|
className: Ne([
|
|
2789
|
-
oe[`${
|
|
2790
|
-
oe[`${
|
|
2789
|
+
oe[`${J}__paragraph`],
|
|
2790
|
+
oe[`${J}__paragraph--primary${r ? "-negative" : ""}`]
|
|
2791
2791
|
]),
|
|
2792
2792
|
variant: Mt.PARAGRAPH100,
|
|
2793
2793
|
"data-testid": `${e}-paragraph`,
|
|
@@ -2795,11 +2795,11 @@ const ni = /* @__PURE__ */ ei(ti), ri = "_slideDownAndFade_1dyp8_1", oi = "_slid
|
|
|
2795
2795
|
}
|
|
2796
2796
|
) : n,
|
|
2797
2797
|
/* @__PURE__ */ I(
|
|
2798
|
-
|
|
2798
|
+
Jo,
|
|
2799
2799
|
{
|
|
2800
2800
|
className: Ne([
|
|
2801
|
-
oe[`${
|
|
2802
|
-
oe[`${
|
|
2801
|
+
oe[`${J}__arrow`],
|
|
2802
|
+
oe[`${J}__arrow--primary${r ? "-negative" : ""}`]
|
|
2803
2803
|
])
|
|
2804
2804
|
}
|
|
2805
2805
|
)
|