@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.
Files changed (43) hide show
  1. package/css/mistica.css +1 -1
  2. package/dist/accordion.d.ts +0 -2
  3. package/dist/carousel.d.ts +5 -5
  4. package/dist/carousel.js +169 -153
  5. package/dist/cvv-field.js +85 -40
  6. package/dist/dialog.js +66 -65
  7. package/dist/feedback.css-mistica.js +14 -8
  8. package/dist/feedback.css.d.ts +2 -0
  9. package/dist/feedback.js +56 -49
  10. package/dist/index.d.ts +3 -1
  11. package/dist/index.js +4 -1
  12. package/dist/package-version.js +1 -1
  13. package/dist/popover.css-mistica.js +4 -43
  14. package/dist/popover.css.d.ts +1 -12
  15. package/dist/popover.d.ts +6 -2
  16. package/dist/popover.js +71 -226
  17. package/dist/select.js +176 -172
  18. package/dist/text.css-mistica.js +7 -7
  19. package/dist/text.css.d.ts +0 -1
  20. package/dist/text.js +24 -24
  21. package/dist/theme.d.ts +2 -1
  22. package/dist/theme.js +17 -13
  23. package/dist/tooltip.css-mistica.js +15 -6
  24. package/dist/tooltip.css.d.ts +3 -0
  25. package/dist/tooltip.d.ts +15 -1
  26. package/dist/tooltip.js +213 -140
  27. package/dist-es/carousel.js +193 -176
  28. package/dist-es/cvv-field.js +73 -69
  29. package/dist-es/dialog.js +126 -125
  30. package/dist-es/feedback.css-mistica.js +2 -2
  31. package/dist-es/feedback.js +90 -83
  32. package/dist-es/index.js +1734 -1734
  33. package/dist-es/package-version.js +1 -1
  34. package/dist-es/popover.css-mistica.js +2 -3
  35. package/dist-es/popover.js +75 -191
  36. package/dist-es/select.js +182 -178
  37. package/dist-es/style.css +1 -1
  38. package/dist-es/text.css-mistica.js +3 -3
  39. package/dist-es/text.js +32 -32
  40. package/dist-es/theme.js +16 -12
  41. package/dist-es/tooltip.css-mistica.js +2 -2
  42. package/dist-es/tooltip.js +234 -169
  43. 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
- formCreditCardCvvTooltipVisaMcButton: "Mostrar ayuda CVV",
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
- formCreditCardCvvTooltipVisaMcButton: "Show CVV help",
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
- formCreditCardCvvTooltipVisaMcButton: "CVV-Hilfe anzeigen",
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
- }, c = {
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
- formCreditCardCvvTooltipVisaMcButton: "Exibir ajuda CVV",
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 c;
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, d = 80, E = {
270
+ }, u = 56, c = 80, E = {
267
271
  headerMobileHeight: u,
268
- headerDesktopHeight: d
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
- }, b = (e)=>(_param)=>{
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
- }, h = (e)=>{
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 b(e.Component);
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 { d as NAVBAR_HEIGHT_DESKTOP, u as NAVBAR_HEIGHT_MOBILE, E as dimensions, h as getMisticaLinkComponent, g as getTexts };
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 = "_1xhatbpa _1y2v1nfhb _1y2v1nfhr _1y2v1nfgd _1y2v1nfjp _1y2v1nf37", a = "_1xhatbp8 _1y2v1nfgd _1y2v1nfhd _1y2v1nfjj", _ = "_1xhatbp1 _1y2v1nfgd", y = "_1xhatbp5 _1y2v1nfgc _1y2v1nfic _1y2v1nfjj", o = "_1xhatbp3 _1y2v1nfgc _1y2v1nfjb _1y2v1nf37", r = "_1y2v1nfgi _1y2v1nfgo _1y2v1nfgx", i = {
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, a as arrowContainer, _ as container, y as content, o as tooltip, r as tooltipCenter, i as tooltipTransitionClasses };
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 };
@@ -51,28 +51,58 @@ function _object_spread_props(target, source) {
51
51
  }
52
52
  return target;
53
53
  }
