@telefonica/mistica 14.25.0 → 14.26.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/accordion.css-mistica.js +41 -0
- package/dist/accordion.css.d.ts +12 -0
- package/dist/accordion.css.ts.vanilla.css-mistica.js +11 -0
- package/dist/accordion.d.ts +47 -0
- package/dist/accordion.js +350 -0
- package/dist/boxed.d.ts +1 -0
- package/dist/boxed.js +17 -16
- package/dist/card.js +345 -345
- package/dist/carousel.js +58 -52
- package/dist/checkbox.css.d.ts +1 -1
- package/dist/checkbox.d.ts +3 -1
- package/dist/checkbox.js +23 -22
- package/dist/community/blocks.js +3 -2
- package/dist/form-context.d.ts +9 -9
- package/dist/generated/mistica-icons/icons-keywords.d.ts +4 -0
- package/dist/icons/icon-chevron.d.ts +1 -0
- package/dist/icons/icon-chevron.js +21 -18
- package/dist/index.d.ts +4 -2
- package/dist/index.js +30 -4
- package/dist/integer-field.d.ts +5 -1
- package/dist/integer-field.js +12 -11
- package/dist/list.d.ts +8 -0
- package/dist/list.js +3 -0
- package/dist/menu.css-mistica.js +30 -6
- package/dist/menu.css.d.ts +14 -2
- package/dist/menu.d.ts +25 -3
- package/dist/menu.js +264 -84
- package/dist/overlay.js +11 -52
- package/dist/overscroll-color-context.js +23 -11
- package/dist/package-version.js +1 -1
- package/dist/pin-field.css-mistica.js +37 -0
- package/dist/pin-field.css.d.ts +7 -0
- package/dist/pin-field.css.ts.vanilla.css-mistica.js +11 -0
- package/dist/pin-field.d.ts +25 -0
- package/dist/pin-field.js +269 -0
- package/dist/progress-bar.css-mistica.js +7 -4
- package/dist/progress-bar.css.d.ts +1 -0
- package/dist/progress-bar.d.ts +12 -3
- package/dist/progress-bar.js +109 -13
- package/dist/stepper.js +34 -27
- package/dist/text-field-base.css.d.ts +2 -0
- package/dist/text-field-base.d.ts +1 -0
- package/dist/text-field-components.js +28 -26
- package/dist/text-field.d.ts +1 -0
- package/dist/theme.d.ts +3 -0
- package/dist/theme.js +24 -12
- package/dist/touchable.js +5 -4
- package/dist/video.js +8 -9
- package/dist-es/accordion.css-mistica.js +9 -0
- package/dist-es/accordion.css.ts.vanilla.css-mistica.js +2 -0
- package/dist-es/accordion.js +280 -0
- package/dist-es/boxed.js +25 -24
- package/dist-es/card.js +475 -475
- package/dist-es/carousel.js +95 -89
- package/dist-es/checkbox.js +42 -41
- package/dist-es/community/blocks.js +2 -1
- package/dist-es/icons/icon-chevron.js +25 -22
- package/dist-es/index.js +1768 -1766
- package/dist-es/integer-field.js +14 -13
- package/dist-es/list.js +9 -9
- package/dist-es/menu.css-mistica.js +10 -4
- package/dist-es/menu.js +262 -93
- package/dist-es/overlay.js +18 -20
- package/dist-es/overscroll-color-context.js +30 -18
- package/dist-es/package-version.js +1 -1
- package/dist-es/pin-field.css-mistica.js +5 -0
- package/dist-es/pin-field.css.ts.vanilla.css-mistica.js +2 -0
- package/dist-es/pin-field.js +217 -0
- package/dist-es/progress-bar.css-mistica.js +2 -2
- package/dist-es/progress-bar.js +67 -18
- package/dist-es/stepper.js +61 -54
- package/dist-es/style.css +1 -1
- package/dist-es/text-field-components.js +38 -36
- package/dist-es/theme.js +24 -12
- package/dist-es/touchable.js +9 -8
- package/dist-es/video.js +16 -17
- package/package.json +1 -1
package/dist-es/carousel.js
CHANGED
|
@@ -57,26 +57,26 @@ import se from "./generated/mistica-icons/icon-chevron-right-regular.js";
|
|
|
57
57
|
import { useScreenSize as oe, useTheme as re, useIsInViewport as xe, useIsomorphicLayoutEffect as we } from "./hooks.js";
|
|
58
58
|
import Se from "./inline.js";
|
|
59
59
|
import ke from "./stack.js";
|
|
60
|
-
import { BaseTouchable as
|
|
60
|
+
import { BaseTouchable as E } from "./touchable.js";
|
|
61
61
|
import Z from "classnames";
|
|
62
|
-
import { useIsInverseVariant as Ne, ThemeVariant as
|
|
62
|
+
import { useIsInverseVariant as Ne, ThemeVariant as B } from "./theme-variant-context.js";
|
|
63
63
|
import { MediaBorderRadiusProvider as Le } from "./image.js";
|
|
64
64
|
import { listenResize as le, getPrefixedDataAttributes as Ce } from "./utils/dom.js";
|
|
65
|
-
import { isAndroid as ne } from "./utils/platform.js";
|
|
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 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";
|
|
72
72
|
const ce = (e, r)=>{
|
|
73
|
-
const t =
|
|
73
|
+
const t = Me();
|
|
74
74
|
return xe(r, !1) && t && !!e;
|
|
75
75
|
}, ie = (param)=>{
|
|
76
76
|
let { currentIndex: e , numPages: r , onPress: t } = param;
|
|
77
77
|
const o = Ne(), { isDesktopOrBigger: f } = oe(), m = (b)=>{
|
|
78
78
|
const d = b === e;
|
|
79
|
-
return o ? d ?
|
|
79
|
+
return o ? d ? De : Ve : d ? ze : _e;
|
|
80
80
|
};
|
|
81
81
|
return /* @__PURE__ */ s(Se, {
|
|
82
82
|
space: f ? 16 : 8,
|
|
@@ -86,8 +86,8 @@ const ce = (e, r)=>{
|
|
|
86
86
|
},
|
|
87
87
|
children: Array.from({
|
|
88
88
|
length: r
|
|
89
|
-
}, (b, d)=>/* @__PURE__ */ s(
|
|
90
|
-
className:
|
|
89
|
+
}, (b, d)=>/* @__PURE__ */ s(E, {
|
|
90
|
+
className: Qe({
|
|
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], $e = (e, r)=>{
|
|
104
104
|
const t = {
|
|
105
105
|
mobile: 1,
|
|
106
106
|
tablet: 2,
|
|
@@ -127,33 +127,33 @@ 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
|
+
}, et = (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
|
-
let { items: e , itemStyle: r , itemClassName: t , withBullets: o , renderBullets: f , initialActiveItem: m , itemsPerPage: b , itemsToScroll: d , mobilePageOffset: g , gap:
|
|
137
|
-
const { texts: T , platformOverrides:
|
|
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({
|
|
138
138
|
scrollLeft: 0,
|
|
139
139
|
scrollRight: 0
|
|
140
|
-
}), [K, he] = n.useState([]), W = n.useMemo(()=>ee(K,
|
|
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
|
we(()=>{
|
|
145
145
|
if (p.current) {
|
|
146
146
|
const l = p.current, a = ()=>{
|
|
147
|
-
const { scrollWidth: z , clientWidth:
|
|
147
|
+
const { scrollWidth: z , clientWidth: M } = l, _ = Math.round(l.scrollLeft), j = Math.round(z - (_ + M));
|
|
148
148
|
de({
|
|
149
149
|
scrollLeft: _,
|
|
150
150
|
scrollRight: j
|
|
151
151
|
});
|
|
152
152
|
}, u = ()=>{
|
|
153
153
|
const z = l.scrollWidth - l.clientWidth;
|
|
154
|
-
he(Array.from(l.querySelectorAll("[data-item]")).map((
|
|
154
|
+
he(Array.from(l.querySelectorAll("[data-item]")).map((M, _)=>{
|
|
155
155
|
if (_ === e.length - 1) return z;
|
|
156
|
-
const j =
|
|
156
|
+
const j = M.offsetLeft, Ie = parseInt(getComputedStyle(M).scrollMargin), Pe = A && !w ? j - M.clientWidth / 2 : j;
|
|
157
157
|
return Math.min(Pe - Ie - l.offsetLeft, z);
|
|
158
158
|
}));
|
|
159
159
|
};
|
|
@@ -170,10 +170,10 @@ const ce = (e, r)=>{
|
|
|
170
170
|
i.desktop,
|
|
171
171
|
i.tablet,
|
|
172
172
|
i.mobile,
|
|
173
|
+
S,
|
|
174
|
+
N,
|
|
175
|
+
A,
|
|
173
176
|
w,
|
|
174
|
-
k,
|
|
175
|
-
R,
|
|
176
|
-
x,
|
|
177
177
|
e.length
|
|
178
178
|
]);
|
|
179
179
|
const D = n.useCallback(function(l) {
|
|
@@ -236,21 +236,21 @@ const ce = (e, r)=>{
|
|
|
236
236
|
q,
|
|
237
237
|
J
|
|
238
238
|
]);
|
|
239
|
-
const
|
|
239
|
+
const k = et(H, W), Q = n.useRef(!m), X = n.useRef(0);
|
|
240
240
|
n.useEffect(()=>{
|
|
241
241
|
if (P) {
|
|
242
|
-
const l = Math.min((
|
|
242
|
+
const l = Math.min((k + 1) * I - 1, e.length - 1), a = [];
|
|
243
243
|
for(let u = 0; u < I; u++){
|
|
244
244
|
const h = l - u;
|
|
245
245
|
h >= 0 && a.unshift(h);
|
|
246
246
|
}
|
|
247
|
-
Q.current ? X.current !==
|
|
248
|
-
pageIndex:
|
|
247
|
+
Q.current ? X.current !== k && P({
|
|
248
|
+
pageIndex: k,
|
|
249
249
|
shownItemIndexes: a
|
|
250
|
-
}) : Q.current = a.includes(m || 0), X.current =
|
|
250
|
+
}) : Q.current = a.includes(m || 0), X.current = k;
|
|
251
251
|
}
|
|
252
252
|
}, [
|
|
253
|
-
|
|
253
|
+
k,
|
|
254
254
|
e.length,
|
|
255
255
|
I,
|
|
256
256
|
m,
|
|
@@ -258,12 +258,12 @@ const ce = (e, r)=>{
|
|
|
258
258
|
]);
|
|
259
259
|
let V = null;
|
|
260
260
|
f ? V = f({
|
|
261
|
-
numPages:
|
|
262
|
-
currentIndex:
|
|
261
|
+
numPages: S,
|
|
262
|
+
currentIndex: k,
|
|
263
263
|
onPress: D
|
|
264
|
-
}) : o && (V =
|
|
265
|
-
numPages:
|
|
266
|
-
currentIndex:
|
|
264
|
+
}) : o && (V = S > 1 && /* @__PURE__ */ s(ie, {
|
|
265
|
+
numPages: S,
|
|
266
|
+
currentIndex: k,
|
|
267
267
|
onPress: D
|
|
268
268
|
}));
|
|
269
269
|
const be = "64px", ve = "36px";
|
|
@@ -274,12 +274,12 @@ const ce = (e, r)=>{
|
|
|
274
274
|
}, F),
|
|
275
275
|
children: [
|
|
276
276
|
/* @__PURE__ */ G("div", {
|
|
277
|
-
className:
|
|
277
|
+
className: je,
|
|
278
278
|
children: [
|
|
279
|
-
/* @__PURE__ */ s(
|
|
279
|
+
/* @__PURE__ */ s(B, {
|
|
280
280
|
isInverse: !1,
|
|
281
|
-
children: /* @__PURE__ */ s(
|
|
282
|
-
className:
|
|
281
|
+
children: /* @__PURE__ */ s(E, {
|
|
282
|
+
className: Fe,
|
|
283
283
|
"aria-label": T.carouselPrevButton,
|
|
284
284
|
onPress: pe,
|
|
285
285
|
disabled: !ge,
|
|
@@ -287,37 +287,43 @@ const ce = (e, r)=>{
|
|
|
287
287
|
})
|
|
288
288
|
}),
|
|
289
289
|
/* @__PURE__ */ s("div", {
|
|
290
|
-
className: Z(
|
|
291
|
-
[
|
|
292
|
-
[
|
|
290
|
+
className: Z(Ue, {
|
|
291
|
+
[qe]: A,
|
|
292
|
+
[Ke]: S > 1
|
|
293
293
|
}),
|
|
294
|
-
style: _object_spread_props(_object_spread({},
|
|
295
|
-
[
|
|
296
|
-
[
|
|
297
|
-
[
|
|
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)
|
|
298
298
|
}, g === "large" ? {
|
|
299
|
-
[
|
|
300
|
-
} : y ===
|
|
301
|
-
[
|
|
302
|
-
} : {},
|
|
303
|
-
[
|
|
299
|
+
[C.mobilePageOffset]: be
|
|
300
|
+
} : y === Ze ? {
|
|
301
|
+
[C.mobilePageOffset]: ve
|
|
302
|
+
} : {}, N !== void 0 ? {
|
|
303
|
+
[C.gap]: String(N)
|
|
304
304
|
} : {}))), {
|
|
305
|
-
scrollSnapType:
|
|
305
|
+
scrollSnapType: R ? "initial" : "x mandatory",
|
|
306
|
+
// Hack to fix https://jira.tid.es/browse/NOVUMCC-8988
|
|
307
|
+
// there is a webkit rendering bug that causes a half pixel white line to appear at
|
|
308
|
+
// the bottom of the scrollable area in retina displays when it has a height with
|
|
309
|
+
// decimals. This extra padding avoids that line to partially cover the carousel
|
|
310
|
+
// slides border:
|
|
311
|
+
paddingBottom: Re(x) && !Ae(x) ? 0.5 : void 0
|
|
306
312
|
}),
|
|
307
313
|
ref: p,
|
|
308
314
|
children: e.map((l, a)=>/* @__PURE__ */ s("div", {
|
|
309
|
-
className: Z(
|
|
315
|
+
className: Z(Ye, t),
|
|
310
316
|
style: _object_spread_props(_object_spread({}, r), {
|
|
311
|
-
scrollSnapStop: ne(
|
|
317
|
+
scrollSnapStop: ne(x) ? "always" : "normal"
|
|
312
318
|
}),
|
|
313
319
|
"data-item": !0,
|
|
314
320
|
children: l
|
|
315
321
|
}, a))
|
|
316
322
|
}),
|
|
317
|
-
/* @__PURE__ */ s(
|
|
323
|
+
/* @__PURE__ */ s(B, {
|
|
318
324
|
isInverse: !1,
|
|
319
|
-
children: /* @__PURE__ */ s(
|
|
320
|
-
className:
|
|
325
|
+
children: /* @__PURE__ */ s(E, {
|
|
326
|
+
className: Ge,
|
|
321
327
|
"aria-label": T.carouselNextButton,
|
|
322
328
|
onPress: Y,
|
|
323
329
|
disabled: !me,
|
|
@@ -327,12 +333,12 @@ const ce = (e, r)=>{
|
|
|
327
333
|
]
|
|
328
334
|
}),
|
|
329
335
|
V && /* @__PURE__ */ s("div", {
|
|
330
|
-
className:
|
|
336
|
+
className: He,
|
|
331
337
|
children: V
|
|
332
338
|
})
|
|
333
339
|
]
|
|
334
340
|
});
|
|
335
|
-
},
|
|
341
|
+
}, Pt = (e)=>/* @__PURE__ */ s(ue, _object_spread({}, e)), xt = (param)=>/* @__PURE__ */ {
|
|
336
342
|
let { items: e , itemStyle: r , itemClassName: t , withBullets: o , renderBullets: f , initialActiveItem: m , onPageChange: b , dataAttributes: d } = param;
|
|
337
343
|
return s(ue, {
|
|
338
344
|
items: e,
|
|
@@ -352,15 +358,15 @@ const ce = (e, r)=>{
|
|
|
352
358
|
onPageChange: b,
|
|
353
359
|
dataAttributes: d
|
|
354
360
|
});
|
|
355
|
-
}, fe = /*#__PURE__*/ n.createContext(!1),
|
|
361
|
+
}, fe = /*#__PURE__*/ n.createContext(!1), wt = ()=>n.useContext(fe), tt = (param)=>/* @__PURE__ */ {
|
|
356
362
|
let { children: e } = param;
|
|
357
363
|
return s(fe.Provider, {
|
|
358
364
|
value: !0,
|
|
359
365
|
children: e
|
|
360
366
|
});
|
|
361
|
-
},
|
|
367
|
+
}, St = (param)=>{
|
|
362
368
|
let { items: e , withBullets: r , autoplay: t , onPageChange: o , dataAttributes: f , inverseBullets: m = !0 } = param;
|
|
363
|
-
const { texts: b , platformOverrides: d } = re(), g = n.useRef(null), [{ scrollLeft:
|
|
369
|
+
const { texts: b , platformOverrides: d } = re(), g = n.useRef(null), [{ scrollLeft: N , scrollRight: R }, A] = n.useState({
|
|
364
370
|
scrollLeft: 0,
|
|
365
371
|
scrollRight: 0
|
|
366
372
|
}), v = n.useCallback(()=>{
|
|
@@ -375,21 +381,21 @@ const ce = (e, r)=>{
|
|
|
375
381
|
left: c.clientWidth,
|
|
376
382
|
behavior: "smooth"
|
|
377
383
|
});
|
|
378
|
-
}, []), F =
|
|
384
|
+
}, []), F = R !== 0, T = N !== 0, x = g.current ? Math.floor((N + g.current.clientWidth / 2) / g.current.clientWidth) : 0;
|
|
379
385
|
n.useLayoutEffect(()=>{
|
|
380
386
|
const c = g.current;
|
|
381
387
|
if (c) {
|
|
382
388
|
const i = ()=>{
|
|
383
|
-
const { scrollWidth:
|
|
384
|
-
|
|
389
|
+
const { scrollWidth: L , clientWidth: U } = c, I = Math.round(c.scrollLeft), p = Math.round(L - (I + U));
|
|
390
|
+
A({
|
|
385
391
|
scrollLeft: I,
|
|
386
392
|
scrollRight: p
|
|
387
393
|
});
|
|
388
394
|
};
|
|
389
395
|
i(), c.addEventListener("scroll", i);
|
|
390
|
-
const
|
|
396
|
+
const w = le(c, i);
|
|
391
397
|
return ()=>{
|
|
392
|
-
c.removeEventListener("scroll", i),
|
|
398
|
+
c.removeEventListener("scroll", i), w();
|
|
393
399
|
};
|
|
394
400
|
}
|
|
395
401
|
}, [
|
|
@@ -398,34 +404,34 @@ const ce = (e, r)=>{
|
|
|
398
404
|
const y = ce(!!t, g);
|
|
399
405
|
return n.useEffect(()=>{
|
|
400
406
|
if (y && t) {
|
|
401
|
-
const c = typeof t == "boolean" ? ae : t.time, i = typeof t == "object" && t.loop,
|
|
402
|
-
var
|
|
403
|
-
|
|
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({
|
|
404
410
|
left: 0,
|
|
405
411
|
behavior: "smooth"
|
|
406
412
|
}));
|
|
407
413
|
}, c);
|
|
408
|
-
return ()=>clearInterval(
|
|
414
|
+
return ()=>clearInterval(w);
|
|
409
415
|
}
|
|
410
416
|
}, [
|
|
411
417
|
t,
|
|
412
418
|
P,
|
|
413
|
-
|
|
419
|
+
R,
|
|
414
420
|
y
|
|
415
421
|
]), n.useEffect(()=>{
|
|
416
|
-
o && o(
|
|
422
|
+
o && o(x);
|
|
417
423
|
}, [
|
|
418
|
-
|
|
424
|
+
x,
|
|
419
425
|
o
|
|
420
|
-
]), /* @__PURE__ */ s(
|
|
426
|
+
]), /* @__PURE__ */ s(tt, {
|
|
421
427
|
children: /* @__PURE__ */ G("div", _object_spread_props(_object_spread({
|
|
422
|
-
className:
|
|
428
|
+
className: Be
|
|
423
429
|
}, Ce(f, "SlideShow")), {
|
|
424
430
|
children: [
|
|
425
|
-
/* @__PURE__ */ s(
|
|
431
|
+
/* @__PURE__ */ s(B, {
|
|
426
432
|
isInverse: !1,
|
|
427
|
-
children: /* @__PURE__ */ s(
|
|
428
|
-
className:
|
|
433
|
+
children: /* @__PURE__ */ s(E, {
|
|
434
|
+
className: Ee,
|
|
429
435
|
"aria-label": b.carouselPrevButton,
|
|
430
436
|
onPress: v,
|
|
431
437
|
disabled: !T,
|
|
@@ -435,10 +441,10 @@ const ce = (e, r)=>{
|
|
|
435
441
|
/* @__PURE__ */ s(Le, {
|
|
436
442
|
value: !1,
|
|
437
443
|
children: /* @__PURE__ */ s("div", {
|
|
438
|
-
className:
|
|
444
|
+
className: Te,
|
|
439
445
|
ref: g,
|
|
440
446
|
children: e.map((c, i)=>/* @__PURE__ */ s("div", {
|
|
441
|
-
className:
|
|
447
|
+
className: ye,
|
|
442
448
|
style: {
|
|
443
449
|
scrollSnapStop: ne(d) ? "always" : "normal"
|
|
444
450
|
},
|
|
@@ -446,23 +452,23 @@ const ce = (e, r)=>{
|
|
|
446
452
|
}, i))
|
|
447
453
|
})
|
|
448
454
|
}),
|
|
449
|
-
/* @__PURE__ */ s(
|
|
455
|
+
/* @__PURE__ */ s(B, {
|
|
450
456
|
isInverse: !1,
|
|
451
|
-
children: /* @__PURE__ */ s(
|
|
452
|
-
className:
|
|
457
|
+
children: /* @__PURE__ */ s(E, {
|
|
458
|
+
className: We,
|
|
453
459
|
"aria-label": b.carouselNextButton,
|
|
454
460
|
onPress: P,
|
|
455
461
|
disabled: !F,
|
|
456
462
|
children: /* @__PURE__ */ s(se, {})
|
|
457
463
|
})
|
|
458
464
|
}),
|
|
459
|
-
r && e.length > 1 && /* @__PURE__ */ s(
|
|
465
|
+
r && e.length > 1 && /* @__PURE__ */ s(B, {
|
|
460
466
|
isInverse: m,
|
|
461
467
|
children: /* @__PURE__ */ s("div", {
|
|
462
|
-
className:
|
|
468
|
+
className: Oe,
|
|
463
469
|
children: /* @__PURE__ */ s(ie, {
|
|
464
470
|
numPages: e.length,
|
|
465
|
-
currentIndex:
|
|
471
|
+
currentIndex: x
|
|
466
472
|
})
|
|
467
473
|
})
|
|
468
474
|
})
|
|
@@ -470,4 +476,4 @@ const ce = (e, r)=>{
|
|
|
470
476
|
}))
|
|
471
477
|
});
|
|
472
478
|
};
|
|
473
|
-
export {
|
|
479
|
+
export { Pt as Carousel, xt as CenteredCarousel, tt as IsInsideSlideshowProvider, ie as PageBullets, St as Slideshow, wt as useIsInsideSlideshowContext };
|
package/dist-es/checkbox.js
CHANGED
|
@@ -50,75 +50,76 @@ function _object_spread_props(target, source) {
|
|
|
50
50
|
}
|
|
51
51
|
return target;
|
|
52
52
|
}
|
|
53
|
-
import { jsx as a, jsxs as
|
|
54
|
-
import * as
|
|
55
|
-
import { SPACE as
|
|
56
|
-
import { useControlProps as
|
|
57
|
-
import
|
|
58
|
-
import { Text3 as
|
|
59
|
-
import { useAriaId as
|
|
53
|
+
import { jsx as a, jsxs as A } from "react/jsx-runtime";
|
|
54
|
+
import * as m from "react";
|
|
55
|
+
import { SPACE as D } from "./utils/key-codes.js";
|
|
56
|
+
import { useControlProps as L } from "./form-context.js";
|
|
57
|
+
import N from "./inline.js";
|
|
58
|
+
import { Text3 as f } from "./text.js";
|
|
59
|
+
import { useAriaId as P, useTheme as R } from "./hooks.js";
|
|
60
60
|
import n from "classnames";
|
|
61
61
|
import { getPrefixedDataAttributes as S } from "./utils/dom.js";
|
|
62
|
-
import { checkboxContainerDisabled as E, checkboxContainer as V, disabled as
|
|
63
|
-
import { vars as
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
62
|
+
import { checkboxContainerDisabled as E, checkboxContainer as V, disabled as x, check as u, checkChecked as k, boxVariant as j } from "./checkbox.css-mistica.js";
|
|
63
|
+
import { vars as v } from "./skins/skin-contract.css-mistica.js";
|
|
64
|
+
import { combineRefs as z } from "./utils/common.js";
|
|
65
|
+
const B = (param)=>{
|
|
66
|
+
let { isChecked: e , disabled: c } = param;
|
|
67
|
+
const { isIos: o } = R(), l = o ? /* @__PURE__ */ a("svg", {
|
|
67
68
|
viewBox: "0 0 10 8",
|
|
68
69
|
width: "10",
|
|
69
70
|
height: "8",
|
|
70
|
-
className: n(
|
|
71
|
-
[
|
|
71
|
+
className: n(u, {
|
|
72
|
+
[k]: e
|
|
72
73
|
}),
|
|
73
74
|
children: /* @__PURE__ */ a("path", {
|
|
74
75
|
d: "M2.659 7.724c.33.366.92.368 1.254.005L9.79 1.336A.782.782 0 009.719.202a.858.858 0 00-1.178.069l-5.236 5.72-1.841-2.038a.857.857 0 00-1.177-.078.782.782 0 00-.082 1.133l2.454 2.716z",
|
|
75
|
-
fill:
|
|
76
|
+
fill: v.colors.inverse
|
|
76
77
|
})
|
|
77
78
|
}) : /* @__PURE__ */ a("svg", {
|
|
78
79
|
viewBox: "0 0 14 10",
|
|
79
80
|
width: "14",
|
|
80
81
|
height: "10",
|
|
81
|
-
className: n(
|
|
82
|
-
[
|
|
82
|
+
className: n(u, {
|
|
83
|
+
[k]: e
|
|
83
84
|
}),
|
|
84
85
|
children: /* @__PURE__ */ a("path", {
|
|
85
86
|
d: "M5 10L0 5.192l1.4-1.346L5 7.308 12.6 0 14 1.346z",
|
|
86
|
-
fill:
|
|
87
|
+
fill: v.colors.inverse
|
|
87
88
|
})
|
|
88
89
|
});
|
|
89
90
|
return /* @__PURE__ */ a("div", {
|
|
90
|
-
className: n(j[e ? "checked" :
|
|
91
|
-
[
|
|
91
|
+
className: n(j[e ? "checked" : o ? "ios" : "rest"], {
|
|
92
|
+
[x]: c
|
|
92
93
|
}),
|
|
93
|
-
children:
|
|
94
|
+
children: l
|
|
94
95
|
});
|
|
95
|
-
},
|
|
96
|
-
const o =
|
|
96
|
+
}, K = /*#__PURE__*/ m.forwardRef((e, c)=>{
|
|
97
|
+
const o = P(e["aria-labelledby"]), l = e["aria-label"], C = l || e["aria-labelledby"], { defaultValue: g , value: t , onChange: s , focusableRef: w , disabled: i } = L({
|
|
97
98
|
name: e.name,
|
|
98
99
|
value: e.checked,
|
|
99
100
|
defaultValue: e.defaultChecked,
|
|
100
101
|
onChange: e.onChange,
|
|
101
102
|
disabled: e.disabled
|
|
102
|
-
}), [d,
|
|
103
|
-
t === void 0 ? (
|
|
104
|
-
},
|
|
105
|
-
|
|
106
|
-
}, b = /* @__PURE__ */ a(
|
|
103
|
+
}), [d, y] = m.useState(!!g), h = ()=>{
|
|
104
|
+
t === void 0 ? (y(!d), s(!d)) : s(!t);
|
|
105
|
+
}, I = (r)=>{
|
|
106
|
+
r.keyCode === D && (r.preventDefault(), r.stopPropagation(), h());
|
|
107
|
+
}, b = /* @__PURE__ */ a(B, {
|
|
107
108
|
disabled: i,
|
|
108
109
|
isChecked: t !== null && t !== void 0 ? t : d
|
|
109
110
|
});
|
|
110
111
|
return(// When the checkbox is disabled, it shouldn't be focusable
|
|
111
|
-
// eslint-disable-next-line jsx-a11y/
|
|
112
|
+
// eslint-disable-next-line jsx-a11y/no-static-element-interactions
|
|
112
113
|
/* @__PURE__ */ a("div", _object_spread_props(_object_spread({
|
|
113
114
|
id: e.id,
|
|
114
|
-
role: "checkbox",
|
|
115
|
+
role: e.role || "checkbox",
|
|
115
116
|
"aria-checked": t !== null && t !== void 0 ? t : d,
|
|
116
|
-
onKeyDown: i ? void 0 :
|
|
117
|
-
onClick: (
|
|
118
|
-
|
|
117
|
+
onKeyDown: i ? void 0 : I,
|
|
118
|
+
onClick: (r)=>{
|
|
119
|
+
r.stopPropagation(), i || h();
|
|
119
120
|
},
|
|
120
121
|
tabIndex: i ? void 0 : 0,
|
|
121
|
-
ref:
|
|
122
|
+
ref: z(c, w),
|
|
122
123
|
className: i ? E : V,
|
|
123
124
|
"aria-label": l,
|
|
124
125
|
"aria-labelledby": l ? void 0 : o,
|
|
@@ -129,10 +130,10 @@ const z = (param)=>{
|
|
|
129
130
|
labelId: o,
|
|
130
131
|
checked: t !== null && t !== void 0 ? t : d,
|
|
131
132
|
disabled: !!i
|
|
132
|
-
}) : /* @__PURE__ */
|
|
133
|
+
}) : /* @__PURE__ */ A(N, {
|
|
133
134
|
space: 16,
|
|
134
135
|
children: [
|
|
135
|
-
/* @__PURE__ */ a(
|
|
136
|
+
/* @__PURE__ */ a(f, {
|
|
136
137
|
regular: !0,
|
|
137
138
|
as: "div",
|
|
138
139
|
children: /* @__PURE__ */ a("div", {
|
|
@@ -143,18 +144,18 @@ const z = (param)=>{
|
|
|
143
144
|
children: b
|
|
144
145
|
})
|
|
145
146
|
}),
|
|
146
|
-
e.children && /* @__PURE__ */ a(
|
|
147
|
+
e.children && /* @__PURE__ */ a(f, {
|
|
147
148
|
regular: !0,
|
|
148
149
|
as: "div",
|
|
149
150
|
id: o,
|
|
150
|
-
role:
|
|
151
|
+
role: C ? "presentation" : void 0,
|
|
151
152
|
children: /* @__PURE__ */ a("span", {
|
|
152
|
-
className: i ?
|
|
153
|
+
className: i ? x : "",
|
|
153
154
|
children: e.children
|
|
154
155
|
})
|
|
155
156
|
})
|
|
156
157
|
]
|
|
157
158
|
})
|
|
158
159
|
})));
|
|
159
|
-
},
|
|
160
|
-
export {
|
|
160
|
+
}), W = K;
|
|
161
|
+
export { W as default };
|
|
@@ -5,7 +5,7 @@ import { Text2 as n, Text5 as f, Text8 as h, Text3 as v } from "../text.js";
|
|
|
5
5
|
import { vars as c } from "../skins/skin-contract.css-mistica.js";
|
|
6
6
|
import s from "../inline.js";
|
|
7
7
|
import u from "../box.js";
|
|
8
|
-
import S from "../progress-bar.js";
|
|
8
|
+
import { ProgressBar as S } from "../progress-bar.js";
|
|
9
9
|
import B from "classnames";
|
|
10
10
|
const g = (param)=>{
|
|
11
11
|
let { title: o , description: e } = param;
|
|
@@ -85,6 +85,7 @@ const g = (param)=>{
|
|
|
85
85
|
/* @__PURE__ */ r(n, {
|
|
86
86
|
regular: !0,
|
|
87
87
|
color: c.colors.textSecondary,
|
|
88
|
+
decoration: "line-through",
|
|
88
89
|
children: l
|
|
89
90
|
}),
|
|
90
91
|
/* @__PURE__ */ r(f, {
|
|
@@ -26,41 +26,44 @@ function _object_spread(target) {
|
|
|
26
26
|
}
|
|
27
27
|
return target;
|
|
28
28
|
}
|
|
29
|
-
import { jsx as
|
|
30
|
-
import { vars as
|
|
31
|
-
const
|
|
32
|
-
let { size: o , color:
|
|
33
|
-
return
|
|
29
|
+
import { jsx as s } from "react/jsx-runtime";
|
|
30
|
+
import { vars as c } from "../skins/skin-contract.css-mistica.js";
|
|
31
|
+
const h = (param)=>/* @__PURE__ */ {
|
|
32
|
+
let { size: o , color: r , transform: n , transitionDuration: t , className: e , style: l } = param;
|
|
33
|
+
return s("svg", {
|
|
34
34
|
role: "presentation",
|
|
35
35
|
width: o,
|
|
36
36
|
height: o,
|
|
37
37
|
viewBox: "0 0 24 24",
|
|
38
|
-
className:
|
|
39
|
-
style:
|
|
40
|
-
|
|
38
|
+
className: e,
|
|
39
|
+
style: _object_spread({
|
|
40
|
+
transform: n,
|
|
41
|
+
transition: `transform ${t}ms`
|
|
42
|
+
}, l),
|
|
43
|
+
children: /* @__PURE__ */ s("path", {
|
|
41
44
|
style: {
|
|
42
|
-
transition:
|
|
45
|
+
transition: `fill ${t}ms`
|
|
43
46
|
},
|
|
44
|
-
fill:
|
|
47
|
+
fill: r,
|
|
45
48
|
fillRule: "evenodd",
|
|
46
|
-
d: "M14.338 11.478a.75.75 0 0 1 0 1.044l-3.837 3.997a.75.75 0 1 1-1.082-1.038L12.76 12 9.42 8.52a.75.75 0 0 1 1.082-1.04l3.837 3.998z"
|
|
47
|
-
transform: r
|
|
49
|
+
d: "M14.338 11.478a.75.75 0 0 1 0 1.044l-3.837 3.997a.75.75 0 1 1-1.082-1.038L12.76 12 9.42 8.52a.75.75 0 0 1 1.082-1.04l3.837 3.998z"
|
|
48
50
|
})
|
|
49
51
|
});
|
|
50
|
-
},
|
|
52
|
+
}, f = {
|
|
51
53
|
up: -90,
|
|
52
54
|
down: 90,
|
|
53
55
|
left: 180,
|
|
54
56
|
right: 0
|
|
55
|
-
},
|
|
56
|
-
let { size: o = 24 , color:
|
|
57
|
-
const i =
|
|
57
|
+
}, g = (param)=>{
|
|
58
|
+
let { size: o = 24 , color: r , className: n , style: t , transitionDuration: e = 300 , direction: l = "right" } = param;
|
|
59
|
+
const i = r || c.colors.neutralHigh, a = {
|
|
58
60
|
size: o,
|
|
59
61
|
color: i,
|
|
60
|
-
transform: `rotate(${
|
|
61
|
-
className:
|
|
62
|
-
|
|
62
|
+
transform: `rotate(${f[l]}deg)`,
|
|
63
|
+
className: n,
|
|
64
|
+
transitionDuration: e,
|
|
65
|
+
style: t
|
|
63
66
|
};
|
|
64
|
-
return /* @__PURE__ */
|
|
65
|
-
},
|
|
66
|
-
export {
|
|
67
|
+
return /* @__PURE__ */ s(h, _object_spread({}, a));
|
|
68
|
+
}, p = g;
|
|
69
|
+
export { p as default };
|