@telefonica/mistica 14.25.0 → 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.
Files changed (78) hide show
  1. package/css/mistica.css +1 -1
  2. package/dist/accordion.css-mistica.js +41 -0
  3. package/dist/accordion.css.d.ts +12 -0
  4. package/dist/accordion.css.ts.vanilla.css-mistica.js +11 -0
  5. package/dist/accordion.d.ts +47 -0
  6. package/dist/accordion.js +350 -0
  7. package/dist/boxed.d.ts +1 -0
  8. package/dist/boxed.js +17 -16
  9. package/dist/card.js +345 -345
  10. package/dist/carousel.js +58 -52
  11. package/dist/checkbox.css.d.ts +1 -1
  12. package/dist/checkbox.d.ts +3 -1
  13. package/dist/checkbox.js +23 -22
  14. package/dist/community/blocks.js +3 -2
  15. package/dist/form-context.d.ts +9 -9
  16. package/dist/generated/mistica-icons/icons-keywords.d.ts +4 -0
  17. package/dist/icons/icon-chevron.d.ts +1 -0
  18. package/dist/icons/icon-chevron.js +21 -18
  19. package/dist/index.d.ts +4 -2
  20. package/dist/index.js +30 -4
  21. package/dist/integer-field.d.ts +5 -1
  22. package/dist/integer-field.js +12 -11
  23. package/dist/list.d.ts +8 -0
  24. package/dist/list.js +3 -0
  25. package/dist/menu.css-mistica.js +30 -6
  26. package/dist/menu.css.d.ts +14 -2
  27. package/dist/menu.d.ts +25 -3
  28. package/dist/menu.js +264 -84
  29. package/dist/overlay.js +11 -52
  30. package/dist/overscroll-color-context.js +23 -11
  31. package/dist/package-version.js +1 -1
  32. package/dist/pin-field.css-mistica.js +37 -0
  33. package/dist/pin-field.css.d.ts +7 -0
  34. package/dist/pin-field.css.ts.vanilla.css-mistica.js +11 -0
  35. package/dist/pin-field.d.ts +25 -0
  36. package/dist/pin-field.js +269 -0
  37. package/dist/progress-bar.css-mistica.js +7 -4
  38. package/dist/progress-bar.css.d.ts +1 -0
  39. package/dist/progress-bar.d.ts +12 -3
  40. package/dist/progress-bar.js +109 -13
  41. package/dist/stepper.js +34 -27
  42. package/dist/text-field-base.css.d.ts +2 -0
  43. package/dist/text-field-base.d.ts +1 -0
  44. package/dist/text-field-components.js +28 -26
  45. package/dist/text-field.d.ts +1 -0
  46. package/dist/theme.d.ts +3 -0
  47. package/dist/theme.js +24 -12
  48. package/dist/touchable.js +5 -4
  49. package/dist/video.js +8 -9
  50. package/dist-es/accordion.css-mistica.js +9 -0
  51. package/dist-es/accordion.css.ts.vanilla.css-mistica.js +2 -0
  52. package/dist-es/accordion.js +280 -0
  53. package/dist-es/boxed.js +25 -24
  54. package/dist-es/card.js +475 -475
  55. package/dist-es/carousel.js +95 -89
  56. package/dist-es/checkbox.js +42 -41
  57. package/dist-es/community/blocks.js +2 -1
  58. package/dist-es/icons/icon-chevron.js +25 -22
  59. package/dist-es/index.js +1768 -1766
  60. package/dist-es/integer-field.js +14 -13
  61. package/dist-es/list.js +9 -9
  62. package/dist-es/menu.css-mistica.js +10 -4
  63. package/dist-es/menu.js +262 -93
  64. package/dist-es/overlay.js +18 -20
  65. package/dist-es/overscroll-color-context.js +30 -18
  66. package/dist-es/package-version.js +1 -1
  67. package/dist-es/pin-field.css-mistica.js +5 -0
  68. package/dist-es/pin-field.css.ts.vanilla.css-mistica.js +2 -0
  69. package/dist-es/pin-field.js +217 -0
  70. package/dist-es/progress-bar.css-mistica.js +2 -2
  71. package/dist-es/progress-bar.js +67 -18
  72. package/dist-es/stepper.js +61 -54
  73. package/dist-es/style.css +1 -1
  74. package/dist-es/text-field-components.js +38 -36
  75. package/dist-es/theme.js +24 -12
  76. package/dist-es/touchable.js +9 -8
  77. package/dist-es/video.js +16 -17
  78. package/package.json +1 -1
