@telefonica/mistica 16.0.0 → 16.1.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 (152) hide show
  1. package/README.md +11 -9
  2. package/css/mistica.css +1 -1
  3. package/dist/box.d.ts +1 -0
  4. package/dist/box.js +12 -12
  5. package/dist/card.d.ts +14 -2
  6. package/dist/card.js +210 -206
  7. package/dist/credit-card-expiration-field.d.ts +1 -1
  8. package/dist/credit-card-expiration-field.js +53 -52
  9. package/dist/credit-card-number-field.d.ts +1 -1
  10. package/dist/credit-card-number-field.js +47 -45
  11. package/dist/cvv-field.d.ts +1 -1
  12. package/dist/cvv-field.js +38 -37
  13. package/dist/date-field.d.ts +1 -1
  14. package/dist/date-field.js +15 -13
  15. package/dist/date-time-field.d.ts +1 -1
  16. package/dist/date-time-field.js +13 -11
  17. package/dist/decimal-field.d.ts +1 -1
  18. package/dist/decimal-field.js +39 -38
  19. package/dist/email-field.d.ts +1 -1
  20. package/dist/email-field.js +21 -19
  21. package/dist/form-context.d.ts +7 -2
  22. package/dist/form-context.js +69 -62
  23. package/dist/form.d.ts +2 -1
  24. package/dist/form.js +94 -80
  25. package/dist/iban-field.d.ts +1 -1
  26. package/dist/iban-field.js +32 -30
  27. package/dist/index.d.ts +12 -3
  28. package/dist/index.js +19 -8
  29. package/dist/inline.d.ts +2 -1
  30. package/dist/inline.js +16 -15
  31. package/dist/integer-field.d.ts +1 -1
  32. package/dist/integer-field.js +30 -30
  33. package/dist/month-field.d.ts +1 -1
  34. package/dist/month-field.js +15 -13
  35. package/dist/package-version.js +1 -1
  36. package/dist/password-field.d.ts +1 -1
  37. package/dist/password-field.js +24 -22
  38. package/dist/phone-number-field.d.ts +4 -1
  39. package/dist/phone-number-field.js +84 -52
  40. package/dist/pin-field.js +21 -20
  41. package/dist/radio-button.d.ts +1 -0
  42. package/dist/radio-button.js +42 -41
  43. package/dist/rating.css-mistica.js +44 -0
  44. package/dist/rating.css.d.ts +11 -0
  45. package/dist/rating.css.ts.vanilla.css-mistica.js +11 -0
  46. package/dist/rating.d.ts +37 -0
  47. package/dist/rating.js +320 -0
  48. package/dist/search-field.d.ts +1 -0
  49. package/dist/search-field.js +18 -16
  50. package/dist/select.js +36 -33
  51. package/dist/sheet-action-row.css-mistica.js +13 -0
  52. package/dist/sheet-action-row.css.d.ts +1 -0
  53. package/dist/sheet-actions-list.d.ts +26 -0
  54. package/dist/sheet-actions-list.js +147 -0
  55. package/dist/sheet-actions.d.ts +23 -0
  56. package/dist/sheet-actions.js +175 -0
  57. package/dist/{sheet.css-mistica.js → sheet-common.css-mistica.js} +15 -21
  58. package/dist/{sheet.css.d.ts → sheet-common.css.d.ts} +0 -2
  59. package/dist/sheet-common.css.ts.vanilla.css-mistica.js +11 -0
  60. package/dist/sheet-common.d.ts +24 -0
  61. package/dist/sheet-common.js +429 -0
  62. package/dist/sheet-info.css-mistica.js +12 -0
  63. package/dist/sheet-info.css.d.ts +1 -0
  64. package/dist/sheet-info.d.ts +28 -0
  65. package/dist/sheet-info.js +156 -0
  66. package/dist/sheet-native.d.ts +2 -0
  67. package/dist/sheet-native.js +173 -0
  68. package/dist/sheet-radio-list.d.ts +22 -0
  69. package/dist/sheet-radio-list.js +143 -0
  70. package/dist/sheet-root.d.ts +4 -85
  71. package/dist/sheet-root.js +48 -322
  72. package/dist/sheet-types.d.ts +88 -0
  73. package/dist/sheet-web.d.ts +8 -0
  74. package/dist/sheet-web.js +183 -0
  75. package/dist/slider.js +40 -39
  76. package/dist/switch-component.js +18 -17
  77. package/dist/text-field-base.d.ts +3 -1
  78. package/dist/text-field-base.js +74 -66
  79. package/dist/text-field-components.css-mistica.js +14 -14
  80. package/dist/text-field-components.css.d.ts +2 -2
  81. package/dist/text-field-components.js +49 -39
  82. package/dist/text-field.d.ts +1 -0
  83. package/dist/text-field.js +24 -22
  84. package/dist/text-tokens.d.ts +14 -0
  85. package/dist/text-tokens.js +145 -89
  86. package/dist/theme-context-provider.js +6 -5
  87. package/dist/theme.d.ts +2 -0
  88. package/dist/utils/credit-card.d.ts +2 -2
  89. package/dist/utils/credit-card.js +1 -1
  90. package/dist/vivinho-loading-animation/in-lottie.json.js +544 -612
  91. package/dist/vivinho-loading-animation/out-lottie.json.js +828 -896
  92. package/dist/vivinho-loading-animation/pulse-lottie.json.js +798 -866
  93. package/dist/vivinho-loading-animation/wave-lottie.json.js +4303 -4409
  94. package/dist-es/box.js +18 -18
  95. package/dist-es/card.js +305 -301
  96. package/dist-es/credit-card-expiration-field.js +57 -56
  97. package/dist-es/credit-card-number-field.js +74 -72
  98. package/dist-es/cvv-field.js +82 -81
  99. package/dist-es/date-field.js +29 -27
  100. package/dist-es/date-time-field.js +29 -27
  101. package/dist-es/decimal-field.js +46 -45
  102. package/dist-es/email-field.js +26 -24
  103. package/dist-es/form-context.js +70 -63
  104. package/dist-es/form.js +102 -88
  105. package/dist-es/iban-field.js +35 -33
  106. package/dist-es/index.js +1822 -1817
  107. package/dist-es/inline.js +26 -25
  108. package/dist-es/integer-field.js +31 -31
  109. package/dist-es/month-field.js +28 -26
  110. package/dist-es/package-version.js +1 -1
  111. package/dist-es/password-field.js +37 -35
  112. package/dist-es/phone-number-field.js +92 -60
  113. package/dist-es/pin-field.js +32 -31
  114. package/dist-es/radio-button.js +42 -41
  115. package/dist-es/rating.css-mistica.js +6 -0
  116. package/dist-es/rating.css.ts.vanilla.css-mistica.js +2 -0
  117. package/dist-es/rating.js +257 -0
  118. package/dist-es/search-field.js +33 -31
  119. package/dist-es/select.js +49 -46
  120. package/dist-es/sheet-action-row.css-mistica.js +4 -0
  121. package/dist-es/sheet-actions-list.js +92 -0
  122. package/dist-es/sheet-actions.js +125 -0
  123. package/dist-es/sheet-common.css-mistica.js +4 -0
  124. package/dist-es/sheet-common.css.ts.vanilla.css-mistica.js +2 -0
  125. package/dist-es/sheet-common.js +366 -0
  126. package/dist-es/sheet-info.css-mistica.js +3 -0
  127. package/dist-es/sheet-info.js +101 -0
  128. package/dist-es/sheet-native.js +164 -0
  129. package/dist-es/sheet-radio-list.js +88 -0
  130. package/dist-es/sheet-root.js +50 -319
  131. package/dist-es/sheet-web.js +128 -0
  132. package/dist-es/slider.js +49 -48
  133. package/dist-es/style.css +1 -1
  134. package/dist-es/switch-component.js +27 -26
  135. package/dist-es/text-field-base.js +108 -100
  136. package/dist-es/text-field-components.css-mistica.js +2 -2
  137. package/dist-es/text-field-components.js +70 -60
  138. package/dist-es/text-field.js +33 -31
  139. package/dist-es/text-tokens.js +80 -45
  140. package/dist-es/theme-context-provider.js +20 -19
  141. package/dist-es/utils/credit-card.js +1 -1
  142. package/dist-es/vivinho-loading-animation/in-lottie.json.js +534 -599
  143. package/dist-es/vivinho-loading-animation/out-lottie.json.js +821 -886
  144. package/dist-es/vivinho-loading-animation/pulse-lottie.json.js +790 -855
  145. package/dist-es/vivinho-loading-animation/wave-lottie.json.js +4297 -4400
  146. package/package.json +4 -3
  147. package/dist/sheet.d.ts +0 -107
  148. package/dist/sheet.js +0 -642
  149. package/dist-es/sheet.css-mistica.js +0 -4
  150. package/dist-es/sheet.js +0 -567
  151. /package/dist/{sheet.css.ts.vanilla.css-mistica.js → sheet-action-row.css.ts.vanilla.css-mistica.js} +0 -0
  152. /package/dist-es/{sheet.css.ts.vanilla.css-mistica.js → sheet-action-row.css.ts.vanilla.css-mistica.js} +0 -0
