@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.
- package/css/mistica.css +1 -1
- package/dist/carousel.js +17 -17
- package/dist/community/advanced-data-card.css-mistica.js +18 -15
- package/dist/community/advanced-data-card.css.d.ts +2 -0
- package/dist/community/advanced-data-card.d.ts +10 -3
- package/dist/community/advanced-data-card.js +191 -130
- package/dist/package-version.js +1 -1
- package/dist-es/carousel.js +55 -55
- package/dist-es/community/advanced-data-card.css-mistica.js +5 -5
- package/dist-es/community/advanced-data-card.js +219 -158
- package/dist-es/package-version.js +1 -1
- package/dist-es/style.css +1 -1
- package/package.json +1 -1
package/dist-es/carousel.js
CHANGED
|
@@ -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
|
|
58
|
-
import
|
|
59
|
-
import
|
|
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
|
|
63
|
-
import { MediaBorderRadiusProvider as
|
|
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
|
|
66
|
-
import { useDocumentVisibility as
|
|
67
|
-
import { slideshowContainer as
|
|
68
|
-
import { assignInlineVars as
|
|
69
|
-
import { sprinkles as
|
|
70
|
-
import { useDesktopContainerType as
|
|
71
|
-
import { VIVO_NEW_SKIN as
|
|
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 =
|
|
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 =
|
|
77
|
+
const o = ke(), { isDesktopOrBigger: f } = oe(), m = (b)=>{
|
|
78
78
|
const d = b === e;
|
|
79
|
-
return o ? d ?
|
|
79
|
+
return o ? d ? Oe : De : d ? Ve : ze;
|
|
80
80
|
};
|
|
81
|
-
return /* @__PURE__ */ s(
|
|
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:
|
|
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],
|
|
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
|
-
},
|
|
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 =
|
|
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
|
-
|
|
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 =
|
|
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(
|
|
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:
|
|
277
|
+
className: _e,
|
|
278
278
|
children: [
|
|
279
279
|
/* @__PURE__ */ s(B, {
|
|
280
280
|
isInverse: !1,
|
|
281
281
|
children: /* @__PURE__ */ s(E, {
|
|
282
|
-
className:
|
|
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(
|
|
291
|
-
[
|
|
292
|
-
[
|
|
290
|
+
className: Z(Fe, {
|
|
291
|
+
[Ue]: A,
|
|
292
|
+
[qe]: S > 1
|
|
293
293
|
}),
|
|
294
|
-
style: _object_spread_props(_object_spread({},
|
|
295
|
-
[
|
|
296
|
-
[
|
|
297
|
-
[
|
|
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
|
-
[
|
|
300
|
-
} : y ===
|
|
301
|
-
[
|
|
299
|
+
[L.mobilePageOffset]: be
|
|
300
|
+
} : y === Xe ? {
|
|
301
|
+
[L.mobilePageOffset]: ve
|
|
302
302
|
} : {}, N !== void 0 ? {
|
|
303
|
-
[
|
|
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:
|
|
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(
|
|
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:
|
|
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:
|
|
336
|
+
className: Ge,
|
|
337
337
|
children: V
|
|
338
338
|
})
|
|
339
339
|
]
|
|
340
340
|
});
|
|
341
|
-
},
|
|
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),
|
|
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
|
-
},
|
|
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:
|
|
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
|
|
409
|
-
R !== 0 ? P() : i && ((
|
|
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(
|
|
426
|
+
]), /* @__PURE__ */ s(et, {
|
|
427
427
|
children: /* @__PURE__ */ G("div", _object_spread_props(_object_spread({
|
|
428
|
-
className:
|
|
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:
|
|
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(
|
|
441
|
+
/* @__PURE__ */ s(Ne, {
|
|
442
442
|
value: !1,
|
|
443
443
|
children: /* @__PURE__ */ s("div", {
|
|
444
|
-
className:
|
|
444
|
+
className: Ee,
|
|
445
445
|
ref: g,
|
|
446
446
|
children: e.map((c, i)=>/* @__PURE__ */ s("div", {
|
|
447
|
-
className:
|
|
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:
|
|
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:
|
|
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 {
|
|
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
|
|
4
|
-
default: "
|
|
5
|
-
mobile: "
|
|
6
|
-
},
|
|
7
|
-
export {
|
|
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 };
|