@@ -0,0 +1,269 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", {
3
+ value: true
4
+ });
5
+ Object.defineProperty(exports, "default", {
6
+ enumerable: true,
7
+ get: function() {
8
+ return pe;
9
+ }
10
+ });
11
+ const _jsxruntime = require("react/jsx-runtime");
12
+ const _classnames = /*#__PURE__*/ _interop_require_default(require("classnames"));
13
+ const _react = /*#__PURE__*/ _interop_require_wildcard(require("react"));
14
+ const _inline = /*#__PURE__*/ _interop_require_default(require("./inline.js"));
15
+ const _textfieldbasecssmistica = require("./text-field-base.css-mistica.js");
16
+ const _pinfieldcssmistica = require("./pin-field.css-mistica.js");
17
+ const _hooks = require("./hooks.js");
18
+ const _screenreaderonly = /*#__PURE__*/ _interop_require_default(require("./screen-reader-only.js"));
19
+ const _integerfield = require("./integer-field.js");
20
+ const _formcontext = require("./form-context.js");
21
+ const _dom = require("./utils/dom.js");
22
+ const _textfieldcomponents = require("./text-field-components.js");
23
+ const _reactdom = require("react-dom");
24
+ function _interop_require_default(obj) {
25
+ return obj && obj.__esModule ? obj : {
26
+ default: obj
27
+ };
28
+ }
29
+ function _getRequireWildcardCache(nodeInterop) {
30
+ if (typeof WeakMap !== "function") return null;
31
+ var cacheBabelInterop = new WeakMap();
32
+ var cacheNodeInterop = new WeakMap();
33
+ return (_getRequireWildcardCache = function(nodeInterop) {
34
+ return nodeInterop ? cacheNodeInterop : cacheBabelInterop;
35
+ })(nodeInterop);
36
+ }
37
+ function _interop_require_wildcard(obj, nodeInterop) {
38
+ if (!nodeInterop && obj && obj.__esModule) {
39
+ return obj;
40
+ }
41
+ if (obj === null || typeof obj !== "object" && typeof obj !== "function") {
42
+ return {
43
+ default: obj
44
+ };
45
+ }
46
+ var cache = _getRequireWildcardCache(nodeInterop);
47
+ if (cache && cache.has(obj)) {
48
+ return cache.get(obj);
49
+ }
50
+ var newObj = {};
51
+ var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
52
+ for(var key in obj){
53
+ if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
54
+ var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null;
55
+ if (desc && (desc.get || desc.set)) {
56
+ Object.defineProperty(newObj, key, desc);
57
+ } else {
58
+ newObj[key] = obj[key];
59
+ }
60
+ }
61
+ }
62
+ newObj.default = obj;
63
+ if (cache) {
64
+ cache.set(obj, newObj);
65
+ }
66
+ return newObj;
67
+ }
68
+ function _define_property(obj, key, value) {
69
+ if (key in obj) {
70
+ Object.defineProperty(obj, key, {
71
+ value: value,
72
+ enumerable: true,
73
+ configurable: true,
74
+ writable: true
75
+ });
76
+ } else {
77
+ obj[key] = value;
78
+ }
79
+ return obj;
80
+ }
81
+ function _object_spread(target) {
82
+ for(var i = 1; i < arguments.length; i++){
83
+ var source = arguments[i] != null ? arguments[i] : {};
84
+ var ownKeys = Object.keys(source);
85
+ if (typeof Object.getOwnPropertySymbols === "function") {
86
+ ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
87
+ return Object.getOwnPropertyDescriptor(source, sym).enumerable;
88
+ }));
89
+ }
90
+ ownKeys.forEach(function(key) {
91
+ _define_property(target, key, source[key]);
92
+ });
93
+ }
94
+ return target;
95
+ }
96
+ let P = !1;
97
+ const Y = (param)=>{
98
+ let { length: a = 6 , hideCode: c = !1 , readSms: d , disabled: h , readOnly: y , value: w , defaultValue: b , onChange: n , inputRef: R } = param;
99
+ var _ref;
100
+ const { texts: T } = (0, _hooks.useTheme)(), [k, A] = _react.useState((_ref = b == null ? void 0 : b.slice(0, a)) !== null && _ref !== void 0 ? _ref : ""), [F, v] = _react.useState(void 0), l = _react.useRef(Array.from({
101
+ length: a
102
+ }, ()=>null)).current, f = typeof w < "u", r = f ? w : k, u = _react.useCallback((s)=>{
103
+ if (s === r) return;
104
+ f || A(s);
105
+ const e = l[0];
106
+ e && (n == null || n((0, _dom.createChangeEvent)(_object_spread({}, e), s)));
107
+ }, [
108
+ r,
109
+ l,
110
+ f,
111
+ n
112
+ ]);
113
+ _react.useEffect(()=>{
114
+ u(r.slice(0, a));
115
+ }, [
116
+ a,
117
+ r,
118
+ u
119
+ ]), _react.useEffect(()=>{
120
+ if (d && "OTPCredential" in window && !P) {
121
+ P = !0;
122
+ const s = new AbortController();
123
+ return navigator.credentials.get({
124
+ // @ts-expect-error: otp is not in the types yet
125
+ otp: {
126
+ transport: [
127
+ "sms"
128
+ ]
129
+ },
130
+ signal: s.signal
131
+ }).then((e)=>{
132
+ if (e) {
133
+ const t = e.code.slice(0, a);
134
+ u(t);
135
+ }
136
+ }).catch(()=>{}).finally(()=>{
137
+ P = !1;
138
+ }), ()=>{
139
+ P = !1, s.abort();
140
+ };
141
+ }
142
+ }, [
143
+ u,
144
+ a,
145
+ d
146
+ ]);
147
+ const N = (s)=>(e)=>{
148
+ var C;
149
+ const t = e.target.value;
150
+ if (t === "") return;
151
+ const o = r[s];
152
+ let p = t;
153
+ !o || o === t ? p = t : o === t[0] ? p = t.slice(1) : o === t[t.length - 1] && (p = t.slice(0, -1));
154
+ let I = s, g = r;
155
+ if (p.length >= 2) {
156
+ const S = p.slice(0, a - s);
157
+ g = r.slice(0, s) + S, I = Math.min(s + S.length, a - 1);
158
+ } else g = r.slice(0, s) + p + r.slice(s + 1), I = s + 1;
159
+ g !== r && ((0, _reactdom.flushSync)(()=>{
160
+ u(g);
161
+ }), I !== s && I <= a - 1 && ((C = l[I]) == null || C.focus()));
162
+ };
163
+ var _r_e;
164
+ return /* @__PURE__ */ (0, _jsxruntime.jsx)(_inline.default, {
165
+ space: 8,
166
+ children: Array.from({
167
+ length: a
168
+ }).map((s, e)=>/* @__PURE__ */ (0, _jsxruntime.jsxs)("div", {
169
+ className: y ? _pinfieldcssmistica.readOnlyField : e === F ? _pinfieldcssmistica.focusedField : _pinfieldcssmistica.field,
170
+ children: [
171
+ /* @__PURE__ */ (0, _jsxruntime.jsx)(_integerfield.IntegerInput, {
172
+ "aria-label": T.pinFieldInputLabel.replace("1$s", String(e + 1)).replace("2$s", String(a)),
173
+ type: c ? "password" : "text",
174
+ tabIndex: e > r.length ? -1 : void 0,
175
+ required: !0,
176
+ onFocus: ()=>{
177
+ var o;
178
+ const t = r.length === a ? -1 : r.length;
179
+ t >= 0 && t < e ? (o = l[t]) == null || o.focus() : v(e);
180
+ },
181
+ onBlur: ()=>{
182
+ v(void 0);
183
+ },
184
+ inputRef: (t)=>{
185
+ l[e] = t, e === 0 && R(t);
186
+ },
187
+ className: (0, _classnames.default)(_textfieldbasecssmistica.input, _textfieldbasecssmistica.inputWithoutLabel, _pinfieldcssmistica.input, {
188
+ [_pinfieldcssmistica.passwordInput]: c
189
+ }),
190
+ disabled: h,
191
+ readOnly: y,
192
+ autoComplete: d ? "one-time-code" : void 0,
193
+ value: (_r_e = r[e]) !== null && _r_e !== void 0 ? _r_e : "",
194
+ onChange: N(e),
195
+ onKeyDown: (t)=>{
196
+ switch(t.key){
197
+ case "Backspace":
198
+ case "Delete":
199
+ if (t.currentTarget.value && u(r.slice(0, e) + r.slice(e + 1)), e > 0 && e >= r.length - 1) {
200
+ const o = l[e - 1];
201
+ o == null || o.focus();
202
+ }
203
+ break;
204
+ case "ArrowLeft":
205
+ if (e > 0) {
206
+ const o = l[e - 1];
207
+ o && o.focus();
208
+ }
209
+ break;
210
+ case "ArrowRight":
211
+ if (e < a - 1) {
212
+ const o = l[e + 1];
213
+ o && o.focus();
214
+ }
215
+ break;
216
+ }
217
+ }
218
+ }),
219
+ c && r[e] && /* @__PURE__ */ (0, _jsxruntime.jsx)("div", {
220
+ "aria-hidden": !0,
221
+ className: _pinfieldcssmistica.passwordDot,
222
+ children: "•"
223
+ })
224
+ ]
225
+ }, e))
226
+ });
227
+ }, Z = (param)=>{
228
+ let { length: a = 6 , hideCode: c = !1 , readSms: d = !c , disabled: h , readOnly: y , name: w , value: b , defaultValue: n , helperText: R , error: T , onChangeValue: k , onChange: A , "aria-label": F , "aria-labelledby": v } = param;
229
+ const l = (0, _formcontext.useFieldProps)({
230
+ name: w,
231
+ value: b,
232
+ defaultValue: n,
233
+ processValue: (r)=>r,
234
+ helperText: R,
235
+ optional: !1,
236
+ error: T,
237
+ disabled: h,
238
+ onChangeValue: k,
239
+ onChange: A
240
+ }), f = (0, _hooks.useAriaId)();
241
+ return /* @__PURE__ */ (0, _jsxruntime.jsxs)("div", {
242
+ role: "group",
243
+ "aria-labelledby": v !== null && v !== void 0 ? v : f,
244
+ className: h ? _pinfieldcssmistica.disabled : void 0,
245
+ children: [
246
+ F && !v && /* @__PURE__ */ (0, _jsxruntime.jsx)(_screenreaderonly.default, {
247
+ children: /* @__PURE__ */ (0, _jsxruntime.jsx)("div", {
248
+ id: f,
249
+ children: F
250
+ })
251
+ }),
252
+ /* @__PURE__ */ (0, _jsxruntime.jsx)(Y, {
253
+ inputRef: l.inputRef,
254
+ length: a,
255
+ hideCode: c,
256
+ readSms: d,
257
+ value: l.value,
258
+ defaultValue: l.defaultValue,
259
+ disabled: l.disabled,
260
+ onChange: l.onChange,
261
+ readOnly: y
262
+ }),
263
+ /* @__PURE__ */ (0, _jsxruntime.jsx)(_textfieldcomponents.HelperText, {
264
+ error: l.error,
265
+ leftText: l.helperText
266
+ })
267
+ ]
268
+ });
269
+ }, pe = Z;
@@ -10,18 +10,21 @@ function _export(target, all) {
10
10
  }
