@telefonica/mistica 14.12.0 → 14.14.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/boxed.css-mistica.js +4 -4
- package/dist/boxed.css.d.ts +1 -1
- package/dist/boxed.js +12 -14
- package/dist/card.css-mistica.js +27 -12
- package/dist/card.css.d.ts +7 -0
- package/dist/card.d.ts +36 -34
- package/dist/card.js +611 -469
- package/dist/fixed-footer-layout.js +8 -7
- package/dist/generated/mistica-icons/icon-alert-filled.js +15 -5
- package/dist/generated/mistica-icons/icon-alert-light.js +24 -8
- package/dist/generated/mistica-icons/icon-alert-regular.js +30 -14
- package/dist/generated/mistica-icons/icon-bell-filled.js +19 -9
- package/dist/generated/mistica-icons/icon-bell-light.js +16 -6
- package/dist/generated/mistica-icons/icon-bell-regular.js +19 -9
- package/dist/generated/mistica-icons/icon-dollar-symbol-circle-light.js +28 -11
- package/dist/generated/mistica-icons/icon-dollar-symbol-circle-regular.js +20 -9
- package/dist/generated/mistica-icons/icon-edit-pencil-light.js +21 -10
- package/dist/generated/mistica-icons/icon-edit-pencil-regular.js +22 -12
- package/dist/generated/mistica-icons/icon-gift-filled.js +19 -9
- package/dist/generated/mistica-icons/icon-gift-light.js +20 -10
- package/dist/generated/mistica-icons/icon-gift-regular.js +19 -9
- package/dist/generated/mistica-icons/icon-heart-filled.js +16 -6
- package/dist/generated/mistica-icons/icon-heart-light.js +18 -8
- package/dist/generated/mistica-icons/icon-heart-regular.js +24 -14
- package/dist/generated/mistica-icons/icon-home-filled.js +23 -13
- package/dist/generated/mistica-icons/icon-home-light.js +24 -14
- package/dist/generated/mistica-icons/icon-home-regular.js +21 -11
- package/dist/generated/mistica-icons/icon-home-wifi-filled.js +24 -7
- package/dist/generated/mistica-icons/icon-home-wifi-light.js +25 -8
- package/dist/generated/mistica-icons/icon-home-wifi-regular.js +24 -7
- package/dist/generated/mistica-icons/icon-pause-regular.js +10 -12
- package/dist/generated/mistica-icons/icon-play-regular.js +14 -16
- package/dist/generated/mistica-icons/icon-reload-light.js +22 -12
- package/dist/generated/mistica-icons/icon-reload-regular.js +24 -14
- package/dist/generated/mistica-icons/icon-share-filled.js +20 -10
- package/dist/generated/mistica-icons/icon-share-light.js +21 -11
- package/dist/generated/mistica-icons/icon-share-regular.js +21 -11
- package/dist/generated/mistica-icons/icon-shopping-bag-filled.d.ts +4 -0
- package/dist/generated/mistica-icons/icon-shopping-bag-filled.js +110 -0
- package/dist/generated/mistica-icons/icon-shopping-bag-light.d.ts +4 -0
- package/dist/generated/mistica-icons/icon-shopping-bag-light.js +110 -0
- package/dist/generated/mistica-icons/icon-shopping-bag-regular.d.ts +4 -0
- package/dist/generated/mistica-icons/icon-shopping-bag-regular.js +110 -0
- package/dist/generated/mistica-icons/icon-tickets-filled.js +17 -7
- package/dist/generated/mistica-icons/icon-tickets-light.js +26 -10
- package/dist/generated/mistica-icons/icon-tickets-regular.js +35 -19
- package/dist/hooks.js +57 -56
- package/dist/index.d.ts +3 -0
- package/dist/index.js +14 -1
- package/dist/package-version.js +1 -1
- package/dist/skins/blau.js +14 -2
- package/dist/skins/defaults.js +12 -0
- package/dist/skins/movistar-legacy.js +15 -3
- package/dist/skins/movistar.js +12 -0
- package/dist/skins/o2.js +13 -1
- package/dist/skins/telefonica.js +12 -0
- package/dist/skins/types/index.d.ts +1 -1
- package/dist/skins/vivo-new.js +12 -0
- package/dist/skins/vivo.js +13 -1
- package/dist/theme-context-provider.js +34 -30
- package/dist/tooltip.js +35 -34
- package/dist/utils/dom.js +10 -10
- package/dist/utils/environment.d.ts +1 -0
- package/dist/utils/environment.js +12 -4
- package/dist-es/boxed.css-mistica.js +3 -3
- package/dist-es/boxed.js +16 -18
- package/dist-es/card.css-mistica.js +2 -2
- package/dist-es/card.js +652 -511
- package/dist-es/fixed-footer-layout.js +18 -17
- package/dist-es/generated/mistica-icons/icon-alert-filled.js +18 -8
- package/dist-es/generated/mistica-icons/icon-alert-light.js +30 -14
- package/dist-es/generated/mistica-icons/icon-alert-regular.js +36 -20
- package/dist-es/generated/mistica-icons/icon-bell-filled.js +26 -16
- package/dist-es/generated/mistica-icons/icon-bell-light.js +20 -10
- package/dist-es/generated/mistica-icons/icon-bell-regular.js +20 -10
- package/dist-es/generated/mistica-icons/icon-dollar-symbol-circle-light.js +33 -16
- package/dist-es/generated/mistica-icons/icon-dollar-symbol-circle-regular.js +25 -14
- package/dist-es/generated/mistica-icons/icon-edit-pencil-light.js +25 -14
- package/dist-es/generated/mistica-icons/icon-edit-pencil-regular.js +30 -20
- package/dist-es/generated/mistica-icons/icon-gift-filled.js +22 -12
- package/dist-es/generated/mistica-icons/icon-gift-light.js +23 -13
- package/dist-es/generated/mistica-icons/icon-gift-regular.js +22 -12
- package/dist-es/generated/mistica-icons/icon-heart-filled.js +18 -8
- package/dist-es/generated/mistica-icons/icon-heart-light.js +24 -14
- package/dist-es/generated/mistica-icons/icon-heart-regular.js +25 -15
- package/dist-es/generated/mistica-icons/icon-home-filled.js +30 -20
- package/dist-es/generated/mistica-icons/icon-home-light.js +27 -17
- package/dist-es/generated/mistica-icons/icon-home-regular.js +27 -17
- package/dist-es/generated/mistica-icons/icon-home-wifi-filled.js +28 -11
- package/dist-es/generated/mistica-icons/icon-home-wifi-light.js +29 -12
- package/dist-es/generated/mistica-icons/icon-home-wifi-regular.js +28 -11
- package/dist-es/generated/mistica-icons/icon-pause-regular.js +12 -14
- package/dist-es/generated/mistica-icons/icon-play-regular.js +19 -21
- package/dist-es/generated/mistica-icons/icon-reload-light.js +27 -17
- package/dist-es/generated/mistica-icons/icon-reload-regular.js +27 -17
- package/dist-es/generated/mistica-icons/icon-share-filled.js +25 -15
- package/dist-es/generated/mistica-icons/icon-share-light.js +28 -18
- package/dist-es/generated/mistica-icons/icon-share-regular.js +28 -18
- package/dist-es/generated/mistica-icons/icon-shopping-bag-filled.js +101 -0
- package/dist-es/generated/mistica-icons/icon-shopping-bag-light.js +101 -0
- package/dist-es/generated/mistica-icons/icon-shopping-bag-regular.js +101 -0
- package/dist-es/generated/mistica-icons/icon-tickets-filled.js +21 -11
- package/dist-es/generated/mistica-icons/icon-tickets-light.js +30 -14
- package/dist-es/generated/mistica-icons/icon-tickets-regular.js +43 -27
- package/dist-es/hooks.js +51 -50
- package/dist-es/index.js +1762 -1758
- package/dist-es/package-version.js +1 -1
- package/dist-es/skins/blau.js +14 -2
- package/dist-es/skins/defaults.js +12 -0
- package/dist-es/skins/movistar-legacy.js +15 -3
- package/dist-es/skins/movistar.js +12 -0
- package/dist-es/skins/o2.js +13 -1
- package/dist-es/skins/telefonica.js +12 -0
- package/dist-es/skins/vivo-new.js +12 -0
- package/dist-es/skins/vivo.js +13 -1
- package/dist-es/style.css +1 -1
- package/dist-es/theme-context-provider.js +72 -68
- package/dist-es/tooltip.js +37 -36
- package/dist-es/utils/dom.js +9 -9
- package/dist-es/utils/environment.js +2 -2
- package/package.json +1 -1
- package/dist/boxed.css.ts.vanilla.css-mistica.js +0 -11
- package/dist-es/boxed.css.ts.vanilla.css-mistica.js +0 -2
|
@@ -26,107 +26,111 @@ function _object_spread(target) {
|
|
|
26
26
|
}
|
|
27
27
|
return target;
|
|
28
28
|
}
|
|
29
|
-
import { jsx as
|
|
29
|
+
import { jsx as r, jsxs as S, Fragment as y } from "react/jsx-runtime";
|
|
30
30
|
import * as a from "react";
|
|
31
|
-
import { assignInlineVars as
|
|
32
|
-
import
|
|
33
|
-
import
|
|
34
|
-
import
|
|
35
|
-
import { getTexts as
|
|
36
|
-
import { getPlatform as
|
|
37
|
-
import
|
|
38
|
-
import { useIsomorphicLayoutEffect as
|
|
39
|
-
import
|
|
40
|
-
import
|
|
41
|
-
import { DocumentVisibilityProvider as
|
|
42
|
-
import { AspectRatioSupportProvider as
|
|
43
|
-
import { TrackingConfig as
|
|
44
|
-
import { vars as
|
|
45
|
-
import { fromHexToRgb as
|
|
46
|
-
import { defaultTextPresetsConfig as
|
|
47
|
-
const
|
|
31
|
+
import { assignInlineVars as N } from "@vanilla-extract/dynamic";
|
|
32
|
+
import O from "./dialog.js";
|
|
33
|
+
import L from "./screen-size-context-provider.js";
|
|
34
|
+
import w from "./aria-id-getter-context.js";
|
|
35
|
+
import { getTexts as F, dimensions as $, AnchorLink as h, NAVBAR_HEIGHT_MOBILE as V } from "./theme.js";
|
|
36
|
+
import { getPlatform as D, isInsideNovumNativeApp as j } from "./utils/platform.js";
|
|
37
|
+
import _ from "./theme-context.js";
|
|
38
|
+
import { useIsomorphicLayoutEffect as B } from "./hooks.js";
|
|
39
|
+
import z from "./tab-focus.js";
|
|
40
|
+
import G from "./modal-context-provider.js";
|
|
41
|
+
import { DocumentVisibilityProvider as q } from "./utils/document-visibility.js";
|
|
42
|
+
import { AspectRatioSupportProvider as W } from "./utils/aspect-ratio-support.js";
|
|
43
|
+
import { TrackingConfig as J } from "./utils/analytics.js";
|
|
44
|
+
import { vars as K } from "./skins/skin-contract.css-mistica.js";
|
|
45
|
+
import { fromHexToRgb as Q } from "./utils/color.js";
|
|
46
|
+
import { defaultTextPresetsConfig as e, defaultBorderRadiiConfig as U } from "./skins/defaults.js";
|
|
47
|
+
const X = "(prefers-color-scheme: dark)", Y = ()=>{
|
|
48
48
|
const [t, c] = a.useState(!1);
|
|
49
|
-
return
|
|
49
|
+
return B(()=>{
|
|
50
50
|
if (!window.matchMedia) return;
|
|
51
|
-
const o = window.matchMedia(
|
|
51
|
+
const o = window.matchMedia(X), s = ()=>{
|
|
52
52
|
c(o.matches);
|
|
53
53
|
};
|
|
54
54
|
return o.addListener(s), s(), ()=>o.removeListener(s);
|
|
55
55
|
}, []), t;
|
|
56
|
-
},
|
|
57
|
-
headerMobileHeight: (t == null ? void 0 : t.headerMobileHeight) === "mistica" ?
|
|
58
|
-
}),
|
|
56
|
+
}, Z = ()=>(t)=>t, tt = (t)=>({
|
|
57
|
+
headerMobileHeight: (t == null ? void 0 : t.headerMobileHeight) === "mistica" ? V : t == null ? void 0 : t.headerMobileHeight
|
|
58
|
+
}), et = (param)=>{
|
|
59
59
|
let { theme: t , children: c , as: o } = param;
|
|
60
60
|
var _t_colorScheme, _t_skin_borderRadii;
|
|
61
|
-
const s = a.useRef(1),
|
|
62
|
-
var i, n,
|
|
63
|
-
const
|
|
64
|
-
platform:
|
|
65
|
-
insideNovumNativeApp:
|
|
61
|
+
const s = a.useRef(1), I = a.useCallback(()=>`aria-id-hook-${s.current++}`, []), E = Y(), m = (_t_colorScheme = t.colorScheme) !== null && _t_colorScheme !== void 0 ? _t_colorScheme : "auto", R = t.skin.colors, A = _object_spread({}, t.skin.colors, t.skin.darkModeColors), u = m === "auto" && E || m === "dark", k = u ? A : R, p = a.useMemo(()=>{
|
|
62
|
+
var i, n, d, x, f, P, b, g, M, T, C;
|
|
63
|
+
const l = _object_spread({
|
|
64
|
+
platform: D(),
|
|
65
|
+
insideNovumNativeApp: j()
|
|
66
66
|
}, t.platformOverrides);
|
|
67
67
|
var _t_Link, _t_useHrefDecorator;
|
|
68
68
|
return {
|
|
69
69
|
skinName: t.skin.name,
|
|
70
70
|
i18n: t.i18n,
|
|
71
|
-
platformOverrides:
|
|
72
|
-
texts: _object_spread({},
|
|
71
|
+
platformOverrides: l,
|
|
72
|
+
texts: _object_spread({}, F(t.i18n.locale), t.texts),
|
|
73
73
|
analytics: _object_spread({
|
|
74
74
|
logEvent: ()=>Promise.resolve(),
|
|
75
75
|
eventFormat: "universal-analytics"
|
|
76
76
|
}, t.analytics),
|
|
77
|
-
dimensions: _object_spread({},
|
|
77
|
+
dimensions: _object_spread({}, $, tt(t.dimensions)),
|
|
78
78
|
textPresets: {
|
|
79
|
-
text5: _object_spread({},
|
|
80
|
-
text6: _object_spread({},
|
|
81
|
-
text7: _object_spread({},
|
|
82
|
-
text8: _object_spread({},
|
|
83
|
-
text9: _object_spread({},
|
|
84
|
-
text10: _object_spread({},
|
|
85
|
-
cardTitle: _object_spread({},
|
|
79
|
+
text5: _object_spread({}, e.text5, (i = t.skin.textPresets) == null ? void 0 : i.text5),
|
|
80
|
+
text6: _object_spread({}, e.text6, (n = t.skin.textPresets) == null ? void 0 : n.text6),
|
|
81
|
+
text7: _object_spread({}, e.text7, (d = t.skin.textPresets) == null ? void 0 : d.text7),
|
|
82
|
+
text8: _object_spread({}, e.text8, (x = t.skin.textPresets) == null ? void 0 : x.text8),
|
|
83
|
+
text9: _object_spread({}, e.text9, (f = t.skin.textPresets) == null ? void 0 : f.text9),
|
|
84
|
+
text10: _object_spread({}, e.text10, (P = t.skin.textPresets) == null ? void 0 : P.text10),
|
|
85
|
+
cardTitle: _object_spread({}, e.cardTitle, (b = t.skin.textPresets) == null ? void 0 : b.cardTitle),
|
|
86
|
+
button: _object_spread({}, e.button, (g = t.skin.textPresets) == null ? void 0 : g.button),
|
|
87
|
+
link: _object_spread({}, e.link, (M = t.skin.textPresets) == null ? void 0 : M.link),
|
|
88
|
+
title1: _object_spread({}, e.title1, (T = t.skin.textPresets) == null ? void 0 : T.title1),
|
|
89
|
+
indicator: _object_spread({}, e.indicator, (C = t.skin.textPresets) == null ? void 0 : C.indicator)
|
|
86
90
|
},
|
|
87
|
-
Link: (_t_Link = t.Link) !== null && _t_Link !== void 0 ? _t_Link :
|
|
88
|
-
isDarkMode:
|
|
89
|
-
isIos:
|
|
90
|
-
useHrefDecorator: (_t_useHrefDecorator = t.useHrefDecorator) !== null && _t_useHrefDecorator !== void 0 ? _t_useHrefDecorator :
|
|
91
|
+
Link: (_t_Link = t.Link) !== null && _t_Link !== void 0 ? _t_Link : h,
|
|
92
|
+
isDarkMode: u,
|
|
93
|
+
isIos: D(l) === "ios",
|
|
94
|
+
useHrefDecorator: (_t_useHrefDecorator = t.useHrefDecorator) !== null && _t_useHrefDecorator !== void 0 ? _t_useHrefDecorator : Z,
|
|
91
95
|
useId: t.useId
|
|
92
96
|
};
|
|
93
97
|
}, [
|
|
94
98
|
t,
|
|
95
|
-
|
|
96
|
-
]),
|
|
97
|
-
let [
|
|
99
|
+
u
|
|
100
|
+
]), H = Object.fromEntries(Object.entries(k).map((param)=>{
|
|
101
|
+
let [l, i] = param;
|
|
98
102
|
let n = "";
|
|
99
103
|
if (i.startsWith("#")) {
|
|
100
|
-
const [
|
|
101
|
-
n = `${
|
|
104
|
+
const [d, x, f] = Q(i);
|
|
105
|
+
n = `${d}, ${x}, ${f}`;
|
|
102
106
|
}
|
|
103
107
|
return [
|
|
104
|
-
|
|
108
|
+
l,
|
|
105
109
|
n
|
|
106
110
|
];
|
|
107
|
-
})), v =
|
|
108
|
-
colors:
|
|
109
|
-
rawColors:
|
|
110
|
-
borderRadii: (_t_skin_borderRadii = t.skin.borderRadii) !== null && _t_skin_borderRadii !== void 0 ? _t_skin_borderRadii :
|
|
111
|
+
})), v = N(K, {
|
|
112
|
+
colors: k,
|
|
113
|
+
rawColors: H,
|
|
114
|
+
borderRadii: (_t_skin_borderRadii = t.skin.borderRadii) !== null && _t_skin_borderRadii !== void 0 ? _t_skin_borderRadii : U
|
|
111
115
|
});
|
|
112
|
-
return /* @__PURE__ */
|
|
116
|
+
return /* @__PURE__ */ r(z, {
|
|
113
117
|
disabled: !t.enableTabFocus,
|
|
114
|
-
children: /* @__PURE__ */
|
|
115
|
-
children: /* @__PURE__ */
|
|
116
|
-
value:
|
|
117
|
-
children: /* @__PURE__ */
|
|
118
|
-
eventFormat:
|
|
119
|
-
children: /* @__PURE__ */
|
|
120
|
-
children: /* @__PURE__ */
|
|
121
|
-
children: /* @__PURE__ */
|
|
122
|
-
value:
|
|
123
|
-
children: /* @__PURE__ */
|
|
124
|
-
children: /* @__PURE__ */
|
|
118
|
+
children: /* @__PURE__ */ r(G, {
|
|
119
|
+
children: /* @__PURE__ */ r(_.Provider, {
|
|
120
|
+
value: p,
|
|
121
|
+
children: /* @__PURE__ */ r(J, {
|
|
122
|
+
eventFormat: p.analytics.eventFormat,
|
|
123
|
+
children: /* @__PURE__ */ r(W, {
|
|
124
|
+
children: /* @__PURE__ */ r(q, {
|
|
125
|
+
children: /* @__PURE__ */ r(w.Provider, {
|
|
126
|
+
value: I,
|
|
127
|
+
children: /* @__PURE__ */ r(L, {
|
|
128
|
+
children: /* @__PURE__ */ r(O, {
|
|
125
129
|
children: o ? /*#__PURE__*/ a.createElement(o, {
|
|
126
130
|
style: v
|
|
127
|
-
}, c) : /* @__PURE__ */
|
|
131
|
+
}, c) : /* @__PURE__ */ S(y, {
|
|
128
132
|
children: [
|
|
129
|
-
(process.env.NODE_ENV !== "test" || process.env.SSR_TEST) && /* @__PURE__ */
|
|
133
|
+
(process.env.NODE_ENV !== "test" || process.env.SSR_TEST) && /* @__PURE__ */ r("style", {
|
|
130
134
|
children: `:root {${v}}`
|
|
131
135
|
}),
|
|
132
136
|
c
|
|
@@ -141,5 +145,5 @@ const J = "(prefers-color-scheme: dark)", K = ()=>{
|
|
|
141
145
|
})
|
|
142
146
|
})
|
|
143
147
|
});
|
|
144
|
-
},
|
|
145
|
-
export {
|
|
148
|
+
}, bt = et;
|
|
149
|
+
export { bt as default, Y as useIsOsDarkModeEnabled };
|
package/dist-es/tooltip.js
CHANGED
|
@@ -84,14 +84,15 @@ import { CSSTransition as V } from "react-transition-group";
|
|
|
84
84
|
import { useTheme as j, useScreenSize as q, useAriaId as G } from "./hooks.js";
|
|
85
85
|
import { Portal as H } from "./portal.js";
|
|
86
86
|
import J from "./overlay.js";
|
|
87
|
-
import { Text2 as
|
|
87
|
+
import { Text2 as O } from "./text.js";
|
|
88
88
|
import { TAB as Q } from "./utils/key-codes.js";
|
|
89
89
|
import U from "./stack.js";
|
|
90
90
|
import { vars as n, wrapper as Z, enter as _, enterActive as tt, enterDone as et, exit as rt, exitActive as nt, container as ot, arrowWrapper as at, arrow as it, fadeInTopKeyframes as st, fadeInBottomKeyframes as ct, fadeInXKeyframes as lt, arrowTop as ut, arrowBottom as ft, arrowLeft as mt, arrowRight as dt } from "./tooltip.css-mistica.js";
|
|
91
91
|
import { assignInlineVars as pt } from "@vanilla-extract/dynamic";
|
|
92
92
|
import { getPrefixedDataAttributes as ht } from "./utils/dom.js";
|
|
93
|
-
|
|
94
|
-
|
|
93
|
+
import { isClientSide as gt, isServerSide as wt } from "./utils/environment.js";
|
|
94
|
+
const xt = "bottom", Tt = "top", bt = 12, h = 4 + bt, g = 16, vt = 340, At = 500, d = 12, Yt = 500, R = ()=>{}, Pt = (t)=>t || vt, St = (t)=>t === "bottom" ? `translateY(${d}px)` : t === "top" ? `translateY(calc(-100% - ${d}px))` : t === "right" ? `translateX(${d}px) translateY(-50%)` : t === "left" ? `translateX(-${d}px) translateY(-50%)` : `translateY(-${d}px)`, yt = (t)=>t === "top" ? "translateY(-100%)" : t === "bottom" ? "translateY(0)" : "translateY(-50%)", Dt = (t)=>t === "bottom" ? "translateY(0)" : t === "top" ? "translateY(-100%)" : t === "right" || t === "left" ? "translateX(0px) translateY(-50%)" : "translateY(0px)", Ot = (t)=>t === "top" ? st : t === "bottom" ? ct : lt, Rt = (t)=>t ? "1" : "0.2", $t = (t)=>t === "top" ? `2px 2px 4px 0 rgba(0, 0, 0, ${n.shadowAlpha})` : t === "right" ? `0 0 4px 0 rgba(0, 0, 0, ${n.shadowAlpha})` : t === "left" ? `0 0 4px 0 rgba(0, 0, 0, ${n.shadowAlpha})` : t === "bottom" ? `-1px -1px 4px 0 rgba(0, 0, 0, ${n.shadowAlpha})` : "", It = (_param)=>{
|
|
95
|
+
var { children: t , extra: $ , description: w , target: I , title: x , targetLabel: C , delay: B = !0 , dataAttributes: E } = _param, Y = _object_without_properties(_param, [
|
|
95
96
|
"children",
|
|
96
97
|
"extra",
|
|
97
98
|
"description",
|
|
@@ -101,7 +102,7 @@ const wt = "bottom", gt = "top", xt = 12, h = 4 + xt, w = 16, Tt = 340, bt = 500
|
|
|
101
102
|
"delay",
|
|
102
103
|
"dataAttributes"
|
|
103
104
|
]);
|
|
104
|
-
const { isDarkMode: M } = j(), [l, T] = c.useState(!1), { isTabletOrSmaller: u } = q(),
|
|
105
|
+
const { isDarkMode: M } = j(), [l, T] = c.useState(!1), { isTabletOrSmaller: u } = q(), P = G(), o = c.useRef(!1), r = c.useRef(null), f = c.useRef(null), b = c.useRef(null), e = c.useRef({
|
|
105
106
|
top: 0,
|
|
106
107
|
right: 0,
|
|
107
108
|
left: 0,
|
|
@@ -109,23 +110,23 @@ const wt = "bottom", gt = "top", xt = 12, h = 4 + xt, w = 16, Tt = 340, bt = 500
|
|
|
109
110
|
width: 0,
|
|
110
111
|
height: 0
|
|
111
112
|
}), a = function() {
|
|
112
|
-
let i = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] :
|
|
113
|
-
return u && (i === "left" || i === "right") ?
|
|
114
|
-
}(Y.position), v =
|
|
113
|
+
let i = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : xt;
|
|
114
|
+
return u && (i === "left" || i === "right") ? Tt : i;
|
|
115
|
+
}(Y.position), v = gt() ? window.matchMedia("(pointer: coarse)").matches : !1, S = ()=>{
|
|
115
116
|
l && T(!1);
|
|
116
117
|
};
|
|
117
|
-
c.useEffect(()=>(window.addEventListener("resize",
|
|
118
|
-
window.removeEventListener("resize",
|
|
118
|
+
c.useEffect(()=>(window.addEventListener("resize", S), ()=>{
|
|
119
|
+
window.removeEventListener("resize", S);
|
|
119
120
|
}));
|
|
120
|
-
const
|
|
121
|
+
const y = ()=>{
|
|
121
122
|
T(!1);
|
|
122
123
|
}, m = ()=>{
|
|
123
124
|
b.current && (e.current = b.current.getBoundingClientRect(), T(!l));
|
|
124
125
|
}, N = ()=>{
|
|
125
126
|
l || m();
|
|
126
127
|
}, k = (i)=>{
|
|
127
|
-
i.keyCode === Q &&
|
|
128
|
-
}, X = (i, A)=>
|
|
128
|
+
i.keyCode === Q && y();
|
|
129
|
+
}, X = (i, A)=>wt() ? {} : ({
|
|
129
130
|
right: {
|
|
130
131
|
left: e.current.right + h,
|
|
131
132
|
top: window.pageYOffset + e.current.top + e.current.height / 2
|
|
@@ -136,26 +137,26 @@ const wt = "bottom", gt = "top", xt = 12, h = 4 + xt, w = 16, Tt = 340, bt = 500
|
|
|
136
137
|
},
|
|
137
138
|
top: {
|
|
138
139
|
top: window.pageYOffset + e.current.top - h,
|
|
139
|
-
left: u ?
|
|
140
|
+
left: u ? g : window.pageXOffset + e.current.left + e.current.width / 2 - A / 2
|
|
140
141
|
},
|
|
141
142
|
bottom: {
|
|
142
143
|
top: window.pageYOffset + e.current.bottom + h,
|
|
143
|
-
left: u ?
|
|
144
|
+
left: u ? g : window.pageXOffset + e.current.left + e.current.width / 2 - A / 2
|
|
144
145
|
}
|
|
145
146
|
})[i], L = ()=>u ? {
|
|
146
|
-
left: e.current.left + e.current.width / 2 -
|
|
147
|
-
} : {},
|
|
147
|
+
left: e.current.left + e.current.width / 2 - g
|
|
148
|
+
} : {}, D = (()=>u ? window.innerWidth - g * 2 : Pt(Y.width))(), K = {
|
|
148
149
|
top: ut,
|
|
149
150
|
bottom: ft,
|
|
150
151
|
left: mt,
|
|
151
152
|
right: dt
|
|
152
153
|
}, W = pt({
|
|
153
|
-
[n.enterTransform]:
|
|
154
|
-
[n.exitTransform]:
|
|
155
|
-
[n.enterActiveAnimationName]:
|
|
154
|
+
[n.enterTransform]: St(a),
|
|
155
|
+
[n.exitTransform]: Dt(a),
|
|
156
|
+
[n.enterActiveAnimationName]: Ot(a),
|
|
156
157
|
[n.enterDoneTransform]: yt(a),
|
|
157
|
-
[n.shadowAlpha]:
|
|
158
|
-
[n.arrowBoxShadow]:
|
|
158
|
+
[n.shadowAlpha]: Rt(M),
|
|
159
|
+
[n.arrowBoxShadow]: $t(a)
|
|
159
160
|
});
|
|
160
161
|
return /* @__PURE__ */ p(z, {
|
|
161
162
|
children: [
|
|
@@ -163,9 +164,9 @@ const wt = "bottom", gt = "top", xt = 12, h = 4 + xt, w = 16, Tt = 340, bt = 500
|
|
|
163
164
|
ref: b,
|
|
164
165
|
className: Z,
|
|
165
166
|
onPointerOver: ()=>{
|
|
166
|
-
r.current && (clearTimeout(r.current), r.current = null), !o.current && (o.current = !0,
|
|
167
|
+
r.current && (clearTimeout(r.current), r.current = null), !o.current && (o.current = !0, B ? f.current = setTimeout(()=>{
|
|
167
168
|
f.current = null, m();
|
|
168
|
-
},
|
|
169
|
+
}, Yt) : m());
|
|
169
170
|
},
|
|
170
171
|
onPointerLeave: v ? R : ()=>{
|
|
171
172
|
if (f.current) {
|
|
@@ -181,19 +182,19 @@ const wt = "bottom", gt = "top", xt = 12, h = 4 + xt, w = 16, Tt = 340, bt = 500
|
|
|
181
182
|
"touch-action": "auto",
|
|
182
183
|
role: "button",
|
|
183
184
|
tabIndex: 0,
|
|
184
|
-
"aria-describedby":
|
|
185
|
+
"aria-describedby": P,
|
|
185
186
|
"aria-expanded": l,
|
|
186
|
-
"aria-label":
|
|
187
|
+
"aria-label": C,
|
|
187
188
|
children: I
|
|
188
189
|
}),
|
|
189
190
|
/* @__PURE__ */ p(H, {
|
|
190
191
|
children: [
|
|
191
192
|
l && v && /* @__PURE__ */ s(J, {
|
|
192
|
-
onPress:
|
|
193
|
+
onPress: y
|
|
193
194
|
}),
|
|
194
195
|
/* @__PURE__ */ s(V, {
|
|
195
196
|
in: l,
|
|
196
|
-
timeout:
|
|
197
|
+
timeout: At,
|
|
197
198
|
classNames: {
|
|
198
199
|
enter: _,
|
|
199
200
|
enterActive: tt,
|
|
@@ -204,11 +205,11 @@ const wt = "bottom", gt = "top", xt = 12, h = 4 + xt, w = 16, Tt = 340, bt = 500
|
|
|
204
205
|
unmountOnExit: !0,
|
|
205
206
|
children: /* @__PURE__ */ p("div", _object_spread_props(_object_spread({}, ht(E, "Tooltip")), {
|
|
206
207
|
role: "tooltip",
|
|
207
|
-
id:
|
|
208
|
+
id: P,
|
|
208
209
|
className: ot,
|
|
209
210
|
style: _object_spread({
|
|
210
|
-
width:
|
|
211
|
-
}, X(a,
|
|
211
|
+
width: D
|
|
212
|
+
}, X(a, D), W),
|
|
212
213
|
onPointerOver: ()=>{
|
|
213
214
|
r.current && (clearTimeout(r.current), r.current = null);
|
|
214
215
|
},
|
|
@@ -225,16 +226,16 @@ const wt = "bottom", gt = "top", xt = 12, h = 4 + xt, w = 16, Tt = 340, bt = 500
|
|
|
225
226
|
className: it
|
|
226
227
|
})
|
|
227
228
|
}),
|
|
228
|
-
(x ||
|
|
229
|
+
(x || w) && /* @__PURE__ */ p(U, {
|
|
229
230
|
space: 4,
|
|
230
231
|
children: [
|
|
231
|
-
x && /* @__PURE__ */ s(
|
|
232
|
+
x && /* @__PURE__ */ s(O, {
|
|
232
233
|
medium: !0,
|
|
233
234
|
children: x
|
|
234
235
|
}),
|
|
235
|
-
|
|
236
|
+
w && /* @__PURE__ */ s(O, {
|
|
236
237
|
regular: !0,
|
|
237
|
-
children:
|
|
238
|
+
children: w
|
|
238
239
|
})
|
|
239
240
|
]
|
|
240
241
|
}),
|
|
@@ -246,5 +247,5 @@ const wt = "bottom", gt = "top", xt = 12, h = 4 + xt, w = 16, Tt = 340, bt = 500
|
|
|
246
247
|
})
|
|
247
248
|
]
|
|
248
249
|
});
|
|
249
|
-
},
|
|
250
|
-
export {
|
|
250
|
+
}, Ht = It;
|
|
251
|
+
export { Ht as default };
|
package/dist-es/utils/dom.js
CHANGED
|
@@ -50,9 +50,9 @@ function _object_spread_props(target, source) {
|
|
|
50
50
|
}
|
|
51
51
|
return target;
|
|
52
52
|
}
|
|
53
|
-
import { isServerSide as
|
|
53
|
+
import { isServerSide as i } from "./environment.js";
|
|
54
54
|
const u = (e)=>{
|
|
55
|
-
if (
|
|
55
|
+
if (i()) return !1;
|
|
56
56
|
const n = document.createElement("input");
|
|
57
57
|
return n.setAttribute("type", e), n.type === e;
|
|
58
58
|
}, v = (e)=>{
|
|
@@ -64,16 +64,16 @@ const u = (e)=>{
|
|
|
64
64
|
currentTarget: e
|
|
65
65
|
});
|
|
66
66
|
};
|
|
67
|
-
let
|
|
67
|
+
let l = !1;
|
|
68
68
|
try {
|
|
69
69
|
const e = Object.defineProperty({}, "passive", {
|
|
70
70
|
get () {
|
|
71
|
-
|
|
71
|
+
l = !0;
|
|
72
72
|
}
|
|
73
73
|
});
|
|
74
74
|
window.addEventListener("test", ()=>{}, e);
|
|
75
75
|
} catch (e) {}
|
|
76
|
-
const p = (e, n, t)=>e.addEventListener(n, t,
|
|
76
|
+
const p = (e, n, t)=>e.addEventListener(n, t, l ? {
|
|
77
77
|
passive: !0
|
|
78
78
|
} : !1), f = (e, n, t)=>e.removeEventListener(n, t, !1), m = (e, n)=>{
|
|
79
79
|
const t = n ? {
|
|
@@ -89,13 +89,13 @@ const p = (e, n, t)=>e.addEventListener(n, t, i ? {
|
|
|
89
89
|
"scroll",
|
|
90
90
|
"overlay"
|
|
91
91
|
].includes(r);
|
|
92
|
-
},
|
|
92
|
+
}, E = function(e) {
|
|
93
93
|
let n = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : "Y";
|
|
94
94
|
let t = e == null ? void 0 : e.parentElement;
|
|
95
95
|
for(; t && !c(t, n);)t = t.parentElement;
|
|
96
96
|
return t || document.documentElement;
|
|
97
|
-
},
|
|
98
|
-
const t = ()=>
|
|
97
|
+
}, g = (e)=>e.scrollHeight - e.scrollTop - e.clientHeight, h = (e)=>e.scrollHeight > e.clientHeight, w = (e, n)=>{
|
|
98
|
+
const t = ()=>i() ? Promise.resolve(null) : window.ResizeObserver ? Promise.resolve(ResizeObserver) : import(/* webpackChunkName: "@juggle/resize-observer" */ "@juggle/resize-observer").then((o)=>o.ResizeObserver);
|
|
99
99
|
let r = !1, s = null;
|
|
100
100
|
return t().then((o)=>{
|
|
101
101
|
!r && o && (s = new o(n), s.observe(e));
|
|
@@ -103,4 +103,4 @@ const p = (e, n, t)=>e.addEventListener(n, t, i ? {
|
|
|
103
103
|
r = !0, s && s.disconnect();
|
|
104
104
|
};
|
|
105
105
|
};
|
|
106
|
-
export { p as addPassiveEventListener, v as cancelEvent, d as createChangeEvent, m as getPrefixedDataAttributes,
|
|
106
|
+
export { p as addPassiveEventListener, v as cancelEvent, d as createChangeEvent, m as getPrefixedDataAttributes, g as getScrollDistanceToBottom, E as getScrollableParentElement, h as hasScroll, u as isInputTypeSupported, w as listenResize, f as removePassiveEventListener };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const e = ()=>typeof window > "u";
|
|
2
|
-
export { e as isServerSide };
|
|
1
|
+
const e = ()=>typeof window > "u", i = ()=>!e();
|
|
2
|
+
export { i as isClientSide, e as isServerSide };
|
package/package.json
CHANGED