@telefonica/mistica 14.42.0 → 14.43.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/css/mistica.css +1 -1
- package/dist/accordion.d.ts +0 -2
- package/dist/carousel.d.ts +5 -5
- package/dist/carousel.js +169 -153
- package/dist/cvv-field.js +85 -40
- package/dist/dialog.js +66 -65
- package/dist/feedback.css-mistica.js +14 -8
- package/dist/feedback.css.d.ts +2 -0
- package/dist/feedback.js +56 -49
- package/dist/index.d.ts +3 -1
- package/dist/index.js +4 -1
- package/dist/package-version.js +1 -1
- package/dist/popover.css-mistica.js +4 -43
- package/dist/popover.css.d.ts +1 -12
- package/dist/popover.d.ts +6 -2
- package/dist/popover.js +71 -226
- package/dist/select.js +176 -172
- package/dist/text.css-mistica.js +7 -7
- package/dist/text.css.d.ts +0 -1
- package/dist/text.js +24 -24
- package/dist/theme.d.ts +2 -1
- package/dist/theme.js +17 -13
- package/dist/tooltip.css-mistica.js +15 -6
- package/dist/tooltip.css.d.ts +3 -0
- package/dist/tooltip.d.ts +15 -1
- package/dist/tooltip.js +213 -140
- package/dist-es/carousel.js +193 -176
- package/dist-es/cvv-field.js +73 -69
- package/dist-es/dialog.js +126 -125
- package/dist-es/feedback.css-mistica.js +2 -2
- package/dist-es/feedback.js +90 -83
- package/dist-es/index.js +1734 -1734
- package/dist-es/package-version.js +1 -1
- package/dist-es/popover.css-mistica.js +2 -3
- package/dist-es/popover.js +75 -191
- package/dist-es/select.js +182 -178
- package/dist-es/style.css +1 -1
- package/dist-es/text.css-mistica.js +3 -3
- package/dist-es/text.js +32 -32
- package/dist-es/theme.js +16 -12
- package/dist-es/tooltip.css-mistica.js +2 -2
- package/dist-es/tooltip.js +234 -169
- package/package.json +4 -4
package/dist-es/theme.js
CHANGED
|
@@ -92,7 +92,8 @@ const l = {
|
|
|
92
92
|
formCreditCardExpirationLabel: "Caducidad",
|
|
93
93
|
formCreditCardCvvLabel: "CVV",
|
|
94
94
|
formCreditCardCvvError: "CVV incorrecto",
|
|
95
|
-
|
|
95
|
+
formCreditCardCvvTooltipVisaMcButtonOpen: "Mostrar ayuda CVV",
|
|
96
|
+
formCreditCardCvvTooltipVisaMcButtonClose: "Ocultar ayuda CVV",
|
|
96
97
|
formCreditCardCvvTooltipVisaMc: "El CVV son los 3 \xfaltimos d\xedgitos del reverso de tu tarjeta",
|
|
97
98
|
formCreditCardCvvTooltipAmex: "Si es American Express, a\xf1ade los 4 d\xedgitos del anverso",
|
|
98
99
|
formCreditCardExpirationError: "Fecha no v\xe1lida",
|
|
@@ -135,7 +136,8 @@ const l = {
|
|
|
135
136
|
formCreditCardExpirationLabel: "Expiry",
|
|
136
137
|
formCreditCardCvvLabel: "CVV",
|
|
137
138
|
formCreditCardCvvError: "Incorrect CVV",
|
|
138
|
-
|
|
139
|
+
formCreditCardCvvTooltipVisaMcButtonOpen: "Show CVV help",
|
|
140
|
+
formCreditCardCvvTooltipVisaMcButtonClose: "Hide CVV help",
|
|
139
141
|
formCreditCardCvvTooltipVisaMc: "The CVV is the 3 digits of the back of your card",
|
|
140
142
|
formCreditCardCvvTooltipAmex: "If it's American Express, add the 4-digit number on the front of the card",
|
|
141
143
|
formCreditCardExpirationError: "Invalid date",
|
|
@@ -178,7 +180,8 @@ const l = {
|
|
|
178
180
|
formCreditCardExpirationLabel: "Ablaufdatum",
|
|
179
181
|
formCreditCardCvvLabel: "CVV",
|
|
180
182
|
formCreditCardCvvError: "Falsche CVV",
|
|
181
|
-
|
|
183
|
+
formCreditCardCvvTooltipVisaMcButtonOpen: "CVV-Hilfe anzeigen",
|
|
184
|
+
formCreditCardCvvTooltipVisaMcButtonClose: "CVV-Hilfe ausblenden",
|
|
182
185
|
formCreditCardCvvTooltipVisaMc: "Der CVV-Code besteht aus den 3 Ziffern auf der Kartenr\xfcckseite",
|
|
183
186
|
formCreditCardCvvTooltipAmex: "Bei American Express 4-stelligen Code auf der R\xfcckseite hinzuf\xfcgen",
|
|
184
187
|
formCreditCardExpirationError: "Datum ung\xfcltig",
|
|
@@ -207,7 +210,7 @@ const l = {
|
|
|
207
210
|
counterQuantity: "menge",
|
|
208
211
|
counterMinValue: "minimal",
|
|
209
212
|
counterMaxValue: "maximal"
|
|
210
|
-
},
|
|
213
|
+
}, d = {
|
|
211
214
|
expirationDatePlaceholder: "MM/AA",
|
|
212
215
|
togglePasswordVisibilityLabel: "Mostrar ou ocultar senha",
|
|
213
216
|
loading: "Carregando",
|
|
@@ -221,7 +224,8 @@ const l = {
|
|
|
221
224
|
formCreditCardExpirationLabel: "Expira\xe7\xe3o",
|
|
222
225
|
formCreditCardCvvLabel: "CVV",
|
|
223
226
|
formCreditCardCvvError: "CVV incorreto",
|
|
224
|
-
|
|
227
|
+
formCreditCardCvvTooltipVisaMcButtonOpen: "Exibir ajuda CVV",
|
|
228
|
+
formCreditCardCvvTooltipVisaMcButtonClose: "Ocultar ajuda CVV",
|
|
225
229
|
formCreditCardCvvTooltipVisaMc: "O CVV s\xe3o os 3 d\xedgitos do reverso de seu cart\xe3o",
|
|
226
230
|
formCreditCardCvvTooltipAmex: "Se for American Express, adicione os 4 d\xedgitos do anverso",
|
|
227
231
|
formCreditCardExpirationError: "Data inv\xe1lida",
|
|
@@ -255,7 +259,7 @@ const l = {
|
|
|
255
259
|
case "es":
|
|
256
260
|
return l;
|
|
257
261
|
case "pt":
|
|
258
|
-
return
|
|
262
|
+
return d;
|
|
259
263
|
case "de":
|
|
260
264
|
return s;
|
|
261
265
|
case "en":
|
|
@@ -263,9 +267,9 @@ const l = {
|
|
|
263
267
|
default:
|
|
264
268
|
return process.env.NODE_ENV !== "production" && console.error(`Invalid locale: ${e}`), i;
|
|
265
269
|
}
|
|
266
|
-
}, u = 56,
|
|
270
|
+
}, u = 56, c = 80, E = {
|
|
267
271
|
headerMobileHeight: u,
|
|
268
|
-
headerDesktopHeight:
|
|
272
|
+
headerDesktopHeight: c
|
|
269
273
|
}, m = (_param)=>{
|
|
270
274
|
var { to: e, innerRef: r } = _param, a = _object_without_properties(_param, [
|
|
271
275
|
"to",
|
|
@@ -298,7 +302,7 @@ const l = {
|
|
|
298
302
|
children: t
|
|
299
303
|
}))
|
|
300
304
|
});
|
|
301
|
-
},
|
|
305
|
+
}, v = (e)=>(_param)=>{
|
|
302
306
|
var { to: r, innerRef: a, children: t } = _param, n = _object_without_properties(_param, [
|
|
303
307
|
"to",
|
|
304
308
|
"innerRef",
|
|
@@ -310,7 +314,7 @@ const l = {
|
|
|
310
314
|
}, n), {
|
|
311
315
|
children: t
|
|
312
316
|
}));
|
|
313
|
-
},
|
|
317
|
+
}, B = (e)=>{
|
|
314
318
|
if (!e) return m;
|
|
315
319
|
if (typeof e == "function" || e.$$typeof) return e;
|
|
316
320
|
switch(e.type){
|
|
@@ -322,10 +326,10 @@ const l = {
|
|
|
322
326
|
return p(e.Component);
|
|
323
327
|
case "Next13":
|
|
324
328
|
case "Next14":
|
|
325
|
-
return
|
|
329
|
+
return v(e.Component);
|
|
326
330
|
default:
|
|
327
331
|
const r = e.type;
|
|
328
332
|
throw new Error(`Invalid Link type: ${r}`);
|
|
329
333
|
}
|
|
330
334
|
};
|
|
331
|
-
export {
|
|
335
|
+
export { c as NAVBAR_HEIGHT_DESKTOP, u as NAVBAR_HEIGHT_MOBILE, E as dimensions, B as getMisticaLinkComponent, g as getTexts };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import "./sprinkles.css.ts.vanilla.css-mistica.js";
|
|
2
2
|
import "./tooltip.css.ts.vanilla.css-mistica.js";
|
|
3
|
-
var v = "
|
|
3
|
+
var a = 40, v = "_1xhatbpb _1y2v1nfhb _1y2v1nfhr _1y2v1nfgd _1y2v1nfjp _1y2v1nf37", _ = "_1xhatbp9 _1y2v1nfgd _1y2v1nfhd _1y2v1nfjj", o = "_1xhatbpd _1y2v1nfgd", r = "_1xhatbp1 _1y2v1nfgd", y = "_1xhatbp6", e = "_1xhatbp5 _1y2v1nfgc _1y2v1nfjj", i = "_1xhatbp3 _1y2v1nfgc _1y2v1nfjb _1y2v1nf37", f = "_1y2v1nfgi _1y2v1nfgo _1y2v1nfgx", p = {
|
|
4
4
|
entering: {
|
|
5
5
|
opacity: 1
|
|
6
6
|
},
|
|
@@ -15,4 +15,4 @@ var v = "_1xhatbpa _1y2v1nfhb _1y2v1nfhr _1y2v1nfgd _1y2v1nfjp _1y2v1nf37", a =
|
|
|
15
15
|
},
|
|
16
16
|
unmounted: {}
|
|
17
17
|
};
|
|
18
|
-
export { v as arrow,
|
|
18
|
+
export { a as CONTENT_MIN_WIDTH, v as arrow, _ as arrowContainer, o as closeButtonIcon, r as container, y as content, e as contentContainer, i as tooltip, f as tooltipCenter, p as tooltipTransitionClasses };
|
package/dist-es/tooltip.js
CHANGED
|
@@ -51,28 +51,58 @@ function _object_spread_props(target, source) {
|
|
|
51
51
|
}
|
|
52
52
|
return target;
|
|
53
53
|
}
|
|
54
|
-
|
|
54
|
+
function _object_without_properties(source, excluded) {
|
|
55
|
+
if (source == null) return {};
|
|
56
|
+
var target = _object_without_properties_loose(source, excluded);
|
|
57
|
+
var key, i;
|
|
58
|
+
if (Object.getOwnPropertySymbols) {
|
|
59
|
+
var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
|
|
60
|
+
for(i = 0; i < sourceSymbolKeys.length; i++){
|
|
61
|
+
key = sourceSymbolKeys[i];
|
|
62
|
+
if (excluded.indexOf(key) >= 0) continue;
|
|
63
|
+
if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
|
|
64
|
+
target[key] = source[key];
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
return target;
|
|
68
|
+
}
|
|
69
|
+
function _object_without_properties_loose(source, excluded) {
|
|
70
|
+
if (source == null) return {};
|
|
71
|
+
var target = {};
|
|
72
|
+
var sourceKeys = Object.keys(source);
|
|
73
|
+
var key, i;
|
|
74
|
+
for(i = 0; i < sourceKeys.length; i++){
|
|
75
|
+
key = sourceKeys[i];
|
|
76
|
+
if (excluded.indexOf(key) >= 0) continue;
|
|
77
|
+
target[key] = source[key];
|
|
78
|
+
}
|
|
79
|
+
return target;
|
|
80
|
+
}
|
|
81
|
+
import { jsx as n, jsxs as B, Fragment as ht } from "react/jsx-runtime";
|
|
55
82
|
import * as i from "react";
|
|
56
|
-
import { useAriaId as
|
|
57
|
-
import { Portal as
|
|
58
|
-
import { Transition as
|
|
59
|
-
import { container as
|
|
60
|
-
import
|
|
83
|
+
import { useTheme as Tt, useAriaId as gt, useBoundingRect as it, useWindowSize as vt } from "./hooks.js";
|
|
84
|
+
import { Portal as xt } from "./portal.js";
|
|
85
|
+
import { Transition as bt } from "react-transition-group";
|
|
86
|
+
import { content as Mt, CONTENT_MIN_WIDTH as Et, container as St, tooltipTransitionClasses as wt, tooltip as Ot, contentContainer as It, tooltipCenter as Rt, closeButtonIcon as _t, arrowContainer as Ct, arrow as Nt } from "./tooltip.css-mistica.js";
|
|
87
|
+
import yt from "./stack.js";
|
|
61
88
|
import { Text2 as nt } from "./text.js";
|
|
62
|
-
import { getCssVarValue as
|
|
63
|
-
import { TAB as
|
|
64
|
-
import { isTouchableDevice as
|
|
65
|
-
import { isEqual as
|
|
66
|
-
import
|
|
67
|
-
import { vars as
|
|
68
|
-
import { useIsInverseVariant as
|
|
69
|
-
import { combineRefs as
|
|
70
|
-
import { useTooltipState as
|
|
71
|
-
import { isRunningAcceptanceTest as
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
89
|
+
import { getCssVarValue as kt } from "./utils/dom.js";
|
|
90
|
+
import { TAB as Lt, ESC as At } from "./utils/keys.js";
|
|
91
|
+
import { isTouchableDevice as $t } from "./utils/environment.js";
|
|
92
|
+
import { isEqual as at } from "./utils/helpers.js";
|
|
93
|
+
import tt from "classnames";
|
|
94
|
+
import { vars as X } from "./skins/skin-contract.css-mistica.js";
|
|
95
|
+
import { useIsInverseVariant as Ft, ThemeVariant as Dt } from "./theme-variant-context.js";
|
|
96
|
+
import { combineRefs as Bt } from "./utils/common.js";
|
|
97
|
+
import { useTooltipState as Wt, useSetTooltipState as Ht } from "./tooltip-context-provider.js";
|
|
98
|
+
import { isRunningAcceptanceTest as Vt } from "./utils/platform.js";
|
|
99
|
+
import Xt from "./icon-button.js";
|
|
100
|
+
import zt from "./generated/mistica-icons/icon-close-regular.js";
|
|
101
|
+
import Pt from "./box.js";
|
|
102
|
+
const lt = (t)=>({
|
|
103
|
+
border: `1px solid ${t ? X.colors.backgroundContainer : X.colors.border}`
|
|
104
|
+
}), ct = 496, Yt = 300, Gt = 500, Kt = 100, p = 20, O = 6, N = O + p / 2 + 1, Ut = (t)=>{
|
|
105
|
+
switch(t){
|
|
76
106
|
case "left":
|
|
77
107
|
return `translateX(-${O}px)`;
|
|
78
108
|
case "right":
|
|
@@ -84,76 +114,76 @@ const at = (e)=>({
|
|
|
84
114
|
default:
|
|
85
115
|
return "";
|
|
86
116
|
}
|
|
87
|
-
}, pt = (
|
|
88
|
-
const
|
|
117
|
+
}, pt = (t)=>{
|
|
118
|
+
const u = parseFloat(getComputedStyle(t, null).paddingLeft) + parseFloat(getComputedStyle(t, null).paddingRight), v = parseFloat(getComputedStyle(t, null).paddingTop) + parseFloat(getComputedStyle(t, null).paddingBottom), d = t.offsetWidth - u, x = t.offsetHeight - v;
|
|
89
119
|
return {
|
|
90
|
-
width:
|
|
91
|
-
height:
|
|
120
|
+
width: d,
|
|
121
|
+
height: x
|
|
92
122
|
};
|
|
93
|
-
},
|
|
94
|
-
if (!
|
|
95
|
-
const { top:
|
|
96
|
-
if (!(!
|
|
123
|
+
}, ft = (t, u, v, d, x)=>{
|
|
124
|
+
if (!t || !u) return;
|
|
125
|
+
const { top: b, bottom: h, left: I, right: W } = t, o = d - h, R = x - W, _ = b, a = I, { width: z, height: H } = pt(u), C = z + N, T = H + N, M = C <= Math.max(a, R), E = T <= Math.max(o, _);
|
|
126
|
+
if (!(!E && !M)) switch(v){
|
|
97
127
|
case "left":
|
|
98
|
-
return
|
|
128
|
+
return M ? C <= a ? "left" : "right" : o > _ ? "bottom" : "top";
|
|
99
129
|
case "right":
|
|
100
|
-
return
|
|
130
|
+
return M ? C <= R ? "right" : "left" : o > _ ? "bottom" : "top";
|
|
101
131
|
case "top":
|
|
102
|
-
return
|
|
132
|
+
return E ? T <= _ ? "top" : "bottom" : a > R ? "left" : "right";
|
|
103
133
|
case "bottom":
|
|
104
|
-
return
|
|
134
|
+
return E ? T <= o ? "bottom" : "top" : a > R ? "left" : "right";
|
|
105
135
|
default:
|
|
106
136
|
return;
|
|
107
137
|
}
|
|
108
|
-
},
|
|
109
|
-
let {
|
|
110
|
-
const
|
|
111
|
-
|
|
138
|
+
}, jt = (param)=>{
|
|
139
|
+
let { content: t, target: u, width: v, position: d = "top", dataAttributes: x, delay: b = !0, centerContent: h, open: I, onClose: W, hasPointerInteractionOnly: o = !1, trackingEvent: R } = param;
|
|
140
|
+
const { texts: _ } = Tt(), a = gt(), { openTooltipId: z } = Wt(), { openTooltip: H, closeTooltip: C } = Ht(), [T, M] = i.useState(), [E, P] = i.useState(), Y = i.useRef(null), G = i.useRef(null), [y, dt] = i.useState(null), m = $t(), K = b ? Gt : 0, [et, U] = i.useState(!1), [j, k] = i.useState(!1), q = I !== void 0, [ot, Z] = i.useState(!1), S = q ? I : a === z, J = Ft(), f = it(Y, S), V = it(G, S, !0), l = vt(), w = i.useCallback(()=>{
|
|
141
|
+
Z(!1), U(!1), k(!1);
|
|
112
142
|
}, []);
|
|
113
143
|
i.useEffect(()=>{
|
|
114
|
-
|
|
144
|
+
S || w();
|
|
115
145
|
}, [
|
|
116
|
-
|
|
117
|
-
|
|
146
|
+
S,
|
|
147
|
+
w
|
|
118
148
|
]), i.useEffect(()=>{
|
|
119
|
-
if (!
|
|
120
|
-
const
|
|
121
|
-
if (!
|
|
122
|
-
|
|
149
|
+
if (!y || !S) return;
|
|
150
|
+
const s = ft(f, y, d, l.height, l.width);
|
|
151
|
+
if (!s || !f) {
|
|
152
|
+
M(void 0), P(void 0), w();
|
|
123
153
|
return;
|
|
124
154
|
}
|
|
125
|
-
let
|
|
155
|
+
let r, e;
|
|
126
156
|
var _parseInt;
|
|
127
|
-
const { left:
|
|
128
|
-
switch(
|
|
157
|
+
const { left: c, right: L, top: A, bottom: $ } = f, { width: F, height: D } = pt(y), rt = l.width - F, st = l.height - D, g = (_parseInt = parseInt(kt(X.borderRadii.popup))) !== null && _parseInt !== void 0 ? _parseInt : 8;
|
|
158
|
+
switch(s){
|
|
129
159
|
case "top":
|
|
130
|
-
|
|
131
|
-
left: Math.max(0, Math.min(
|
|
132
|
-
top:
|
|
133
|
-
padding: `0px 0px ${
|
|
134
|
-
},
|
|
135
|
-
left: Math.max(
|
|
160
|
+
r = {
|
|
161
|
+
left: Math.max(0, Math.min(rt, (c + L - F) / 2)),
|
|
162
|
+
top: A - D - p / 2,
|
|
163
|
+
padding: `0px 0px ${N}px 0px`
|
|
164
|
+
}, e = {
|
|
165
|
+
left: Math.max(g, Math.min(l.width - g - p, (c + L - p) / 2)),
|
|
136
166
|
top: "100%"
|
|
137
167
|
};
|
|
138
168
|
break;
|
|
139
169
|
case "bottom":
|
|
140
|
-
|
|
141
|
-
left: Math.max(0, Math.min(
|
|
142
|
-
top:
|
|
143
|
-
padding: `${
|
|
144
|
-
},
|
|
145
|
-
left: Math.max(
|
|
170
|
+
r = {
|
|
171
|
+
left: Math.max(0, Math.min(rt, (c + L - F) / 2)),
|
|
172
|
+
top: $ - O,
|
|
173
|
+
padding: `${N}px 0px 0px 0px`
|
|
174
|
+
}, e = {
|
|
175
|
+
left: Math.max(g, Math.min(l.width - g - p, (c + L - p) / 2)),
|
|
146
176
|
bottom: "100%",
|
|
147
177
|
transform: "rotate(180deg)"
|
|
148
178
|
};
|
|
149
179
|
break;
|
|
150
180
|
case "left":
|
|
151
|
-
|
|
152
|
-
left:
|
|
153
|
-
top: Math.max(0, Math.min(
|
|
154
|
-
padding: `0px ${
|
|
155
|
-
},
|
|
156
|
-
top: Math.max(
|
|
181
|
+
r = {
|
|
182
|
+
left: c - F - p / 2,
|
|
183
|
+
top: Math.max(0, Math.min(st, (A + $ - D) / 2)),
|
|
184
|
+
padding: `0px ${N}px 0px 0px`
|
|
185
|
+
}, e = {
|
|
186
|
+
top: Math.max(g, Math.min(l.height - g - p, (A + $ - p) / 2)),
|
|
157
187
|
left: "100%",
|
|
158
188
|
transform: "rotate(-90deg)",
|
|
159
189
|
transformOrigin: "bottom"
|
|
@@ -161,172 +191,172 @@ const at = (e)=>({
|
|
|
161
191
|
break;
|
|
162
192
|
case "right":
|
|
163
193
|
default:
|
|
164
|
-
|
|
165
|
-
left:
|
|
166
|
-
top: Math.max(0, Math.min(
|
|
167
|
-
padding: `0px 0px 0px ${
|
|
168
|
-
},
|
|
169
|
-
top: Math.max(
|
|
194
|
+
r = {
|
|
195
|
+
left: L - O,
|
|
196
|
+
top: Math.max(0, Math.min(st, (A + $ - D) / 2)),
|
|
197
|
+
padding: `0px 0px 0px ${N}px`
|
|
198
|
+
}, e = {
|
|
199
|
+
top: Math.max(g, Math.min(l.height - g - p, (A + $ - p) / 2)),
|
|
170
200
|
right: "100%",
|
|
171
201
|
transform: "rotate(90deg)",
|
|
172
202
|
transformOrigin: "bottom"
|
|
173
203
|
};
|
|
174
204
|
break;
|
|
175
205
|
}
|
|
176
|
-
typeof
|
|
206
|
+
typeof e.top == "number" && (e.top -= r.top, e.top = `${e.top / D * 100}%`), typeof e.left == "number" && (e.left -= r.left, e.left = `${e.left / F * 100}%`), at(r, T) || M(r), at(e, E) || P(e);
|
|
177
207
|
}, [
|
|
178
|
-
|
|
179
|
-
l,
|
|
180
|
-
dt,
|
|
181
|
-
x,
|
|
182
|
-
R,
|
|
183
|
-
s,
|
|
184
|
-
d,
|
|
185
|
-
v,
|
|
186
|
-
j,
|
|
208
|
+
y,
|
|
187
209
|
f,
|
|
188
|
-
|
|
189
|
-
|
|
210
|
+
V,
|
|
211
|
+
S,
|
|
212
|
+
d,
|
|
213
|
+
l,
|
|
214
|
+
T,
|
|
215
|
+
E,
|
|
216
|
+
J,
|
|
217
|
+
m,
|
|
218
|
+
a,
|
|
219
|
+
w
|
|
190
220
|
]);
|
|
191
|
-
const
|
|
221
|
+
const Q = i.useRef(!1);
|
|
192
222
|
i.useEffect(()=>{
|
|
193
|
-
const
|
|
194
|
-
switch(
|
|
195
|
-
case
|
|
196
|
-
|
|
223
|
+
const s = (c)=>{
|
|
224
|
+
switch(c.key){
|
|
225
|
+
case At:
|
|
226
|
+
o || w();
|
|
197
227
|
break;
|
|
198
|
-
case
|
|
199
|
-
|
|
228
|
+
case Lt:
|
|
229
|
+
Q.current = !0;
|
|
200
230
|
break;
|
|
201
231
|
}
|
|
202
|
-
},
|
|
203
|
-
|
|
232
|
+
}, r = ()=>Q.current = !1, e = (c)=>{
|
|
233
|
+
!o && m && f && (c.clientX < f.left || c.clientX > f.right || c.clientY < f.top || c.clientY > f.bottom) && w();
|
|
204
234
|
};
|
|
205
|
-
return document.addEventListener("keydown",
|
|
206
|
-
document.removeEventListener("keydown",
|
|
235
|
+
return document.addEventListener("keydown", s, !1), document.addEventListener("keyup", r, !1), document.addEventListener("click", e, !1), ()=>{
|
|
236
|
+
document.removeEventListener("keydown", s, !1), document.removeEventListener("keyup", r, !1), document.removeEventListener("click", e, !1);
|
|
207
237
|
};
|
|
208
238
|
}, [
|
|
239
|
+
m,
|
|
240
|
+
w,
|
|
209
241
|
f,
|
|
210
|
-
|
|
211
|
-
l
|
|
242
|
+
o
|
|
212
243
|
]), i.useEffect(()=>{
|
|
213
|
-
|
|
244
|
+
q || (j || et || ot ? H(a) : C(a));
|
|
214
245
|
}, [
|
|
215
|
-
|
|
216
|
-
Q,
|
|
246
|
+
j,
|
|
217
247
|
et,
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
248
|
+
ot,
|
|
249
|
+
a,
|
|
250
|
+
H,
|
|
251
|
+
C,
|
|
252
|
+
q
|
|
222
253
|
]);
|
|
223
|
-
const
|
|
224
|
-
return /* @__PURE__ */
|
|
254
|
+
const mt = ft(f, y, d, l.height, l.width), ut = h !== void 0 ? h : (V == null ? void 0 : V.width) === Et;
|
|
255
|
+
return /* @__PURE__ */ B(ht, {
|
|
225
256
|
children: [
|
|
226
|
-
/* @__PURE__ */
|
|
227
|
-
ref: (
|
|
228
|
-
const
|
|
229
|
-
|
|
257
|
+
/* @__PURE__ */ n("div", {
|
|
258
|
+
ref: (s)=>{
|
|
259
|
+
const r = s == null ? void 0 : s.firstElementChild;
|
|
260
|
+
r && r !== Y.current && (Y.current = r);
|
|
230
261
|
},
|
|
231
262
|
onMouseOver: ()=>{
|
|
232
|
-
|
|
263
|
+
!m && !o && k(!0);
|
|
233
264
|
},
|
|
234
265
|
onMouseLeave: ()=>{
|
|
235
|
-
|
|
266
|
+
!m && !o && k(!1);
|
|
236
267
|
},
|
|
237
268
|
onClick: ()=>{
|
|
238
|
-
|
|
269
|
+
(m || o) && k(o ? !j : !0);
|
|
239
270
|
},
|
|
240
271
|
onFocus: ()=>{
|
|
241
|
-
|
|
272
|
+
Q.current && !o && Z(!0);
|
|
242
273
|
},
|
|
243
274
|
onBlur: ()=>{
|
|
244
|
-
|
|
275
|
+
!m && !o && Z(!1);
|
|
245
276
|
},
|
|
246
|
-
"aria-describedby":
|
|
247
|
-
children:
|
|
277
|
+
"aria-describedby": a,
|
|
278
|
+
children: u
|
|
248
279
|
}),
|
|
249
|
-
/* @__PURE__ */
|
|
250
|
-
children: /* @__PURE__ */
|
|
251
|
-
in:
|
|
252
|
-
nodeRef:
|
|
253
|
-
timeout:
|
|
254
|
-
enter:
|
|
255
|
-
exit:
|
|
280
|
+
/* @__PURE__ */ n(xt, {
|
|
281
|
+
children: /* @__PURE__ */ n(bt, {
|
|
282
|
+
in: S,
|
|
283
|
+
nodeRef: G,
|
|
284
|
+
timeout: Vt() ? 0 : {
|
|
285
|
+
enter: Yt + K,
|
|
286
|
+
exit: Kt
|
|
256
287
|
},
|
|
257
288
|
onExited: ()=>{
|
|
258
|
-
|
|
289
|
+
M(void 0), P(void 0);
|
|
259
290
|
},
|
|
260
291
|
mountOnEnter: !0,
|
|
261
292
|
unmountOnExit: !0,
|
|
262
|
-
children: (
|
|
293
|
+
children: (s)=>/* @__PURE__ */ n("div", _object_spread_props(_object_spread({
|
|
263
294
|
style: {
|
|
264
295
|
/**
|
|
265
296
|
* Hack to prevent text from wrapping automatically when touching the viewport's edges,
|
|
266
297
|
* even if the content's width didn't reach the max width.
|
|
267
298
|
* https://stackoverflow.com/questions/66106629/how-to-disable-text-wrapping-when-viewport-border-is-reached
|
|
268
|
-
*/ width: `calc(100vw + ${
|
|
299
|
+
*/ width: `calc(100vw + ${ct}px)`,
|
|
269
300
|
top: 0,
|
|
270
301
|
left: 0,
|
|
271
302
|
position: "fixed",
|
|
272
|
-
visibility:
|
|
303
|
+
visibility: T ? "visible" : "hidden"
|
|
273
304
|
}
|
|
274
|
-
},
|
|
305
|
+
}, x), {
|
|
275
306
|
role: "tooltip",
|
|
276
|
-
"aria-label":
|
|
307
|
+
"aria-label": a,
|
|
277
308
|
tabIndex: -1,
|
|
278
|
-
children: /* @__PURE__ */
|
|
279
|
-
className:
|
|
309
|
+
children: /* @__PURE__ */ n("div", {
|
|
310
|
+
className: tt(St),
|
|
280
311
|
style: _object_spread_props(_object_spread({
|
|
281
|
-
pointerEvents:
|
|
282
|
-
transform:
|
|
283
|
-
},
|
|
284
|
-
transition:
|
|
312
|
+
pointerEvents: s === "entered" ? "auto" : "none",
|
|
313
|
+
transform: Ut(mt)
|
|
314
|
+
}, T, wt[s]), {
|
|
315
|
+
transition: s === "entering" ? `opacity .1s linear ${K}ms,transform .3s cubic-bezier(0.215,0.61,0.335,1) ${K}ms` : "opacity .1s linear"
|
|
285
316
|
}),
|
|
286
|
-
ref:
|
|
317
|
+
ref: Bt(dt, G),
|
|
287
318
|
onMouseEnter: ()=>{
|
|
288
|
-
!
|
|
319
|
+
!m && s === "entered" && !o && U(!0);
|
|
289
320
|
},
|
|
290
321
|
onMouseLeave: ()=>{
|
|
291
|
-
|
|
322
|
+
!m && !o && U(!1);
|
|
292
323
|
},
|
|
293
|
-
children: /* @__PURE__ */
|
|
324
|
+
children: /* @__PURE__ */ B("div", {
|
|
294
325
|
className: Ot,
|
|
295
|
-
style: _object_spread({
|
|
296
|
-
width:
|
|
297
|
-
},
|
|
326
|
+
style: _object_spread_props(_object_spread({
|
|
327
|
+
width: v
|
|
328
|
+
}, lt(J)), {
|
|
329
|
+
maxWidth: Math.min(ct, l.width)
|
|
330
|
+
}),
|
|
298
331
|
children: [
|
|
299
|
-
/* @__PURE__ */
|
|
300
|
-
className:
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
children: /* @__PURE__ */ F(Lt, {
|
|
332
|
+
/* @__PURE__ */ n("div", {
|
|
333
|
+
className: tt(It, {
|
|
334
|
+
[Rt]: ut
|
|
335
|
+
}),
|
|
336
|
+
children: /* @__PURE__ */ B(Dt, {
|
|
305
337
|
isInverse: !1,
|
|
306
338
|
children: [
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
}),
|
|
320
|
-
I || e
|
|
339
|
+
t,
|
|
340
|
+
W && /* @__PURE__ */ n(Xt, {
|
|
341
|
+
className: _t,
|
|
342
|
+
onPress: ()=>{
|
|
343
|
+
k(!1), W();
|
|
344
|
+
},
|
|
345
|
+
trackingEvent: R,
|
|
346
|
+
"aria-label": _.modalClose,
|
|
347
|
+
children: /* @__PURE__ */ n(zt, {
|
|
348
|
+
color: X.colors.neutralHigh
|
|
349
|
+
})
|
|
350
|
+
})
|
|
321
351
|
]
|
|
322
352
|
})
|
|
323
353
|
}),
|
|
324
|
-
/* @__PURE__ */
|
|
325
|
-
className:
|
|
326
|
-
style:
|
|
327
|
-
children: /* @__PURE__ */
|
|
328
|
-
className:
|
|
329
|
-
style:
|
|
354
|
+
/* @__PURE__ */ n("div", {
|
|
355
|
+
className: Ct,
|
|
356
|
+
style: E,
|
|
357
|
+
children: /* @__PURE__ */ n("div", {
|
|
358
|
+
className: tt(Nt),
|
|
359
|
+
style: lt(J)
|
|
330
360
|
})
|
|
331
361
|
})
|
|
332
362
|
]
|
|
@@ -337,5 +367,40 @@ const at = (e)=>({
|
|
|
337
367
|
})
|
|
338
368
|
]
|
|
339
369
|
});
|
|
340
|
-
},
|
|
341
|
-
|
|
370
|
+
}, qt = (_param)=>{
|
|
371
|
+
var { centerContent: t, textCenter: u, extra: v, children: d, dataAttributes: x, title: b, description: h } = _param, I = _object_without_properties(_param, [
|
|
372
|
+
"centerContent",
|
|
373
|
+
"textCenter",
|
|
374
|
+
"extra",
|
|
375
|
+
"children",
|
|
376
|
+
"dataAttributes",
|
|
377
|
+
"title",
|
|
378
|
+
"description"
|
|
379
|
+
]);
|
|
380
|
+
return /* @__PURE__ */ n(jt, _object_spread({
|
|
381
|
+
content: /* @__PURE__ */ B(Pt, {
|
|
382
|
+
className: Mt,
|
|
383
|
+
children: [
|
|
384
|
+
(b || h) && /* @__PURE__ */ B(yt, {
|
|
385
|
+
space: 4,
|
|
386
|
+
children: [
|
|
387
|
+
b && /* @__PURE__ */ n(nt, {
|
|
388
|
+
medium: !0,
|
|
389
|
+
children: b
|
|
390
|
+
}),
|
|
391
|
+
h && /* @__PURE__ */ n(nt, {
|
|
392
|
+
regular: !0,
|
|
393
|
+
children: h
|
|
394
|
+
})
|
|
395
|
+
]
|
|
396
|
+
}),
|
|
397
|
+
v !== null && v !== void 0 ? v : d
|
|
398
|
+
]
|
|
399
|
+
}),
|
|
400
|
+
centerContent: t !== null && t !== void 0 ? t : u,
|
|
401
|
+
dataAttributes: _object_spread({
|
|
402
|
+
"component-name": "Tooltip"
|
|
403
|
+
}, x)
|
|
404
|
+
}, I));
|
|
405
|
+
}, ge = qt;
|
|
406
|
+
export { jt as BaseTooltip, ge as default };
|