11
11
  _export(exports, {
12
12
  bar: function() {
13
- return a;
13
+ return v;
14
14
  },
15
15
  barBackground: function() {
16
16
  return n;
17
17
  },
18
18
  inverse: function() {
19
- return y;
19
+ return e;
20
20
  },
21
21
  normal: function() {
22
- return e;
22
+ return y;
23
+ },
24
+ progressBarSteppedContainer: function() {
25
+ return o;
23
26
  }
24
27
  });
25
28
  require("./sprinkles.css.ts.vanilla.css-mistica.js");
26
29
  require("./progress-bar.css.ts.vanilla.css-mistica.js");
27
- var a = "_1y2v1nfca _1y2v1nfe3", n = "_1y2v1nfe3 _1y2v1nfcd _1y2v1nf44", y = "j0y7r95", e = "j0y7r94";
30
+ var v = "_1y2v1nfca _1y2v1nfe3", n = "_1y2v1nfe3 _1y2v1nfcd _1y2v1nf44", e = "j0y7r95", y = "j0y7r94", o = "j0y7r96";
@@ -2,3 +2,4 @@ export declare const barBackground: string;
2
2
  export declare const bar: string;
3
3
  export declare const normal: string;
4
4
  export declare const inverse: string;
5
+ export declare const progressBarSteppedContainer: string;
@@ -1,6 +1,6 @@
1
1
  import * as React from 'react';
