@telefonica/mistica 14.24.1 → 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 +5 -2
- package/dist/index.js +34 -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/skins/telefonica.js +2 -2
- package/dist/skins/vivo-new.js +1 -1
- package/dist/slider.css-mistica.js +42 -0
- package/dist/slider.css.d.ts +9 -0
- package/dist/slider.css.ts.vanilla.css-mistica.js +11 -0
- package/dist/slider.d.ts +14 -0
- package/dist/slider.js +170 -0
- 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/tooltip.css-mistica.js +10 -7
- package/dist/tooltip.css.d.ts +1 -0
- package/dist/tooltip.d.ts +2 -1
- package/dist/tooltip.js +37 -36
- package/dist/touchable.js +5 -4
- package/dist/utils/locale.d.ts +1 -1
- 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 -1765
- 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/skins/telefonica.js +2 -2
- package/dist-es/skins/vivo-new.js +1 -1
- package/dist-es/slider.css-mistica.js +10 -0
- package/dist-es/slider.css.ts.vanilla.css-mistica.js +2 -0
- package/dist-es/slider.js +117 -0
- 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/tooltip.css-mistica.js +3 -3
- package/dist-es/tooltip.js +65 -64
- package/dist-es/touchable.js +9 -8
- package/dist-es/video.js +16 -17
- package/package.json +1 -1
package/dist/carousel.js
CHANGED
|
@@ -10,22 +10,22 @@ function _export(target, all) {
|
|
|
10
10
|
}
|
|
11
11
|
_export(exports, {
|
|
12
12
|
Carousel: function() {
|
|
13
|
-
return
|
|
13
|
+
return Pt;
|
|
14
14
|
},
|
|
15
15
|
CenteredCarousel: function() {
|
|
16
|
-
return
|
|
16
|
+
return xt;
|
|
17
17
|
},
|
|
18
18
|
IsInsideSlideshowProvider: function() {
|
|
19
|
-
return
|
|
19
|
+
return tt;
|
|
20
20
|
},
|
|
21
21
|
PageBullets: function() {
|
|
22
22
|
return ie;
|
|
23
23
|
},
|
|
24
24
|
Slideshow: function() {
|
|
25
|
-
return
|
|
25
|
+
return St;
|
|
26
26
|
},
|
|
27
27
|
useIsInsideSlideshowContext: function() {
|
|
28
|
-
return
|
|
28
|
+
return wt;
|
|
29
29
|
}
|
|
30
30
|
});
|
|
31
31
|
const _jsxruntime = require("react/jsx-runtime");
|
|
@@ -174,7 +174,7 @@ const ce = (e, r)=>{
|
|
|
174
174
|
})
|
|
175
175
|
}, d))
|
|
176
176
|
});
|
|
177
|
-
}, $ = (e, r, t)=>t ? typeof t == "number" ? t : t[e] || r[e] : r[e],
|
|
177
|
+
}, $ = (e, r, t)=>t ? typeof t == "number" ? t : t[e] || r[e] : r[e], $e = (e, r)=>{
|
|
178
178
|
const t = {
|
|
179
179
|
mobile: 1,
|
|
180
180
|
tablet: 2,
|
|
@@ -201,33 +201,33 @@ const ce = (e, r)=>{
|
|
|
201
201
|
const t = Math.ceil(e.length / r), o = [];
|
|
202
202
|
for(let f = 0; f < e.length; f += t)o.push(e[f]);
|
|
203
203
|
return o[o.length - 1] = e[e.length - t], o;
|
|
204
|
-
},
|
|
204
|
+
}, et = (e, r)=>{
|
|
205
205
|
const t = [];
|
|
206
206
|
for(let o = 0; o < r.length; o++)o === 0 ? t.push(r[0]) : t.push((r[o] + r[o - 1]) / 2);
|
|
207
207
|
for(let o = t.length - 1; o >= 0; o--)if (e - t[o] >= -1) return o;
|
|
208
208
|
return 0;
|
|
209
209
|
}, ae = 5e3, ue = (param)=>{
|
|
210
|
-
let { items: e , itemStyle: r , itemClassName: t , withBullets: o , renderBullets: f , initialActiveItem: m , itemsPerPage: b , itemsToScroll: d , mobilePageOffset: g , gap:
|
|
211
|
-
const { texts: T , platformOverrides:
|
|
210
|
+
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;
|
|
211
|
+
const { texts: T , platformOverrides: x , skinName: y } = (0, _hooks.useTheme)(), c = (0, _desktopcontainertypecontext.useDesktopContainerType)(), i = $e(c || "large", b), { isDesktopOrBigger: w , isTablet: L } = (0, _hooks.useScreenSize)(), U = L ? i.tablet : i.mobile, I = Math.max(Math.floor(w ? i.desktop : U), 1), p = _react.useRef(null), S = Math.ceil(e.length / I), [{ scrollLeft: H , scrollRight: q }, de] = _react.useState({
|
|
212
212
|
scrollLeft: 0,
|
|
213
213
|
scrollRight: 0
|
|
214
|
-
}), [K, he] = _react.useState([]), W = _react.useMemo(()=>ee(K,
|
|
214
|
+
}), [K, he] = _react.useState([]), W = _react.useMemo(()=>ee(K, S), [
|
|
215
215
|
K,
|
|
216
|
-
|
|
216
|
+
S
|
|
217
217
|
]), O = d ? ee(K, Math.ceil(e.length / d)) : W, me = q !== 0, ge = H !== 0;
|
|
218
218
|
(0, _hooks.useIsomorphicLayoutEffect)(()=>{
|
|
219
219
|
if (p.current) {
|
|
220
220
|
const l = p.current, a = ()=>{
|
|
221
|
-
const { scrollWidth: z , clientWidth:
|
|
221
|
+
const { scrollWidth: z , clientWidth: M } = l, _ = Math.round(l.scrollLeft), j = Math.round(z - (_ + M));
|
|
222
222
|
de({
|
|
223
223
|
scrollLeft: _,
|
|
224
224
|
scrollRight: j
|
|
225
225
|
});
|
|
226
226
|
}, u = ()=>{
|
|
227
227
|
const z = l.scrollWidth - l.clientWidth;
|
|
228
|
-
he(Array.from(l.querySelectorAll("[data-item]")).map((
|
|
228
|
+
he(Array.from(l.querySelectorAll("[data-item]")).map((M, _)=>{
|
|
229
229
|
if (_ === e.length - 1) return z;
|
|
230
|
-
const j =
|
|
230
|
+
const j = M.offsetLeft, Ie = parseInt(getComputedStyle(M).scrollMargin), Pe = A && !w ? j - M.clientWidth / 2 : j;
|
|
231
231
|
return Math.min(Pe - Ie - l.offsetLeft, z);
|
|
232
232
|
}));
|
|
233
233
|
};
|
|
@@ -244,10 +244,10 @@ const ce = (e, r)=>{
|
|
|
244
244
|
i.desktop,
|
|
245
245
|
i.tablet,
|
|
246
246
|
i.mobile,
|
|
247
|
+
S,
|
|
248
|
+
N,
|
|
249
|
+
A,
|
|
247
250
|
w,
|
|
248
|
-
k,
|
|
249
|
-
R,
|
|
250
|
-
x,
|
|
251
251
|
e.length
|
|
252
252
|
]);
|
|
253
253
|
const D = _react.useCallback(function(l) {
|
|
@@ -310,21 +310,21 @@ const ce = (e, r)=>{
|
|
|
310
310
|
q,
|
|
311
311
|
J
|
|
312
312
|
]);
|
|
313
|
-
const
|
|
313
|
+
const k = et(H, W), Q = _react.useRef(!m), X = _react.useRef(0);
|
|
314
314
|
_react.useEffect(()=>{
|
|
315
315
|
if (P) {
|
|
316
|
-
const l = Math.min((
|
|
316
|
+
const l = Math.min((k + 1) * I - 1, e.length - 1), a = [];
|
|
317
317
|
for(let u = 0; u < I; u++){
|
|
318
318
|
const h = l - u;
|
|
319
319
|
h >= 0 && a.unshift(h);
|
|
320
320
|
}
|
|
321
|
-
Q.current ? X.current !==
|
|
322
|
-
pageIndex:
|
|
321
|
+
Q.current ? X.current !== k && P({
|
|
322
|
+
pageIndex: k,
|
|
323
323
|
shownItemIndexes: a
|
|
324
|
-
}) : Q.current = a.includes(m || 0), X.current =
|
|
324
|
+
}) : Q.current = a.includes(m || 0), X.current = k;
|
|
325
325
|
}
|
|
326
326
|
}, [
|
|
327
|
-
|
|
327
|
+
k,
|
|
328
328
|
e.length,
|
|
329
329
|
I,
|
|
330
330
|
m,
|
|
@@ -332,12 +332,12 @@ const ce = (e, r)=>{
|
|
|
332
332
|
]);
|
|
333
333
|
let V = null;
|
|
334
334
|
f ? V = f({
|
|
335
|
-
numPages:
|
|
336
|
-
currentIndex:
|
|
335
|
+
numPages: S,
|
|
336
|
+
currentIndex: k,
|
|
337
337
|
onPress: D
|
|
338
|
-
}) : o && (V =
|
|
339
|
-
numPages:
|
|
340
|
-
currentIndex:
|
|
338
|
+
}) : o && (V = S > 1 && /* @__PURE__ */ (0, _jsxruntime.jsx)(ie, {
|
|
339
|
+
numPages: S,
|
|
340
|
+
currentIndex: k,
|
|
341
341
|
onPress: D
|
|
342
342
|
}));
|
|
343
343
|
const be = "64px", ve = "36px";
|
|
@@ -362,8 +362,8 @@ const ce = (e, r)=>{
|
|
|
362
362
|
}),
|
|
363
363
|
/* @__PURE__ */ (0, _jsxruntime.jsx)("div", {
|
|
364
364
|
className: (0, _classnames.default)(_carouselcssmistica.carousel, {
|
|
365
|
-
[_carouselcssmistica.centeredCarousel]:
|
|
366
|
-
[_carouselcssmistica.carouselWithScroll]:
|
|
365
|
+
[_carouselcssmistica.centeredCarousel]: A,
|
|
366
|
+
[_carouselcssmistica.carouselWithScroll]: S > 1
|
|
367
367
|
}),
|
|
368
368
|
style: _object_spread_props(_object_spread({}, (0, _dynamic.assignInlineVars)(_object_spread({
|
|
369
369
|
[_carouselcssmistica.vars.itemsPerPageDesktop]: String(i.desktop),
|
|
@@ -373,16 +373,22 @@ const ce = (e, r)=>{
|
|
|
373
373
|
[_carouselcssmistica.vars.mobilePageOffset]: be
|
|
374
374
|
} : y === _constants.VIVO_NEW_SKIN ? {
|
|
375
375
|
[_carouselcssmistica.vars.mobilePageOffset]: ve
|
|
376
|
-
} : {},
|
|
377
|
-
[_carouselcssmistica.vars.gap]: String(
|
|
376
|
+
} : {}, N !== void 0 ? {
|
|
377
|
+
[_carouselcssmistica.vars.gap]: String(N)
|
|
378
378
|
} : {}))), {
|
|
379
|
-
scrollSnapType:
|
|
379
|
+
scrollSnapType: R ? "initial" : "x mandatory",
|
|
380
|
+
// Hack to fix https://jira.tid.es/browse/NOVUMCC-8988
|
|
381
|
+
// there is a webkit rendering bug that causes a half pixel white line to appear at
|
|
382
|
+
// the bottom of the scrollable area in retina displays when it has a height with
|
|
383
|
+
// decimals. This extra padding avoids that line to partially cover the carousel
|
|
384
|
+
// slides border:
|
|
385
|
+
paddingBottom: (0, _platform.isIos)(x) && !(0, _platform.isRunningAcceptanceTest)(x) ? 0.5 : void 0
|
|
380
386
|
}),
|
|
381
387
|
ref: p,
|
|
382
388
|
children: e.map((l, a)=>/* @__PURE__ */ (0, _jsxruntime.jsx)("div", {
|
|
383
389
|
className: (0, _classnames.default)(_carouselcssmistica.carouselItem, t),
|
|
384
390
|
style: _object_spread_props(_object_spread({}, r), {
|
|
385
|
-
scrollSnapStop: (0, _platform.isAndroid)(
|
|
391
|
+
scrollSnapStop: (0, _platform.isAndroid)(x) ? "always" : "normal"
|
|
386
392
|
}),
|
|
387
393
|
"data-item": !0,
|
|
388
394
|
children: l
|
|
@@ -406,7 +412,7 @@ const ce = (e, r)=>{
|
|
|
406
412
|
})
|
|
407
413
|
]
|
|
408
414
|
});
|
|
409
|
-
},
|
|
415
|
+
}, Pt = (e)=>/* @__PURE__ */ (0, _jsxruntime.jsx)(ue, _object_spread({}, e)), xt = (param)=>/* @__PURE__ */ {
|
|
410
416
|
let { items: e , itemStyle: r , itemClassName: t , withBullets: o , renderBullets: f , initialActiveItem: m , onPageChange: b , dataAttributes: d } = param;
|
|
411
417
|
return (0, _jsxruntime.jsx)(ue, {
|
|
412
418
|
items: e,
|
|
@@ -426,15 +432,15 @@ const ce = (e, r)=>{
|
|
|
426
432
|
onPageChange: b,
|
|
427
433
|
dataAttributes: d
|
|
428
434
|
});
|
|
429
|
-
}, fe = /*#__PURE__*/ _react.createContext(!1),
|
|
435
|
+
}, fe = /*#__PURE__*/ _react.createContext(!1), wt = ()=>_react.useContext(fe), tt = (param)=>/* @__PURE__ */ {
|
|
430
436
|
let { children: e } = param;
|
|
431
437
|
return (0, _jsxruntime.jsx)(fe.Provider, {
|
|
432
438
|
value: !0,
|
|
433
439
|
children: e
|
|
434
440
|
});
|
|
435
|
-
},
|
|
441
|
+
}, St = (param)=>{
|
|
436
442
|
let { items: e , withBullets: r , autoplay: t , onPageChange: o , dataAttributes: f , inverseBullets: m = !0 } = param;
|
|
437
|
-
const { texts: b , platformOverrides: d } = (0, _hooks.useTheme)(), g = _react.useRef(null), [{ scrollLeft:
|
|
443
|
+
const { texts: b , platformOverrides: d } = (0, _hooks.useTheme)(), g = _react.useRef(null), [{ scrollLeft: N , scrollRight: R }, A] = _react.useState({
|
|
438
444
|
scrollLeft: 0,
|
|
439
445
|
scrollRight: 0
|
|
440
446
|
}), v = _react.useCallback(()=>{
|
|
@@ -449,21 +455,21 @@ const ce = (e, r)=>{
|
|
|
449
455
|
left: c.clientWidth,
|
|
450
456
|
behavior: "smooth"
|
|
451
457
|
});
|
|
452
|
-
}, []), F =
|
|
458
|
+
}, []), F = R !== 0, T = N !== 0, x = g.current ? Math.floor((N + g.current.clientWidth / 2) / g.current.clientWidth) : 0;
|
|
453
459
|
_react.useLayoutEffect(()=>{
|
|
454
460
|
const c = g.current;
|
|
455
461
|
if (c) {
|
|
456
462
|
const i = ()=>{
|
|
457
|
-
const { scrollWidth:
|
|
458
|
-
|
|
463
|
+
const { scrollWidth: L , clientWidth: U } = c, I = Math.round(c.scrollLeft), p = Math.round(L - (I + U));
|
|
464
|
+
A({
|
|
459
465
|
scrollLeft: I,
|
|
460
466
|
scrollRight: p
|
|
461
467
|
});
|
|
462
468
|
};
|
|
463
469
|
i(), c.addEventListener("scroll", i);
|
|
464
|
-
const
|
|
470
|
+
const w = (0, _dom.listenResize)(c, i);
|
|
465
471
|
return ()=>{
|
|
466
|
-
c.removeEventListener("scroll", i),
|
|
472
|
+
c.removeEventListener("scroll", i), w();
|
|
467
473
|
};
|
|
468
474
|
}
|
|
469
475
|
}, [
|
|
@@ -472,26 +478,26 @@ const ce = (e, r)=>{
|
|
|
472
478
|
const y = ce(!!t, g);
|
|
473
479
|
return _react.useEffect(()=>{
|
|
474
480
|
if (y && t) {
|
|
475
|
-
const c = typeof t == "boolean" ? ae : t.time, i = typeof t == "object" && t.loop,
|
|
476
|
-
var
|
|
477
|
-
|
|
481
|
+
const c = typeof t == "boolean" ? ae : t.time, i = typeof t == "object" && t.loop, w = setInterval(()=>{
|
|
482
|
+
var L;
|
|
483
|
+
R !== 0 ? P() : i && ((L = g.current) == null || L.scrollTo({
|
|
478
484
|
left: 0,
|
|
479
485
|
behavior: "smooth"
|
|
480
486
|
}));
|
|
481
487
|
}, c);
|
|
482
|
-
return ()=>clearInterval(
|
|
488
|
+
return ()=>clearInterval(w);
|
|
483
489
|
}
|
|
484
490
|
}, [
|
|
485
491
|
t,
|
|
486
492
|
P,
|
|
487
|
-
|
|
493
|
+
R,
|
|
488
494
|
y
|
|
489
495
|
]), _react.useEffect(()=>{
|
|
490
|
-
o && o(
|
|
496
|
+
o && o(x);
|
|
491
497
|
}, [
|
|
492
|
-
|
|
498
|
+
x,
|
|
493
499
|
o
|
|
494
|
-
]), /* @__PURE__ */ (0, _jsxruntime.jsx)(
|
|
500
|
+
]), /* @__PURE__ */ (0, _jsxruntime.jsx)(tt, {
|
|
495
501
|
children: /* @__PURE__ */ (0, _jsxruntime.jsxs)("div", _object_spread_props(_object_spread({
|
|
496
502
|
className: _carouselcssmistica.slideshowContainer
|
|
497
503
|
}, (0, _dom.getPrefixedDataAttributes)(f, "SlideShow")), {
|
|
@@ -536,7 +542,7 @@ const ce = (e, r)=>{
|
|
|
536
542
|
className: _carouselcssmistica.slideshowBullets,
|
|
537
543
|
children: /* @__PURE__ */ (0, _jsxruntime.jsx)(ie, {
|
|
538
544
|
numPages: e.length,
|
|
539
|
-
currentIndex:
|
|
545
|
+
currentIndex: x
|
|
540
546
|
})
|
|
541
547
|
})
|
|
542
548
|
})
|
package/dist/checkbox.css.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export declare const checkboxContainer: string;
|
|
2
2
|
export declare const checkboxContainerDisabled: string;
|
|
3
|
-
export declare const boxVariant: Record<"ios" | "
|
|
3
|
+
export declare const boxVariant: Record<"ios" | "checked" | "rest", string>;
|
|
4
4
|
export declare const check: string;
|
|
5
5
|
export declare const checkChecked: string;
|
|
6
6
|
export declare const disabled: string;
|
package/dist/checkbox.d.ts
CHANGED
|
@@ -16,6 +16,7 @@ type RenderProps = {
|
|
|
16
16
|
disabled?: boolean;
|
|
17
17
|
'aria-labelledby'?: string;
|
|
18
18
|
'aria-label'?: string;
|
|
19
|
+
role?: 'checkbox' | 'menuitemcheckbox';
|
|
19
20
|
dataAttributes?: DataAttributes;
|
|
20
21
|
};
|
|
21
22
|
type ChildrenProps = {
|
|
@@ -29,7 +30,8 @@ type ChildrenProps = {
|
|
|
29
30
|
disabled?: boolean;
|
|
30
31
|
'aria-label'?: string;
|
|
31
32
|
'aria-labelledby'?: string;
|
|
33
|
+
role?: 'checkbox' | 'menuitemcheckbox';
|
|
32
34
|
dataAttributes?: DataAttributes;
|
|
33
35
|
};
|
|
34
|
-
declare const Checkbox: React.
|
|
36
|
+
declare const Checkbox: React.ForwardRefExoticComponent<(RenderProps | ChildrenProps) & React.RefAttributes<HTMLDivElement>>;
|
|
35
37
|
export default Checkbox;
|
package/dist/checkbox.js
CHANGED
|
@@ -5,7 +5,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
Object.defineProperty(exports, "default", {
|
|
6
6
|
enumerable: true,
|
|
7
7
|
get: function() {
|
|
8
|
-
return
|
|
8
|
+
return W;
|
|
9
9
|
}
|
|
10
10
|
});
|
|
11
11
|
const _jsxruntime = require("react/jsx-runtime");
|
|
@@ -19,6 +19,7 @@ const _classnames = /*#__PURE__*/ _interop_require_default(require("classnames")
|
|
|
19
19
|
const _dom = require("./utils/dom.js");
|
|
20
20
|
const _checkboxcssmistica = require("./checkbox.css-mistica.js");
|
|
21
21
|
const _skincontractcssmistica = require("./skins/skin-contract.css-mistica.js");
|
|
22
|
+
const _common = require("./utils/common.js");
|
|
22
23
|
function _interop_require_default(obj) {
|
|
23
24
|
return obj && obj.__esModule ? obj : {
|
|
24
25
|
default: obj
|
|
@@ -115,9 +116,9 @@ function _object_spread_props(target, source) {
|
|
|
115
116
|
}
|
|
116
117
|
return target;
|
|
117
118
|
}
|
|
118
|
-
const
|
|
119
|
-
let { isChecked: e , disabled:
|
|
120
|
-
const { isIos:
|
|
119
|
+
const B = (param)=>{
|
|
120
|
+
let { isChecked: e , disabled: c } = param;
|
|
121
|
+
const { isIos: o } = (0, _hooks.useTheme)(), l = o ? /* @__PURE__ */ (0, _jsxruntime.jsx)("svg", {
|
|
121
122
|
viewBox: "0 0 10 8",
|
|
122
123
|
width: "10",
|
|
123
124
|
height: "8",
|
|
@@ -141,37 +142,37 @@ const z = (param)=>{
|
|
|
141
142
|
})
|
|
142
143
|
});
|
|
143
144
|
return /* @__PURE__ */ (0, _jsxruntime.jsx)("div", {
|
|
144
|
-
className: (0, _classnames.default)(_checkboxcssmistica.boxVariant[e ? "checked" :
|
|
145
|
-
[_checkboxcssmistica.disabled]:
|
|
145
|
+
className: (0, _classnames.default)(_checkboxcssmistica.boxVariant[e ? "checked" : o ? "ios" : "rest"], {
|
|
146
|
+
[_checkboxcssmistica.disabled]: c
|
|
146
147
|
}),
|
|
147
|
-
children:
|
|
148
|
+
children: l
|
|
148
149
|
});
|
|
149
|
-
},
|
|
150
|
-
const o = (0, _hooks.useAriaId)(e["aria-labelledby"]), l = e["aria-label"],
|
|
150
|
+
}, K = /*#__PURE__*/ _react.forwardRef((e, c)=>{
|
|
151
|
+
const o = (0, _hooks.useAriaId)(e["aria-labelledby"]), l = e["aria-label"], C = l || e["aria-labelledby"], { defaultValue: g , value: t , onChange: s , focusableRef: w , disabled: i } = (0, _formcontext.useControlProps)({
|
|
151
152
|
name: e.name,
|
|
152
153
|
value: e.checked,
|
|
153
154
|
defaultValue: e.defaultChecked,
|
|
154
155
|
onChange: e.onChange,
|
|
155
156
|
disabled: e.disabled
|
|
156
|
-
}), [d,
|
|
157
|
-
t === void 0 ? (
|
|
158
|
-
},
|
|
159
|
-
|
|
160
|
-
}, b = /* @__PURE__ */ (0, _jsxruntime.jsx)(
|
|
157
|
+
}), [d, y] = _react.useState(!!g), h = ()=>{
|
|
158
|
+
t === void 0 ? (y(!d), s(!d)) : s(!t);
|
|
159
|
+
}, I = (r)=>{
|
|
160
|
+
r.keyCode === _keycodes.SPACE && (r.preventDefault(), r.stopPropagation(), h());
|
|
161
|
+
}, b = /* @__PURE__ */ (0, _jsxruntime.jsx)(B, {
|
|
161
162
|
disabled: i,
|
|
162
163
|
isChecked: t !== null && t !== void 0 ? t : d
|
|
163
164
|
});
|
|
164
|
-
return(// eslint-disable-next-line jsx-a11y/
|
|
165
|
+
return(// eslint-disable-next-line jsx-a11y/no-static-element-interactions
|
|
165
166
|
/* @__PURE__ */ (0, _jsxruntime.jsx)("div", _object_spread_props(_object_spread({
|
|
166
167
|
id: e.id,
|
|
167
|
-
role: "checkbox",
|
|
168
|
+
role: e.role || "checkbox",
|
|
168
169
|
"aria-checked": t !== null && t !== void 0 ? t : d,
|
|
169
|
-
onKeyDown: i ? void 0 :
|
|
170
|
-
onClick: (
|
|
171
|
-
|
|
170
|
+
onKeyDown: i ? void 0 : I,
|
|
171
|
+
onClick: (r)=>{
|
|
172
|
+
r.stopPropagation(), i || h();
|
|
172
173
|
},
|
|
173
174
|
tabIndex: i ? void 0 : 0,
|
|
174
|
-
ref:
|
|
175
|
+
ref: (0, _common.combineRefs)(c, w),
|
|
175
176
|
className: i ? _checkboxcssmistica.checkboxContainerDisabled : _checkboxcssmistica.checkboxContainer,
|
|
176
177
|
"aria-label": l,
|
|
177
178
|
"aria-labelledby": l ? void 0 : o,
|
|
@@ -200,7 +201,7 @@ const z = (param)=>{
|
|
|
200
201
|
regular: !0,
|
|
201
202
|
as: "div",
|
|
202
203
|
id: o,
|
|
203
|
-
role:
|
|
204
|
+
role: C ? "presentation" : void 0,
|
|
204
205
|
children: /* @__PURE__ */ (0, _jsxruntime.jsx)("span", {
|
|
205
206
|
className: i ? _checkboxcssmistica.disabled : "",
|
|
206
207
|
children: e.children
|
|
@@ -209,4 +210,4 @@ const z = (param)=>{
|
|
|
209
210
|
]
|
|
210
211
|
})
|
|
211
212
|
})));
|
|
212
|
-
},
|
|
213
|
+
}), W = K;
|
package/dist/community/blocks.js
CHANGED
|
@@ -35,7 +35,7 @@ const _text = require("../text.js");
|
|
|
35
35
|
const _skincontractcssmistica = require("../skins/skin-contract.css-mistica.js");
|
|
36
36
|
const _inline = /*#__PURE__*/ _interop_require_default(require("../inline.js"));
|
|
37
37
|
const _box = /*#__PURE__*/ _interop_require_default(require("../box.js"));
|
|
38
|
-
const _progressbar =
|
|
38
|
+
const _progressbar = require("../progress-bar.js");
|
|
39
39
|
const _classnames = /*#__PURE__*/ _interop_require_default(require("classnames"));
|
|
40
40
|
function _interop_require_default(obj) {
|
|
41
41
|
return obj && obj.__esModule ? obj : {
|
|
@@ -120,6 +120,7 @@ const g = (param)=>{
|
|
|
120
120
|
/* @__PURE__ */ (0, _jsxruntime.jsx)(_text.Text2, {
|
|
121
121
|
regular: !0,
|
|
122
122
|
color: _skincontractcssmistica.vars.colors.textSecondary,
|
|
123
|
+
decoration: "line-through",
|
|
123
124
|
children: l
|
|
124
125
|
}),
|
|
125
126
|
/* @__PURE__ */ (0, _jsxruntime.jsx)(_text.Text5, {
|
|
@@ -228,7 +229,7 @@ const g = (param)=>{
|
|
|
228
229
|
e
|
|
229
230
|
]
|
|
230
231
|
}),
|
|
231
|
-
l !== void 0 && /* @__PURE__ */ (0, _jsxruntime.jsx)(_progressbar.
|
|
232
|
+
l !== void 0 && /* @__PURE__ */ (0, _jsxruntime.jsx)(_progressbar.ProgressBar, {
|
|
232
233
|
progressPercent: l,
|
|
233
234
|
reverse: t
|
|
234
235
|
}),
|
package/dist/form-context.d.ts
CHANGED
|
@@ -54,17 +54,17 @@ export declare const useControlProps: <T>({ name, value, defaultValue, onChange,
|
|
|
54
54
|
};
|
|
55
55
|
export declare const useFieldProps: ({ name, value, defaultValue, processValue, helperText, optional, error, disabled, onBlur, validate, onChange, onChangeValue, }: {
|
|
56
56
|
name: string;
|
|
57
|
-
value
|
|
58
|
-
defaultValue
|
|
57
|
+
value?: string | undefined;
|
|
58
|
+
defaultValue?: string | undefined;
|
|
59
59
|
processValue: (value: string) => unknown;
|
|
60
|
-
helperText
|
|
61
|
-
optional
|
|
62
|
-
error
|
|
63
|
-
disabled
|
|
60
|
+
helperText?: string | undefined;
|
|
61
|
+
optional?: boolean | undefined;
|
|
62
|
+
error?: boolean | undefined;
|
|
63
|
+
disabled?: boolean | undefined;
|
|
64
64
|
onBlur?: React.FocusEventHandler<Element> | undefined;
|
|
65
|
-
validate
|
|
66
|
-
onChange
|
|
67
|
-
onChangeValue
|
|
65
|
+
validate?: ((value: any, rawValue: string) => string | undefined) | undefined;
|
|
66
|
+
onChange?: ((event: React.ChangeEvent<HTMLInputElement>) => void) | undefined;
|
|
67
|
+
onChangeValue?: ((value: any, rawValue: string) => void) | undefined;
|
|
68
68
|
}) => {
|
|
69
69
|
value?: string | undefined;
|
|
70
70
|
defaultValue?: string | undefined;
|
|
@@ -5,7 +5,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
Object.defineProperty(exports, "default", {
|
|
6
6
|
enumerable: true,
|
|
7
7
|
get: function() {
|
|
8
|
-
return
|
|
8
|
+
return p;
|
|
9
9
|
}
|
|
10
10
|
});
|
|
11
11
|
const _jsxruntime = require("react/jsx-runtime");
|
|
@@ -38,38 +38,41 @@ function _object_spread(target) {
|
|
|
38
38
|
}
|
|
39
39
|
return target;
|
|
40
40
|
}
|
|
41
|
-
const
|
|
42
|
-
let { size: o , color:
|
|
41
|
+
const h = (param)=>/* @__PURE__ */ {
|
|
42
|
+
let { size: o , color: r , transform: n , transitionDuration: t , className: e , style: l } = param;
|
|
43
43
|
return (0, _jsxruntime.jsx)("svg", {
|
|
44
44
|
role: "presentation",
|
|
45
45
|
width: o,
|
|
46
46
|
height: o,
|
|
47
47
|
viewBox: "0 0 24 24",
|
|
48
|
-
className:
|
|
49
|
-
style:
|
|
48
|
+
className: e,
|
|
49
|
+
style: _object_spread({
|
|
50
|
+
transform: n,
|
|
51
|
+
transition: `transform ${t}ms`
|
|
52
|
+
}, l),
|
|
50
53
|
children: /* @__PURE__ */ (0, _jsxruntime.jsx)("path", {
|
|
51
54
|
style: {
|
|
52
|
-
transition:
|
|
55
|
+
transition: `fill ${t}ms`
|
|
53
56
|
},
|
|
54
|
-
fill:
|
|
57
|
+
fill: r,
|
|
55
58
|
fillRule: "evenodd",
|
|
56
|
-
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"
|
|
57
|
-
transform: r
|
|
59
|
+
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"
|
|
58
60
|
})
|
|
59
61
|
});
|
|
60
|
-
},
|
|
62
|
+
}, f = {
|
|
61
63
|
up: -90,
|
|
62
64
|
down: 90,
|
|
63
65
|
left: 180,
|
|
64
66
|
right: 0
|
|
65
|
-
},
|
|
66
|
-
let { size: o = 24 , color:
|
|
67
|
-
const i =
|
|
67
|
+
}, g = (param)=>{
|
|
68
|
+
let { size: o = 24 , color: r , className: n , style: t , transitionDuration: e = 300 , direction: l = "right" } = param;
|
|
69
|
+
const i = r || _skincontractcssmistica.vars.colors.neutralHigh, a = {
|
|
68
70
|
size: o,
|
|
69
71
|
color: i,
|
|
70
|
-
transform: `rotate(${
|
|
71
|
-
className:
|
|
72
|
-
|
|
72
|
+
transform: `rotate(${f[l]}deg)`,
|
|
73
|
+
className: n,
|
|
74
|
+
transitionDuration: e,
|
|
75
|
+
style: t
|
|
73
76
|
};
|
|
74
|
-
return /* @__PURE__ */ (0, _jsxruntime.jsx)(
|
|
75
|
-
},
|
|
77
|
+
return /* @__PURE__ */ (0, _jsxruntime.jsx)(h, _object_spread({}, a));
|
|
78
|
+
}, p = g;
|
package/dist/index.d.ts
CHANGED
|
@@ -7,6 +7,7 @@ export { default as Touchable } from './touchable';
|
|
|
7
7
|
export type { TouchableElement } from './touchable';
|
|
8
8
|
export { default as Spinner } from './spinner';
|
|
9
9
|
export { default as FadeIn } from './fade-in';
|
|
10
|
+
export { AccordionItem, BoxedAccordionItem, Accordion, BoxedAccordion } from './accordion';
|
|
10
11
|
export { ButtonPrimary, ButtonSecondary, ButtonDanger, ButtonLink } from './button';
|
|
11
12
|
export { default as ButtonLayout } from './button-layout';
|
|
12
13
|
export { default as FixedFooterLayout } from './fixed-footer-layout';
|
|
@@ -50,15 +51,16 @@ export { default as Inline } from './inline';
|
|
|
50
51
|
export { default as HorizontalScroll } from './horizontal-scroll';
|
|
51
52
|
export { default as HighlightedCard } from './highlighted-card';
|
|
52
53
|
export { default as Stepper } from './stepper';
|
|
53
|
-
export {
|
|
54
|
+
export { ProgressBar, ProgressBarStepped } from './progress-bar';
|
|
54
55
|
export { MediaCard, DataCard, SnapCard, DisplayDataCard, DisplayMediaCard, PosterCard, NakedCard, SmallNakedCard, CardActionSpinner, } from './card';
|
|
55
56
|
export { default as Hero } from './hero';
|
|
56
57
|
export { default as Divider } from './divider';
|
|
57
|
-
export {
|
|
58
|
+
export { Menu, MenuItem, MenuSection } from './menu';
|
|
58
59
|
export { default as EmptyState } from './empty-state';
|
|
59
60
|
export { default as EmptyStateCard } from './empty-state-card';
|
|
60
61
|
export { default as Callout } from './callout';
|
|
61
62
|
export { default as Avatar } from './avatar';
|
|
63
|
+
export { default as Slider } from './slider';
|
|
62
64
|
export { useModalState } from './modal-context-provider';
|
|
63
65
|
export { NavigationBar, MainNavigationBar, FunnelNavigationBar, NavigationBarActionGroup, NavigationBarAction, } from './navigation-bar';
|
|
64
66
|
export {
|
|
@@ -79,6 +81,7 @@ export { default as StackingGroup } from './stacking-group';
|
|
|
79
81
|
export { default as Form } from './form';
|
|
80
82
|
export { default as Select } from './select';
|
|
81
83
|
export { default as TextField } from './text-field';
|
|
84
|
+
export { default as PinField } from './pin-field';
|
|
82
85
|
export { TextFieldBase } from './text-field-base';
|
|
83
86
|
export { default as SearchField } from './search-field';
|
|
84
87
|
export { default as EmailField } from './email-field';
|