@telefonica/mistica 15.16.4 → 15.17.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/css/roboto.css +102 -34
- package/dist/box.d.ts +1 -0
- package/dist/box.js +11 -10
- package/dist/chip.js +21 -22
- package/dist/dialog.js +53 -51
- package/dist/generated/mistica-icons/icon-box-star-filled.d.ts +4 -0
- package/dist/generated/mistica-icons/icon-box-star-filled.js +121 -0
- package/dist/generated/mistica-icons/icon-box-star-light.d.ts +4 -0
- package/dist/generated/mistica-icons/icon-box-star-light.js +117 -0
- package/dist/generated/mistica-icons/icon-box-star-regular.d.ts +4 -0
- package/dist/generated/mistica-icons/icon-box-star-regular.js +117 -0
- package/dist/generated/mistica-icons/icon-high-priority-filled.d.ts +4 -0
- package/dist/generated/mistica-icons/icon-high-priority-filled.js +111 -0
- package/dist/generated/mistica-icons/icon-high-priority-light.d.ts +4 -0
- package/dist/generated/mistica-icons/icon-high-priority-light.js +111 -0
- package/dist/generated/mistica-icons/icon-high-priority-regular.d.ts +4 -0
- package/dist/generated/mistica-icons/icon-high-priority-regular.js +111 -0
- package/dist/generated/mistica-icons/icon-mms-filled.d.ts +4 -0
- package/dist/generated/mistica-icons/icon-mms-filled.js +122 -0
- package/dist/generated/mistica-icons/icon-mms-light.d.ts +4 -0
- package/dist/generated/mistica-icons/icon-mms-light.js +134 -0
- package/dist/generated/mistica-icons/icon-mms-regular.d.ts +4 -0
- package/dist/generated/mistica-icons/icon-mms-regular.js +134 -0
- package/dist/generated/mistica-icons/icon-vivo-valoriza-filled.d.ts +4 -0
- package/dist/generated/mistica-icons/icon-vivo-valoriza-filled.js +111 -0
- package/dist/generated/mistica-icons/icon-vivo-valoriza-light.d.ts +4 -0
- package/dist/generated/mistica-icons/icon-vivo-valoriza-light.js +117 -0
- package/dist/generated/mistica-icons/icon-vivo-valoriza-regular.d.ts +4 -0
- package/dist/generated/mistica-icons/icon-vivo-valoriza-regular.js +117 -0
- package/dist/generated/mistica-icons/icons-keywords.js +31 -0
- package/dist/index.d.ts +12 -0
- package/dist/index.js +48 -0
- package/dist/list.d.ts +1 -0
- package/dist/list.js +163 -157
- package/dist/package-version.js +1 -1
- package/dist/select.js +103 -95
- package/dist/skins/blau.js +96 -8
- package/dist/skins/defaults.js +98 -10
- package/dist/skins/movistar.js +94 -6
- package/dist/skins/o2-new.js +95 -7
- package/dist/skins/o2.js +94 -6
- package/dist/skins/skin-contract.css-mistica.js +42 -10
- package/dist/skins/skin-contract.css.d.ts +32 -0
- package/dist/skins/telefonica.js +96 -8
- package/dist/skins/tu.js +94 -6
- package/dist/skins/types/index.d.ts +36 -28
- package/dist/skins/vivo-new.js +95 -7
- package/dist/skins/vivo.js +94 -6
- package/dist/snackbar.js +53 -51
- package/dist/theme-context-provider.js +91 -63
- package/dist/theme-context.css-mistica.js +452 -0
- package/dist/theme-context.css.d.ts +432 -0
- package/dist/theme-context.css.ts.vanilla.css-mistica.js +11 -0
- package/dist-es/box.js +17 -16
- package/dist-es/chip.js +47 -48
- package/dist-es/dialog.js +70 -68
- package/dist-es/generated/mistica-icons/icon-box-star-filled.js +112 -0
- package/dist-es/generated/mistica-icons/icon-box-star-light.js +108 -0
- package/dist-es/generated/mistica-icons/icon-box-star-regular.js +108 -0
- package/dist-es/generated/mistica-icons/icon-high-priority-filled.js +102 -0
- package/dist-es/generated/mistica-icons/icon-high-priority-light.js +102 -0
- package/dist-es/generated/mistica-icons/icon-high-priority-regular.js +102 -0
- package/dist-es/generated/mistica-icons/icon-mms-filled.js +113 -0
- package/dist-es/generated/mistica-icons/icon-mms-light.js +125 -0
- package/dist-es/generated/mistica-icons/icon-mms-regular.js +125 -0
- package/dist-es/generated/mistica-icons/icon-vivo-valoriza-filled.js +102 -0
- package/dist-es/generated/mistica-icons/icon-vivo-valoriza-light.js +108 -0
- package/dist-es/generated/mistica-icons/icon-vivo-valoriza-regular.js +108 -0
- package/dist-es/generated/mistica-icons/icons-keywords.js +31 -0
- package/dist-es/index.js +1563 -1551
- package/dist-es/list.js +225 -219
- package/dist-es/package-version.js +1 -1
- package/dist-es/select.js +146 -138
- package/dist-es/skins/blau.js +96 -8
- package/dist-es/skins/defaults.js +97 -9
- package/dist-es/skins/movistar.js +94 -6
- package/dist-es/skins/o2-new.js +95 -7
- package/dist-es/skins/o2.js +94 -6
- package/dist-es/skins/skin-contract.css-mistica.js +42 -10
- package/dist-es/skins/telefonica.js +98 -10
- package/dist-es/skins/tu.js +94 -6
- package/dist-es/skins/vivo-new.js +95 -7
- package/dist-es/skins/vivo.js +94 -6
- package/dist-es/snackbar.js +62 -60
- package/dist-es/style.css +1 -1
- package/dist-es/theme-context-provider.js +133 -105
- package/dist-es/theme-context.css-mistica.js +432 -0
- package/dist-es/theme-context.css.ts.vanilla.css-mistica.js +2 -0
- package/package.json +2 -3
|
@@ -27,158 +27,186 @@ function _object_spread(target) {
|
|
|
27
27
|
}
|
|
28
28
|
return target;
|
|
29
29
|
}
|
|
30
|
-
import { jsxs as
|
|
30
|
+
import { jsxs as P, Fragment as M, jsx as r } from "react/jsx-runtime";
|
|
31
31
|
import * as o from "react";
|
|
32
|
-
import { assignInlineVars as
|
|
33
|
-
import { DialogRoot as
|
|
34
|
-
import
|
|
35
|
-
import
|
|
36
|
-
import { getTexts as
|
|
37
|
-
import { getPlatform as _, isInsideNovumNativeApp as
|
|
38
|
-
import
|
|
39
|
-
import { useIsomorphicLayoutEffect as
|
|
40
|
-
import
|
|
41
|
-
import
|
|
42
|
-
import
|
|
43
|
-
import { DocumentVisibilityProvider as
|
|
44
|
-
import { AspectRatioSupportProvider as
|
|
45
|
-
import { TrackingConfig as
|
|
46
|
-
import { vars as
|
|
47
|
-
import { fromHexToRgb as
|
|
48
|
-
import { defaultTextPresetsConfig as
|
|
49
|
-
import { isClientSide as
|
|
50
|
-
import { PACKAGE_VERSION as
|
|
51
|
-
import { SnackbarRoot as
|
|
52
|
-
import { mapToWeight as
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
32
|
+
import { assignInlineVars as h } from "@vanilla-extract/dynamic";
|
|
33
|
+
import { DialogRoot as D } from "./dialog-context.js";
|
|
34
|
+
import $ from "./screen-size-context-provider.js";
|
|
35
|
+
import N from "./aria-id-getter-context.js";
|
|
36
|
+
import { getTexts as j, dimensions as y, getMisticaLinkComponent as A, NAVBAR_HEIGHT_MOBILE as z } from "./theme.js";
|
|
37
|
+
import { getPlatform as _, isInsideNovumNativeApp as F } from "./utils/platform.js";
|
|
38
|
+
import L from "./theme-context.js";
|
|
39
|
+
import { useIsomorphicLayoutEffect as I } from "./hooks.js";
|
|
40
|
+
import B from "./tab-focus.js";
|
|
41
|
+
import G from "./modal-context-provider.js";
|
|
42
|
+
import W from "./tooltip-context-provider.js";
|
|
43
|
+
import { DocumentVisibilityProvider as q } from "./utils/document-visibility.js";
|
|
44
|
+
import { AspectRatioSupportProvider as K } from "./utils/aspect-ratio-support.js";
|
|
45
|
+
import { TrackingConfig as J } from "./utils/analytics.js";
|
|
46
|
+
import { vars as E } from "./skins/skin-contract.css-mistica.js";
|
|
47
|
+
import { fromHexToRgb as Q } from "./utils/color.js";
|
|
48
|
+
import { defaultTextPresetsConfig as U, defaultBorderRadiiConfig as X } from "./skins/defaults.js";
|
|
49
|
+
import { isClientSide as O } from "./utils/environment.js";
|
|
50
|
+
import { PACKAGE_VERSION as w } from "./package-version.js";
|
|
51
|
+
import { SnackbarRoot as Y } from "./snackbar-context.js";
|
|
52
|
+
import { mapToWeight as S } from "./text.js";
|
|
53
|
+
import { tabletOrSmaller as Z } from "./media-queries.css-mistica.js";
|
|
54
|
+
import { themeVarsContract as ee, textPresetResponsiveVarsContract as te, themeVars as re } from "./theme-context.css-mistica.js";
|
|
55
|
+
if (process.env.NODE_ENV !== "production" && O()) {
|
|
56
|
+
if (window.__mistica_version__ && window.__mistica_version__ !== w) throw new Error("There is more than one version of @telefonica/mistica running on the same page");
|
|
57
|
+
window.__mistica_version__ = w;
|
|
56
58
|
}
|
|
57
|
-
const
|
|
58
|
-
const [e,
|
|
59
|
-
return
|
|
59
|
+
const oe = "(prefers-color-scheme: dark)", se = ()=>{
|
|
60
|
+
const [e, l] = o.useState(!1);
|
|
61
|
+
return I(()=>{
|
|
60
62
|
if (!window.matchMedia) return;
|
|
61
|
-
const
|
|
62
|
-
i
|
|
63
|
+
const i = window.matchMedia(oe), s = ()=>{
|
|
64
|
+
l(i.matches);
|
|
63
65
|
};
|
|
64
|
-
return
|
|
65
|
-
|
|
66
|
+
return i.addEventListener("change", s), s(), ()=>{
|
|
67
|
+
i.removeEventListener("change", s);
|
|
66
68
|
};
|
|
67
69
|
}, []), e;
|
|
68
|
-
},
|
|
69
|
-
headerMobileHeight: (e == null ? void 0 : e.headerMobileHeight) === "mistica" ?
|
|
70
|
-
}),
|
|
71
|
-
const e = o.useRef(null), [
|
|
72
|
-
return
|
|
73
|
-
var
|
|
74
|
-
if (
|
|
70
|
+
}, ie = ()=>(e)=>e, ne = (e)=>({
|
|
71
|
+
headerMobileHeight: (e == null ? void 0 : e.headerMobileHeight) === "mistica" ? z : e == null ? void 0 : e.headerMobileHeight
|
|
72
|
+
}), ae = ()=>{
|
|
73
|
+
const e = o.useRef(null), [l, i] = o.useState(!1), [s, v] = o.useState(!0);
|
|
74
|
+
return I(()=>{
|
|
75
|
+
var d;
|
|
76
|
+
if (s) v(!1);
|
|
75
77
|
else {
|
|
76
|
-
const
|
|
77
|
-
|
|
78
|
+
const p = (d = e.current) == null ? void 0 : d.parentElement;
|
|
79
|
+
p && (p.style.isolation = "isolate", i(!0));
|
|
78
80
|
}
|
|
79
81
|
}, [
|
|
80
|
-
|
|
81
|
-
]),
|
|
82
|
+
s
|
|
83
|
+
]), l || !O() || s ? null : /* @__PURE__ */ r("div", {
|
|
82
84
|
ref: e,
|
|
83
85
|
style: {
|
|
84
86
|
display: "none"
|
|
85
87
|
}
|
|
86
88
|
});
|
|
87
|
-
},
|
|
88
|
-
let { theme: e, children:
|
|
89
|
+
}, le = (param)=>{
|
|
90
|
+
let { theme: e, children: l, as: i, withoutStyles: s = !1 } = param;
|
|
89
91
|
var _e_colorScheme, _e_skin_borderRadii;
|
|
90
|
-
const v = o.useRef(1),
|
|
92
|
+
const v = o.useRef(1), d = o.useCallback(()=>`aria-id-hook-${v.current++}`, []), p = se(), k = (_e_colorScheme = e.colorScheme) !== null && _e_colorScheme !== void 0 ? _e_colorScheme : "auto", R = e.skin.colors, T = _object_spread({}, e.skin.colors, e.skin.darkModeColors), x = k === "auto" && p || k === "dark", m = x ? T : R, c = o.useMemo(()=>{
|
|
91
93
|
const n = _object_spread({
|
|
92
94
|
platform: _(),
|
|
93
|
-
insideNovumNativeApp:
|
|
94
|
-
}, e.platformOverrides),
|
|
95
|
-
let [
|
|
96
|
-
var
|
|
95
|
+
insideNovumNativeApp: F()
|
|
96
|
+
}, e.platformOverrides), a = Object.entries(U).map((param)=>{
|
|
97
|
+
let [u, g] = param;
|
|
98
|
+
var f;
|
|
97
99
|
return {
|
|
98
|
-
[
|
|
100
|
+
[u]: _object_spread({}, g, (f = e.skin.textPresets) == null ? void 0 : f[u])
|
|
99
101
|
};
|
|
100
|
-
}),
|
|
102
|
+
}), t = Object.assign({}, ...a);
|
|
101
103
|
var _e_useHrefDecorator;
|
|
102
104
|
return {
|
|
103
105
|
skinName: e.skin.name,
|
|
104
106
|
i18n: e.i18n,
|
|
105
107
|
platformOverrides: n,
|
|
106
|
-
texts: _object_spread({},
|
|
108
|
+
texts: _object_spread({}, j(e.i18n.locale), e.texts),
|
|
107
109
|
analytics: _object_spread({
|
|
108
110
|
logEvent: ()=>Promise.resolve(),
|
|
109
111
|
eventFormat: "universal-analytics"
|
|
110
112
|
}, e.analytics),
|
|
111
|
-
colorValues:
|
|
112
|
-
dimensions: _object_spread({}, y,
|
|
113
|
-
textPresets:
|
|
113
|
+
colorValues: m,
|
|
114
|
+
dimensions: _object_spread({}, y, ne(e.dimensions)),
|
|
115
|
+
textPresets: t,
|
|
114
116
|
Link: A(e.Link),
|
|
115
|
-
isDarkMode:
|
|
117
|
+
isDarkMode: x,
|
|
116
118
|
isIos: _(n) === "ios",
|
|
117
|
-
useHrefDecorator: (_e_useHrefDecorator = e.useHrefDecorator) !== null && _e_useHrefDecorator !== void 0 ? _e_useHrefDecorator :
|
|
119
|
+
useHrefDecorator: (_e_useHrefDecorator = e.useHrefDecorator) !== null && _e_useHrefDecorator !== void 0 ? _e_useHrefDecorator : ie,
|
|
118
120
|
useId: e.useId
|
|
119
121
|
};
|
|
120
122
|
}, [
|
|
121
|
-
|
|
123
|
+
m,
|
|
122
124
|
e,
|
|
123
|
-
|
|
124
|
-
]),
|
|
125
|
-
let [n,
|
|
126
|
-
let
|
|
127
|
-
if (
|
|
128
|
-
const [
|
|
129
|
-
|
|
125
|
+
x
|
|
126
|
+
]), H = o.useMemo(()=>Object.fromEntries(Object.entries(m).map((param)=>{
|
|
127
|
+
let [n, a] = param;
|
|
128
|
+
let t = "";
|
|
129
|
+
if (a.startsWith("#")) {
|
|
130
|
+
const [u, g, f] = Q(a);
|
|
131
|
+
t = `${u}, ${g}, ${f}`;
|
|
130
132
|
}
|
|
131
133
|
return [
|
|
132
134
|
n,
|
|
133
|
-
|
|
135
|
+
t
|
|
134
136
|
];
|
|
135
137
|
})), [
|
|
136
|
-
|
|
137
|
-
]),
|
|
138
|
-
const n = Object.entries(
|
|
139
|
-
let [a,
|
|
138
|
+
m
|
|
139
|
+
]), V = o.useMemo(()=>{
|
|
140
|
+
const n = Object.entries(c.textPresets).map((param)=>{
|
|
141
|
+
let [a, t] = param;
|
|
140
142
|
return {
|
|
141
|
-
[a]: {
|
|
142
|
-
weight: String(
|
|
143
|
-
}
|
|
143
|
+
[a]: _object_spread({}, t.weight && {
|
|
144
|
+
weight: String(S[t.weight])
|
|
145
|
+
}, t.size && {
|
|
146
|
+
size: `${t.size.desktop}px`
|
|
147
|
+
}, t.lineHeight && {
|
|
148
|
+
lineHeight: `${t.lineHeight.desktop}px`
|
|
149
|
+
})
|
|
144
150
|
};
|
|
145
151
|
});
|
|
146
152
|
return Object.assign({}, ...n);
|
|
147
153
|
}, [
|
|
148
|
-
|
|
149
|
-
]),
|
|
150
|
-
textPresets
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
154
|
+
c
|
|
155
|
+
]), b = o.useMemo(()=>{
|
|
156
|
+
const n = Object.entries(c.textPresets).map((param)=>{
|
|
157
|
+
let [a, t] = param;
|
|
158
|
+
return {
|
|
159
|
+
[a]: _object_spread({}, t.weight && {
|
|
160
|
+
weight: String(S[t.weight])
|
|
161
|
+
}, t.size && {
|
|
162
|
+
size: `${t.size.mobile}px`
|
|
163
|
+
}, t.lineHeight && {
|
|
164
|
+
lineHeight: `${t.lineHeight.mobile}px`
|
|
165
|
+
})
|
|
166
|
+
};
|
|
167
|
+
});
|
|
168
|
+
return Object.assign({}, ...n);
|
|
169
|
+
}, [
|
|
170
|
+
c
|
|
171
|
+
]), C = {
|
|
172
|
+
textPresets: V,
|
|
173
|
+
colors: m,
|
|
174
|
+
rawColors: H,
|
|
175
|
+
borderRadii: (_e_skin_borderRadii = e.skin.borderRadii) !== null && _e_skin_borderRadii !== void 0 ? _e_skin_borderRadii : X
|
|
176
|
+
};
|
|
177
|
+
return /* @__PURE__ */ P(M, {
|
|
156
178
|
children: [
|
|
157
|
-
/* @__PURE__ */ r(
|
|
179
|
+
/* @__PURE__ */ r(B, {
|
|
158
180
|
disabled: !e.enableTabFocus,
|
|
159
|
-
children: /* @__PURE__ */ r(
|
|
160
|
-
children: /* @__PURE__ */ r(
|
|
161
|
-
children: /* @__PURE__ */ r(
|
|
162
|
-
value:
|
|
163
|
-
children: /* @__PURE__ */ r(
|
|
164
|
-
eventFormat:
|
|
165
|
-
children: /* @__PURE__ */ r(
|
|
166
|
-
children: /* @__PURE__ */ r(
|
|
167
|
-
children: /* @__PURE__ */ r(
|
|
168
|
-
value:
|
|
169
|
-
children: /* @__PURE__ */ r(
|
|
170
|
-
children: /* @__PURE__ */ r(
|
|
171
|
-
children: /* @__PURE__ */ r(
|
|
172
|
-
children:
|
|
181
|
+
children: /* @__PURE__ */ r(G, {
|
|
182
|
+
children: /* @__PURE__ */ r(W, {
|
|
183
|
+
children: /* @__PURE__ */ r(L.Provider, {
|
|
184
|
+
value: c,
|
|
185
|
+
children: /* @__PURE__ */ r(J, {
|
|
186
|
+
eventFormat: c.analytics.eventFormat,
|
|
187
|
+
children: /* @__PURE__ */ r(K, {
|
|
188
|
+
children: /* @__PURE__ */ r(q, {
|
|
189
|
+
children: /* @__PURE__ */ r(N.Provider, {
|
|
190
|
+
value: d,
|
|
191
|
+
children: /* @__PURE__ */ r($, {
|
|
192
|
+
children: /* @__PURE__ */ r(D, {
|
|
193
|
+
children: /* @__PURE__ */ r(Y, {
|
|
194
|
+
children: i ? /*#__PURE__*/ o.createElement(i, {
|
|
173
195
|
style: _object_spread({
|
|
174
196
|
isolation: "isolate"
|
|
175
|
-
},
|
|
176
|
-
|
|
197
|
+
}, h(ee, C), h(te, b)),
|
|
198
|
+
className: s ? void 0 : re
|
|
199
|
+
}, l) : /* @__PURE__ */ P(M, {
|
|
177
200
|
children: [
|
|
178
|
-
!
|
|
179
|
-
children:
|
|
201
|
+
!s && (process.env.NODE_ENV !== "test" || process.env.SSR_TEST) && /* @__PURE__ */ r("style", {
|
|
202
|
+
children: `
|
|
203
|
+
:root {${h(E, C)}}
|
|
204
|
+
@media ${Z} {
|
|
205
|
+
:root {${h(E.textPresets, b)}}
|
|
206
|
+
}
|
|
207
|
+
`
|
|
180
208
|
}),
|
|
181
|
-
|
|
209
|
+
l
|
|
182
210
|
]
|
|
183
211
|
})
|
|
184
212
|
})
|
|
@@ -192,8 +220,8 @@ const Y = "(prefers-color-scheme: dark)", Z = ()=>{
|
|
|
192
220
|
})
|
|
193
221
|
})
|
|
194
222
|
}),
|
|
195
|
-
!
|
|
223
|
+
!i && /* @__PURE__ */ r(ae, {})
|
|
196
224
|
]
|
|
197
225
|
});
|
|
198
|
-
},
|
|
199
|
-
export {
|
|
226
|
+
}, Ve = le;
|
|
227
|
+
export { Ve as default, se as useIsOsDarkModeEnabled };
|