@telefonica/mistica 14.39.0 → 14.40.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 (103) hide show
  1. package/css/mistica.css +1 -1
  2. package/dist/accordion.js +47 -49
  3. package/dist/button.js +10 -10
  4. package/dist/card.js +10 -10
  5. package/dist/carousel.css-mistica.js +48 -24
  6. package/dist/carousel.css.d.ts +9 -1
  7. package/dist/carousel.d.ts +2 -2
  8. package/dist/carousel.js +227 -219
  9. package/dist/community/advanced-data-card.css-mistica.js +6 -6
  10. package/dist/community/blocks.js +12 -12
  11. package/dist/desktop-container-type-context.js +2 -2
  12. package/dist/fade-in.js +2 -2
  13. package/dist/feedback.js +6 -6
  14. package/dist/focus-trap.js +2 -2
  15. package/dist/header.js +4 -4
  16. package/dist/hero.js +4 -4
  17. package/dist/horizontal-scroll.js +2 -2
  18. package/dist/icons/icon-amex.js +2 -2
  19. package/dist/icons/icon-chevron.js +2 -2
  20. package/dist/icons/icon-cvv-amex.js +2 -2
  21. package/dist/icons/icon-cvv-visa-mc.js +2 -2
  22. package/dist/icons/icon-info.js +4 -4
  23. package/dist/icons/icon-mastercard.js +2 -2
  24. package/dist/icons/icon-visa.js +2 -2
  25. package/dist/image.js +2 -2
  26. package/dist/list.js +16 -16
  27. package/dist/loading-bar.js +2 -2
  28. package/dist/logo.js +10 -10
  29. package/dist/menu.js +2 -2
  30. package/dist/mosaic.js +2 -2
  31. package/dist/navigation-bar.js +8 -8
  32. package/dist/navigation-breadcrumbs.js +2 -2
  33. package/dist/negative-box.js +2 -2
  34. package/dist/nestable-context.js +2 -2
  35. package/dist/package-version.js +1 -1
  36. package/dist/placeholder.js +2 -2
  37. package/dist/responsive-layout.js +2 -2
  38. package/dist/select.js +4 -4
  39. package/dist/sheet.js +71 -67
  40. package/dist/skeletons.js +12 -12
  41. package/dist/stack.js +2 -2
  42. package/dist/text-field-base.js +2 -2
  43. package/dist/text-field-components.js +2 -2
  44. package/dist/text.js +18 -17
  45. package/dist/theme-variant-context.js +2 -2
  46. package/dist/theme.js +8 -8
  47. package/dist/title.js +2 -2
  48. package/dist/tooltip.js +64 -60
  49. package/dist/utils/animation.js +2 -2
  50. package/dist/utils/css.js +1 -1
  51. package/dist/video.js +2 -2
  52. package/dist/vivinho-loading-animation/pulse-lottie.json.js +3 -5
  53. package/dist-es/accordion.js +65 -67
  54. package/dist-es/button.js +10 -10
  55. package/dist-es/card.js +10 -10
  56. package/dist-es/carousel.css-mistica.js +7 -7
  57. package/dist-es/carousel.js +278 -270
  58. package/dist-es/community/advanced-data-card.css-mistica.js +3 -3
  59. package/dist-es/community/blocks.js +12 -12
  60. package/dist-es/desktop-container-type-context.js +2 -2
  61. package/dist-es/fade-in.js +2 -2
  62. package/dist-es/feedback.js +6 -6
  63. package/dist-es/focus-trap.js +2 -2
  64. package/dist-es/header.js +4 -4
  65. package/dist-es/hero.js +4 -4
  66. package/dist-es/horizontal-scroll.js +2 -2
  67. package/dist-es/icons/icon-amex.js +2 -2
  68. package/dist-es/icons/icon-chevron.js +2 -2
  69. package/dist-es/icons/icon-cvv-amex.js +2 -2
  70. package/dist-es/icons/icon-cvv-visa-mc.js +2 -2
  71. package/dist-es/icons/icon-info.js +4 -4
  72. package/dist-es/icons/icon-mastercard.js +2 -2
  73. package/dist-es/icons/icon-visa.js +2 -2
  74. package/dist-es/image.js +2 -2
  75. package/dist-es/list.js +16 -16
  76. package/dist-es/loading-bar.js +2 -2
  77. package/dist-es/logo.js +10 -10
  78. package/dist-es/menu.js +2 -2
  79. package/dist-es/mosaic.js +2 -2
  80. package/dist-es/navigation-bar.js +8 -8
  81. package/dist-es/navigation-breadcrumbs.js +2 -2
  82. package/dist-es/negative-box.js +2 -2
  83. package/dist-es/nestable-context.js +2 -2
  84. package/dist-es/package-version.js +1 -1
  85. package/dist-es/placeholder.js +2 -2
  86. package/dist-es/responsive-layout.js +2 -2
  87. package/dist-es/select.js +4 -4
  88. package/dist-es/sheet.js +79 -75
  89. package/dist-es/skeletons.js +12 -12
  90. package/dist-es/stack.js +2 -2
  91. package/dist-es/style.css +1 -1
  92. package/dist-es/text-field-base.js +2 -2
  93. package/dist-es/text-field-components.js +4 -4
  94. package/dist-es/text.js +21 -20
  95. package/dist-es/theme-variant-context.js +2 -2
  96. package/dist-es/theme.js +8 -8
  97. package/dist-es/title.js +2 -2
  98. package/dist-es/tooltip.js +80 -76
  99. package/dist-es/utils/animation.js +2 -2
  100. package/dist-es/utils/css.js +1 -1
  101. package/dist-es/video.js +2 -2
  102. package/dist-es/vivinho-loading-animation/pulse-lottie.json.js +3 -5
  103. package/package.json +16 -17
