@telefonica/mistica 14.41.0 → 14.42.1

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 (142) hide show
  1. package/css/mistica.css +1 -1
  2. package/dist/boxed.css-mistica.js +14 -5
  3. package/dist/boxed.css.d.ts +1 -0
  4. package/dist/boxed.d.ts +1 -0
  5. package/dist/boxed.js +11 -9
  6. package/dist/button-fixed-footer-layout.d.ts +1 -0
  7. package/dist/button-fixed-footer-layout.js +19 -14
  8. package/dist/button-layout.css-mistica.js +16 -13
  9. package/dist/button-layout.css.d.ts +1 -0
  10. package/dist/button-layout.js +15 -15
  11. package/dist/button.js +43 -35
  12. package/dist/carousel.d.ts +13 -0
  13. package/dist/carousel.js +325 -223
  14. package/dist/credit-card-expiration-field.js +30 -26
  15. package/dist/credit-card-number-field.css-mistica.js +7 -7
  16. package/dist/credit-card-number-field.js +59 -45
  17. package/dist/cvv-field.js +46 -41
  18. package/dist/date-field.css-mistica.js +14 -0
  19. package/dist/date-field.css.d.ts +1 -0
  20. package/dist/date-field.css.ts.vanilla.css-mistica.js +11 -0
  21. package/dist/date-field.js +41 -35
  22. package/dist/date-time-field.js +40 -34
  23. package/dist/date-time-picker.js +43 -45
  24. package/dist/decimal-field.js +26 -22
  25. package/dist/dialog-context.d.ts +24 -0
  26. package/dist/dialog-context.js +192 -0
  27. package/dist/dialog.css-mistica.js +15 -12
  28. package/dist/dialog.css.d.ts +1 -0
  29. package/dist/dialog.d.ts +14 -44
  30. package/dist/dialog.js +163 -246
  31. package/dist/double-field.css-mistica.js +3 -2
  32. package/dist/email-field.js +15 -11
  33. package/dist/feedback.css-mistica.js +23 -14
  34. package/dist/feedback.css.d.ts +7 -4
  35. package/dist/feedback.js +157 -143
  36. package/dist/fixed-footer-layout.css-mistica.js +1 -1
  37. package/dist/fixed-footer-layout.js +9 -8
  38. package/dist/iban-field.js +31 -27
  39. package/dist/icons/icon-amex.d.ts +1 -1
  40. package/dist/icons/icon-cvv-amex.d.ts +1 -1
  41. package/dist/icons/icon-cvv-visa-mc.d.ts +1 -1
  42. package/dist/icons/icon-mastercard.d.ts +1 -1
  43. package/dist/icons/icon-visa.d.ts +1 -1
  44. package/dist/index.d.ts +2 -2
  45. package/dist/index.js +16 -4
  46. package/dist/inline.css-mistica.js +9 -6
  47. package/dist/inline.css.d.ts +1 -1
  48. package/dist/inline.js +9 -9
  49. package/dist/integer-field.js +17 -13
  50. package/dist/loading-bar.css-mistica.js +4 -7
  51. package/dist/loading-bar.css.d.ts +0 -2
  52. package/dist/loading-bar.js +3 -6
  53. package/dist/month-field.js +39 -33
  54. package/dist/package-version.js +1 -1
  55. package/dist/password-field.js +46 -44
  56. package/dist/phone-number-field.js +50 -46
  57. package/dist/pin-field.css-mistica.js +12 -6
  58. package/dist/pin-field.css.d.ts +2 -0
  59. package/dist/pin-field.d.ts +3 -1
  60. package/dist/pin-field.js +129 -95
  61. package/dist/responsive-layout.css-mistica.js +10 -7
  62. package/dist/responsive-layout.css.d.ts +2 -1
  63. package/dist/responsive-layout.d.ts +1 -1
  64. package/dist/responsive-layout.js +20 -17
  65. package/dist/search-field.js +36 -35
  66. package/dist/select.css-mistica.js +16 -15
  67. package/dist/select.css.d.ts +1 -0
  68. package/dist/select.js +138 -143
  69. package/dist/text-field-base.css-mistica.js +45 -21
  70. package/dist/text-field-base.css.d.ts +30 -7
  71. package/dist/text-field-base.d.ts +11 -0
  72. package/dist/text-field-base.js +175 -140
  73. package/dist/text-field-components.css-mistica.js +13 -21
  74. package/dist/text-field-components.css.d.ts +0 -3
  75. package/dist/text-field-components.d.ts +3 -0
  76. package/dist/text-field-components.js +38 -35
  77. package/dist/text-field.js +26 -22
  78. package/dist/text.css-mistica.js +7 -7
  79. package/dist/text.css.d.ts +0 -1
  80. package/dist/text.js +24 -24
  81. package/dist/theme-context-provider.js +2 -2
  82. package/dist/utils/platform.js +8 -11
  83. package/dist-es/boxed.css-mistica.js +3 -2
  84. package/dist-es/boxed.js +17 -15
  85. package/dist-es/button-fixed-footer-layout.js +29 -24
  86. package/dist-es/button-layout.css-mistica.js +7 -7
  87. package/dist-es/button-layout.js +23 -23
  88. package/dist-es/button.js +65 -57
  89. package/dist-es/carousel.js +373 -280
  90. package/dist-es/credit-card-expiration-field.js +34 -30
  91. package/dist-es/credit-card-number-field.css-mistica.js +4 -4
  92. package/dist-es/credit-card-number-field.js +84 -70
  93. package/dist-es/cvv-field.js +68 -63
  94. package/dist-es/date-field.css-mistica.js +5 -0
  95. package/dist-es/date-field.css.ts.vanilla.css-mistica.js +2 -0
  96. package/dist-es/date-field.js +46 -40
  97. package/dist-es/date-time-field.js +47 -41
  98. package/dist-es/date-time-picker.js +55 -57
  99. package/dist-es/decimal-field.js +31 -27
  100. package/dist-es/dialog-context.js +125 -0
  101. package/dist-es/dialog.css-mistica.js +3 -3
  102. package/dist-es/dialog.js +193 -262
  103. package/dist-es/double-field.css-mistica.js +3 -2
  104. package/dist-es/email-field.js +16 -12
  105. package/dist-es/feedback.css-mistica.js +2 -2
  106. package/dist-es/feedback.js +196 -182
  107. package/dist-es/fixed-footer-layout.css-mistica.js +1 -1
  108. package/dist-es/fixed-footer-layout.js +21 -20
  109. package/dist-es/iban-field.js +42 -38
  110. package/dist-es/index.js +1778 -1778
  111. package/dist-es/inline.css-mistica.js +3 -3
  112. package/dist-es/inline.js +18 -18
  113. package/dist-es/integer-field.js +21 -17
  114. package/dist-es/loading-bar.css-mistica.js +2 -2
  115. package/dist-es/loading-bar.js +10 -13
  116. package/dist-es/month-field.js +47 -41
  117. package/dist-es/package-version.js +1 -1
  118. package/dist-es/password-field.js +54 -52
  119. package/dist-es/phone-number-field.js +53 -49
  120. package/dist-es/pin-field.css-mistica.js +2 -2
  121. package/dist-es/pin-field.js +145 -111
  122. package/dist-es/responsive-layout.css-mistica.js +3 -3
  123. package/dist-es/responsive-layout.js +27 -24
  124. package/dist-es/search-field.js +45 -44
  125. package/dist-es/select.css-mistica.js +8 -7
  126. package/dist-es/select.js +167 -172
  127. package/dist-es/style.css +1 -1
  128. package/dist-es/text-field-base.css-mistica.js +2 -2
  129. package/dist-es/text-field-base.js +189 -157
  130. package/dist-es/text-field-components.css-mistica.js +3 -2
  131. package/dist-es/text-field-components.js +52 -49
  132. package/dist-es/text-field.js +31 -27
  133. package/dist-es/text.css-mistica.js +3 -3
  134. package/dist-es/text.js +32 -32
  135. package/dist-es/theme-context-provider.js +1 -1
  136. package/dist-es/utils/platform.js +6 -6
  137. package/package.json +1 -1
  138. package/dist/password-field.css-mistica.js +0 -13
  139. package/dist/password-field.css.d.ts +0 -1
  140. package/dist-es/password-field.css-mistica.js +0 -4
  141. /package/dist/{password-field.css.ts.vanilla.css-mistica.js → boxed.css.ts.vanilla.css-mistica.js} +0 -0
  142. /package/dist-es/{password-field.css.ts.vanilla.css-mistica.js → boxed.css.ts.vanilla.css-mistica.js} +0 -0
