@telefonica/mistica 14.41.0 → 14.42.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 (137) 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 +161 -245
  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 +18 -15
  34. package/dist/feedback.css.d.ts +5 -4
  35. package/dist/feedback.js +154 -147
  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/theme-context-provider.js +2 -2
  79. package/dist/utils/platform.js +8 -11
  80. package/dist-es/boxed.css-mistica.js +3 -2
  81. package/dist-es/boxed.js +17 -15
  82. package/dist-es/button-fixed-footer-layout.js +29 -24
  83. package/dist-es/button-layout.css-mistica.js +7 -7
  84. package/dist-es/button-layout.js +23 -23
  85. package/dist-es/button.js +65 -57
  86. package/dist-es/carousel.js +373 -280
  87. package/dist-es/credit-card-expiration-field.js +34 -30
  88. package/dist-es/credit-card-number-field.css-mistica.js +4 -4
  89. package/dist-es/credit-card-number-field.js +84 -70
  90. package/dist-es/cvv-field.js +68 -63
  91. package/dist-es/date-field.css-mistica.js +5 -0
  92. package/dist-es/date-field.css.ts.vanilla.css-mistica.js +2 -0
  93. package/dist-es/date-field.js +46 -40
  94. package/dist-es/date-time-field.js +47 -41
  95. package/dist-es/date-time-picker.js +55 -57
  96. package/dist-es/decimal-field.js +31 -27
  97. package/dist-es/dialog-context.js +125 -0
  98. package/dist-es/dialog.css-mistica.js +3 -3
  99. package/dist-es/dialog.js +192 -262
  100. package/dist-es/double-field.css-mistica.js +3 -2
  101. package/dist-es/email-field.js +16 -12
  102. package/dist-es/feedback.css-mistica.js +2 -2
  103. package/dist-es/feedback.js +191 -184
  104. package/dist-es/fixed-footer-layout.css-mistica.js +1 -1
  105. package/dist-es/fixed-footer-layout.js +21 -20
  106. package/dist-es/iban-field.js +42 -38
  107. package/dist-es/index.js +1778 -1778
  108. package/dist-es/inline.css-mistica.js +3 -3
  109. package/dist-es/inline.js +18 -18
  110. package/dist-es/integer-field.js +21 -17
  111. package/dist-es/loading-bar.css-mistica.js +2 -2
  112. package/dist-es/loading-bar.js +10 -13
  113. package/dist-es/month-field.js +47 -41
  114. package/dist-es/package-version.js +1 -1
  115. package/dist-es/password-field.js +54 -52
  116. package/dist-es/phone-number-field.js +53 -49
  117. package/dist-es/pin-field.css-mistica.js +2 -2
  118. package/dist-es/pin-field.js +145 -111
  119. package/dist-es/responsive-layout.css-mistica.js +3 -3
  120. package/dist-es/responsive-layout.js +27 -24
  121. package/dist-es/search-field.js +45 -44
  122. package/dist-es/select.css-mistica.js +8 -7
  123. package/dist-es/select.js +167 -172
  124. package/dist-es/style.css +1 -1
  125. package/dist-es/text-field-base.css-mistica.js +2 -2
  126. package/dist-es/text-field-base.js +189 -157
  127. package/dist-es/text-field-components.css-mistica.js +3 -2
  128. package/dist-es/text-field-components.js +52 -49
  129. package/dist-es/text-field.js +31 -27
  130. package/dist-es/theme-context-provider.js +1 -1
  131. package/dist-es/utils/platform.js +6 -6
  132. package/package.json +1 -1
  133. package/dist/password-field.css-mistica.js +0 -13
  134. package/dist/password-field.css.d.ts +0 -1
  135. package/dist-es/password-field.css-mistica.js +0 -4
  136. /package/dist/{password-field.css.ts.vanilla.css-mistica.js → boxed.css.ts.vanilla.css-mistica.js} +0 -0
  137. /package/dist-es/{password-field.css.ts.vanilla.css-mistica.js → boxed.css.ts.vanilla.css-mistica.js} +0 -0
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", {
6
6
  Object.defineProperty(exports, "default", {
7
7
  enumerable: true,
8
8
  get: function() {
9
- return O;
9
+ return U;
10
10
  }
11
11
  });
12
12
  const _jsxruntime = require("react/jsx-runtime");
@@ -15,10 +15,10 @@ const _formcontext = require("./form-context.js");
15
15
  const _textfieldbase = require("./text-field-base.js");
16
16
  const _iconsearchregular = /*#__PURE__*/ _interop_require_default(require("./generated/mistica-icons/icon-search-regular.js"));
17
17
  const _iconcloseregular = /*#__PURE__*/ _interop_require_default(require("./generated/mistica-icons/icon-close-regular.js"));
