@telefonica/mistica 14.37.0 → 14.39.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 (66) hide show
  1. package/css/mistica.css +1 -1
  2. package/dist/carousel.js +46 -43
  3. package/dist/chip.js +51 -34
  4. package/dist/empty-state-card.js +24 -18
  5. package/dist/image.css-mistica.js +7 -4
  6. package/dist/image.css.d.ts +1 -0
  7. package/dist/image.js +69 -58
  8. package/dist/index.d.ts +1 -0
  9. package/dist/index.js +7 -0
  10. package/dist/inline.css-mistica.js +14 -12
  11. package/dist/inline.css.d.ts +5 -1
  12. package/dist/inline.d.ts +4 -2
  13. package/dist/inline.js +31 -16
  14. package/dist/loading-bar.css-mistica.js +6 -18
  15. package/dist/loading-bar.css.d.ts +1 -4
  16. package/dist/loading-bar.js +22 -27
  17. package/dist/loading-screen.css-mistica.js +51 -0
  18. package/dist/loading-screen.css.d.ts +11 -0
  19. package/dist/loading-screen.css.ts.vanilla.css-mistica.js +11 -0
  20. package/dist/loading-screen.d.ts +28 -0
  21. package/dist/loading-screen.js +398 -0
  22. package/dist/logo.css-mistica.js +21 -5
  23. package/dist/logo.css.d.ts +7 -0
  24. package/dist/logo.d.ts +2 -2
  25. package/dist/logo.js +86 -61
  26. package/dist/navigation-bar.css-mistica.js +43 -37
  27. package/dist/navigation-bar.css.d.ts +3 -1
  28. package/dist/navigation-bar.js +165 -209
  29. package/dist/package-version.js +1 -1
  30. package/dist/tabs.css.d.ts +1 -1
  31. package/dist/vivinho-loading-animation/in-lottie.json.js +1479 -0
  32. package/dist/vivinho-loading-animation/index.d.ts +8 -0
  33. package/dist/vivinho-loading-animation/index.js +119 -0
  34. package/dist/vivinho-loading-animation/out-lottie.json.js +2143 -0
  35. package/dist/vivinho-loading-animation/pulse-lottie.json.js +2017 -0
  36. package/dist/vivinho-loading-animation/vivinho-loading-animation.css-mistica.js +20 -0
  37. package/dist/vivinho-loading-animation/vivinho-loading-animation.css.d.ts +2 -0
  38. package/dist/vivinho-loading-animation/vivinho-loading-animation.css.ts.vanilla.css-mistica.js +11 -0
  39. package/dist/vivinho-loading-animation/wave-lottie.json.js +10207 -0
  40. package/dist-es/carousel.js +46 -43
  41. package/dist-es/chip.js +78 -61
  42. package/dist-es/empty-state-card.js +41 -35
  43. package/dist-es/image.css-mistica.js +2 -2
  44. package/dist-es/image.js +86 -76
  45. package/dist-es/index.js +1782 -1781
  46. package/dist-es/inline.css-mistica.js +7 -8
  47. package/dist-es/inline.js +39 -24
  48. package/dist-es/loading-bar.css-mistica.js +2 -2
  49. package/dist-es/loading-bar.js +22 -32
  50. package/dist-es/loading-screen.css-mistica.js +7 -0
  51. package/dist-es/loading-screen.css.ts.vanilla.css-mistica.js +2 -0
  52. package/dist-es/loading-screen.js +335 -0
  53. package/dist-es/logo.css-mistica.js +7 -2
  54. package/dist-es/logo.js +110 -85
  55. package/dist-es/navigation-bar.css-mistica.js +19 -19
  56. package/dist-es/navigation-bar.js +219 -263
  57. package/dist-es/package-version.js +1 -1
  58. package/dist-es/style.css +1 -1
  59. package/dist-es/vivinho-loading-animation/in-lottie.json.js +1426 -0
  60. package/dist-es/vivinho-loading-animation/index.js +64 -0
  61. package/dist-es/vivinho-loading-animation/out-lottie.json.js +2090 -0
  62. package/dist-es/vivinho-loading-animation/pulse-lottie.json.js +1964 -0
  63. package/dist-es/vivinho-loading-animation/vivinho-loading-animation.css-mistica.js +3 -0
  64. package/dist-es/vivinho-loading-animation/vivinho-loading-animation.css.ts.vanilla.css-mistica.js +2 -0
  65. package/dist-es/vivinho-loading-animation/wave-lottie.json.js +10154 -0
  66. package/package.json +2 -1