@@ -138,8 +138,8 @@ function _object_without_properties_loose(source, excluded) {
138
138
  }
139
139
  return target;
140
140
  }
141
- const P = (r, s)=>(0, _libphonenumber.formatAsYouType)(s.replace(/[^\d+*#]/g, ""), r), $ = (r)=>!!r.match(/^\+\d+$/), j = (_param)=>{
142
- var { inputRef: r, value: s, defaultValue: m, onChange: i, prefix: t, e164: b } = _param, p = _object_without_properties(_param, [
141
+ const b = (r, n)=>(0, _libphonenumber.formatAsYouType)(n.replace(/[^\d+*#]/g, ""), r), $ = (r)=>!!r.match(/^\+\d+$/), j = (_param)=>{
142
+ var { inputRef: r, value: n, defaultValue: f, onChange: s, prefix: o, e164: y } = _param, d = _object_without_properties(_param, [
143
143
  "inputRef",
144
144
  "value",
145
145
  "defaultValue",
@@ -147,38 +147,38 @@ const P = (r, s)=>(0, _libphonenumber.formatAsYouType)(s.replace(/[^\d+*#]/g, ""
147
147
  "prefix",
148
148
  "e164"
149
149
  ]);
150
- const [f, d] = _react.useState(m !== null && m !== void 0 ? m : ""), l = _react.useRef(null), { i18n: g } = (0, _hooks.useTheme)(), c = g.phoneNumberFormattingRegionCode, n = typeof s < "u", h = n ? s : f, y = _react.useCallback((o)=>{
151
- n || d(o), l.current && (i == null || i((0, _dom.createChangeEvent)(l.current, o)));
150
+ const [g, h] = _react.useState(f !== null && f !== void 0 ? f : ""), l = _react.useRef(null), { i18n: C } = (0, _hooks.useTheme)(), i = C.phoneNumberFormattingRegionCode, u = typeof n < "u", a = u ? n : g, P = _react.useCallback((e)=>{
151
+ u || h(e), l.current && (s == null || s((0, _dom.createChangeEvent)(l.current, e)));
152
152
  }, [
153
- n,
154
- i
155
- ]), C = _react.useCallback(// otherwise the cursor position is incorrectly positioned
153
+ u,
154
+ s
155
+ ]), F = _react.useCallback(// otherwise the cursor position is incorrectly positioned
156
156
  // also note the "@" is replaced back to "-" in `replace` param in `useRifm`
157
- (o)=>{
158
- let e = "";
159
- if (t && $(t)) {
160
- const F = t + o;
161
- e = P(c, F), e.startsWith(t) ? e = e.slice(t.length).trim() : e = P(c, o);
162
- } else e = P(c, o);
163
- return e.replace(/-/g, "@");
157
+ (e)=>{
158
+ let t = "";
159
+ if (o && $(o)) {
160
+ const c = o + e;
161
+ t = b(i, c), t.startsWith(o) ? t = t.slice(o.length).trim() : t = b(i, e);
162
+ } else t = b(i, e);
163
+ return t.replace(/-/g, "@");
164
164
  }, [
165
- c,
166
- t
167
- ]), u = (0, _rifm.useRifm)({
168
- format: C,
169
- value: h,
170
- onChange: y,
165
+ i,
166
+ o
167
+ ]), m = (0, _rifm.useRifm)({
168
+ format: F,
169
+ value: a,
170
+ onChange: P,
171
171
  accept: /[\d\-+#*]+/g,
172
- replace: (o)=>o.replace(/@/g, "-")
172
+ replace: (e)=>e.replace(/@/g, "-")
173
173
  });
174
- return /* @__PURE__ */ (0, _jsxruntime.jsx)("input", _object_spread_props(_object_spread({}, p), {
175
- value: u.value,
176
- onChange: u.onChange,
174
+ return /* @__PURE__ */ (0, _jsxruntime.jsx)("input", _object_spread_props(_object_spread({}, d), {
175
+ value: m.value,
176
+ onChange: m.onChange,
177
177
  type: "tel",
178
178
  ref: (0, _common.combineRefs)(r, l)
179
179
  }));
180
180
  }, I = (_param)=>{
181
- var { disabled: r, error: s, helperText: m, name: i, optional: t, validate: b, onChange: p, onChangeValue: f, onBlur: d, value: l, defaultValue: g, e164: c } = _param, n = _object_without_properties(_param, [
181
+ var { disabled: r, error: n, helperText: f, name: s, optional: o, validate: y, onChange: d, onChangeValue: g, onBlur: h, value: l, defaultValue: C, e164: i, dataAttributes: u } = _param, a = _object_without_properties(_param, [
182
182
  "disabled",
183
183
  "error",
184
184
  "helperText",
@@ -190,37 +190,41 @@ const P = (r, s)=>(0, _libphonenumber.formatAsYouType)(s.replace(/[^\d+*#]/g, ""
190
190
  "onBlur",
191
191
  "value",
192
192
  "defaultValue",
193
- "e164"
193
+ "e164",
194
+ "dataAttributes"
194
195
  ]);
195
- const { i18n: h } = (0, _hooks.useTheme)(), C = (0, _formcontext.useFieldProps)({
196
- name: i,
196
+ const { i18n: P } = (0, _hooks.useTheme)(), m = (0, _formcontext.useFieldProps)({
197
+ name: s,
197
198
  value: l,
198
- defaultValue: g,
199
- processValue: (u)=>{
200
- if (c) try {
201
- var _n_prefix;
202
- const o = ((_n_prefix = n.prefix) !== null && _n_prefix !== void 0 ? _n_prefix : "").replace(/[^\d]/g, "");
203
- let e = (0, _libphonenumber.getRegionCodeForCountryCode)(o);
204
- return (!e || e === "ZZ") && (e = h.phoneNumberFormattingRegionCode), (0, _libphonenumber.formatToE164)((0, _libphonenumber.parse)(u, e));
199
+ defaultValue: C,
200
+ processValue: (e)=>{
201
+ if (i) try {
202
+ var _a_prefix;
203
+ const t = ((_a_prefix = a.prefix) !== null && _a_prefix !== void 0 ? _a_prefix : "").replace(/[^\d]/g, "");
204
+ let c = (0, _libphonenumber.getRegionCodeForCountryCode)(t);
205
+ return (!c || c === "ZZ") && (c = P.phoneNumberFormattingRegionCode), (0, _libphonenumber.formatToE164)((0, _libphonenumber.parse)(e, c));
205
206
  } catch (e) {
206
207
  return "";
207
208
  }
208
- else return u.replace(/[^\d]/g, "");
209
+ else return e.replace(/[^\d]/g, "");
209
210
  },
210
- helperText: m,
211
- optional: t,
212
- error: s,
211
+ helperText: f,
212
+ optional: o,
213
+ error: n,
213
214
  disabled: r,
214
- onBlur: d,
215
- validate: b,
216
- onChange: p,
217
- onChangeValue: f
215
+ onBlur: h,
216
+ validate: y,
217
+ onChange: d,
218
+ onChangeValue: g
218
219
  });
219
- return /* @__PURE__ */ (0, _jsxruntime.jsx)(_textfieldbase.TextFieldBaseAutosuggest, _object_spread_props(_object_spread({}, n, C), {
220
+ return /* @__PURE__ */ (0, _jsxruntime.jsx)(_textfieldbase.TextFieldBaseAutosuggest, _object_spread_props(_object_spread({}, a, m), {
220
221
  type: "phone",
221
222
  inputProps: {
222
- prefix: n.prefix
223
+ prefix: a.prefix
223
224
  },
224
- inputComponent: j
225
+ inputComponent: j,
226
+ dataAttributes: _object_spread({
227
+ "component-name": "PhoneNumberField"
228
+ }, u)
225
229
  }));
226
230
  }, J = I;
@@ -10,28 +10,34 @@ function _export(target, all) {
10
10
  }
11
11
  _export(exports, {
12
12
  disabled: function() {
13
- return f;
13
+ return r;
14
14
  },
15
15
  field: function() {
16
+ return f;
17
+ },
18
+ fieldContainer: function() {
16
19
  return y;
17
20
  },
18
21
  focusedField: function() {
19
- return r;
22
+ return i;
20
23
  },
21
24
  input: function() {
22
- return i;
25
+ return p;
23
26
  },
24
27
  passwordDot: function() {
25
28
  return o;
26
29
  },
27
30
  passwordInput: function() {
28
- return p;
31
+ return a;
32
+ },
33
+ pinInputLineHeight: function() {
34
+ return c;
29
35
  },
30
36
  readOnlyField: function() {
31
- return a;
37
+ return e;
32
38
  }
33
39
  });
34
40
  require("./sprinkles.css.ts.vanilla.css-mistica.js");
35
41
  require("./text-field-base.css.ts.vanilla.css-mistica.js");
36
42
  require("./pin-field.css.ts.vanilla.css-mistica.js");
37
- var f = "_3pc6ro0", y = "_1y2v1nfjj _1y2v1nfiz _1y2v1nfgi _1y2v1nfj8 _1y2v1nfgc _1y2v1nfhh _1y2v1nfhx _1y2v1nf37", r = "_3pc6ro2 _1y2v1nfjj _1y2v1nfiz _1y2v1nfgi _1y2v1nfj8 _1y2v1nfgc _1y2v1nfhh _1y2v1nfhx _1y2v1nf37", i = "_3pc6ro4", o = "_3pc6ro7", p = "_1y2v1nf33", a = "_1y2v1nfjj _1y2v1nfiz _1y2v1nfgi _1y2v1nfj8 _1y2v1nfgc _1y2v1nfhh _1y2v1nfhx _1y2v1nf4y";
43
+ var r = "_3pc6ro1", f = "_3pc6ro3 _1y2v1nfjj _1y2v1nfiz _1y2v1nfgi _1y2v1nfj8 _1y2v1nfgc _1y2v1nf37", y = "_3pc6ro0", i = "_3pc6ro4 _3pc6ro3 _1y2v1nfjj _1y2v1nfiz _1y2v1nfgi _1y2v1nfj8 _1y2v1nfgc _1y2v1nf37", p = "_3pc6ro6", o = "_3pc6ro9", a = "_1y2v1nf33", c = "1.000rem", e = "_3pc6ro5 _3pc6ro3 _1y2v1nfjj _1y2v1nfiz _1y2v1nfgi _1y2v1nfj8 _1y2v1nfgc _1y2v1nf37";
@@ -1,3 +1,5 @@
1
+ export declare const pinInputLineHeight: string;
2
+ export declare const fieldContainer: string;
1
3
  export declare const disabled: string;
2
4
  export declare const field: string;
3
5
  export declare const focusedField: string;
@@ -1,4 +1,5 @@
1
1
  import * as React from 'react';
2
+ import type { DataAttributes } from './utils/types';
2
3
  type OtpFieldProps = {
3
4
  length?: number;
4
5
  /**
@@ -20,6 +21,7 @@ type OtpFieldProps = {
20
21
  onChange?: (event: React.ChangeEvent<HTMLInputElement>) => void;
21
22
  'aria-label'?: string;
22
23
  'aria-labelledby'?: string;
24
+ dataAttributes?: DataAttributes;
23
25
  };
24
- declare const PinField: ({ length, hideCode, readSms, disabled, readOnly, name, value, defaultValue, helperText, error, onChangeValue, onChange, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledBy, }: OtpFieldProps) => React.ReactElement;
26
+ declare const PinField: ({ length, hideCode, readSms, disabled, readOnly, name, value, defaultValue, helperText, error, onChangeValue, onChange, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledBy, dataAttributes, }: OtpFieldProps) => React.ReactElement;
25
27
  export default PinField;
package/dist/pin-field.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 pe;
9
+ return de;
10
10
  }
11
11
  });
12
12
  const _jsxruntime = require("react/jsx-runtime");
@@ -96,32 +96,56 @@ function _object_spread(target) {
96
96
  }
97
97
  return target;
98
98
  }
99
- let P = !1;
100
- const Y = (param)=>{
101
- let { length: a = 6, hideCode: c = !1, readSms: d, disabled: h, readOnly: y, value: w, defaultValue: b, onChange: n, inputRef: R } = param;
99
+ function ownKeys(object, enumerableOnly) {
100
+ var keys = Object.keys(object);
101
+ if (Object.getOwnPropertySymbols) {
102
+ var symbols = Object.getOwnPropertySymbols(object);
103
+ if (enumerableOnly) {
104
+ symbols = symbols.filter(function(sym) {
105
+ return Object.getOwnPropertyDescriptor(object, sym).enumerable;
106
+ });
107
+ }
108
+ keys.push.apply(keys, symbols);
109
+ }
110
+ return keys;
111
+ }
112
+ function _object_spread_props(target, source) {
113
+ source = source != null ? source : {};
114
+ if (Object.getOwnPropertyDescriptors) {
115
+ Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
116
+ } else {
117
+ ownKeys(Object(source)).forEach(function(key) {
118
+ Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
119
+ });
120
+ }
121
+ return target;
122
+ }
123
+ let T = !1;
124
+ const x = (param)=>{
125
+ let { length: l = 6, hideCode: f = !1, readSms: d, disabled: g, readOnly: y, value: F, defaultValue: b, onChange: u, inputRef: A } = param;
102
126
  var _ref;
103
- 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({
104
- length: a
105
- }, ()=>null)).current, f = typeof w < "u", r = f ? w : k, u = _react.useCallback((s)=>{
106
- if (s === r) return;
107
- f || A(s);
108
- const e = l[0];
109
- e && (n == null || n((0, _dom.createChangeEvent)(_object_spread({}, e), s)));
127
+ const { texts: C } = (0, _hooks.useTheme)(), [R, S] = _react.useState((_ref = b == null ? void 0 : b.slice(0, l)) !== null && _ref !== void 0 ? _ref : ""), [w, I] = _react.useState(void 0), a = _react.useRef(Array.from({
128
+ length: l
129
+ }, ()=>null)).current, i = typeof F < "u", t = i ? F : R, c = _react.useCallback((s)=>{
130
+ if (s === t) return;
131
+ i || S(s);
132
+ const e = a[0];
133
+ e && (u == null || u((0, _dom.createChangeEvent)(_object_spread({}, e), s)));
110
134
  }, [
111
- r,
112
- l,
113
- f,
114
- n
135
+ t,
136
+ a,
137
+ i,
138
+ u
115
139
  ]);
116
140
  _react.useEffect(()=>{
117
- u(r.slice(0, a));
141
+ c(t.slice(0, l));
118
142
  }, [
119
- a,
120
- r,
121
- u
143
+ l,
144
+ t,
145
+ c
122
146
  ]), _react.useEffect(()=>{
123
- if (d && "OTPCredential" in window && !P) {
124
- P = !0;
147
+ if (d && "OTPCredential" in window && !T) {
148
+ T = !0;
125
149
  const s = new AbortController();
126
150
  return navigator.credentials.get({
127
151
  // @ts-expect-error: otp is not in the types yet
@@ -133,94 +157,101 @@ const Y = (param)=>{
133
157
  signal: s.signal
134
158
  }).then((e)=>{
135
159
  if (e) {
136
- const t = e.code.slice(0, a);
137
- u(t);
160
+ const r = e.code.slice(0, l);
161
+ c(r);
138
162
  }
139
163
  }).catch(()=>{}).finally(()=>{
140
- P = !1;
164
+ T = !1;
141
165
  }), ()=>{
142
- P = !1, s.abort();
166
+ T = !1, s.abort();
143
167
  };
144
168
  }
145
169
  }, [
146
- u,
147
- a,
170
+ c,
171
+ l,
148
172
  d
149
173
  ]);
150
- const N = (s)=>(e)=>{
151
- var C;
152
- const t = e.target.value;
153
- if (t === "") return;
154
- const o = r[s];
155
- let p = t;
156
- !o || o === t ? p = t : o === t[0] ? p = t.slice(1) : o === t[t.length - 1] && (p = t.slice(0, -1));
157
- let I = s, g = r;
174
+ const H = (s)=>(e)=>{
175
+ var k;
176
+ const r = e.target.value;
177
+ if (r === "") return;
178
+ const o = t[s];
179
+ let p = r;
180
+ !o || o === r ? p = r : o === r[0] ? p = r.slice(1) : o === r[r.length - 1] && (p = r.slice(0, -1));
181
+ let v = s, P = t;
158
182
  if (p.length >= 2) {
159
- const S = p.slice(0, a - s);
160
- g = r.slice(0, s) + S, I = Math.min(s + S.length, a - 1);
161
- } else g = r.slice(0, s) + p + r.slice(s + 1), I = s + 1;
162
- g !== r && ((0, _reactdom.flushSync)(()=>{
163
- u(g);
164
- }), I !== s && I <= a - 1 && ((C = l[I]) == null || C.focus()));
183
+ const V = p.slice(0, l - s);
184
+ P = t.slice(0, s) + V, v = Math.min(s + V.length, l - 1);
185
+ } else P = t.slice(0, s) + p + t.slice(s + 1), v = s + 1;
186
+ P !== t && ((0, _reactdom.flushSync)(()=>{
187
+ c(P);
188
+ }), v !== s && v <= l - 1 && ((k = a[v]) == null || k.focus()));
165
189
  };
166
190
  return /* @__PURE__ */ (0, _jsxruntime.jsx)(_inline.default, {
167
191
  space: 8,
168
192
  children: Array.from({
169
- length: a
193
+ length: l
170
194
  }).map((s, e)=>/* @__PURE__ */ {
171
- var _r_e;
195
+ var _t_e;
172
196
  return (0, _jsxruntime.jsxs)("div", {
173
- className: y ? _pinfieldcssmistica.readOnlyField : e === F ? _pinfieldcssmistica.focusedField : _pinfieldcssmistica.field,
197
+ className: y ? _pinfieldcssmistica.readOnlyField : e === w ? _pinfieldcssmistica.focusedField : _pinfieldcssmistica.field,
174
198
  children: [
175
199
  /* @__PURE__ */ (0, _jsxruntime.jsx)(_integerfield.IntegerInput, {
176
- "aria-label": T.pinFieldInputLabel.replace("1$s", String(e + 1)).replace("2$s", String(a)),
177
- type: c ? "password" : "text",
178
- tabIndex: e > r.length ? -1 : void 0,
200
+ "aria-label": C.pinFieldInputLabel.replace("1$s", String(e + 1)).replace("2$s", String(l)),
201
+ type: f ? "password" : "text",
202
+ tabIndex: e > t.length ? -1 : void 0,
179
203
  required: !0,
180
204
  onFocus: ()=>{
181
205
  var o;
182
- const t = r.length === a ? -1 : r.length;
183
- t >= 0 && t < e ? (o = l[t]) == null || o.focus() : v(e);
206
+ const r = t.length === l ? -1 : t.length;
207
+ r >= 0 && r < e ? (o = a[r]) == null || o.focus() : I(e);
184
208
  },
185
209
  onBlur: ()=>{
186
- v(void 0);
210
+ I(void 0);
187
211
  },
188
- inputRef: (t)=>{
189
- l[e] = t, e === 0 && R(t);
212
+ inputRef: (r)=>{
213
+ a[e] = r, e === 0 && A(r);
190
214
  },
191
- className: (0, _classnames.default)(_textfieldbasecssmistica.input, _textfieldbasecssmistica.inputWithoutLabel, _pinfieldcssmistica.input, {
192
- [_pinfieldcssmistica.passwordInput]: c
215
+ className: (0, _classnames.default)(_textfieldbasecssmistica.input, _pinfieldcssmistica.input, {
216
+ [_pinfieldcssmistica.passwordInput]: f
193
217
  }),
194
- disabled: h,
218
+ style: {
219
+ marginTop: `calc(${_pinfieldcssmistica.pinInputLineHeight} - 1px)`,
220
+ marginBottom: `calc(${_pinfieldcssmistica.pinInputLineHeight} - 1px)`,
221
+ lineHeight: _pinfieldcssmistica.pinInputLineHeight,
222
+ fontSize: _pinfieldcssmistica.pinInputLineHeight,
223
+ height: _pinfieldcssmistica.pinInputLineHeight
224
+ },
225
+ disabled: g,
195
226
  readOnly: y,
196
227
  autoComplete: d ? "one-time-code" : void 0,
197
- value: (_r_e = r[e]) !== null && _r_e !== void 0 ? _r_e : "",
198
- onChange: N(e),
199
- onKeyDown: (t)=>{
200
- switch(t.key){
228
+ value: (_t_e = t[e]) !== null && _t_e !== void 0 ? _t_e : "",
229
+ onChange: H(e),
230
+ onKeyDown: (r)=>{
231
+ switch(r.key){
201
232
  case "Backspace":
202
233
  case "Delete":
203
- if (t.currentTarget.value && u(r.slice(0, e) + r.slice(e + 1)), e > 0 && e >= r.length - 1) {
204
- const o = l[e - 1];
234
+ if (r.currentTarget.value && c(t.slice(0, e) + t.slice(e + 1)), e > 0 && e >= t.length - 1) {
235
+ const o = a[e - 1];
205
236
  o == null || o.focus();
206
237
  }
207
238
  break;
208
239
  case "ArrowLeft":
209
240
  if (e > 0) {
210
- const o = l[e - 1];
241
+ const o = a[e - 1];
211
242
  o && o.focus();
212
243
  }
213
244
  break;
214
245
  case "ArrowRight":
215
- if (e < a - 1) {
216
- const o = l[e + 1];
246
+ if (e < l - 1) {
247
+ const o = a[e + 1];
217
248
  o && o.focus();
218
249
  }
219
250
  break;
220
251
  }
221
252
  }
222
253
  }),
223
- c && r[e] && /* @__PURE__ */ (0, _jsxruntime.jsx)("div", {
254
+ f && t[e] && /* @__PURE__ */ (0, _jsxruntime.jsx)("div", {
224
255
  "aria-hidden": !0,
225
256
  className: _pinfieldcssmistica.passwordDot,
226
257
  children: "•"
@@ -229,46 +260,49 @@ const Y = (param)=>{
229
260
  }, e);
230
261
  })
231
262
  });
232
- }, Z = (param)=>{
233
- 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;
234
- const l = (0, _formcontext.useFieldProps)({
235
- name: w,
263
+ }, ee = (param)=>{
264
+ let { length: l = 6, hideCode: f = !1, readSms: d = !f, disabled: g, readOnly: y, name: F, value: b, defaultValue: u, helperText: A, error: C, onChangeValue: R, onChange: S, "aria-label": w, "aria-labelledby": I, dataAttributes: a } = param;
265
+ const i = (0, _formcontext.useFieldProps)({
266
+ name: F,
236
267
  value: b,
237
- defaultValue: n,
238
- processValue: (r)=>r,
239
- helperText: R,
268
+ defaultValue: u,
269
+ processValue: (c)=>c,
270
+ helperText: A,
240
271
  optional: !1,
241
- error: T,
242
- disabled: h,
243
- onChangeValue: k,
244
- onChange: A
245
- }), f = (0, _hooks.useAriaId)();
246
- return /* @__PURE__ */ (0, _jsxruntime.jsxs)("div", {
272
+ error: C,
273
+ disabled: g,
274
+ onChangeValue: R,
275
+ onChange: S
276
+ }), t = (0, _hooks.useAriaId)();
277
+ return /* @__PURE__ */ (0, _jsxruntime.jsxs)("div", _object_spread_props(_object_spread({
247
278
  role: "group",
248
- "aria-labelledby": v !== null && v !== void 0 ? v : f,
249
- className: h ? _pinfieldcssmistica.disabled : void 0,
279
+ "aria-labelledby": I !== null && I !== void 0 ? I : t,
280
+ className: (0, _classnames.default)(_pinfieldcssmistica.fieldContainer, {
281
+ [_pinfieldcssmistica.disabled]: g
282
+ })
283
+ }, (0, _dom.getPrefixedDataAttributes)(a, "PinField")), {
250
284
  children: [
251
- F && !v && /* @__PURE__ */ (0, _jsxruntime.jsx)(_screenreaderonly.default, {
285
+ w && !I && /* @__PURE__ */ (0, _jsxruntime.jsx)(_screenreaderonly.default, {
252
286
  children: /* @__PURE__ */ (0, _jsxruntime.jsx)("div", {
253
- id: f,
254
- children: F
287
+ id: t,
288
+ children: w
255
289
  })
256
290
  }),
257
- /* @__PURE__ */ (0, _jsxruntime.jsx)(Y, {
258
- inputRef: l.inputRef,
259
- length: a,
260
- hideCode: c,
291
+ /* @__PURE__ */ (0, _jsxruntime.jsx)(x, {
292
+ inputRef: i.inputRef,
293
+ length: l,
294
+ hideCode: f,
261
295
  readSms: d,
262
- value: l.value,
263
- defaultValue: l.defaultValue,
264
- disabled: l.disabled,
265
- onChange: l.onChange,
296
+ value: i.value,
297
+ defaultValue: i.defaultValue,
298
+ disabled: i.disabled,
299
+ onChange: i.onChange,
266
300
  readOnly: y
267
301
  }),
268
302
  /* @__PURE__ */ (0, _jsxruntime.jsx)(_textfieldcomponents.HelperText, {
269
- error: l.error,
270
- leftText: l.helperText
303
+ error: i.error,
304
+ leftText: i.helperText
271
305
  })
272
306
  ]
273
- });
274
- }, pe = Z;
307
+ }));
308
+ }, de = ee;
@@ -10,27 +10,30 @@ function _export(target, all) {
10
10
  }
11
11
  _export(exports, {
12
12
  backgroundVariant: function() {
13
- return o;
13
+ return e;
14
+ },
15
+ expandedResponsiveLayoutContainerDesktop: function() {
16
+ return n;
14
17
  },
15
- expandedResponsiveLayoutContainer: function() {
18
+ expandedResponsiveLayoutContainerMobile: function() {
16
19
  return r;
17
20
  },
18
21
  fullWidth: function() {
19
- return e;
22
+ return t;
20
23
  },
21
24
  fullwidthContainer: function() {
22
25
  return v;
23
26
  },
24
27
  responsiveLayout: function() {
25
- return t;
28
+ return i;
26
29
  },
27
30
  responsiveLayoutContainer: function() {
28
- return i;
31
+ return f;
29
32
  }
30
33
  });
31
34
  require("./sprinkles.css.ts.vanilla.css-mistica.js");
32
35
  require("./responsive-layout.css.ts.vanilla.css-mistica.js");
33
- var o = {
36
+ var e = {
34
37
  inverse: "_1y2v1nf3f",
35
38
  alternative: "_1y2v1nf3k"
36
- }, r = "_17lofg73", e = "_17lofg79 _1y2v1nfh5", v = "_17lofg74", t = "_17lofg77", i = "_17lofg72 _1y2v1nfh5";
39
+ }, n = "_17lofg74", r = "_17lofg73", t = "_17lofg7a _1y2v1nfh5", v = "_17lofg75", i = "_17lofg78", f = "_17lofg72 _1y2v1nfh5";
@@ -6,7 +6,8 @@ export declare const vars: {
6
6
  sideMargin: `var(--${string})` | `var(--${string}, ${string})` | `var(--${string}, ${number})`;
7
7
  };
8
8
  export declare const responsiveLayoutContainer: string;
9
- export declare const expandedResponsiveLayoutContainer: string;
9
+ export declare const expandedResponsiveLayoutContainerMobile: string;
10
+ export declare const expandedResponsiveLayoutContainerDesktop: string;
10
11
  export declare const fullwidthContainer: string;
11
12
  export declare const backgroundVariant: {
12
13
  inverse: string;
@@ -11,7 +11,7 @@ type Props = {
11
11
  dataAttributes?: DataAttributes;
12
12
  };
13
13
  export declare const InternalResponsiveLayout: React.FC<Props & {
14
- shouldExpandWhenNested?: boolean;
14
+ shouldExpandWhenNested?: boolean | 'desktop';
15
15
  }>;
16
16
  declare const ResponsiveLayout: React.FC<Props>;
17
17
  export default ResponsiveLayout;
@@ -11,10 +11,10 @@ function _export(target, all) {
11
11
  }
12
12
  _export(exports, {
13
13
  InternalResponsiveLayout: function() {
14
- return R;
14
+ return b;
15
15
  },
16
16
  default: function() {
17
- return k;
17
+ return j;
18
18
  }
19
19
  });
20
20
  const _jsxruntime = require("react/jsx-runtime");
@@ -106,29 +106,32 @@ function _object_without_properties_loose(source, excluded) {
106
106
  }
107
107
  return target;
108
108
  }
109
- const R = (param)=>{
110
- let { children: a, isInverse: n = !1, variant: i, backgroundColor: o, className: r, fullWidth: s, dataAttributes: d, shouldExpandWhenNested: u = !1 } = param;
111
- const m = (0, _themevariantcontext.useThemeVariant)(), e = i || n && "inverse" || void 0;
109
+ const b = (param)=>{
110
+ let { children: n, isInverse: o = !1, variant: r, backgroundColor: s, className: p, fullWidth: e, dataAttributes: u, shouldExpandWhenNested: i = !1 } = param;
111
+ const d = (0, _themevariantcontext.useThemeVariant)(), t = r || o && "inverse" || void 0;
112
112
  return /* @__PURE__ */ (0, _jsxruntime.jsx)(_themevariantcontext.ThemeVariant, {
113
- variant: e !== null && e !== void 0 ? e : m,
113
+ variant: t !== null && t !== void 0 ? t : d,
114
114
  children: /* @__PURE__ */ (0, _jsxruntime.jsx)("div", _object_spread_props(_object_spread({
115
- className: (0, _classnames.default)(s ? _responsivelayoutcssmistica.fullwidthContainer : _responsivelayoutcssmistica.responsiveLayoutContainer, r, e && e !== "default" && _responsivelayoutcssmistica.backgroundVariant[e], u && !s && _responsivelayoutcssmistica.expandedResponsiveLayoutContainer),
116
- style: o ? {
117
- background: o
115
+ className: (0, _classnames.default)(e ? _responsivelayoutcssmistica.fullwidthContainer : _responsivelayoutcssmistica.responsiveLayoutContainer, p, t && t !== "default" && _responsivelayoutcssmistica.backgroundVariant[t], {
116
+ [_responsivelayoutcssmistica.expandedResponsiveLayoutContainerMobile]: i === !0 && !e,
117
+ [_responsivelayoutcssmistica.expandedResponsiveLayoutContainerDesktop]: i && !e
118
+ }),
119
+ style: s ? {
120
+ background: s
118
121
  } : void 0
119
- }, (0, _dom.getPrefixedDataAttributes)(d)), {
122
+ }, (0, _dom.getPrefixedDataAttributes)(u)), {
120
123
  children: /* @__PURE__ */ (0, _jsxruntime.jsx)("div", {
121
- className: s ? _responsivelayoutcssmistica.fullWidth : _responsivelayoutcssmistica.responsiveLayout,
122
- children: a
124
+ className: e ? _responsivelayoutcssmistica.fullWidth : _responsivelayoutcssmistica.responsiveLayout,
125
+ children: n
123
126
  })
124
127
  }))
125
128
  });
126
- }, N = (_param)=>{
127
- var { children: a } = _param, n = _object_without_properties(_param, [
129
+ }, C = (_param)=>{
130
+ var { children: n } = _param, o = _object_without_properties(_param, [
128
131
  "children"
129
132
  ]);
130
- return /* @__PURE__ */ (0, _jsxruntime.jsx)(R, _object_spread_props(_object_spread({}, n), {
133
+ return /* @__PURE__ */ (0, _jsxruntime.jsx)(b, _object_spread_props(_object_spread({}, o), {
131
134
  shouldExpandWhenNested: !0,
132
- children: a
135
+ children: n
133
136
  }));
134
- }, k = N;
137
+ }, j = C;