@pismo/marola 1.1.17 → 1.1.18
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.
|
@@ -1,51 +1,51 @@
|
|
|
1
|
-
import { jsx as a, jsxs as
|
|
1
|
+
import { jsx as a, jsxs as S, Fragment as v } from "react/jsx-runtime";
|
|
2
2
|
import * as u from "react";
|
|
3
|
-
import { useRef as
|
|
4
|
-
import { T as
|
|
5
|
-
import { _ as
|
|
6
|
-
import { c as
|
|
7
|
-
import { C as
|
|
8
|
-
import '../../assets/Tooltip.css';function
|
|
9
|
-
const
|
|
10
|
-
if (!
|
|
3
|
+
import { useRef as P, useState as R, useEffect as C, isValidElement as T, cloneElement as q } from "react";
|
|
4
|
+
import { T as M, P as O } from "../../Popup-Ck3XlWMq.js";
|
|
5
|
+
import { _ as V, b as $, P as l } from "../../useSlotProps-C_I1kEHr.js";
|
|
6
|
+
import { c as z } from "../../clsx-DB4S2d7J.js";
|
|
7
|
+
import { C as D } from "../../ClickAwayListener-DbEYZpyh.js";
|
|
8
|
+
import '../../assets/Tooltip.css';function F() {
|
|
9
|
+
const n = u.useContext(M);
|
|
10
|
+
if (!n)
|
|
11
11
|
throw new Error("Missing transition context");
|
|
12
12
|
const {
|
|
13
13
|
registerTransition: o,
|
|
14
14
|
requestedEnter: r,
|
|
15
|
-
onExited:
|
|
16
|
-
} =
|
|
15
|
+
onExited: e
|
|
16
|
+
} = n;
|
|
17
17
|
return u.useEffect(() => o(), [o]), {
|
|
18
|
-
onExited:
|
|
18
|
+
onExited: e,
|
|
19
19
|
requestedEnter: r
|
|
20
20
|
};
|
|
21
21
|
}
|
|
22
|
-
const
|
|
23
|
-
function
|
|
22
|
+
const I = ["children", "className", "enterAnimationName", "enterClassName", "exitAnimationName", "exitClassName"];
|
|
23
|
+
function E(n) {
|
|
24
24
|
const {
|
|
25
25
|
children: o,
|
|
26
26
|
className: r,
|
|
27
|
-
enterAnimationName:
|
|
27
|
+
enterAnimationName: e,
|
|
28
28
|
enterClassName: c,
|
|
29
29
|
exitAnimationName: _,
|
|
30
30
|
exitClassName: f
|
|
31
|
-
} =
|
|
31
|
+
} = n, p = V(n, I), {
|
|
32
32
|
requestedEnter: d,
|
|
33
33
|
onExited: s
|
|
34
|
-
} =
|
|
34
|
+
} = F(), i = u.useRef(!0);
|
|
35
35
|
u.useEffect(() => {
|
|
36
36
|
d && i.current && (i.current = !1);
|
|
37
37
|
}, [d]);
|
|
38
38
|
const N = u.useCallback((t) => {
|
|
39
|
-
t.animationName === _ ? (s(), i.current = !0) : t.animationName ===
|
|
40
|
-
}, [s, _,
|
|
41
|
-
return /* @__PURE__ */ a("div",
|
|
39
|
+
t.animationName === _ ? (s(), i.current = !0) : t.animationName === e && (i.current = !1);
|
|
40
|
+
}, [s, _, e]);
|
|
41
|
+
return /* @__PURE__ */ a("div", $({
|
|
42
42
|
onAnimationEnd: N,
|
|
43
|
-
className:
|
|
43
|
+
className: z(r, d ? c : f)
|
|
44
44
|
}, p, {
|
|
45
45
|
children: o
|
|
46
46
|
}));
|
|
47
47
|
}
|
|
48
|
-
process.env.NODE_ENV !== "production" && (
|
|
48
|
+
process.env.NODE_ENV !== "production" && (E.propTypes = {
|
|
49
49
|
children: l.node,
|
|
50
50
|
className: l.string,
|
|
51
51
|
enterAnimationName: l.string,
|
|
@@ -53,8 +53,8 @@ process.env.NODE_ENV !== "production" && (b.propTypes = {
|
|
|
53
53
|
exitAnimationName: l.string,
|
|
54
54
|
exitClassName: l.string
|
|
55
55
|
});
|
|
56
|
-
const
|
|
57
|
-
tooltip:
|
|
56
|
+
const W = "_tooltip_1dujm_1", m = {
|
|
57
|
+
tooltip: W,
|
|
58
58
|
"tooltip--small-padding": "_tooltip--small-padding_1dujm_5",
|
|
59
59
|
"tooltip--normal-padding": "_tooltip--normal-padding_1dujm_8",
|
|
60
60
|
"tooltip--white-theme": "_tooltip--white-theme_1dujm_11",
|
|
@@ -64,11 +64,11 @@ const B = "_tooltip_1dujm_1", m = {
|
|
|
64
64
|
"tooltip--open-animation": "_tooltip--open-animation_1dujm_1",
|
|
65
65
|
"tooltip--anim-close": "_tooltip--anim-close_1dujm_23",
|
|
66
66
|
"tooltip--close-animation": "_tooltip--close-animation_1dujm_1"
|
|
67
|
-
},
|
|
68
|
-
arialRole:
|
|
67
|
+
}, U = ({
|
|
68
|
+
arialRole: n,
|
|
69
69
|
children: o,
|
|
70
70
|
className: r,
|
|
71
|
-
disableHoverListener:
|
|
71
|
+
disableHoverListener: e,
|
|
72
72
|
onClose: c,
|
|
73
73
|
padding: _ = "small",
|
|
74
74
|
position: f = "bottom",
|
|
@@ -78,57 +78,55 @@ const B = "_tooltip_1dujm_1", m = {
|
|
|
78
78
|
onTargetCreated: i,
|
|
79
79
|
...N
|
|
80
80
|
}) => {
|
|
81
|
-
const t =
|
|
82
|
-
let j =
|
|
83
|
-
|
|
81
|
+
const t = P(null), [b, h] = R(p || !1);
|
|
82
|
+
let j = b;
|
|
83
|
+
C(() => {
|
|
84
84
|
h(p || !1);
|
|
85
85
|
}, [p]);
|
|
86
|
-
const A =
|
|
86
|
+
const A = T(o) ? o : /* @__PURE__ */ a("span", { children: o });
|
|
87
87
|
!s && s !== 0 && (j = !1);
|
|
88
|
-
const
|
|
89
|
-
c == null || c(), !
|
|
88
|
+
const y = () => {
|
|
89
|
+
c == null || c(), !e && h(!1);
|
|
90
90
|
};
|
|
91
|
-
|
|
92
|
-
var C;
|
|
91
|
+
C(() => {
|
|
93
92
|
if (t != null && t.current) {
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
x && (n || (x.onpointerenter = () => h(!0), x.onpointerleave = () => h(!1)));
|
|
93
|
+
const x = t == null ? void 0 : t.current;
|
|
94
|
+
i == null || i(x), e || (x.onpointerenter = () => h(!0), x.onpointerleave = () => h(!1));
|
|
97
95
|
}
|
|
98
|
-
}, [t,
|
|
99
|
-
const
|
|
96
|
+
}, [t, e]);
|
|
97
|
+
const g = {
|
|
100
98
|
padding: f.match(/(bottom|top)/) ? ".25rem 0" : "0 .25rem",
|
|
101
99
|
zIndex: 1
|
|
102
|
-
},
|
|
100
|
+
}, k = [
|
|
103
101
|
m.tooltip,
|
|
104
102
|
m[`tooltip--${d}-theme`],
|
|
105
103
|
m[`tooltip--${_}-padding`],
|
|
106
104
|
r || ""
|
|
107
|
-
].join(" ").trim(),
|
|
105
|
+
].join(" ").trim(), w = {
|
|
108
106
|
...A.props,
|
|
109
107
|
ref: t
|
|
110
108
|
};
|
|
111
|
-
return /* @__PURE__ */ v
|
|
112
|
-
|
|
109
|
+
return /* @__PURE__ */ S(v, { children: [
|
|
110
|
+
q(A, w),
|
|
113
111
|
/* @__PURE__ */ a(
|
|
114
|
-
|
|
112
|
+
O,
|
|
115
113
|
{
|
|
116
114
|
disablePortal: !0,
|
|
117
115
|
...N,
|
|
118
116
|
open: j,
|
|
119
117
|
anchor: t == null ? void 0 : t.current,
|
|
120
|
-
style:
|
|
121
|
-
role:
|
|
118
|
+
style: g,
|
|
119
|
+
role: n,
|
|
122
120
|
placement: f,
|
|
123
121
|
children: /* @__PURE__ */ a(
|
|
124
|
-
|
|
122
|
+
E,
|
|
125
123
|
{
|
|
126
124
|
className: m["tooltip--animation"],
|
|
127
125
|
enterClassName: m["tooltip--anim-open"],
|
|
128
126
|
exitClassName: m["tooltip--anim-close"],
|
|
129
127
|
enterAnimationName: "tooltip--open-animation",
|
|
130
128
|
exitAnimationName: "tooltip--close-animation",
|
|
131
|
-
children: /* @__PURE__ */ a("div", { className:
|
|
129
|
+
children: /* @__PURE__ */ a("div", { className: k, children: /* @__PURE__ */ a(D, { onClickAway: y, children: /* @__PURE__ */ a("div", { children: s }) }) })
|
|
132
130
|
}
|
|
133
131
|
)
|
|
134
132
|
}
|
|
@@ -136,5 +134,5 @@ const B = "_tooltip_1dujm_1", m = {
|
|
|
136
134
|
] });
|
|
137
135
|
};
|
|
138
136
|
export {
|
|
139
|
-
|
|
137
|
+
U as Tooltip
|
|
140
138
|
};
|