@telefonica/mistica 14.34.0 → 14.35.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 (156) hide show
  1. package/css/mistica.css +1 -1
  2. package/dist/avatar.css-mistica.js +1 -1
  3. package/dist/button.css-mistica.js +7 -7
  4. package/dist/callout.css-mistica.js +1 -1
  5. package/dist/callout.js +17 -12
  6. package/dist/card.js +277 -244
  7. package/dist/carousel.css-mistica.js +5 -5
  8. package/dist/carousel.js +54 -52
  9. package/dist/checkbox.js +18 -18
  10. package/dist/community/advanced-data-card.css-mistica.js +3 -3
  11. package/dist/community/advanced-data-card.js +57 -50
  12. package/dist/community/blocks.js +42 -35
  13. package/dist/counter.css-mistica.js +1 -1
  14. package/dist/cvv-field.js +1 -1
  15. package/dist/dialog.css-mistica.js +3 -3
  16. package/dist/dialog.js +2 -2
  17. package/dist/hero.js +34 -30
  18. package/dist/hooks.d.ts +12 -1
  19. package/dist/hooks.js +85 -48
  20. package/dist/image.css-mistica.js +7 -2
  21. package/dist/image.css.d.ts +3 -0
  22. package/dist/image.d.ts +1 -7
  23. package/dist/image.js +55 -66
  24. package/dist/list.css-mistica.js +1 -1
  25. package/dist/list.js +80 -75
  26. package/dist/loading-bar.css-mistica.js +6 -6
  27. package/dist/maybe-dismissable.css-mistica.js +1 -1
  28. package/dist/menu.js +32 -32
  29. package/dist/navigation-bar.css-mistica.js +10 -10
  30. package/dist/overlay.js +10 -10
  31. package/dist/package-version.js +1 -1
  32. package/dist/pin-field.css-mistica.js +3 -3
  33. package/dist/popover.css-mistica.js +4 -4
  34. package/dist/radio-button.css-mistica.js +5 -5
  35. package/dist/radio-button.js +7 -7
  36. package/dist/screen-reader-only.css-mistica.js +1 -1
  37. package/dist/select.css-mistica.js +7 -7
  38. package/dist/select.js +65 -53
  39. package/dist/sheet.css-mistica.js +8 -8
  40. package/dist/skeletons.d.ts +9 -1
  41. package/dist/skeletons.js +3 -0
  42. package/dist/skins/blau.js +2 -1
  43. package/dist/skins/defaults.js +2 -1
  44. package/dist/skins/movistar-legacy.js +2 -1
  45. package/dist/skins/movistar.js +2 -1
  46. package/dist/skins/o2.js +2 -1
  47. package/dist/skins/skin-contract.css-mistica.js +2 -1
  48. package/dist/skins/skin-contract.css.d.ts +1 -0
  49. package/dist/skins/telefonica.js +2 -1
  50. package/dist/skins/types/index.d.ts +1 -0
  51. package/dist/skins/vivo-new.js +2 -1
  52. package/dist/skins/vivo.js +2 -1
  53. package/dist/slider.css-mistica.js +19 -19
  54. package/dist/slider.css.d.ts +8 -8
  55. package/dist/slider.d.ts +28 -8
  56. package/dist/slider.js +226 -106
  57. package/dist/snackbar.css-mistica.js +5 -5
  58. package/dist/sprinkles.css-mistica.js +71 -68
  59. package/dist/stacking-group.js +31 -24
  60. package/dist/stepper.css-mistica.js +3 -3
  61. package/dist/switch-component.css-mistica.js +17 -17
  62. package/dist/switch-component.js +12 -12
  63. package/dist/tab-focus.js +12 -12
  64. package/dist/tabs.css-mistica.js +1 -1
  65. package/dist/text-field-base.css-mistica.js +1 -1
  66. package/dist/text-field-components.css-mistica.js +7 -7
  67. package/dist/text-link.css-mistica.js +3 -3
  68. package/dist/theme-context-provider.js +39 -36
  69. package/dist/tooltip-context-provider.d.ts +14 -0
  70. package/dist/tooltip-context-provider.js +90 -0
  71. package/dist/tooltip.css-mistica.js +25 -54
  72. package/dist/tooltip.css.d.ts +19 -26
  73. package/dist/tooltip.d.ts +15 -1
  74. package/dist/tooltip.js +255 -207
  75. package/dist/touchable.css-mistica.js +1 -1
  76. package/dist/touchable.js +8 -8
  77. package/dist/utils/aspect-ratio-support.css-mistica.js +2 -2
  78. package/dist/utils/environment.d.ts +1 -0
  79. package/dist/utils/environment.js +4 -1
  80. package/dist/utils/keys.d.ts +8 -0
  81. package/dist/utils/{key-codes.js → keys.js} +6 -6
  82. package/dist/video.css-mistica.js +1 -1
  83. package/dist/video.js +33 -31
  84. package/dist-es/avatar.css-mistica.js +1 -1
  85. package/dist-es/button.css-mistica.js +7 -7
  86. package/dist-es/callout.css-mistica.js +1 -1
  87. package/dist-es/callout.js +33 -28
  88. package/dist-es/card.js +416 -383
  89. package/dist-es/carousel.css-mistica.js +2 -2
  90. package/dist-es/carousel.js +84 -82
  91. package/dist-es/checkbox.js +18 -18
  92. package/dist-es/community/advanced-data-card.css-mistica.js +2 -2
  93. package/dist-es/community/advanced-data-card.js +83 -76
  94. package/dist-es/community/blocks.js +77 -70
  95. package/dist-es/counter.css-mistica.js +1 -1
  96. package/dist-es/cvv-field.js +1 -1
  97. package/dist-es/dialog.css-mistica.js +3 -3
  98. package/dist-es/dialog.js +2 -2
  99. package/dist-es/hero.js +69 -65
  100. package/dist-es/hooks.js +83 -49
  101. package/dist-es/image.css-mistica.js +4 -2
  102. package/dist-es/image.js +74 -79
  103. package/dist-es/list.css-mistica.js +1 -1
  104. package/dist-es/list.js +116 -111
  105. package/dist-es/loading-bar.css-mistica.js +2 -2
  106. package/dist-es/maybe-dismissable.css-mistica.js +1 -1
  107. package/dist-es/menu.js +41 -41
  108. package/dist-es/navigation-bar.css-mistica.js +6 -6
  109. package/dist-es/overlay.js +14 -14
  110. package/dist-es/package-version.js +1 -1
  111. package/dist-es/pin-field.css-mistica.js +2 -2
  112. package/dist-es/popover.css-mistica.js +2 -2
  113. package/dist-es/radio-button.css-mistica.js +4 -4
  114. package/dist-es/radio-button.js +2 -2
  115. package/dist-es/screen-reader-only.css-mistica.js +1 -1
  116. package/dist-es/select.css-mistica.js +7 -7
  117. package/dist-es/select.js +89 -77
  118. package/dist-es/sheet.css-mistica.js +2 -2
  119. package/dist-es/skeletons.js +1 -1
  120. package/dist-es/skins/blau.js +2 -1
  121. package/dist-es/skins/defaults.js +2 -1
  122. package/dist-es/skins/movistar-legacy.js +2 -1
  123. package/dist-es/skins/movistar.js +2 -1
  124. package/dist-es/skins/o2.js +2 -1
  125. package/dist-es/skins/skin-contract.css-mistica.js +2 -1
  126. package/dist-es/skins/telefonica.js +2 -1
  127. package/dist-es/skins/vivo-new.js +2 -1
  128. package/dist-es/skins/vivo.js +2 -1
  129. package/dist-es/slider.css-mistica.js +2 -8
  130. package/dist-es/slider.js +231 -111
  131. package/dist-es/snackbar.css-mistica.js +4 -4
  132. package/dist-es/sprinkles.css-mistica.js +71 -68
  133. package/dist-es/stacking-group.js +37 -30
  134. package/dist-es/stepper.css-mistica.js +2 -2
  135. package/dist-es/style.css +1 -1
  136. package/dist-es/switch-component.css-mistica.js +13 -13
  137. package/dist-es/switch-component.js +14 -14
  138. package/dist-es/tab-focus.js +14 -14
  139. package/dist-es/tabs.css-mistica.js +1 -1
  140. package/dist-es/text-field-base.css-mistica.js +1 -1
  141. package/dist-es/text-field-components.css-mistica.js +2 -2
  142. package/dist-es/text-link.css-mistica.js +3 -3
  143. package/dist-es/theme-context-provider.js +53 -50
  144. package/dist-es/tooltip-context-provider.js +29 -0
  145. package/dist-es/tooltip.css-mistica.js +16 -9
  146. package/dist-es/tooltip.js +264 -216
  147. package/dist-es/touchable.css-mistica.js +1 -1
  148. package/dist-es/touchable.js +8 -8
  149. package/dist-es/utils/aspect-ratio-support.css-mistica.js +2 -2
  150. package/dist-es/utils/environment.js +2 -2
  151. package/dist-es/utils/keys.js +2 -0
  152. package/dist-es/video.css-mistica.js +1 -1
  153. package/dist-es/video.js +41 -39
  154. package/package.json +1 -1
  155. package/dist/utils/key-codes.d.ts +0 -8
  156. package/dist-es/utils/key-codes.js +0 -2
