@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
@@ -51,61 +51,62 @@ function _object_spread_props(target, source) {
51
51
  }
52
52
  return target;
53
53
  }
54
- import { jsx as s, jsxs as $ } from "react/jsx-runtime";
55
- import * as n from "react";
56
- import te from "./generated/mistica-icons/icon-chevron-left-regular.js";
57
- import se from "./generated/mistica-icons/icon-chevron-right-regular.js";
58
- import { useScreenSize as oe, useTheme as re, useIsInViewport as we } from "./hooks.js";
59
- import Se from "./inline.js";
60
- import ke from "./stack.js";
61
- import { BaseTouchable as M } from "./touchable.js";
62
- import X from "classnames";
63
- import { useIsInverseVariant as Ne, ThemeVariant as E } from "./theme-variant-context.js";
64
- import { listenResize as le, getPrefixedDataAttributes as Ce } from "./utils/dom.js";
65
- import { isAndroid as ne, isIos as Le, isRunningAcceptanceTest as Re } from "./utils/platform.js";
66
- import { useDocumentVisibility as Ae } from "./utils/document-visibility.js";
67
- import { slideshowContainer as Be, slideshowPrevArrowButton as Ee, slideshow as Me, slideshowItem as Te, slideshowNextArrowButton as ye, slideshowBullets as We, bulletActiveInverse as Oe, bulletInverse as De, bulletActive as Ve, bullet as ze, carouselContainer as _e, carouselPrevArrowButton as je, carousel as Fe, centeredCarousel as Ue, carouselWithScroll as qe, vars as L, carouselItem as Ke, carouselNextArrowButton as Ye, carouselBullets as $e } from "./carousel.css-mistica.js";
68
- import { vars as Ge } from "./image.css-mistica.js";
69
- import { sprinkles as He } from "./sprinkles.css-mistica.js";
70
- import { useDesktopContainerType as Je } from "./desktop-container-type-context.js";
71
- import { VIVO_NEW_SKIN as Qe } from "./skins/constants.js";
72
- import { applyCssVars as ce } from "./utils/css.js";
73
- const ie = (e, r)=>{
74
- const t = Ae();
75
- return we(r, !1) && t && !!e;
76
- }, ae = (param)=>{
77
- let { currentIndex: e, numPages: r, onPress: t } = param;
78
- const o = Ne(), { isDesktopOrBigger: h } = oe(), m = (b)=>{
79
- const f = b === e;
80
- return o ? f ? Oe : De : f ? Ve : ze;
81
- };
82
- return /* @__PURE__ */ s(Se, {
83
- space: {
84
- mobile: 8,
85
- desktop: 16
86
- },
54
+ import { jsx as s, jsxs as J } from "react/jsx-runtime";
55
+ import * as c from "react";
56
+ import le from "./generated/mistica-icons/icon-chevron-left-regular.js";
57
+ import re from "./generated/mistica-icons/icon-chevron-right-regular.js";
58
+ import { useScreenSize as ne, useTheme as ce, useIsInViewport as Pe } from "./hooks.js";
59
+ import Ne from "./inline.js";
60
+ import { BaseTouchable as T } from "./touchable.js";
61
+ import F from "classnames";
62
+ import { useIsInverseVariant as Be, ThemeVariant as R } from "./theme-variant-context.js";
63
+ import { listenResize as ie, getPrefixedDataAttributes as ae } from "./utils/dom.js";
64
+ import { isAndroid as ue, isIos as Le, isRunningAcceptanceTest as Re } from "./utils/platform.js";
65
+ import { useDocumentVisibility as Te } from "./utils/document-visibility.js";
66
+ import { bulletButton as Ae, bulletButtonMobile as Ee, bulletButtonTablet as ye, bulletButtonDesktop as We, slideshowContainer as De, slideshowPrevArrowButton as Oe, slideshow as Ve, slideshowItem as ze, slideshowNextArrowButton as _e, slideshowBullets as je, bulletActiveInverse as Fe, bulletInverse as Ue, bulletActive as qe, bullet as Ke, carouselContainer as Ye, carouselPrevArrowButton as $e, carousel as Ge, centeredCarousel as He, carouselWithScrollMobile as Je, carouselWithScrollTablet as Qe, vars as P, carouselItem as Xe, carouselNextArrowButton as Ze, carouselBullets as et, noCarouselBulletsDesktop as tt, noCarouselBulletsTablet as ot, noCarouselBulletsMobile as st } from "./carousel.css-mistica.js";
67
+ import { vars as lt } from "./image.css-mistica.js";
68
+ import { useDesktopContainerType as rt } from "./desktop-container-type-context.js";
69
+ import { VIVO_NEW_SKIN as nt } from "./skins/constants.js";
70
+ import { applyCssVars as fe } from "./utils/css.js";
71
+ const de = (e, t)=>{
72
+ const o = Te();
73
+ return Pe(t, !1) && o && !!e;
74
+ }, he = (param)=>{
75
+ let { currentIndex: e, numPages: t, onPress: o } = param;
76
+ var _t_tablet;
77
+ const l = Be(), { isDesktopOrBigger: h } = ne(), m = (p)=>{
78
+ const n = p === e;
79
+ return l ? n ? Fe : Ue : n ? qe : Ke;
80
+ }, I = typeof t == "number" ? t : Math.max(t.mobile, (_t_tablet = t.tablet) !== null && _t_tablet !== void 0 ? _t_tablet : t.mobile, t.desktop);
81
+ return /* @__PURE__ */ s(Ne, {
82
+ space: 0,
87
83
  alignItems: "center",
88
84
  dataAttributes: {
89
85
  "component-name": "PageBullets"
90
86
  },
91
87
  children: Array.from({
92
- length: r
93
- }, (b, f)=>/* @__PURE__ */ s(M, {
94
- className: He({
95
- display: "block",
96
- padding: 0,
97
- border: "none",
98
- background: "transparent"
88
+ length: I
89
+ }, (p, n)=>/* @__PURE__ */ {
90
+ var _t_tablet;
91
+ return s(T, {
92
+ className: F(typeof t == "number" ? Ae : {
93
+ [Ee]: n < t.mobile,
94
+ [ye]: n < ((_t_tablet = t.tablet) !== null && _t_tablet !== void 0 ? _t_tablet : t.mobile),
95
+ [We]: n < t.desktop
99
96
  }),
97
+ style: n === 0 ? {
98
+ paddingLeft: 0
99
+ } : {},
100
100
  maybe: !0,
101
- onPress: h && t ? ()=>t(f) : void 0,
101
+ onPress: h && o ? ()=>o(n) : void 0,
102
102
  children: /* @__PURE__ */ s("div", {
103
- className: m(f)
103
+ className: m(n)
104
104
  })
105
- }, f))
105
+ }, n);
106
+ })
106
107
  });
107
- }, Z = (e, r, t)=>t ? typeof t == "number" ? t : t[e] || r[e] : r[e], Xe = (e, r)=>{
108
- const t = {
108
+ }, oe = (e, t, o)=>o ? typeof o == "number" ? o : o[e] || t[e] : t[e], ct = (e, t)=>{
109
+ const o = {
109
110
  mobile: 1,
110
111
  tablet: 2,
111
112
  desktop: {
@@ -114,59 +115,59 @@ const ie = (e, r)=>{
114
115
  large: 3
115
116
  }
116
117
  };
117
- if (!r) return _object_spread_props(_object_spread({}, t), {
118
- desktop: Z(e, t.desktop)
118
+ if (!t) return _object_spread_props(_object_spread({}, o), {
119
+ desktop: oe(e, o.desktop)
119
120
  });
120
- if (typeof r == "number") return {
121
- mobile: r,
122
- tablet: r,
123
- desktop: r
121
+ if (typeof t == "number") return {
122
+ mobile: t,
123
+ tablet: t,
124
+ desktop: t
124
125
  };
125
- const o = Z(e, t.desktop, r.desktop);
126
- return _object_spread_props(_object_spread({}, t, r), {
127
- desktop: o
126
+ const l = oe(e, o.desktop, t.desktop);
127
+ return _object_spread_props(_object_spread({}, o, t), {
128
+ desktop: l
128
129
  });
129
- }, ee = (e, r)=>{
130
+ }, se = (e, t)=>{
130
131
  if (e.length === 0) return [];
131
- const t = Math.ceil(e.length / r), o = [];
132
- for(let h = 0; h < e.length; h += t)o.push(e[h]);
133
- return o[o.length - 1] = e[e.length - t], o;
134
- }, Ze = (e, r)=>{
135
- const t = [];
136
- for(let o = 0; o < r.length; o++)o === 0 ? t.push(r[0]) : t.push((r[o] + r[o - 1]) / 2);
137
- for(let o = t.length - 1; o >= 0; o--)if (e - t[o] >= -1) return o;
132
+ const o = Math.ceil(e.length / t), l = [];
133
+ for(let h = 0; h < e.length; h += o)l.push(e[h]);
134
+ return l[l.length - 1] = e[e.length - o], l;
135
+ }, it = (e, t)=>{
136
+ const o = [];
137
+ for(let l = 0; l < t.length; l++)l === 0 ? o.push(t[0]) : o.push((t[l] + t[l - 1]) / 2);
138
+ for(let l = o.length - 1; l >= 0; l--)if (e - o[l] >= -1) return l;
138
139
  return 0;
139
- }, ue = 5e3, fe = (param)=>{
140
- 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;
141
- const { texts: T, platformOverrides: x, skinName: y } = re(), c = Je(), i = Xe(c || "large", b), { isDesktopOrBigger: w, isTablet: C } = oe(), U = C ? i.tablet : i.mobile, I = Math.max(Math.floor(w ? i.desktop : U), 1), g = n.useRef(null), S = Math.ceil(e.length / I), [{ scrollLeft: G, scrollRight: q }, he] = n.useState({
140
+ }, me = 5e3, be = (param)=>{
141
+ 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;
142
+ const { texts: A, platformOverrides: M, skinName: E } = ce(), a = rt(), i = ct(a || "large", I), { isDesktopOrBigger: C, isTablet: k } = ne(), q = k ? i.tablet : i.mobile, v = Math.max(Math.floor(C ? i.desktop : q), 1), b = c.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] = c.useState({
142
143
  scrollLeft: 0,
143
144
  scrollRight: 0
144
- }), [K, me] = n.useState([]), W = n.useMemo(()=>ee(K, S), [
145
- K,
146
- S
147
- ]), O = f ? ee(K, Math.ceil(e.length / f)) : W, pe = q !== 0, ge = G !== 0;
148
- n.useEffect(()=>{
149
- if (g.current) {
150
- const l = g.current, a = ()=>{
151
- const { scrollWidth: z, clientWidth: B } = l, _ = Math.round(l.scrollLeft), j = Math.round(z - (_ + B));
152
- he({
145
+ }), [G, ve] = c.useState([]), W = c.useMemo(()=>se(G, y), [
146
+ G,
147
+ y
148
+ ]), D = p ? se(G, Math.ceil(e.length / p)) : W, Ie = $ !== 0, xe = X !== 0;
149
+ c.useEffect(()=>{
150
+ if (b.current) {
151
+ const r = b.current, u = ()=>{
152
+ const { scrollWidth: z, clientWidth: L } = r, _ = Math.round(r.scrollLeft), j = Math.round(z - (_ + L));
153
+ ge({
153
154
  scrollLeft: _,
154
155
  scrollRight: j
155
156
  });
156
- }, u = ()=>{
157
- const z = l.scrollWidth - l.clientWidth;
158
- me(Array.from(l.querySelectorAll("[data-item]")).map((B, _)=>{
157
+ }, f = ()=>{
158
+ const z = r.scrollWidth - r.clientWidth;
159
+ ve(Array.from(r.querySelectorAll("[data-item]")).map((L, _)=>{
159
160
  if (_ === e.length - 1) return z;
160
- const j = B.offsetLeft, Pe = parseInt(getComputedStyle(B).scrollMargin), xe = A && !w ? j - B.clientWidth / 2 : j;
161
- return Math.min(xe - Pe - l.offsetLeft, z);
161
+ const j = L.offsetLeft, Se = parseInt(getComputedStyle(L).scrollMargin), ke = B && !C ? j - L.clientWidth / 2 : j;
162
+ return Math.min(ke - Se - r.offsetLeft, z);
162
163
  }));
163
164
  };
164
- a(), u(), l.addEventListener("scroll", a);
165
- const d = le(l, ()=>{
166
- a(), u();
165
+ u(), f(), r.addEventListener("scroll", u);
166
+ const d = ie(r, ()=>{
167
+ u(), f();
167
168
  });
168
169
  return ()=>{
169
- l.removeEventListener("scroll", a), d();
170
+ r.removeEventListener("scroll", u), d();
170
171
  };
171
172
  }
172
173
  return ()=>{};
@@ -174,180 +175,187 @@ const ie = (e, r)=>{
174
175
  i.desktop,
175
176
  i.tablet,
176
177
  i.mobile,
178
+ y,
177
179
  S,
178
- N,
179
- A,
180
- w,
180
+ B,
181
+ C,
181
182
  e.length
182
183
  ]);
183
- const D = n.useCallback(function(l) {
184
- let a = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : !0;
185
- const u = g.current;
186
- if (u) {
187
- const d = W[l];
188
- u.scrollTo({
184
+ const O = c.useCallback(function(r) {
185
+ let u = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : !0;
186
+ const f = b.current;
187
+ if (f) {
188
+ const d = W[r];
189
+ f.scrollTo({
189
190
  left: d,
190
- behavior: a ? "smooth" : "auto"
191
+ behavior: u ? "smooth" : "auto"
191
192
  });
192
193
  }
193
194
  }, [
194
195
  W
195
- ]), be = n.useCallback(()=>{
196
- const l = g.current;
197
- if (l) {
198
- const { scrollLeft: a } = l, u = [
199
- ...O
200
- ].reverse().find((d)=>d - a < -1);
201
- l.scrollTo({
202
- left: u,
196
+ ]), Me = c.useCallback(()=>{
197
+ const r = b.current;
198
+ if (r) {
199
+ const { scrollLeft: u } = r, f = [
200
+ ...D
201
+ ].reverse().find((d)=>d - u < -1);
202
+ r.scrollTo({
203
+ left: f,
203
204
  behavior: "smooth"
204
205
  });
205
206
  }
206
207
  }, [
207
- O
208
- ]), Y = n.useCallback(()=>{
209
- const l = g.current;
210
- if (l) {
211
- const { scrollLeft: a } = l, u = O.find((d)=>d - a > 1);
212
- l.scrollTo({
213
- left: u,
208
+ D
209
+ ]), H = c.useCallback(()=>{
210
+ const r = b.current;
211
+ if (r) {
212
+ const { scrollLeft: u } = r, f = D.find((d)=>d - u > 1);
213
+ r.scrollTo({
214
+ left: f,
214
215
  behavior: "smooth"
215
216
  });
216
217
  }
217
218
  }, [
218
- O
219
- ]), H = ie(!!v, g);
220
- n.useEffect(()=>{
221
- m !== void 0 && D(Math.floor(m / I), !1);
219
+ D
220
+ ]), Z = de(!!g, b);
221
+ c.useEffect(()=>{
222
+ m !== void 0 && O(Math.floor(m / v), !1);
222
223
  }, [
223
224
  m,
224
- D,
225
- I
226
- ]), n.useEffect(()=>{
227
- if (H && v) {
228
- const l = typeof v == "boolean" ? ue : v.time, a = typeof v == "object" && v.loop, u = setInterval(()=>{
225
+ O,
226
+ v
227
+ ]), c.useEffect(()=>{
228
+ if (Z && g) {
229
+ const r = typeof g == "boolean" ? me : g.time, u = typeof g == "object" && g.loop, f = setInterval(()=>{
229
230
  var d;
230
- q !== 0 ? Y() : a && ((d = g.current) == null || d.scrollTo({
231
+ $ !== 0 ? H() : u && ((d = b.current) == null || d.scrollTo({
231
232
  left: 0,
232
233
  behavior: "smooth"
233
234
  }));
234
- }, l);
235
- return ()=>clearInterval(u);
235
+ }, r);
236
+ return ()=>clearInterval(f);
236
237
  }
237
238
  }, [
238
- v,
239
- Y,
240
- q,
241
- H
239
+ g,
240
+ H,
241
+ $,
242
+ Z
242
243
  ]);
243
- const k = Ze(G, W), J = n.useRef(!m), Q = n.useRef(0);
244
- n.useEffect(()=>{
245
- if (P) {
246
- const l = Math.min((k + 1) * I - 1, e.length - 1), a = [];
247
- for(let u = 0; u < I; u++){
248
- const d = l - u;
249
- d >= 0 && a.unshift(d);
244
+ const w = it(X, W), ee = c.useRef(!m), te = c.useRef(0);
245
+ c.useEffect(()=>{
246
+ if (x) {
247
+ const r = Math.min((w + 1) * v - 1, e.length - 1), u = [];
248
+ for(let f = 0; f < v; f++){
249
+ const d = r - f;
250
+ d >= 0 && u.unshift(d);
250
251
  }
251
- J.current ? Q.current !== k && P({
252
- pageIndex: k,
253
- shownItemIndexes: a
254
- }) : J.current = a.includes(m || 0), Q.current = k;
252
+ ee.current ? te.current !== w && x({
253
+ pageIndex: w,
254
+ shownItemIndexes: u
255
+ }) : ee.current = u.includes(m || 0), te.current = w;
255
256
  }
256
257
  }, [
257
- k,
258
+ w,
258
259
  e.length,
259
- I,
260
+ v,
260
261
  m,
261
- P
262
+ x
262
263
  ]);
263
264
  let V = null;
264
265
  h ? V = h({
265
- numPages: S,
266
- currentIndex: k,
267
- onPress: D
268
- }) : o && (V = S > 1 && /* @__PURE__ */ s(ae, {
269
- numPages: S,
270
- currentIndex: k,
271
- onPress: D
266
+ numPages: y,
267
+ currentIndex: w,
268
+ onPress: O
269
+ }) : l && (V = /* @__PURE__ */ s(he, {
270
+ numPages: {
271
+ mobile: K,
272
+ tablet: Y,
273
+ desktop: Q
274
+ },
275
+ currentIndex: w,
276
+ onPress: O
272
277
  }));
273
- const ve = "64px", Ie = "36px";
274
- return /* @__PURE__ */ $(ke, {
275
- space: 24,
276
- dataAttributes: _object_spread({
277
- "component-name": "Carousel"
278
- }, F),
278
+ const Ce = "64px", we = "36px";
279
+ return /* @__PURE__ */ J("div", _object_spread_props(_object_spread({}, ae(_object_spread({
280
+ "component-name": "Carousel"
281
+ }, U))), {
279
282
  children: [
280
- /* @__PURE__ */ $("div", {
281
- className: _e,
283
+ /* @__PURE__ */ J("div", {
284
+ className: Ye,
282
285
  children: [
283
- /* @__PURE__ */ s(E, {
286
+ /* @__PURE__ */ s(R, {
284
287
  isInverse: !1,
285
- children: /* @__PURE__ */ s(M, {
286
- className: je,
287
- "aria-label": T.carouselPrevButton,
288
- onPress: be,
289
- disabled: !ge,
290
- children: /* @__PURE__ */ s(te, {})
288
+ children: /* @__PURE__ */ s(T, {
289
+ className: $e,
290
+ "aria-label": A.carouselPrevButton,
291
+ onPress: Me,
292
+ disabled: !xe,
293
+ children: /* @__PURE__ */ s(le, {})
291
294
  })
292
295
  }),
293
296
  /* @__PURE__ */ s("div", {
294
- className: X(Fe, {
295
- [Ue]: A,
296
- [qe]: S > 1
297
+ className: F(Ge, {
298
+ [He]: B,
299
+ [Je]: K > 1,
300
+ [Qe]: Y > 1
297
301
  }),
298
- style: _object_spread_props(_object_spread({}, ce(_object_spread({
299
- [L.itemsPerPageDesktop]: String(i.desktop),
300
- [L.itemsPerPageTablet]: String(i.tablet),
301
- [L.itemsPerPageMobile]: String(i.mobile)
302
- }, p === "large" ? {
303
- [L.mobilePageOffset]: ve
304
- } : y === Qe ? {
305
- [L.mobilePageOffset]: Ie
306
- } : {}, N !== void 0 ? {
307
- [L.gap]: String(N)
302
+ style: _object_spread_props(_object_spread({}, fe(_object_spread({
303
+ [P.itemsPerPageDesktop]: String(i.desktop),
304
+ [P.itemsPerPageTablet]: String(i.tablet),
305
+ [P.itemsPerPageMobile]: String(i.mobile)
306
+ }, n === "large" ? {
307
+ [P.mobilePageOffset]: Ce
308
+ } : E === nt ? {
309
+ [P.mobilePageOffset]: we
310
+ } : {}, S !== void 0 ? {
311
+ [P.gap]: String(S)
308
312
  } : {}))), {
309
- scrollSnapType: R ? "initial" : "x mandatory",
313
+ scrollSnapType: N ? "initial" : "x mandatory",
310
314
  // Hack to fix https://jira.tid.es/browse/NOVUMCC-8988
311
315
  // there is a webkit rendering bug that causes a half pixel white line to appear at
312
316
  // the bottom of the scrollable area in retina displays when it has a height with
313
317
  // decimals. This extra padding avoids that line to partially cover the carousel
314
318
  // slides border:
315
- paddingBottom: Le(x) && !Re(x) ? 0.5 : void 0
319
+ paddingBottom: Le(M) && !Re(M) ? 0.5 : void 0
316
320
  }),
317
- ref: g,
318
- children: e.map((l, a)=>/* @__PURE__ */ s("div", {
319
- className: X(Ke, t),
320
- style: _object_spread_props(_object_spread({}, r), {
321
- scrollSnapStop: ne(x) ? "always" : "normal"
321
+ ref: b,
322
+ children: e.map((r, u)=>/* @__PURE__ */ s("div", {
323
+ className: F(Xe, o),
324
+ style: _object_spread_props(_object_spread({}, t), {
325
+ scrollSnapStop: ue(M) ? "always" : "normal"
322
326
  }),
323
327
  "data-item": !0,
324
- children: l
325
- }, a))
328
+ children: r
329
+ }, u))
326
330
  }),
327
- /* @__PURE__ */ s(E, {
331
+ /* @__PURE__ */ s(R, {
328
332
  isInverse: !1,
329
- children: /* @__PURE__ */ s(M, {
330
- className: Ye,
331
- "aria-label": T.carouselNextButton,
332
- onPress: Y,
333
- disabled: !pe,
334
- children: /* @__PURE__ */ s(se, {})
333
+ children: /* @__PURE__ */ s(T, {
334
+ className: Ze,
335
+ "aria-label": A.carouselNextButton,
336
+ onPress: H,
337
+ disabled: !Ie,
338
+ children: /* @__PURE__ */ s(re, {})
335
339
  })
336
340
  })
337
341
  ]
338
342
  }),
339
343
  V && /* @__PURE__ */ s("div", {
340
- className: $e,
344
+ className: F(et, {
345
+ [tt]: Q <= 1,
346
+ [ot]: Y <= 1,
347
+ [st]: K <= 1
348
+ }),
341
349
  children: V
342
350
  })
343
351
  ]
344
- });
345
- }, It = (e)=>/* @__PURE__ */ s(fe, _object_spread({}, e)), Pt = (param)=>/* @__PURE__ */ {
346
- let { items: e, itemStyle: r, itemClassName: t, withBullets: o, renderBullets: h, initialActiveItem: m, onPageChange: b, dataAttributes: f } = param;
347
- return s(fe, {
352
+ }));
353
+ }, Pt = (e)=>/* @__PURE__ */ s(be, _object_spread({}, e)), Nt = (param)=>{
354
+ let { items: e, itemStyle: t, itemClassName: o, withBullets: l, renderBullets: h, initialActiveItem: m, onPageChange: I, dataAttributes: p } = param;
355
+ return /* @__PURE__ */ s(be, {
348
356
  items: e,
349
- itemStyle: r,
350
- itemClassName: t,
357
+ itemStyle: t,
358
+ itemClassName: o,
351
359
  itemsPerPage: {
352
360
  mobile: 1,
353
361
  tablet: 1,
@@ -356,125 +364,125 @@ const ie = (e, r)=>{
356
364
  centered: !0,
357
365
  itemsToScroll: 1,
358
366
  gap: 0,
359
- withBullets: o,
367
+ withBullets: l,
360
368
  renderBullets: h,
361
369
  initialActiveItem: m,
362
- onPageChange: b,
363
- dataAttributes: f
370
+ onPageChange: I,
371
+ dataAttributes: p
364
372
  });
365
- }, de = /*#__PURE__*/ n.createContext(!1), xt = ()=>n.useContext(de), et = (param)=>/* @__PURE__ */ {
373
+ }, pe = /*#__PURE__*/ c.createContext(!1), Bt = ()=>c.useContext(pe), at = (param)=>{
366
374
  let { children: e } = param;
367
- return s(de.Provider, {
375
+ return /* @__PURE__ */ s(pe.Provider, {
368
376
  value: !0,
369
377
  children: e
370
378
  });
371
- }, wt = (param)=>{
372
- let { items: e, withBullets: r, autoplay: t, onPageChange: o, dataAttributes: h, inverseBullets: m = !0 } = param;
373
- const { texts: b, platformOverrides: f } = re(), p = n.useRef(null), [{ scrollLeft: N, scrollRight: R }, A] = n.useState({
379
+ }, Lt = (param)=>{
380
+ let { items: e, withBullets: t, autoplay: o, onPageChange: l, dataAttributes: h, inverseBullets: m = !0 } = param;
381
+ const { texts: I, platformOverrides: p } = ce(), n = c.useRef(null), [{ scrollLeft: S, scrollRight: N }, B] = c.useState({
374
382
  scrollLeft: 0,
375
383
  scrollRight: 0
376
- }), v = n.useCallback(()=>{
377
- const c = p.current;
378
- c && c.scrollBy({
379
- left: -c.clientWidth,
384
+ }), g = c.useCallback(()=>{
385
+ const a = n.current;
386
+ a && a.scrollBy({
387
+ left: -a.clientWidth,
380
388
  behavior: "smooth"
381
389
  });
382
- }, []), P = n.useCallback(()=>{
383
- const c = p.current;
384
- c && c.scrollBy({
385
- left: c.clientWidth,
390
+ }, []), x = c.useCallback(()=>{
391
+ const a = n.current;
392
+ a && a.scrollBy({
393
+ left: a.clientWidth,
386
394
  behavior: "smooth"
387
395
  });
388
- }, []), F = R !== 0, T = N !== 0, x = p.current ? Math.floor((N + p.current.clientWidth / 2) / p.current.clientWidth) : 0;
389
- n.useLayoutEffect(()=>{
390
- const c = p.current;
391
- if (c) {
396
+ }, []), U = N !== 0, A = S !== 0, M = n.current ? Math.floor((S + n.current.clientWidth / 2) / n.current.clientWidth) : 0;
397
+ c.useLayoutEffect(()=>{
398
+ const a = n.current;
399
+ if (a) {
392
400
  const i = ()=>{
393
- const { scrollWidth: C, clientWidth: U } = c, I = Math.round(c.scrollLeft), g = Math.round(C - (I + U));
394
- A({
395
- scrollLeft: I,
396
- scrollRight: g
401
+ const { scrollWidth: k, clientWidth: q } = a, v = Math.round(a.scrollLeft), b = Math.round(k - (v + q));
402
+ B({
403
+ scrollLeft: v,
404
+ scrollRight: b
397
405
  });
398
406
  };
399
- i(), c.addEventListener("scroll", i);
400
- const w = le(c, i);
407
+ i(), a.addEventListener("scroll", i);
408
+ const C = ie(a, i);
401
409
  return ()=>{
402
- c.removeEventListener("scroll", i), w();
410
+ a.removeEventListener("scroll", i), C();
403
411
  };
404
412
  }
405
413
  }, [
406
414
  e.length
407
415
  ]);
408
- const y = ie(!!t, p);
409
- return n.useEffect(()=>{
410
- if (y && t) {
411
- const c = typeof t == "boolean" ? ue : t.time, i = typeof t == "object" && t.loop, w = setInterval(()=>{
412
- var C;
413
- R !== 0 ? P() : i && ((C = p.current) == null || C.scrollTo({
416
+ const E = de(!!o, n);
417
+ return c.useEffect(()=>{
418
+ if (E && o) {
419
+ const a = typeof o == "boolean" ? me : o.time, i = typeof o == "object" && o.loop, C = setInterval(()=>{
420
+ var k;
421
+ N !== 0 ? x() : i && ((k = n.current) == null || k.scrollTo({
414
422
  left: 0,
415
423
  behavior: "smooth"
416
424
  }));
417
- }, c);
418
- return ()=>clearInterval(w);
425
+ }, a);
426
+ return ()=>clearInterval(C);
419
427
  }
420
428
  }, [
421
- t,
422
- P,
423
- R,
424
- y
425
- ]), n.useEffect(()=>{
426
- o && o(x);
427
- }, [
429
+ o,
428
430
  x,
429
- o
430
- ]), /* @__PURE__ */ s(et, {
431
- children: /* @__PURE__ */ $("div", _object_spread_props(_object_spread({
432
- className: Be
433
- }, Ce(h, "SlideShow")), {
431
+ N,
432
+ E
433
+ ]), c.useEffect(()=>{
434
+ l && l(M);
435
+ }, [
436
+ M,
437
+ l
438
+ ]), /* @__PURE__ */ s(at, {
439
+ children: /* @__PURE__ */ J("div", _object_spread_props(_object_spread({
440
+ className: De
441
+ }, ae(h, "SlideShow")), {
434
442
  children: [
435
- /* @__PURE__ */ s(E, {
443
+ /* @__PURE__ */ s(R, {
436
444
  isInverse: !1,
437
- children: /* @__PURE__ */ s(M, {
438
- className: Ee,
439
- "aria-label": b.carouselPrevButton,
440
- onPress: v,
441
- disabled: !T,
442
- children: /* @__PURE__ */ s(te, {})
445
+ children: /* @__PURE__ */ s(T, {
446
+ className: Oe,
447
+ "aria-label": I.carouselPrevButton,
448
+ onPress: g,
449
+ disabled: !A,
450
+ children: /* @__PURE__ */ s(le, {})
443
451
  })
444
452
  }),
445
453
  /* @__PURE__ */ s("div", {
446
- style: ce({
447
- [Ge.mediaBorderRadius]: "0px"
454
+ style: fe({
455
+ [lt.mediaBorderRadius]: "0px"
448
456
  }),
449
457
  children: /* @__PURE__ */ s("div", {
450
- className: Me,
451
- ref: p,
452
- children: e.map((c, i)=>/* @__PURE__ */ s("div", {
453
- className: Te,
458
+ className: Ve,
459
+ ref: n,
460
+ children: e.map((a, i)=>/* @__PURE__ */ s("div", {
461
+ className: ze,
454
462
  style: {
455
- scrollSnapStop: ne(f) ? "always" : "normal"
463
+ scrollSnapStop: ue(p) ? "always" : "normal"
456
464
  },
457
- children: c
465
+ children: a
458
466
  }, i))
459
467
  })
460
468
  }),
461
- /* @__PURE__ */ s(E, {
469
+ /* @__PURE__ */ s(R, {
462
470
  isInverse: !1,
463
- children: /* @__PURE__ */ s(M, {
464
- className: ye,
465
- "aria-label": b.carouselNextButton,
466
- onPress: P,
467
- disabled: !F,
468
- children: /* @__PURE__ */ s(se, {})
471
+ children: /* @__PURE__ */ s(T, {
472
+ className: _e,
473
+ "aria-label": I.carouselNextButton,
474
+ onPress: x,
475
+ disabled: !U,
476
+ children: /* @__PURE__ */ s(re, {})
469
477
  })
470
478
  }),
471
- r && e.length > 1 && /* @__PURE__ */ s(E, {
479
+ t && e.length > 1 && /* @__PURE__ */ s(R, {
472
480
  isInverse: m,
473
481
  children: /* @__PURE__ */ s("div", {
474
- className: We,
475
- children: /* @__PURE__ */ s(ae, {
482
+ className: je,
483
+ children: /* @__PURE__ */ s(he, {
476
484
  numPages: e.length,
477
- currentIndex: x
485
+ currentIndex: M
478
486
  })
479
487
  })
480
488
  })
@@ -482,4 +490,4 @@ const ie = (e, r)=>{
482
490
  }))
483
491
  });
484
492
  };
485
- export { It as Carousel, Pt as CenteredCarousel, et as IsInsideSlideshowProvider, ae as PageBullets, wt as Slideshow, xt as useIsInsideSlideshowContext };
493
+ export { Pt as Carousel, Nt as CenteredCarousel, at as IsInsideSlideshowProvider, he as PageBullets, Lt as Slideshow, Bt as useIsInsideSlideshowContext };