@telefonica/mistica 14.31.0 → 14.32.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.
@@ -54,31 +54,31 @@ import { jsx as s, jsxs as G } from "react/jsx-runtime";
54
54
  import * as n from "react";
55
55
  import te from "./generated/mistica-icons/icon-chevron-left-regular.js";
56
56
  import se from "./generated/mistica-icons/icon-chevron-right-regular.js";
57
- import { useScreenSize as oe, useTheme as re, useIsInViewport as xe, useIsomorphicLayoutEffect as we } from "./hooks.js";
58
- import Se from "./inline.js";
59
- import ke from "./stack.js";
57
+ import { useScreenSize as oe, useTheme as re, useIsInViewport as xe } from "./hooks.js";
58
+ import we from "./inline.js";
59
+ import Se from "./stack.js";
60
60
  import { BaseTouchable as E } from "./touchable.js";
61
61
  import Z from "classnames";
62
- import { useIsInverseVariant as Ne, ThemeVariant as B } from "./theme-variant-context.js";
63
- import { MediaBorderRadiusProvider as Le } from "./image.js";
62
+ import { useIsInverseVariant as ke, ThemeVariant as B } from "./theme-variant-context.js";
63
+ import { MediaBorderRadiusProvider as Ne } from "./image.js";
64
64
  import { listenResize as le, getPrefixedDataAttributes as Ce } from "./utils/dom.js";
