@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-es/button.js
CHANGED
|
@@ -92,7 +92,7 @@ import { getTextFromChildren as C } from "./utils/common.js";
|
|
|
92
92
|
import { useTrackingConfig as F, eventNames as z, eventCategories as M, eventActions as q } from "./utils/analytics.js";
|
|
93
93
|
import { useTheme as R } from "./hooks.js";
|
|
94
94
|
import { flattenChildren as J } from "./skins/utils.js";
|
|
95
|
-
import { inverseButtonVariants as Q, buttonVariants as U, small as p, isLoading as G, textContent as ee, inverseLinkVariants as te, linkVariants as ne, PADDING_X_LINK as A, PADDING_Y_LINK as T, textContentLink as ie, SMALL_SPINNER_SIZE as re, SPINNER_SIZE as ae, ICON_MARGIN_PX as
|
|
95
|
+
import { inverseButtonVariants as Q, buttonVariants as U, small as p, isLoading as G, textContent as ee, inverseLinkVariants as te, linkVariants as ne, PADDING_X_LINK as A, PADDING_Y_LINK as T, textContentLink as ie, SMALL_SPINNER_SIZE as re, SPINNER_SIZE as ae, ICON_MARGIN_PX as E, CHEVRON_MARGIN_LEFT_LINK as oe, loadingFiller as le, X_SMALL_PADDING_PX as se, X_PADDING_PX as ce, loadingContent as de, SMALL_ICON_SIZE as ue, ICON_SIZE as me } from "./button.css-mistica.js";
|
|
96
96
|
const x = (param)=>{
|
|
97
97
|
let { content: e, defaultIconSize: t, renderText: i } = param;
|
|
98
98
|
const l = J(e), u = l.length, c = [];
|
|
@@ -112,8 +112,8 @@ const x = (param)=>{
|
|
|
112
112
|
style: {
|
|
113
113
|
display: "flex",
|
|
114
114
|
alignItems: "center",
|
|
115
|
-
marginLeft: h ? 0 :
|
|
116
|
-
marginRight: o ? 0 :
|
|
115
|
+
marginLeft: h ? 0 : E,
|
|
116
|
+
marginRight: o ? 0 : E
|
|
117
117
|
},
|
|
118
118
|
children: /*#__PURE__*/ a.cloneElement(d, {
|
|
119
119
|
size: S(v)
|
|
@@ -142,7 +142,7 @@ const x = (param)=>{
|
|
|
142
142
|
style: {
|
|
143
143
|
display: "flex",
|
|
144
144
|
alignItems: "center",
|
|
145
|
-
marginRight:
|
|
145
|
+
marginRight: E
|
|
146
146
|
},
|
|
147
147
|
children: /* @__PURE__ */ n(d, {
|
|
148
148
|
size: S(o),
|
|
@@ -174,7 +174,7 @@ const x = (param)=>{
|
|
|
174
174
|
style: {
|
|
175
175
|
display: "flex",
|
|
176
176
|
alignItems: "center",
|
|
177
|
-
marginLeft:
|
|
177
|
+
marginLeft: E
|
|
178
178
|
},
|
|
179
179
|
children: /* @__PURE__ */ n(m, {
|
|
180
180
|
size: S(o),
|
|
@@ -188,7 +188,7 @@ const x = (param)=>{
|
|
|
188
188
|
"aria-hidden": !0,
|
|
189
189
|
style: l ? {
|
|
190
190
|
paddingLeft: r,
|
|
191
|
-
paddingRight:
|
|
191
|
+
paddingRight: E + 2 * (i ? se : ce)
|
|
192
192
|
} : void 0,
|
|
193
193
|
children: x({
|
|
194
194
|
content: l,
|
|
@@ -237,7 +237,7 @@ const x = (param)=>{
|
|
|
237
237
|
u
|
|
238
238
|
]);
|
|
239
239
|
var _e_trackingEvent;
|
|
240
|
-
const
|
|
240
|
+
const N = ()=>l === "google-analytics-4" ? {
|
|
241
241
|
name: z.userInteraction,
|
|
242
242
|
component_type: `${e.type}_button`,
|
|
243
243
|
component_copy: C(e.children)
|
|
@@ -268,7 +268,7 @@ const x = (param)=>{
|
|
|
268
268
|
style: _object_spread({
|
|
269
269
|
cursor: e.fake ? "pointer" : void 0
|
|
270
270
|
}, e.style),
|
|
271
|
-
trackingEvent: (_e_trackingEvent = e.trackingEvent) !== null && _e_trackingEvent !== void 0 ? _e_trackingEvent : e.trackEvent ?
|
|
271
|
+
trackingEvent: (_e_trackingEvent = e.trackingEvent) !== null && _e_trackingEvent !== void 0 ? _e_trackingEvent : e.trackEvent ? N() : void 0,
|
|
272
272
|
dataAttributes: e.dataAttributes,
|
|
273
273
|
"aria-label": e["aria-label"],
|
|
274
274
|
"aria-controls": e["aria-controls"],
|
|
@@ -326,9 +326,9 @@ const x = (param)=>{
|
|
|
326
326
|
"type"
|
|
327
327
|
]);
|
|
328
328
|
var _t_withChevron;
|
|
329
|
-
const { formStatus: l } = V(), u = O(), { textPresets: c } = R(), { eventFormat: s } = F(), { isDarkMode: f } = R(), { loadingText: d } = t, m = l === "sending", [h, o] = a.useState(!1), r = t.showSpinner || h, v = (_t_withChevron = t.withChevron) !== null && _t_withChevron !== void 0 ? _t_withChevron : !!t.href || !!t.to, [I,
|
|
329
|
+
const { formStatus: l } = V(), u = O(), { textPresets: c } = R(), { eventFormat: s } = F(), { isDarkMode: f } = R(), { loadingText: d } = t, m = l === "sending", [h, o] = a.useState(!1), r = t.showSpinner || h, v = (_t_withChevron = t.withChevron) !== null && _t_withChevron !== void 0 ? _t_withChevron : !!t.href || !!t.to, [I, N] = a.useState(!!r);
|
|
330
330
|
a.useEffect(()=>{
|
|
331
|
-
r && !I &&
|
|
331
|
+
r && !I && N(!0);
|
|
332
332
|
}, [
|
|
333
333
|
r,
|
|
334
334
|
I,
|
|
@@ -372,7 +372,7 @@ const x = (param)=>{
|
|
|
372
372
|
children: X({
|
|
373
373
|
showSpinner: r,
|
|
374
374
|
shouldRenderSpinner: I,
|
|
375
|
-
setShouldRenderSpinner:
|
|
375
|
+
setShouldRenderSpinner: N,
|
|
376
376
|
children: t.children,
|
|
377
377
|
loadingText: d,
|
|
378
378
|
small: !0,
|
package/dist-es/callout.js
CHANGED
|
@@ -62,17 +62,17 @@ import T from "./generated/mistica-icons/icon-close-regular.js";
|
|
|
62
62
|
import { IconButton as B } from "./icon-button.js";
|
|
63
63
|
import R from "classnames";
|
|
64
64
|
import y from "./button-group.js";
|
|
65
|
-
import { container as
|
|
66
|
-
import { vars as
|
|
67
|
-
import { sprinkles as
|
|
65
|
+
import { container as S, content as V } from "./callout.css-mistica.js";
|
|
66
|
+
import { vars as j } from "./image.css-mistica.js";
|
|
67
|
+
import { sprinkles as A } from "./sprinkles.css-mistica.js";
|
|
68
68
|
import { vars as e } from "./skins/skin-contract.css-mistica.js";
|
|
69
|
-
import { getPrefixedDataAttributes as
|
|
69
|
+
import { getPrefixedDataAttributes as N } from "./utils/dom.js";
|
|
70
70
|
import { applyCssVars as P } from "./utils/css.js";
|
|
71
71
|
const $ = (param)=>{
|
|
72
72
|
let { title: t, titleAs: c = "h2", description: d, icon: a, onClose: i, button: l, secondaryButton: s, buttonLink: m, "aria-label": p, dataAttributes: u } = param;
|
|
73
73
|
const f = x(), { texts: h } = v();
|
|
74
74
|
return /* @__PURE__ */ r("section", _object_spread_props(_object_spread({
|
|
75
|
-
className: R(
|
|
75
|
+
className: R(S, A({
|
|
76
76
|
background: {
|
|
77
77
|
inverse: e.colors.backgroundContainer,
|
|
78
78
|
alternative: e.colors.backgroundContainer,
|
|
@@ -80,10 +80,10 @@ const $ = (param)=>{
|
|
|
80
80
|
}[f]
|
|
81
81
|
})),
|
|
82
82
|
style: P({
|
|
83
|
-
[
|
|
83
|
+
[j.mediaBorderRadius]: e.borderRadii.mediaSmall
|
|
84
84
|
}),
|
|
85
85
|
"aria-label": p !== null && p !== void 0 ? p : t
|
|
86
|
-
},
|
|
86
|
+
}, N(u, "Callout")), {
|
|
87
87
|
children: /* @__PURE__ */ o(C, {
|
|
88
88
|
isInverse: !1,
|
|
89
89
|
children: [
|
|
@@ -92,7 +92,7 @@ const $ = (param)=>{
|
|
|
92
92
|
children: a
|
|
93
93
|
}),
|
|
94
94
|
/* @__PURE__ */ r("div", {
|
|
95
|
-
className:
|
|
95
|
+
className: V,
|
|
96
96
|
children: /* @__PURE__ */ o(n, {
|
|
97
97
|
space: 16,
|
|
98
98
|
children: [
|
package/dist-es/carousel.js
CHANGED
|
@@ -183,9 +183,9 @@ const ve = (e, t)=>{
|
|
|
183
183
|
for(let r = 0; r < t.length; r++)r === 0 ? s.push(t[0]) : s.push((t[r] + t[r - 1]) / 2);
|
|
184
184
|
for(let r = s.length - 1; r >= 0; r--)if (e - s[r] >= -1) return r;
|
|
185
185
|
return 0;
|
|
186
|
-
}, Me = 5e3,
|
|
187
|
-
let { items: e, itemStyle: t, itemClassName: s, withBullets: r, renderBullets: d, initialActiveItem: h, itemsPerPage: w, itemsToScroll: i, mobilePageOffset: u, gap: C, free: b, centered:
|
|
188
|
-
const { texts: I, platformOverrides:
|
|
186
|
+
}, Me = 5e3, Se = (param)=>{
|
|
187
|
+
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;
|
|
188
|
+
const { texts: I, platformOverrides: N, skinName: H } = he(), J = bt(), a = vt(J || "large", w), { isDesktopOrBigger: E, isTablet: A } = de(), j = A ? a.tablet : a.mobile, P = Math.max(Math.floor(E ? a.desktop : j), 1), l = o.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] = o.useState({
|
|
189
189
|
scrollLeft: 0,
|
|
190
190
|
scrollRight: 0
|
|
191
191
|
}), [Q, Re] = o.useState([]), F = o.useMemo(()=>ie(Q, R), [
|
|
@@ -204,7 +204,7 @@ const ve = (e, t)=>{
|
|
|
204
204
|
const Y = c.scrollWidth - c.clientWidth;
|
|
205
205
|
Re(Array.from(c.querySelectorAll("[data-item]")).map((V, q)=>{
|
|
206
206
|
if (q === e.length - 1) return Y;
|
|
207
|
-
const Z = V.offsetLeft, We = parseInt(getComputedStyle(V).scrollMargin), Ae =
|
|
207
|
+
const Z = V.offsetLeft, We = parseInt(getComputedStyle(V).scrollMargin), Ae = k && !E ? Z - V.clientWidth / 2 : Z;
|
|
208
208
|
return Math.min(Ae - We - c.offsetLeft, Y);
|
|
209
209
|
}));
|
|
210
210
|
};
|
|
@@ -223,7 +223,7 @@ const ve = (e, t)=>{
|
|
|
223
223
|
a.mobile,
|
|
224
224
|
R,
|
|
225
225
|
C,
|
|
226
|
-
|
|
226
|
+
k,
|
|
227
227
|
E,
|
|
228
228
|
e.length
|
|
229
229
|
]);
|
|
@@ -287,35 +287,35 @@ const ve = (e, t)=>{
|
|
|
287
287
|
G,
|
|
288
288
|
le
|
|
289
289
|
]);
|
|
290
|
-
const
|
|
290
|
+
const S = xt(D, F), ne = o.useRef(!h), ce = o.useRef(0);
|
|
291
291
|
o.useEffect(()=>{
|
|
292
292
|
if (y) {
|
|
293
|
-
const c = Math.min((
|
|
293
|
+
const c = Math.min((S + 1) * P - 1, e.length - 1), f = [];
|
|
294
294
|
for(let p = 0; p < P; p++){
|
|
295
295
|
const g = c - p;
|
|
296
296
|
g >= 0 && f.unshift(g);
|
|
297
297
|
}
|
|
298
|
-
ne.current ? ce.current !==
|
|
299
|
-
pageIndex:
|
|
298
|
+
ne.current ? ce.current !== S && y({
|
|
299
|
+
pageIndex: S,
|
|
300
300
|
shownItemIndexes: f
|
|
301
|
-
}) : ne.current = f.includes(h || 0), ce.current =
|
|
301
|
+
}) : ne.current = f.includes(h || 0), ce.current = S;
|
|
302
302
|
}
|
|
303
303
|
}, [
|
|
304
|
-
|
|
304
|
+
S,
|
|
305
305
|
e.length,
|
|
306
306
|
P,
|
|
307
307
|
h,
|
|
308
308
|
y
|
|
309
309
|
]);
|
|
310
310
|
const T = o.useContext(re), ee = o.useMemo(()=>({
|
|
311
|
-
currentIndex:
|
|
311
|
+
currentIndex: S,
|
|
312
312
|
numPages: {
|
|
313
313
|
mobile: m,
|
|
314
314
|
tablet: v,
|
|
315
315
|
desktop: M
|
|
316
316
|
}
|
|
317
317
|
}), [
|
|
318
|
-
|
|
318
|
+
S,
|
|
319
319
|
M,
|
|
320
320
|
m,
|
|
321
321
|
v
|
|
@@ -332,7 +332,7 @@ const ve = (e, t)=>{
|
|
|
332
332
|
let U = null;
|
|
333
333
|
d ? U = d({
|
|
334
334
|
numPages: R,
|
|
335
|
-
currentIndex:
|
|
335
|
+
currentIndex: S,
|
|
336
336
|
onPress: B
|
|
337
337
|
}) : r && (U = /* @__PURE__ */ n(xe, _object_spread_props(_object_spread({}, ee), {
|
|
338
338
|
onPress: B
|
|
@@ -357,7 +357,7 @@ const ve = (e, t)=>{
|
|
|
357
357
|
}),
|
|
358
358
|
/* @__PURE__ */ n("div", {
|
|
359
359
|
className: $(lt, {
|
|
360
|
-
[nt]:
|
|
360
|
+
[nt]: k,
|
|
361
361
|
[ct]: m > 1,
|
|
362
362
|
[at]: v > 1
|
|
363
363
|
}),
|
|
@@ -378,13 +378,13 @@ const ve = (e, t)=>{
|
|
|
378
378
|
// the bottom of the scrollable area in retina displays when it has a height with
|
|
379
379
|
// decimals. This extra padding avoids that line to partially cover the carousel
|
|
380
380
|
// slides border:
|
|
381
|
-
paddingBottom: ze(
|
|
381
|
+
paddingBottom: ze(N) && !_e(N) ? 0.5 : void 0
|
|
382
382
|
}),
|
|
383
383
|
ref: l,
|
|
384
384
|
children: e.map((c, f)=>/* @__PURE__ */ n("div", {
|
|
385
385
|
className: $(it, s),
|
|
386
386
|
style: _object_spread_props(_object_spread({}, t), {
|
|
387
|
-
scrollSnapStop: be(
|
|
387
|
+
scrollSnapStop: be(N) ? "always" : "normal"
|
|
388
388
|
}),
|
|
389
389
|
"data-item": !0,
|
|
390
390
|
children: c
|
|
@@ -412,7 +412,7 @@ const ve = (e, t)=>{
|
|
|
412
412
|
})
|
|
413
413
|
]
|
|
414
414
|
}));
|
|
415
|
-
},
|
|
415
|
+
}, ke = ()=>{
|
|
416
416
|
const [e, t] = o.useState(1);
|
|
417
417
|
return o.useEffect(()=>{
|
|
418
418
|
const s = ()=>{
|
|
@@ -423,14 +423,14 @@ const ve = (e, t)=>{
|
|
|
423
423
|
};
|
|
424
424
|
}, []), e;
|
|
425
425
|
}, _t = (e)=>{
|
|
426
|
-
const t =
|
|
427
|
-
return /* @__PURE__ */ /*#__PURE__*/ De(
|
|
426
|
+
const t = ke();
|
|
427
|
+
return /* @__PURE__ */ /*#__PURE__*/ De(Se, _object_spread_props(_object_spread({}, e), {
|
|
428
428
|
key: t
|
|
429
429
|
}));
|
|
430
430
|
}, jt = (param)=>{
|
|
431
431
|
let { items: e, itemStyle: t, itemClassName: s, withBullets: r, renderBullets: d, initialActiveItem: h, onPageChange: w, dataAttributes: i } = param;
|
|
432
|
-
const u =
|
|
433
|
-
return /* @__PURE__ */ n(
|
|
432
|
+
const u = ke();
|
|
433
|
+
return /* @__PURE__ */ n(Se, {
|
|
434
434
|
items: e,
|
|
435
435
|
itemStyle: t,
|
|
436
436
|
itemClassName: s,
|
|
@@ -448,15 +448,15 @@ const ve = (e, t)=>{
|
|
|
448
448
|
onPageChange: w,
|
|
449
449
|
dataAttributes: i
|
|
450
450
|
}, u);
|
|
451
|
-
},
|
|
451
|
+
}, Ne = /*#__PURE__*/ o.createContext(!1), Ft = ()=>o.useContext(Ne), Ct = (param)=>{
|
|
452
452
|
let { children: e } = param;
|
|
453
|
-
return /* @__PURE__ */ n(
|
|
453
|
+
return /* @__PURE__ */ n(Ne.Provider, {
|
|
454
454
|
value: !0,
|
|
455
455
|
children: e
|
|
456
456
|
});
|
|
457
457
|
}, Kt = (param)=>{
|
|
458
458
|
let { items: e, withBullets: t, autoplay: s, initialPageIndex: r = 0, onPageChange: d, dataAttributes: h, inverseBullets: w = !0 } = param;
|
|
459
|
-
const { texts: i, platformOverrides: u } = he(), C = o.useContext(re), b = o.useRef(null), [{ scrollLeft:
|
|
459
|
+
const { texts: i, platformOverrides: u } = he(), C = o.useContext(re), b = o.useRef(null), [{ scrollLeft: k, scrollRight: x }, y] = o.useState({
|
|
460
460
|
scrollLeft: 0,
|
|
461
461
|
scrollRight: 0
|
|
462
462
|
}), W = o.useCallback(()=>{
|
|
@@ -471,7 +471,7 @@ const ve = (e, t)=>{
|
|
|
471
471
|
left: l.clientWidth,
|
|
472
472
|
behavior: "smooth"
|
|
473
473
|
});
|
|
474
|
-
}, []),
|
|
474
|
+
}, []), N = o.useCallback(function(l) {
|
|
475
475
|
let m = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : !0;
|
|
476
476
|
const v = b.current;
|
|
477
477
|
v && v.scrollTo({
|
|
@@ -480,7 +480,7 @@ const ve = (e, t)=>{
|
|
|
480
480
|
});
|
|
481
481
|
}, [
|
|
482
482
|
b
|
|
483
|
-
]), H = x !== 0, J =
|
|
483
|
+
]), H = x !== 0, J = k !== 0, a = b.current ? Math.floor((k + b.current.clientWidth / 2) / b.current.clientWidth) : 0;
|
|
484
484
|
o.useLayoutEffect(()=>{
|
|
485
485
|
const l = b.current;
|
|
486
486
|
if (l) {
|
|
@@ -541,13 +541,13 @@ const ve = (e, t)=>{
|
|
|
541
541
|
e.length
|
|
542
542
|
]);
|
|
543
543
|
return o.useEffect(()=>{
|
|
544
|
-
C && (C.setGoPrev(W), C.setGoNext(I), C.setGoToPage(
|
|
544
|
+
C && (C.setGoPrev(W), C.setGoNext(I), C.setGoToPage(N), C.setBulletsProps(P));
|
|
545
545
|
}, [
|
|
546
546
|
C,
|
|
547
547
|
I,
|
|
548
548
|
W,
|
|
549
549
|
P,
|
|
550
|
-
|
|
550
|
+
N
|
|
551
551
|
]), /* @__PURE__ */ n(Ct, {
|
|
552
552
|
children: /* @__PURE__ */ te("div", _object_spread_props(_object_spread({
|
|
553
553
|
className: qe
|
package/dist-es/checkbox.js
CHANGED
|
@@ -51,11 +51,11 @@ function _object_spread_props(target, source) {
|
|
|
51
51
|
}
|
|
52
52
|
return target;
|
|
53
53
|
}
|
|
54
|
-
import { jsx as a, jsxs as
|
|
54
|
+
import { jsx as a, jsxs as A } from "react/jsx-runtime";
|
|
55
55
|
import * as m from "react";
|
|
56
|
-
import { SPACE as
|
|
57
|
-
import { useControlProps as
|
|
58
|
-
import
|
|
56
|
+
import { SPACE as D } from "./utils/keys.js";
|
|
57
|
+
import { useControlProps as L } from "./form-context.js";
|
|
58
|
+
import N from "./inline.js";
|
|
59
59
|
import { Text3 as f } from "./text.js";
|
|
60
60
|
import { useAriaId as P, useTheme as R } from "./hooks.js";
|
|
61
61
|
import n from "classnames";
|
|
@@ -95,7 +95,7 @@ const B = (param)=>{
|
|
|
95
95
|
children: o
|
|
96
96
|
});
|
|
97
97
|
}, K = /*#__PURE__*/ m.forwardRef((e, c)=>{
|
|
98
|
-
const l = P(e["aria-labelledby"]), o = e["aria-label"], C = o || e["aria-labelledby"], { defaultValue: g, value: t, onChange: s, focusableRef: w, disabled: i } =
|
|
98
|
+
const l = P(e["aria-labelledby"]), o = e["aria-label"], C = o || e["aria-labelledby"], { defaultValue: g, value: t, onChange: s, focusableRef: w, disabled: i } = L({
|
|
99
99
|
name: e.name,
|
|
100
100
|
value: e.checked,
|
|
101
101
|
defaultValue: e.defaultChecked,
|
|
@@ -104,7 +104,7 @@ const B = (param)=>{
|
|
|
104
104
|
}), [r, y] = m.useState(!!g), h = ()=>{
|
|
105
105
|
t === void 0 ? (y(!r), s(!r)) : s(!t);
|
|
106
106
|
}, I = (d)=>{
|
|
107
|
-
d.key ===
|
|
107
|
+
d.key === D && (d.preventDefault(), d.stopPropagation(), h());
|
|
108
108
|
}, b = /* @__PURE__ */ a(B, {
|
|
109
109
|
disabled: i,
|
|
110
110
|
isChecked: t !== null && t !== void 0 ? t : r
|
|
@@ -131,7 +131,7 @@ const B = (param)=>{
|
|
|
131
131
|
labelId: l,
|
|
132
132
|
checked: t !== null && t !== void 0 ? t : r,
|
|
133
133
|
disabled: !!i
|
|
134
|
-
}) : /* @__PURE__ */ N
|
|
134
|
+
}) : /* @__PURE__ */ A(N, {
|
|
135
135
|
space: 16,
|
|
136
136
|
children: [
|
|
137
137
|
/* @__PURE__ */ a(f, {
|
package/dist-es/chip.js
CHANGED
|
@@ -52,7 +52,7 @@ function _object_spread_props(target, source) {
|
|
|
52
52
|
return target;
|
|
53
53
|
}
|
|
54
54
|
import { jsxs as g, Fragment as k, jsx as t } from "react/jsx-runtime";
|
|
55
|
-
import
|
|
55
|
+
import N from "classnames";
|
|
56
56
|
import { useTheme as V } from "./hooks.js";
|
|
57
57
|
import A from "./badge.js";
|
|
58
58
|
import i from "./box.js";
|
|
@@ -139,13 +139,13 @@ const $ = (e)=>{
|
|
|
139
139
|
}));
|
|
140
140
|
const I = d !== void 0 || e.href || e.onPress || e.to, a = _object_spread({
|
|
141
141
|
"component-name": "Chip"
|
|
142
|
-
}, s), o = (
|
|
143
|
-
className:
|
|
142
|
+
}, s), o = (B)=>/* @__PURE__ */ t(i, {
|
|
143
|
+
className: N(n[d ? "active" : h ? "overAlternative" : "default"], {
|
|
144
144
|
[M[T ? "dark" : "light"]]: I
|
|
145
145
|
}),
|
|
146
146
|
paddingLeft: u,
|
|
147
147
|
paddingRight: R,
|
|
148
|
-
dataAttributes:
|
|
148
|
+
dataAttributes: B,
|
|
149
149
|
children: f
|
|
150
150
|
});
|
|
151
151
|
return e.onPress ? /* @__PURE__ */ t(v, {
|
|
@@ -87,8 +87,8 @@ import { dataCard as $, touchableContainer as q, touchableCardOverlay as J, card
|
|
|
87
87
|
import { vars as me } from "../image.css-mistica.js";
|
|
88
88
|
import H from "../divider.js";
|
|
89
89
|
import { Text2 as v, Text as he } from "../text.js";
|
|
90
|
-
import { vars as
|
|
91
|
-
import
|
|
90
|
+
import { vars as y } from "../skins/skin-contract.css-mistica.js";
|
|
91
|
+
import N from "../box.js";
|
|
92
92
|
import pe from "../touchable.js";
|
|
93
93
|
import h from "classnames";
|
|
94
94
|
import { CardActionsGroup as ue } from "../card.js";
|
|
@@ -96,7 +96,7 @@ import { useTheme as ge } from "../hooks.js";
|
|
|
96
96
|
import { getPrefixedDataAttributes as fe } from "../utils/dom.js";
|
|
97
97
|
import ve from "../inline.js";
|
|
98
98
|
import { applyCssVars as P } from "../utils/css.js";
|
|
99
|
-
const
|
|
99
|
+
const ye = (_param)=>{
|
|
100
100
|
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, [
|
|
101
101
|
"headline",
|
|
102
102
|
"pretitle",
|
|
@@ -125,7 +125,7 @@ const Ne = (_param)=>{
|
|
|
125
125
|
children: /* @__PURE__ */ e(k, {})
|
|
126
126
|
})),
|
|
127
127
|
i && /* @__PURE__ */ e(v, {
|
|
128
|
-
color:
|
|
128
|
+
color: y.colors.textPrimary,
|
|
129
129
|
truncate: p,
|
|
130
130
|
as: n,
|
|
131
131
|
regular: !0,
|
|
@@ -144,7 +144,7 @@ const Ne = (_param)=>{
|
|
|
144
144
|
children: d
|
|
145
145
|
}),
|
|
146
146
|
/* @__PURE__ */ e(v, {
|
|
147
|
-
color:
|
|
147
|
+
color: y.colors.textPrimary,
|
|
148
148
|
truncate: o,
|
|
149
149
|
as: "p",
|
|
150
150
|
regular: !0,
|
|
@@ -155,13 +155,13 @@ const Ne = (_param)=>{
|
|
|
155
155
|
truncate: u,
|
|
156
156
|
as: "p",
|
|
157
157
|
regular: !0,
|
|
158
|
-
color:
|
|
158
|
+
color: y.colors.textSecondary,
|
|
159
159
|
hyphens: "auto",
|
|
160
160
|
children: r
|
|
161
161
|
})
|
|
162
162
|
]
|
|
163
163
|
});
|
|
164
|
-
},
|
|
164
|
+
}, Ne = (param)=>{
|
|
165
165
|
let { button: a, footerImage: i, footerText: n, footerTextLinesMax: p, buttonLink: d } = param;
|
|
166
166
|
const c = !!a, l = !!i, m = !!n, o = !!d, r = c && (l || m) && o, u = o && !r ? "178px" : "";
|
|
167
167
|
return /* @__PURE__ */ t(k, {
|
|
@@ -182,7 +182,7 @@ const Ne = (_param)=>{
|
|
|
182
182
|
paddingTop: 16
|
|
183
183
|
})),
|
|
184
184
|
children: [
|
|
185
|
-
l && /* @__PURE__ */ e(
|
|
185
|
+
l && /* @__PURE__ */ e(N, {
|
|
186
186
|
paddingRight: 16,
|
|
187
187
|
className: b({
|
|
188
188
|
alignItems: "center",
|
|
@@ -190,7 +190,7 @@ const Ne = (_param)=>{
|
|
|
190
190
|
}),
|
|
191
191
|
children: /* @__PURE__ */ e("div", {
|
|
192
192
|
style: P({
|
|
193
|
-
[me.mediaBorderRadius]:
|
|
193
|
+
[me.mediaBorderRadius]: y.borderRadii.mediaSmall
|
|
194
194
|
}),
|
|
195
195
|
children: i
|
|
196
196
|
})
|
|
@@ -268,7 +268,7 @@ const Ne = (_param)=>{
|
|
|
268
268
|
}),
|
|
269
269
|
/* @__PURE__ */ e("div", {
|
|
270
270
|
className: h(K, !w && !F ? Q : ""),
|
|
271
|
-
children: /* @__PURE__ */ e(
|
|
271
|
+
children: /* @__PURE__ */ e(N, {
|
|
272
272
|
paddingTop: 8,
|
|
273
273
|
children: /* @__PURE__ */ t(ve, {
|
|
274
274
|
space: 0,
|
|
@@ -277,7 +277,7 @@ const Ne = (_param)=>{
|
|
|
277
277
|
space: 8,
|
|
278
278
|
children: [
|
|
279
279
|
a,
|
|
280
|
-
/* @__PURE__ */ e(
|
|
280
|
+
/* @__PURE__ */ e(ye, _object_spread({
|
|
281
281
|
headline: i,
|
|
282
282
|
pretitle: n,
|
|
283
283
|
pretitleAs: p,
|
|
@@ -308,7 +308,7 @@ const Ne = (_param)=>{
|
|
|
308
308
|
flexGrow: 1
|
|
309
309
|
}
|
|
310
310
|
}),
|
|
311
|
-
F && /* @__PURE__ */ e(
|
|
311
|
+
F && /* @__PURE__ */ e(N, {
|
|
312
312
|
paddingTop: 16,
|
|
313
313
|
paddingBottom: 24,
|
|
314
314
|
width: "100%",
|
|
@@ -319,7 +319,7 @@ const Ne = (_param)=>{
|
|
|
319
319
|
className: _,
|
|
320
320
|
children: O
|
|
321
321
|
}),
|
|
322
|
-
I + 1 !== s.length && /* @__PURE__ */ e(
|
|
322
|
+
I + 1 !== s.length && /* @__PURE__ */ e(N, {
|
|
323
323
|
paddingY: C,
|
|
324
324
|
children: /* @__PURE__ */ e(H, {})
|
|
325
325
|
})
|
|
@@ -333,7 +333,7 @@ const Ne = (_param)=>{
|
|
|
333
333
|
})
|
|
334
334
|
]
|
|
335
335
|
}),
|
|
336
|
-
w && /* @__PURE__ */ e(
|
|
336
|
+
w && /* @__PURE__ */ e(Ne, _object_spread({}, L))
|
|
337
337
|
]
|
|
338
338
|
})
|
|
339
339
|
}));
|
package/dist-es/counter.js
CHANGED
|
@@ -54,9 +54,9 @@ function _object_spread_props(target, source) {
|
|
|
54
54
|
import { jsx as r, jsxs as I } from "react/jsx-runtime";
|
|
55
55
|
import * as V from "react";
|
|
56
56
|
import { getPrefixedDataAttributes as L } from "./utils/dom.js";
|
|
57
|
-
import { counter as R, disabled as
|
|
57
|
+
import { counter as R, disabled as g, buttonContainer as B, hasTrashIcon as j, isButtonDisabled as M, button as y, buttonBackground as S, decreaseButtonIcon as E, trashButtonIcon as O, valueContainer as Q, defaultButtonIcon as Z } from "./counter.css-mistica.js";
|
|
58
58
|
import { useThemeVariant as _, ThemeVariant as q } from "./theme-variant-context.js";
|
|
59
|
-
import { vars as
|
|
59
|
+
import { vars as c } from "./skins/skin-contract.css-mistica.js";
|
|
60
60
|
import w from "./inline.js";
|
|
61
61
|
import { Text3 as F } from "./text.js";
|
|
62
62
|
import { BaseTouchable as P } from "./touchable.js";
|
|
@@ -64,46 +64,46 @@ import G from "./generated/mistica-icons/icon-subtract-regular.js";
|
|
|
64
64
|
import H from "./generated/mistica-icons/icon-add-more-regular.js";
|
|
65
65
|
import J from "./generated/mistica-icons/icon-trash-can-regular.js";
|
|
66
66
|
import { useTheme as K } from "./hooks.js";
|
|
67
|
-
import
|
|
67
|
+
import N from "classnames";
|
|
68
68
|
import U from "./screen-reader-only.js";
|
|
69
69
|
const x = 20, W = (param)=>{
|
|
70
|
-
let { value: h, defaultValue:
|
|
71
|
-
const i = h !== void 0, f = V.useCallback((
|
|
70
|
+
let { value: h, defaultValue: b, min: m, max: s, onChangeValue: a } = param;
|
|
71
|
+
const i = h !== void 0, f = V.useCallback((n)=>n === void 0 ? m : Math.max(m, Math.min(s, n)), [
|
|
72
72
|
m,
|
|
73
73
|
s
|
|
74
|
-
]), [e, p] = V.useState(f(
|
|
75
|
-
i || p(
|
|
74
|
+
]), [e, p] = V.useState(f(b)), v = (n)=>{
|
|
75
|
+
i || p(n), a == null || a(n);
|
|
76
76
|
};
|
|
77
77
|
return [
|
|
78
78
|
i ? f(h) : e,
|
|
79
79
|
v
|
|
80
80
|
];
|
|
81
81
|
}, X = (param)=>{
|
|
82
|
-
let { value: h, defaultValue:
|
|
82
|
+
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;
|
|
83
83
|
const A = _(), { texts: u } = K(), l = a === void 0 ? 0 : a, d = Math.max(l, i === void 0 ? 999 : i), [t, T] = W({
|
|
84
84
|
value: h,
|
|
85
|
-
defaultValue:
|
|
85
|
+
defaultValue: b,
|
|
86
86
|
min: l,
|
|
87
87
|
max: d,
|
|
88
88
|
onChangeValue: m
|
|
89
|
-
}), o = !!s && t === l, D = ()=>p === void 0 ? u.counterRemoveLabel : p, $ = ()=>v === void 0 ? u.counterIncreaseLabel : v, k = ()=>
|
|
89
|
+
}), 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}` : ""}`;
|
|
90
90
|
return /* @__PURE__ */ r("div", _object_spread_props(_object_spread({
|
|
91
|
-
className:
|
|
92
|
-
[
|
|
91
|
+
className: N(R, {
|
|
92
|
+
[g]: e
|
|
93
93
|
})
|
|
94
94
|
}, L(f, "Counter")), {
|
|
95
95
|
style: {
|
|
96
|
-
border: `1px solid ${A === "inverse" ?
|
|
96
|
+
border: `1px solid ${A === "inverse" ? c.colors.backgroundContainer : c.colors.border}`
|
|
97
97
|
},
|
|
98
98
|
children: /* @__PURE__ */ I(w, {
|
|
99
99
|
space: 8,
|
|
100
100
|
alignItems: "center",
|
|
101
101
|
children: [
|
|
102
102
|
/* @__PURE__ */ r("div", {
|
|
103
|
-
className:
|
|
103
|
+
className: N(B, {
|
|
104
104
|
[j]: o,
|
|
105
105
|
[M]: e || !o && t === l,
|
|
106
|
-
[
|
|
106
|
+
[g]: !e && !o && t === l
|
|
107
107
|
}),
|
|
108
108
|
children: /* @__PURE__ */ I(P, {
|
|
109
109
|
className: y,
|
|
@@ -119,7 +119,7 @@ const x = 20, W = (param)=>{
|
|
|
119
119
|
"aria-hidden": o,
|
|
120
120
|
children: /* @__PURE__ */ r(G, {
|
|
121
121
|
size: x,
|
|
122
|
-
color: t === l && !o || e ?
|
|
122
|
+
color: t === l && !o || e ? c.colors.control : c.colors.controlActivated
|
|
123
123
|
})
|
|
124
124
|
}),
|
|
125
125
|
/* @__PURE__ */ r("div", {
|
|
@@ -127,7 +127,7 @@ const x = 20, W = (param)=>{
|
|
|
127
127
|
"aria-hidden": !o,
|
|
128
128
|
children: /* @__PURE__ */ r(J, {
|
|
129
129
|
size: x,
|
|
130
|
-
color:
|
|
130
|
+
color: c.colors.controlError
|
|
131
131
|
})
|
|
132
132
|
})
|
|
133
133
|
]
|
|
@@ -145,7 +145,7 @@ const x = 20, W = (param)=>{
|
|
|
145
145
|
"aria-hidden": !0,
|
|
146
146
|
children: /* @__PURE__ */ r(F, {
|
|
147
147
|
regular: !0,
|
|
148
|
-
color:
|
|
148
|
+
color: c.colors.textPrimary,
|
|
149
149
|
children: t
|
|
150
150
|
})
|
|
151
151
|
}),
|
|
@@ -158,9 +158,9 @@ const x = 20, W = (param)=>{
|
|
|
158
158
|
})
|
|
159
159
|
}),
|
|
160
160
|
/* @__PURE__ */ r("div", {
|
|
161
|
-
className:
|
|
161
|
+
className: N(B, {
|
|
162
162
|
[M]: e || t === d,
|
|
163
|
-
[
|
|
163
|
+
[g]: !e && t === d
|
|
164
164
|
}),
|
|
165
165
|
children: /* @__PURE__ */ I(P, {
|
|
166
166
|
className: y,
|
|
@@ -175,7 +175,7 @@ const x = 20, W = (param)=>{
|
|
|
175
175
|
className: Z,
|
|
176
176
|
children: /* @__PURE__ */ r(H, {
|
|
177
177
|
size: x,
|
|
178
|
-
color: t === d || e ?
|
|
178
|
+
color: t === d || e ? c.colors.control : c.colors.controlActivated
|
|
179
179
|
})
|
|
180
180
|
})
|
|
181
181
|
]
|