2
2
  import type { DataAttributes } from './utils/types';
3
- type Props = {
3
+ type ProgressBarProps = {
4
4
  progressPercent: number;
5
5
  color?: string;
6
6
  children?: void;
@@ -9,5 +9,14 @@ type Props = {
9
9
  dataAttributes?: DataAttributes;
10
10
  reverse?: boolean;
11
11
  };
12
- declare const ProgressBar: React.FC<Props>;
13
- export default ProgressBar;
12
+ export declare const ProgressBar: React.FC<ProgressBarProps>;
13
+ type ProgressBarSteppedProps = {
14
+ steps: number;
15
+ currentStep?: number;
16
+ color?: string;
17
+ dataAttributes?: DataAttributes;
18
+ 'aria-label'?: string;
19
+ 'aria-labelledby'?: string;
20
+ };
21
+ export declare const ProgressBarStepped: React.FC<ProgressBarSteppedProps>;
22
+ export {};
@@ -2,23 +2,72 @@
2
2
  Object.defineProperty(exports, "__esModule", {
3
3
  value: true
4
4
  });
5
- Object.defineProperty(exports, "default", {
6
- enumerable: true,
7
- get: function() {
8
- return N;
5
+ function _export(target, all) {
6
+ for(var name in all)Object.defineProperty(target, name, {
7
+ enumerable: true,
8
+ get: all[name]
9
+ });
10
+ }
11
+ _export(exports, {
12
+ ProgressBar: function() {
13
+ return E;
14
+ },
15
+ ProgressBarStepped: function() {
16
+ return R;
9
17
  }
10
18
  });
11
19
  const _jsxruntime = require("react/jsx-runtime");
20
+ const _react = /*#__PURE__*/ _interop_require_wildcard(require("react"));
12
21
  const _hooks = require("./hooks.js");
13
22
  const _skincontractcssmistica = require("./skins/skin-contract.css-mistica.js");
14
23
  const _progressbarcssmistica = require("./progress-bar.css-mistica.js");
15
24
  const _dom = require("./utils/dom.js");
16
25
  const _classnames = /*#__PURE__*/ _interop_require_default(require("classnames"));
26
+ const _inline = /*#__PURE__*/ _interop_require_default(require("./inline.js"));
17
27
  function _interop_require_default(obj) {
18
28
  return obj && obj.__esModule ? obj : {
19
29
  default: obj
20
30
  };
21
31
  }
32
+ function _getRequireWildcardCache(nodeInterop) {
33
+ if (typeof WeakMap !== "function") return null;
34
+ var cacheBabelInterop = new WeakMap();
35
+ var cacheNodeInterop = new WeakMap();
36
+ return (_getRequireWildcardCache = function(nodeInterop) {
37
+ return nodeInterop ? cacheNodeInterop : cacheBabelInterop;
38
+ })(nodeInterop);
39
+ }
40
+ function _interop_require_wildcard(obj, nodeInterop) {
41
+ if (!nodeInterop && obj && obj.__esModule) {
42
+ return obj;
43
+ }
44
+ if (obj === null || typeof obj !== "object" && typeof obj !== "function") {
45
+ return {
46
+ default: obj
47
+ };
48
+ }
49
+ var cache = _getRequireWildcardCache(nodeInterop);
50
+ if (cache && cache.has(obj)) {
51
+ return cache.get(obj);
52
+ }
53
+ var newObj = {};
54
+ var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
55
+ for(var key in obj){
56
+ if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
57
+ var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null;
58
+ if (desc && (desc.get || desc.set)) {
59
+ Object.defineProperty(newObj, key, desc);
60
+ } else {
61
+ newObj[key] = obj[key];
62
+ }
63
+ }
64
+ }
65
+ newObj.default = obj;
66
+ if (cache) {
67
+ cache.set(obj, newObj);
68
+ }
69
+ return newObj;
70
+ }
22
71
  function _define_property(obj, key, value) {
23
72
  if (key in obj) {
24
73
  Object.defineProperty(obj, key, {
@@ -71,23 +120,70 @@ function _object_spread_props(target, source) {
71
120
  }
72
121
  return target;
73
122
  }
74
- const x = (param)=>{
75
- let { progressPercent: a , color: e , "aria-label": l , "aria-labelledby": r , dataAttributes: s , reverse: t = !1 } = param;
76
- const { texts: i } = (0, _hooks.useTheme)(), m = i.loading, n = r ? void 0 : l || m;
77
- return /* @__PURE__ */ (0, _jsxruntime.jsx)("div", _object_spread_props(_object_spread({}, (0, _dom.getPrefixedDataAttributes)(s, "ProgressBar")), {
123
+ const E = (param)=>{
124
+ let { progressPercent: r , color: o , "aria-label": d , "aria-labelledby": l , dataAttributes: i , reverse: n = !1 } = param;
125
+ const { texts: c } = (0, _hooks.useTheme)(), a = Math.max(0, Math.min(100, r)), s = l ? void 0 : (()=>`${d || c.loading}, ${a}% ${c.progressBarCompletedLabel}`)();
126
+ return /* @__PURE__ */ (0, _jsxruntime.jsx)("div", _object_spread_props(_object_spread({}, (0, _dom.getPrefixedDataAttributes)(i, "ProgressBar")), {
78
127
  className: _progressbarcssmistica.barBackground,
79
128
  role: "progressbar",
80
129
  "aria-valuenow": a,
81
130
  "aria-valuemin": 0,
82
131
  "aria-valuemax": 100,
83
- "aria-label": n,
84
- "aria-labelledby": r,
132
+ "aria-label": s,
133
+ "aria-labelledby": l,
85
134
  children: /* @__PURE__ */ (0, _jsxruntime.jsx)("div", {
86
- className: (0, _classnames.default)(_progressbarcssmistica.bar, t ? _progressbarcssmistica.inverse : _progressbarcssmistica.normal),
135
+ className: (0, _classnames.default)(_progressbarcssmistica.bar, n ? _progressbarcssmistica.inverse : _progressbarcssmistica.normal),
87
136
  style: {
88
137
  maxWidth: `${a}%`,
89
- backgroundColor: e !== null && e !== void 0 ? e : _skincontractcssmistica.vars.colors.controlActivated
138
+ backgroundColor: o !== null && o !== void 0 ? o : _skincontractcssmistica.vars.colors.controlActivated
90
139
  }
91
140
  })
92
141
  }));
93
- }, N = x;
142
+ }, R = (param)=>{
143
+ let { steps: r , currentStep: o = 0 , color: d , dataAttributes: l , "aria-label": i , "aria-labelledby": n } = param;
144
+ const { texts: c } = (0, _hooks.useTheme)(), [a, p] = _react.useState(Math.ceil(o)), [s, y] = _react.useState(!1);
145
+ _react.useEffect(()=>{
146
+ const e = Math.ceil(o);
147
+ a !== e && (y(e < a), p(e));
148
+ }, [
149
+ o,
150
+ r,
151
+ a
152
+ ]);
153
+ const A = n ? void 0 : (()=>{
154
+ const e = c.progressBarStepLabel.replace("1$s", String(a)).replace("2$s", String(r));
155
+ return i ? `${i}, ${e.toLowerCase()}` : e;
156
+ })();
157
+ return /* @__PURE__ */ (0, _jsxruntime.jsx)("div", _object_spread_props(_object_spread({}, (0, _dom.getPrefixedDataAttributes)(l, "ProgressBarStepped")), {
158
+ role: "progressbar",
159
+ "aria-valuenow": a,
160
+ "aria-valuemin": 0,
161
+ "aria-valuemax": r,
162
+ "aria-label": A,
163
+ "aria-labelledby": n,
164
+ className: _progressbarcssmistica.progressBarSteppedContainer,
165
+ children: /* @__PURE__ */ (0, _jsxruntime.jsx)(_inline.default, {
166
+ space: 8,
167
+ fullWidth: !0,
168
+ children: Array.from({
169
+ length: r
170
+ }, (e, m)=>{
171
+ const g = m === a, u = m < a, v = m === a - 1;
172
+ return /* @__PURE__ */ (0, _jsxruntime.jsx)("div", {
173
+ className: _progressbarcssmistica.barBackground,
174
+ "aria-hidden": "true",
175
+ children: (u || g) && /* @__PURE__ */ (0, _jsxruntime.jsx)("div", {
176
+ className: (0, _classnames.default)(_progressbarcssmistica.bar, {
177
+ [_progressbarcssmistica.normal]: v && !s,
178
+ [_progressbarcssmistica.inverse]: g && s
179
+ }),
180
+ style: {
181
+ backgroundColor: d !== null && d !== void 0 ? d : _skincontractcssmistica.vars.colors.controlActivated,
182
+ maxWidth: u || v && !s ? "100%" : "0"
183
+ }
184
+ })
185
+ }, m);
186
+ })
187
+ })
188
+ }));
189
+ };
package/dist/stepper.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 ee;
8
+ return te;
9
9
  }
10
10
  });
11
11
  const _jsxruntime = require("react/jsx-runtime");
@@ -115,37 +115,44 @@ function _object_spread_props(target, source) {
115
115
  }
116
116
  return target;
117
117
  }
118
- const G = (param)=>{
119
- let { steps: n , currentIndex: t , "aria-label": v , dataAttributes: f } = param;
120
- const { textPresets: g } = (0, _hooks.useTheme)(), { isDesktopOrBigger: b } = (0, _hooks.useScreenSize)(), { height: N , ref: S } = (0, _hooks.useElementDimensions)(), A = N, l = _react.useRef(t), i = l.current > t;
121
- return t !== l.current && (l.current = t), /* @__PURE__ */ (0, _jsxruntime.jsx)("div", _object_spread_props(_object_spread({
118
+ const J = (param)=>{
119
+ let { steps: n , currentIndex: m , "aria-label": f , dataAttributes: v } = param;
120
+ const { textPresets: g } = (0, _hooks.useTheme)(), { isDesktopOrBigger: S } = (0, _hooks.useScreenSize)(), { height: b , ref: N } = (0, _hooks.useElementDimensions)(), x = b, [a, A] = _react.useState(Math.ceil(m)), [s, y] = _react.useState(!1);
121
+ return _react.useEffect(()=>{
122
+ const i = Math.ceil(m);
123
+ a !== i && (y(i < a), A(i));
124
+ }, [
125
+ m,
126
+ n,
127
+ a
128
+ ]), /* @__PURE__ */ (0, _jsxruntime.jsx)("div", _object_spread_props(_object_spread({
122
129
  className: _steppercssmistica.stepper,
123
130
  style: (0, _dynamic.assignInlineVars)({
124
- [_steppercssmistica.vars.stepperMinHeight]: (0, _css.pxToRem)(40 + A)
131
+ [_steppercssmistica.vars.stepperMinHeight]: (0, _css.pxToRem)(40 + x)
125
132
  })
126
- }, (0, _dom.getPrefixedDataAttributes)(f, "Stepper")), {
127
- children: n.map((p, a)=>{
128
- const r = a === t, y = a === n.length - 1, o = a < t, m = a === t - 1;
133
+ }, (0, _dom.getPrefixedDataAttributes)(v, "Stepper")), {
134
+ children: n.map((i, t)=>{
135
+ const r = t === a, k = t === n.length - 1, c = t < a, p = t === a - 1;
129
136
  return /* @__PURE__ */ (0, _jsxruntime.jsxs)(_react.Fragment, {
130
137
  children: [
131
138
  /* @__PURE__ */ (0, _jsxruntime.jsxs)("div", {
132
139
  className: _steppercssmistica.step,
133
140
  role: "progressbar",
134
- "aria-valuenow": r ? a + 1 : void 0,
141
+ "aria-valuenow": r ? t + 1 : void 0,
135
142
  "aria-valuemin": 1,
136
143
  "aria-valuemax": n.length,
137
- "aria-valuetext": p,
138
- "aria-label": v,
144
+ "aria-valuetext": i,
145
+ "aria-label": f,
139
146
  children: [
140
- o ? /* @__PURE__ */ (0, _jsxruntime.jsx)("div", {
147
+ c ? /* @__PURE__ */ (0, _jsxruntime.jsx)("div", {
141
148
  className: (0, _classnames.default)(_steppercssmistica.stepIconNumber, {
142
- [_steppercssmistica.iconAnimation]: m && !i
149
+ [_steppercssmistica.iconAnimation]: p && !s
143
150
  }),
144
151
  "aria-hidden": "true",
145
152
  children: /* @__PURE__ */ (0, _jsxruntime.jsx)(_iconsuccess.default, {
146
153
  color: _skincontractcssmistica.vars.colors.controlActivated,
147
154
  size: "100%",
148
- skipAnimation: !m || i
155
+ skipAnimation: !p || s
149
156
  })
150
157
  }) : /* @__PURE__ */ (0, _jsxruntime.jsx)("div", {
151
158
  className: (0, _classnames.default)(_steppercssmistica.stepIconNumber, _steppercssmistica.number, {
@@ -156,35 +163,35 @@ const G = (param)=>{
156
163
  weight: g.indicator.weight,
157
164
  color: r ? _skincontractcssmistica.vars.colors.textPrimaryInverse : _skincontractcssmistica.vars.colors.textSecondary,
158
165
  "aria-hidden": "true",
159
- children: a + 1
166
+ children: t + 1
160
167
  })
161
168
  }),
162
- b && /* @__PURE__ */ (0, _jsxruntime.jsx)("div", {
169
+ S && /* @__PURE__ */ (0, _jsxruntime.jsx)("div", {
163
170
  className: _steppercssmistica.textContainer,
164
- ref: S,
171
+ ref: N,
165
172
  "aria-hidden": "true",
166
173
  children: /* @__PURE__ */ (0, _jsxruntime.jsx)(_text.Text2, {
167
174
  as: "span",
168
175
  regular: !0,
169
- color: o || r ? _skincontractcssmistica.vars.colors.textPrimary : _skincontractcssmistica.vars.colors.textSecondary,
170
- children: p
176
+ color: c || r ? _skincontractcssmistica.vars.colors.textPrimary : _skincontractcssmistica.vars.colors.textSecondary,
177
+ children: i
171
178
  })
172
179
  })
173
180
  ]
174
181
  }),
175
- !y && /* @__PURE__ */ (0, _jsxruntime.jsx)("div", {
182
+ !k && /* @__PURE__ */ (0, _jsxruntime.jsx)("div", {
176
183
  className: _steppercssmistica.bar,
177
184
  "aria-hidden": "true",
178
- children: (o || r) && /* @__PURE__ */ (0, _jsxruntime.jsx)("div", {
185
+ children: (c || r) && /* @__PURE__ */ (0, _jsxruntime.jsx)("div", {
179
186
  className: (0, _classnames.default)({
180
- [_steppercssmistica.barFilled]: i && r || o,
181
- [_steppercssmistica.barFilledAnimation]: m && !i,
182
- [_steppercssmistica.barFilledReverseAnimation]: r && i
187
+ [_steppercssmistica.barFilled]: s && r || c,
188
+ [_steppercssmistica.barFilledAnimation]: p && !s,
189
+ [_steppercssmistica.barFilledReverseAnimation]: r && s
183
190
  })
184
191
  })
185
192
  })
186
193
  ]
187
- }, a);
194
+ }, t);
188
195
  })
189
196
  }));
190
- }, ee = G;
197
+ }, te = J;
@@ -1,3 +1,5 @@
1
+ export declare const mobileFontSize = 16;
2
+ export declare const desktopFontSize = 18;
1
3
  export declare const container: string;
2
4
  export declare const fullWidth: string;
3
5
  export declare const textArea: string;
@@ -70,6 +70,7 @@ interface TextFieldBaseProps {
70
70
  readOnly?: boolean;
71
71
  min?: string;
72
72
  max?: string;
73
+ role?: string;
73
74
  }
74
75
  export declare const TextFieldBase: React.ForwardRefExoticComponent<TextFieldBaseProps & React.RefAttributes<any>>;
75
76
  export declare const TextFieldBaseAutosuggest: React.ForwardRefExoticComponent<TextFieldBaseProps & React.RefAttributes<any>>;