@telefonica/mistica 15.7.0 → 15.9.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 -92
- package/dist/community/blocks.js +1 -0
- package/dist/empty-state.js +7 -6
- package/dist/icon-button.d.ts +17 -16
- package/dist/icon-button.js +51 -49
- 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.css-mistica.js +11 -11
- package/dist/list.css.d.ts +1 -3
- package/dist/list.d.ts +8 -16
- package/dist/list.js +275 -383
- 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 -121
- package/dist-es/community/blocks.js +1 -0
- package/dist-es/empty-state.js +9 -8
- package/dist-es/icon-button.js +64 -62
- 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.css-mistica.js +2 -2
- package/dist-es/list.js +321 -429
- 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/package-version.js
CHANGED
package/dist/progress-bar.d.ts
CHANGED
|
@@ -6,6 +6,7 @@ type ProgressBarProps = {
|
|
|
6
6
|
children?: void;
|
|
7
7
|
'aria-label'?: string;
|
|
8
8
|
'aria-labelledby'?: string;
|
|
9
|
+
'aria-hidden'?: React.HTMLAttributes<HTMLDivElement>['aria-hidden'];
|
|
9
10
|
dataAttributes?: DataAttributes;
|
|
10
11
|
reverse?: boolean;
|
|
11
12
|
};
|
|
@@ -17,6 +18,7 @@ type ProgressBarSteppedProps = {
|
|
|
17
18
|
dataAttributes?: DataAttributes;
|
|
18
19
|
'aria-label'?: string;
|
|
19
20
|
'aria-labelledby'?: string;
|
|
21
|
+
'aria-hidden'?: React.HTMLAttributes<HTMLDivElement>['aria-hidden'];
|
|
20
22
|
};
|
|
21
23
|
export declare const ProgressBarStepped: React.FC<ProgressBarSteppedProps>;
|
|
22
24
|
export {};
|
package/dist/progress-bar.js
CHANGED
|
@@ -11,10 +11,10 @@ function _export(target, all) {
|
|
|
11
11
|
}
|
|
12
12
|
_export(exports, {
|
|
13
13
|
ProgressBar: function() {
|
|
14
|
-
return
|
|
14
|
+
return R;
|
|
15
15
|
},
|
|
16
16
|
ProgressBarStepped: function() {
|
|
17
|
-
return
|
|
17
|
+
return T;
|
|
18
18
|
}
|
|
19
19
|
});
|
|
20
20
|
const _jsxruntime = require("react/jsx-runtime");
|
|
@@ -123,69 +123,78 @@ function _object_spread_props(target, source) {
|
|
|
123
123
|
}
|
|
124
124
|
return target;
|
|
125
125
|
}
|
|
126
|
-
const
|
|
127
|
-
let { progressPercent:
|
|
128
|
-
const { texts:
|
|
129
|
-
|
|
130
|
-
|
|
126
|
+
const R = (param)=>{
|
|
127
|
+
let { progressPercent: e, color: s, "aria-label": p, "aria-labelledby": n, "aria-hidden": t, dataAttributes: c, reverse: l = !1 } = param;
|
|
128
|
+
const { texts: m } = (0, _hooks.useTheme)(), a = Math.max(0, Math.min(100, e)), i = t && t !== "false" ? {
|
|
129
|
+
"aria-hidden": t
|
|
130
|
+
} : {
|
|
131
131
|
role: "progressbar",
|
|
132
132
|
"aria-valuenow": a,
|
|
133
133
|
"aria-valuemin": 0,
|
|
134
134
|
"aria-valuemax": 100,
|
|
135
|
-
"aria-label":
|
|
136
|
-
"aria-labelledby":
|
|
135
|
+
"aria-label": n ? void 0 : (()=>`${p || m.loading}, ${a}% ${m.progressBarCompletedLabel}`)(),
|
|
136
|
+
"aria-labelledby": n
|
|
137
|
+
};
|
|
138
|
+
return /* @__PURE__ */ (0, _jsxruntime.jsx)("div", _object_spread_props(_object_spread(_object_spread_props(_object_spread({}, (0, _dom.getPrefixedDataAttributes)(c, "ProgressBar")), {
|
|
139
|
+
className: _progressbarcssmistica.barBackground
|
|
140
|
+
}), i), {
|
|
137
141
|
children: /* @__PURE__ */ (0, _jsxruntime.jsx)("div", {
|
|
138
|
-
className: (0, _classnames.default)(_progressbarcssmistica.bar,
|
|
142
|
+
className: (0, _classnames.default)(_progressbarcssmistica.bar, l ? _progressbarcssmistica.inverse : _progressbarcssmistica.normal),
|
|
139
143
|
style: {
|
|
140
144
|
maxWidth: `${a}%`,
|
|
141
|
-
backgroundColor:
|
|
145
|
+
backgroundColor: s !== null && s !== void 0 ? s : _skincontractcssmistica.vars.colors.controlActivated
|
|
142
146
|
}
|
|
143
147
|
})
|
|
144
148
|
}));
|
|
145
|
-
},
|
|
146
|
-
let { steps:
|
|
147
|
-
const { texts:
|
|
149
|
+
}, T = (param)=>{
|
|
150
|
+
let { steps: e, currentStep: s = 0, color: p, dataAttributes: n, "aria-label": t, "aria-labelledby": c, "aria-hidden": l } = param;
|
|
151
|
+
const { texts: m } = (0, _hooks.useTheme)(), [a, g] = _react.useState(Math.ceil(s)), [i, k] = _react.useState(!1);
|
|
148
152
|
_react.useEffect(()=>{
|
|
149
|
-
const
|
|
150
|
-
a !==
|
|
153
|
+
const r = Math.ceil(s);
|
|
154
|
+
a !== r && (k(r < a), g(r));
|
|
151
155
|
}, [
|
|
152
|
-
|
|
153
|
-
|
|
156
|
+
s,
|
|
157
|
+
e,
|
|
154
158
|
a
|
|
155
159
|
]);
|
|
156
|
-
const A =
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
})();
|
|
160
|
-
return /* @__PURE__ */ (0, _jsxruntime.jsx)("div", _object_spread_props(_object_spread({}, (0, _dom.getPrefixedDataAttributes)(l, "ProgressBarStepped")), {
|
|
160
|
+
const A = l && l !== "false" ? {
|
|
161
|
+
"aria-hidden": l
|
|
162
|
+
} : {
|
|
161
163
|
role: "progressbar",
|
|
162
164
|
"aria-valuenow": a,
|
|
163
165
|
"aria-valuemin": 0,
|
|
164
|
-
"aria-valuemax":
|
|
165
|
-
"aria-label":
|
|
166
|
-
|
|
166
|
+
"aria-valuemax": e,
|
|
167
|
+
"aria-label": c ? void 0 : (()=>{
|
|
168
|
+
const r = m.progressBarStepLabel.replace("1$s", String(a)).replace("2$s", String(e));
|
|
169
|
+
return t ? `${t}, ${r.toLowerCase()}` : r;
|
|
170
|
+
})(),
|
|
171
|
+
"aria-labelledby": c
|
|
172
|
+
};
|
|
173
|
+
return /* @__PURE__ */ (0, _jsxruntime.jsx)("div", _object_spread_props(_object_spread(_object_spread_props(_object_spread({}, (0, _dom.getPrefixedDataAttributes)(n, "ProgressBarStepped")), {
|
|
174
|
+
role: "progressbar"
|
|
175
|
+
}), A), {
|
|
167
176
|
className: _progressbarcssmistica.progressBarSteppedContainer,
|
|
168
177
|
children: /* @__PURE__ */ (0, _jsxruntime.jsx)(_inline.default, {
|
|
169
178
|
space: 8,
|
|
170
179
|
fullWidth: !0,
|
|
171
180
|
children: Array.from({
|
|
172
|
-
length:
|
|
173
|
-
}, (
|
|
174
|
-
const
|
|
181
|
+
length: e
|
|
182
|
+
}, (r, d)=>{
|
|
183
|
+
const u = d === a, h = d < a, f = d === a - 1;
|
|
175
184
|
return /* @__PURE__ */ (0, _jsxruntime.jsx)("div", {
|
|
176
185
|
className: _progressbarcssmistica.barBackground,
|
|
177
186
|
"aria-hidden": "true",
|
|
178
|
-
children: (
|
|
187
|
+
children: (h || u) && /* @__PURE__ */ (0, _jsxruntime.jsx)("div", {
|
|
179
188
|
className: (0, _classnames.default)(_progressbarcssmistica.bar, {
|
|
180
|
-
[_progressbarcssmistica.normal]:
|
|
181
|
-
[_progressbarcssmistica.inverse]:
|
|
189
|
+
[_progressbarcssmistica.normal]: f && !i,
|
|
190
|
+
[_progressbarcssmistica.inverse]: u && i
|
|
182
191
|
}),
|
|
183
192
|
style: {
|
|
184
|
-
backgroundColor:
|
|
185
|
-
maxWidth:
|
|
193
|
+
backgroundColor: p !== null && p !== void 0 ? p : _skincontractcssmistica.vars.colors.controlActivated,
|
|
194
|
+
maxWidth: h || f && !i ? "100%" : "0"
|
|
186
195
|
}
|
|
187
196
|
})
|
|
188
|
-
},
|
|
197
|
+
}, d);
|
|
189
198
|
})
|
|
190
199
|
})
|
|
191
200
|
}));
|
package/dist/stacking-group.js
CHANGED
|
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
Object.defineProperty(exports, "default", {
|
|
7
7
|
enumerable: true,
|
|
8
8
|
get: function() {
|
|
9
|
-
return
|
|
9
|
+
return B;
|
|
10
10
|
}
|
|
11
11
|
});
|
|
12
12
|
const _jsxruntime = require("react/jsx-runtime");
|
|
@@ -65,8 +65,8 @@ function _interop_require_wildcard(obj, nodeInterop) {
|
|
|
65
65
|
return newObj;
|
|
66
66
|
}
|
|
67
67
|
const C = (param)=>{
|
|
68
|
-
let { moreItemsStyle:
|
|
69
|
-
const c = (0, _themevariantcontext.useIsInverseVariant)(), i = _react.Children.count(
|
|
68
|
+
let { moreItemsStyle: s, stacked: t = !0, maxItems: o = 1 / 0, children: n } = param;
|
|
69
|
+
const c = (0, _themevariantcontext.useIsInverseVariant)(), i = _react.Children.count(n), m = i - o + 1, p = t ? -8 : 8, a = s.size, d = s.type === "circle" ? "50%" : _skincontractcssmistica.vars.borderRadii.mediaSmall;
|
|
70
70
|
return /* @__PURE__ */ (0, _jsxruntime.jsx)("div", {
|
|
71
71
|
style: (0, _css.applyCssVars)({
|
|
72
72
|
[_imagecssmistica.vars.mediaBorderRadius]: d
|
|
@@ -74,7 +74,7 @@ const C = (param)=>{
|
|
|
74
74
|
children: /* @__PURE__ */ (0, _jsxruntime.jsxs)(_inline.default, {
|
|
75
75
|
space: p,
|
|
76
76
|
children: [
|
|
77
|
-
_react.Children.toArray(
|
|
77
|
+
_react.Children.toArray(n).slice(0, i > o ? o - 1 : o),
|
|
78
78
|
i > o && /* @__PURE__ */ (0, _jsxruntime.jsx)("div", {
|
|
79
79
|
className: _stackinggroupcssmistica.moreItems,
|
|
80
80
|
style: {
|
|
@@ -82,15 +82,15 @@ const C = (param)=>{
|
|
|
82
82
|
height: a,
|
|
83
83
|
borderRadius: d,
|
|
84
84
|
backgroundColor: c ? _skincontractcssmistica.vars.colors.brandHigh : _skincontractcssmistica.vars.colors.brandLow,
|
|
85
|
-
border:
|
|
85
|
+
border: t ? `1px solid ${_skincontractcssmistica.vars.colors.borderLow}` : "none"
|
|
86
86
|
},
|
|
87
87
|
children: /* @__PURE__ */ (0, _jsxruntime.jsx)(_text.Text4, {
|
|
88
88
|
regular: !0,
|
|
89
|
-
color: c ? _skincontractcssmistica.vars.colors.textPrimaryInverse : _skincontractcssmistica.vars.colors.
|
|
89
|
+
color: c ? _skincontractcssmistica.vars.colors.textPrimaryInverse : _skincontractcssmistica.vars.colors.textBrand,
|
|
90
90
|
children: "+" + m
|
|
91
91
|
})
|
|
92
92
|
})
|
|
93
93
|
]
|
|
94
94
|
})
|
|
95
95
|
});
|
|
96
|
-
},
|
|
96
|
+
}, B = C;
|
|
@@ -139,12 +139,12 @@ const J = (param)=>{
|
|
|
139
139
|
clearTimeout(g);
|
|
140
140
|
};
|
|
141
141
|
}, []);
|
|
142
|
-
let
|
|
143
|
-
return l && r !== "default" ?
|
|
142
|
+
let x = _skincontractcssmistica.vars.colors.textSecondary;
|
|
143
|
+
return l && r !== "default" ? x = _skincontractcssmistica.vars.colors.textError : r === "focused" && (x = _skincontractcssmistica.vars.colors.textActivated), /* @__PURE__ */ (0, _jsxruntime.jsxs)("label", {
|
|
144
144
|
className: (0, _classnames.default)(_textfieldcomponentscssmistica.labelContainer, {
|
|
145
145
|
[_textfieldcomponentscssmistica.shrinked]: f
|
|
146
146
|
}, (0, _sprinklescssmistica.sprinkles)({
|
|
147
|
-
color:
|
|
147
|
+
color: x
|
|
148
148
|
})),
|
|
149
149
|
htmlFor: s,
|
|
150
150
|
style: _object_spread_props(_object_spread({}, n), {
|
|
@@ -166,7 +166,7 @@ const J = (param)=>{
|
|
|
166
166
|
});
|
|
167
167
|
}, K = (param)=>{
|
|
168
168
|
let { leftText: o, rightText: s, error: r, id: l } = param;
|
|
169
|
-
const i = (0, _themevariantcontext.useIsInverseVariant)(), n = i ? _skincontractcssmistica.vars.colors.textPrimaryInverse : r ? _skincontractcssmistica.vars.colors.
|
|
169
|
+
const i = (0, _themevariantcontext.useIsInverseVariant)(), n = i ? _skincontractcssmistica.vars.colors.textPrimaryInverse : r ? _skincontractcssmistica.vars.colors.textError : _skincontractcssmistica.vars.colors.textSecondary, a = i ? _skincontractcssmistica.vars.colors.textPrimaryInverse : _skincontractcssmistica.vars.colors.textSecondary;
|
|
170
170
|
return /* @__PURE__ */ (0, _jsxruntime.jsxs)(_jsxruntime.Fragment, {
|
|
171
171
|
children: [
|
|
172
172
|
o && /* @__PURE__ */ (0, _jsxruntime.jsx)("div", {
|
|
@@ -11,13 +11,13 @@ function _export(target, all) {
|
|
|
11
11
|
}
|
|
12
12
|
_export(exports, {
|
|
13
13
|
AspectRatioContainer: function() {
|
|
14
|
-
return
|
|
14
|
+
return $;
|
|
15
15
|
},
|
|
16
16
|
AspectRatioSupportProvider: function() {
|
|
17
|
-
return
|
|
17
|
+
return W;
|
|
18
18
|
},
|
|
19
19
|
useSupportsAspectRatio: function() {
|
|
20
|
-
return
|
|
20
|
+
return b;
|
|
21
21
|
}
|
|
22
22
|
});
|
|
23
23
|
const _jsxruntime = require("react/jsx-runtime");
|
|
@@ -124,7 +124,7 @@ function _object_spread_props(target, source) {
|
|
|
124
124
|
}
|
|
125
125
|
return target;
|
|
126
126
|
}
|
|
127
|
-
const u = /*#__PURE__*/ _react.createContext(!0),
|
|
127
|
+
const u = /*#__PURE__*/ _react.createContext(!0), W = (param)=>{
|
|
128
128
|
let { children: t } = param;
|
|
129
129
|
const [o, s] = _react.useState(!0);
|
|
130
130
|
return (0, _hooks.useIsomorphicLayoutEffect)(()=>{
|
|
@@ -137,33 +137,33 @@ const u = /*#__PURE__*/ _react.createContext(!0), x = (param)=>{
|
|
|
137
137
|
value: o,
|
|
138
138
|
children: t
|
|
139
139
|
});
|
|
140
|
-
},
|
|
141
|
-
const o =
|
|
142
|
-
let
|
|
140
|
+
}, b = ()=>_react.useContext(u), $ = (t)=>{
|
|
141
|
+
const o = !!t.forceNonCssAspectRatio, s = b() && !o, h = typeof t.width != "number" && typeof t.height != "number" && t.aspectRatio !== 0, a = h ? t.aspectRatio : void 0;
|
|
142
|
+
let e = t.width, i = t.height;
|
|
143
143
|
var _t_aspectRatio, _t_aspectRatio1;
|
|
144
|
-
t.width !== void 0 && t.height !== void 0 ? (
|
|
145
|
-
var _t_as;
|
|
146
|
-
const c =
|
|
144
|
+
t.width !== void 0 && t.height !== void 0 ? (e = t.width, i = t.height) : typeof t.width == "number" ? i = t.aspectRatio !== 0 ? t.width / ((_t_aspectRatio = t.aspectRatio) !== null && _t_aspectRatio !== void 0 ? _t_aspectRatio : 1) : void 0 : typeof t.height == "number" ? e = t.aspectRatio !== 0 ? t.height * ((_t_aspectRatio1 = t.aspectRatio) !== null && _t_aspectRatio1 !== void 0 ? _t_aspectRatio1 : 1) : void 0 : t.height ? i = t.height : e = t.width || "100%";
|
|
145
|
+
var _t_as, _ref, _ref1;
|
|
146
|
+
const c = h && !s, r = /*#__PURE__*/ _react.createElement((_t_as = t.as) !== null && _t_as !== void 0 ? _t_as : "div", _object_spread({
|
|
147
147
|
className: (0, _classnames.default)(t.className, _aspectratiosupportcssmistica.container, {
|
|
148
148
|
[_aspectratiosupportcssmistica.containerWithWrapper]: c
|
|
149
149
|
}),
|
|
150
150
|
style: _object_spread({}, c ? _object_spread_props(_object_spread({}, t.style), {
|
|
151
|
-
position:
|
|
151
|
+
position: a ? "absolute" : "static",
|
|
152
152
|
width: "100%"
|
|
153
153
|
}) : _object_spread_props(_object_spread({}, t.style), {
|
|
154
|
-
width: isNaN(Number(
|
|
155
|
-
height: isNaN(Number(
|
|
154
|
+
width: (_ref = isNaN(Number(e)) ? e : Number(e)) !== null && _ref !== void 0 ? _ref : "fit-content",
|
|
155
|
+
height: (_ref1 = isNaN(Number(i)) ? i : Number(i)) !== null && _ref1 !== void 0 ? _ref1 : "fit-content"
|
|
156
156
|
}), (0, _css.applyCssVars)({
|
|
157
|
-
[_aspectratiosupportcssmistica.vars.aspectRatio]:
|
|
157
|
+
[_aspectratiosupportcssmistica.vars.aspectRatio]: a ? String(a) : "unset"
|
|
158
158
|
}))
|
|
159
159
|
}, !c && t.dataAttributes), t.children);
|
|
160
160
|
if (c) {
|
|
161
|
-
const
|
|
161
|
+
const f = (()=>a ? t.width && typeof t.width == "string" && t.width.endsWith("%") ? `${parseFloat(t.width) / a}%` : `${100 / a}%` : 0)();
|
|
162
162
|
return /* @__PURE__ */ (0, _jsxruntime.jsx)("div", _object_spread_props(_object_spread({
|
|
163
163
|
style: {
|
|
164
|
-
width:
|
|
165
|
-
height:
|
|
166
|
-
paddingTop:
|
|
164
|
+
width: e,
|
|
165
|
+
height: i,
|
|
166
|
+
paddingTop: f
|
|
167
167
|
},
|
|
168
168
|
className: _aspectratiosupportcssmistica.wrapper
|
|
169
169
|
}, t.dataAttributes), {
|