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