se-design 1.0.87-dev.1 → 1.0.87-dev.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/Icon/index.d.ts +5 -0
- package/dist/components/Tooltip/index.d.ts +5 -1
- package/dist/index16.js +111 -107
- package/dist/index16.js.map +1 -1
- package/dist/index38.js +84 -84
- package/dist/index38.js.map +1 -1
- package/dist/index4.js +66 -61
- package/dist/index4.js.map +1 -1
- package/dist/index6.js +305 -301
- package/dist/index6.js.map +1 -1
- package/package.json +1 -1
|
@@ -50,5 +50,10 @@ export type IconProps = {
|
|
|
50
50
|
* For mouse users only; does not replace ariaLabel for screen readers.
|
|
51
51
|
*/
|
|
52
52
|
htmlTitle?: string;
|
|
53
|
+
/**
|
|
54
|
+
* Override tab order. Pass tabIndex={0} to make a non-interactive or disabled icon
|
|
55
|
+
* focusable (e.g. for tooltip access). Overrides the hook's default when provided.
|
|
56
|
+
*/
|
|
57
|
+
tabIndex?: number;
|
|
53
58
|
};
|
|
54
59
|
export declare const Icon: React.ForwardRefExoticComponent<IconProps & React.RefAttributes<HTMLDivElement>>;
|
|
@@ -29,6 +29,10 @@ export interface TooltipProps {
|
|
|
29
29
|
* Required when isTriggerDisabled is true. Provides an accessible name for the focusable wrapper trigger.
|
|
30
30
|
*/
|
|
31
31
|
disabledTriggerAriaLabel?: string;
|
|
32
|
+
/**
|
|
33
|
+
* When true, tooltip is suppressed — renders tooltipSrc only, no tooltip behavior.
|
|
34
|
+
*/
|
|
35
|
+
disabled?: boolean;
|
|
32
36
|
/**
|
|
33
37
|
* Max width of the tooltip content
|
|
34
38
|
*/
|
|
@@ -50,4 +54,4 @@ export interface TooltipProps {
|
|
|
50
54
|
*/
|
|
51
55
|
automationId?: string;
|
|
52
56
|
}
|
|
53
|
-
export declare const Tooltip: ({ content, tooltipSrc, position, displayOn, maxWidth, isWithPortal, tooltipSrcRef, isTriggerDisabled, disabledTriggerAriaLabel, tooltipContentClasses, tooltipOffset, automationId }: TooltipProps) => React.JSX.Element;
|
|
57
|
+
export declare const Tooltip: ({ content, tooltipSrc, position, displayOn, disabled, maxWidth, isWithPortal, tooltipSrcRef, isTriggerDisabled, disabledTriggerAriaLabel, tooltipContentClasses, tooltipOffset, automationId }: TooltipProps) => React.JSX.Element;
|
package/dist/index16.js
CHANGED
|
@@ -1,227 +1,231 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import { useStableId as
|
|
4
|
-
import { useDismissOnFocusOut as
|
|
1
|
+
import c, { useState as N, useRef as $, useEffect as P } from "react";
|
|
2
|
+
import ee, { flushSync as te } from "react-dom";
|
|
3
|
+
import { useStableId as oe } from "./index206.js";
|
|
4
|
+
import { useDismissOnFocusOut as re } from "./index80.js";
|
|
5
5
|
import "./index72.js";
|
|
6
6
|
function I() {
|
|
7
|
-
return I = Object.assign ? Object.assign.bind() : function(
|
|
8
|
-
for (var
|
|
9
|
-
var s = arguments[
|
|
10
|
-
for (var
|
|
7
|
+
return I = Object.assign ? Object.assign.bind() : function(v) {
|
|
8
|
+
for (var p = 1; p < arguments.length; p++) {
|
|
9
|
+
var s = arguments[p];
|
|
10
|
+
for (var d in s) ({}).hasOwnProperty.call(s, d) && (v[d] = s[d]);
|
|
11
11
|
}
|
|
12
|
-
return
|
|
12
|
+
return v;
|
|
13
13
|
}, I.apply(null, arguments);
|
|
14
14
|
}
|
|
15
|
-
const
|
|
16
|
-
content:
|
|
17
|
-
tooltipSrc:
|
|
15
|
+
const de = ({
|
|
16
|
+
content: v,
|
|
17
|
+
tooltipSrc: p,
|
|
18
18
|
position: s = "bottom-center",
|
|
19
|
-
displayOn:
|
|
19
|
+
displayOn: d = "hover",
|
|
20
|
+
disabled: z = !1,
|
|
20
21
|
maxWidth: B = 240,
|
|
21
22
|
isWithPortal: F = !1,
|
|
22
23
|
tooltipSrcRef: w = void 0,
|
|
23
24
|
isTriggerDisabled: y = !1,
|
|
24
|
-
disabledTriggerAriaLabel:
|
|
25
|
-
tooltipContentClasses:
|
|
26
|
-
tooltipOffset:
|
|
27
|
-
automationId:
|
|
25
|
+
disabledTriggerAriaLabel: S = void 0,
|
|
26
|
+
tooltipContentClasses: _ = "",
|
|
27
|
+
tooltipOffset: m = 8,
|
|
28
|
+
automationId: K = ""
|
|
28
29
|
}) => {
|
|
29
|
-
const [L,
|
|
30
|
+
const [L, g] = N(!1), M = $(null), V = $(null), E = w || V, [q, U] = N({}), [k, D] = N(!1), A = $(null), H = typeof v == "string", x = oe(void 0, "tooltip-content"), T = () => {
|
|
30
31
|
A.current && (clearTimeout(A.current), A.current = null);
|
|
31
32
|
}, C = () => {
|
|
32
|
-
|
|
33
|
-
},
|
|
34
|
-
T(),
|
|
35
|
-
},
|
|
33
|
+
d !== "always-on" && (T(), A.current = setTimeout(() => g(!1), 150));
|
|
34
|
+
}, R = () => {
|
|
35
|
+
T(), g(!0);
|
|
36
|
+
}, W = (e) => {
|
|
36
37
|
if (y) {
|
|
37
38
|
if (e.key === "Escape") {
|
|
38
|
-
e.preventDefault(),
|
|
39
|
+
e.preventDefault(), g(!1);
|
|
39
40
|
return;
|
|
40
41
|
}
|
|
41
|
-
(e.key === "Enter" || e.key === " ") && (e.preventDefault(),
|
|
42
|
+
(e.key === "Enter" || e.key === " ") && (e.preventDefault(), g((t) => !t));
|
|
42
43
|
}
|
|
43
|
-
},
|
|
44
|
+
}, G = re({
|
|
44
45
|
disabled: y,
|
|
45
|
-
onFocusIn:
|
|
46
|
+
onFocusIn: R,
|
|
46
47
|
onFocusOut: C,
|
|
47
|
-
onEscape: () =>
|
|
48
|
+
onEscape: () => g(!1)
|
|
48
49
|
});
|
|
49
50
|
P(() => {
|
|
50
51
|
const e = M.current;
|
|
51
|
-
e && (s == "bottom-center" ? (e.setAttribute("style", "left: 50%;transform: translateX(-50%);"), e.classList.add("before:left-[calc(50%-7px)]"), e.classList.add("before:top-[-7px]")) : s == "bottom-left" ? (e.classList.add("before:left-[calc(10%-7px)]"), e.classList.add("before:top-[-7px]")) : s == "bottom-right" ? (e.setAttribute("style", "right: 0;"), e.classList.add("before:right-[calc(10%+7px)]"), e.classList.add("before:top-[-7px]")) : s == "top-center" ? (e.setAttribute("style", "left: 50%;transform: translateX(-50%);bottom: calc(100% + 8px);"), e.classList.add("before:left-[calc(50%-7px)]"), e.classList.add("before:bottom-[-7px]")) : s == "top-left" ? (e.setAttribute("style", "bottom: calc(100% + 8px);"), e.classList.add("before:left-[calc(10%-7px)]"), e.classList.add("before:bottom-[-7px]")) : s == "top-right" ? (e.setAttribute("style", "right: 0;bottom: calc(100% + 8px);"), e.classList.add("before:right-[calc(10%+7px)]"), e.classList.add("before:bottom-[-7px]")) : s == "left-top" ? (e.setAttribute("style", "right: calc(100% + 10px);top:0;"), e.classList.add("before:right-[-6px]"), e.classList.add("before:top-[7px]")) : s == "left-center" ? (e.setAttribute("style", "right: calc(100% + 10px);top: 50%;transform: translateY(-50%);"), e.classList.add("before:right-[-6px]"), e.classList.add("before:top-[calc(50%-7px)]")) : s == "left-bottom" ? (e.setAttribute("style", "right: calc(100% + 10px);bottom:0;"), e.classList.add("before:right-[-6px]"), e.classList.add("before:bottom-[7px]")) : s == "right-top" ? (e.setAttribute("style", "left: calc(100% + 10px);top:0;"), e.classList.add("before:left-[-6px]"), e.classList.add("before:top-[7px]")) : s == "right-center" ? (e.setAttribute("style", "left: calc(100% + 10px);top: 50%;transform: translateY(-50%);"), e.classList.add("before:left-[-6px]"), e.classList.add("before:top-[calc(50%-7px)]")) : s == "right-bottom" && (e.setAttribute("style", "left: calc(100% + 10px);bottom:0;"), e.classList.add("before:left-[-6px]"), e.classList.add("before:bottom-[7px]")),
|
|
52
|
-
}, [
|
|
52
|
+
e && (s == "bottom-center" ? (e.setAttribute("style", "left: 50%;transform: translateX(-50%);"), e.classList.add("before:left-[calc(50%-7px)]"), e.classList.add("before:top-[-7px]")) : s == "bottom-left" ? (e.classList.add("before:left-[calc(10%-7px)]"), e.classList.add("before:top-[-7px]")) : s == "bottom-right" ? (e.setAttribute("style", "right: 0;"), e.classList.add("before:right-[calc(10%+7px)]"), e.classList.add("before:top-[-7px]")) : s == "top-center" ? (e.setAttribute("style", "left: 50%;transform: translateX(-50%);bottom: calc(100% + 8px);"), e.classList.add("before:left-[calc(50%-7px)]"), e.classList.add("before:bottom-[-7px]")) : s == "top-left" ? (e.setAttribute("style", "bottom: calc(100% + 8px);"), e.classList.add("before:left-[calc(10%-7px)]"), e.classList.add("before:bottom-[-7px]")) : s == "top-right" ? (e.setAttribute("style", "right: 0;bottom: calc(100% + 8px);"), e.classList.add("before:right-[calc(10%+7px)]"), e.classList.add("before:bottom-[-7px]")) : s == "left-top" ? (e.setAttribute("style", "right: calc(100% + 10px);top:0;"), e.classList.add("before:right-[-6px]"), e.classList.add("before:top-[7px]")) : s == "left-center" ? (e.setAttribute("style", "right: calc(100% + 10px);top: 50%;transform: translateY(-50%);"), e.classList.add("before:right-[-6px]"), e.classList.add("before:top-[calc(50%-7px)]")) : s == "left-bottom" ? (e.setAttribute("style", "right: calc(100% + 10px);bottom:0;"), e.classList.add("before:right-[-6px]"), e.classList.add("before:bottom-[7px]")) : s == "right-top" ? (e.setAttribute("style", "left: calc(100% + 10px);top:0;"), e.classList.add("before:left-[-6px]"), e.classList.add("before:top-[7px]")) : s == "right-center" ? (e.setAttribute("style", "left: calc(100% + 10px);top: 50%;transform: translateY(-50%);"), e.classList.add("before:left-[-6px]"), e.classList.add("before:top-[calc(50%-7px)]")) : s == "right-bottom" && (e.setAttribute("style", "left: calc(100% + 10px);bottom:0;"), e.classList.add("before:left-[-6px]"), e.classList.add("before:bottom-[7px]")), d == "hover" && e.classList.add("group-hover:visible"));
|
|
53
|
+
}, [v]), P(() => {
|
|
53
54
|
const e = M.current;
|
|
54
55
|
e && (L ? e.classList.remove("invisible") : e.classList.add("invisible"));
|
|
55
56
|
}, [L]), P(() => {
|
|
56
|
-
|
|
57
|
-
}, [
|
|
58
|
-
const
|
|
59
|
-
|
|
60
|
-
},
|
|
61
|
-
...
|
|
57
|
+
d === "always-on" && g(!0);
|
|
58
|
+
}, [d]);
|
|
59
|
+
const J = () => {
|
|
60
|
+
d == "click" && g((e) => !e);
|
|
61
|
+
}, Q = {
|
|
62
|
+
...d === "click" && {
|
|
62
63
|
onClick: () => {
|
|
63
|
-
|
|
64
|
+
g((e) => !e);
|
|
64
65
|
}
|
|
65
66
|
},
|
|
66
|
-
...
|
|
67
|
-
onMouseEnter: () =>
|
|
68
|
-
onMouseLeave: () =>
|
|
67
|
+
...d === "hover" && {
|
|
68
|
+
onMouseEnter: () => g(!0),
|
|
69
|
+
onMouseLeave: () => g(!1)
|
|
69
70
|
}
|
|
70
|
-
},
|
|
71
|
-
const e =
|
|
71
|
+
}, Z = () => {
|
|
72
|
+
const e = E.current;
|
|
72
73
|
if (!e)
|
|
73
74
|
return {};
|
|
74
|
-
const t = e.getBoundingClientRect(), n = window.scrollX || window.pageXOffset,
|
|
75
|
-
let a = 0,
|
|
75
|
+
const t = e.getBoundingClientRect(), n = window.scrollX || window.pageXOffset, i = window.scrollY || window.pageYOffset, o = 14, h = document.getElementById(x), r = h?.offsetWidth || 0, l = h?.offsetHeight || 0;
|
|
76
|
+
let a = 0, f = 0, b = 0, u = 0;
|
|
76
77
|
switch (s) {
|
|
77
78
|
case "bottom-center":
|
|
78
|
-
a = t.bottom +
|
|
79
|
+
a = t.bottom + i + m, f = t.left + n + t.width / 2 - r / 2, b = r / 2 - o / 2, u = -o / 2;
|
|
79
80
|
break;
|
|
80
81
|
case "bottom-left":
|
|
81
|
-
a = t.bottom +
|
|
82
|
+
a = t.bottom + i + m, f = t.left + n, b = r * 0.1 - o / 2, u = -o / 2;
|
|
82
83
|
break;
|
|
83
84
|
case "bottom-right":
|
|
84
|
-
a = t.bottom +
|
|
85
|
+
a = t.bottom + i + m, f = t.right + n - r, b = r - r * 0.1 - o / 2, u = -o / 2;
|
|
85
86
|
break;
|
|
86
87
|
case "top-center":
|
|
87
|
-
a = t.top +
|
|
88
|
+
a = t.top + i - l - m, f = t.left + n + t.width / 2 - r / 2, b = r / 2 - o / 2, u = l - o / 2;
|
|
88
89
|
break;
|
|
89
90
|
case "top-left":
|
|
90
|
-
a = t.top +
|
|
91
|
+
a = t.top + i - l - m, f = t.left + n, b = r * 0.1 - o / 2, u = l - o / 2;
|
|
91
92
|
break;
|
|
92
93
|
case "top-right":
|
|
93
|
-
a = t.top +
|
|
94
|
+
a = t.top + i - l - m, f = t.right + n - r, b = r - r * 0.1 - o / 2, u = l - o / 2;
|
|
94
95
|
break;
|
|
95
96
|
case "left-top":
|
|
96
|
-
a = t.top +
|
|
97
|
+
a = t.top + i, f = t.left + n - r - m, b = r - o / 2, u = o / 2;
|
|
97
98
|
break;
|
|
98
99
|
case "left-center":
|
|
99
|
-
a = t.top +
|
|
100
|
+
a = t.top + i + t.height / 2 - l / 2, f = t.left + n - r - m, b = r - o / 2, u = l / 2 - o / 2;
|
|
100
101
|
break;
|
|
101
102
|
case "left-bottom":
|
|
102
|
-
a = t.bottom +
|
|
103
|
+
a = t.bottom + i - l, f = t.left + n - r - m, b = r - o / 2, u = l - o / 2;
|
|
103
104
|
break;
|
|
104
105
|
case "right-top":
|
|
105
|
-
a = t.top +
|
|
106
|
+
a = t.top + i, f = t.right + n + m, b = -o / 2, u = o / 2;
|
|
106
107
|
break;
|
|
107
108
|
case "right-center":
|
|
108
|
-
a = t.top +
|
|
109
|
+
a = t.top + i + t.height / 2 - l / 2, f = t.right + n + m, b = -o / 2, u = l / 2 - o / 2;
|
|
109
110
|
break;
|
|
110
111
|
case "right-bottom":
|
|
111
|
-
a = t.bottom +
|
|
112
|
+
a = t.bottom + i - l, f = t.right + n + m, b = -o / 2, u = l - o / 2;
|
|
112
113
|
break;
|
|
113
114
|
default:
|
|
114
|
-
a = t.bottom +
|
|
115
|
+
a = t.bottom + i + m, f = t.left + n + t.width / 2 - r / 2, b = r / 2 - o / 2, u = -o / 2;
|
|
115
116
|
break;
|
|
116
117
|
}
|
|
117
118
|
return {
|
|
118
119
|
position: "absolute",
|
|
119
120
|
top: `${a}px`,
|
|
120
|
-
left: `${
|
|
121
|
+
left: `${f}px`,
|
|
121
122
|
zIndex: 9999,
|
|
122
|
-
"--arrow-left": `${
|
|
123
|
-
"--arrow-top": `${
|
|
123
|
+
"--arrow-left": `${b}px`,
|
|
124
|
+
"--arrow-top": `${u}px`
|
|
124
125
|
};
|
|
125
126
|
};
|
|
126
|
-
P(() => {
|
|
127
|
+
if (P(() => {
|
|
127
128
|
if (!L || !F) {
|
|
128
|
-
|
|
129
|
+
D(!1);
|
|
129
130
|
return;
|
|
130
131
|
}
|
|
131
132
|
const e = () => {
|
|
132
|
-
const h = document.getElementById(
|
|
133
|
+
const h = document.getElementById(x);
|
|
133
134
|
if (!h || h.offsetHeight === 0) {
|
|
134
135
|
requestAnimationFrame(e);
|
|
135
136
|
return;
|
|
136
137
|
}
|
|
137
|
-
const r =
|
|
138
|
-
|
|
139
|
-
U(r),
|
|
138
|
+
const r = Z();
|
|
139
|
+
te(() => {
|
|
140
|
+
U(r), D(!0);
|
|
140
141
|
});
|
|
141
142
|
}, t = setTimeout(e, w ? 60 : 10), n = (h) => {
|
|
142
|
-
const r = document.getElementById(
|
|
143
|
-
r && l && !r.contains(a) && !l.contains(a) &&
|
|
144
|
-
},
|
|
145
|
-
|
|
143
|
+
const r = document.getElementById(x), l = E.current, a = h.target;
|
|
144
|
+
r && l && !r.contains(a) && !l.contains(a) && g(!1);
|
|
145
|
+
}, i = d !== "always-on";
|
|
146
|
+
i && document.body.addEventListener("click", n, !0), window.addEventListener("scroll", e, !0), window.addEventListener("resize", e);
|
|
146
147
|
let o = null;
|
|
147
|
-
return w &&
|
|
148
|
+
return w && E.current && (o = new MutationObserver(() => {
|
|
148
149
|
e();
|
|
149
|
-
}), o.observe(
|
|
150
|
+
}), o.observe(E.current, {
|
|
150
151
|
attributes: !0,
|
|
151
152
|
attributeFilter: ["style", "class"]
|
|
152
153
|
})), () => {
|
|
153
|
-
clearTimeout(t), T(),
|
|
154
|
+
clearTimeout(t), T(), i && document.body.removeEventListener("click", n, !0), window.removeEventListener("scroll", e, !0), window.removeEventListener("resize", e), o && o.disconnect();
|
|
154
155
|
};
|
|
155
|
-
}, [L, F, s,
|
|
156
|
-
const
|
|
157
|
-
"aria-describedby":
|
|
158
|
-
...typeof
|
|
159
|
-
ariaDescribedBy:
|
|
156
|
+
}, [L, F, s, d, w, x]), z) return /* @__PURE__ */ c.createElement(c.Fragment, null, p);
|
|
157
|
+
const O = /* @__PURE__ */ c.isValidElement(p) && p.props.disabled, X = !y && /* @__PURE__ */ c.isValidElement(p) ? /* @__PURE__ */ c.cloneElement(p, {
|
|
158
|
+
"aria-describedby": x,
|
|
159
|
+
...typeof p.type != "string" && {
|
|
160
|
+
ariaDescribedBy: x
|
|
161
|
+
},
|
|
162
|
+
...O && {
|
|
163
|
+
tabIndex: 0
|
|
160
164
|
}
|
|
161
|
-
}) :
|
|
165
|
+
}) : p, Y = y ? {
|
|
162
166
|
tabIndex: 0,
|
|
163
167
|
role: "button",
|
|
164
|
-
"aria-label":
|
|
165
|
-
"aria-describedby":
|
|
166
|
-
onFocus:
|
|
168
|
+
"aria-label": S,
|
|
169
|
+
"aria-describedby": x,
|
|
170
|
+
onFocus: R,
|
|
167
171
|
onBlur: C,
|
|
168
|
-
onKeyDown:
|
|
169
|
-
} : void 0,
|
|
170
|
-
return F ? /* @__PURE__ */
|
|
172
|
+
onKeyDown: W
|
|
173
|
+
} : void 0, j = y ? void 0 : G;
|
|
174
|
+
return F ? /* @__PURE__ */ c.createElement("div", I({
|
|
171
175
|
className: "se-design-tooltip group relative inline-flex items-center min-w-0"
|
|
172
|
-
},
|
|
176
|
+
}, Q, Y, j), /* @__PURE__ */ c.createElement("div", {
|
|
173
177
|
className: "cursor-pointer flex items-center min-w-0",
|
|
174
|
-
ref: w ? void 0 :
|
|
175
|
-
onMouseEnter:
|
|
178
|
+
ref: w ? void 0 : E,
|
|
179
|
+
onMouseEnter: d === "always-on" ? void 0 : T,
|
|
176
180
|
onMouseLeave: C
|
|
177
|
-
},
|
|
181
|
+
}, X), L && /* @__PURE__ */ ee.createPortal(/* @__PURE__ */ c.createElement(c.Fragment, null, /* @__PURE__ */ c.createElement("style", null, `#${x}::before {
|
|
178
182
|
left: var(--arrow-left, 0);
|
|
179
183
|
top: var(--arrow-top, 0);
|
|
180
|
-
}`), /* @__PURE__ */
|
|
181
|
-
id:
|
|
184
|
+
}`), /* @__PURE__ */ c.createElement("div", {
|
|
185
|
+
id: x,
|
|
182
186
|
role: "tooltip",
|
|
183
187
|
className: `flex justify-center px-3 py-2 min-w-24 bg-[var(--color-gray-800)] text-[var(--color-white)] text-base rounded-[3px]
|
|
184
188
|
before:content-[' '] before:w-3.5 before:h-3.5 before:bg-[var(--color-gray-800)] before:inline-block
|
|
185
|
-
before:absolute before:rounded-tl-sm before:rotate-45 ${
|
|
189
|
+
before:absolute before:rounded-tl-sm before:rotate-45 ${_}`,
|
|
186
190
|
style: {
|
|
187
191
|
...q,
|
|
188
192
|
maxWidth: `${B}px`,
|
|
189
193
|
wordBreak: "break-word",
|
|
190
194
|
overflowWrap: "break-word",
|
|
191
|
-
visibility:
|
|
192
|
-
opacity:
|
|
193
|
-
pointerEvents:
|
|
194
|
-
transition:
|
|
195
|
+
visibility: k ? "visible" : "hidden",
|
|
196
|
+
opacity: k ? 1 : 0,
|
|
197
|
+
pointerEvents: k ? "auto" : "none",
|
|
198
|
+
transition: k ? "opacity 0.15s ease-in" : "none",
|
|
195
199
|
// Ensure it stays at 0,0 until positioned to avoid any visual flash
|
|
196
|
-
...
|
|
200
|
+
...k ? {} : {
|
|
197
201
|
position: "fixed",
|
|
198
202
|
top: "0px",
|
|
199
203
|
left: "0px"
|
|
200
204
|
}
|
|
201
205
|
},
|
|
202
|
-
onMouseEnter:
|
|
206
|
+
onMouseEnter: d === "always-on" ? void 0 : T,
|
|
203
207
|
onMouseLeave: C
|
|
204
|
-
},
|
|
208
|
+
}, H ? /* @__PURE__ */ c.createElement("p", {
|
|
205
209
|
className: "leading-normal"
|
|
206
|
-
},
|
|
210
|
+
}, v) : v)), document.body)) : /* @__PURE__ */ c.createElement("div", I({
|
|
207
211
|
className: "se-design-tooltip group relative inline-flex items-center min-w-0",
|
|
208
|
-
onClick:
|
|
209
|
-
},
|
|
212
|
+
onClick: J
|
|
213
|
+
}, Y, j), /* @__PURE__ */ c.createElement("div", {
|
|
210
214
|
className: "cursor-pointer flex items-center min-w-0"
|
|
211
|
-
},
|
|
215
|
+
}, X), /* @__PURE__ */ c.createElement("div", {
|
|
212
216
|
ref: M,
|
|
213
|
-
id:
|
|
217
|
+
id: x,
|
|
214
218
|
role: "tooltip",
|
|
215
219
|
className: `flex justify-center px-3 py-2 min-w-24 max-w-[${B}px]
|
|
216
220
|
absolute top-[calc(100%+8px)] w-max bg-[var(--color-gray-800)] text-[var(--color-white)] text-base rounded-[3px]
|
|
217
221
|
before:content-[' '] before:w-3.5 before:h-3.5 before:bg-[var(--color-gray-800)] before:inline-block
|
|
218
222
|
before:absolute before:rounded-tl-sm before:rotate-45`,
|
|
219
|
-
"data-automation-id":
|
|
220
|
-
},
|
|
223
|
+
"data-automation-id": K || "tooltip-content"
|
|
224
|
+
}, H ? /* @__PURE__ */ c.createElement("p", {
|
|
221
225
|
className: "leading-normal"
|
|
222
|
-
},
|
|
226
|
+
}, v) : v));
|
|
223
227
|
};
|
|
224
228
|
export {
|
|
225
|
-
|
|
229
|
+
de as Tooltip
|
|
226
230
|
};
|
|
227
231
|
//# sourceMappingURL=index16.js.map
|
package/dist/index16.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index16.js","sources":["../src/components/Tooltip/index.tsx"],"sourcesContent":["import React, { useEffect, useState, useRef } from 'react';\nimport ReactDOM, { flushSync } from 'react-dom';\nimport { useStableId } from '../../utils/useStableId';\nimport { useDismissOnFocusOut } from '../../utils/a11y';\n\nexport interface TooltipProps {\n /**\n * Tooltip contents\n */\n content: string | React.ReactNode;\n /**\n * Tooltip position\n */\n position?:\n | 'top-left'\n | 'top-center'\n | 'top-right'\n | 'bottom-left'\n | 'bottom-center'\n | 'bottom-right'\n | 'left-top'\n | 'left-center'\n | 'left-bottom'\n | 'right-top'\n | 'right-center'\n | 'right-bottom';\n /**\n * Display tooltip on Hover, Click or Always\n */\n displayOn?: 'hover' | 'click' | 'always-on';\n /**\n * Tooltip trigger contents\n */\n tooltipSrc?: React.ReactNode;\n /**\n * Tooltip trigger contents ref\n */\n tooltipSrcRef?: React.RefObject<HTMLElement>;\n /**\n * When true, the real trigger is disabled and cannot receive focus.\n * Tooltip will make its wrapper focusable and treat it as a \"button\" that reveals tooltip content.\n */\n isTriggerDisabled?: boolean;\n /**\n * Required when isTriggerDisabled is true. Provides an accessible name for the focusable wrapper trigger.\n */\n disabledTriggerAriaLabel?: string;\n /**\n * Max width of the tooltip content\n */\n maxWidth?: number;\n /**\n * Whether to use portal for the tooltip content\n */\n isWithPortal?: boolean;\n /**\n * Tooltip content classes\n */\n tooltipContentClasses?: string;\n /**\n * Tooltip offset\n */\n tooltipOffset?: number;\n /**\n * Automation ID for testing\n */\n automationId?: string;\n}\n\nexport const Tooltip = ({\n content,\n tooltipSrc,\n position = 'bottom-center',\n displayOn = 'hover',\n maxWidth = 240,\n isWithPortal = false,\n tooltipSrcRef = undefined,\n isTriggerDisabled = false,\n disabledTriggerAriaLabel = undefined,\n tooltipContentClasses = '',\n tooltipOffset = 8,\n automationId = ''\n}: TooltipProps) => {\n const [displayTooltip, setDisplayTooltip] = useState(false);\n const tooltipContentRef = useRef<HTMLDivElement>(null);\n // Support for external ref when provided\n const internalToolTipSrcRef = useRef<HTMLDivElement>(null);\n const tooltipSourceRef = (tooltipSrcRef || internalToolTipSrcRef) as React.RefObject<HTMLElement>;\n const [tooltipPortalStyle, setTooltipPortalStyle] = useState({});\n const [isPortalPositioned, setIsPortalPositioned] = useState(false);\n const hideTimeoutRef = useRef<ReturnType<typeof setTimeout> | null>(null);\n const isContentString = typeof content === 'string';\n const tooltipContentId = useStableId(undefined, 'tooltip-content');\n\n // Helper to clear hide timeout\n const clearHideTimeout = () => {\n if (hideTimeoutRef.current) {\n clearTimeout(hideTimeoutRef.current);\n hideTimeoutRef.current = null;\n }\n };\n\n // Helper to schedule hide\n const scheduleHide = () => {\n if (displayOn !== 'always-on') {\n clearHideTimeout();\n hideTimeoutRef.current = setTimeout(() => setDisplayTooltip(false), 150);\n }\n };\n\n const showTooltip = () => {\n clearHideTimeout();\n setDisplayTooltip(true);\n };\n\n const onDisabledTriggerKeyDown = (e: React.KeyboardEvent) => {\n if (!isTriggerDisabled) return;\n if (e.key === 'Escape') {\n e.preventDefault();\n setDisplayTooltip(false);\n return;\n }\n if (e.key === 'Enter' || e.key === ' ') {\n e.preventDefault();\n setDisplayTooltip((prev) => !prev);\n }\n };\n\n // Enabled trigger: use React focus/blur capture handlers (no native event listeners).\n // This keeps the tooltip open while focus stays anywhere inside the tooltip wrapper.\n const dismissOnFocusOutProps = useDismissOnFocusOut<HTMLDivElement>({\n disabled: isTriggerDisabled,\n onFocusIn: showTooltip,\n onFocusOut: scheduleHide,\n onEscape: () => setDisplayTooltip(false)\n });\n\n useEffect(() => {\n const tooltipContent = tooltipContentRef.current;\n\n if (!tooltipContent) {\n return;\n }\n\n if (position == 'bottom-center') {\n tooltipContent.setAttribute('style', `left: 50%;transform: translateX(-50%);`);\n tooltipContent.classList.add(`before:left-[calc(50%-7px)]`);\n tooltipContent.classList.add(`before:top-[-7px]`);\n } else if (position == 'bottom-left') {\n tooltipContent.classList.add(`before:left-[calc(10%-7px)]`);\n tooltipContent.classList.add(`before:top-[-7px]`);\n } else if (position == 'bottom-right') {\n tooltipContent.setAttribute('style', `right: 0;`);\n tooltipContent.classList.add(`before:right-[calc(10%+7px)]`);\n tooltipContent.classList.add(`before:top-[-7px]`);\n } else if (position == 'top-center') {\n tooltipContent.setAttribute('style', `left: 50%;transform: translateX(-50%);bottom: calc(100% + 8px);`);\n tooltipContent.classList.add(`before:left-[calc(50%-7px)]`);\n tooltipContent.classList.add(`before:bottom-[-7px]`);\n } else if (position == 'top-left') {\n tooltipContent.setAttribute('style', `bottom: calc(100% + 8px);`);\n tooltipContent.classList.add(`before:left-[calc(10%-7px)]`);\n tooltipContent.classList.add(`before:bottom-[-7px]`);\n } else if (position == 'top-right') {\n tooltipContent.setAttribute('style', `right: 0;bottom: calc(100% + 8px);`);\n tooltipContent.classList.add(`before:right-[calc(10%+7px)]`);\n tooltipContent.classList.add(`before:bottom-[-7px]`);\n } else if (position == 'left-top') {\n tooltipContent.setAttribute('style', `right: calc(100% + 10px);top:0;`);\n tooltipContent.classList.add(`before:right-[-6px]`);\n tooltipContent.classList.add(`before:top-[7px]`);\n } else if (position == 'left-center') {\n tooltipContent.setAttribute('style', `right: calc(100% + 10px);top: 50%;transform: translateY(-50%);`);\n tooltipContent.classList.add(`before:right-[-6px]`);\n tooltipContent.classList.add(`before:top-[calc(50%-7px)]`);\n } else if (position == 'left-bottom') {\n tooltipContent.setAttribute('style', `right: calc(100% + 10px);bottom:0;`);\n tooltipContent.classList.add(`before:right-[-6px]`);\n tooltipContent.classList.add(`before:bottom-[7px]`);\n } else if (position == 'right-top') {\n tooltipContent.setAttribute('style', `left: calc(100% + 10px);top:0;`);\n tooltipContent.classList.add(`before:left-[-6px]`);\n tooltipContent.classList.add(`before:top-[7px]`);\n } else if (position == 'right-center') {\n tooltipContent.setAttribute('style', `left: calc(100% + 10px);top: 50%;transform: translateY(-50%);`);\n tooltipContent.classList.add(`before:left-[-6px]`);\n tooltipContent.classList.add(`before:top-[calc(50%-7px)]`);\n } else if (position == 'right-bottom') {\n tooltipContent.setAttribute('style', `left: calc(100% + 10px);bottom:0;`);\n tooltipContent.classList.add(`before:left-[-6px]`);\n tooltipContent.classList.add(`before:bottom-[7px]`);\n }\n\n if (displayOn == 'hover') {\n tooltipContent.classList.add(`group-hover:visible`);\n }\n }, [content]);\n\n useEffect(() => {\n const tooltipContent = tooltipContentRef.current;\n\n if (!tooltipContent) {\n return;\n }\n if (displayTooltip) {\n tooltipContent.classList.remove(`invisible`);\n } else {\n tooltipContent.classList.add(`invisible`);\n }\n }, [displayTooltip]);\n\n // Ensure tooltip stays open when displayOn is always-on\n useEffect(() => {\n if (displayOn === 'always-on') {\n setDisplayTooltip(true);\n }\n }, [displayOn]);\n\n const onTooltipSrcClick = () => {\n if (displayOn == 'click') {\n setDisplayTooltip((displayTooltip) => !displayTooltip);\n }\n };\n\n const toggleTooltip = () => {\n setDisplayTooltip((displayTooltip) => !displayTooltip);\n };\n\n const events = {\n ...(displayOn === 'click' && { onClick: toggleTooltip }),\n ...(displayOn === 'hover' && {\n onMouseEnter: () => setDisplayTooltip(true),\n onMouseLeave: () => setDisplayTooltip(false)\n })\n };\n\n const calculateTooltipPortalStyle = () => {\n const refToUse = tooltipSourceRef.current;\n if (!refToUse) {\n return {};\n }\n\n const srcRect = refToUse.getBoundingClientRect();\n const scrollX = window.scrollX || window.pageXOffset;\n const scrollY = window.scrollY || window.pageYOffset;\n const arrowSize = 14; // 14px (3.5 * 4 = 14px in Tailwind)\n\n // Get tooltip content dimensions if available\n const tooltipElement = document.getElementById(tooltipContentId);\n const tooltipWidth = tooltipElement?.offsetWidth || 0;\n const tooltipHeight = tooltipElement?.offsetHeight || 0;\n\n let top = 0;\n let left = 0;\n let arrowLeft = 0;\n let arrowTop = 0;\n\n switch (position) {\n case 'bottom-center':\n top = srcRect.bottom + scrollY + tooltipOffset;\n left = srcRect.left + scrollX + srcRect.width / 2 - tooltipWidth / 2;\n arrowLeft = tooltipWidth / 2 - arrowSize / 2;\n arrowTop = -arrowSize / 2;\n break;\n case 'bottom-left':\n top = srcRect.bottom + scrollY + tooltipOffset;\n left = srcRect.left + scrollX;\n arrowLeft = tooltipWidth * 0.1 - arrowSize / 2;\n arrowTop = -arrowSize / 2;\n break;\n case 'bottom-right':\n top = srcRect.bottom + scrollY + tooltipOffset;\n left = srcRect.right + scrollX - tooltipWidth;\n arrowLeft = tooltipWidth - tooltipWidth * 0.1 - arrowSize / 2;\n arrowTop = -arrowSize / 2;\n break;\n case 'top-center':\n top = srcRect.top + scrollY - tooltipHeight - tooltipOffset;\n left = srcRect.left + scrollX + srcRect.width / 2 - tooltipWidth / 2;\n arrowLeft = tooltipWidth / 2 - arrowSize / 2;\n arrowTop = tooltipHeight - arrowSize / 2;\n break;\n case 'top-left':\n top = srcRect.top + scrollY - tooltipHeight - tooltipOffset;\n left = srcRect.left + scrollX;\n arrowLeft = tooltipWidth * 0.1 - arrowSize / 2;\n arrowTop = tooltipHeight - arrowSize / 2;\n break;\n case 'top-right':\n top = srcRect.top + scrollY - tooltipHeight - tooltipOffset;\n left = srcRect.right + scrollX - tooltipWidth;\n arrowLeft = tooltipWidth - tooltipWidth * 0.1 - arrowSize / 2;\n arrowTop = tooltipHeight - arrowSize / 2;\n break;\n case 'left-top':\n top = srcRect.top + scrollY;\n left = srcRect.left + scrollX - tooltipWidth - tooltipOffset;\n arrowLeft = tooltipWidth - arrowSize / 2;\n arrowTop = arrowSize / 2;\n break;\n case 'left-center':\n top = srcRect.top + scrollY + srcRect.height / 2 - tooltipHeight / 2;\n left = srcRect.left + scrollX - tooltipWidth - tooltipOffset;\n arrowLeft = tooltipWidth - arrowSize / 2;\n arrowTop = tooltipHeight / 2 - arrowSize / 2;\n break;\n case 'left-bottom':\n top = srcRect.bottom + scrollY - tooltipHeight;\n left = srcRect.left + scrollX - tooltipWidth - tooltipOffset;\n arrowLeft = tooltipWidth - arrowSize / 2;\n arrowTop = tooltipHeight - arrowSize / 2;\n break;\n case 'right-top':\n top = srcRect.top + scrollY;\n left = srcRect.right + scrollX + tooltipOffset;\n arrowLeft = -arrowSize / 2;\n arrowTop = arrowSize / 2;\n break;\n case 'right-center':\n top = srcRect.top + scrollY + srcRect.height / 2 - tooltipHeight / 2;\n left = srcRect.right + scrollX + tooltipOffset;\n arrowLeft = -arrowSize / 2;\n arrowTop = tooltipHeight / 2 - arrowSize / 2;\n break;\n case 'right-bottom':\n top = srcRect.bottom + scrollY - tooltipHeight;\n left = srcRect.right + scrollX + tooltipOffset;\n arrowLeft = -arrowSize / 2;\n arrowTop = tooltipHeight - arrowSize / 2;\n break;\n default:\n top = srcRect.bottom + scrollY + tooltipOffset;\n left = srcRect.left + scrollX + srcRect.width / 2 - tooltipWidth / 2;\n arrowLeft = tooltipWidth / 2 - arrowSize / 2;\n arrowTop = -arrowSize / 2;\n break;\n }\n\n return {\n position: 'absolute',\n top: `${top}px`,\n left: `${left}px`,\n zIndex: 9999,\n '--arrow-left': `${arrowLeft}px`,\n '--arrow-top': `${arrowTop}px`\n } as React.CSSProperties & { '--arrow-left': string; '--arrow-top': string };\n };\n\n useEffect(() => {\n if (!displayTooltip || !isWithPortal) {\n setIsPortalPositioned(false);\n return;\n }\n\n const updatePosition = () => {\n const tooltipElement = document.getElementById(tooltipContentId);\n\n // Wait for tooltip to be rendered and have valid dimensions\n if (!tooltipElement || tooltipElement.offsetHeight === 0) {\n requestAnimationFrame(updatePosition);\n return;\n }\n\n const calculatedStyle = calculateTooltipPortalStyle();\n \n // Batch both state updates into a single synchronous render using flushSync\n flushSync(() => {\n setTooltipPortalStyle(calculatedStyle);\n setIsPortalPositioned(true);\n });\n };\n\n // Initial position calculation\n const timeout = setTimeout(updatePosition, tooltipSrcRef ? 60 : 10);\n\n const handleClick = (e: MouseEvent) => {\n const tooltip = document.getElementById(tooltipContentId);\n const source = tooltipSourceRef.current;\n const target = e.target as Node;\n\n if (tooltip && source && !tooltip.contains(target) && !source.contains(target)) {\n setDisplayTooltip(false);\n }\n };\n\n // Only add click listener if not always-on\n const shouldAddClickListener = displayOn !== 'always-on';\n if (shouldAddClickListener) {\n document.body.addEventListener('click', handleClick, true);\n }\n window.addEventListener('scroll', updatePosition, true);\n window.addEventListener('resize', updatePosition);\n\n // Watch for style changes on the source element when tooltipSrcRef is provided\n // This ensures the tooltip position updates when the blocker is repositioned\n let mutationObserver: MutationObserver | null = null;\n if (tooltipSrcRef && tooltipSourceRef.current) {\n mutationObserver = new MutationObserver(() => {\n updatePosition();\n });\n mutationObserver.observe(tooltipSourceRef.current, {\n attributes: true,\n attributeFilter: ['style', 'class']\n });\n }\n\n return () => {\n clearTimeout(timeout);\n clearHideTimeout();\n if (shouldAddClickListener) {\n document.body.removeEventListener('click', handleClick, true);\n }\n window.removeEventListener('scroll', updatePosition, true);\n window.removeEventListener('resize', updatePosition);\n if (mutationObserver) {\n mutationObserver.disconnect();\n }\n };\n }, [displayTooltip, isWithPortal, position, displayOn, tooltipSrcRef, tooltipContentId]);\n\n // For enabled triggers: link trigger to tooltip content via aria-describedby so screen\n // readers announce tooltip text on focus. Native elements need kebab-case only;\n // se-design components (Icon, Button) also accept camelCase ariaDescribedBy prop.\n // Disabled trigger already wires aria-describedby in disabledTriggerProps.\n const linkedTooltipSrc =\n !isTriggerDisabled && React.isValidElement(tooltipSrc)\n ? React.cloneElement(tooltipSrc as React.ReactElement<any>, {\n 'aria-describedby': tooltipContentId,\n ...(typeof tooltipSrc.type !== 'string' && { ariaDescribedBy: tooltipContentId })\n })\n : tooltipSrc;\n\n const disabledTriggerProps = isTriggerDisabled\n ? {\n tabIndex: 0,\n role: 'button' as const,\n 'aria-label': disabledTriggerAriaLabel,\n 'aria-describedby': tooltipContentId,\n onFocus: showTooltip,\n onBlur: scheduleHide,\n onKeyDown: onDisabledTriggerKeyDown\n }\n : undefined;\n\n const enabledTriggerProps = !isTriggerDisabled\n ? dismissOnFocusOutProps\n : undefined;\n\n return !isWithPortal ? (\n <div\n className=\"se-design-tooltip group relative inline-flex items-center min-w-0\"\n onClick={onTooltipSrcClick}\n {...disabledTriggerProps}\n {...enabledTriggerProps}\n >\n <div className=\"cursor-pointer flex items-center min-w-0\">\n {linkedTooltipSrc}\n </div>\n <div\n ref={tooltipContentRef}\n id={tooltipContentId}\n role=\"tooltip\"\n className={`flex justify-center px-3 py-2 min-w-24 max-w-[${maxWidth}px]\n absolute top-[calc(100%+8px)] w-max bg-[var(--color-gray-800)] text-[var(--color-white)] text-base rounded-[3px]\n before:content-[' '] before:w-3.5 before:h-3.5 before:bg-[var(--color-gray-800)] before:inline-block\n before:absolute before:rounded-tl-sm before:rotate-45`}\n data-automation-id={automationId || 'tooltip-content'}\n >\n {isContentString ? <p className=\"leading-normal\">{content}</p> : content}\n </div>\n </div>\n ) : (\n <div\n className=\"se-design-tooltip group relative inline-flex items-center min-w-0\"\n {...events}\n {...disabledTriggerProps}\n {...enabledTriggerProps}\n >\n <div\n className=\"cursor-pointer flex items-center min-w-0\"\n ref={tooltipSrcRef ? undefined : (tooltipSourceRef as React.RefObject<HTMLDivElement>)}\n onMouseEnter={displayOn === 'always-on' ? undefined : clearHideTimeout}\n onMouseLeave={scheduleHide}\n >\n {linkedTooltipSrc}\n </div>\n {displayTooltip &&\n ReactDOM.createPortal(\n <>\n <style>\n {`#${tooltipContentId}::before {\n left: var(--arrow-left, 0);\n top: var(--arrow-top, 0);\n }`}\n </style>\n <div\n id={tooltipContentId}\n role=\"tooltip\"\n className={`flex justify-center px-3 py-2 min-w-24 bg-[var(--color-gray-800)] text-[var(--color-white)] text-base rounded-[3px]\n before:content-[' '] before:w-3.5 before:h-3.5 before:bg-[var(--color-gray-800)] before:inline-block\n before:absolute before:rounded-tl-sm before:rotate-45 ${tooltipContentClasses}`}\n style={{\n ...tooltipPortalStyle,\n maxWidth: `${maxWidth}px`,\n wordBreak: 'break-word',\n overflowWrap: 'break-word',\n visibility: isPortalPositioned ? 'visible' : 'hidden',\n opacity: isPortalPositioned ? 1 : 0,\n pointerEvents: isPortalPositioned ? 'auto' : 'none',\n transition: isPortalPositioned ? 'opacity 0.15s ease-in' : 'none',\n // Ensure it stays at 0,0 until positioned to avoid any visual flash\n ...(isPortalPositioned ? {} : { position: 'fixed', top: '0px', left: '0px' })\n }}\n onMouseEnter={displayOn === 'always-on' ? undefined : clearHideTimeout}\n onMouseLeave={scheduleHide}\n >\n {isContentString ? <p className=\"leading-normal\">{content}</p> : content}\n </div>\n </>,\n document.body\n )}\n </div>\n );\n};\n"],"names":["Tooltip","content","tooltipSrc","position","displayOn","maxWidth","isWithPortal","tooltipSrcRef","undefined","isTriggerDisabled","disabledTriggerAriaLabel","tooltipContentClasses","tooltipOffset","automationId","displayTooltip","setDisplayTooltip","useState","tooltipContentRef","useRef","internalToolTipSrcRef","tooltipSourceRef","tooltipPortalStyle","setTooltipPortalStyle","isPortalPositioned","setIsPortalPositioned","hideTimeoutRef","isContentString","tooltipContentId","useStableId","clearHideTimeout","current","clearTimeout","scheduleHide","setTimeout","showTooltip","onDisabledTriggerKeyDown","e","key","preventDefault","prev","dismissOnFocusOutProps","useDismissOnFocusOut","disabled","onFocusIn","onFocusOut","onEscape","useEffect","tooltipContent","setAttribute","classList","add","remove","onTooltipSrcClick","events","onClick","toggleTooltip","onMouseEnter","onMouseLeave","calculateTooltipPortalStyle","refToUse","srcRect","getBoundingClientRect","scrollX","window","pageXOffset","scrollY","pageYOffset","arrowSize","tooltipElement","document","getElementById","tooltipWidth","offsetWidth","tooltipHeight","offsetHeight","top","left","arrowLeft","arrowTop","bottom","width","right","height","zIndex","updatePosition","requestAnimationFrame","calculatedStyle","flushSync","timeout","handleClick","tooltip","source","target","contains","shouldAddClickListener","body","addEventListener","mutationObserver","MutationObserver","observe","attributes","attributeFilter","removeEventListener","disconnect","linkedTooltipSrc","React","isValidElement","cloneElement","type","ariaDescribedBy","disabledTriggerProps","tabIndex","role","onFocus","onBlur","onKeyDown","enabledTriggerProps","createElement","_extends","className","ref","ReactDOM","createPortal","Fragment","id","style","wordBreak","overflowWrap","visibility","opacity","pointerEvents","transition"],"mappings":";;;;;;;;;;;;;;AAqEO,MAAMA,KAAUA,CAAC;AAAA,EACtBC,SAAAA;AAAAA,EACAC,YAAAA;AAAAA,EACAC,UAAAA,IAAW;AAAA,EACXC,WAAAA,IAAY;AAAA,EACZC,UAAAA,IAAW;AAAA,EACXC,cAAAA,IAAe;AAAA,EACfC,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KAAKvG;AAAAA,IACL2G,IAAIjG;AAAAA,IACJqF,MAAK;AAAA,IACLO,WAAW,iDAAiDlH,CAAQ;AAAA;AAAA;AAAA;AAAA,IAIpE,sBAAoBQ,KAAgB;AAAA,EAAA,GAEnCa,IAAkB+E,gBAAAA,EAAAY,cAAA,KAAA;AAAA,IAAGE,WAAU;AAAA,EAAA,GAAkBtH,CAAW,IAAIA,CAC9D,CACF;AAqDT;"}
|
|
1
|
+
{"version":3,"file":"index16.js","sources":["../src/components/Tooltip/index.tsx"],"sourcesContent":["import React, { useEffect, useState, useRef } from 'react';\nimport ReactDOM, { flushSync } from 'react-dom';\nimport { useStableId } from '../../utils/useStableId';\nimport { useDismissOnFocusOut } from '../../utils/a11y';\n\nexport interface TooltipProps {\n /**\n * Tooltip contents\n */\n content: string | React.ReactNode;\n /**\n * Tooltip position\n */\n position?:\n | 'top-left'\n | 'top-center'\n | 'top-right'\n | 'bottom-left'\n | 'bottom-center'\n | 'bottom-right'\n | 'left-top'\n | 'left-center'\n | 'left-bottom'\n | 'right-top'\n | 'right-center'\n | 'right-bottom';\n /**\n * Display tooltip on Hover, Click or Always\n */\n displayOn?: 'hover' | 'click' | 'always-on';\n /**\n * Tooltip trigger contents\n */\n tooltipSrc?: React.ReactNode;\n /**\n * Tooltip trigger contents ref\n */\n tooltipSrcRef?: React.RefObject<HTMLElement>;\n /**\n * When true, the real trigger is disabled and cannot receive focus.\n * Tooltip will make its wrapper focusable and treat it as a \"button\" that reveals tooltip content.\n */\n isTriggerDisabled?: boolean;\n /**\n * Required when isTriggerDisabled is true. Provides an accessible name for the focusable wrapper trigger.\n */\n disabledTriggerAriaLabel?: string;\n /**\n * When true, tooltip is suppressed — renders tooltipSrc only, no tooltip behavior.\n */\n disabled?: boolean;\n /**\n * Max width of the tooltip content\n */\n maxWidth?: number;\n /**\n * Whether to use portal for the tooltip content\n */\n isWithPortal?: boolean;\n /**\n * Tooltip content classes\n */\n tooltipContentClasses?: string;\n /**\n * Tooltip offset\n */\n tooltipOffset?: number;\n /**\n * Automation ID for testing\n */\n automationId?: string;\n}\n\nexport const Tooltip = ({\n content,\n tooltipSrc,\n position = 'bottom-center',\n displayOn = 'hover',\n disabled = false,\n maxWidth = 240,\n isWithPortal = false,\n tooltipSrcRef = undefined,\n isTriggerDisabled = false,\n disabledTriggerAriaLabel = undefined,\n tooltipContentClasses = '',\n tooltipOffset = 8,\n automationId = ''\n}: TooltipProps) => {\n const [displayTooltip, setDisplayTooltip] = useState(false);\n const tooltipContentRef = useRef<HTMLDivElement>(null);\n // Support for external ref when provided\n const internalToolTipSrcRef = useRef<HTMLDivElement>(null);\n const tooltipSourceRef = (tooltipSrcRef || internalToolTipSrcRef) as React.RefObject<HTMLElement>;\n const [tooltipPortalStyle, setTooltipPortalStyle] = useState({});\n const [isPortalPositioned, setIsPortalPositioned] = useState(false);\n const hideTimeoutRef = useRef<ReturnType<typeof setTimeout> | null>(null);\n const isContentString = typeof content === 'string';\n const tooltipContentId = useStableId(undefined, 'tooltip-content');\n\n // Helper to clear hide timeout\n const clearHideTimeout = () => {\n if (hideTimeoutRef.current) {\n clearTimeout(hideTimeoutRef.current);\n hideTimeoutRef.current = null;\n }\n };\n\n // Helper to schedule hide\n const scheduleHide = () => {\n if (displayOn !== 'always-on') {\n clearHideTimeout();\n hideTimeoutRef.current = setTimeout(() => setDisplayTooltip(false), 150);\n }\n };\n\n const showTooltip = () => {\n clearHideTimeout();\n setDisplayTooltip(true);\n };\n\n const onDisabledTriggerKeyDown = (e: React.KeyboardEvent) => {\n if (!isTriggerDisabled) return;\n if (e.key === 'Escape') {\n e.preventDefault();\n setDisplayTooltip(false);\n return;\n }\n if (e.key === 'Enter' || e.key === ' ') {\n e.preventDefault();\n setDisplayTooltip((prev) => !prev);\n }\n };\n\n // Enabled trigger: use React focus/blur capture handlers (no native event listeners).\n // This keeps the tooltip open while focus stays anywhere inside the tooltip wrapper.\n const dismissOnFocusOutProps = useDismissOnFocusOut<HTMLDivElement>({\n disabled: isTriggerDisabled,\n onFocusIn: showTooltip,\n onFocusOut: scheduleHide,\n onEscape: () => setDisplayTooltip(false)\n });\n\n useEffect(() => {\n const tooltipContent = tooltipContentRef.current;\n\n if (!tooltipContent) {\n return;\n }\n\n if (position == 'bottom-center') {\n tooltipContent.setAttribute('style', `left: 50%;transform: translateX(-50%);`);\n tooltipContent.classList.add(`before:left-[calc(50%-7px)]`);\n tooltipContent.classList.add(`before:top-[-7px]`);\n } else if (position == 'bottom-left') {\n tooltipContent.classList.add(`before:left-[calc(10%-7px)]`);\n tooltipContent.classList.add(`before:top-[-7px]`);\n } else if (position == 'bottom-right') {\n tooltipContent.setAttribute('style', `right: 0;`);\n tooltipContent.classList.add(`before:right-[calc(10%+7px)]`);\n tooltipContent.classList.add(`before:top-[-7px]`);\n } else if (position == 'top-center') {\n tooltipContent.setAttribute('style', `left: 50%;transform: translateX(-50%);bottom: calc(100% + 8px);`);\n tooltipContent.classList.add(`before:left-[calc(50%-7px)]`);\n tooltipContent.classList.add(`before:bottom-[-7px]`);\n } else if (position == 'top-left') {\n tooltipContent.setAttribute('style', `bottom: calc(100% + 8px);`);\n tooltipContent.classList.add(`before:left-[calc(10%-7px)]`);\n tooltipContent.classList.add(`before:bottom-[-7px]`);\n } else if (position == 'top-right') {\n tooltipContent.setAttribute('style', `right: 0;bottom: calc(100% + 8px);`);\n tooltipContent.classList.add(`before:right-[calc(10%+7px)]`);\n tooltipContent.classList.add(`before:bottom-[-7px]`);\n } else if (position == 'left-top') {\n tooltipContent.setAttribute('style', `right: calc(100% + 10px);top:0;`);\n tooltipContent.classList.add(`before:right-[-6px]`);\n tooltipContent.classList.add(`before:top-[7px]`);\n } else if (position == 'left-center') {\n tooltipContent.setAttribute('style', `right: calc(100% + 10px);top: 50%;transform: translateY(-50%);`);\n tooltipContent.classList.add(`before:right-[-6px]`);\n tooltipContent.classList.add(`before:top-[calc(50%-7px)]`);\n } else if (position == 'left-bottom') {\n tooltipContent.setAttribute('style', `right: calc(100% + 10px);bottom:0;`);\n tooltipContent.classList.add(`before:right-[-6px]`);\n tooltipContent.classList.add(`before:bottom-[7px]`);\n } else if (position == 'right-top') {\n tooltipContent.setAttribute('style', `left: calc(100% + 10px);top:0;`);\n tooltipContent.classList.add(`before:left-[-6px]`);\n tooltipContent.classList.add(`before:top-[7px]`);\n } else if (position == 'right-center') {\n tooltipContent.setAttribute('style', `left: calc(100% + 10px);top: 50%;transform: translateY(-50%);`);\n tooltipContent.classList.add(`before:left-[-6px]`);\n tooltipContent.classList.add(`before:top-[calc(50%-7px)]`);\n } else if (position == 'right-bottom') {\n tooltipContent.setAttribute('style', `left: calc(100% + 10px);bottom:0;`);\n tooltipContent.classList.add(`before:left-[-6px]`);\n tooltipContent.classList.add(`before:bottom-[7px]`);\n }\n\n if (displayOn == 'hover') {\n tooltipContent.classList.add(`group-hover:visible`);\n }\n }, [content]);\n\n useEffect(() => {\n const tooltipContent = tooltipContentRef.current;\n\n if (!tooltipContent) {\n return;\n }\n if (displayTooltip) {\n tooltipContent.classList.remove(`invisible`);\n } else {\n tooltipContent.classList.add(`invisible`);\n }\n }, [displayTooltip]);\n\n // Ensure tooltip stays open when displayOn is always-on\n useEffect(() => {\n if (displayOn === 'always-on') {\n setDisplayTooltip(true);\n }\n }, [displayOn]);\n\n const onTooltipSrcClick = () => {\n if (displayOn == 'click') {\n setDisplayTooltip((displayTooltip) => !displayTooltip);\n }\n };\n\n const toggleTooltip = () => {\n setDisplayTooltip((displayTooltip) => !displayTooltip);\n };\n\n const events = {\n ...(displayOn === 'click' && { onClick: toggleTooltip }),\n ...(displayOn === 'hover' && {\n onMouseEnter: () => setDisplayTooltip(true),\n onMouseLeave: () => setDisplayTooltip(false)\n })\n };\n\n const calculateTooltipPortalStyle = () => {\n const refToUse = tooltipSourceRef.current;\n if (!refToUse) {\n return {};\n }\n\n const srcRect = refToUse.getBoundingClientRect();\n const scrollX = window.scrollX || window.pageXOffset;\n const scrollY = window.scrollY || window.pageYOffset;\n const arrowSize = 14; // 14px (3.5 * 4 = 14px in Tailwind)\n\n // Get tooltip content dimensions if available\n const tooltipElement = document.getElementById(tooltipContentId);\n const tooltipWidth = tooltipElement?.offsetWidth || 0;\n const tooltipHeight = tooltipElement?.offsetHeight || 0;\n\n let top = 0;\n let left = 0;\n let arrowLeft = 0;\n let arrowTop = 0;\n\n switch (position) {\n case 'bottom-center':\n top = srcRect.bottom + scrollY + tooltipOffset;\n left = srcRect.left + scrollX + srcRect.width / 2 - tooltipWidth / 2;\n arrowLeft = tooltipWidth / 2 - arrowSize / 2;\n arrowTop = -arrowSize / 2;\n break;\n case 'bottom-left':\n top = srcRect.bottom + scrollY + tooltipOffset;\n left = srcRect.left + scrollX;\n arrowLeft = tooltipWidth * 0.1 - arrowSize / 2;\n arrowTop = -arrowSize / 2;\n break;\n case 'bottom-right':\n top = srcRect.bottom + scrollY + tooltipOffset;\n left = srcRect.right + scrollX - tooltipWidth;\n arrowLeft = tooltipWidth - tooltipWidth * 0.1 - arrowSize / 2;\n arrowTop = -arrowSize / 2;\n break;\n case 'top-center':\n top = srcRect.top + scrollY - tooltipHeight - tooltipOffset;\n left = srcRect.left + scrollX + srcRect.width / 2 - tooltipWidth / 2;\n arrowLeft = tooltipWidth / 2 - arrowSize / 2;\n arrowTop = tooltipHeight - arrowSize / 2;\n break;\n case 'top-left':\n top = srcRect.top + scrollY - tooltipHeight - tooltipOffset;\n left = srcRect.left + scrollX;\n arrowLeft = tooltipWidth * 0.1 - arrowSize / 2;\n arrowTop = tooltipHeight - arrowSize / 2;\n break;\n case 'top-right':\n top = srcRect.top + scrollY - tooltipHeight - tooltipOffset;\n left = srcRect.right + scrollX - tooltipWidth;\n arrowLeft = tooltipWidth - tooltipWidth * 0.1 - arrowSize / 2;\n arrowTop = tooltipHeight - arrowSize / 2;\n break;\n case 'left-top':\n top = srcRect.top + scrollY;\n left = srcRect.left + scrollX - tooltipWidth - tooltipOffset;\n arrowLeft = tooltipWidth - arrowSize / 2;\n arrowTop = arrowSize / 2;\n break;\n case 'left-center':\n top = srcRect.top + scrollY + srcRect.height / 2 - tooltipHeight / 2;\n left = srcRect.left + scrollX - tooltipWidth - tooltipOffset;\n arrowLeft = tooltipWidth - arrowSize / 2;\n arrowTop = tooltipHeight / 2 - arrowSize / 2;\n break;\n case 'left-bottom':\n top = srcRect.bottom + scrollY - tooltipHeight;\n left = srcRect.left + scrollX - tooltipWidth - tooltipOffset;\n arrowLeft = tooltipWidth - arrowSize / 2;\n arrowTop = tooltipHeight - arrowSize / 2;\n break;\n case 'right-top':\n top = srcRect.top + scrollY;\n left = srcRect.right + scrollX + tooltipOffset;\n arrowLeft = -arrowSize / 2;\n arrowTop = arrowSize / 2;\n break;\n case 'right-center':\n top = srcRect.top + scrollY + srcRect.height / 2 - tooltipHeight / 2;\n left = srcRect.right + scrollX + tooltipOffset;\n arrowLeft = -arrowSize / 2;\n arrowTop = tooltipHeight / 2 - arrowSize / 2;\n break;\n case 'right-bottom':\n top = srcRect.bottom + scrollY - tooltipHeight;\n left = srcRect.right + scrollX + tooltipOffset;\n arrowLeft = -arrowSize / 2;\n arrowTop = tooltipHeight - arrowSize / 2;\n break;\n default:\n top = srcRect.bottom + scrollY + tooltipOffset;\n left = srcRect.left + scrollX + srcRect.width / 2 - tooltipWidth / 2;\n arrowLeft = tooltipWidth / 2 - arrowSize / 2;\n arrowTop = -arrowSize / 2;\n break;\n }\n\n return {\n position: 'absolute',\n top: `${top}px`,\n left: `${left}px`,\n zIndex: 9999,\n '--arrow-left': `${arrowLeft}px`,\n '--arrow-top': `${arrowTop}px`\n } as React.CSSProperties & { '--arrow-left': string; '--arrow-top': string };\n };\n\n useEffect(() => {\n if (!displayTooltip || !isWithPortal) {\n setIsPortalPositioned(false);\n return;\n }\n\n const updatePosition = () => {\n const tooltipElement = document.getElementById(tooltipContentId);\n\n // Wait for tooltip to be rendered and have valid dimensions\n if (!tooltipElement || tooltipElement.offsetHeight === 0) {\n requestAnimationFrame(updatePosition);\n return;\n }\n\n const calculatedStyle = calculateTooltipPortalStyle();\n \n // Batch both state updates into a single synchronous render using flushSync\n flushSync(() => {\n setTooltipPortalStyle(calculatedStyle);\n setIsPortalPositioned(true);\n });\n };\n\n // Initial position calculation\n const timeout = setTimeout(updatePosition, tooltipSrcRef ? 60 : 10);\n\n const handleClick = (e: MouseEvent) => {\n const tooltip = document.getElementById(tooltipContentId);\n const source = tooltipSourceRef.current;\n const target = e.target as Node;\n\n if (tooltip && source && !tooltip.contains(target) && !source.contains(target)) {\n setDisplayTooltip(false);\n }\n };\n\n // Only add click listener if not always-on\n const shouldAddClickListener = displayOn !== 'always-on';\n if (shouldAddClickListener) {\n document.body.addEventListener('click', handleClick, true);\n }\n window.addEventListener('scroll', updatePosition, true);\n window.addEventListener('resize', updatePosition);\n\n // Watch for style changes on the source element when tooltipSrcRef is provided\n // This ensures the tooltip position updates when the blocker is repositioned\n let mutationObserver: MutationObserver | null = null;\n if (tooltipSrcRef && tooltipSourceRef.current) {\n mutationObserver = new MutationObserver(() => {\n updatePosition();\n });\n mutationObserver.observe(tooltipSourceRef.current, {\n attributes: true,\n attributeFilter: ['style', 'class']\n });\n }\n\n return () => {\n clearTimeout(timeout);\n clearHideTimeout();\n if (shouldAddClickListener) {\n document.body.removeEventListener('click', handleClick, true);\n }\n window.removeEventListener('scroll', updatePosition, true);\n window.removeEventListener('resize', updatePosition);\n if (mutationObserver) {\n mutationObserver.disconnect();\n }\n };\n }, [displayTooltip, isWithPortal, position, displayOn, tooltipSrcRef, tooltipContentId]);\n\n // For enabled triggers: link trigger to tooltip content via aria-describedby so screen\n // readers announce tooltip text on focus. Native elements need kebab-case only;\n // se-design components (Icon, Button) also accept camelCase ariaDescribedBy prop.\n // Disabled trigger already wires aria-describedby in disabledTriggerProps.\n if (disabled) return <>{tooltipSrc}</>;\n\n // Auto-add tabIndex={0} to disabled sources so they remain reachable for tooltip hover/focus\n const isSourceDisabled = React.isValidElement<{ disabled?: boolean }>(tooltipSrc) && tooltipSrc.props.disabled;\n const linkedTooltipSrc =\n !isTriggerDisabled && React.isValidElement(tooltipSrc)\n ? React.cloneElement(tooltipSrc as React.ReactElement<any>, {\n 'aria-describedby': tooltipContentId,\n ...(typeof tooltipSrc.type !== 'string' && { ariaDescribedBy: tooltipContentId }),\n ...(isSourceDisabled && { tabIndex: 0 })\n })\n : tooltipSrc;\n\n const disabledTriggerProps = isTriggerDisabled\n ? {\n tabIndex: 0,\n role: 'button' as const,\n 'aria-label': disabledTriggerAriaLabel,\n 'aria-describedby': tooltipContentId,\n onFocus: showTooltip,\n onBlur: scheduleHide,\n onKeyDown: onDisabledTriggerKeyDown\n }\n : undefined;\n\n const enabledTriggerProps = !isTriggerDisabled\n ? dismissOnFocusOutProps\n : undefined;\n\n return !isWithPortal ? (\n <div\n className=\"se-design-tooltip group relative inline-flex items-center min-w-0\"\n onClick={onTooltipSrcClick}\n {...disabledTriggerProps}\n {...enabledTriggerProps}\n >\n <div className=\"cursor-pointer flex items-center min-w-0\">\n {linkedTooltipSrc}\n </div>\n <div\n ref={tooltipContentRef}\n id={tooltipContentId}\n role=\"tooltip\"\n className={`flex justify-center px-3 py-2 min-w-24 max-w-[${maxWidth}px]\n absolute top-[calc(100%+8px)] w-max bg-[var(--color-gray-800)] text-[var(--color-white)] text-base rounded-[3px]\n before:content-[' '] before:w-3.5 before:h-3.5 before:bg-[var(--color-gray-800)] before:inline-block\n before:absolute before:rounded-tl-sm before:rotate-45`}\n data-automation-id={automationId || 'tooltip-content'}\n >\n {isContentString ? <p className=\"leading-normal\">{content}</p> : content}\n </div>\n </div>\n ) : (\n <div\n className=\"se-design-tooltip group relative inline-flex items-center min-w-0\"\n {...events}\n {...disabledTriggerProps}\n {...enabledTriggerProps}\n >\n <div\n className=\"cursor-pointer flex items-center min-w-0\"\n ref={tooltipSrcRef ? undefined : (tooltipSourceRef as React.RefObject<HTMLDivElement>)}\n onMouseEnter={displayOn === 'always-on' ? undefined : clearHideTimeout}\n onMouseLeave={scheduleHide}\n >\n {linkedTooltipSrc}\n </div>\n {displayTooltip &&\n ReactDOM.createPortal(\n <>\n <style>\n {`#${tooltipContentId}::before {\n left: var(--arrow-left, 0);\n top: var(--arrow-top, 0);\n }`}\n </style>\n <div\n id={tooltipContentId}\n role=\"tooltip\"\n className={`flex justify-center px-3 py-2 min-w-24 bg-[var(--color-gray-800)] text-[var(--color-white)] text-base rounded-[3px]\n before:content-[' '] before:w-3.5 before:h-3.5 before:bg-[var(--color-gray-800)] before:inline-block\n before:absolute before:rounded-tl-sm before:rotate-45 ${tooltipContentClasses}`}\n style={{\n ...tooltipPortalStyle,\n maxWidth: `${maxWidth}px`,\n wordBreak: 'break-word',\n overflowWrap: 'break-word',\n visibility: isPortalPositioned ? 'visible' : 'hidden',\n opacity: isPortalPositioned ? 1 : 0,\n pointerEvents: isPortalPositioned ? 'auto' : 'none',\n transition: isPortalPositioned ? 'opacity 0.15s ease-in' : 'none',\n // Ensure it stays at 0,0 until positioned to avoid any visual flash\n ...(isPortalPositioned ? {} : { position: 'fixed', top: '0px', left: '0px' })\n }}\n onMouseEnter={displayOn === 'always-on' ? undefined : clearHideTimeout}\n onMouseLeave={scheduleHide}\n >\n {isContentString ? <p className=\"leading-normal\">{content}</p> : content}\n </div>\n </>,\n document.body\n )}\n </div>\n );\n};\n"],"names":["Tooltip","content","tooltipSrc","position","displayOn","disabled","maxWidth","isWithPortal","tooltipSrcRef","undefined","isTriggerDisabled","disabledTriggerAriaLabel","tooltipContentClasses","tooltipOffset","automationId","displayTooltip","setDisplayTooltip","useState","tooltipContentRef","useRef","internalToolTipSrcRef","tooltipSourceRef","tooltipPortalStyle","setTooltipPortalStyle","isPortalPositioned","setIsPortalPositioned","hideTimeoutRef","isContentString","tooltipContentId","useStableId","clearHideTimeout","current","clearTimeout","scheduleHide","setTimeout","showTooltip","onDisabledTriggerKeyDown","e","key","preventDefault","prev","dismissOnFocusOutProps","useDismissOnFocusOut","onFocusIn","onFocusOut","onEscape","useEffect","tooltipContent","setAttribute","classList","add","remove","onTooltipSrcClick","events","onClick","toggleTooltip","onMouseEnter","onMouseLeave","calculateTooltipPortalStyle","refToUse","srcRect","getBoundingClientRect","scrollX","window","pageXOffset","scrollY","pageYOffset","arrowSize","tooltipElement","document","getElementById","tooltipWidth","offsetWidth","tooltipHeight","offsetHeight","top","left","arrowLeft","arrowTop","bottom","width","right","height","zIndex","updatePosition","requestAnimationFrame","calculatedStyle","flushSync","timeout","handleClick","tooltip","source","target","contains","shouldAddClickListener","body","addEventListener","mutationObserver","MutationObserver","observe","attributes","attributeFilter","removeEventListener","disconnect","React","createElement","Fragment","isSourceDisabled","isValidElement","props","linkedTooltipSrc","cloneElement","type","ariaDescribedBy","tabIndex","disabledTriggerProps","role","onFocus","onBlur","onKeyDown","enabledTriggerProps","_extends","className","ref","ReactDOM","createPortal","id","style","wordBreak","overflowWrap","visibility","opacity","pointerEvents","transition"],"mappings":";;;;;;;;;;;;;;AAyEO,MAAMA,KAAUA,CAAC;AAAA,EACtBC,SAAAA;AAAAA,EACAC,YAAAA;AAAAA,EACAC,UAAAA,IAAW;AAAA,EACXC,WAAAA,IAAY;AAAA,EACZC,UAAAA,IAAW;AAAA,EACXC,UAAAA,IAAW;AAAA,EACXC,cAAAA,IAAe;AAAA,EACfC,eAAAA,IAAgBC;AAAAA,EAChBC,mBAAAA,IAAoB;AAAA,EACpBC,0BAAAA,IAA2BF;AAAAA,EAC3BG,uBAAAA,IAAwB;AAAA,EACxBC,eAAAA,IAAgB;AAAA,EAChBC,cAAAA,IAAe;AACH,MAAM;AAClB,QAAM,CAACC,GAAgBC,CAAiB,IAAIC,EAAS,EAAK,GACpDC,IAAoBC,EAAuB,IAAI,GAE/CC,IAAwBD,EAAuB,IAAI,GACnDE,IAAoBb,KAAiBY,GACrC,CAACE,GAAoBC,CAAqB,IAAIN,EAAS,CAAA,CAAE,GACzD,CAACO,GAAoBC,CAAqB,IAAIR,EAAS,EAAK,GAC5DS,IAAiBP,EAA6C,IAAI,GAClEQ,IAAkB,OA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