package/dist/form.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 Y;
9
+ return oe;
10
10
  }
11
11
  });
12
12
  const _jsxruntime = require("react/jsx-runtime");
@@ -16,6 +16,7 @@ const _formcontext = require("./form-context.js");
16
16
  const _classnames = /*#__PURE__*/ _interop_require_default(require("classnames"));
17
17
  const _sprinklescssmistica = require("./sprinkles.css-mistica.js");
18
18
  const _texttokens = require("./text-tokens.js");
19
+ const _screenreaderonly = /*#__PURE__*/ _interop_require_default(require("./screen-reader-only.js"));
19
20
  function _interop_require_default(obj) {
20
21
  return obj && obj.__esModule ? obj : {
21
22
  default: obj
@@ -115,118 +116,131 @@ function _object_spread_props(target, source) {
115
116
  return target;
116
117
  }
117
118
  process.env.NODE_ENV !== "test" && typeof document < "u" && !("scrollBehavior" in document.documentElement.style) && Promise.resolve().then(()=>/*#__PURE__*/ _interop_require_wildcard(require("scroll-behavior-polyfill"))).finally(()=>{});
118
- const U = (param)=>{
119
- let { children: N, className: R, onSubmit: b, initialValues: k = {}, autoJump: y = !1, onValidationErrors: a, id: S } = param;
120
- const f = _react.useRef(!0), [i, x] = _react.useState(k), [l, w] = _react.useState(k), [V, m] = _react.useState("filling"), [j, h] = _react.useState({}), c = _react.useRef(/* @__PURE__ */ new Map()), d = _react.useRef(null), { texts: g, t: v } = (0, _hooks.useTheme)(), M = _react.useId(), F = S || M;
119
+ const X = (param)=>{
120
+ let { children: S, className: j, onSubmit: g, initialValues: E = {}, autoJump: O = !1, onValidationErrors: a, getErrorMessageForScreenReader: v, id: M } = param;
121
+ const f = _react.useRef(!0), [u, w] = _react.useState(E), [c, V] = _react.useState(E), [P, m] = _react.useState("filling"), [d, F] = _react.useState({}), l = _react.useRef(/* @__PURE__ */ new Map()), p = _react.useRef(null), { texts: b, t: h } = (0, _hooks.useTheme)(), T = _react.useId(), I = M || T;
121
122
  _react.useEffect(()=>(f.current = !0, ()=>{
122
123
  f.current = !1;
123
124
  }), []);
124
- const P = _react.useCallback((e, param)=>{
125
- let { input: r, validator: o, focusableElement: t } = param;
126
- r || t ? c.current.set(e, {
127
- input: r,
128
- validator: o,
129
- focusableElement: t
130
- }) : c.current.delete(e);
131
- }, []), T = _react.useCallback((param)=>{
132
- let { name: e, error: r } = param;
133
- return h((o)=>_object_spread_props(_object_spread({}, o), {
134
- [e]: r
125
+ const A = _react.useCallback((e, param)=>{
126
+ let { input: t, validator: s, focusableElement: r, label: o } = param;
127
+ t || r ? l.current.set(e, {
128
+ input: t,
129
+ validator: s,
130
+ focusableElement: r,
131
+ label: o
132
+ }) : l.current.delete(e);
133
+ }, []), D = _react.useCallback((param)=>{
134
+ let { name: e, error: t } = param;
135
+ return F((s)=>_object_spread_props(_object_spread({}, s), {
136
+ [e]: t
135
137
  }));
136
- }, []), p = _react.useCallback(()=>{
137
- var o;
138
+ }, []), y = _react.useCallback(()=>{
139
+ var s;
138
140
  const e = {};
139
- for (const [t, { input: s, validator: u }] of c.current)if (s) {
140
- if (s.disabled) continue;
141
- if (s.required && !((o = l[t]) != null && o.trim())) e[t] = g.formFieldErrorIsMandatory || v(_texttokens.formFieldErrorIsMandatory);
141
+ for (const [r, { input: o, validator: i }] of l.current)if (o) {
142
+ if (o.disabled) continue;
143
+ if (o.required && !((s = c[r]) != null && s.trim())) e[r] = b.formFieldErrorIsMandatory || h(_texttokens.formFieldErrorIsMandatory);
142
144
  else {
143
- const C = u == null ? void 0 : u(i[t], l[t]);
144
- C && (e[t] = C);
145
+ const R = i == null ? void 0 : i(u[r], c[r]);
146
+ R && (e[r] = R);
145
147
  }
146
148
  }
147
- const r = Object.keys(e).map((t)=>{
148
- const s = c.current.get(t);
149
- return (s == null ? void 0 : s.focusableElement) || (s == null ? void 0 : s.input);
149
+ const t = Object.keys(e).map((r)=>{
150
+ const o = l.current.get(r);
151
+ return (o == null ? void 0 : o.focusableElement) || (o == null ? void 0 : o.input);
150
152
  }).filter(Boolean);
151
- if (r.length) {
152
- r.sort((t, s)=>t.compareDocumentPosition(s) & Node.DOCUMENT_POSITION_FOLLOWING ? -1 : 1), r[0].focus();
153
+ if (t.length) {
154
+ t.sort((r, o)=>r.compareDocumentPosition(o) & Node.DOCUMENT_POSITION_FOLLOWING ? -1 : 1), t[0].focus();
153
155
  try {
154
- r[0].scrollIntoView({
156
+ t[0].scrollIntoView({
155
157
  behavior: "smooth",
156
158
  block: "center",
157
159
  inline: "center"
158
160
  });
159
161
  } catch (e) {}
160
162
  }
161
- return h(e), a && Object.keys(e).length > 0 && a(e), e;
163
+ return F(e), a && Object.keys(e).length > 0 && a(e), e;
162
164
  }, [
163
165
  a,
164
- l,
165
- g,
166
- i,
167
- v
168
- ]), D = _react.useCallback((e)=>{
166
+ c,
167
+ b,
168
+ u,
169
+ h
170
+ ]), B = _react.useCallback((e)=>{
169
171
  setTimeout(()=>{
170
- var r;
171
- if (y && d.current) {
172
- const o = Array.from(d.current.querySelectorAll("input, select")), t = (r = c.current.get(e)) == null ? void 0 : r.input, s = o.indexOf(t);
173
- if (s >= 0) {
174
- const u = o[s + 1];
175
- u ? u.focus() : t == null || t.blur();
172
+ var t;
173
+ if (O && p.current) {
174
+ const s = Array.from(p.current.querySelectorAll("input, select")), r = (t = l.current.get(e)) == null ? void 0 : t.input, o = s.indexOf(r);
175
+ if (o >= 0) {
176
+ const i = s[o + 1];
177
+ i ? i.focus() : r == null || r.blur();
176
178
  }
177
179
  }
178
180
  }, 100);
179
181
  }, [
180
- y
181
- ]), I = (e)=>[
182
- ...c.current.keys()
183
- ].reduce((r, o)=>{
184
- var t, s;
185
- return (s = (t = c.current.get(o)) == null ? void 0 : t.input) != null && s.disabled ? r : _object_spread_props(_object_spread({}, r), {
186
- [o]: e[o]
182
+ O
183
+ ]), x = (e)=>[
184
+ ...l.current.keys()
185
+ ].reduce((t, s)=>{
186
+ var r, o;
187
+ return (o = (r = l.current.get(s)) == null ? void 0 : r.input) != null && o.disabled ? t : _object_spread_props(_object_spread({}, t), {
188
+ [s]: e[s]
187
189
  });
188
- }, {}), O = _react.useCallback((e)=>(e == null || e.preventDefault(), m("sending"), Object.keys(p()).length > 0 ? (m("filling"), Promise.resolve()) : Promise.resolve(b(I(i), I(l))).finally(()=>{
190
+ }, {}), C = _react.useCallback((e)=>(e == null || e.preventDefault(), m("sending"), Object.keys(y()).length > 0 ? (m("filling"), Promise.resolve()) : Promise.resolve(g(x(u), x(c))).finally(()=>{
189
191
  f.current && m("filling");
190
192
  })), [
191
- b,
192
- l,
193
- p,
194
- i
195
- ]), _ = _react.useCallback((param)=>{
196
- let { name: e, value: r } = param;
197
- x((o)=>_object_spread_props(_object_spread({}, o), {
198
- [e]: r
193
+ g,
194
+ c,
195
+ y,
196
+ u
197
+ ]), L = _react.useCallback((param)=>{
198
+ let { name: e, value: t } = param;
199
+ w((s)=>_object_spread_props(_object_spread({}, s), {
200
+ [e]: t
199
201
  }));
200
- }, []), q = _react.useCallback((param)=>{
201
- let { name: e, value: r } = param;
202
- w((o)=>_object_spread_props(_object_spread({}, o), {
203
- [e]: r
202
+ }, []), W = _react.useCallback((param)=>{
203
+ let { name: e, value: t } = param;
204
+ V((s)=>_object_spread_props(_object_spread({}, s), {
205
+ [e]: t
204
206
  }));
205
- }, []);
207
+ }, []), N = Object.entries(d).map((param)=>{
208
+ let [e, t] = param;
209
+ var s;
210
+ return t && ((s = l.current.get(e)) == null ? void 0 : s.label);
211
+ }).filter(Boolean), _ = N.length > 1;
206
212
  return /* @__PURE__ */ (0, _jsxruntime.jsx)(_formcontext.FormContext.Provider, {
207
213
  value: {
208
- formStatus: V,
209
- values: i,
210
- setValue: _,
211
- rawValues: l,
212
- setRawValue: q,
213
- formErrors: j,
214
- setFormError: T,
215
- register: P,
216
- jumpToNext: D,
217
- validate: p,
218
- submit: O,
219
- formId: F
214
+ formStatus: P,
215
+ values: u,
216
+ setValue: L,
217
+ rawValues: c,
218
+ setRawValue: W,
219
+ formErrors: d,
220
+ setFormError: D,
221
+ register: A,
222
+ jumpToNext: B,
223
+ validate: y,
224
+ submit: C,
225
+ formId: I
220
226
  },
221
- children: /* @__PURE__ */ (0, _jsxruntime.jsx)("form", {
222
- id: F,
223
- onSubmit: O,
224
- ref: d,
227
+ children: /* @__PURE__ */ (0, _jsxruntime.jsxs)("form", {
228
+ id: I,
229
+ onSubmit: C,
230
+ ref: p,
225
231
  className: (0, _classnames.default)((0, _sprinklescssmistica.sprinkles)({
226
232
  width: "100%"
227
- }), R),
233
+ }), j),
228
234
  noValidate: !0,
229
- children: N
235
+ children: [
236
+ _ ? /* @__PURE__ */ (0, _jsxruntime.jsx)(_screenreaderonly.default, {
237
+ children: /* @__PURE__ */ (0, _jsxruntime.jsx)("span", {
238
+ role: "alert",
239
+ children: v ? v(d) : `${b.formErrorsAlertMessage || h(_texttokens.formErrorsAlertMessage)} ${N.join(", ")}`
240
+ })
241
+ }) : null,
242
+ S
243
+ ]
230
244
  })
231
245
  });
232
- }, Y = U;
246
+ }, oe = X;
@@ -5,5 +5,5 @@ export interface IbanFieldProps extends CommonFormFieldProps {
5
5
  prefix?: string;
6
6
  getSuggestions?: (value: string) => Array<string>;
7
7
  }
8
- declare const IbanField: ({ disabled, error, helperText, name, optional, validate: customValidate, onChange, onChangeValue, onBlur, value, defaultValue, dataAttributes, ...rest }: IbanFieldProps) => JSX.Element;
8
+ declare const IbanField: ({ disabled, error, helperText, name, label, optional, validate: customValidate, onChange, onChangeValue, onBlur, value, defaultValue, dataAttributes, ...rest }: IbanFieldProps) => JSX.Element;
9
9
  export default IbanField;
@@ -138,16 +138,16 @@ function _object_without_properties_loose(source, excluded) {
138
138
  }
139
139
  return target;
140
140
  }
141
- const I = {
141
+ const A = {
142
142
  ES: 24,
143
143
  GB: 22,
144
144
  DE: 22,
145
145
  BR: 29
146
- }, M = 32, R = (t, e)=>{
146
+ }, R = 32, S = (t, e)=>{
147
147
  let n = 0;
148
148
  for(let r = 0; r < t.length; r++)n = (n * 10 + Number(t[r])) % e;
149
149
  return n;
150
- }, y = (t)=>/^[A-Z]{2}$/.test(t), S = (t)=>/^\d{2}$/.test(t), T = (t)=>{
150
+ }, v = (t)=>/^[A-Z]{2}$/.test(t), T = (t)=>/^\d{2}$/.test(t), z = (t)=>{
151
151
  let e = t.substr(4) + t.substr(0, 4);
152
152
  const n = "A".charCodeAt(0);
153
153
  return e = Array.from(e).map((r)=>{
@@ -156,12 +156,12 @@ const I = {
156
156
  return String(10 + s - n);
157
157
  }
158
158
  return r;
159
- }).join(""), R(e, 97) === 1;
160
- }, z = (t)=>{
159
+ }).join(""), S(e, 97) === 1;
160
+ }, F = (t)=>{
161
161
  const e = t.substr(0, 2), n = t.substr(2, 2);
162
- if (!y(e) || !S(n)) return !1;
163
- const r = I[e];
164
- return !(r && r !== t.length || !T(t));
162
+ if (!v(e) || !T(n)) return !1;
163
+ const r = A[e];
164
+ return !(r && r !== t.length || !z(t));
165
165
  }, Z = (t)=>{
166
166
  var n;
167
167
  const e = t.replace(/[^\dA-Za-z]/g, "");
@@ -169,9 +169,9 @@ const I = {
169
169
  return (_ref = (n = e.match(/.{1,4}/g)) == null ? void 0 : n.join(" ")) !== null && _ref !== void 0 ? _ref : e;
170
170
  }, j = (t)=>{
171
171
  const e = t.substr(0, 2);
172
- let n = M;
173
- if (e && y(e)) {
174
- const s = I[e];
172
+ let n = R;
173
+ if (e && v(e)) {
174
+ const s = A[e];
175
175
  s && (n = s);
176
176
  }
177
177
  const r = Math.ceil(n / 4) - 1;
@@ -183,8 +183,8 @@ const I = {
183
183
  "defaultValue",
184
184
  "onChange"
185
185
  ]);
186
- const [u, p] = _react.useState(n !== null && n !== void 0 ? n : ""), c = _react.useRef(null), i = typeof e < "u", d = i ? e : u, g = _react.useCallback((o)=>{
187
- i || p(o), c.current && (r == null || r((0, _dom.createChangeEvent)(c.current, o)));
186
+ const [m, u] = _react.useState(n !== null && n !== void 0 ? n : ""), c = _react.useRef(null), i = typeof e < "u", d = i ? e : m, g = _react.useCallback((o)=>{
187
+ i || u(o), c.current && (r == null || r((0, _dom.createChangeEvent)(c.current, o)));
188
188
  }, [
189
189
  i,
190
190
  r
@@ -199,19 +199,20 @@ const I = {
199
199
  maxLength: j(a.value),
200
200
  value: a.value,
201
201
  onChange: (o)=>{
202
- var h;
203
- const m = o.target.value, l = a.value;
204
- return m.length - l.length > 1 && ((h = o.nativeEvent) == null ? void 0 : h.inputType) === "insertText" && (o.target.value = l), a.onChange(o);
202
+ var f;
203
+ const h = o.target.value, l = a.value;
204
+ return h.length - l.length > 1 && ((f = o.nativeEvent) == null ? void 0 : f.inputType) === "insertText" && (o.target.value = l), a.onChange(o);
205
205
  },
206
206
  type: "text",
207
207
  ref: (0, _common.combineRefs)(t, c)
208
208
  }));
209
- }, P = (_param)=>{
210
- var { disabled: t, error: e, helperText: n, name: r, optional: s, validate: u, onChange: p, onChangeValue: c, onBlur: i, value: d, defaultValue: g, dataAttributes: a } = _param, o = _object_without_properties(_param, [
209
+ }, M = (_param)=>{
210
+ var { disabled: t, error: e, helperText: n, name: r, label: s, optional: m, validate: u, onChange: c, onChangeValue: i, onBlur: d, value: g, defaultValue: a, dataAttributes: o } = _param, h = _object_without_properties(_param, [
211
211
  "disabled",
212
212
  "error",
213
213
  "helperText",
214
214
  "name",
215
+ "label",
215
216
  "optional",
216
217
  "validate",
217
218
  "onChange",
@@ -221,24 +222,25 @@ const I = {
221
222
  "defaultValue",
222
223
  "dataAttributes"
223
224
  ]);
224
- const { texts: m, t: l } = (0, _hooks.useTheme)(), A = (0, _formcontext.useFieldProps)({
225
+ const { texts: l, t: f } = (0, _hooks.useTheme)(), I = (0, _formcontext.useFieldProps)({
225
226
  name: r,
226
- value: d,
227
- defaultValue: g,
228
- processValue: (f)=>f.replace(/[^\dA-Za-z]/g, ""),
227
+ label: s,
228
+ value: g,
229
+ defaultValue: a,
230
+ processValue: (p)=>p.replace(/[^\dA-Za-z]/g, ""),
229
231
  helperText: n,
230
- optional: s,
232
+ optional: m,
231
233
  error: e,
232
234
  disabled: t,
233
- onBlur: i,
234
- validate: (f, v)=>f ? z(f) ? u == null ? void 0 : u(f, v) : m.formIbanError || l(_texttokens.formIbanError) : s ? "" : m.formFieldErrorIsMandatory || l(_texttokens.formFieldErrorIsMandatory),
235
- onChange: p,
236
- onChangeValue: c
235
+ onBlur: d,
236
+ validate: (p, y)=>F(p !== null && p !== void 0 ? p : "") ? u == null ? void 0 : u(p, y) : l.formIbanError || f(_texttokens.formIbanError),
237
+ onChange: c,
238
+ onChangeValue: i
237
239
  });
238
- return /* @__PURE__ */ (0, _jsxruntime.jsx)(_textfieldbase.TextFieldBaseAutosuggest, _object_spread_props(_object_spread({}, o, A), {
240
+ return /* @__PURE__ */ (0, _jsxruntime.jsx)(_textfieldbase.TextFieldBaseAutosuggest, _object_spread_props(_object_spread({}, h, I), {
239
241
  inputComponent: D,
240
242
  dataAttributes: _object_spread({
241
243
  "component-name": "IbanField"
242
- }, a)
244
+ }, o)
243
245
  }));
244
- }, J = P;
246
+ }, J = M;
package/dist/index.d.ts CHANGED
@@ -56,9 +56,11 @@ export { default as HorizontalScroll } from './horizontal-scroll';
56
56
  export { default as HighlightedCard } from './highlighted-card';
57
57
  export { default as Stepper } from './stepper';
58
58
  export { ProgressBar, ProgressBarStepped } from './progress-bar';
59
+ export { Rating, InfoRating } from './rating';
59
60
  export { VerticalMosaic, HorizontalMosaic } from './mosaic';
60
61
  export { Timer, TextTimer } from './timer';
61
62
  export { MediaCard, DataCard, SnapCard, DisplayDataCard, DisplayMediaCard, PosterCard, NakedCard, SmallNakedCard, CardActionSpinner, CardActionIconButton, } from './card';
63
+ export { default as StackingGroup } from './stacking-group';
62
64
  export { default as Hero } from './hero';
63
65
  export { default as CoverHero } from './cover-hero';
64
66
  export { Table } from './table';
@@ -78,10 +80,17 @@ export { default as Video } from './video';
78
80
  export type { VideoElement } from './video';
79
81
  export { Carousel, CenteredCarousel, Slideshow, PageBullets, CarouselContextProvider, useCarouselContext, CarouselContextConsumer, } from './carousel';
80
82
  export { Grid, GridItem } from './grid';
81
- export { default as Sheet, ActionsSheet, InfoSheet, ActionsListSheet, RadioListSheet, SheetBody, } from './sheet';
82
83
  export { default as SheetRoot, showSheet } from './sheet-root';
83
- export type { NativeSheetImplementation } from './sheet-root';
84
- export { default as StackingGroup } from './stacking-group';
84
+ export type { NativeSheetImplementation } from './sheet-types';
85
+ export { default as Sheet, SheetBody } from './sheet-common';
86
+ /** @deprecated use showSheet. It is easier to use and uses the app native implementation if available */
87
+ export { default as ActionsSheet } from './sheet-actions';
88
+ /** @deprecated use showSheet. It is easier to use and uses the app native implementation if available */
89
+ export { default as InfoSheet } from './sheet-info';
90
+ /** @deprecated use showSheet. It is easier to use and uses the app native implementation if available */
91
+ export { default as ActionsListSheet } from './sheet-actions-list';
92
+ /** @deprecated use showSheet. It is easier to use and uses the app native implementation if available */
93
+ export { default as RadioListSheet } from './sheet-radio-list';
85
94
  export { default as Form } from './form';
86
95
  export { default as Select } from './select';
87
96
  export { default as TextField } from './text-field';
package/dist/index.js CHANGED
@@ -16,10 +16,10 @@ _export(exports, {
16
16
  return _accordion.AccordionItem;
17
17
  },
18
18
  ActionsListSheet: function() {
19
- return _sheet.ActionsListSheet;
19
+ return _sheetactionslist.default;
20
20
  },
21
21
  ActionsSheet: function() {
22
- return _sheet.ActionsSheet;
22
+ return _sheetactions.default;
23
23
  },
24
24
  Avatar: function() {
25
25
  return _avatar.default;
@@ -5487,8 +5487,11 @@ _export(exports, {
5487
5487
  InfoFeedbackScreen: function() {
5488
5488
  return _feedback.InfoFeedbackScreen;
5489
5489
  },
5490
+ InfoRating: function() {
5491
+ return _rating.InfoRating;
5492
+ },
5490
5493
  InfoSheet: function() {
5491
- return _sheet.InfoSheet;
5494
+ return _sheetinfo.default;
5492
5495
  },
5493
5496
  Inline: function() {
5494
5497
  return _inline.default;
@@ -5611,7 +5614,10 @@ _export(exports, {
5611
5614
  return _radiobutton.RadioGroup;
5612
5615
  },
5613
5616
  RadioListSheet: function() {
5614
- return _sheet.RadioListSheet;
5617
+ return _sheetradiolist.default;
5618
+ },
5619
+ Rating: function() {
5620
+ return _rating.Rating;
5615
5621
  },
5616
5622
  ResponsiveLayout: function() {
5617
5623
  return _responsivelayout.default;
@@ -5632,10 +5638,10 @@ _export(exports, {
5632
5638
  return _select.default;
5633
5639
  },
5634
5640
  Sheet: function() {
5635
- return _sheet.default;
5641
+ return _sheetcommon.default;
5636
5642
  },
5637
5643
  SheetBody: function() {
5638
- return _sheet.SheetBody;
5644
+ return _sheetcommon.SheetBody;
5639
5645
  },
5640
5646
  SheetRoot: function() {
5641
5647
  return _sheetroot.default;
@@ -6002,9 +6008,11 @@ const _horizontalscroll = /*#__PURE__*/ _interop_require_default(require("./hori
6002
6008
  const _highlightedcard = /*#__PURE__*/ _interop_require_default(require("./highlighted-card.js"));
6003
6009
  const _stepper = /*#__PURE__*/ _interop_require_default(require("./stepper.js"));
6004
6010
  const _progressbar = require("./progress-bar.js");
6011
+ const _rating = require("./rating.js");
6005
6012
  const _mosaic = require("./mosaic.js");
6006
6013
  const _timer = require("./timer.js");
6007
6014
  const _card = require("./card.js");
6015
+ const _stackinggroup = /*#__PURE__*/ _interop_require_default(require("./stacking-group.js"));
6008
6016
  const _hero = /*#__PURE__*/ _interop_require_default(require("./hero.js"));
6009
6017
  const _coverhero = /*#__PURE__*/ _interop_require_default(require("./cover-hero.js"));
6010
6018
  const _table = require("./table.js");
@@ -6023,9 +6031,12 @@ const _chip = /*#__PURE__*/ _interop_require_default(require("./chip.js"));
6023
6031
  const _video = /*#__PURE__*/ _interop_require_default(require("./video.js"));
6024
6032
  const _carousel = require("./carousel.js");
6025
6033
  const _grid = require("./grid.js");
6026
- const _sheet = /*#__PURE__*/ _interop_require_wildcard(require("./sheet.js"));
6027
6034
  const _sheetroot = /*#__PURE__*/ _interop_require_wildcard(require("./sheet-root.js"));
6028
- const _stackinggroup = /*#__PURE__*/ _interop_require_default(require("./stacking-group.js"));
6035
+ const _sheetcommon = /*#__PURE__*/ _interop_require_wildcard(require("./sheet-common.js"));
6036
+ const _sheetactions = /*#__PURE__*/ _interop_require_default(require("./sheet-actions.js"));
6037
+ const _sheetinfo = /*#__PURE__*/ _interop_require_default(require("./sheet-info.js"));
6038
+ const _sheetactionslist = /*#__PURE__*/ _interop_require_default(require("./sheet-actions-list.js"));
6039
+ const _sheetradiolist = /*#__PURE__*/ _interop_require_default(require("./sheet-radio-list.js"));
6029
6040
  const _form = /*#__PURE__*/ _interop_require_default(require("./form.js"));
6030
6041
  const _select = /*#__PURE__*/ _interop_require_default(require("./select.js"));
6031
6042
  const _textfield = /*#__PURE__*/ _interop_require_default(require("./text-field.js"));
package/dist/inline.d.ts CHANGED
@@ -8,10 +8,11 @@ type Props = {
8
8
  children: React.ReactNode;
9
9
  className?: string;
10
10
  role?: string;
11
+ 'aria-label'?: string;
11
12
  'aria-labelledby'?: string;
12
13
  fullWidth?: boolean;
13
14
  dataAttributes?: DataAttributes;
14
15
  wrap?: boolean;
15
16
  };
16
- declare const Inline: ({ space, className, children, role, alignItems, "aria-labelledby": ariaLabelledBy, fullWidth, wrap, dataAttributes, }: Props) => JSX.Element;
17
+ declare const Inline: ({ space, className, children, role, alignItems, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledBy, fullWidth, wrap, dataAttributes, }: Props) => JSX.Element;
17
18
  export default Inline;
package/dist/inline.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 q;
9
+ return z;
10
10
  }
11
11
  });
12
12
  const _jsxruntime = require("react/jsx-runtime");
@@ -116,7 +116,7 @@ function _object_spread_props(target, source) {
116
116
  }
117
117
  return target;
118
118
  }
119
- const i = (t)=>typeof t == "number" ? `${t}px` : `space-${t}`, D = (t)=>{
119
+ const i = (t)=>typeof t == "number" ? `${t}px` : `space-${t}`, R = (t)=>{
120
120
  if (typeof t == "number" || typeof t == "string") return {
121
121
  [_inlinecssmistica.vars.space]: i(t)
122
122
  };
@@ -125,25 +125,26 @@ const i = (t)=>typeof t == "number" ? `${t}px` : `space-${t}`, D = (t)=>{
125
125
  [_inlinecssmistica.vars.spaceDesktop]: i(t.desktop)
126
126
  };
127
127
  return t.tablet && (e[_inlinecssmistica.vars.spaceTablet] = i(t.tablet)), e;
128
- }, R = (param)=>{
129
- let { space: t, className: e, children: m, role: o, alignItems: p = "stretch", "aria-labelledby": f, fullWidth: c, wrap: l, dataAttributes: d } = param;
130
- const { platformOverrides: s } = (0, _hooks.useTheme)(), u = typeof t == "string";
128
+ }, j = (param)=>{
129
+ let { space: t, className: e, children: p, role: l, alignItems: f = "stretch", "aria-label": o, "aria-labelledby": c, fullWidth: d, wrap: s, dataAttributes: u } = param;
130
+ const { platformOverrides: a } = (0, _hooks.useTheme)(), b = typeof t == "string";
131
131
  return /* @__PURE__ */ (0, _jsxruntime.jsx)("div", _object_spread_props(_object_spread({
132
132
  className: (0, _classnames.default)(e, _inlinecssmistica.inline, (0, _sprinklescssmistica.sprinkles)({
133
- alignItems: p
134
- }), l ? _inlinecssmistica.wrap : c ? _inlinecssmistica.fullWidth : _inlinecssmistica.noFullWidth, u ? l ? _inlinecssmistica.stringSpaceWithWrap : _inlinecssmistica.stringSpace : _inlinecssmistica.marginInline),
135
- style: (0, _css.applyCssVars)(D(t)),
136
- role: o,
137
- "aria-labelledby": f
138
- }, (0, _dom.getPrefixedDataAttributes)(d, "Inline")), {
139
- children: _react.Children.map(m, (n)=>n || n === 0 ? /* @__PURE__ */ (0, _jsxruntime.jsx)("div", {
140
- role: o === "list" ? "listitem" : void 0,
133
+ alignItems: f
134
+ }), s ? _inlinecssmistica.wrap : d ? _inlinecssmistica.fullWidth : _inlinecssmistica.noFullWidth, b ? s ? _inlinecssmistica.stringSpaceWithWrap : _inlinecssmistica.stringSpace : _inlinecssmistica.marginInline),
135
+ style: (0, _css.applyCssVars)(R(t)),
136
+ role: l,
137
+ "aria-label": o,
138
+ "aria-labelledby": o ? void 0 : c
139
+ }, (0, _dom.getPrefixedDataAttributes)(u, "Inline")), {
140
+ children: _react.Children.map(p, (n)=>n || n === 0 ? /* @__PURE__ */ (0, _jsxruntime.jsx)("div", {
141
+ role: l === "list" ? "listitem" : void 0,
141
142
  style: {
142
143
  // Hack to fix https://jira.tid.es/browse/WEB-1683
143
144
  // In iOS the inline component sometimes cuts the last line of the content
144
- paddingBottom: (0, _platform.isIos)(s) && !(0, _platform.isRunningAcceptanceTest)(s) ? 1 : void 0
145
+ paddingBottom: (0, _platform.isIos)(a) && !(0, _platform.isRunningAcceptanceTest)(a) ? 1 : void 0
145
146
  },
146
147
  children: n
147
148
  }) : null)
148
149
  }));
149
- }, q = R;
150
+ }, z = j;
@@ -8,5 +8,5 @@ export declare const IntegerInput: ({ inputRef, value, defaultValue, type, ...re
8
8
  export interface IntegerFieldProps extends CommonFormFieldProps {
9
9
  onChangeValue?: (value: string, rawValue: string) => void;
10
10
  }
11
- declare const IntegerField: ({ disabled, error, helperText, name, optional, validate: validateProp, onChange, onChangeValue, onBlur, value, defaultValue, dataAttributes, ...rest }: IntegerFieldProps) => JSX.Element;
11
+ declare const IntegerField: ({ disabled, error, helperText, name, label, optional, validate, onChange, onChangeValue, onBlur, value, defaultValue, dataAttributes, ...rest }: IntegerFieldProps) => JSX.Element;
12
12
  export default IntegerField;