65
- import { isAndroid as ne, isIos as Re, isRunningAcceptanceTest as Ae } from "./utils/platform.js";
66
- import { useDocumentVisibility as Me } from "./utils/document-visibility.js";
67
- import { slideshowContainer as Be, slideshowPrevArrowButton as Ee, slideshow as Te, slideshowItem as ye, slideshowNextArrowButton as We, slideshowBullets as Oe, bulletActiveInverse as De, bulletInverse as Ve, bulletActive as ze, bullet as _e, carouselContainer as je, carouselPrevArrowButton as Fe, carousel as Ue, centeredCarousel as qe, carouselWithScroll as Ke, vars as C, carouselItem as Ye, carouselNextArrowButton as Ge, carouselBullets as He } from "./carousel.css-mistica.js";
68
- import { assignInlineVars as Je } from "@vanilla-extract/dynamic";
69
- import { sprinkles as Qe } from "./sprinkles.css-mistica.js";
70
- import { useDesktopContainerType as Xe } from "./desktop-container-type-context.js";
71
- import { VIVO_NEW_SKIN as Ze } from "./skins/constants.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 Me, slideshowPrevArrowButton as Be, slideshow as Ee, 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 Ge } from "./carousel.css-mistica.js";
68
+ import { assignInlineVars as He } from "@vanilla-extract/dynamic";
69
+ import { sprinkles as Je } from "./sprinkles.css-mistica.js";
70
+ import { useDesktopContainerType as Qe } from "./desktop-container-type-context.js";
71
+ import { VIVO_NEW_SKIN as Xe } from "./skins/constants.js";
72
72
  const ce = (e, r)=>{
73
- const t = Me();
73
+ const t = Ae();
74
74
  return xe(r, !1) && t && !!e;
75
75
  }, ie = (param)=>{
76
76
  let { currentIndex: e , numPages: r , onPress: t } = param;
77
- const o = Ne(), { isDesktopOrBigger: f } = oe(), m = (b)=>{
77
+ const o = ke(), { isDesktopOrBigger: f } = oe(), m = (b)=>{
78
78
  const d = b === e;
79
- return o ? d ? De : Ve : d ? ze : _e;
79
+ return o ? d ? Oe : De : d ? Ve : ze;
80
80
  };
81
- return /* @__PURE__ */ s(Se, {
81
+ return /* @__PURE__ */ s(we, {
82
82
  space: f ? 16 : 8,
83
83
  alignItems: "center",
84
84
  dataAttributes: {
@@ -87,7 +87,7 @@ const ce = (e, r)=>{
87
87
  children: Array.from({
88
88
  length: r
89
89
  }, (b, d)=>/* @__PURE__ */ s(E, {
90
- className: Qe({
90
+ className: Je({
91
91
  display: "block",
92
92
  padding: 0,
93
93
  border: "none",
@@ -100,7 +100,7 @@ const ce = (e, r)=>{
100
100
  })
101
101
  }, d))
102
102
  });
103
- }, $ = (e, r, t)=>t ? typeof t == "number" ? t : t[e] || r[e] : r[e], $e = (e, r)=>{
103
+ }, $ = (e, r, t)=>t ? typeof t == "number" ? t : t[e] || r[e] : r[e], Ze = (e, r)=>{
104
104
  const t = {
105
105
  mobile: 1,
106
106
  tablet: 2,
@@ -127,21 +127,21 @@ const ce = (e, r)=>{
127
127
  const t = Math.ceil(e.length / r), o = [];
128
128
  for(let f = 0; f < e.length; f += t)o.push(e[f]);
129
129
  return o[o.length - 1] = e[e.length - t], o;
130
- }, et = (e, r)=>{
130
+ }, $e = (e, r)=>{
131
131
  const t = [];
132
132
  for(let o = 0; o < r.length; o++)o === 0 ? t.push(r[0]) : t.push((r[o] + r[o - 1]) / 2);
133
133
  for(let o = t.length - 1; o >= 0; o--)if (e - t[o] >= -1) return o;
134
134
  return 0;
135
135
  }, ae = 5e3, ue = (param)=>{
136
136
  let { items: e , itemStyle: r , itemClassName: t , withBullets: o , renderBullets: f , initialActiveItem: m , itemsPerPage: b , itemsToScroll: d , mobilePageOffset: g , gap: N , free: R , centered: A , autoplay: v , onPageChange: P , dataAttributes: F } = param;
137
- const { texts: T , platformOverrides: x , skinName: y } = re(), c = Xe(), i = $e(c || "large", b), { isDesktopOrBigger: w , isTablet: L } = oe(), U = L ? i.tablet : i.mobile, I = Math.max(Math.floor(w ? i.desktop : U), 1), p = n.useRef(null), S = Math.ceil(e.length / I), [{ scrollLeft: H , scrollRight: q }, de] = n.useState({
137
+ const { texts: T , platformOverrides: x , skinName: y } = re(), c = Qe(), i = Ze(c || "large", b), { isDesktopOrBigger: w , isTablet: C } = oe(), U = C ? i.tablet : i.mobile, I = Math.max(Math.floor(w ? i.desktop : U), 1), p = n.useRef(null), S = Math.ceil(e.length / I), [{ scrollLeft: H , scrollRight: q }, de] = n.useState({
138
138
  scrollLeft: 0,
139
139
  scrollRight: 0
140
140
  }), [K, he] = n.useState([]), W = n.useMemo(()=>ee(K, S), [
141
141
  K,
142
142
  S
143
143
  ]), O = d ? ee(K, Math.ceil(e.length / d)) : W, me = q !== 0, ge = H !== 0;
144
- we(()=>{
144
+ n.useEffect(()=>{
145
145
  if (p.current) {
146
146
  const l = p.current, a = ()=>{
147
147
  const { scrollWidth: z , clientWidth: M } = l, _ = Math.round(l.scrollLeft), j = Math.round(z - (_ + M));
@@ -236,7 +236,7 @@ const ce = (e, r)=>{
236
236
  q,
237
237
  J
238
238
  ]);
239
- const k = et(H, W), Q = n.useRef(!m), X = n.useRef(0);
239
+ const k = $e(H, W), Q = n.useRef(!m), X = n.useRef(0);
240
240
  n.useEffect(()=>{
241
241
  if (P) {
242
242
  const l = Math.min((k + 1) * I - 1, e.length - 1), a = [];
@@ -267,19 +267,19 @@ const ce = (e, r)=>{
267
267
  onPress: D
268
268
  }));
269
269
  const be = "64px", ve = "36px";
270
- return /* @__PURE__ */ G(ke, {
270
+ return /* @__PURE__ */ G(Se, {
271
271
  space: 24,
272
272
  dataAttributes: _object_spread({
273
273
  "component-name": "Carousel"
274
274
  }, F),
275
275
  children: [
276
276
  /* @__PURE__ */ G("div", {
277
- className: je,
277
+ className: _e,
278
278
  children: [
279
279
  /* @__PURE__ */ s(B, {
280
280
  isInverse: !1,
281
281
  children: /* @__PURE__ */ s(E, {
282
- className: Fe,
282
+ className: je,
283
283
  "aria-label": T.carouselPrevButton,
284
284
  onPress: pe,
285
285
  disabled: !ge,
@@ -287,20 +287,20 @@ const ce = (e, r)=>{
287
287
  })
288
288
  }),
289
289
  /* @__PURE__ */ s("div", {
290
- className: Z(Ue, {
291
- [qe]: A,
292
- [Ke]: S > 1
290
+ className: Z(Fe, {
291
+ [Ue]: A,
292
+ [qe]: S > 1
293
293
  }),
294
- style: _object_spread_props(_object_spread({}, Je(_object_spread({
295
- [C.itemsPerPageDesktop]: String(i.desktop),
296
- [C.itemsPerPageTablet]: String(i.tablet),
297
- [C.itemsPerPageMobile]: String(i.mobile)
294
+ style: _object_spread_props(_object_spread({}, He(_object_spread({
295
+ [L.itemsPerPageDesktop]: String(i.desktop),
296
+ [L.itemsPerPageTablet]: String(i.tablet),
297
+ [L.itemsPerPageMobile]: String(i.mobile)
298
298
  }, g === "large" ? {
299
- [C.mobilePageOffset]: be
300
- } : y === Ze ? {
301
- [C.mobilePageOffset]: ve
299
+ [L.mobilePageOffset]: be
300
+ } : y === Xe ? {
301
+ [L.mobilePageOffset]: ve
302
302
  } : {}, N !== void 0 ? {
303
- [C.gap]: String(N)
303
+ [L.gap]: String(N)
304
304
  } : {}))), {
305
305
  scrollSnapType: R ? "initial" : "x mandatory",
306
306
  // Hack to fix https://jira.tid.es/browse/NOVUMCC-8988
@@ -308,11 +308,11 @@ const ce = (e, r)=>{
308
308
  // the bottom of the scrollable area in retina displays when it has a height with
309
309
  // decimals. This extra padding avoids that line to partially cover the carousel
310
310
  // slides border:
311
- paddingBottom: Re(x) && !Ae(x) ? 0.5 : void 0
311
+ paddingBottom: Le(x) && !Re(x) ? 0.5 : void 0
312
312
  }),
313
313
  ref: p,
314
314
  children: e.map((l, a)=>/* @__PURE__ */ s("div", {
315
- className: Z(Ye, t),
315
+ className: Z(Ke, t),
316
316
  style: _object_spread_props(_object_spread({}, r), {
317
317
  scrollSnapStop: ne(x) ? "always" : "normal"
318
318
  }),
@@ -323,7 +323,7 @@ const ce = (e, r)=>{
323
323
  /* @__PURE__ */ s(B, {
324
324
  isInverse: !1,
325
325
  children: /* @__PURE__ */ s(E, {
326
- className: Ge,
326
+ className: Ye,
327
327
  "aria-label": T.carouselNextButton,
328
328
  onPress: Y,
329
329
  disabled: !me,
@@ -333,12 +333,12 @@ const ce = (e, r)=>{
333
333
  ]
334
334
  }),
335
335
  V && /* @__PURE__ */ s("div", {
336
- className: He,
336
+ className: Ge,
337
337
  children: V
338
338
  })
339
339
  ]
340
340
  });
341
- }, Pt = (e)=>/* @__PURE__ */ s(ue, _object_spread({}, e)), xt = (param)=>/* @__PURE__ */ {
341
+ }, It = (e)=>/* @__PURE__ */ s(ue, _object_spread({}, e)), Pt = (param)=>/* @__PURE__ */ {
342
342
  let { items: e , itemStyle: r , itemClassName: t , withBullets: o , renderBullets: f , initialActiveItem: m , onPageChange: b , dataAttributes: d } = param;
343
343
  return s(ue, {
344
344
  items: e,
@@ -358,13 +358,13 @@ const ce = (e, r)=>{
358
358
  onPageChange: b,
359
359
  dataAttributes: d
360
360
  });
361
- }, fe = /*#__PURE__*/ n.createContext(!1), wt = ()=>n.useContext(fe), tt = (param)=>/* @__PURE__ */ {
361
+ }, fe = /*#__PURE__*/ n.createContext(!1), xt = ()=>n.useContext(fe), et = (param)=>/* @__PURE__ */ {
362
362
  let { children: e } = param;
363
363
  return s(fe.Provider, {
364
364
  value: !0,
365
365
  children: e
366
366
  });
367
- }, St = (param)=>{
367
+ }, wt = (param)=>{
368
368
  let { items: e , withBullets: r , autoplay: t , onPageChange: o , dataAttributes: f , inverseBullets: m = !0 } = param;
369
369
  const { texts: b , platformOverrides: d } = re(), g = n.useRef(null), [{ scrollLeft: N , scrollRight: R }, A] = n.useState({
370
370
  scrollLeft: 0,
@@ -386,7 +386,7 @@ const ce = (e, r)=>{
386
386
  const c = g.current;
387
387
  if (c) {
388
388
  const i = ()=>{
389
- const { scrollWidth: L , clientWidth: U } = c, I = Math.round(c.scrollLeft), p = Math.round(L - (I + U));
389
+ const { scrollWidth: C , clientWidth: U } = c, I = Math.round(c.scrollLeft), p = Math.round(C - (I + U));
390
390
  A({
391
391
  scrollLeft: I,
392
392
  scrollRight: p
@@ -405,8 +405,8 @@ const ce = (e, r)=>{
405
405
  return n.useEffect(()=>{
406
406
  if (y && t) {
407
407
  const c = typeof t == "boolean" ? ae : t.time, i = typeof t == "object" && t.loop, w = setInterval(()=>{
408
- var L;
409
- R !== 0 ? P() : i && ((L = g.current) == null || L.scrollTo({
408
+ var C;
409
+ R !== 0 ? P() : i && ((C = g.current) == null || C.scrollTo({
410
410
  left: 0,
411
411
  behavior: "smooth"
412
412
  }));
@@ -423,28 +423,28 @@ const ce = (e, r)=>{
423
423
  }, [
424
424
  x,
425
425
  o
426
- ]), /* @__PURE__ */ s(tt, {
426
+ ]), /* @__PURE__ */ s(et, {
427
427
  children: /* @__PURE__ */ G("div", _object_spread_props(_object_spread({
428
- className: Be
428
+ className: Me
429
429
  }, Ce(f, "SlideShow")), {
430
430
  children: [
431
431
  /* @__PURE__ */ s(B, {
432
432
  isInverse: !1,
433
433
  children: /* @__PURE__ */ s(E, {
434
- className: Ee,
434
+ className: Be,
435
435
  "aria-label": b.carouselPrevButton,
436
436
  onPress: v,
437
437
  disabled: !T,
438
438
  children: /* @__PURE__ */ s(te, {})
439
439
  })
440
440
  }),
441
- /* @__PURE__ */ s(Le, {
441
+ /* @__PURE__ */ s(Ne, {
442
442
  value: !1,
443
443
  children: /* @__PURE__ */ s("div", {
444
- className: Te,
444
+ className: Ee,
445
445
  ref: g,
446
446
  children: e.map((c, i)=>/* @__PURE__ */ s("div", {
447
- className: ye,
447
+ className: Te,
448
448
  style: {
449
449
  scrollSnapStop: ne(d) ? "always" : "normal"
450
450
  },
@@ -455,7 +455,7 @@ const ce = (e, r)=>{
455
455
  /* @__PURE__ */ s(B, {
456
456
  isInverse: !1,
457
457
  children: /* @__PURE__ */ s(E, {
458
- className: We,
458
+ className: ye,
459
459
  "aria-label": b.carouselNextButton,
460
460
  onPress: P,
461
461
  disabled: !F,
@@ -465,7 +465,7 @@ const ce = (e, r)=>{
465
465
  r && e.length > 1 && /* @__PURE__ */ s(B, {
466
466
  isInverse: m,
467
467
  children: /* @__PURE__ */ s("div", {
468
- className: Oe,
468
+ className: We,
469
469
  children: /* @__PURE__ */ s(ie, {
470
470
  numPages: e.length,
471
471
  currentIndex: x
@@ -476,4 +476,4 @@ const ce = (e, r)=>{
476
476
  }))
477
477
  });
478
478
  };
479
- export { Pt as Carousel, xt as CenteredCarousel, tt as IsInsideSlideshowProvider, ie as PageBullets, St as Slideshow, wt as useIsInsideSlideshowContext };
479
+ export { It as Carousel, Pt as CenteredCarousel, et as IsInsideSlideshowProvider, ie as PageBullets, wt as Slideshow, xt as useIsInsideSlideshowContext };
@@ -1,7 +1,7 @@
1
1
  import "../sprinkles.css.ts.vanilla.css-mistica.js";
2
2
  import "./advanced-data-card.css.ts.vanilla.css-mistica.js";
3
- var _ = "_1x00fru3 _1x00fru1 _1y2v1nf90 _1y2v1nfa9 _1y2v1nfba _1y2v1nfbw _1y2v1nfbm _1y2v1nf7x", v = {
4
- default: "_1x00frui",
5
- mobile: "_1x00fruj"
6
- }, a = "_1x00frup", n = "_1x00frul", t = "_1x00frum _1x00frul", u = "_1x00fru8 _1x00fru1 _1y2v1nf90 _1y2v1nfa9 _1y2v1nf6c _1y2v1nf7x _1y2v1nfb4", y = "_1x00frub _1y2v1nfb4 _1y2v1nfba _1y2v1nfbw _1y2v1nfbg _1y2v1nfbx _1y2v1nfce _1x00fru9", x = "_1x00frug", o = "_1x00fruo _1y2v1nfba _1y2v1nfbf", b = "_1y2v1nfba _1y2v1nfbw _1y2v1nfbp _1y2v1nfdj", i = "_1x00fruk", e = "_1y2v1nfff", d = "_1x00fru9", l = "_1x00fru1 _1y2v1nf90 _1y2v1nfa9", c = "_1x00fru5", g = "_1x00fru6", m = "_1x00fru4";
7
- export { _ as actions, v as actionsVariants, a as adjustButtonLink, n as button, t as buttonMobile, u as cardContentStyle, y as dataCard, x as divider, o as footerDirection, b as footerText, i as marginRightAuto, e as marginRightButton, d as minHeight, l as paddingX, c as touchable, g as touchableCardOverlay, m as touchableContainer };
3
+ var a = "_1x00fru3 _1x00fru1 _1y2v1nf90 _1y2v1nfa9 _1y2v1nfba _1y2v1nfbw _1y2v1nfbm _1y2v1nf7x", _ = {
4
+ default: "_1x00fruk",
5
+ mobile: "_1x00frul"
6
+ }, n = "_1x00frur", v = "_1x00frun", t = "_1x00fruo _1x00frun", u = "_1x00fru9 _1x00fru1 _1y2v1nf90 _1y2v1nfa9 _1y2v1nf6c _1y2v1nf7x", x = "_1x00frud _1y2v1nfb4 _1y2v1nfba _1y2v1nfbw _1y2v1nfbg _1y2v1nfbx _1y2v1nfce _1x00frub", y = "_1x00frui", o = "_1x00fruq _1y2v1nfba _1y2v1nfbf", b = "_1y2v1nfba _1y2v1nfbw _1y2v1nfbp _1y2v1nfdj", i = "_1x00frum", e = "_1y2v1nfff", d = "_1x00frub", c = "_1x00fru1 _1y2v1nf90 _1y2v1nfa9", l = "_1x00fru4", m = "_1x00fru7", g = "_1x00fru5", h = "_1x00frua";
7
+ export { a as actions, _ as actionsVariants, n as adjustButtonLink, v as button, t as buttonMobile, u as cardContentStyle, x as dataCard, y as divider, o as footerDirection, b as footerText, i as marginRightAuto, e as marginRightButton, d as minHeight, c as paddingX, l as touchableArea, m as touchableCardOverlay, g as touchableContainer, h as zindex };