package/dist/carousel.js CHANGED
@@ -11,22 +11,22 @@ function _export(target, all) {
11
11
  }
12
12
  _export(exports, {
13
13
  Carousel: function() {
14
- return It;
14
+ return Pt;
15
15
  },
16
16
  CenteredCarousel: function() {
17
- return Pt;
17
+ return Nt;
18
18
  },
19
19
  IsInsideSlideshowProvider: function() {
20
- return et;
20
+ return at;
21
21
  },
22
22
  PageBullets: function() {
23
- return ae;
23
+ return he;
24
24
  },
25
25
  Slideshow: function() {
26
- return wt;
26
+ return Lt;
27
27
  },
28
28
  useIsInsideSlideshowContext: function() {
29
- return xt;
29
+ return Bt;
30
30
  }
31
31
  });
32
32
  const _jsxruntime = require("react/jsx-runtime");
@@ -35,7 +35,6 @@ const _iconchevronleftregular = /*#__PURE__*/ _interop_require_default(require("
35
35
  const _iconchevronrightregular = /*#__PURE__*/ _interop_require_default(require("./generated/mistica-icons/icon-chevron-right-regular.js"));
36
36
  const _hooks = require("./hooks.js");
37
37
  const _inline = /*#__PURE__*/ _interop_require_default(require("./inline.js"));
38
- const _stack = /*#__PURE__*/ _interop_require_default(require("./stack.js"));
39
38
  const _touchable = require("./touchable.js");
40
39
  const _classnames = /*#__PURE__*/ _interop_require_default(require("classnames"));
41
40
  const _themevariantcontext = require("./theme-variant-context.js");
@@ -44,7 +43,6 @@ const _platform = require("./utils/platform.js");
44
43
  const _documentvisibility = require("./utils/document-visibility.js");
45
44
  const _carouselcssmistica = require("./carousel.css-mistica.js");
46
45
  const _imagecssmistica = require("./image.css-mistica.js");
47
- const _sprinklescssmistica = require("./sprinkles.css-mistica.js");
48
46
  const _desktopcontainertypecontext = require("./desktop-container-type-context.js");
49
47
  const _constants = require("./skins/constants.js");
50
48
  const _css = require("./utils/css.js");
@@ -146,42 +144,45 @@ function _object_spread_props(target, source) {
146
144
  }
147
145
  return target;
148
146
  }
149
- const ie = (e, r)=>{
150
- const t = (0, _documentvisibility.useDocumentVisibility)();
151
- return (0, _hooks.useIsInViewport)(r, !1) && t && !!e;
152
- }, ae = (param)=>{
153
- let { currentIndex: e, numPages: r, onPress: t } = param;
154
- const o = (0, _themevariantcontext.useIsInverseVariant)(), { isDesktopOrBigger: h } = (0, _hooks.useScreenSize)(), m = (b)=>{
155
- const f = b === e;
156
- return o ? f ? _carouselcssmistica.bulletActiveInverse : _carouselcssmistica.bulletInverse : f ? _carouselcssmistica.bulletActive : _carouselcssmistica.bullet;
157
- };
147
+ const de = (e, t)=>{
148
+ const o = (0, _documentvisibility.useDocumentVisibility)();
149
+ return (0, _hooks.useIsInViewport)(t, !1) && o && !!e;
150
+ }, he = (param)=>{
151
+ let { currentIndex: e, numPages: t, onPress: o } = param;
152
+ var _t_tablet;
153
+ const l = (0, _themevariantcontext.useIsInverseVariant)(), { isDesktopOrBigger: h } = (0, _hooks.useScreenSize)(), m = (p)=>{
154
+ const n = p === e;
155
+ return l ? n ? _carouselcssmistica.bulletActiveInverse : _carouselcssmistica.bulletInverse : n ? _carouselcssmistica.bulletActive : _carouselcssmistica.bullet;
156
+ }, I = typeof t == "number" ? t : Math.max(t.mobile, (_t_tablet = t.tablet) !== null && _t_tablet !== void 0 ? _t_tablet : t.mobile, t.desktop);
158
157
  return /* @__PURE__ */ (0, _jsxruntime.jsx)(_inline.default, {
159
- space: {
160
- mobile: 8,
161
- desktop: 16
162
- },
158
+ space: 0,
163
159
  alignItems: "center",
164
160
  dataAttributes: {
165
161
  "component-name": "PageBullets"
166
162
  },
167
163
  children: Array.from({
168
- length: r
169
- }, (b, f)=>/* @__PURE__ */ (0, _jsxruntime.jsx)(_touchable.BaseTouchable, {
170
- className: (0, _sprinklescssmistica.sprinkles)({
171
- display: "block",
172
- padding: 0,
173
- border: "none",
174
- background: "transparent"
164
+ length: I
165
+ }, (p, n)=>/* @__PURE__ */ {
166
+ var _t_tablet;
167
+ return (0, _jsxruntime.jsx)(_touchable.BaseTouchable, {
168
+ className: (0, _classnames.default)(typeof t == "number" ? _carouselcssmistica.bulletButton : {
169
+ [_carouselcssmistica.bulletButtonMobile]: n < t.mobile,
170
+ [_carouselcssmistica.bulletButtonTablet]: n < ((_t_tablet = t.tablet) !== null && _t_tablet !== void 0 ? _t_tablet : t.mobile),
171
+ [_carouselcssmistica.bulletButtonDesktop]: n < t.desktop
175
172
  }),
173
+ style: n === 0 ? {
174
+ paddingLeft: 0
175
+ } : {},
176
176
  maybe: !0,
177
- onPress: h && t ? ()=>t(f) : void 0,
177
+ onPress: h && o ? ()=>o(n) : void 0,
178
178
  children: /* @__PURE__ */ (0, _jsxruntime.jsx)("div", {
179
- className: m(f)
179
+ className: m(n)
180
180
  })
181
- }, f))
181
+ }, n);
182
+ })
182
183
  });
183
- }, Z = (e, r, t)=>t ? typeof t == "number" ? t : t[e] || r[e] : r[e], Xe = (e, r)=>{
184
- const t = {
184
+ }, oe = (e, t, o)=>o ? typeof o == "number" ? o : o[e] || t[e] : t[e], ct = (e, t)=>{
185
+ const o = {
185
186
  mobile: 1,
186
187
  tablet: 2,
187
188
  desktop: {
@@ -190,59 +191,59 @@ const ie = (e, r)=>{
190
191
  large: 3
191
192
  }
192
193
  };
193
- if (!r) return _object_spread_props(_object_spread({}, t), {
194
- desktop: Z(e, t.desktop)
194
+ if (!t) return _object_spread_props(_object_spread({}, o), {
195
+ desktop: oe(e, o.desktop)
195
196
  });
196
- if (typeof r == "number") return {
197
- mobile: r,
198
- tablet: r,
199
- desktop: r
197
+ if (typeof t == "number") return {
198
+ mobile: t,
199
+ tablet: t,
200
+ desktop: t
200
201
  };
201
- const o = Z(e, t.desktop, r.desktop);
202
- return _object_spread_props(_object_spread({}, t, r), {
203
- desktop: o
202
+ const l = oe(e, o.desktop, t.desktop);
203
+ return _object_spread_props(_object_spread({}, o, t), {
204
+ desktop: l
204
205
  });
205
- }, ee = (e, r)=>{
206
+ }, se = (e, t)=>{
206
207
  if (e.length === 0) return [];
207
- const t = Math.ceil(e.length / r), o = [];
208
- for(let h = 0; h < e.length; h += t)o.push(e[h]);
209
- return o[o.length - 1] = e[e.length - t], o;
210
- }, Ze = (e, r)=>{
211
- const t = [];
212
- for(let o = 0; o < r.length; o++)o === 0 ? t.push(r[0]) : t.push((r[o] + r[o - 1]) / 2);
213
- for(let o = t.length - 1; o >= 0; o--)if (e - t[o] >= -1) return o;
208
+ const o = Math.ceil(e.length / t), l = [];
209
+ for(let h = 0; h < e.length; h += o)l.push(e[h]);
210
+ return l[l.length - 1] = e[e.length - o], l;
211
+ }, it = (e, t)=>{
212
+ const o = [];
213
+ for(let l = 0; l < t.length; l++)l === 0 ? o.push(t[0]) : o.push((t[l] + t[l - 1]) / 2);
214
+ for(let l = o.length - 1; l >= 0; l--)if (e - o[l] >= -1) return l;
214
215
  return 0;
215
- }, ue = 5e3, fe = (param)=>{
216
- let { items: e, itemStyle: r, itemClassName: t, withBullets: o, renderBullets: h, initialActiveItem: m, itemsPerPage: b, itemsToScroll: f, mobilePageOffset: p, gap: N, free: R, centered: A, autoplay: v, onPageChange: P, dataAttributes: F } = param;
217
- const { texts: T, platformOverrides: x, skinName: y } = (0, _hooks.useTheme)(), c = (0, _desktopcontainertypecontext.useDesktopContainerType)(), i = Xe(c || "large", b), { isDesktopOrBigger: w, isTablet: C } = (0, _hooks.useScreenSize)(), U = C ? i.tablet : i.mobile, I = Math.max(Math.floor(w ? i.desktop : U), 1), g = _react.useRef(null), S = Math.ceil(e.length / I), [{ scrollLeft: G, scrollRight: q }, he] = _react.useState({
216
+ }, me = 5e3, be = (param)=>{
217
+ let { items: e, itemStyle: t, itemClassName: o, withBullets: l, renderBullets: h, initialActiveItem: m, itemsPerPage: I, itemsToScroll: p, mobilePageOffset: n, gap: S, free: N, centered: B, autoplay: g, onPageChange: x, dataAttributes: U } = param;
218
+ const { texts: A, platformOverrides: M, skinName: E } = (0, _hooks.useTheme)(), a = (0, _desktopcontainertypecontext.useDesktopContainerType)(), i = ct(a || "large", I), { isDesktopOrBigger: C, isTablet: k } = (0, _hooks.useScreenSize)(), q = k ? i.tablet : i.mobile, v = Math.max(Math.floor(C ? i.desktop : q), 1), b = _react.useRef(null), K = Math.ceil(e.length / Math.max(Math.floor(i.mobile), 1)), Y = Math.ceil(e.length / Math.max(Math.floor(i.tablet), 1)), Q = Math.ceil(e.length / Math.max(Math.floor(i.desktop), 1)), y = Math.ceil(e.length / v), [{ scrollLeft: X, scrollRight: $ }, ge] = _react.useState({
218
219
  scrollLeft: 0,
219
220
  scrollRight: 0
220
- }), [K, me] = _react.useState([]), W = _react.useMemo(()=>ee(K, S), [
221
- K,
222
- S
223
- ]), O = f ? ee(K, Math.ceil(e.length / f)) : W, pe = q !== 0, ge = G !== 0;
221
+ }), [G, ve] = _react.useState([]), W = _react.useMemo(()=>se(G, y), [
222
+ G,
223
+ y
224
+ ]), D = p ? se(G, Math.ceil(e.length / p)) : W, Ie = $ !== 0, xe = X !== 0;
224
225
  _react.useEffect(()=>{
225
- if (g.current) {
226
- const l = g.current, a = ()=>{
227
- const { scrollWidth: z, clientWidth: B } = l, _ = Math.round(l.scrollLeft), j = Math.round(z - (_ + B));
228
- he({
226
+ if (b.current) {
227
+ const r = b.current, u = ()=>{
228
+ const { scrollWidth: z, clientWidth: L } = r, _ = Math.round(r.scrollLeft), j = Math.round(z - (_ + L));
229
+ ge({
229
230
  scrollLeft: _,
230
231
  scrollRight: j
231
232
  });
232
- }, u = ()=>{
233
- const z = l.scrollWidth - l.clientWidth;
234
- me(Array.from(l.querySelectorAll("[data-item]")).map((B, _)=>{
233
+ }, f = ()=>{
234
+ const z = r.scrollWidth - r.clientWidth;
235
+ ve(Array.from(r.querySelectorAll("[data-item]")).map((L, _)=>{
235
236
  if (_ === e.length - 1) return z;
236
- const j = B.offsetLeft, Pe = parseInt(getComputedStyle(B).scrollMargin), xe = A && !w ? j - B.clientWidth / 2 : j;
237
- return Math.min(xe - Pe - l.offsetLeft, z);
237
+ const j = L.offsetLeft, Se = parseInt(getComputedStyle(L).scrollMargin), ke = B && !C ? j - L.clientWidth / 2 : j;
238
+ return Math.min(ke - Se - r.offsetLeft, z);
238
239
  }));
239
240
  };
240
- a(), u(), l.addEventListener("scroll", a);
241
- const d = (0, _dom.listenResize)(l, ()=>{
242
- a(), u();
241
+ u(), f(), r.addEventListener("scroll", u);
242
+ const d = (0, _dom.listenResize)(r, ()=>{
243
+ u(), f();
243
244
  });
244
245
  return ()=>{
245
- l.removeEventListener("scroll", a), d();
246
+ r.removeEventListener("scroll", u), d();
246
247
  };
247
248
  }
248
249
  return ()=>{};
@@ -250,108 +251,110 @@ const ie = (e, r)=>{
250
251
  i.desktop,
251
252
  i.tablet,
252
253
  i.mobile,
254
+ y,
253
255
  S,
254
- N,
255
- A,
256
- w,
256
+ B,
257
+ C,
257
258
  e.length
258
259
  ]);
259
- const D = _react.useCallback(function(l) {
260
- let a = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : !0;
261
- const u = g.current;
262
- if (u) {
263
- const d = W[l];
264
- u.scrollTo({
260
+ const O = _react.useCallback(function(r) {
261
+ let u = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : !0;
262
+ const f = b.current;
263
+ if (f) {
264
+ const d = W[r];
265
+ f.scrollTo({
265
266
  left: d,
266
- behavior: a ? "smooth" : "auto"
267
+ behavior: u ? "smooth" : "auto"
267
268
  });
268
269
  }
269
270
  }, [
270
271
  W
271
- ]), be = _react.useCallback(()=>{
272
- const l = g.current;
273
- if (l) {
274
- const { scrollLeft: a } = l, u = [
275
- ...O
276
- ].reverse().find((d)=>d - a < -1);
277
- l.scrollTo({
278
- left: u,
272
+ ]), Me = _react.useCallback(()=>{
273
+ const r = b.current;
274
+ if (r) {
275
+ const { scrollLeft: u } = r, f = [
276
+ ...D
277
+ ].reverse().find((d)=>d - u < -1);
278
+ r.scrollTo({
279
+ left: f,
279
280
  behavior: "smooth"
280
281
  });
281
282
  }
282
283
  }, [
283
- O
284
- ]), Y = _react.useCallback(()=>{
285
- const l = g.current;
286
- if (l) {
287
- const { scrollLeft: a } = l, u = O.find((d)=>d - a > 1);
288
- l.scrollTo({
289
- left: u,
284
+ D
285
+ ]), H = _react.useCallback(()=>{
286
+ const r = b.current;
287
+ if (r) {
288
+ const { scrollLeft: u } = r, f = D.find((d)=>d - u > 1);
289
+ r.scrollTo({
290
+ left: f,
290
291
  behavior: "smooth"
291
292
  });
292
293
  }
293
294
  }, [
294
- O
295
- ]), H = ie(!!v, g);
295
+ D
296
+ ]), Z = de(!!g, b);
296
297
  _react.useEffect(()=>{
297
- m !== void 0 && D(Math.floor(m / I), !1);
298
+ m !== void 0 && O(Math.floor(m / v), !1);
298
299
  }, [
299
300
  m,
300
- D,
301
- I
301
+ O,
302
+ v
302
303
  ]), _react.useEffect(()=>{
303
- if (H && v) {
304
- const l = typeof v == "boolean" ? ue : v.time, a = typeof v == "object" && v.loop, u = setInterval(()=>{
304
+ if (Z && g) {
305
+ const r = typeof g == "boolean" ? me : g.time, u = typeof g == "object" && g.loop, f = setInterval(()=>{
305
306
  var d;
306
- q !== 0 ? Y() : a && ((d = g.current) == null || d.scrollTo({
307
+ $ !== 0 ? H() : u && ((d = b.current) == null || d.scrollTo({
307
308
  left: 0,
308
309
  behavior: "smooth"
309
310
  }));
310
- }, l);
311
- return ()=>clearInterval(u);
311
+ }, r);
312
+ return ()=>clearInterval(f);
312
313
  }
313
314
  }, [
314
- v,
315
- Y,
316
- q,
317
- H
315
+ g,
316
+ H,
317
+ $,
318
+ Z
318
319
  ]);
319
- const k = Ze(G, W), J = _react.useRef(!m), Q = _react.useRef(0);
320
+ const w = it(X, W), ee = _react.useRef(!m), te = _react.useRef(0);
320
321
  _react.useEffect(()=>{
321
- if (P) {
322
- const l = Math.min((k + 1) * I - 1, e.length - 1), a = [];
323
- for(let u = 0; u < I; u++){
324
- const d = l - u;
325
- d >= 0 && a.unshift(d);
322
+ if (x) {
323
+ const r = Math.min((w + 1) * v - 1, e.length - 1), u = [];
324
+ for(let f = 0; f < v; f++){
325
+ const d = r - f;
326
+ d >= 0 && u.unshift(d);
326
327
  }
327
- J.current ? Q.current !== k && P({
328
- pageIndex: k,
329
- shownItemIndexes: a
330
- }) : J.current = a.includes(m || 0), Q.current = k;
328
+ ee.current ? te.current !== w && x({
329
+ pageIndex: w,
330
+ shownItemIndexes: u
331
+ }) : ee.current = u.includes(m || 0), te.current = w;
331
332
  }
332
333
  }, [
333
- k,
334
+ w,
334
335
  e.length,
335
- I,
336
+ v,
336
337
  m,
337
- P
338
+ x
338
339
  ]);
339
340
  let V = null;
340
341
  h ? V = h({
341
- numPages: S,
342
- currentIndex: k,
343
- onPress: D
344
- }) : o && (V = S > 1 && /* @__PURE__ */ (0, _jsxruntime.jsx)(ae, {
345
- numPages: S,
346
- currentIndex: k,
347
- onPress: D
342
+ numPages: y,
343
+ currentIndex: w,
344
+ onPress: O
345
+ }) : l && (V = /* @__PURE__ */ (0, _jsxruntime.jsx)(he, {
346
+ numPages: {
347
+ mobile: K,
348
+ tablet: Y,
349
+ desktop: Q
350
+ },
351
+ currentIndex: w,
352
+ onPress: O
348
353
  }));
349
- const ve = "64px", Ie = "36px";
350
- return /* @__PURE__ */ (0, _jsxruntime.jsxs)(_stack.default, {
351
- space: 24,
352
- dataAttributes: _object_spread({
353
- "component-name": "Carousel"
354
- }, F),
354
+ const Ce = "64px", we = "36px";
355
+ return /* @__PURE__ */ (0, _jsxruntime.jsxs)("div", _object_spread_props(_object_spread({}, (0, _dom.getPrefixedDataAttributes)(_object_spread({
356
+ "component-name": "Carousel"
357
+ }, U))), {
355
358
  children: [
356
359
  /* @__PURE__ */ (0, _jsxruntime.jsxs)("div", {
357
360
  className: _carouselcssmistica.carouselContainer,
@@ -360,70 +363,75 @@ const ie = (e, r)=>{
360
363
  isInverse: !1,
361
364
  children: /* @__PURE__ */ (0, _jsxruntime.jsx)(_touchable.BaseTouchable, {
362
365
  className: _carouselcssmistica.carouselPrevArrowButton,
363
- "aria-label": T.carouselPrevButton,
364
- onPress: be,
365
- disabled: !ge,
366
+ "aria-label": A.carouselPrevButton,
367
+ onPress: Me,
368
+ disabled: !xe,
366
369
  children: /* @__PURE__ */ (0, _jsxruntime.jsx)(_iconchevronleftregular.default, {})
367
370
  })
368
371
  }),
369
372
  /* @__PURE__ */ (0, _jsxruntime.jsx)("div", {
370
373
  className: (0, _classnames.default)(_carouselcssmistica.carousel, {
371
- [_carouselcssmistica.centeredCarousel]: A,
372
- [_carouselcssmistica.carouselWithScroll]: S > 1
374
+ [_carouselcssmistica.centeredCarousel]: B,
375
+ [_carouselcssmistica.carouselWithScrollMobile]: K > 1,
376
+ [_carouselcssmistica.carouselWithScrollTablet]: Y > 1
373
377
  }),
374
378
  style: _object_spread_props(_object_spread({}, (0, _css.applyCssVars)(_object_spread({
375
379
  [_carouselcssmistica.vars.itemsPerPageDesktop]: String(i.desktop),
376
380
  [_carouselcssmistica.vars.itemsPerPageTablet]: String(i.tablet),
377
381
  [_carouselcssmistica.vars.itemsPerPageMobile]: String(i.mobile)
378
- }, p === "large" ? {
379
- [_carouselcssmistica.vars.mobilePageOffset]: ve
380
- } : y === _constants.VIVO_NEW_SKIN ? {
381
- [_carouselcssmistica.vars.mobilePageOffset]: Ie
382
- } : {}, N !== void 0 ? {
383
- [_carouselcssmistica.vars.gap]: String(N)
382
+ }, n === "large" ? {
383
+ [_carouselcssmistica.vars.mobilePageOffset]: Ce
384
+ } : E === _constants.VIVO_NEW_SKIN ? {
385
+ [_carouselcssmistica.vars.mobilePageOffset]: we
386
+ } : {}, S !== void 0 ? {
387
+ [_carouselcssmistica.vars.gap]: String(S)
384
388
  } : {}))), {
385
- scrollSnapType: R ? "initial" : "x mandatory",
389
+ scrollSnapType: N ? "initial" : "x mandatory",
386
390
  // Hack to fix https://jira.tid.es/browse/NOVUMCC-8988
387
391
  // there is a webkit rendering bug that causes a half pixel white line to appear at
388
392
  // the bottom of the scrollable area in retina displays when it has a height with
389
393
  // decimals. This extra padding avoids that line to partially cover the carousel
390
394
  // slides border:
391
- paddingBottom: (0, _platform.isIos)(x) && !(0, _platform.isRunningAcceptanceTest)(x) ? 0.5 : void 0
395
+ paddingBottom: (0, _platform.isIos)(M) && !(0, _platform.isRunningAcceptanceTest)(M) ? 0.5 : void 0
392
396
  }),
393
- ref: g,
394
- children: e.map((l, a)=>/* @__PURE__ */ (0, _jsxruntime.jsx)("div", {
395
- className: (0, _classnames.default)(_carouselcssmistica.carouselItem, t),
396
- style: _object_spread_props(_object_spread({}, r), {
397
- scrollSnapStop: (0, _platform.isAndroid)(x) ? "always" : "normal"
397
+ ref: b,
398
+ children: e.map((r, u)=>/* @__PURE__ */ (0, _jsxruntime.jsx)("div", {
399
+ className: (0, _classnames.default)(_carouselcssmistica.carouselItem, o),
400
+ style: _object_spread_props(_object_spread({}, t), {
401
+ scrollSnapStop: (0, _platform.isAndroid)(M) ? "always" : "normal"
398
402
  }),
399
403
  "data-item": !0,
400
- children: l
401
- }, a))
404
+ children: r
405
+ }, u))
402
406
  }),
403
407
  /* @__PURE__ */ (0, _jsxruntime.jsx)(_themevariantcontext.ThemeVariant, {
404
408
  isInverse: !1,
405
409
  children: /* @__PURE__ */ (0, _jsxruntime.jsx)(_touchable.BaseTouchable, {
406
410
  className: _carouselcssmistica.carouselNextArrowButton,
407
- "aria-label": T.carouselNextButton,
408
- onPress: Y,
409
- disabled: !pe,
411
+ "aria-label": A.carouselNextButton,
412
+ onPress: H,
413
+ disabled: !Ie,
410
414
  children: /* @__PURE__ */ (0, _jsxruntime.jsx)(_iconchevronrightregular.default, {})
411
415
  })
412
416
  })
413
417
  ]
414
418
  }),
415
419
  V && /* @__PURE__ */ (0, _jsxruntime.jsx)("div", {
416
- className: _carouselcssmistica.carouselBullets,
420
+ className: (0, _classnames.default)(_carouselcssmistica.carouselBullets, {
421
+ [_carouselcssmistica.noCarouselBulletsDesktop]: Q <= 1,
422
+ [_carouselcssmistica.noCarouselBulletsTablet]: Y <= 1,
423
+ [_carouselcssmistica.noCarouselBulletsMobile]: K <= 1
424
+ }),
417
425
  children: V
418
426
  })
419
427
  ]
420
- });
421
- }, It = (e)=>/* @__PURE__ */ (0, _jsxruntime.jsx)(fe, _object_spread({}, e)), Pt = (param)=>/* @__PURE__ */ {
422
- let { items: e, itemStyle: r, itemClassName: t, withBullets: o, renderBullets: h, initialActiveItem: m, onPageChange: b, dataAttributes: f } = param;
423
- return (0, _jsxruntime.jsx)(fe, {
428
+ }));
429
+ }, Pt = (e)=>/* @__PURE__ */ (0, _jsxruntime.jsx)(be, _object_spread({}, e)), Nt = (param)=>{
430
+ let { items: e, itemStyle: t, itemClassName: o, withBullets: l, renderBullets: h, initialActiveItem: m, onPageChange: I, dataAttributes: p } = param;
431
+ return /* @__PURE__ */ (0, _jsxruntime.jsx)(be, {
424
432
  items: e,
425
- itemStyle: r,
426
- itemClassName: t,
433
+ itemStyle: t,
434
+ itemClassName: o,
427
435
  itemsPerPage: {
428
436
  mobile: 1,
429
437
  tablet: 1,
@@ -432,78 +440,78 @@ const ie = (e, r)=>{
432
440
  centered: !0,
433
441
  itemsToScroll: 1,
434
442
  gap: 0,
435
- withBullets: o,
443
+ withBullets: l,
436
444
  renderBullets: h,
437
445
  initialActiveItem: m,
438
- onPageChange: b,
439
- dataAttributes: f
446
+ onPageChange: I,
447
+ dataAttributes: p
440
448
  });
441
- }, de = /*#__PURE__*/ _react.createContext(!1), xt = ()=>_react.useContext(de), et = (param)=>/* @__PURE__ */ {
449
+ }, pe = /*#__PURE__*/ _react.createContext(!1), Bt = ()=>_react.useContext(pe), at = (param)=>{
442
450
  let { children: e } = param;
443
- return (0, _jsxruntime.jsx)(de.Provider, {
451
+ return /* @__PURE__ */ (0, _jsxruntime.jsx)(pe.Provider, {
444
452
  value: !0,
445
453
  children: e
446
454
  });
447
- }, wt = (param)=>{
448
- let { items: e, withBullets: r, autoplay: t, onPageChange: o, dataAttributes: h, inverseBullets: m = !0 } = param;
449
- const { texts: b, platformOverrides: f } = (0, _hooks.useTheme)(), p = _react.useRef(null), [{ scrollLeft: N, scrollRight: R }, A] = _react.useState({
455
+ }, Lt = (param)=>{
456
+ let { items: e, withBullets: t, autoplay: o, onPageChange: l, dataAttributes: h, inverseBullets: m = !0 } = param;
457
+ const { texts: I, platformOverrides: p } = (0, _hooks.useTheme)(), n = _react.useRef(null), [{ scrollLeft: S, scrollRight: N }, B] = _react.useState({
450
458
  scrollLeft: 0,
451
459
  scrollRight: 0
452
- }), v = _react.useCallback(()=>{
453
- const c = p.current;
454
- c && c.scrollBy({
455
- left: -c.clientWidth,
460
+ }), g = _react.useCallback(()=>{
461
+ const a = n.current;
462
+ a && a.scrollBy({
463
+ left: -a.clientWidth,
456
464
  behavior: "smooth"
457
465
  });
458
- }, []), P = _react.useCallback(()=>{
459
- const c = p.current;
460
- c && c.scrollBy({
461
- left: c.clientWidth,
466
+ }, []), x = _react.useCallback(()=>{
467
+ const a = n.current;
468
+ a && a.scrollBy({
469
+ left: a.clientWidth,
462
470
  behavior: "smooth"
463
471
  });
464
- }, []), F = R !== 0, T = N !== 0, x = p.current ? Math.floor((N + p.current.clientWidth / 2) / p.current.clientWidth) : 0;
472
+ }, []), U = N !== 0, A = S !== 0, M = n.current ? Math.floor((S + n.current.clientWidth / 2) / n.current.clientWidth) : 0;
465
473
  _react.useLayoutEffect(()=>{
466
- const c = p.current;
467
- if (c) {
474
+ const a = n.current;
475
+ if (a) {
468
476
  const i = ()=>{
469
- const { scrollWidth: C, clientWidth: U } = c, I = Math.round(c.scrollLeft), g = Math.round(C - (I + U));
470
- A({
471
- scrollLeft: I,
472
- scrollRight: g
477
+ const { scrollWidth: k, clientWidth: q } = a, v = Math.round(a.scrollLeft), b = Math.round(k - (v + q));
478
+ B({
479
+ scrollLeft: v,
480
+ scrollRight: b
473
481
  });
474
482
  };
475
- i(), c.addEventListener("scroll", i);
476
- const w = (0, _dom.listenResize)(c, i);
483
+ i(), a.addEventListener("scroll", i);
484
+ const C = (0, _dom.listenResize)(a, i);
477
485
  return ()=>{
478
- c.removeEventListener("scroll", i), w();
486
+ a.removeEventListener("scroll", i), C();
479
487
  };
480
488
  }
481
489
  }, [
482
490
  e.length
483
491
  ]);
484
- const y = ie(!!t, p);
492
+ const E = de(!!o, n);
485
493
  return _react.useEffect(()=>{
486
- if (y && t) {
487
- const c = typeof t == "boolean" ? ue : t.time, i = typeof t == "object" && t.loop, w = setInterval(()=>{
488
- var C;
489
- R !== 0 ? P() : i && ((C = p.current) == null || C.scrollTo({
494
+ if (E && o) {
495
+ const a = typeof o == "boolean" ? me : o.time, i = typeof o == "object" && o.loop, C = setInterval(()=>{
496
+ var k;
497
+ N !== 0 ? x() : i && ((k = n.current) == null || k.scrollTo({
490
498
  left: 0,
491
499
  behavior: "smooth"
492
500
  }));
493
- }, c);
494
- return ()=>clearInterval(w);
501
+ }, a);
502
+ return ()=>clearInterval(C);
495
503
  }
496
504
  }, [
497
- t,
498
- P,
499
- R,
500
- y
505
+ o,
506
+ x,
507
+ N,
508
+ E
501
509
  ]), _react.useEffect(()=>{
502
- o && o(x);
510
+ l && l(M);
503
511
  }, [
504
- x,
505
- o
506
- ]), /* @__PURE__ */ (0, _jsxruntime.jsx)(et, {
512
+ M,
513
+ l
514
+ ]), /* @__PURE__ */ (0, _jsxruntime.jsx)(at, {
507
515
  children: /* @__PURE__ */ (0, _jsxruntime.jsxs)("div", _object_spread_props(_object_spread({
508
516
  className: _carouselcssmistica.slideshowContainer
509
517
  }, (0, _dom.getPrefixedDataAttributes)(h, "SlideShow")), {
@@ -512,9 +520,9 @@ const ie = (e, r)=>{
512
520
  isInverse: !1,
513
521
  children: /* @__PURE__ */ (0, _jsxruntime.jsx)(_touchable.BaseTouchable, {
514
522
  className: _carouselcssmistica.slideshowPrevArrowButton,
515
- "aria-label": b.carouselPrevButton,
516
- onPress: v,
517
- disabled: !T,
523
+ "aria-label": I.carouselPrevButton,
524
+ onPress: g,
525
+ disabled: !A,
518
526
  children: /* @__PURE__ */ (0, _jsxruntime.jsx)(_iconchevronleftregular.default, {})
519
527
  })
520
528
  }),
@@ -524,13 +532,13 @@ const ie = (e, r)=>{
524
532
  }),
525
533
  children: /* @__PURE__ */ (0, _jsxruntime.jsx)("div", {
526
534
  className: _carouselcssmistica.slideshow,
527
- ref: p,
528
- children: e.map((c, i)=>/* @__PURE__ */ (0, _jsxruntime.jsx)("div", {
535
+ ref: n,
536
+ children: e.map((a, i)=>/* @__PURE__ */ (0, _jsxruntime.jsx)("div", {
529
537
  className: _carouselcssmistica.slideshowItem,
530
538
  style: {
531
- scrollSnapStop: (0, _platform.isAndroid)(f) ? "always" : "normal"
539
+ scrollSnapStop: (0, _platform.isAndroid)(p) ? "always" : "normal"
532
540
  },
533
- children: c
541
+ children: a
534
542
  }, i))
535
543
  })
536
544
  }),
@@ -538,19 +546,19 @@ const ie = (e, r)=>{
538
546
  isInverse: !1,
539
547
  children: /* @__PURE__ */ (0, _jsxruntime.jsx)(_touchable.BaseTouchable, {
540
548
  className: _carouselcssmistica.slideshowNextArrowButton,
541
- "aria-label": b.carouselNextButton,
542
- onPress: P,
543
- disabled: !F,
549
+ "aria-label": I.carouselNextButton,
550
+ onPress: x,
551
+ disabled: !U,
544
552
  children: /* @__PURE__ */ (0, _jsxruntime.jsx)(_iconchevronrightregular.default, {})
545
553
  })
546
554
  }),
547
- r && e.length > 1 && /* @__PURE__ */ (0, _jsxruntime.jsx)(_themevariantcontext.ThemeVariant, {
555
+ t && e.length > 1 && /* @__PURE__ */ (0, _jsxruntime.jsx)(_themevariantcontext.ThemeVariant, {
548
556
  isInverse: m,
549
557
  children: /* @__PURE__ */ (0, _jsxruntime.jsx)("div", {
550
558
  className: _carouselcssmistica.slideshowBullets,
551
- children: /* @__PURE__ */ (0, _jsxruntime.jsx)(ae, {
559
+ children: /* @__PURE__ */ (0, _jsxruntime.jsx)(he, {
552
560
  numPages: e.length,
553
- currentIndex: x
561
+ currentIndex: M
554
562
  })
555
563
  })
556
564
  })