@telefonica/mistica 15.2.0 → 15.3.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/box.js +3 -3
- package/dist/boxed.js +2 -2
- package/dist/button-group.js +2 -2
- package/dist/button.js +5 -5
- package/dist/carousel.js +29 -29
- package/dist/chip.js +2 -2
- package/dist/community/advanced-data-card.d.ts +6 -2
- package/dist/community/advanced-data-card.js +4 -4
- package/dist/counter.js +7 -7
- package/dist/feedback.js +2 -2
- package/dist/fixed-footer-layout.css-mistica.js +5 -5
- package/dist/fixed-footer-layout.js +19 -17
- package/dist/form.js +6 -6
- package/dist/hero.css-mistica.js +12 -6
- package/dist/hero.css.d.ts +2 -0
- package/dist/hero.d.ts +2 -1
- package/dist/hero.js +80 -69
- package/dist/horizontal-scroll.js +2 -2
- package/dist/image.js +9 -7
- package/dist/list.js +19 -15
- package/dist/loading-bar.js +2 -2
- package/dist/loading-screen.js +3 -3
- package/dist/package-version.js +1 -1
- package/dist/pin-field.js +2 -2
- package/dist/progress-bar.js +4 -4
- package/dist/radio-button.js +3 -3
- package/dist/responsive-layout.css-mistica.js +18 -9
- package/dist/responsive-layout.d.ts +1 -0
- package/dist/responsive-layout.js +15 -15
- package/dist/select.js +16 -16
- package/dist/sheet.js +82 -81
- package/dist/slider.js +8 -8
- package/dist/tag.js +2 -2
- package/dist/text-field-base.js +3 -3
- package/dist/text-field-components.js +2 -2
- package/dist/text.js +105 -84
- package/dist/utils/aspect-ratio-support.js +8 -8
- package/dist/utils/browser.js +1 -1
- package/dist/video.js +2 -2
- package/dist-es/box.js +7 -7
- package/dist-es/boxed.js +2 -2
- package/dist-es/button-group.js +4 -4
- package/dist-es/button-layout.js +5 -5
- package/dist-es/button.js +11 -11
- package/dist-es/callout.js +8 -8
- package/dist-es/carousel.js +29 -29
- package/dist-es/checkbox.js +7 -7
- package/dist-es/chip.js +4 -4
- package/dist-es/community/advanced-data-card.js +14 -14
- package/dist-es/counter.js +21 -21
- package/dist-es/empty-state.js +12 -12
- package/dist-es/feedback.js +5 -5
- package/dist-es/fixed-footer-layout.css-mistica.js +2 -2
- package/dist-es/fixed-footer-layout.js +33 -31
- package/dist-es/form.js +9 -9
- package/dist-es/grid.js +3 -3
- package/dist-es/hero.css-mistica.js +2 -2
- package/dist-es/hero.js +119 -108
- package/dist-es/horizontal-scroll.js +2 -2
- package/dist-es/image.js +15 -13
- package/dist-es/list.js +15 -11
- package/dist-es/loading-bar.js +6 -6
- package/dist-es/loading-screen.js +8 -8
- package/dist-es/package-version.js +1 -1
- package/dist-es/pin-field.js +10 -10
- package/dist-es/progress-bar.js +9 -9
- package/dist-es/radio-button.js +9 -9
- package/dist-es/responsive-layout.css-mistica.js +3 -3
- package/dist-es/responsive-layout.js +21 -21
- package/dist-es/select.js +22 -22
- package/dist-es/sheet.js +124 -123
- package/dist-es/slider.js +8 -8
- package/dist-es/style.css +1 -1
- package/dist-es/tag.js +4 -4
- package/dist-es/text-field-base.js +11 -11
- package/dist-es/text-field-components.js +9 -9
- package/dist-es/text-link.js +5 -5
- package/dist-es/text.js +103 -82
- package/dist-es/utils/aspect-ratio-support.js +14 -14
- package/dist-es/utils/browser.js +1 -1
- package/dist-es/video.js +5 -5
- package/package.json +1 -1
package/dist/carousel.js
CHANGED
|
@@ -267,9 +267,9 @@ const ve = (e, t)=>{
|
|
|
267
267
|
for(let r = 0; r < t.length; r++)r === 0 ? s.push(t[0]) : s.push((t[r] + t[r - 1]) / 2);
|
|
268
268
|
for(let r = s.length - 1; r >= 0; r--)if (e - s[r] >= -1) return r;
|
|
269
269
|
return 0;
|
|
270
|
-
}, Me = 5e3,
|
|
271
|
-
let { items: e, itemStyle: t, itemClassName: s, withBullets: r, renderBullets: d, initialActiveItem: h, itemsPerPage: w, itemsToScroll: i, mobilePageOffset: u, gap: C, free: b, centered:
|
|
272
|
-
const { texts: I, platformOverrides:
|
|
270
|
+
}, Me = 5e3, Se = (param)=>{
|
|
271
|
+
let { items: e, itemStyle: t, itemClassName: s, withBullets: r, renderBullets: d, initialActiveItem: h, itemsPerPage: w, itemsToScroll: i, mobilePageOffset: u, gap: C, free: b, centered: k, autoplay: x, onPageChange: y, dataAttributes: W } = param;
|
|
272
|
+
const { texts: I, platformOverrides: N, skinName: H } = (0, _hooks.useTheme)(), J = (0, _desktopcontainertypecontext.useDesktopContainerType)(), a = vt(J || "large", w), { isDesktopOrBigger: E, isTablet: A } = (0, _hooks.useScreenSize)(), j = A ? a.tablet : a.mobile, P = Math.max(Math.floor(E ? a.desktop : j), 1), l = _react.useRef(null), m = Math.ceil(e.length / Math.max(Math.floor(a.mobile), 1)), v = Math.ceil(e.length / Math.max(Math.floor(a.tablet), 1)), M = Math.ceil(e.length / Math.max(Math.floor(a.desktop), 1)), R = Math.ceil(e.length / P), [{ scrollLeft: D, scrollRight: G }, Ee] = _react.useState({
|
|
273
273
|
scrollLeft: 0,
|
|
274
274
|
scrollRight: 0
|
|
275
275
|
}), [Q, Re] = _react.useState([]), F = _react.useMemo(()=>ie(Q, R), [
|
|
@@ -288,7 +288,7 @@ const ve = (e, t)=>{
|
|
|
288
288
|
const Y = c.scrollWidth - c.clientWidth;
|
|
289
289
|
Re(Array.from(c.querySelectorAll("[data-item]")).map((V, q)=>{
|
|
290
290
|
if (q === e.length - 1) return Y;
|
|
291
|
-
const Z = V.offsetLeft, We = parseInt(getComputedStyle(V).scrollMargin), Ae =
|
|
291
|
+
const Z = V.offsetLeft, We = parseInt(getComputedStyle(V).scrollMargin), Ae = k && !E ? Z - V.clientWidth / 2 : Z;
|
|
292
292
|
return Math.min(Ae - We - c.offsetLeft, Y);
|
|
293
293
|
}));
|
|
294
294
|
};
|
|
@@ -307,7 +307,7 @@ const ve = (e, t)=>{
|
|
|
307
307
|
a.mobile,
|
|
308
308
|
R,
|
|
309
309
|
C,
|
|
310
|
-
|
|
310
|
+
k,
|
|
311
311
|
E,
|
|
312
312
|
e.length
|
|
313
313
|
]);
|
|
@@ -371,35 +371,35 @@ const ve = (e, t)=>{
|
|
|
371
371
|
G,
|
|
372
372
|
le
|
|
373
373
|
]);
|
|
374
|
-
const
|
|
374
|
+
const S = xt(D, F), ne = _react.useRef(!h), ce = _react.useRef(0);
|
|
375
375
|
_react.useEffect(()=>{
|
|
376
376
|
if (y) {
|
|
377
|
-
const c = Math.min((
|
|
377
|
+
const c = Math.min((S + 1) * P - 1, e.length - 1), f = [];
|
|
378
378
|
for(let p = 0; p < P; p++){
|
|
379
379
|
const g = c - p;
|
|
380
380
|
g >= 0 && f.unshift(g);
|
|
381
381
|
}
|
|
382
|
-
ne.current ? ce.current !==
|
|
383
|
-
pageIndex:
|
|
382
|
+
ne.current ? ce.current !== S && y({
|
|
383
|
+
pageIndex: S,
|
|
384
384
|
shownItemIndexes: f
|
|
385
|
-
}) : ne.current = f.includes(h || 0), ce.current =
|
|
385
|
+
}) : ne.current = f.includes(h || 0), ce.current = S;
|
|
386
386
|
}
|
|
387
387
|
}, [
|
|
388
|
-
|
|
388
|
+
S,
|
|
389
389
|
e.length,
|
|
390
390
|
P,
|
|
391
391
|
h,
|
|
392
392
|
y
|
|
393
393
|
]);
|
|
394
394
|
const T = _react.useContext(re), ee = _react.useMemo(()=>({
|
|
395
|
-
currentIndex:
|
|
395
|
+
currentIndex: S,
|
|
396
396
|
numPages: {
|
|
397
397
|
mobile: m,
|
|
398
398
|
tablet: v,
|
|
399
399
|
desktop: M
|
|
400
400
|
}
|
|
401
401
|
}), [
|
|
402
|
-
|
|
402
|
+
S,
|
|
403
403
|
M,
|
|
404
404
|
m,
|
|
405
405
|
v
|
|
@@ -416,7 +416,7 @@ const ve = (e, t)=>{
|
|
|
416
416
|
let U = null;
|
|
417
417
|
d ? U = d({
|
|
418
418
|
numPages: R,
|
|
419
|
-
currentIndex:
|
|
419
|
+
currentIndex: S,
|
|
420
420
|
onPress: B
|
|
421
421
|
}) : r && (U = /* @__PURE__ */ (0, _jsxruntime.jsx)(xe, _object_spread_props(_object_spread({}, ee), {
|
|
422
422
|
onPress: B
|
|
@@ -441,7 +441,7 @@ const ve = (e, t)=>{
|
|
|
441
441
|
}),
|
|
442
442
|
/* @__PURE__ */ (0, _jsxruntime.jsx)("div", {
|
|
443
443
|
className: (0, _classnames.default)(_carouselcssmistica.carousel, {
|
|
444
|
-
[_carouselcssmistica.centeredCarousel]:
|
|
444
|
+
[_carouselcssmistica.centeredCarousel]: k,
|
|
445
445
|
[_carouselcssmistica.carouselWithScrollMobile]: m > 1,
|
|
446
446
|
[_carouselcssmistica.carouselWithScrollTablet]: v > 1
|
|
447
447
|
}),
|
|
@@ -462,13 +462,13 @@ const ve = (e, t)=>{
|
|
|
462
462
|
// the bottom of the scrollable area in retina displays when it has a height with
|
|
463
463
|
// decimals. This extra padding avoids that line to partially cover the carousel
|
|
464
464
|
// slides border:
|
|
465
|
-
paddingBottom: (0, _platform.isIos)(
|
|
465
|
+
paddingBottom: (0, _platform.isIos)(N) && !(0, _platform.isRunningAcceptanceTest)(N) ? 0.5 : void 0
|
|
466
466
|
}),
|
|
467
467
|
ref: l,
|
|
468
468
|
children: e.map((c, f)=>/* @__PURE__ */ (0, _jsxruntime.jsx)("div", {
|
|
469
469
|
className: (0, _classnames.default)(_carouselcssmistica.carouselItem, s),
|
|
470
470
|
style: _object_spread_props(_object_spread({}, t), {
|
|
471
|
-
scrollSnapStop: (0, _platform.isAndroid)(
|
|
471
|
+
scrollSnapStop: (0, _platform.isAndroid)(N) ? "always" : "normal"
|
|
472
472
|
}),
|
|
473
473
|
"data-item": !0,
|
|
474
474
|
children: c
|
|
@@ -496,7 +496,7 @@ const ve = (e, t)=>{
|
|
|
496
496
|
})
|
|
497
497
|
]
|
|
498
498
|
}));
|
|
499
|
-
},
|
|
499
|
+
}, ke = ()=>{
|
|
500
500
|
const [e, t] = _react.useState(1);
|
|
501
501
|
return _react.useEffect(()=>{
|
|
502
502
|
const s = ()=>{
|
|
@@ -507,14 +507,14 @@ const ve = (e, t)=>{
|
|
|
507
507
|
};
|
|
508
508
|
}, []), e;
|
|
509
509
|
}, _t = (e)=>{
|
|
510
|
-
const t =
|
|
511
|
-
return /* @__PURE__ */ /*#__PURE__*/ (0, _react.createElement)(
|
|
510
|
+
const t = ke();
|
|
511
|
+
return /* @__PURE__ */ /*#__PURE__*/ (0, _react.createElement)(Se, _object_spread_props(_object_spread({}, e), {
|
|
512
512
|
key: t
|
|
513
513
|
}));
|
|
514
514
|
}, jt = (param)=>{
|
|
515
515
|
let { items: e, itemStyle: t, itemClassName: s, withBullets: r, renderBullets: d, initialActiveItem: h, onPageChange: w, dataAttributes: i } = param;
|
|
516
|
-
const u =
|
|
517
|
-
return /* @__PURE__ */ (0, _jsxruntime.jsx)(
|
|
516
|
+
const u = ke();
|
|
517
|
+
return /* @__PURE__ */ (0, _jsxruntime.jsx)(Se, {
|
|
518
518
|
items: e,
|
|
519
519
|
itemStyle: t,
|
|
520
520
|
itemClassName: s,
|
|
@@ -532,15 +532,15 @@ const ve = (e, t)=>{
|
|
|
532
532
|
onPageChange: w,
|
|
533
533
|
dataAttributes: i
|
|
534
534
|
}, u);
|
|
535
|
-
},
|
|
535
|
+
}, Ne = /*#__PURE__*/ _react.createContext(!1), Ft = ()=>_react.useContext(Ne), Ct = (param)=>{
|
|
536
536
|
let { children: e } = param;
|
|
537
|
-
return /* @__PURE__ */ (0, _jsxruntime.jsx)(
|
|
537
|
+
return /* @__PURE__ */ (0, _jsxruntime.jsx)(Ne.Provider, {
|
|
538
538
|
value: !0,
|
|
539
539
|
children: e
|
|
540
540
|
});
|
|
541
541
|
}, Kt = (param)=>{
|
|
542
542
|
let { items: e, withBullets: t, autoplay: s, initialPageIndex: r = 0, onPageChange: d, dataAttributes: h, inverseBullets: w = !0 } = param;
|
|
543
|
-
const { texts: i, platformOverrides: u } = (0, _hooks.useTheme)(), C = _react.useContext(re), b = _react.useRef(null), [{ scrollLeft:
|
|
543
|
+
const { texts: i, platformOverrides: u } = (0, _hooks.useTheme)(), C = _react.useContext(re), b = _react.useRef(null), [{ scrollLeft: k, scrollRight: x }, y] = _react.useState({
|
|
544
544
|
scrollLeft: 0,
|
|
545
545
|
scrollRight: 0
|
|
546
546
|
}), W = _react.useCallback(()=>{
|
|
@@ -555,7 +555,7 @@ const ve = (e, t)=>{
|
|
|
555
555
|
left: l.clientWidth,
|
|
556
556
|
behavior: "smooth"
|
|
557
557
|
});
|
|
558
|
-
}, []),
|
|
558
|
+
}, []), N = _react.useCallback(function(l) {
|
|
559
559
|
let m = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : !0;
|
|
560
560
|
const v = b.current;
|
|
561
561
|
v && v.scrollTo({
|
|
@@ -564,7 +564,7 @@ const ve = (e, t)=>{
|
|
|
564
564
|
});
|
|
565
565
|
}, [
|
|
566
566
|
b
|
|
567
|
-
]), H = x !== 0, J =
|
|
567
|
+
]), H = x !== 0, J = k !== 0, a = b.current ? Math.floor((k + b.current.clientWidth / 2) / b.current.clientWidth) : 0;
|
|
568
568
|
_react.useLayoutEffect(()=>{
|
|
569
569
|
const l = b.current;
|
|
570
570
|
if (l) {
|
|
@@ -625,13 +625,13 @@ const ve = (e, t)=>{
|
|
|
625
625
|
e.length
|
|
626
626
|
]);
|
|
627
627
|
return _react.useEffect(()=>{
|
|
628
|
-
C && (C.setGoPrev(W), C.setGoNext(I), C.setGoToPage(
|
|
628
|
+
C && (C.setGoPrev(W), C.setGoNext(I), C.setGoToPage(N), C.setBulletsProps(P));
|
|
629
629
|
}, [
|
|
630
630
|
C,
|
|
631
631
|
I,
|
|
632
632
|
W,
|
|
633
633
|
P,
|
|
634
|
-
|
|
634
|
+
N
|
|
635
635
|
]), /* @__PURE__ */ (0, _jsxruntime.jsx)(Ct, {
|
|
636
636
|
children: /* @__PURE__ */ (0, _jsxruntime.jsxs)("div", _object_spread_props(_object_spread({
|
|
637
637
|
className: _carouselcssmistica.slideshowContainer
|
package/dist/chip.js
CHANGED
|
@@ -195,13 +195,13 @@ const $ = (e)=>{
|
|
|
195
195
|
}));
|
|
196
196
|
const I = d !== void 0 || e.href || e.onPress || e.to, a = _object_spread({
|
|
197
197
|
"component-name": "Chip"
|
|
198
|
-
}, s), o = (
|
|
198
|
+
}, s), o = (B)=>/* @__PURE__ */ (0, _jsxruntime.jsx)(_box.default, {
|
|
199
199
|
className: (0, _classnames.default)(_chipcssmistica.chipVariants[d ? "active" : h ? "overAlternative" : "default"], {
|
|
200
200
|
[_chipcssmistica.chipInteractiveVariants[T ? "dark" : "light"]]: I
|
|
201
201
|
}),
|
|
202
202
|
paddingLeft: u,
|
|
203
203
|
paddingRight: R,
|
|
204
|
-
dataAttributes:
|
|
204
|
+
dataAttributes: B,
|
|
205
205
|
children: f
|
|
206
206
|
});
|
|
207
207
|
return e.onPress ? /* @__PURE__ */ (0, _jsxruntime.jsx)(_touchable.BaseTouchable, {
|
|
@@ -5,14 +5,18 @@ import type { CardAction } from '../card';
|
|
|
5
5
|
import type StackingGroup from '../stacking-group';
|
|
6
6
|
import type Image from '../image';
|
|
7
7
|
import type { ButtonPrimary, ButtonLink } from '../button';
|
|
8
|
-
import type { DataAttributes } from '../utils/types';
|
|
8
|
+
import type { DataAttributes, TrackingEvent } from '../utils/types';
|
|
9
9
|
import type { RendersNullableElement } from '../utils/renders-element';
|
|
10
10
|
import type Tag from '../tag';
|
|
11
11
|
import type { HighlightedValueBlock, InformationBlock, ProgressBlock, RowBlock, SimpleBlock, ValueBlock } from './blocks';
|
|
12
|
-
type TouchableProps =
|
|
12
|
+
type TouchableProps = {
|
|
13
|
+
trackingEvent?: TrackingEvent | ReadonlyArray<TrackingEvent>;
|
|
14
|
+
} & ExclusifyUnion<{
|
|
13
15
|
href: string | undefined;
|
|
16
|
+
newTab?: boolean;
|
|
14
17
|
} | {
|
|
15
18
|
to: string | undefined;
|
|
19
|
+
fullPageOnWebView?: boolean;
|
|
16
20
|
} | {
|
|
17
21
|
onPress: PressHandler | undefined;
|
|
18
22
|
}>;
|
|
@@ -160,7 +160,7 @@ function _object_without_properties_loose(source, excluded) {
|
|
|
160
160
|
}
|
|
161
161
|
return target;
|
|
162
162
|
}
|
|
163
|
-
const
|
|
163
|
+
const ye = (_param)=>{
|
|
164
164
|
var { headline: a, pretitle: i, pretitleAs: n = "p", pretitleLinesMax: p, title: d, titleAs: c = "h3", titleLinesMax: l, subtitle: m, subtitleLinesMax: o, description: r, descriptionLinesMax: u, ariaLabel: x } = _param, s = _object_without_properties(_param, [
|
|
165
165
|
"headline",
|
|
166
166
|
"pretitle",
|
|
@@ -225,7 +225,7 @@ const Ne = (_param)=>{
|
|
|
225
225
|
})
|
|
226
226
|
]
|
|
227
227
|
});
|
|
228
|
-
},
|
|
228
|
+
}, Ne = (param)=>{
|
|
229
229
|
let { button: a, footerImage: i, footerText: n, footerTextLinesMax: p, buttonLink: d } = param;
|
|
230
230
|
const c = !!a, l = !!i, m = !!n, o = !!d, r = c && (l || m) && o, u = o && !r ? "178px" : "";
|
|
231
231
|
return /* @__PURE__ */ (0, _jsxruntime.jsxs)(_jsxruntime.Fragment, {
|
|
@@ -341,7 +341,7 @@ const Ne = (_param)=>{
|
|
|
341
341
|
space: 8,
|
|
342
342
|
children: [
|
|
343
343
|
a,
|
|
344
|
-
/* @__PURE__ */ (0, _jsxruntime.jsx)(
|
|
344
|
+
/* @__PURE__ */ (0, _jsxruntime.jsx)(ye, _object_spread({
|
|
345
345
|
headline: i,
|
|
346
346
|
pretitle: n,
|
|
347
347
|
pretitleAs: p,
|
|
@@ -397,7 +397,7 @@ const Ne = (_param)=>{
|
|
|
397
397
|
})
|
|
398
398
|
]
|
|
399
399
|
}),
|
|
400
|
-
w && /* @__PURE__ */ (0, _jsxruntime.jsx)(
|
|
400
|
+
w && /* @__PURE__ */ (0, _jsxruntime.jsx)(Ne, _object_spread({}, L))
|
|
401
401
|
]
|
|
402
402
|
})
|
|
403
403
|
}));
|
package/dist/counter.js
CHANGED
|
@@ -123,26 +123,26 @@ function _object_spread_props(target, source) {
|
|
|
123
123
|
return target;
|
|
124
124
|
}
|
|
125
125
|
const x = 20, W = (param)=>{
|
|
126
|
-
let { value: h, defaultValue:
|
|
127
|
-
const i = h !== void 0, f = _react.useCallback((
|
|
126
|
+
let { value: h, defaultValue: b, min: m, max: s, onChangeValue: a } = param;
|
|
127
|
+
const i = h !== void 0, f = _react.useCallback((n)=>n === void 0 ? m : Math.max(m, Math.min(s, n)), [
|
|
128
128
|
m,
|
|
129
129
|
s
|
|
130
|
-
]), [e, p] = _react.useState(f(
|
|
131
|
-
i || p(
|
|
130
|
+
]), [e, p] = _react.useState(f(b)), v = (n)=>{
|
|
131
|
+
i || p(n), a == null || a(n);
|
|
132
132
|
};
|
|
133
133
|
return [
|
|
134
134
|
i ? f(h) : e,
|
|
135
135
|
v
|
|
136
136
|
];
|
|
137
137
|
}, X = (param)=>{
|
|
138
|
-
let { value: h, defaultValue:
|
|
138
|
+
let { value: h, defaultValue: b, onChangeValue: m, onRemove: s, min: a, max: i, dataAttributes: f, disabled: e, removeLabel: p, increaseLabel: v, decreaseLabel: n, valueLabel: C } = param;
|
|
139
139
|
const A = (0, _themevariantcontext.useThemeVariant)(), { texts: u } = (0, _hooks.useTheme)(), l = a === void 0 ? 0 : a, d = Math.max(l, i === void 0 ? 999 : i), [t, T] = W({
|
|
140
140
|
value: h,
|
|
141
|
-
defaultValue:
|
|
141
|
+
defaultValue: b,
|
|
142
142
|
min: l,
|
|
143
143
|
max: d,
|
|
144
144
|
onChangeValue: m
|
|
145
|
-
}), o = !!s && t === l, D = ()=>p === void 0 ? u.counterRemoveLabel : p, $ = ()=>v === void 0 ? u.counterIncreaseLabel : v, k = ()=>
|
|
145
|
+
}), o = !!s && t === l, D = ()=>p === void 0 ? u.counterRemoveLabel : p, $ = ()=>v === void 0 ? u.counterIncreaseLabel : v, k = ()=>n === void 0 ? u.counterDecreaseLabel : n, z = ()=>`${t}, ${C === void 0 ? u.counterQuantity : C}${a !== void 0 ? `, ${u.counterMinValue} ${a}` : ""}${i !== void 0 ? `, ${u.counterMaxValue} ${i}` : ""}`;
|
|
146
146
|
return /* @__PURE__ */ (0, _jsxruntime.jsx)("div", _object_spread_props(_object_spread({
|
|
147
147
|
className: (0, _classnames.default)(_countercssmistica.counter, {
|
|
148
148
|
[_countercssmistica.disabled]: e
|
package/dist/feedback.js
CHANGED
|
@@ -185,12 +185,12 @@ const O = (r)=>!(0, _platform.isRunningAcceptanceTest)(r), D = (param)=>{
|
|
|
185
185
|
return /* @__PURE__ */ (0, _jsxruntime.jsx)("style", {
|
|
186
186
|
children: o
|
|
187
187
|
});
|
|
188
|
-
},
|
|
188
|
+
}, N = (r)=>{
|
|
189
189
|
(0, _webviewbridge.isWebViewBridgeAvailable)() && (0, _webviewbridge.requestVibration)(r).catch(()=>{});
|
|
190
190
|
}, E = (r)=>{
|
|
191
191
|
_react.useEffect(()=>{
|
|
192
192
|
let o;
|
|
193
|
-
return r === "success" && (o = setTimeout(()=>
|
|
193
|
+
return r === "success" && (o = setTimeout(()=>N("success"), 700)), r === "error" && (o = setTimeout(()=>N("error"), 1e3)), ()=>{
|
|
194
194
|
clearTimeout(o);
|
|
195
195
|
};
|
|
196
196
|
}, [
|
|
@@ -10,16 +10,16 @@ function _export(target, all) {
|
|
|
10
10
|
}
|
|
11
11
|
_export(exports, {
|
|
12
12
|
container: function() {
|
|
13
|
-
return
|
|
13
|
+
return a;
|
|
14
14
|
},
|
|
15
15
|
elevated: function() {
|
|
16
|
-
return
|
|
16
|
+
return j;
|
|
17
17
|
},
|
|
18
18
|
fixedFooter: function() {
|
|
19
|
-
return
|
|
19
|
+
return t;
|
|
20
20
|
},
|
|
21
21
|
footer: function() {
|
|
22
|
-
return
|
|
22
|
+
return v;
|
|
23
23
|
},
|
|
24
24
|
vars: function() {
|
|
25
25
|
return e;
|
|
@@ -30,7 +30,7 @@ _export(exports, {
|
|
|
30
30
|
});
|
|
31
31
|
require("./sprinkles.css.ts.vanilla.css-mistica.js");
|
|
32
32
|
require("./fixed-footer-layout.css.ts.vanilla.css-mistica.js");
|
|
33
|
-
var
|
|
33
|
+
var a = "p5j8j57", j = "p5j8j55", t = "p5j8j54", v = "p5j8j53 _1y2v1nfhx", e = {
|
|
34
34
|
footerHeight: "var(--p5j8j50)",
|
|
35
35
|
backgroundColor: "var(--p5j8j51)"
|
|
36
36
|
}, p = "_1y2v1nfh9";
|
|
@@ -123,48 +123,50 @@ const Z = 2, C = (e)=>e === document.documentElement ? window : e, ee = (e)=>{
|
|
|
123
123
|
cancel: ()=>clearTimeout(n)
|
|
124
124
|
};
|
|
125
125
|
}, te = (param)=>{
|
|
126
|
-
let { isFooterVisible: e = !0, footer: n, footerHeight:
|
|
127
|
-
const [
|
|
126
|
+
let { isFooterVisible: e = !0, footer: n, footerHeight: T = "auto", footerBgColor: y = _skincontractcssmistica.vars.colors.background, containerBgColor: d, children: g, onChangeFooterHeight: o } = param;
|
|
127
|
+
const [w, F] = _react.useState(!1), u = _react.useRef(null), { isTabletOrSmaller: i } = (0, _hooks.useScreenSize)(), { platformOverrides: f } = (0, _hooks.useTheme)(), { height: s, ref: b } = (0, _hooks.useElementDimensions)(), I = (0, _hooks.useIsWithinIFrame)(), p = (0, _hooks.useWindowHeight)(), A = (0, _hooks.useScreenHeight)(), a = p - s > (I ? p : A) / Z;
|
|
128
128
|
(0, _hooks.useIsomorphicLayoutEffect)(()=>{
|
|
129
129
|
o == null || o(s);
|
|
130
130
|
}, [
|
|
131
131
|
o,
|
|
132
132
|
s
|
|
133
133
|
]), _react.useEffect(()=>{
|
|
134
|
-
|
|
135
|
-
|
|
134
|
+
if (!i || (0, _platform.isRunningAcceptanceTest)(f) || a) return;
|
|
135
|
+
const c = (0, _dom.getScrollableParentElement)(u.current), R = ()=>(0, _dom.hasScroll)(c) && (0, _dom.getScrollDistanceToBottom)(c) > 1, t = (0, _helpers.debounce)(()=>{
|
|
136
|
+
F(R());
|
|
136
137
|
}, 50, {
|
|
137
138
|
leading: !0,
|
|
138
139
|
maxWait: 200
|
|
139
|
-
}), D = ee(t), r = C(
|
|
140
|
+
}), D = ee(t), r = C(c);
|
|
140
141
|
return (0, _dom.addPassiveEventListener)(r, "resize", t), (0, _dom.addPassiveEventListener)(r, "scroll", t), ()=>{
|
|
141
142
|
t.cancel(), (0, _dom.removePassiveEventListener)(r, "scroll", t), (0, _dom.removePassiveEventListener)(r, "resize", t), D.cancel();
|
|
142
143
|
};
|
|
143
144
|
}, [
|
|
144
|
-
|
|
145
|
-
|
|
145
|
+
a,
|
|
146
|
+
f,
|
|
147
|
+
i
|
|
146
148
|
]);
|
|
147
|
-
const
|
|
149
|
+
const v = a;
|
|
148
150
|
return /* @__PURE__ */ (0, _jsxruntime.jsxs)(_jsxruntime.Fragment, {
|
|
149
151
|
children: [
|
|
150
152
|
/* @__PURE__ */ (0, _jsxruntime.jsx)("div", {
|
|
151
|
-
ref:
|
|
153
|
+
ref: u,
|
|
152
154
|
className: _fixedfooterlayoutcssmistica.container,
|
|
153
|
-
style: (0, _css.applyCssVars)(_object_spread_props(_object_spread({},
|
|
154
|
-
[_fixedfooterlayoutcssmistica.vars.backgroundColor]:
|
|
155
|
+
style: (0, _css.applyCssVars)(_object_spread_props(_object_spread({}, d && {
|
|
156
|
+
[_fixedfooterlayoutcssmistica.vars.backgroundColor]: d
|
|
155
157
|
}), {
|
|
156
|
-
[_fixedfooterlayoutcssmistica.vars.footerHeight]:
|
|
158
|
+
[_fixedfooterlayoutcssmistica.vars.footerHeight]: v ? `calc(${_css.safeAreaInsetBottom} + ${s}px)` : "0px"
|
|
157
159
|
})),
|
|
158
|
-
children:
|
|
160
|
+
children: g
|
|
159
161
|
}),
|
|
160
162
|
/* @__PURE__ */ (0, _jsxruntime.jsx)("div", {
|
|
161
163
|
className: (0, _classnames.default)(_fixedfooterlayoutcssmistica.footer, {
|
|
162
164
|
[_fixedfooterlayoutcssmistica.withoutFooter]: !e,
|
|
163
|
-
[_fixedfooterlayoutcssmistica.elevated]:
|
|
164
|
-
[_fixedfooterlayoutcssmistica.fixedFooter]:
|
|
165
|
+
[_fixedfooterlayoutcssmistica.elevated]: w,
|
|
166
|
+
[_fixedfooterlayoutcssmistica.fixedFooter]: v
|
|
165
167
|
}),
|
|
166
168
|
style: {
|
|
167
|
-
background:
|
|
169
|
+
background: i ? y : void 0
|
|
168
170
|
},
|
|
169
171
|
"data-testid": `fixed-footer${e ? "-visible" : "-hidden"}`,
|
|
170
172
|
"data-position-fixed": "bottom",
|
|
@@ -172,7 +174,7 @@ const Z = 2, C = (e)=>e === document.documentElement ? window : e, ee = (e)=>{
|
|
|
172
174
|
ref: b,
|
|
173
175
|
"data-component-name": "FixedFooter",
|
|
174
176
|
style: {
|
|
175
|
-
height:
|
|
177
|
+
height: T,
|
|
176
178
|
marginBottom: _css.safeAreaInsetBottom
|
|
177
179
|
},
|
|
178
180
|
children: n
|
package/dist/form.js
CHANGED
|
@@ -139,8 +139,8 @@ const W = (param)=>{
|
|
|
139
139
|
if (s.disabled) continue;
|
|
140
140
|
if (s.required && !((o = l[t]) != null && o.trim())) e[t] = g.formFieldErrorIsMandatory;
|
|
141
141
|
else {
|
|
142
|
-
const
|
|
143
|
-
|
|
142
|
+
const F = u == null ? void 0 : u(i[t], l[t]);
|
|
143
|
+
F && (e[t] = F);
|
|
144
144
|
}
|
|
145
145
|
}
|
|
146
146
|
const r = Object.keys(e).map((t)=>{
|
|
@@ -176,14 +176,14 @@ const W = (param)=>{
|
|
|
176
176
|
}, 100);
|
|
177
177
|
}, [
|
|
178
178
|
h
|
|
179
|
-
]),
|
|
179
|
+
]), O = (e)=>[
|
|
180
180
|
...c.current.keys()
|
|
181
181
|
].reduce((r, o)=>{
|
|
182
182
|
var t, s;
|
|
183
183
|
return (s = (t = c.current.get(o)) == null ? void 0 : t.input) != null && s.disabled ? r : _object_spread_props(_object_spread({}, r), {
|
|
184
184
|
[o]: e[o]
|
|
185
185
|
});
|
|
186
|
-
}, {}),
|
|
186
|
+
}, {}), C = _react.useCallback((e)=>(e == null || e.preventDefault(), m("sending"), Object.keys(p()).length > 0 ? (m("filling"), Promise.resolve()) : Promise.resolve(b(O(i), O(l))).finally(()=>{
|
|
187
187
|
f.current && m("filling");
|
|
188
188
|
})), [
|
|
189
189
|
b,
|
|
@@ -213,12 +213,12 @@ const W = (param)=>{
|
|
|
213
213
|
register: j,
|
|
214
214
|
jumpToNext: T,
|
|
215
215
|
validate: p,
|
|
216
|
-
submit:
|
|
216
|
+
submit: C,
|
|
217
217
|
formId: v
|
|
218
218
|
},
|
|
219
219
|
children: /* @__PURE__ */ (0, _jsxruntime.jsx)("form", {
|
|
220
220
|
id: v,
|
|
221
|
-
onSubmit:
|
|
221
|
+
onSubmit: C,
|
|
222
222
|
ref: d,
|
|
223
223
|
className: (0, _classnames.default)((0, _sprinklescssmistica.sprinkles)({
|
|
224
224
|
width: "100%"
|
package/dist/hero.css-mistica.js
CHANGED
|
@@ -10,27 +10,33 @@ function _export(target, all) {
|
|
|
10
10
|
}
|
|
11
11
|
_export(exports, {
|
|
12
12
|
actions: function() {
|
|
13
|
-
return
|
|
13
|
+
return n;
|
|
14
14
|
},
|
|
15
15
|
container: function() {
|
|
16
|
-
return
|
|
16
|
+
return o;
|
|
17
17
|
},
|
|
18
18
|
containerDesktop: function() {
|
|
19
|
-
return
|
|
19
|
+
return v;
|
|
20
|
+
},
|
|
21
|
+
containerMinHeight: function() {
|
|
22
|
+
return i;
|
|
20
23
|
},
|
|
21
24
|
containerMobile: function() {
|
|
22
25
|
return _;
|
|
23
26
|
},
|
|
24
27
|
layout: function() {
|
|
25
|
-
return
|
|
28
|
+
return e;
|
|
26
29
|
},
|
|
27
|
-
|
|
30
|
+
mediaContainer: function() {
|
|
28
31
|
return p;
|
|
32
|
+
},
|
|
33
|
+
vars: function() {
|
|
34
|
+
return h;
|
|
29
35
|
}
|
|
30
36
|
});
|
|
31
37
|
require("./sprinkles.css.ts.vanilla.css-mistica.js");
|
|
32
38
|
require("./responsive-layout.css.ts.vanilla.css-mistica.js");
|
|
33
39
|
require("./hero.css.ts.vanilla.css-mistica.js");
|
|
34
|
-
var
|
|
40
|
+
var n = "_16rbpto7 _1y2v1nfha _1y2v1nfhw _1y2v1nfhq", o = "_16rbpto2 _1y2v1nfha", v = "_1y2v1nfhp _1y2v1nfie", i = "_16rbpto3", _ = "_1y2v1nfhg", e = "_16rbpto8", p = "_16rbpto9", h = {
|
|
35
41
|
height: "var(--_16rbpto0)"
|
|
36
42
|
};
|
package/dist/hero.css.d.ts
CHANGED
|
@@ -2,7 +2,9 @@ export declare const vars: {
|
|
|
2
2
|
height: `var(--${string})` | `var(--${string}, ${string})` | `var(--${string}, ${number})`;
|
|
3
3
|
};
|
|
4
4
|
export declare const container: string;
|
|
5
|
+
export declare const containerMinHeight: string;
|
|
5
6
|
export declare const containerMobile: string;
|
|
6
7
|
export declare const containerDesktop: string;
|
|
7
8
|
export declare const actions: string;
|
|
8
9
|
export declare const layout: string;
|
|
10
|
+
export declare const mediaContainer: string;
|
package/dist/hero.d.ts
CHANGED
|
@@ -6,7 +6,8 @@ import type Tag from './tag';
|
|
|
6
6
|
import type { DataAttributes, RendersElement, RendersNullableElement } from './utils/types';
|
|
7
7
|
type HeroProps = {
|
|
8
8
|
height?: string;
|
|
9
|
-
background?: 'default' | 'alternative' | 'brand' | 'brand-secondary';
|
|
9
|
+
background?: 'default' | 'alternative' | 'brand' | 'brand-secondary' | 'none';
|
|
10
|
+
noPaddingY?: boolean;
|
|
10
11
|
media: RendersElement<typeof Image> | RendersElement<typeof Video>;
|
|
11
12
|
headline?: RendersNullableElement<typeof Tag>;
|
|
12
13
|
pretitle?: string;
|