@telefonica/mistica 15.6.1 → 15.8.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.d.ts +4 -6
- package/dist/accordion.js +99 -91
- package/dist/card.d.ts +2 -0
- package/dist/card.js +264 -248
- package/dist/community/blocks.js +1 -0
- package/dist/empty-state.js +7 -6
- package/dist/icons/icon-chevron.css-mistica.js +25 -0
- package/dist/icons/icon-chevron.css.d.ts +5 -0
- package/dist/icons/icon-chevron.css.ts.vanilla.css-mistica.js +11 -0
- package/dist/icons/icon-chevron.js +27 -20
- package/dist/image.js +13 -12
- package/dist/list.js +22 -22
- package/dist/package-version.js +1 -1
- package/dist/progress-bar.d.ts +2 -0
- package/dist/progress-bar.js +44 -35
- package/dist/stacking-group.js +7 -7
- package/dist/text-field-components.js +4 -4
- package/dist/utils/aspect-ratio-support.js +18 -18
- package/dist-es/accordion.js +131 -120
- package/dist-es/card.js +335 -319
- package/dist-es/community/blocks.js +1 -0
- package/dist-es/empty-state.js +9 -8
- package/dist-es/icons/icon-chevron.css-mistica.js +5 -0
- package/dist-es/icons/icon-chevron.css.ts.vanilla.css-mistica.js +2 -0
- package/dist-es/icons/icon-chevron.js +26 -24
- package/dist-es/image.js +19 -18
- package/dist-es/list.js +25 -25
- package/dist-es/package-version.js +1 -1
- package/dist-es/progress-bar.js +54 -45
- package/dist-es/stacking-group.js +14 -14
- package/dist-es/style.css +1 -1
- package/dist-es/text-field-components.js +11 -11
- package/dist-es/utils/aspect-ratio-support.js +22 -22
- package/package.json +1 -1
package/dist-es/empty-state.js
CHANGED
|
@@ -64,10 +64,10 @@ import { vars as a } from "./skins/skin-contract.css-mistica.js";
|
|
|
64
64
|
import { AspectRatioContainer as D } from "./utils/aspect-ratio-support.js";
|
|
65
65
|
import { getPrefixedDataAttributes as P } from "./utils/dom.js";
|
|
66
66
|
import { sprinkles as R } from "./sprinkles.css-mistica.js";
|
|
67
|
-
import { applyCssVars as
|
|
68
|
-
const
|
|
69
|
-
let { title: c, titleAs: p = "h1", description: d, button: e, buttonLink: f, largeImageUrl: o, imageUrl: i, icon: m, "aria-label": g, dataAttributes:
|
|
70
|
-
const { isDarkMode:
|
|
67
|
+
import { applyCssVars as w } from "./utils/css.js";
|
|
68
|
+
const G = (param)=>{
|
|
69
|
+
let { title: c, titleAs: p = "h1", description: d, button: e, buttonLink: f, largeImageUrl: o, imageUrl: i, icon: m, "aria-label": g, dataAttributes: h } = param;
|
|
70
|
+
const { isDarkMode: v } = C(), s = k(), u = i ? /* @__PURE__ */ r("img", {
|
|
71
71
|
className: A,
|
|
72
72
|
alt: "",
|
|
73
73
|
src: i
|
|
@@ -82,12 +82,12 @@ const M = (param)=>{
|
|
|
82
82
|
className: x(E, s ? T : R({
|
|
83
83
|
border: "regular"
|
|
84
84
|
})),
|
|
85
|
-
style:
|
|
86
|
-
[V.backgroundColor]: s && !
|
|
85
|
+
style: w({
|
|
86
|
+
[V.backgroundColor]: s && !v ? a.colors.backgroundBrand : a.colors.backgroundContainer
|
|
87
87
|
}),
|
|
88
88
|
"aria-label": g,
|
|
89
89
|
role: "region"
|
|
90
|
-
}, P(
|
|
90
|
+
}, P(h, "EmptyState")), {
|
|
91
91
|
children: [
|
|
92
92
|
/* @__PURE__ */ r("div", {
|
|
93
93
|
style: {
|
|
@@ -129,6 +129,7 @@ const M = (param)=>{
|
|
|
129
129
|
aspectRatio: 16 / 9,
|
|
130
130
|
className: b,
|
|
131
131
|
height: "100%",
|
|
132
|
+
width: "100%",
|
|
132
133
|
children: /* @__PURE__ */ r("div", {
|
|
133
134
|
className: j,
|
|
134
135
|
style: {
|
|
@@ -139,5 +140,5 @@ const M = (param)=>{
|
|
|
139
140
|
})
|
|
140
141
|
]
|
|
141
142
|
}));
|
|
142
|
-
}, _ =
|
|
143
|
+
}, _ = G;
|
|
143
144
|
export { _ as default };
|
|
@@ -26,44 +26,46 @@ function _object_spread(target) {
|
|
|
26
26
|
}
|
|
27
27
|
return target;
|
|
28
28
|
}
|
|
29
|
-
import { jsx as
|
|
30
|
-
import
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
29
|
+
import { jsx as e } from "react/jsx-runtime";
|
|
30
|
+
import c from "classnames";
|
|
31
|
+
import { vars as m } from "../skins/skin-contract.css-mistica.js";
|
|
32
|
+
import { applyCssVars as h } from "../utils/css.js";
|
|
33
|
+
import { chevronRotateTransition as p, vars as v, chevronColorTransition as f } from "./icon-chevron.css-mistica.js";
|
|
34
|
+
const g = (param)=>{
|
|
35
|
+
let { size: o, color: r, transform: t, transitionDuration: n, className: s, style: a } = param;
|
|
36
|
+
return /* @__PURE__ */ e("svg", {
|
|
34
37
|
role: "presentation",
|
|
35
38
|
width: o,
|
|
36
39
|
height: o,
|
|
37
40
|
viewBox: "0 0 24 24",
|
|
38
|
-
className:
|
|
41
|
+
className: c(s, p),
|
|
39
42
|
style: _object_spread({
|
|
40
|
-
transform:
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
},
|
|
43
|
+
transform: t
|
|
44
|
+
}, a, h({
|
|
45
|
+
[v.transitionDuration]: `${n}ms`
|
|
46
|
+
})),
|
|
47
|
+
children: /* @__PURE__ */ e("path", {
|
|
48
|
+
className: f,
|
|
47
49
|
fill: r,
|
|
48
50
|
fillRule: "evenodd",
|
|
49
51
|
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"
|
|
50
52
|
})
|
|
51
53
|
});
|
|
52
|
-
},
|
|
54
|
+
}, d = {
|
|
53
55
|
up: -90,
|
|
54
56
|
down: 90,
|
|
55
57
|
left: 180,
|
|
56
58
|
right: 0
|
|
57
|
-
},
|
|
58
|
-
let { size: o = 24, color: r, className:
|
|
59
|
-
const i = r ||
|
|
59
|
+
}, u = (param)=>{
|
|
60
|
+
let { size: o = 24, color: r, className: t, style: n, transitionDuration: s = 300, direction: a = "right" } = param;
|
|
61
|
+
const i = r || m.colors.neutralHigh, l = {
|
|
60
62
|
size: o,
|
|
61
63
|
color: i,
|
|
62
|
-
transform: `rotate(${
|
|
63
|
-
className:
|
|
64
|
-
transitionDuration:
|
|
65
|
-
style:
|
|
64
|
+
transform: `rotate(${d[a]}deg)`,
|
|
65
|
+
className: t,
|
|
66
|
+
transitionDuration: s,
|
|
67
|
+
style: n
|
|
66
68
|
};
|
|
67
|
-
return /* @__PURE__ */
|
|
68
|
-
},
|
|
69
|
-
export {
|
|
69
|
+
return /* @__PURE__ */ e(g, _object_spread({}, l));
|
|
70
|
+
}, I = u;
|
|
71
|
+
export { I as default };
|
package/dist-es/image.js
CHANGED
|
@@ -78,10 +78,10 @@ function _object_without_properties_loose(source, excluded) {
|
|
|
78
78
|
}
|
|
79
79
|
return target;
|
|
80
80
|
}
|
|
81
|
-
import { jsx as t, jsxs as k, Fragment as
|
|
81
|
+
import { jsx as t, jsxs as k, Fragment as A } from "react/jsx-runtime";
|
|
82
82
|
import * as r from "react";
|
|
83
|
-
import
|
|
84
|
-
import { SkeletonAnimation as
|
|
83
|
+
import F from "classnames";
|
|
84
|
+
import { SkeletonAnimation as L } from "./skeletons.js";
|
|
85
85
|
import { AspectRatioContainer as W } from "./utils/aspect-ratio-support.js";
|
|
86
86
|
import { getPrefixedDataAttributes as M } from "./utils/dom.js";
|
|
87
87
|
import { useIsInverseVariant as V } from "./theme-variant-context.js";
|
|
@@ -145,13 +145,13 @@ const Y = (param)=>{
|
|
|
145
145
|
})
|
|
146
146
|
}) : void 0
|
|
147
147
|
});
|
|
148
|
-
}),
|
|
148
|
+
}), S = {
|
|
149
149
|
"1:1": 1,
|
|
150
150
|
"16:9": 16 / 9,
|
|
151
151
|
"7:10": 7 / 10,
|
|
152
152
|
"4:3": 4 / 3
|
|
153
|
-
},
|
|
154
|
-
var { aspectRatio: e =
|
|
153
|
+
}, x = "1:1", e1 = /*#__PURE__*/ r.forwardRef((_param, N)=>{
|
|
154
|
+
var { aspectRatio: e = x, alt: n = "", dataAttributes: d, noBorderRadius: h, src: o, srcSet: c, onError: s, onLoad: l, loadingFallback: B = !0, errorFallback: E = !0 } = _param, i = _object_without_properties(_param, [
|
|
155
155
|
"aspectRatio",
|
|
156
156
|
"alt",
|
|
157
157
|
"dataAttributes",
|
|
@@ -164,7 +164,7 @@ const Y = (param)=>{
|
|
|
164
164
|
"errorFallback"
|
|
165
165
|
]);
|
|
166
166
|
var y;
|
|
167
|
-
const u = O(), m = r.useRef(), f = i.circular ? P : h ? U : K, [v, g] = r.useState(!o), [
|
|
167
|
+
const u = O(), m = r.useRef(), f = i.circular ? P : h ? U : K, [v, g] = r.useState(!o), [H, C] = r.useState(!1), b = i.width && i.height ? void 0 : i.circular ? 1 : typeof e == "number" ? e : S[e], w = B && !!(b !== 0 || i.width && i.height), T = E && !!(b !== 0 || i.width && i.height), I = r.useCallback(()=>{
|
|
168
168
|
g(!1), m.current && (m.current.style.opacity = "1"), setTimeout(()=>{
|
|
169
169
|
C(!0);
|
|
170
170
|
}, Z), l == null || l();
|
|
@@ -181,18 +181,18 @@ const Y = (param)=>{
|
|
|
181
181
|
}, [
|
|
182
182
|
I
|
|
183
183
|
]);
|
|
184
|
-
const
|
|
184
|
+
const _ = X() || !((y = document.getElementById(u)) != null && y.complete), z = /* @__PURE__ */ k(A, {
|
|
185
185
|
children: [
|
|
186
186
|
/* @__PURE__ */ t("img", {
|
|
187
187
|
suppressHydrationWarning: !0,
|
|
188
188
|
id: u,
|
|
189
189
|
style: {
|
|
190
|
-
opacity:
|
|
190
|
+
opacity: _ && w ? 0 : 1
|
|
191
191
|
},
|
|
192
|
-
ref: J(m,
|
|
192
|
+
ref: J(m, N),
|
|
193
193
|
src: o,
|
|
194
194
|
srcSet: c,
|
|
195
|
-
className:
|
|
195
|
+
className: F(f, q, {
|
|
196
196
|
[G]: i.border
|
|
197
197
|
}, $({
|
|
198
198
|
position: b !== 0 ? "absolute" : "static"
|
|
@@ -212,9 +212,9 @@ const Y = (param)=>{
|
|
|
212
212
|
]
|
|
213
213
|
});
|
|
214
214
|
var _i_height, _i_width;
|
|
215
|
-
return /* @__PURE__ */ k(
|
|
215
|
+
return /* @__PURE__ */ k(A, {
|
|
216
216
|
children: [
|
|
217
|
-
w && !
|
|
217
|
+
w && !H && /* @__PURE__ */ t("div", {
|
|
218
218
|
style: {
|
|
219
219
|
position: "absolute",
|
|
220
220
|
width: "100%",
|
|
@@ -222,7 +222,7 @@ const Y = (param)=>{
|
|
|
222
222
|
overflow: "hidden"
|
|
223
223
|
},
|
|
224
224
|
className: f,
|
|
225
|
-
children: /* @__PURE__ */ t(
|
|
225
|
+
children: /* @__PURE__ */ t(L, {
|
|
226
226
|
height: (_i_height = i.height) !== null && _i_height !== void 0 ? _i_height : "100%",
|
|
227
227
|
width: (_i_width = i.width) !== null && _i_width !== void 0 ? _i_width : "100%",
|
|
228
228
|
children: /* @__PURE__ */ t(Q, {
|
|
@@ -232,7 +232,7 @@ const Y = (param)=>{
|
|
|
232
232
|
})
|
|
233
233
|
})
|
|
234
234
|
}),
|
|
235
|
-
v &&
|
|
235
|
+
v && T && /* @__PURE__ */ t("div", {
|
|
236
236
|
style: {
|
|
237
237
|
position: "absolute",
|
|
238
238
|
width: "100%",
|
|
@@ -244,12 +244,12 @@ const Y = (param)=>{
|
|
|
244
244
|
className: f
|
|
245
245
|
})
|
|
246
246
|
}),
|
|
247
|
-
!v &&
|
|
247
|
+
!v && z
|
|
248
248
|
]
|
|
249
249
|
});
|
|
250
250
|
}), t1 = /*#__PURE__*/ r.forwardRef((e, n)=>{
|
|
251
251
|
var _e_aspectRatio;
|
|
252
|
-
const d = e.width && e.height ? void 0 : e.circular ? 1 : typeof e.aspectRatio == "number" ? e.aspectRatio :
|
|
252
|
+
const d = e.width && e.height ? void 0 : e.circular ? 1 : typeof e.aspectRatio == "number" ? e.aspectRatio : S[(_e_aspectRatio = e.aspectRatio) !== null && _e_aspectRatio !== void 0 ? _e_aspectRatio : x];
|
|
253
253
|
return /* @__PURE__ */ t(W, {
|
|
254
254
|
style: {
|
|
255
255
|
position: "relative"
|
|
@@ -258,9 +258,10 @@ const Y = (param)=>{
|
|
|
258
258
|
width: e.width,
|
|
259
259
|
height: e.height,
|
|
260
260
|
dataAttributes: M(e.dataAttributes, "Image"),
|
|
261
|
+
forceNonCssAspectRatio: e.forceNonCssAspectRatio,
|
|
261
262
|
children: /* @__PURE__ */ t(e1, _object_spread_props(_object_spread({}, e), {
|
|
262
263
|
ref: n
|
|
263
264
|
}))
|
|
264
265
|
});
|
|
265
266
|
}), C1 = t1;
|
|
266
|
-
export { e1 as ImageContent, p as ImageError,
|
|
267
|
+
export { e1 as ImageContent, p as ImageError, S as RATIO, C1 as default };
|
package/dist-es/list.js
CHANGED
|
@@ -82,7 +82,7 @@ import { jsx as t, jsxs as L } from "react/jsx-runtime";
|
|
|
82
82
|
import * as I from "react";
|
|
83
83
|
import i from "classnames";
|
|
84
84
|
import { BaseTouchable as S } from "./touchable.js";
|
|
85
|
-
import { Text3 as
|
|
85
|
+
import { Text3 as me, Text1 as ue, Text2 as K } from "./text.js";
|
|
86
86
|
import c from "./box.js";
|
|
87
87
|
import X from "./stack.js";
|
|
88
88
|
import ne from "./badge.js";
|
|
@@ -111,7 +111,7 @@ const ce = (e, n)=>typeof e == "function" ? e == null ? void 0 : e({
|
|
|
111
111
|
},
|
|
112
112
|
children: e
|
|
113
113
|
}) : e, Ve = (param)=>{
|
|
114
|
-
let { withChevron: e, headline: n, headlineRef: r, extraRef: l, title: h, titleAs: P, titleLinesMax: b, subtitle: x, subtitleLinesMax: Y, description: E, descriptionLinesMax: q, detail:
|
|
114
|
+
let { withChevron: e, headline: n, headlineRef: r, extraRef: l, title: h, titleAs: P, titleLinesMax: b, subtitle: x, subtitleLinesMax: Y, description: E, descriptionLinesMax: q, detail: u, asset: H, danger: j, type: y = "basic", badge: D, right: s, extra: M, labelId: m, disabled: a } = param;
|
|
115
115
|
const O = le(), A = [
|
|
116
116
|
n,
|
|
117
117
|
h,
|
|
@@ -155,9 +155,9 @@ const ce = (e, n)=>typeof e == "function" ? e == null ? void 0 : e({
|
|
|
155
155
|
style: {
|
|
156
156
|
justifyContent: A ? "center" : "flex-start"
|
|
157
157
|
},
|
|
158
|
-
id:
|
|
158
|
+
id: m,
|
|
159
159
|
children: [
|
|
160
|
-
/* @__PURE__ */ t(
|
|
160
|
+
/* @__PURE__ */ t(me, {
|
|
161
161
|
regular: !0,
|
|
162
162
|
color: j ? d.colors.textError : d.colors.textPrimary,
|
|
163
163
|
truncate: b,
|
|
@@ -171,7 +171,7 @@ const ce = (e, n)=>typeof e == "function" ? e == null ? void 0 : e({
|
|
|
171
171
|
order: -1,
|
|
172
172
|
paddingBottom: 4
|
|
173
173
|
},
|
|
174
|
-
children: /* @__PURE__ */ t(
|
|
174
|
+
children: /* @__PURE__ */ t(ue, {
|
|
175
175
|
regular: !0,
|
|
176
176
|
color: d.colors.textPrimary,
|
|
177
177
|
hyphens: "auto",
|
|
@@ -182,7 +182,7 @@ const ce = (e, n)=>typeof e == "function" ? e == null ? void 0 : e({
|
|
|
182
182
|
paddingTop: 2,
|
|
183
183
|
children: /* @__PURE__ */ t(K, {
|
|
184
184
|
regular: !0,
|
|
185
|
-
color: d.colors.
|
|
185
|
+
color: d.colors.textPrimary,
|
|
186
186
|
truncate: Y,
|
|
187
187
|
hyphens: "auto",
|
|
188
188
|
children: x
|
|
@@ -208,11 +208,11 @@ const ce = (e, n)=>typeof e == "function" ? e == null ? void 0 : e({
|
|
|
208
208
|
z(),
|
|
209
209
|
/* @__PURE__ */ L("div", {
|
|
210
210
|
className: i({
|
|
211
|
-
[ke]: !!
|
|
212
|
-
[Ie]: !!
|
|
211
|
+
[ke]: !!u || y !== "basic",
|
|
212
|
+
[Ie]: !!u
|
|
213
213
|
}),
|
|
214
214
|
children: [
|
|
215
|
-
|
|
215
|
+
u && /* @__PURE__ */ t("div", {
|
|
216
216
|
className: i(F, Pe, {
|
|
217
217
|
[V]: a
|
|
218
218
|
}),
|
|
@@ -220,24 +220,24 @@ const ce = (e, n)=>typeof e == "function" ? e == null ? void 0 : e({
|
|
|
220
220
|
regular: !0,
|
|
221
221
|
color: d.colors.textSecondary,
|
|
222
222
|
hyphens: "auto",
|
|
223
|
-
children:
|
|
223
|
+
children: u
|
|
224
224
|
})
|
|
225
225
|
}),
|
|
226
226
|
y === "control" && /* @__PURE__ */ t("div", {
|
|
227
227
|
className: i({
|
|
228
|
-
[ae]: !!
|
|
228
|
+
[ae]: !!u
|
|
229
229
|
}),
|
|
230
230
|
children: ce(s, A)
|
|
231
231
|
}),
|
|
232
232
|
y === "custom" && /* @__PURE__ */ t("div", {
|
|
233
233
|
className: i({
|
|
234
|
-
[ae]: !!
|
|
234
|
+
[ae]: !!u,
|
|
235
235
|
[V]: a
|
|
236
236
|
}),
|
|
237
237
|
children: ce(s, A)
|
|
238
238
|
}),
|
|
239
239
|
(y === "chevron" || y === "custom" && e) && /* @__PURE__ */ t(c, {
|
|
240
|
-
paddingLeft:
|
|
240
|
+
paddingLeft: u || y === "custom" ? 4 : 0,
|
|
241
241
|
className: i(F, {
|
|
242
242
|
[V]: a
|
|
243
243
|
}),
|
|
@@ -263,11 +263,11 @@ const ce = (e, n)=>typeof e == "function" ? e == null ? void 0 : e({
|
|
|
263
263
|
b
|
|
264
264
|
];
|
|
265
265
|
}, je = (e)=>e.switch !== void 0, De = (e)=>e.checkbox !== void 0, Me = (e)=>e.radioValue !== void 0, Oe = (e)=>e.iconButton !== void 0, de = /*#__PURE__*/ I.forwardRef((e, n)=>{
|
|
266
|
-
const r = ge(), l = le(), { asset: h, headline: P, title: b, titleAs: x, titleLinesMax: Y, subtitle: E, subtitleLinesMax: q, description:
|
|
266
|
+
const r = ge(), l = le(), { asset: h, headline: P, title: b, titleAs: x, titleLinesMax: Y, subtitle: E, subtitleLinesMax: q, description: u, descriptionLinesMax: H, detail: j, danger: y, badge: D, role: s, extra: M, dataAttributes: m, "aria-label": a } = e, [O, _] = I.useState(""), [A, z] = I.useState(""), $ = [
|
|
267
267
|
b,
|
|
268
268
|
O,
|
|
269
269
|
E,
|
|
270
|
-
|
|
270
|
+
u,
|
|
271
271
|
A,
|
|
272
272
|
j
|
|
273
273
|
].filter(Boolean).join(" "), se = fe(), o = e.disabled || e.radioValue !== void 0 && se.disabled, N = !o && !l, w = !o && l, [p, ee] = Xe(e.switch || e.checkbox || {}), v = (param)=>{
|
|
@@ -281,7 +281,7 @@ const ce = (e, n)=>typeof e == "function" ? e == null ? void 0 : e({
|
|
|
281
281
|
title: b,
|
|
282
282
|
titleAs: x,
|
|
283
283
|
subtitle: E,
|
|
284
|
-
description:
|
|
284
|
+
description: u,
|
|
285
285
|
badge: D,
|
|
286
286
|
titleLinesMax: Y,
|
|
287
287
|
subtitleLinesMax: q,
|
|
@@ -320,7 +320,7 @@ const ce = (e, n)=>typeof e == "function" ? e == null ? void 0 : e({
|
|
|
320
320
|
trackingEvent: e.trackingEvent,
|
|
321
321
|
onPress: e.onPress,
|
|
322
322
|
role: s,
|
|
323
|
-
dataAttributes:
|
|
323
|
+
dataAttributes: m,
|
|
324
324
|
disabled: o,
|
|
325
325
|
"aria-label": a,
|
|
326
326
|
children: G({
|
|
@@ -339,7 +339,7 @@ const ce = (e, n)=>typeof e == "function" ? e == null ? void 0 : e({
|
|
|
339
339
|
fullPageOnWebView: e.fullPageOnWebView,
|
|
340
340
|
onNavigate: e.onNavigate,
|
|
341
341
|
role: s,
|
|
342
|
-
dataAttributes:
|
|
342
|
+
dataAttributes: m,
|
|
343
343
|
disabled: o,
|
|
344
344
|
"aria-label": a !== null && a !== void 0 ? a : $,
|
|
345
345
|
children: G({
|
|
@@ -360,7 +360,7 @@ const ce = (e, n)=>typeof e == "function" ? e == null ? void 0 : e({
|
|
|
360
360
|
onNavigate: e.onNavigate,
|
|
361
361
|
loadOnTop: e.loadOnTop,
|
|
362
362
|
role: s,
|
|
363
|
-
dataAttributes:
|
|
363
|
+
dataAttributes: m,
|
|
364
364
|
disabled: o,
|
|
365
365
|
"aria-label": a !== null && a !== void 0 ? a : $,
|
|
366
366
|
children: G({
|
|
@@ -376,7 +376,7 @@ const ce = (e, n)=>typeof e == "function" ? e == null ? void 0 : e({
|
|
|
376
376
|
className: Q,
|
|
377
377
|
children: [
|
|
378
378
|
/* @__PURE__ */ t(S, {
|
|
379
|
-
dataAttributes:
|
|
379
|
+
dataAttributes: m,
|
|
380
380
|
disabled: o,
|
|
381
381
|
onPress: e.onPress,
|
|
382
382
|
trackingEvent: e.trackingEvent,
|
|
@@ -418,7 +418,7 @@ const ce = (e, n)=>typeof e == "function" ? e == null ? void 0 : e({
|
|
|
418
418
|
}),
|
|
419
419
|
children: /* @__PURE__ */ t(g, {
|
|
420
420
|
disabled: o,
|
|
421
|
-
dataAttributes:
|
|
421
|
+
dataAttributes: m,
|
|
422
422
|
name: B,
|
|
423
423
|
checked: p,
|
|
424
424
|
onChange: ee,
|
|
@@ -445,7 +445,7 @@ const ce = (e, n)=>typeof e == "function" ? e == null ? void 0 : e({
|
|
|
445
445
|
className: Q,
|
|
446
446
|
children: [
|
|
447
447
|
/* @__PURE__ */ t(S, {
|
|
448
|
-
dataAttributes:
|
|
448
|
+
dataAttributes: m,
|
|
449
449
|
disabled: o,
|
|
450
450
|
onPress: e.onPress,
|
|
451
451
|
trackingEvent: e.trackingEvent,
|
|
@@ -517,7 +517,7 @@ const ce = (e, n)=>typeof e == "function" ? e == null ? void 0 : e({
|
|
|
517
517
|
className: Z
|
|
518
518
|
}),
|
|
519
519
|
/* @__PURE__ */ t(re, {
|
|
520
|
-
dataAttributes:
|
|
520
|
+
dataAttributes: m,
|
|
521
521
|
value: e.radioValue,
|
|
522
522
|
"aria-labelledby": r,
|
|
523
523
|
"aria-label": a,
|
|
@@ -542,7 +542,7 @@ const ce = (e, n)=>typeof e == "function" ? e == null ? void 0 : e({
|
|
|
542
542
|
role: s,
|
|
543
543
|
ref: n,
|
|
544
544
|
children: /* @__PURE__ */ t(re, {
|
|
545
|
-
dataAttributes:
|
|
545
|
+
dataAttributes: m,
|
|
546
546
|
value: e.radioValue,
|
|
547
547
|
"aria-labelledby": r,
|
|
548
548
|
"aria-label": a,
|
|
@@ -565,7 +565,7 @@ const ce = (e, n)=>typeof e == "function" ? e == null ? void 0 : e({
|
|
|
565
565
|
paddingX: 16,
|
|
566
566
|
className: T,
|
|
567
567
|
role: s,
|
|
568
|
-
dataAttributes:
|
|
568
|
+
dataAttributes: m,
|
|
569
569
|
children: e.right ? v({
|
|
570
570
|
type: "custom",
|
|
571
571
|
right: e.right
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const o = "15.
|
|
1
|
+
const o = "15.8.0";
|
|
2
2
|
export { o as PACKAGE_VERSION };
|
package/dist-es/progress-bar.js
CHANGED
|
@@ -51,79 +51,88 @@ function _object_spread_props(target, source) {
|
|
|
51
51
|
}
|
|
52
52
|
return target;
|
|
53
53
|
}
|
|
54
|
-
import { jsx as
|
|
54
|
+
import { jsx as o } from "react/jsx-runtime";
|
|
55
55
|
import * as b from "react";
|
|
56
|
-
import { useTheme as
|
|
57
|
-
import { vars as
|
|
58
|
-
import { barBackground as
|
|
56
|
+
import { useTheme as v } from "./hooks.js";
|
|
57
|
+
import { vars as B } from "./skins/skin-contract.css-mistica.js";
|
|
58
|
+
import { barBackground as S, bar as $, inverse as x, normal as y, progressBarSteppedContainer as N } from "./progress-bar.css-mistica.js";
|
|
59
59
|
import { getPrefixedDataAttributes as C } from "./utils/dom.js";
|
|
60
|
-
import
|
|
61
|
-
import
|
|
62
|
-
const
|
|
63
|
-
let { progressPercent:
|
|
64
|
-
const { texts:
|
|
65
|
-
|
|
66
|
-
|
|
60
|
+
import P from "classnames";
|
|
61
|
+
import w from "./inline.js";
|
|
62
|
+
const R = (param)=>{
|
|
63
|
+
let { progressPercent: e, color: s, "aria-label": p, "aria-labelledby": n, "aria-hidden": t, dataAttributes: c, reverse: l = !1 } = param;
|
|
64
|
+
const { texts: m } = v(), a = Math.max(0, Math.min(100, e)), i = t && t !== "false" ? {
|
|
65
|
+
"aria-hidden": t
|
|
66
|
+
} : {
|
|
67
67
|
role: "progressbar",
|
|
68
68
|
"aria-valuenow": a,
|
|
69
69
|
"aria-valuemin": 0,
|
|
70
70
|
"aria-valuemax": 100,
|
|
71
|
-
"aria-label":
|
|
72
|
-
"aria-labelledby":
|
|
73
|
-
|
|
74
|
-
|
|
71
|
+
"aria-label": n ? void 0 : (()=>`${p || m.loading}, ${a}% ${m.progressBarCompletedLabel}`)(),
|
|
72
|
+
"aria-labelledby": n
|
|
73
|
+
};
|
|
74
|
+
return /* @__PURE__ */ o("div", _object_spread_props(_object_spread(_object_spread_props(_object_spread({}, C(c, "ProgressBar")), {
|
|
75
|
+
className: S
|
|
76
|
+
}), i), {
|
|
77
|
+
children: /* @__PURE__ */ o("div", {
|
|
78
|
+
className: P($, l ? x : y),
|
|
75
79
|
style: {
|
|
76
80
|
maxWidth: `${a}%`,
|
|
77
|
-
backgroundColor:
|
|
81
|
+
backgroundColor: s !== null && s !== void 0 ? s : B.colors.controlActivated
|
|
78
82
|
}
|
|
79
83
|
})
|
|
80
84
|
}));
|
|
81
|
-
},
|
|
82
|
-
let { steps:
|
|
83
|
-
const { texts:
|
|
85
|
+
}, T = (param)=>{
|
|
86
|
+
let { steps: e, currentStep: s = 0, color: p, dataAttributes: n, "aria-label": t, "aria-labelledby": c, "aria-hidden": l } = param;
|
|
87
|
+
const { texts: m } = v(), [a, g] = b.useState(Math.ceil(s)), [i, k] = b.useState(!1);
|
|
84
88
|
b.useEffect(()=>{
|
|
85
|
-
const
|
|
86
|
-
a !==
|
|
89
|
+
const r = Math.ceil(s);
|
|
90
|
+
a !== r && (k(r < a), g(r));
|
|
87
91
|
}, [
|
|
88
|
-
|
|
89
|
-
|
|
92
|
+
s,
|
|
93
|
+
e,
|
|
90
94
|
a
|
|
91
95
|
]);
|
|
92
|
-
const A =
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
})();
|
|
96
|
-
return /* @__PURE__ */ t("div", _object_spread_props(_object_spread({}, C(l, "ProgressBarStepped")), {
|
|
96
|
+
const A = l && l !== "false" ? {
|
|
97
|
+
"aria-hidden": l
|
|
98
|
+
} : {
|
|
97
99
|
role: "progressbar",
|
|
98
100
|
"aria-valuenow": a,
|
|
99
101
|
"aria-valuemin": 0,
|
|
100
|
-
"aria-valuemax":
|
|
101
|
-
"aria-label":
|
|
102
|
-
|
|
102
|
+
"aria-valuemax": e,
|
|
103
|
+
"aria-label": c ? void 0 : (()=>{
|
|
104
|
+
const r = m.progressBarStepLabel.replace("1$s", String(a)).replace("2$s", String(e));
|
|
105
|
+
return t ? `${t}, ${r.toLowerCase()}` : r;
|
|
106
|
+
})(),
|
|
107
|
+
"aria-labelledby": c
|
|
108
|
+
};
|
|
109
|
+
return /* @__PURE__ */ o("div", _object_spread_props(_object_spread(_object_spread_props(_object_spread({}, C(n, "ProgressBarStepped")), {
|
|
110
|
+
role: "progressbar"
|
|
111
|
+
}), A), {
|
|
103
112
|
className: N,
|
|
104
|
-
children: /* @__PURE__ */
|
|
113
|
+
children: /* @__PURE__ */ o(w, {
|
|
105
114
|
space: 8,
|
|
106
115
|
fullWidth: !0,
|
|
107
116
|
children: Array.from({
|
|
108
|
-
length:
|
|
109
|
-
}, (
|
|
110
|
-
const
|
|
111
|
-
return /* @__PURE__ */
|
|
112
|
-
className:
|
|
117
|
+
length: e
|
|
118
|
+
}, (r, d)=>{
|
|
119
|
+
const u = d === a, h = d < a, f = d === a - 1;
|
|
120
|
+
return /* @__PURE__ */ o("div", {
|
|
121
|
+
className: S,
|
|
113
122
|
"aria-hidden": "true",
|
|
114
|
-
children: (
|
|
115
|
-
className:
|
|
116
|
-
[
|
|
117
|
-
[
|
|
123
|
+
children: (h || u) && /* @__PURE__ */ o("div", {
|
|
124
|
+
className: P($, {
|
|
125
|
+
[y]: f && !i,
|
|
126
|
+
[x]: u && i
|
|
118
127
|
}),
|
|
119
128
|
style: {
|
|
120
|
-
backgroundColor:
|
|
121
|
-
maxWidth:
|
|
129
|
+
backgroundColor: p !== null && p !== void 0 ? p : B.colors.controlActivated,
|
|
130
|
+
maxWidth: h || f && !i ? "100%" : "0"
|
|
122
131
|
}
|
|
123
132
|
})
|
|
124
|
-
},
|
|
133
|
+
}, d);
|
|
125
134
|
})
|
|
126
135
|
})
|
|
127
136
|
}));
|
|
128
137
|
};
|
|
129
|
-
export {
|
|
138
|
+
export { R as ProgressBar, T as ProgressBarStepped };
|
|
@@ -1,41 +1,41 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsx as
|
|
2
|
+
import { jsx as e, jsxs as u } from "react/jsx-runtime";
|
|
3
3
|
import * as l from "react";
|
|
4
4
|
import { useIsInverseVariant as f } from "./theme-variant-context.js";
|
|
5
5
|
import { vars as r } from "./skins/skin-contract.css-mistica.js";
|
|
6
6
|
import h from "./inline.js";
|
|
7
|
-
import { Text4 as
|
|
8
|
-
import { moreItems as
|
|
7
|
+
import { Text4 as v } from "./text.js";
|
|
8
|
+
import { moreItems as b } from "./stacking-group.css-mistica.js";
|
|
9
9
|
import { vars as g } from "./image.css-mistica.js";
|
|
10
10
|
import { applyCssVars as y } from "./utils/css.js";
|
|
11
11
|
const C = (param)=>{
|
|
12
|
-
let { moreItemsStyle:
|
|
13
|
-
const c = f(), i = l.Children.count(
|
|
14
|
-
return /* @__PURE__ */
|
|
12
|
+
let { moreItemsStyle: s, stacked: t = !0, maxItems: o = 1 / 0, children: n } = param;
|
|
13
|
+
const c = f(), i = l.Children.count(n), m = i - o + 1, p = t ? -8 : 8, a = s.size, d = s.type === "circle" ? "50%" : r.borderRadii.mediaSmall;
|
|
14
|
+
return /* @__PURE__ */ e("div", {
|
|
15
15
|
style: y({
|
|
16
16
|
[g.mediaBorderRadius]: d
|
|
17
17
|
}),
|
|
18
18
|
children: /* @__PURE__ */ u(h, {
|
|
19
19
|
space: p,
|
|
20
20
|
children: [
|
|
21
|
-
l.Children.toArray(
|
|
22
|
-
i > o && /* @__PURE__ */
|
|
23
|
-
className:
|
|
21
|
+
l.Children.toArray(n).slice(0, i > o ? o - 1 : o),
|
|
22
|
+
i > o && /* @__PURE__ */ e("div", {
|
|
23
|
+
className: b,
|
|
24
24
|
style: {
|
|
25
25
|
width: a,
|
|
26
26
|
height: a,
|
|
27
27
|
borderRadius: d,
|
|
28
28
|
backgroundColor: c ? r.colors.brandHigh : r.colors.brandLow,
|
|
29
|
-
border:
|
|
29
|
+
border: t ? `1px solid ${r.colors.borderLow}` : "none"
|
|
30
30
|
},
|
|
31
|
-
children: /* @__PURE__ */
|
|
31
|
+
children: /* @__PURE__ */ e(v, {
|
|
32
32
|
regular: !0,
|
|
33
|
-
color: c ? r.colors.textPrimaryInverse : r.colors.
|
|
33
|
+
color: c ? r.colors.textPrimaryInverse : r.colors.textBrand,
|
|
34
34
|
children: "+" + m
|
|
35
35
|
})
|
|
36
36
|
})
|
|
37
37
|
]
|
|
38
38
|
})
|
|
39
39
|
});
|
|
40
|
-
},
|
|
41
|
-
export {
|
|
40
|
+
}, B = C;
|
|
41
|
+
export { B as default };
|