54
- import { jsxs as F, Fragment as mt, jsx as p } from "react/jsx-runtime";
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 ht, useBoundingRect as it, useWindowSize as gt } from "./hooks.js";
57
- import { Portal as Tt } from "./portal.js";
58
- import { Transition as vt } from "react-transition-group";
59
- import { container as xt, tooltipTransitionClasses as bt, tooltip as Ot, content as It, tooltipCenter as Mt, arrowContainer as St, arrow as yt } from "./tooltip.css-mistica.js";
60
- import Et from "./stack.js";
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 wt, getPrefixedDataAttributes as Rt } from "./utils/dom.js";
63
- import { TAB as _t, ESC as Ct } from "./utils/keys.js";
64
- import { isTouchableDevice as Nt } from "./utils/environment.js";
65
- import { isEqual as st } from "./utils/helpers.js";
66
- import Z from "classnames";
67
- import { vars as J } from "./skins/skin-contract.css-mistica.js";
68
- import { useIsInverseVariant as kt, ThemeVariant as Lt } from "./theme-variant-context.js";
69
- import { combineRefs as At } from "./utils/common.js";
70
- import { useTooltipState as $t, useSetTooltipState as Pt } from "./tooltip-context-provider.js";
71
- import { isRunningAcceptanceTest as Ft } from "./utils/platform.js";
72
- const at = (e)=>({
73
- border: `1px solid ${e ? J.colors.backgroundContainer : J.colors.border}`
74
- }), lt = 496, Dt = 300, Wt = 500, Vt = 100, c = 20, O = 6, E = O + c / 2 + 1, Bt = (e)=>{
75
- switch(e){
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 = (e)=>{
88
- const I = parseFloat(getComputedStyle(e, null).paddingLeft) + parseFloat(getComputedStyle(e, null).paddingRight), m = parseFloat(getComputedStyle(e, null).paddingTop) + parseFloat(getComputedStyle(e, null).paddingBottom), w = e.offsetWidth - I, h = e.offsetHeight - m;
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: w,
91
- height: h
120
+ width: d,
121
+ height: x
92
122
  };
93
- }, ct = (e, I, m, w, h)=>{
94
- if (!e || !I) return;
95
- const { top: D, bottom: R, left: W, right: V } = e, M = w - R, g = h - V, S = D, n = W, { width: B, height: $ } = pt(I), y = B + E, d = $ + E, T = y <= Math.max(n, g), v = d <= Math.max(M, S);
96
- if (!(!v && !T)) switch(m){
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 T ? y <= n ? "left" : "right" : M > S ? "bottom" : "top";
128
+ return M ? C <= a ? "left" : "right" : o > _ ? "bottom" : "top";
99
129
  case "right":
100
- return T ? y <= g ? "right" : "left" : M > S ? "bottom" : "top";
130
+ return M ? C <= R ? "right" : "left" : o > _ ? "bottom" : "top";
101
131
  case "top":
102
- return v ? d <= S ? "top" : "bottom" : n > g ? "left" : "right";
132
+ return E ? T <= _ ? "top" : "bottom" : a > R ? "left" : "right";
103
133
  case "bottom":
104
- return v ? d <= M ? "bottom" : "top" : n > g ? "left" : "right";
134
+ return E ? T <= o ? "bottom" : "top" : a > R ? "left" : "right";
105
135
  default:
106
136
  return;
107
137
  }
108
- }, Xt = (param)=>{
109
- let { children: e, extra: I, description: m, target: w, title: h, width: D, position: R = "top", dataAttributes: W, delay: V = !0, centerContent: M, open: g, textCenter: S } = param;
110
- const n = ht(), { openTooltipId: B } = $t(), { openTooltip: $, closeTooltip: y } = Pt(), [d, T] = i.useState(), [v, X] = i.useState(), z = i.useRef(null), H = i.useRef(null), [_, ft] = i.useState(null), f = Nt(), Y = V ? Wt : 0, [Q, G] = i.useState(!1), [tt, P] = i.useState(!1), K = g !== void 0, [et, U] = i.useState(!1), x = K ? g : n === B, j = kt(), l = it(z, x), dt = it(H, x, !0), s = gt(), b = i.useCallback(()=>{
111
- U(!1), G(!1), P(!1);
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
- x || b();
144
+ S || w();
115
145
  }, [
116
- x,
117
- b
146
+ S,
147
+ w
118
148
  ]), i.useEffect(()=>{
119
- if (!_ || !x) return;
120
- const r = ct(l, _, R, s.height, s.width);
121
- if (!r || !l) {
122
- T(void 0), X(void 0), b();
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 o, t;
155
+ let r, e;
126
156
  var _parseInt;
127
- const { left: a, right: C, top: N, bottom: k } = l, { width: L, height: A } = pt(_), ot = s.width - L, rt = s.height - A, u = (_parseInt = parseInt(wt(J.borderRadii.popup))) !== null && _parseInt !== void 0 ? _parseInt : 8;
128
- switch(r){
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
- o = {
131
- left: Math.max(0, Math.min(ot, (a + C - L) / 2)),
132
- top: N - A - c / 2,
133
- padding: `0px 0px ${E}px 0px`
134
- }, t = {
135
- left: Math.max(u, Math.min(s.width - u - c, (a + C - c) / 2)),
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
- o = {
141
- left: Math.max(0, Math.min(ot, (a + C - L) / 2)),
142
- top: k - O,
143
- padding: `${E}px 0px 0px 0px`
144
- }, t = {
145
- left: Math.max(u, Math.min(s.width - u - c, (a + C - c) / 2)),
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
- o = {
152
- left: a - L - c / 2,
153
- top: Math.max(0, Math.min(rt, (N + k - A) / 2)),
154
- padding: `0px ${E}px 0px 0px`
155
- }, t = {
156
- top: Math.max(u, Math.min(s.height - u - c, (N + k - c) / 2)),
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
- o = {
165
- left: C - O,
166
- top: Math.max(0, Math.min(rt, (N + k - A) / 2)),
167
- padding: `0px 0px 0px ${E}px`
168
- }, t = {
169
- top: Math.max(u, Math.min(s.height - u - c, (N + k - c) / 2)),
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 t.top == "number" && (t.top -= o.top, t.top = `${t.top / A * 100}%`), typeof t.left == "number" && (t.left -= o.left, t.left = `${t.left / L * 100}%`), st(o, d) || T(o), st(t, v) || X(t);
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
- n,
189
- b
210
+ V,
211
+ S,
212
+ d,
213
+ l,
214
+ T,
215
+ E,
216
+ J,
217
+ m,
218
+ a,
219
+ w
190
220
  ]);
191
- const q = i.useRef(!1);
221
+ const Q = i.useRef(!1);
192
222
  i.useEffect(()=>{
193
- const r = (a)=>{
194
- switch(a.key){
195
- case Ct:
196
- b();
223
+ const s = (c)=>{
224
+ switch(c.key){
225
+ case At:
226
+ o || w();
197
227
  break;
198
- case _t:
199
- q.current = !0;
228
+ case Lt:
229
+ Q.current = !0;
200
230
  break;
201
231
  }
202
- }, o = ()=>q.current = !1, t = (a)=>{
203
- f && l && (a.clientX < l.left || a.clientX > l.right || a.clientY < l.top || a.clientY > l.bottom) && b();
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", r, !1), document.addEventListener("keyup", o, !1), document.addEventListener("click", t, !1), ()=>{
206
- document.removeEventListener("keydown", r, !1), document.removeEventListener("keyup", o, !1), document.removeEventListener("click", t, !1);
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
- b,
211
- l
242
+ o
212
243
  ]), i.useEffect(()=>{
213
- K || (tt || Q || et ? $(n) : y(n));
244
+ q || (j || et || ot ? H(a) : C(a));
214
245
  }, [
215
- tt,
216
- Q,
246
+ j,
217
247
  et,
218
- n,
219
- $,
220
- y,
221
- K
248
+ ot,
249
+ a,
250
+ H,
251
+ C,
252
+ q
222
253
  ]);
223
- const ut = ct(l, _, R, s.height, s.width);
224
- return /* @__PURE__ */ F(mt, {
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__ */ p("div", {
227
- ref: (r)=>{
228
- const o = r == null ? void 0 : r.firstElementChild;
229
- o && o !== z.current && (z.current = o);
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
- f || P(!0);
263
+ !m && !o && k(!0);
233
264
  },
234
265
  onMouseLeave: ()=>{
235
- f || P(!1);
266
+ !m && !o && k(!1);
236
267
  },
237
268
  onClick: ()=>{
238
- f && P(!0);
269
+ (m || o) && k(o ? !j : !0);
239
270
  },
240
271
  onFocus: ()=>{
241
- q.current && U(!0);
272
+ Q.current && !o && Z(!0);
242
273
  },
243
274
  onBlur: ()=>{
244
- f || U(!1);
275
+ !m && !o && Z(!1);
245
276
  },
246
- "aria-describedby": n,
247
- children: w
277
+ "aria-describedby": a,
278
+ children: u
248
279
  }),
249
- /* @__PURE__ */ p(Tt, {
250
- children: /* @__PURE__ */ p(vt, {
251
- in: x,
252
- nodeRef: H,
253
- timeout: Ft() ? 0 : {
254
- enter: Dt + Y,
255
- exit: Vt
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
- T(void 0), X(void 0);
289
+ M(void 0), P(void 0);
259
290
  },
260
291
  mountOnEnter: !0,
261
292
  unmountOnExit: !0,
262
- children: (r)=>/* @__PURE__ */ p("div", _object_spread_props(_object_spread({
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 + ${lt}px)`,
299
+ */ width: `calc(100vw + ${ct}px)`,
269
300
  top: 0,
270
301
  left: 0,
271
302
  position: "fixed",
272
- visibility: d ? "visible" : "hidden"
303
+ visibility: T ? "visible" : "hidden"
273
304
  }
274
- }, Rt(W, "Tooltip")), {
305
+ }, x), {
275
306
  role: "tooltip",
276
- "aria-label": n,
307
+ "aria-label": a,
277
308
  tabIndex: -1,
278
- children: /* @__PURE__ */ p("div", {
279
- className: Z(xt),
309
+ children: /* @__PURE__ */ n("div", {
310
+ className: tt(St),
280
311
  style: _object_spread_props(_object_spread({
281
- pointerEvents: r === "entered" ? "auto" : "none",
282
- transform: Bt(ut)
283
- }, d, bt[r]), {
284
- transition: r === "entering" ? `opacity .1s linear ${Y}ms,transform .3s cubic-bezier(0.215,0.61,0.335,1) ${Y}ms` : "opacity .1s linear"
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: At(ft, H),
317
+ ref: Bt(dt, G),
287
318
  onMouseEnter: ()=>{
288
- !f && r === "entered" && G(!0);
319
+ !m && s === "entered" && !o && U(!0);
289
320
  },
290
321
  onMouseLeave: ()=>{
291
- f || G(!1);
322
+ !m && !o && U(!1);
292
323
  },
293
- children: /* @__PURE__ */ F("div", {
324
+ children: /* @__PURE__ */ B("div", {
294
325
  className: Ot,
295
- style: _object_spread({
296
- width: D
297
- }, at(j)),
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__ */ p("div", {
300
- className: Z(It, M || S ? Mt : void 0),
301
- style: {
302
- maxWidth: Math.min(lt, s.width)
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
- (h || m) && /* @__PURE__ */ F(Et, {
308
- space: 4,
309
- children: [
310
- h && /* @__PURE__ */ p(nt, {
311
- medium: !0,
312
- children: h
313
- }),
314
- m && /* @__PURE__ */ p(nt, {
315
- regular: !0,
316
- children: m
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__ */ p("div", {
325
- className: St,
326
- style: v,
327
- children: /* @__PURE__ */ p("div", {
328
- className: Z(yt),
329
- style: at(j)
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
- }, se = Xt;
341
- export { se as default };
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 };