package/dist-es/image.js CHANGED
@@ -78,22 +78,23 @@ function _object_without_properties_loose(source, excluded) {
78
78
  }
79
79
  return target;
80
80
  }
81
- import { jsx as e, jsxs as H, Fragment as _ } from "react/jsx-runtime";
82
- import * as o from "react";
83
- import E from "classnames";
84
- import { SkeletonAnimation as M } from "./skeletons.js";
85
- import { AspectRatioContainer as N } from "./utils/aspect-ratio-support.js";
86
- import { getPrefixedDataAttributes as V } from "./utils/dom.js";
87
- import { useIsInverseVariant as W } from "./theme-variant-context.js";
88
- import { useTheme as B } from "./hooks.js";
89
- import { VIVO_SKIN as D } from "./skins/constants.js";
90
- import { sprinkles as O } from "./sprinkles.css-mistica.js";
91
- import { vars as $, FADE_IN_DURATION_MS as j, image as P } from "./image.css-mistica.js";
92
- import { vars as r } from "./skins/skin-contract.css-mistica.js";
93
- import { combineRefs as U } from "./utils/common.js";
94
- import K from "./skeleton-base.js";
95
- import { fallbackStyles as Z } from "./utils/css.js";
96
- const q = (param)=>/* @__PURE__ */ {
81
+ import { jsx as e, jsxs as k, Fragment as R } from "react/jsx-runtime";
82
+ import * as r from "react";
83
+ import F from "classnames";
84
+ import { SkeletonAnimation as L } from "./skeletons.js";
85
+ import { AspectRatioContainer as W } from "./utils/aspect-ratio-support.js";
86
+ import { getPrefixedDataAttributes as M } from "./utils/dom.js";
87
+ import { useIsInverseVariant as N } from "./theme-variant-context.js";
88
+ import { useTheme as V, useAriaId as D } from "./hooks.js";
89
+ import { VIVO_SKIN as O } from "./skins/constants.js";
90
+ import { sprinkles as $ } from "./sprinkles.css-mistica.js";
91
+ import { vars as j, FADE_IN_DURATION_MS as P, image as U, imageWithBorder as p } from "./image.css-mistica.js";
92
+ import { vars as o } from "./skins/skin-contract.css-mistica.js";
93
+ import { combineRefs as K } from "./utils/common.js";
94
+ import Z from "./skeleton-base.js";
95
+ import { isServerSide as q } from "./utils/environment.js";
96
+ import { fallbackStyles as G } from "./utils/css.js";
97
+ const J = (param)=>/* @__PURE__ */ {
97
98
  let { style: t } = param;
98
99
  return e("svg", {
99
100
  width: "48",
@@ -103,13 +104,13 @@ const q = (param)=>/* @__PURE__ */ {
103
104
  style: t,
104
105
  children: /* @__PURE__ */ e("path", {
105
106
  d: "M24.021 35.7235C24.8145 35.7694 25.0467 36.1913 25.3157 36.5138C25.586 36.8362 29.515 41.551 29.7823 41.8569C30.0475 42.1662 30.7822 42.7329 31.5901 42.8405C32.3967 42.9473 33.282 42.7842 33.8484 42.3748C34.4135 41.965 35.1313 41.4073 35.3833 41.0356C35.6337 40.6638 36.061 40.1302 35.9823 39.2534C35.9028 38.3783 35.7112 37.9204 35.0268 37.1691C34.3433 36.4185 30.2992 31.6657 29.5382 30.7537C29.5382 30.7537 28.8467 29.9423 28.9469 28.7956C29.0476 27.6468 29.567 27.1343 30.6608 26.8487C31.7534 26.5647 36.0267 25.5306 36.0267 25.5306C36.0267 25.5306 38.4728 24.3723 37.9182 22.0776L37.5997 20.904C37.5997 20.904 37.0672 18.2264 33.5519 19.0556C30.0344 19.8869 28.0803 20.377 28.0803 20.377C28.0803 20.377 26.9602 20.4838 26.7999 19.744C26.6417 19.0038 26.8494 18.6218 27.3443 18.4156C27.8387 18.209 30.9611 16.7175 31.3617 12.6853C31.7652 8.65158 28.3882 5.06573 24.0091 5.08104C19.6288 5.0976 16.4594 8.39988 16.4725 11.8185C16.4856 15.2387 18.7033 17.5144 20.4079 18.3638C21.3752 18.8453 21.0656 19.7122 21.0656 19.7122C21.0656 19.7122 20.8334 20.5554 19.8153 20.3311C18.7972 20.1025 13.8657 18.9736 13.8657 18.9736C13.8657 18.9736 10.8914 18.4226 10.1732 21.359C9.4541 24.2978 11.1261 25.4143 12.3532 25.6908C13.5798 25.9669 17.7296 26.9716 17.7296 26.9716C17.7296 26.9716 18.9643 27.581 19.0125 28.8308C19.0425 29.5697 19.0438 30.1824 18.266 31.2832C17.4894 32.3835 12.6598 38.0148 12.6598 38.0148C12.6598 38.0148 10.9997 39.9862 13.4051 41.763C15.8106 43.5401 17.1641 43.1262 18.5921 41.4889C20.0188 39.852 22.8383 36.4243 22.8383 36.4243C22.8383 36.4243 23.2275 35.6788 24.021 35.7235Z",
106
- stroke: r.colors.brand,
107
+ stroke: o.colors.brand,
107
108
  strokeWidth: "2"
108
109
  })
109
110
  });
110
- }, G = /*#__PURE__*/ o.forwardRef((param, l)=>{
111
- let { borderRadius: t, withIcon: a = !0, border: c } = param;
112
- const s = W(), { skinName: n } = B();
111
+ }, Q = /*#__PURE__*/ r.forwardRef((param, m)=>{
112
+ let { borderRadius: t, withIcon: a = !0, border: d } = param;
113
+ const n = N(), { skinName: s } = V();
113
114
  return /* @__PURE__ */ e("div", {
114
115
  style: {
115
116
  height: "100%",
@@ -117,13 +118,13 @@ const q = (param)=>/* @__PURE__ */ {
117
118
  display: "flex",
118
119
  alignItems: "center",
119
120
  justifyContent: "center",
120
- backgroundColor: s ? r.colors.backgroundSkeletonInverse : r.colors.backgroundSkeleton,
121
+ backgroundColor: n ? o.colors.backgroundSkeletonInverse : o.colors.backgroundSkeleton,
121
122
  boxSizing: "border-box",
122
- border: c ? `1px solid ${r.colors.borderLow}` : "none",
123
+ border: d ? `1px solid ${o.colors.borderLow}` : "none",
123
124
  borderRadius: t
124
125
  },
125
- ref: l,
126
- children: a ? n === D ? /* @__PURE__ */ e(q, {
126
+ ref: m,
127
+ children: a ? s === O ? /* @__PURE__ */ e(J, {
127
128
  style: {
128
129
  width: "10%",
129
130
  minWidth: 24,
@@ -139,18 +140,18 @@ const q = (param)=>/* @__PURE__ */ {
139
140
  maxWidth: 48
140
141
  },
141
142
  children: /* @__PURE__ */ e("path", {
142
- fill: s ? r.colors.inverse : r.colors.neutralMedium,
143
+ fill: n ? o.colors.inverse : o.colors.neutralMedium,
143
144
  d: "M20.25 4.622c.832 0 1.591.664 1.591 1.393v11.98c0 .728-.76 1.392-1.591 1.392H3.746c-.863 0-1.591-.639-1.591-1.392V6.015c0-.754.728-1.393 1.59-1.393H20.25zm0 13.558c.193 0 .367-.146.39-.207l-.003-11.956a.555.555 0 00-.384-.182H3.746c-.21 0-.364.132-.387.19v11.973c.014.044.171.182.387.182H20.25zM6.152 9.068c0 .554.451 1.005 1.003 1.005a1.006 1.006 0 000-2.01c-.552 0-1.003.45-1.003 1.005zm1.003 2.215a2.216 2.216 0 010-4.43c1.218 0 2.207.993 2.207 2.215a2.213 2.213 0 01-2.207 2.215zm12.42 1.337l-3.18-2.44a.605.605 0 00-.742.005l-3.636 2.9-.879-.83a.6.6 0 00-.798-.025l-5.168 4.317a.607.607 0 00.386 1.07.59.59 0 00.384-.14l4.759-3.975 3.308 3.123c.241.23.625.221.852-.025a.605.605 0 00-.026-.854l-1.932-1.824 3.131-2.496 2.807 2.154a.603.603 0 00.846-.112.609.609 0 00-.112-.848z"
144
145
  })
145
146
  }) : void 0
146
147
  });
147
- }), k = {
148
+ }), x = {
148
149
  "1:1": 1,
149
150
  "16:9": 16 / 9,
150
151
  "7:10": 7 / 10,
151
152
  "4:3": 4 / 3
152
- }, x = "1:1", J = /*#__PURE__*/ o.forwardRef((_param, S)=>{
153
- var { aspectRatio: t = x, alt: a = "", dataAttributes: c, noBorderRadius: l, src: s, onError: n, onLoad: d, loadingFallback: R = !0, errorFallback: y = !0 } = _param, i = _object_without_properties(_param, [
153
+ }, S = "1:1", X = /*#__PURE__*/ r.forwardRef((_param, H)=>{
154
+ var { aspectRatio: t = S, alt: a = "", dataAttributes: d, noBorderRadius: m, src: n, onError: s, onLoad: c, loadingFallback: A = !0, errorFallback: E = !0 } = _param, i = _object_without_properties(_param, [
154
155
  "aspectRatio",
155
156
  "alt",
156
157
  "dataAttributes",
@@ -161,88 +162,97 @@ const q = (param)=>/* @__PURE__ */ {
161
162
  "loadingFallback",
162
163
  "errorFallback"
163
164
  ]);
164
- const f = o.useRef(), A = i.border ? `1px solid ${r.colors.borderLow}` : "none", h = i.circular ? "50%" : l ? "0px" : Z($.mediaBorderRadius, r.borderRadii.container), [C, g] = o.useState(!s), [z, b] = o.useState(!0), [F, w] = o.useState(!1), m = i.width && i.height ? void 0 : i.circular ? 1 : typeof t == "number" ? t : k[t], v = R && !!(m !== 0 || i.width && i.height), L = y && !!(m !== 0 || i.width && i.height), u = o.useCallback(()=>{
165
- g(!1), b(!1), setTimeout(()=>{
165
+ var I;
166
+ const h = D(), l = r.useRef(), u = i.circular ? "50%" : m ? "0px" : G(j.mediaBorderRadius, o.borderRadii.container), [b, v] = r.useState(!n), [T, w] = r.useState(!1), g = i.width && i.height ? void 0 : i.circular ? 1 : typeof t == "number" ? t : x[t], f = A && !!(g !== 0 || i.width && i.height), _ = E && !!(g !== 0 || i.width && i.height), C = r.useCallback(()=>{
167
+ v(!1), l.current && (l.current.style.opacity = "1"), setTimeout(()=>{
166
168
  w(!0);
167
- }, j), d == null || d();
169
+ }, P), c == null || c();
168
170
  }, [
169
- d
170
- ]), T = // https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/issues/309
171
- // eslint-disable-next-line jsx-a11y/no-noninteractive-element-interactions
172
- /* @__PURE__ */ e("img", {
173
- style: _object_spread_props(_object_spread({}, z && v ? {
174
- opacity: 0
175
- } : {
176
- opacity: 1
177
- }), {
178
- boxSizing: "border-box",
179
- border: A,
180
- borderRadius: h
181
- }),
182
- ref: U(f, S),
183
- src: s,
184
- className: E(P, O({
185
- position: m !== 0 ? "absolute" : "static"
186
- })),
187
- alt: a,
188
- onError: ()=>{
189
- g(!0), b(!1), w(!0), n == null || n();
190
- },
191
- onLoad: u
171
+ c
172
+ ]);
173
+ r.useEffect(()=>{
174
+ var y;
175
+ (y = l.current) != null && y.complete && C();
176
+ }, [
177
+ C
178
+ ]);
179
+ const z = q() || !((I = document.getElementById(h)) != null && I.complete), B = /* @__PURE__ */ k(R, {
180
+ children: [
181
+ /* @__PURE__ */ e("img", {
182
+ suppressHydrationWarning: !0,
183
+ id: h,
184
+ style: {
185
+ opacity: z && f ? 0 : 1,
186
+ borderRadius: u
187
+ },
188
+ ref: K(l, H),
189
+ src: n,
190
+ className: F(U, {
191
+ [p]: i.border
192
+ }, $({
193
+ position: g !== 0 ? "absolute" : "static"
194
+ })),
195
+ alt: a,
196
+ onError: ()=>{
197
+ v(!0), w(!0), s == null || s();
198
+ },
199
+ onLoad: C
200
+ }),
201
+ f && /* @__PURE__ */ e("script", {
202
+ dangerouslySetInnerHTML: {
203
+ __html: `document.getElementById("${h}").addEventListener('load', (e) => e.target.style.opacity = "1")`
204
+ }
205
+ })
206
+ ]
192
207
  });
193
208
  var _i_height, _i_width;
194
- return o.useEffect(()=>{
195
- var I;
196
- (I = f.current) != null && I.complete && u();
197
- }, [
198
- u
199
- ]), /* @__PURE__ */ H(_, {
209
+ return /* @__PURE__ */ k(R, {
200
210
  children: [
201
- v && !F && /* @__PURE__ */ e("div", {
211
+ f && !T && /* @__PURE__ */ e("div", {
202
212
  style: {
203
213
  position: "absolute",
204
214
  width: "100%",
205
215
  height: "100%"
206
216
  },
207
- children: /* @__PURE__ */ e(M, {
217
+ children: /* @__PURE__ */ e(L, {
208
218
  height: (_i_height = i.height) !== null && _i_height !== void 0 ? _i_height : "100%",
209
219
  width: (_i_width = i.width) !== null && _i_width !== void 0 ? _i_width : "100%",
210
- children: /* @__PURE__ */ e(K, {
220
+ children: /* @__PURE__ */ e(Z, {
211
221
  height: "100%",
212
222
  width: "100%",
213
- radius: h
223
+ radius: u
214
224
  })
215
225
  })
216
226
  }),
217
- C && L && /* @__PURE__ */ e("div", {
227
+ b && _ && /* @__PURE__ */ e("div", {
218
228
  style: {
219
229
  position: "absolute",
220
230
  width: "100%",
221
231
  height: "100%",
222
232
  zIndex: 1
223
233
  },
224
- children: /* @__PURE__ */ e(G, {
225
- borderRadius: h,
234
+ children: /* @__PURE__ */ e(Q, {
235
+ borderRadius: u,
226
236
  border: i.border
227
237
  })
228
238
  }),
229
- !C && T
239
+ !b && B
230
240
  ]
231
241
  });
232
- }), Q = /*#__PURE__*/ o.forwardRef((t, a)=>{
242
+ }), Y = /*#__PURE__*/ r.forwardRef((t, a)=>{
233
243
  var _t_aspectRatio;
234
- const c = t.width && t.height ? void 0 : t.circular ? 1 : typeof t.aspectRatio == "number" ? t.aspectRatio : k[(_t_aspectRatio = t.aspectRatio) !== null && _t_aspectRatio !== void 0 ? _t_aspectRatio : x];
235
- return /* @__PURE__ */ e(N, {
244
+ const d = t.width && t.height ? void 0 : t.circular ? 1 : typeof t.aspectRatio == "number" ? t.aspectRatio : x[(_t_aspectRatio = t.aspectRatio) !== null && _t_aspectRatio !== void 0 ? _t_aspectRatio : S];
245
+ return /* @__PURE__ */ e(W, {
236
246
  style: {
237
247
  position: "relative"
238
248
  },
239
- aspectRatio: c,
249
+ aspectRatio: d,
240
250
  width: t.width,
241
251
  height: t.height,
242
- dataAttributes: V(t.dataAttributes, "Image"),
243
- children: /* @__PURE__ */ e(J, _object_spread_props(_object_spread({}, t), {
252
+ dataAttributes: M(t.dataAttributes, "Image"),
253
+ children: /* @__PURE__ */ e(X, _object_spread_props(_object_spread({}, t), {
244
254
  ref: a
245
255
  }))
246
256
  });
247
- }), h1 = Q;
248
- export { J as ImageContent, G as ImageError, k as RATIO, h1 as default };
257
+ }), f1 = Y;
258
+ export { X as ImageContent, Q as ImageError, x as RATIO, f1 as default };