@@ -51,239 +51,287 @@ function _object_spread_props(target, source) {
51
51
  }
52
52
  return target;
53
53
  }
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
- }
54
+ import { jsxs as F, Fragment as mt, jsx as f } from "react/jsx-runtime";
55
+ 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";
61
+ 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 q from "classnames";
67
+ import { vars as Z } 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 ? Z.colors.backgroundContainer : Z.colors.border}`
74
+ }), lt = 496, Dt = 300, Wt = 500, Vt = 100, c = 20, b = 6, E = b + c / 2 + 1, Bt = (e)=>{
75
+ switch(e){
76
+ case "left":
77
+ return `translateX(-${b}px)`;
78
+ case "right":
79
+ return `translateX(${b}px)`;
80
+ case "top":
81
+ return `translateY(-${b}px)`;
82
+ case "bottom":
83
+ return `translateY(${b}px)`;
84
+ default:
85
+ return "";
66
86
  }
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];
87
+ }, ft = (e)=>{
88
+ const O = parseFloat(getComputedStyle(e, null).paddingLeft) + parseFloat(getComputedStyle(e, null).paddingRight), m = parseFloat(getComputedStyle(e, null).paddingTop) + parseFloat(getComputedStyle(e, null).paddingBottom), w = e.offsetWidth - O, h = e.offsetHeight - m;
89
+ return {
90
+ width: w,
91
+ height: h
92
+ };
93
+ }, ct = (e, O, m, w, h)=>{
94
+ if (!e || !O) return;
95
+ const { top: D, bottom: R, left: W, right: V } = e, I = w - R, g = h - V, M = D, n = W, { width: B, height: $ } = ft(O), S = B + E, d = $ + E, y = S <= Math.max(n, g), T = d <= Math.max(I, M);
96
+ if (!(!T && !y)) switch(m){
97
+ case "left":
98
+ return y ? S <= n ? "left" : "right" : I > M ? "bottom" : "top";
99
+ case "right":
100
+ return y ? S <= g ? "right" : "left" : I > M ? "bottom" : "top";
101
+ case "top":
102
+ return T ? d <= M ? "top" : "bottom" : n > g ? "left" : "right";
103
+ case "bottom":
104
+ return T ? d <= I ? "bottom" : "top" : n > g ? "left" : "right";
105
+ default:
106
+ return;
78
107
  }
79
- return target;
80
- }
81
- import { jsxs as P, Fragment as et, jsx as w } from "react/jsx-runtime";
82
- import * as o from "react";
83
- import E from "classnames";
84
- import { CSSTransition as rt } from "react-transition-group";
85
- import { useTheme as nt, useScreenSize as ot, useAriaId as it } from "./hooks.js";
86
- import { Portal as at } from "./portal.js";
87
- import ct from "./overlay.js";
88
- import { Text2 as I } from "./text.js";
89
- import { TAB as st } from "./utils/key-codes.js";
90
- import ut from "./stack.js";
91
- import { wrapper as lt, enter as dt, enterActive as ft, enterDone as ht, exit as wt, exitActive as mt, container as pt, textAlign as gt, textCenter as xt, arrowWrapper as Tt, arrow as vt, arrowTop as bt, arrowBottom as At, arrowLeft as Pt, arrowRight as St, vars as s, fadeInTopKeyframes as Yt, fadeInBottomKeyframes as Ct, fadeInXKeyframes as yt } from "./tooltip.css-mistica.js";
92
- import { getPrefixedDataAttributes as Ot } from "./utils/dom.js";
93
- import { isClientSide as Rt, isServerSide as Dt } from "./utils/environment.js";
94
- import { applyCssVars as Wt } from "./utils/css.js";
95
- const $t = "bottom", Bt = "top", Et = 12, m = 4 + Et, It = 500, v = 12, Mt = 500, M = ()=>{}, Nt = (r)=>r === "bottom" ? `translateY(${v}px)` : r === "top" ? `translateY(calc(-100% - ${v}px))` : r === "right" ? `translateX(${v}px) translateY(-50%)` : r === "left" ? `translateX(-${v}px) translateY(-50%)` : `translateY(-${v}px)`, kt = (r)=>r === "top" ? "translateY(-100%)" : r === "bottom" ? "translateY(0)" : "translateY(-50%)", Lt = (r)=>r === "bottom" ? "translateY(0)" : r === "top" ? "translateY(-100%)" : r === "right" || r === "left" ? "translateX(0px) translateY(-50%)" : "translateY(0px)", Vt = (r)=>r === "top" ? Yt : r === "bottom" ? Ct : yt, jt = (r)=>r ? "1" : "0.2", Kt = (r)=>r === "top" ? `2px 2px 4px 0 rgba(0, 0, 0, ${s.shadowAlpha})` : r === "right" ? `0 0 4px 0 rgba(0, 0, 0, ${s.shadowAlpha})` : r === "left" ? `0 0 4px 0 rgba(0, 0, 0, ${s.shadowAlpha})` : r === "bottom" ? `-1px -1px 4px 0 rgba(0, 0, 0, ${s.shadowAlpha})` : "", zt = (_param)=>{
96
- var { children: r, extra: N, description: S, target: k, title: Y, targetLabel: L, delay: V = !0, dataAttributes: j, targetStyle: K, unstable_offsetX: f, textCenter: z } = _param, R = _object_without_properties(_param, [
97
- "children",
98
- "extra",
99
- "description",
100
- "target",
101
- "title",
102
- "targetLabel",
103
- "delay",
104
- "dataAttributes",
105
- "targetStyle",
106
- "unstable_offsetX",
107
- "textCenter"
108
+ }, Xt = (param)=>{
109
+ let { children: e, extra: O, description: m, target: w, title: h, width: D, position: R = "top", dataAttributes: W, delay: V = !0, centerContent: I, open: g, textCenter: M } = param;
110
+ const n = ht(), { openTooltipId: B } = $t(), { openTooltip: $, closeTooltip: S } = Pt(), [d, y] = i.useState(), [T, J] = i.useState(), X = i.useRef(null), z = i.useRef(null), [_, pt] = i.useState(null), p = Nt(), H = V ? Wt : 0, [Q, Y] = i.useState(!1), [tt, P] = i.useState(!1), G = g !== void 0, [et, K] = i.useState(!1), v = G ? g : n === B, U = kt(), l = it(X, v), dt = it(z, v, !0), s = gt(), x = i.useCallback(()=>{
111
+ K(!1), Y(!1), P(!1);
112
+ }, []);
113
+ i.useEffect(()=>{
114
+ v || x();
115
+ }, [
116
+ v,
117
+ x
118
+ ]), i.useEffect(()=>{
119
+ if (!_ || !v) return;
120
+ const r = ct(l, _, R, s.height, s.width);
121
+ if (!r || !l) {
122
+ y(void 0), J(void 0), x();
123
+ return;
124
+ }
125
+ let o, t;
126
+ const { left: a, right: C, top: N, bottom: k } = l, { width: L, height: A } = ft(_), ot = s.width - L, rt = s.height - A, u = parseInt(wt(Z.borderRadii.container)) || 8;
127
+ switch(r){
128
+ case "top":
129
+ o = {
130
+ left: Math.max(0, Math.min(ot, (a + C - L) / 2)),
131
+ top: N - A - c / 2,
132
+ padding: `0px 0px ${E}px 0px`
133
+ }, t = {
134
+ left: Math.max(u, Math.min(s.width - u - c, (a + C - c) / 2)),
135
+ top: "100%"
136
+ };
137
+ break;
138
+ case "bottom":
139
+ o = {
140
+ left: Math.max(0, Math.min(ot, (a + C - L) / 2)),
141
+ top: k - b,
142
+ padding: `${E}px 0px 0px 0px`
143
+ }, t = {
144
+ left: Math.max(u, Math.min(s.width - u - c, (a + C - c) / 2)),
145
+ bottom: "100%",
146
+ transform: "rotate(180deg)"
147
+ };
148
+ break;
149
+ case "left":
150
+ o = {
151
+ left: a - L - c / 2,
152
+ top: Math.max(0, Math.min(rt, (N + k - A) / 2)),
153
+ padding: `0px ${E}px 0px 0px`
154
+ }, t = {
155
+ top: Math.max(u, Math.min(s.height - u - c, (N + k - c) / 2)),
156
+ left: "100%",
157
+ transform: "rotate(-90deg)",
158
+ transformOrigin: "bottom"
159
+ };
160
+ break;
161
+ case "right":
162
+ default:
163
+ o = {
164
+ left: C - b,
165
+ top: Math.max(0, Math.min(rt, (N + k - A) / 2)),
166
+ padding: `0px 0px 0px ${E}px`
167
+ }, t = {
168
+ top: Math.max(u, Math.min(s.height - u - c, (N + k - c) / 2)),
169
+ right: "100%",
170
+ transform: "rotate(90deg)",
171
+ transformOrigin: "bottom"
172
+ };
173
+ break;
174
+ }
175
+ 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) || y(o), st(t, T) || J(t);
176
+ }, [
177
+ _,
178
+ l,
179
+ dt,
180
+ v,
181
+ R,
182
+ s,
183
+ d,
184
+ T,
185
+ U,
186
+ p,
187
+ n,
188
+ x
108
189
  ]);
109
- const { isDarkMode: F } = nt(), [a, C] = o.useState(!1), { isTabletOrSmaller: H } = ot(), D = it(), h = o.useRef(!1), c = o.useRef(null), g = o.useRef(null), y = o.useRef(null), x = o.useRef(null), t = o.useRef({
110
- top: 0,
111
- right: 0,
112
- left: 0,
113
- bottom: 0,
114
- width: 0,
115
- height: 0
116
- }), [X, q] = o.useState({}), G = (n)=>H ? n || Bt : n || $t, [e, J] = o.useState(void 0), i = ((n)=>{
117
- if (!e) return n;
118
- const u = (d)=>{
119
- const p = t.current.top > e.height;
120
- return t.current.left < e.width ? p ? "top" : "bottom" : d;
121
- }, l = (d)=>t.current.right + e.width > window.innerWidth ? u("left") : d;
122
- return ({
123
- top: t.current.top < e.height ? l("bottom") : l(n),
124
- right: l(n),
125
- left: t.current.left < e.width ? t.current.right + e.width > window.innerWidth ? t.current.top < e.height ? "bottom" : "top" : "right" : n,
126
- bottom: t.current.bottom + e.height > window.innerHeight ? l("top") : l(n)
127
- })[n];
128
- })(G(R.position)), O = Rt() ? window.matchMedia("(pointer: coarse)").matches : !1, W = ()=>{
129
- a && C(!1);
130
- };
131
- o.useEffect(()=>(window.addEventListener("resize", W), ()=>{
132
- window.removeEventListener("resize", W);
133
- }));
134
- const $ = ()=>{
135
- C(!1);
136
- }, T = ()=>{
137
- y.current && (t.current = y.current.getBoundingClientRect(), C(!a));
138
- }, Q = ()=>{
139
- a || T();
140
- }, U = (n)=>{
141
- n.keyCode === st && $();
142
- }, Z = (n)=>{
143
- if (!e) return {};
144
- const u = e.width > t.current.width && t.current.left + t.current.width / 2 < e.width / 2 + 16 ? t.current.width / 2 : "50%";
145
- return n === "bottom" || n === "top" ? {
146
- left: u
147
- } : {};
148
- }, B = o.useCallback((n, u)=>{
149
- if (Dt() || !e) return {};
150
- const l = e.width > t.current.width && t.current.left + t.current.width / 2 < e.width / 2 + 16 ? Math.round(e.width / 2 - t.current.width / 2) : 0, A = f || (u ? window.pageXOffset + t.current.left + t.current.width / 2 - u / 2 : window.pageXOffset + t.current.left + l + t.current.width / 2 - e.width / 2), d = t.current.left < e.width ? A : u ? t.current.left - u - m : t.current.left - e.width - m, p = t.current.left < e.width ? t.current.top < e.height ? window.pageYOffset + t.current.bottom + m : window.pageYOffset + t.current.top - m : f || window.pageYOffset + t.current.top + t.current.height / 2;
151
- return ({
152
- right: {
153
- left: t.current.right + e.width > window.innerWidth ? d : t.current.right + m,
154
- top: t.current.right + e.width > window.innerWidth ? p : f || window.pageYOffset + t.current.top + t.current.height / 2
155
- },
156
- left: {
157
- left: d,
158
- top: p
159
- },
160
- top: {
161
- top: t.current.right + e.width > window.innerWidth ? p : window.pageYOffset + t.current.top - m,
162
- left: t.current.right + e.width > window.innerWidth ? d : A
163
- },
164
- bottom: {
165
- top: t.current.right + e.width > window.innerWidth ? p : window.pageYOffset + t.current.bottom + m,
166
- left: t.current.right + e.width > window.innerWidth ? d : A
190
+ const j = i.useRef(!1);
191
+ i.useEffect(()=>{
192
+ const r = (a)=>{
193
+ switch(a.key){
194
+ case Ct:
195
+ x();
196
+ break;
197
+ case _t:
198
+ j.current = !0;
199
+ break;
167
200
  }
168
- })[n];
201
+ }, o = ()=>j.current = !1, t = (a)=>{
202
+ p && l && (a.clientX < l.left || a.clientX > l.right || a.clientY < l.top || a.clientY > l.bottom) && x();
203
+ };
204
+ return document.addEventListener("keydown", r, !1), document.addEventListener("keyup", o, !1), document.addEventListener("click", t, !1), ()=>{
205
+ document.removeEventListener("keydown", r, !1), document.removeEventListener("keyup", o, !1), document.removeEventListener("click", t, !1);
206
+ };
169
207
  }, [
170
- f,
171
- e
172
- ]), b = (()=>R.width)(), _ = {
173
- top: bt,
174
- bottom: At,
175
- left: Pt,
176
- right: St
177
- }, tt = i && Wt({
178
- [s.enterTransform]: Nt(i),
179
- [s.exitTransform]: Lt(i),
180
- [s.enterActiveAnimationName]: Vt(i),
181
- [s.enterDoneTransform]: kt(i),
182
- [s.shadowAlpha]: jt(F),
183
- [s.arrowBoxShadow]: Kt(i)
184
- });
185
- return o.useEffect(()=>{
186
- i && x.current && a && q(B(i, b || 0));
208
+ p,
209
+ x,
210
+ l
211
+ ]), i.useEffect(()=>{
212
+ G || (tt || Q || et ? $(n) : S(n));
187
213
  }, [
188
- a,
189
- B,
190
- i,
191
- b
192
- ]), o.useEffect(()=>{
193
- x.current && (x.current.getBoundingClientRect(), a && J(x.current.getBoundingClientRect()));
194
- }, [
195
- a
196
- ]), /* @__PURE__ */ P(et, {
214
+ tt,
215
+ Q,
216
+ et,
217
+ n,
218
+ $,
219
+ S,
220
+ G
221
+ ]);
222
+ const ut = ct(l, _, R, s.height, s.width);
223
+ return /* @__PURE__ */ F(mt, {
197
224
  children: [
198
- /* @__PURE__ */ w("div", {
199
- ref: y,
200
- style: K,
201
- className: lt,
202
- onPointerOver: ()=>{
203
- c.current && (clearTimeout(c.current), c.current = null), !h.current && (h.current = !0, V ? g.current = setTimeout(()=>{
204
- g.current = null, T();
205
- }, Mt) : T());
225
+ /* @__PURE__ */ f("div", {
226
+ ref: (r)=>{
227
+ const o = r == null ? void 0 : r.firstElementChild;
228
+ o && o !== X.current && (X.current = o);
206
229
  },
207
- onPointerLeave: O ? M : ()=>{
208
- if (g.current) {
209
- clearTimeout(g.current), g.current = null, h.current = !1;
210
- return;
211
- }
212
- c.current = setTimeout(()=>{
213
- h.current && (c.current = null, h.current = !1, T());
214
- }, 100);
230
+ onMouseOver: ()=>{
231
+ p || P(!0);
215
232
  },
216
- onFocus: Q,
217
- onKeyDown: U,
218
- "touch-action": "auto",
219
- role: "button",
220
- tabIndex: 0,
221
- "aria-describedby": D,
222
- "aria-expanded": a,
223
- "aria-label": L,
224
- children: k
233
+ onMouseLeave: ()=>{
234
+ p || P(!1);
235
+ },
236
+ onClick: ()=>{
237
+ p && P(!0);
238
+ },
239
+ onFocus: ()=>{
240
+ j.current && K(!0);
241
+ },
242
+ onBlur: ()=>{
243
+ p || K(!1);
244
+ },
245
+ "aria-describedby": n,
246
+ children: w
225
247
  }),
226
- /* @__PURE__ */ P(at, {
227
- children: [
228
- a && O && /* @__PURE__ */ w(ct, {
229
- onPress: $
230
- }),
231
- /* @__PURE__ */ w(rt, {
232
- in: a,
233
- timeout: It,
234
- classNames: {
235
- enter: dt,
236
- enterActive: ft,
237
- enterDone: ht,
238
- exit: wt,
239
- exitActive: mt
240
- },
241
- unmountOnExit: !0,
242
- children: /* @__PURE__ */ P("div", _object_spread_props(_object_spread({
243
- ref: x
244
- }, Ot(j, "Tooltip")), {
248
+ /* @__PURE__ */ f(Tt, {
249
+ children: /* @__PURE__ */ f(vt, {
250
+ in: v,
251
+ nodeRef: z,
252
+ timeout: Ft() ? 0 : {
253
+ enter: Dt + H,
254
+ exit: Vt
255
+ },
256
+ mountOnEnter: !0,
257
+ unmountOnExit: !0,
258
+ children: (r)=>/* @__PURE__ */ f("div", _object_spread_props(_object_spread({
259
+ style: {
260
+ /**
261
+ * Hack to prevent text from wrapping automatically when touching the viewport's edges,
262
+ * even if the content's width didn't reach the max width.
263
+ * https://stackoverflow.com/questions/66106629/how-to-disable-text-wrapping-when-viewport-border-is-reached
264
+ */ width: `calc(100vw + ${lt}px)`,
265
+ top: 0,
266
+ left: 0,
267
+ position: "fixed",
268
+ visibility: d ? "visible" : "hidden"
269
+ }
270
+ }, Rt(W, "Tooltip")), {
245
271
  role: "tooltip",
246
- id: D,
247
- className: E(pt, gt, z ? xt : ""),
248
- style: _object_spread({
249
- width: b
250
- }, X, tt),
251
- onPointerOver: ()=>{
252
- c.current && (clearTimeout(c.current), c.current = null);
253
- },
254
- onPointerLeave: O ? M : ()=>{
255
- c.current = setTimeout(()=>{
256
- h.current && (c.current = null, h.current = !1, T());
257
- }, 100);
258
- },
259
- children: [
260
- /* @__PURE__ */ w("div", {
261
- style: Z(i),
262
- className: E(Tt, _[i]),
263
- children: /* @__PURE__ */ w("div", {
264
- className: vt
265
- })
272
+ "aria-label": n,
273
+ tabIndex: -1,
274
+ children: /* @__PURE__ */ f("div", {
275
+ className: q(xt),
276
+ style: _object_spread_props(_object_spread({
277
+ pointerEvents: r === "entered" ? "auto" : "none",
278
+ transform: Bt(ut)
279
+ }, d, bt[r]), {
280
+ transition: r === "entering" ? `opacity .1s linear ${H}ms,transform .3s cubic-bezier(0.215,0.61,0.335,1) ${H}ms` : "opacity .1s linear"
266
281
  }),
267
- (Y || S) && /* @__PURE__ */ P(ut, {
268
- space: 4,
282
+ ref: At(pt, z),
283
+ onMouseEnter: ()=>{
284
+ !p && r === "entered" && Y(!0);
285
+ },
286
+ onMouseLeave: ()=>{
287
+ p || Y(!1);
288
+ },
289
+ children: /* @__PURE__ */ F("div", {
290
+ className: Ot,
291
+ style: _object_spread({
292
+ width: D
293
+ }, at(U)),
269
294
  children: [
270
- Y && /* @__PURE__ */ w(I, {
271
- medium: !0,
272
- children: Y
295
+ /* @__PURE__ */ f("div", {
296
+ className: q(It, I || M ? Mt : void 0),
297
+ style: {
298
+ maxWidth: Math.min(lt, s.width)
299
+ },
300
+ children: /* @__PURE__ */ F(Lt, {
301
+ isInverse: !1,
302
+ children: [
303
+ (h || m) && /* @__PURE__ */ F(Et, {
304
+ space: 4,
305
+ children: [
306
+ h && /* @__PURE__ */ f(nt, {
307
+ medium: !0,
308
+ children: h
309
+ }),
310
+ m && /* @__PURE__ */ f(nt, {
311
+ regular: !0,
312
+ children: m
313
+ })
314
+ ]
315
+ }),
316
+ O || e
317
+ ]
318
+ })
273
319
  }),
274
- S && /* @__PURE__ */ w(I, {
275
- regular: !0,
276
- children: S
320
+ /* @__PURE__ */ f("div", {
321
+ className: St,
322
+ style: T,
323
+ children: /* @__PURE__ */ f("div", {
324
+ className: q(yt),
325
+ style: at(U)
326
+ })
277
327
  })
278
328
  ]
279
- }),
280
- N || r
281
- ]
329
+ })
330
+ })
282
331
  }))
283
- })
284
- ]
332
+ })
285
333
  })
286
334
  ]
287
335
  });
288
- }, ae = zt;
289
- export { ae as default };
336
+ }, se = Xt;
337
+ export { se as default };
@@ -1,4 +1,4 @@
1
1
  import "./sprinkles.css.ts.vanilla.css-mistica.js";
2
2
  import "./touchable.css.ts.vanilla.css-mistica.js";
3
- var f = "mhti6u1 _1y2v1nfe9", y = "mhti6u4", _ = "mhti6u1 _1y2v1nfe9 _1y2v1nf63 _1y2v1nf7c _1y2v1nf8l _1y2v1nf9u _1y2v1nfbc _1y2v1nfds _1y2v1nfbx _1y2v1nf30 _1y2v1nf62 _1y2v1nfeb";
3
+ var f = "mhti6u1 _1y2v1nfea", y = "mhti6u4", _ = "mhti6u1 _1y2v1nfea _1y2v1nf63 _1y2v1nf7c _1y2v1nf8l _1y2v1nf9u _1y2v1nfbc _1y2v1nfds _1y2v1nfbx _1y2v1nf30 _1y2v1nf62 _1y2v1nfec";
4
4
  export { f as base, y as notTouchable, _ as touchable };
@@ -58,13 +58,13 @@ import A from "./screen-reader-only.js";
58
58
  import { notTouchable as _, touchable as H, base as K } from "./touchable.css-mistica.js";
59
59
  import { useTheme as j } from "./hooks.js";
60
60
  import { isInsideNovumNativeApp as B } from "./utils/platform.js";
61
- import { ENTER as S, SPACE as V } from "./utils/key-codes.js";
61
+ import { ENTER as S, SPACE as V } from "./utils/keys.js";
62
62
  import { getPrefixedDataAttributes as W } from "./utils/dom.js";
63
63
  const L = function(e) {
64
64
  let t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : !1, d = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : !1;
65
65
  t ? window.open(e, "_blank") : d ? window.open(e, "_top") : document.location.href = e;
66
66
  }, T = /*#__PURE__*/ c.forwardRef((e, t)=>{
67
- const { texts: d, analytics: v, platformOverrides: N, Link: P, useHrefDecorator: E } = j(), C = E(), f = c.useRef(!1);
67
+ const { texts: d, analytics: v, platformOverrides: N, Link: P, useHrefDecorator: E } = j(), x = E(), f = c.useRef(!1);
68
68
  let l = [];
69
69
  e.trackingEvent && (Array.isArray(e.trackingEvent) ? l = e.trackingEvent : l = [
70
70
  e.trackingEvent
@@ -89,28 +89,28 @@ const L = function(e) {
89
89
  e.onPress && e.onPress(a);
90
90
  }, k = ()=>{
91
91
  var _e_to_pathname;
92
- return e.href ? C(e.href) : e.to && e.fullPageOnWebView ? typeof e.to == "string" ? e.to : (_e_to_pathname = e.to.pathname) !== null && _e_to_pathname !== void 0 ? _e_to_pathname : "" : "";
92
+ return e.href ? x(e.href) : e.to && e.fullPageOnWebView ? typeof e.to == "string" ? e.to : (_e_to_pathname = e.to.pathname) !== null && _e_to_pathname !== void 0 ? _e_to_pathname : "" : "";
93
93
  }, y = ()=>Promise.all(l.map((a)=>v.logEvent(a))), g = (a)=>{
94
94
  f.current || (f.current = !0, y().finally(()=>{
95
95
  f.current = !1, a();
96
96
  }));
97
- }, x = (a)=>{
97
+ }, R = (a)=>{
98
98
  if (s(a), !l.length) {
99
99
  h(a);
100
100
  return;
101
101
  }
102
102
  g(()=>h(a));
103
- }, R = (a)=>{
103
+ }, C = (a)=>{
104
104
  s(a), l.length && (a.preventDefault(), g(()=>L(k(), r, m)));
105
105
  }, D = (a)=>{
106
106
  s(a), y();
107
107
  }, w = (a)=>{
108
- (a.keyCode === S || a.keyCode === V) && (a.preventDefault(), a.currentTarget.click());
108
+ (a.key === S || a.key === V) && (a.preventDefault(), a.currentTarget.click());
109
109
  };
110
110
  if (e.href || e.to && e.fullPageOnWebView && B(N)) return /* @__PURE__ */ I("a", _object_spread_props(_object_spread({}, n), {
111
111
  "aria-label": e["aria-label"],
112
112
  "aria-labelledby": e["aria-labelledby"],
113
- onClick: R,
113
+ onClick: C,
114
114
  onKeyDown: w,
115
115
  href: e.disabled ? void 0 : k(),
116
116
  target: (()=>{
@@ -152,7 +152,7 @@ const L = function(e) {
152
152
  "aria-labelledby": e["aria-labelledby"],
153
153
  type: u,
154
154
  ref: t,
155
- onClick: x,
155
+ onClick: R,
156
156
  children: o
157
157
  }));
158
158
  }
@@ -1,6 +1,6 @@
1
1
  import "../sprinkles.css.ts.vanilla.css-mistica.js";
2
2
  import "./aspect-ratio-support.css.ts.vanilla.css-mistica.js";
3
- var a = "yqswj62", n = "_1y2v1nfbx _1y2v1nfce _1y2v1nfeg _1y2v1nfev", e = {
3
+ var a = "yqswj62", n = "_1y2v1nfbx _1y2v1nfce _1y2v1nfeh _1y2v1nfew", e = {
4
4
  aspectRatio: "var(--yqswj60)"
5
- }, y = "_1y2v1nfea _1y2v1nfdp _1y2v1nfdq _1y2v1nfb4";
5
+ }, y = "_1y2v1nfeb _1y2v1nfdp _1y2v1nfdq _1y2v1nfb4";
6
6
  export { a as container, n as containerWithWrapper, e as vars, y as wrapper };
@@ -1,2 +1,2 @@
1
- const e = ()=>typeof window > "u", i = ()=>!e();
2
- export { i as isClientSide, e as isServerSide };
1
+ const e = ()=>typeof window > "u", i = ()=>!e(), o = ()=>i() ? window.matchMedia("(pointer: coarse)").matches : !1;
2
+ export { i as isClientSide, e as isServerSide, o as isTouchableDevice };
@@ -0,0 +1,2 @@
1
+ const o = "ArrowLeft", t = "ArrowUp", n = "ArrowRight", r = "ArrowDown", c = "Enter", s = "Escape", E = " ", A = "Tab";
2
+ export { r as DOWN, c as ENTER, s as ESC, o as LEFT, n as RIGHT, E as SPACE, A as TAB, t as UP };
@@ -1,3 +1,3 @@
1
1
  import "./sprinkles.css.ts.vanilla.css-mistica.js";
2
- var f = "_1y2v1nfeg _1y2v1nfev _1y2v1nfbc _1y2v1nf62 _1y2v1nfdp _1y2v1nfdq _1y2v1nfg4";
2
+ var f = "_1y2v1nfeh _1y2v1nfew _1y2v1nfbc _1y2v1nf62 _1y2v1nfdp _1y2v1nfdq _1y2v1nfg5";
3
3
  export { f as video };