18
- const _iconbutton = /*#__PURE__*/ _interop_require_default(require("./icon-button.js"));
19
18
  const _hooks = require("./hooks.js");
20
19
  const _dom = require("./utils/dom.js");
21
20
  const _common = require("./utils/common.js");
21
+ const _textfieldbasecssmistica = require("./text-field-base.css-mistica.js");
22
22
  function _interop_require_default(obj) {
23
23
  return obj && obj.__esModule ? obj : {
24
24
  default: obj
@@ -144,8 +144,8 @@ function _object_without_properties_loose(source, excluded) {
144
144
  }
145
145
  return target;
146
146
  }
147
- const q = /*#__PURE__*/ _react.forwardRef((_param, y)=>{
148
- var { disabled: m, error: u, helperText: d, name: p, optional: n, validate: R, onChange: e, onChangeValue: t, onBlur: I, value: a, defaultValue: S } = _param, x = _object_without_properties(_param, [
147
+ const q = /*#__PURE__*/ _react.forwardRef((_param, h)=>{
148
+ var { disabled: f, error: d, helperText: u, name: n, optional: p, validate: S, onChange: e, onChangeValue: t, onBlur: I, value: l, defaultValue: R, dataAttributes: F } = _param, b = _object_without_properties(_param, [
149
149
  "disabled",
150
150
  "error",
151
151
  "helperText",
@@ -156,47 +156,48 @@ const q = /*#__PURE__*/ _react.forwardRef((_param, y)=>{
156
156
  "onChangeValue",
157
157
  "onBlur",
158
158
  "value",
159
- "defaultValue"
159
+ "defaultValue",
160
+ "dataAttributes"
160
161
  ]);
161
- const b = (0, _hooks.useTheme)(), o = _react.useRef(), [F, P] = _react.useState(S || ""), i = typeof a < "u", f = i ? a : F, l = _react.useCallback((s, B)=>{
162
- i || P(s), t == null || t(s, B);
162
+ const x = (0, _hooks.useTheme)(), o = _react.useRef(), [P, v] = _react.useState(R || ""), c = typeof l < "u", m = c ? l : P, i = _react.useCallback((s, z)=>{
163
+ c || v(s), t == null || t(s, z);
163
164
  }, [
164
- i,
165
+ c,
165
166
  t
166
- ]), h = _react.useCallback(()=>{
167
- l("", ""), o.current && (e == null || e((0, _dom.createChangeEvent)(o.current, "")), o.current.focus());
167
+ ]), y = _react.useCallback(()=>{
168
+ i("", ""), o.current && (e == null || e((0, _dom.createChangeEvent)(o.current, "")), o.current.focus());
168
169
  }, [
169
- l,
170
+ i,
170
171
  e
171
- ]), v = (0, _formcontext.useFieldProps)({
172
- name: p,
173
- value: f,
172
+ ]), k = (0, _formcontext.useFieldProps)({
173
+ name: n,
174
+ value: m,
174
175
  defaultValue: void 0,
175
176
  processValue: (s)=>s,
176
- helperText: d,
177
- optional: n,
178
- error: u,
179
- disabled: m,
177
+ helperText: u,
178
+ optional: p,
179
+ error: d,
180
+ disabled: f,
180
181
  onBlur: I,
181
- validate: R,
182
+ validate: S,
182
183
  onChange: e,
183
- onChangeValue: l
184
+ onChangeValue: i
184
185
  });
185
186
  return /* @__PURE__ */ (0, _jsxruntime.jsx)(_textfieldbase.TextFieldBaseAutosuggest, _object_spread_props(_object_spread({
186
- ref: (0, _common.combineRefs)(o, y),
187
- startIcon: /* @__PURE__ */ (0, _jsxruntime.jsx)(_iconsearchregular.default, {}),
188
- endIcon: f ? /* @__PURE__ */ (0, _jsxruntime.jsx)(_iconbutton.default, {
189
- size: 48,
190
- style: {
191
- display: "flex",
192
- padding: 12,
193
- margin: -12
194
- },
195
- "aria-label": b.texts.formSearchClear,
196
- onPress: h,
197
- children: /* @__PURE__ */ (0, _jsxruntime.jsx)(_iconcloseregular.default, {})
187
+ ref: (0, _common.combineRefs)(o, h),
188
+ startIcon: /* @__PURE__ */ (0, _jsxruntime.jsx)(_iconsearchregular.default, {
189
+ size: _textfieldbasecssmistica.iconSize
190
+ }),
191
+ endIcon: m ? /* @__PURE__ */ (0, _jsxruntime.jsx)(_textfieldbase.FieldEndIcon, {
192
+ Icon: _iconcloseregular.default,
193
+ className: _textfieldbasecssmistica.endIconWithShadow,
194
+ "aria-label": x.texts.formSearchClear,
195
+ onPress: y
198
196
  }) : void 0
199
- }, x, v), {
200
- type: "search"
197
+ }, b, k), {
198
+ type: "search",
199
+ dataAttributes: _object_spread({
200
+ "component-name": "SearchField"
201
+ }, F)
201
202
  }));
202
- }), O = q;
203
+ }), U = q;
@@ -10,48 +10,49 @@ function _export(target, all) {
10
10
  }
11
11
  _export(exports, {
12
12
  arrowDown: function() {
13
- return n;
13
+ return i;
14
14
  },
15
15
  menuItem: function() {
16
- return i;
16
+ return f;
17
17
  },
18
18
  menuItemSelected: function() {
19
- return f;
19
+ return y;
20
20
  },
21
21
  optionsAnimationsVariants: function() {
22
- return y;
22
+ return a;
23
23
  },
24
24
  optionsContainer: function() {
25
- return a;
25
+ return s;
26
26
  },
27
27
  selectContainerVariants: function() {
28
- return s;
28
+ return t;
29
29
  },
30
30
  selectTextVariants: function() {
31
- return t;
31
+ return r;
32
32
  },
33
33
  selectVariants: function() {
34
- return r;
34
+ return p;
35
35
  },
36
36
  vars: function() {
37
- return p;
37
+ return e;
38
38
  }
39
39
  });
40
40
  require("./sprinkles.css.ts.vanilla.css-mistica.js");
41
+ require("./text-field-base.css.ts.vanilla.css-mistica.js");
41
42
  require("./select.css.ts.vanilla.css-mistica.js");
42
- var n = "_1sqpivvo _1y2v1nfgd _1y2v1nfko", i = "_1sqpivvq _1y2v1nf98 _1y2v1nfah _1y2v1nf6k _1y2v1nf7t _1y2v1nf22 _1y2v1nfgi _1y2v1nfgx _1y2v1nfji _1y2v1nfhx", f = "_1y2v1nf3k", y = {
43
+ var i = "_1sqpivvo _1y2v1nfgd", f = "_1sqpivvq _1y2v1nf98 _1y2v1nfah _1y2v1nf6k _1y2v1nf7t _1y2v1nf22 _1y2v1nfgi _1y2v1nfgx _1y2v1nfji", y = "_1y2v1nf3k", a = {
43
44
  show: "_1sqpivv7",
44
45
  hide: "_1sqpivv8"
45
- }, a = "_1sqpivv6 _1y2v1nf6b _1y2v1nf7k _1y2v1nf8t _1y2v1nfa2 _1y2v1nfge _1y2v1nfj8 _1y2v1nf37", s = {
46
+ }, s = "_1sqpivv6 _1y2v1nf6b _1y2v1nf7k _1y2v1nf8t _1y2v1nfa2 _1y2v1nfge _1y2v1nfj8 _1y2v1nf37", t = {
46
47
  default: "_1sqpivvd _1sqpivvc _1y2v1nfgc _1y2v1nfji",
47
48
  fullWidth: "_1sqpivve _1sqpivvc _1y2v1nfgc _1y2v1nfji"
48
- }, t = {
49
+ }, r = {
49
50
  default: "_1sqpivvl _1sqpivvk _1y2v1nfgd _1y2v1nfjj _1y2v1nfix _1y2v1nf22",
50
51
  disabled: "_1sqpivvm _1sqpivvk _1y2v1nfgd _1y2v1nfjj _1y2v1nfix _1y2v1nf22"
51
- }, r = {
52
- default: "_1sqpivvh _1sqpivvg _1y2v1nfj0 _1y2v1nfjj _1y2v1nf22 _1y2v1nf6a _1y2v1nfh5 _1y2v1nfhm",
53
- disabled: "_1sqpivvi _1sqpivvg _1y2v1nfj0 _1y2v1nfjj _1y2v1nf22 _1y2v1nf6a _1y2v1nfh5 _1y2v1nfhm"
54
52
  }, p = {
53
+ default: "_1sqpivvh _1sqpivvg _1y2v1nf6b _1y2v1nf7k _1y2v1nfj0 _1y2v1nfjj _1y2v1nf22 _1y2v1nf6a _1y2v1nfh5",
54
+ disabled: "_1sqpivvi _1sqpivvg _1y2v1nf6b _1y2v1nf7k _1y2v1nfj0 _1y2v1nfjj _1y2v1nf22 _1y2v1nf6a _1y2v1nfh5"
55
+ }, e = {
55
56
  top: "var(--_1sqpivv0)",
56
57
  left: "var(--_1sqpivv1)",
57
58
  transformOrigin: "var(--_1sqpivv2)",
@@ -5,6 +5,7 @@ export declare const vars: {
5
5
  minWidth: `var(--${string})` | `var(--${string}, ${string})` | `var(--${string}, ${number})`;
6
6
  maxHeight: `var(--${string})` | `var(--${string}, ${string})` | `var(--${string}, ${number})`;
7
7
  };
8
+ export declare const chevronSize: string;
8
9
  export declare const optionsContainer: string;
9
10
  export declare const optionsAnimationsVariants: Record<"hide" | "show", string>;
10
11
  export declare const actions: string;
package/dist/select.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 St;
9
+ return vt;
10
10
  }
11
11
  });
12
12
  const _jsxruntime = require("react/jsx-runtime");
@@ -23,6 +23,7 @@ const _platform = require("./utils/platform.js");
23
23
  const _dom = require("./utils/dom.js");
24
24
  const _text = require("./text.js");
25
25
  const _selectcssmistica = require("./select.css-mistica.js");
26
+ const _textfieldbasecssmistica = require("./text-field-base.css-mistica.js");
26
27
  const _portal = require("./portal.js");
27
28
  const _css = require("./utils/css.js");
28
29
  function _interop_require_default(obj) {
@@ -123,201 +124,198 @@ function _object_spread_props(target, source) {
123
124
  }
124
125
  return target;
125
126
  }
126
- const Ye = (param)=>{
127
- let { id: oe, label: d, helperText: ie, value: ce, onChangeValue: C, name: i, fullWidth: P, options: u, optional: V, disabled: ae, error: le, onBlur: D, autoFocus: $ = !1, native: ue } = param;
128
- var Y;
129
- const S = _react.useRef(null), f = _react.useRef(null), g = _react.useRef(null), T = _react.useRef(null), R = _react.useRef(/* @__PURE__ */ new Map()), [de, fe] = _react.useState(!0), [p, pe] = _react.useState(), [M, q] = _react.useState(!1), [z, j] = _react.useState(!1), [K, x] = _react.useState(!1), [l, H] = _react.useState({}), [v, F] = _react.useState(), G = _react.useRef(null), Z = (0, _hooks.useAriaId)(oe), { rawValues: me, setRawValue: B, setValue: W, formStatus: he, formErrors: U, setFormError: Se, register: L } = (0, _formcontext.useForm)(), { platformOverrides: X } = (0, _hooks.useTheme)(), ge = ue || process.env.NODE_ENV === "test" && !process.env.SSR_TEST || (0, _platform.isAndroid)(X) || (0, _platform.isIos)(X), E = ae || he === "sending", b = le || !!U[i], J = U[i] || ie, a = ce !== null && ce !== void 0 ? ce : me[i], A = (e)=>{
130
- C == null || C(e), Se({
127
+ const tt = (param)=>{
128
+ let { id: le, label: w, helperText: ae, value: ue, onChangeValue: P, name: i, fullWidth: V, options: u, optional: D, disabled: fe, error: de, onBlur: M, autoFocus: q = !1, native: pe } = param;
129
+ var te;
130
+ const h = _react.useRef(null), f = _react.useRef(null), S = _react.useRef(null), g = _react.useRef(null), N = _react.useRef(/* @__PURE__ */ new Map()), [me, he] = _react.useState(!0), [d, Se] = _react.useState(), [H, z] = _react.useState(!1), [j, K] = _react.useState(!1), [U, x] = _react.useState(!1), [a, F] = _react.useState({}), [T, W] = _react.useState(), G = _react.useRef(null), L = (0, _hooks.useAriaId)(le), { rawValues: ge, setRawValue: Z, setValue: $, formStatus: Te, formErrors: X, setFormError: ve, register: B } = (0, _formcontext.useForm)(), { platformOverrides: J } = (0, _hooks.useTheme)(), Ee = pe || process.env.NODE_ENV === "test" && !process.env.SSR_TEST || (0, _platform.isAndroid)(J) || (0, _platform.isIos)(J), v = fe || Te === "sending", R = de || !!X[i], Q = X[i] || ae, l = ue !== null && ue !== void 0 ? ue : ge[i], A = (e)=>{
131
+ P == null || P(e), ve({
131
132
  name: i,
132
133
  error: ""
133
- }), B({
134
+ }), Z({
134
135
  name: i,
135
136
  value: e
136
- }), W({
137
+ }), $({
137
138
  name: i,
138
139
  value: e
139
140
  });
140
- }, I = (e)=>{
141
+ }, E = (e)=>{
141
142
  if (e) {
142
- if (g != null && g.current) {
143
- const r = g.current.getBoundingClientRect(), m = r.top, w = r.width, O = r.left, Oe = r.height, y = m + Oe, k = Math.min(u.length, 8) * 48 + 16;
144
- if (y + k + 12 > window.innerHeight) {
145
- const ye = window.innerHeight - y;
146
- if (m > ye) {
147
- const Ne = m - k;
148
- H({
149
- minWidth: w,
143
+ if (S != null && S.current) {
144
+ const s = S.current.getBoundingClientRect(), p = s.top, I = s.width, O = s.left, ye = s.height, b = p + ye, _ = Math.min(u.length, 8) * 48 + 16;
145
+ if (b + _ + 12 > window.innerHeight) {
146
+ const Ne = window.innerHeight - b;
147
+ if (p > Ne) {
148
+ const Re = p - _;
149
+ F({
150
+ minWidth: I,
150
151
  left: O,
151
- top: Math.max(Ne, 12),
152
- maxHeight: Math.min(m - 12, k),
152
+ top: Math.max(Re, 12),
153
+ maxHeight: Math.min(p - 12, _),
153
154
  transformOrigin: "center bottom"
154
155
  });
155
- } else H({
156
- minWidth: w,
157
- top: y,
156
+ } else F({
157
+ minWidth: I,
158
+ top: b,
158
159
  left: O,
159
- maxHeight: window.innerHeight - y - 12,
160
+ maxHeight: window.innerHeight - b - 12,
160
161
  transformOrigin: "center top"
161
162
  });
162
- } else H({
163
- minWidth: w,
164
- top: y,
163
+ } else F({
164
+ minWidth: I,
165
+ top: b,
165
166
  left: O,
166
- maxHeight: k,
167
+ maxHeight: _,
167
168
  transformOrigin: "center top"
168
169
  });
169
170
  }
170
- q(!0), requestAnimationFrame(()=>{
171
- G.current && T.current && "scrollTop" in T.current && (T.current.scrollTop = G.current), j(!0);
172
- }), F(p !== null && p !== void 0 ? p : a);
173
- } else j(!1), q(!1), F(void 0);
174
- }, Q = (e)=>{
171
+ z(!0), requestAnimationFrame(()=>{
172
+ G.current && g.current && "scrollTop" in g.current && (g.current.scrollTop = G.current), K(!0);
173
+ }), W(d !== null && d !== void 0 ? d : l);
174
+ } else K(!1), z(!1), W(void 0);
175
+ }, Y = (e)=>{
175
176
  var t;
176
- G.current = (t = T.current) == null ? void 0 : t.scrollTop, I(!1), A && typeof e == "string" && A(e), typeof a > "u" && pe(e);
177
- }, Te = (e)=>{
178
- var s;
179
- const t = (s = T.current) == null ? void 0 : s.getBoundingClientRect();
180
- if (t && e && R.current.has(e)) {
181
- const c = R.current.get(e), r = c == null ? void 0 : c.getBoundingClientRect();
182
- if (r && r.top + r.height / 2 >= t.top + t.height) {
177
+ G.current = (t = g.current) == null ? void 0 : t.scrollTop, E(!1), A && typeof e == "string" && A(e), typeof l > "u" && Se(e);
178
+ }, Ie = (e)=>{
179
+ var r;
180
+ const t = (r = g.current) == null ? void 0 : r.getBoundingClientRect();
181
+ if (t && e && N.current.has(e)) {
182
+ const c = N.current.get(e), s = c == null ? void 0 : c.getBoundingClientRect();
183
+ if (s && s.top + s.height / 2 >= t.top + t.height) {
183
184
  c == null || c.scrollIntoView();
184
185
  return;
185
186
  }
186
- r && r.top + r.height / 2 <= t.top && (c == null || c.scrollIntoView(!1));
187
+ s && s.top + s.height / 2 <= t.top && (c == null || c.scrollIntoView(!1));
187
188
  }
188
- }, ve = f.current, Ee = S.current;
189
+ }, we = f.current, xe = h.current;
189
190
  _react.useEffect(()=>{
190
- B({
191
+ Z({
191
192
  name: i,
192
- value: a
193
- }), W({
193
+ value: l
194
+ }), $({
194
195
  name: i,
195
- value: a
196
+ value: l
196
197
  });
197
198
  }, [
198
199
  i,
199
- B,
200
- W,
201
- a
202
- ]), _react.useEffect(()=>(L(i, {
203
- input: S.current,
200
+ Z,
201
+ $,
202
+ l
203
+ ]), _react.useEffect(()=>(B(i, {
204
+ input: h.current,
204
205
  focusableElement: f.current
205
206
  }), ()=>{
206
- L(i, {
207
+ B(i, {
207
208
  input: null,
208
209
  focusableElement: null
209
210
  });
210
211
  }), [
211
212
  i,
212
- L,
213
+ B,
213
214
  f,
214
- S,
215
- ve,
216
- Ee
215
+ h,
216
+ we,
217
+ xe
217
218
  ]), _react.useEffect(()=>{
218
- const e = (s)=>{
219
- var m;
220
- const r = {
219
+ const e = (r)=>{
220
+ var p;
221
+ const s = {
221
222
  [_keys.UP]: -1,
222
223
  [_keys.DOWN]: 1
223
- }[s.key];
224
- if (r) {
225
- (0, _dom.cancelEvent)(s);
224
+ }[r.key];
225
+ if (s) {
226
+ (0, _dom.cancelEvent)(r);
226
227
  var _ref;
227
- const w = (_ref = (m = u[u.findIndex((param)=>{
228
+ const I = (_ref = (p = u[u.findIndex((param)=>{
228
229
  let { value: O } = param;
229
- return O === v;
230
- }) + r]) == null ? void 0 : m.value) !== null && _ref !== void 0 ? _ref : v;
231
- F(w), Te(w);
230
+ return O === T;
231
+ }) + s]) == null ? void 0 : p.value) !== null && _ref !== void 0 ? _ref : T;
232
+ W(I), Ie(I);
232
233
  }
233
- }, t = (s)=>{
234
- if (M) switch(s.key){
234
+ }, t = (r)=>{
235
+ if (H) switch(r.key){
235
236
  case _keys.TAB:
236
- (0, _dom.cancelEvent)(s);
237
+ (0, _dom.cancelEvent)(r);
237
238
  break;
238
239
  case _keys.ESC:
239
- I(!1);
240
+ E(!1);
240
241
  break;
241
242
  case _keys.ENTER:
242
243
  case _keys.SPACE:
243
- (0, _dom.cancelEvent)(s), u.findIndex((param)=>{
244
+ (0, _dom.cancelEvent)(r), u.findIndex((param)=>{
244
245
  let { value: c } = param;
245
- return c === v;
246
- }) !== -1 && v !== p && Q(v), I(!1);
246
+ return c === T;
247
+ }) !== -1 && T !== d && Y(T), E(!1);
247
248
  break;
248
249
  }
249
- z && e(s);
250
+ j && e(r);
250
251
  };
251
252
  return document.addEventListener("keydown", t, !1), ()=>{
252
253
  document.removeEventListener("keydown", t, !1);
253
254
  };
254
255
  }), _react.useEffect(()=>{
255
- $ && f.current && f.current.focus();
256
+ q && f.current && f.current.focus();
256
257
  }, [
257
- $
258
+ q
258
259
  ]), _react.useEffect(()=>{
259
- fe(!1);
260
+ he(!1);
260
261
  }, []);
261
- const Ie = (e)=>{
262
+ const Oe = (e)=>{
262
263
  var t;
263
264
  return e ? (t = u.find((param)=>{
264
- let { value: s } = param;
265
- return s === e;
265
+ let { value: r } = param;
266
+ return r === e;
266
267
  })) == null ? void 0 : t.text : "";
267
- }, we = {
268
+ }, be = {
268
269
  tabIndex: 0,
269
270
  onFocus: ()=>x(!0),
270
271
  onBlur: ()=>x(!1),
271
272
  onClick: ()=>{
272
- I(!0), x(!0);
273
+ E(!0), x(!0);
273
274
  },
274
275
  onKeyDown: (e)=>{
275
- !M && (e.key === _keys.SPACE || e.key === _keys.ENTER) && ((0, _dom.cancelEvent)(e), I(!0));
276
+ !H && (e.key === _keys.SPACE || e.key === _keys.ENTER) && ((0, _dom.cancelEvent)(e), E(!0));
276
277
  }
277
- }, { isDesktopOrBigger: xe } = (0, _hooks.useScreenSize)();
278
- var _ref, _l_transformOrigin;
279
- return ge || de ? /* @__PURE__ */ (0, _jsxruntime.jsxs)(_textfieldcomponents.FieldContainer, {
280
- disabled: E,
278
+ }, ee = (0, _css.pxToRem)(20);
279
+ var _ref, _a_transformOrigin;
280
+ return Ee || me ? /* @__PURE__ */ (0, _jsxruntime.jsxs)(_textfieldcomponents.FieldContainer, {
281
+ disabled: v,
281
282
  helperText: /* @__PURE__ */ (0, _jsxruntime.jsx)(_textfieldcomponents.HelperText, {
282
- error: b,
283
- leftText: J
283
+ error: R,
284
+ leftText: Q
284
285
  }),
285
- fieldRef: g,
286
- fullWidth: P,
286
+ fieldRef: S,
287
+ fullWidth: V,
287
288
  children: [
288
- d && /* @__PURE__ */ (0, _jsxruntime.jsx)(_textfieldcomponents.Label, {
289
- error: b,
290
- forId: Z,
291
- inputState: K ? "focused" : ((_ref = a !== null && a !== void 0 ? a : p) !== null && _ref !== void 0 ? _ref : (Y = S.current) == null ? void 0 : Y.value) ? "filled" : "default",
292
- optional: V,
293
- children: d
289
+ w && /* @__PURE__ */ (0, _jsxruntime.jsx)(_textfieldcomponents.Label, {
290
+ error: R,
291
+ forId: L,
292
+ inputState: U ? "focused" : ((_ref = l !== null && l !== void 0 ? l : d) !== null && _ref !== void 0 ? _ref : (te = h.current) == null ? void 0 : te.value) ? "filled" : "default",
293
+ optional: D,
294
+ children: w
294
295
  }),
295
296
  /* @__PURE__ */ (0, _jsxruntime.jsxs)("select", {
296
- className: _selectcssmistica.selectVariants[E ? "disabled" : "default"],
297
- id: Z,
298
- "aria-invalid": !!b,
299
- value: a,
300
- required: !V,
301
- disabled: E,
297
+ className: (0, _classnames.default)(_selectcssmistica.selectVariants[v ? "disabled" : "default"], w ? _textfieldbasecssmistica.inputWithLabel : _textfieldbasecssmistica.inputWithoutLabel),
298
+ id: L,
299
+ "aria-invalid": !!R,
300
+ value: l,
301
+ required: !D,
302
+ disabled: v,
302
303
  onChange: (e)=>{
303
304
  A && A(e.target.value);
304
305
  },
305
306
  onFocus: ()=>x(!0),
306
307
  onBlur: (e)=>{
307
- x(!1), D == null || D(e);
308
+ x(!1), M == null || M(e);
308
309
  },
309
310
  ref: (e)=>{
310
311
  [
311
- S,
312
+ h,
312
313
  f
313
314
  ].forEach((t)=>{
314
315
  t.current = e;
315
316
  });
316
317
  },
317
318
  style: {
318
- paddingTop: d ? 24 : 16,
319
- paddingBottom: d ? 8 : 16,
320
- paddingRight: 48,
321
319
  // Override default browser opacity when disabled. This opacity also affects the label.
322
320
  // Without this fix, the label is invisible when disabled
323
321
  opacity: 1
@@ -347,80 +345,77 @@ const Ye = (param)=>{
347
345
  className: _selectcssmistica.arrowDown,
348
346
  "aria-hidden": !0,
349
347
  children: /* @__PURE__ */ (0, _jsxruntime.jsx)(_iconchevrondownregular.default, {
350
- size: 20
348
+ size: ee
351
349
  })
352
350
  })
353
351
  ]
354
352
  }) : /* @__PURE__ */ (0, _jsxruntime.jsxs)(_jsxruntime.Fragment, {
355
353
  children: [
356
354
  /* @__PURE__ */ (0, _jsxruntime.jsxs)("div", _object_spread_props(_object_spread({
357
- className: _selectcssmistica.selectContainerVariants[P ? "fullWidth" : "default"],
355
+ className: _selectcssmistica.selectContainerVariants[V ? "fullWidth" : "default"],
358
356
  role: "button",
359
357
  "aria-haspopup": "listbox",
360
358
  ref: f
361
- }, !E && we), {
359
+ }, !v && be), {
362
360
  children: [
363
361
  /* @__PURE__ */ (0, _jsxruntime.jsx)(_textfieldbase.TextFieldBaseAutosuggest, {
364
362
  style: {
365
363
  visibility: "hidden"
366
364
  },
367
- fullWidth: P,
365
+ fullWidth: V,
368
366
  endIcon: /* @__PURE__ */ (0, _jsxruntime.jsx)(_iconchevrondownregular.default, {
369
- size: 20
367
+ size: ee
370
368
  }),
371
- focus: K,
372
- label: d,
373
- value: a,
374
- shrinkLabel: !!(a || p),
369
+ focus: U,
370
+ label: w,
371
+ value: l,
372
+ shrinkLabel: !!(l || d),
375
373
  name: i,
376
- helperText: J,
377
- required: !V,
378
- disabled: E,
379
- id: Z,
380
- error: b,
381
- inputRef: S,
382
- fieldRef: g
374
+ helperText: Q,
375
+ required: !D,
376
+ disabled: v,
377
+ id: L,
378
+ error: R,
379
+ inputRef: h,
380
+ fieldRef: S
383
381
  }),
384
382
  /* @__PURE__ */ (0, _jsxruntime.jsx)("div", {
385
- className: _selectcssmistica.selectTextVariants[E ? "disabled" : "default"],
386
- style: {
387
- top: xe ? d ? 28 : 18 : d ? 25 : 16
388
- },
389
- children: Ie(a !== null && a !== void 0 ? a : p)
383
+ className: (0, _classnames.default)(_selectcssmistica.selectTextVariants[v ? "disabled" : "default"], w ? _textfieldbasecssmistica.inputWithLabel : _textfieldbasecssmistica.inputWithoutLabel),
384
+ children: Oe(l !== null && l !== void 0 ? l : d)
390
385
  })
391
386
  ]
392
387
  })),
393
- M && /* @__PURE__ */ (0, _jsxruntime.jsx)(_overlay.default, {
388
+ H && /* @__PURE__ */ (0, _jsxruntime.jsx)(_overlay.default, {
394
389
  onPress: (e)=>{
395
- I(!1), (0, _dom.cancelEvent)(e);
390
+ E(!1), (0, _dom.cancelEvent)(e);
396
391
  },
397
392
  disableScroll: !0,
398
393
  children: /* @__PURE__ */ (0, _jsxruntime.jsx)(_portal.Portal, {
399
394
  children: /* @__PURE__ */ (0, _jsxruntime.jsx)("ul", {
400
395
  style: (0, _css.applyCssVars)({
401
- [_selectcssmistica.vars.top]: l.top ? `${l.top}px` : "",
402
- [_selectcssmistica.vars.left]: l.left ? `${l.left}px` : "",
403
- [_selectcssmistica.vars.maxHeight]: l.maxHeight ? `${l.maxHeight}px` : "",
404
- [_selectcssmistica.vars.minWidth]: l.minWidth ? `${l.minWidth}px` : "",
405
- [_selectcssmistica.vars.transformOrigin]: (_l_transformOrigin = l.transformOrigin) !== null && _l_transformOrigin !== void 0 ? _l_transformOrigin : ""
396
+ [_selectcssmistica.vars.top]: a.top ? `${a.top}px` : "",
397
+ [_selectcssmistica.vars.left]: a.left ? `${a.left}px` : "",
398
+ [_selectcssmistica.vars.maxHeight]: a.maxHeight ? `${a.maxHeight}px` : "",
399
+ [_selectcssmistica.vars.minWidth]: a.minWidth ? `${a.minWidth}px` : "",
400
+ [_selectcssmistica.vars.transformOrigin]: (_a_transformOrigin = a.transformOrigin) !== null && _a_transformOrigin !== void 0 ? _a_transformOrigin : ""
406
401
  }),
407
402
  onPointerDown: _dom.cancelEvent,
408
- className: (0, _classnames.default)(_selectcssmistica.optionsContainer, z ? _selectcssmistica.optionsAnimationsVariants.show : _selectcssmistica.optionsAnimationsVariants.hide),
403
+ className: (0, _classnames.default)(_selectcssmistica.optionsContainer, j ? _selectcssmistica.optionsAnimationsVariants.show : _selectcssmistica.optionsAnimationsVariants.hide),
409
404
  role: "listbox",
410
- ref: T,
405
+ ref: g,
411
406
  children: u.map((param)=>{
412
407
  let { value: e, text: t } = param;
413
408
  return /* @__PURE__ */ (0, _jsxruntime.jsx)("li", {
414
409
  role: "option",
415
- "aria-selected": e === (p !== null && p !== void 0 ? p : a),
410
+ "aria-selected": e === (d !== null && d !== void 0 ? d : l),
416
411
  "data-value": e,
417
412
  className: (0, _classnames.default)(_selectcssmistica.menuItem, {
418
- [_selectcssmistica.menuItemSelected]: e === v || e === (p !== null && p !== void 0 ? p : a)
413
+ [_selectcssmistica.menuItemSelected]: e === T || e === (d !== null && d !== void 0 ? d : l)
419
414
  }),
420
415
  onPointerDown: _dom.cancelEvent,
421
- onClick: ()=>Q(e),
422
- ref: (s)=>{
423
- s ? R.current.set(e, s) : R.current.delete(e);
416
+ onClick: ()=>Y(e),
417
+ ref: (r)=>{
418
+ r ? N.current.set(e, r) : N.current.delete(e);
424
419
  },
425
420
  children: /* @__PURE__ */ (0, _jsxruntime.jsx)(_text.Text3, {
426
421
  regular: !0,
@@ -433,4 +428,4 @@ const Ye = (param)=>{
433
428
  })
434
429
  ]
435
430
  });
436
- }, St = Ye;
431
+ }, vt = tt;