@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.
- package/css/mistica.css +1 -1
- package/dist/boxed.css-mistica.js +14 -5
- package/dist/boxed.css.d.ts +1 -0
- package/dist/boxed.d.ts +1 -0
- package/dist/boxed.js +11 -9
- package/dist/button-fixed-footer-layout.d.ts +1 -0
- package/dist/button-fixed-footer-layout.js +19 -14
- package/dist/button-layout.css-mistica.js +16 -13
- package/dist/button-layout.css.d.ts +1 -0
- package/dist/button-layout.js +15 -15
- package/dist/button.js +43 -35
- package/dist/carousel.d.ts +13 -0
- package/dist/carousel.js +325 -223
- package/dist/credit-card-expiration-field.js +30 -26
- package/dist/credit-card-number-field.css-mistica.js +7 -7
- package/dist/credit-card-number-field.js +59 -45
- package/dist/cvv-field.js +46 -41
- package/dist/date-field.css-mistica.js +14 -0
- package/dist/date-field.css.d.ts +1 -0
- package/dist/date-field.css.ts.vanilla.css-mistica.js +11 -0
- package/dist/date-field.js +41 -35
- package/dist/date-time-field.js +40 -34
- package/dist/date-time-picker.js +43 -45
- package/dist/decimal-field.js +26 -22
- package/dist/dialog-context.d.ts +24 -0
- package/dist/dialog-context.js +192 -0
- package/dist/dialog.css-mistica.js +15 -12
- package/dist/dialog.css.d.ts +1 -0
- package/dist/dialog.d.ts +14 -44
- package/dist/dialog.js +163 -246
- package/dist/double-field.css-mistica.js +3 -2
- package/dist/email-field.js +15 -11
- package/dist/feedback.css-mistica.js +23 -14
- package/dist/feedback.css.d.ts +7 -4
- package/dist/feedback.js +157 -143
- package/dist/fixed-footer-layout.css-mistica.js +1 -1
- package/dist/fixed-footer-layout.js +9 -8
- package/dist/iban-field.js +31 -27
- package/dist/icons/icon-amex.d.ts +1 -1
- package/dist/icons/icon-cvv-amex.d.ts +1 -1
- package/dist/icons/icon-cvv-visa-mc.d.ts +1 -1
- package/dist/icons/icon-mastercard.d.ts +1 -1
- package/dist/icons/icon-visa.d.ts +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.js +16 -4
- package/dist/inline.css-mistica.js +9 -6
- package/dist/inline.css.d.ts +1 -1
- package/dist/inline.js +9 -9
- package/dist/integer-field.js +17 -13
- package/dist/loading-bar.css-mistica.js +4 -7
- package/dist/loading-bar.css.d.ts +0 -2
- package/dist/loading-bar.js +3 -6
- package/dist/month-field.js +39 -33
- package/dist/package-version.js +1 -1
- package/dist/password-field.js +46 -44
- package/dist/phone-number-field.js +50 -46
- package/dist/pin-field.css-mistica.js +12 -6
- package/dist/pin-field.css.d.ts +2 -0
- package/dist/pin-field.d.ts +3 -1
- package/dist/pin-field.js +129 -95
- package/dist/responsive-layout.css-mistica.js +10 -7
- package/dist/responsive-layout.css.d.ts +2 -1
- package/dist/responsive-layout.d.ts +1 -1
- package/dist/responsive-layout.js +20 -17
- package/dist/search-field.js +36 -35
- package/dist/select.css-mistica.js +16 -15
- package/dist/select.css.d.ts +1 -0
- package/dist/select.js +138 -143
- package/dist/text-field-base.css-mistica.js +45 -21
- package/dist/text-field-base.css.d.ts +30 -7
- package/dist/text-field-base.d.ts +11 -0
- package/dist/text-field-base.js +175 -140
- package/dist/text-field-components.css-mistica.js +13 -21
- package/dist/text-field-components.css.d.ts +0 -3
- package/dist/text-field-components.d.ts +3 -0
- package/dist/text-field-components.js +38 -35
- package/dist/text-field.js +26 -22
- package/dist/text.css-mistica.js +7 -7
- package/dist/text.css.d.ts +0 -1
- package/dist/text.js +24 -24
- package/dist/theme-context-provider.js +2 -2
- package/dist/utils/platform.js +8 -11
- package/dist-es/boxed.css-mistica.js +3 -2
- package/dist-es/boxed.js +17 -15
- package/dist-es/button-fixed-footer-layout.js +29 -24
- package/dist-es/button-layout.css-mistica.js +7 -7
- package/dist-es/button-layout.js +23 -23
- package/dist-es/button.js +65 -57
- package/dist-es/carousel.js +373 -280
- package/dist-es/credit-card-expiration-field.js +34 -30
- package/dist-es/credit-card-number-field.css-mistica.js +4 -4
- package/dist-es/credit-card-number-field.js +84 -70
- package/dist-es/cvv-field.js +68 -63
- package/dist-es/date-field.css-mistica.js +5 -0
- package/dist-es/date-field.css.ts.vanilla.css-mistica.js +2 -0
- package/dist-es/date-field.js +46 -40
- package/dist-es/date-time-field.js +47 -41
- package/dist-es/date-time-picker.js +55 -57
- package/dist-es/decimal-field.js +31 -27
- package/dist-es/dialog-context.js +125 -0
- package/dist-es/dialog.css-mistica.js +3 -3
- package/dist-es/dialog.js +193 -262
- package/dist-es/double-field.css-mistica.js +3 -2
- package/dist-es/email-field.js +16 -12
- package/dist-es/feedback.css-mistica.js +2 -2
- package/dist-es/feedback.js +196 -182
- package/dist-es/fixed-footer-layout.css-mistica.js +1 -1
- package/dist-es/fixed-footer-layout.js +21 -20
- package/dist-es/iban-field.js +42 -38
- package/dist-es/index.js +1778 -1778
- package/dist-es/inline.css-mistica.js +3 -3
- package/dist-es/inline.js +18 -18
- package/dist-es/integer-field.js +21 -17
- package/dist-es/loading-bar.css-mistica.js +2 -2
- package/dist-es/loading-bar.js +10 -13
- package/dist-es/month-field.js +47 -41
- package/dist-es/package-version.js +1 -1
- package/dist-es/password-field.js +54 -52
- package/dist-es/phone-number-field.js +53 -49
- package/dist-es/pin-field.css-mistica.js +2 -2
- package/dist-es/pin-field.js +145 -111
- package/dist-es/responsive-layout.css-mistica.js +3 -3
- package/dist-es/responsive-layout.js +27 -24
- package/dist-es/search-field.js +45 -44
- package/dist-es/select.css-mistica.js +8 -7
- package/dist-es/select.js +167 -172
- package/dist-es/style.css +1 -1
- package/dist-es/text-field-base.css-mistica.js +2 -2
- package/dist-es/text-field-base.js +189 -157
- package/dist-es/text-field-components.css-mistica.js +3 -2
- package/dist-es/text-field-components.js +52 -49
- package/dist-es/text-field.js +31 -27
- package/dist-es/text.css-mistica.js +3 -3
- package/dist-es/text.js +32 -32
- package/dist-es/theme-context-provider.js +1 -1
- package/dist-es/utils/platform.js +6 -6
- package/package.json +1 -1
- package/dist/password-field.css-mistica.js +0 -13
- package/dist/password-field.css.d.ts +0 -1
- package/dist-es/password-field.css-mistica.js +0 -4
- /package/dist/{password-field.css.ts.vanilla.css-mistica.js → boxed.css.ts.vanilla.css-mistica.js} +0 -0
- /package/dist-es/{password-field.css.ts.vanilla.css-mistica.js → boxed.css.ts.vanilla.css-mistica.js} +0 -0
|
@@ -9,55 +9,79 @@ function _export(target, all) {
|
|
|
9
9
|
});
|
|
10
10
|
}
|
|
11
11
|
_export(exports, {
|
|
12
|
+
emptyDateValue: function() {
|
|
13
|
+
return t;
|
|
14
|
+
},
|
|
12
15
|
endIcon: function() {
|
|
13
|
-
return
|
|
16
|
+
return v;
|
|
17
|
+
},
|
|
18
|
+
endIconContainer: function() {
|
|
19
|
+
return r;
|
|
20
|
+
},
|
|
21
|
+
endIconWithShadow: function() {
|
|
22
|
+
return y;
|
|
23
|
+
},
|
|
24
|
+
fieldElementsGap: function() {
|
|
25
|
+
return a;
|
|
26
|
+
},
|
|
27
|
+
fieldEndIconContainer: function() {
|
|
28
|
+
return f;
|
|
29
|
+
},
|
|
30
|
+
fieldLeftPadding: function() {
|
|
31
|
+
return i;
|
|
32
|
+
},
|
|
33
|
+
fieldRightPadding: function() {
|
|
34
|
+
return _;
|
|
14
35
|
},
|
|
15
36
|
fullWidth: function() {
|
|
16
|
-
return
|
|
37
|
+
return h;
|
|
38
|
+
},
|
|
39
|
+
hiddenDatePlaceholder: function() {
|
|
40
|
+
return d;
|
|
41
|
+
},
|
|
42
|
+
iconButtonSize: function() {
|
|
43
|
+
return o;
|
|
44
|
+
},
|
|
45
|
+
iconSize: function() {
|
|
46
|
+
return l;
|
|
17
47
|
},
|
|
18
48
|
input: function() {
|
|
19
|
-
return
|
|
49
|
+
return g;
|
|
20
50
|
},
|
|
21
51
|
inputFirefoxStyles: function() {
|
|
22
|
-
return
|
|
52
|
+
return u;
|
|
23
53
|
},
|
|
24
54
|
inputWithLabel: function() {
|
|
25
|
-
return
|
|
55
|
+
return c;
|
|
26
56
|
},
|
|
27
57
|
inputWithoutLabel: function() {
|
|
28
|
-
return
|
|
58
|
+
return m;
|
|
29
59
|
},
|
|
30
60
|
menuItem: function() {
|
|
31
|
-
return
|
|
61
|
+
return p;
|
|
32
62
|
},
|
|
33
63
|
menuItemSelected: function() {
|
|
34
|
-
return
|
|
64
|
+
return x;
|
|
35
65
|
},
|
|
36
66
|
prefix: function() {
|
|
37
|
-
return
|
|
38
|
-
},
|
|
39
|
-
prefixWithLabel: function() {
|
|
40
|
-
return o;
|
|
41
|
-
},
|
|
42
|
-
prefixWithoutLabel: function() {
|
|
43
|
-
return x;
|
|
67
|
+
return b;
|
|
44
68
|
},
|
|
45
69
|
startIcon: function() {
|
|
46
|
-
return
|
|
70
|
+
return s;
|
|
47
71
|
},
|
|
48
72
|
suggestionsContainer: function() {
|
|
49
|
-
return
|
|
73
|
+
return I;
|
|
50
74
|
},
|
|
51
75
|
textArea: function() {
|
|
52
|
-
return
|
|
76
|
+
return W;
|
|
53
77
|
},
|
|
54
78
|
textAreaWithLabel: function() {
|
|
55
|
-
return
|
|
79
|
+
return j;
|
|
56
80
|
},
|
|
57
81
|
textAreaWithoutLabel: function() {
|
|
58
|
-
return
|
|
82
|
+
return L;
|
|
59
83
|
}
|
|
60
84
|
});
|
|
61
85
|
require("./sprinkles.css.ts.vanilla.css-mistica.js");
|
|
62
86
|
require("./text-field-base.css.ts.vanilla.css-mistica.js");
|
|
63
|
-
var
|
|
87
|
+
var t = "rhey4t8", v = "rhey4ts _1y2v1nf6b _1y2v1nf7k _1y2v1nf8t _1y2v1nfa2 _1y2v1nf6a", r = "rhey4th _1y2v1nf95 _1y2v1nfgi _1y2v1nfgx", y = "rhey4tu rhey4ts _1y2v1nf6b _1y2v1nf7k _1y2v1nf8t _1y2v1nfa2 _1y2v1nf6a _1y2v1nfj1", a = 12, f = "rhey4tv", i = 11, _ = 15, h = "rhey4t4", d = "rhey4t7", o = "2.500rem", l = "1.500rem", g = "rhey4ta _1y2v1nfgc rhey4t1 _1y2v1nfj0 _1y2v1nfi3 _1y2v1nf22 _1y2v1nfh5", u = "rhey4tb", c = "rhey4tc", m = "rhey4td", p = "rhey4tn _1y2v1nfgi _1y2v1nfgx _1y2v1nfji", x = "_1y2v1nf3k", b = "rhey4tl _1y2v1nfae", s = "rhey4tj _1y2v1nfae _1y2v1nfgi _1y2v1nfgx _1y2v1nfhm _1y2v1nfgd", I = "rhey4tq _1y2v1nfgd", W = "rhey4t6 _1y2v1nf6b _1y2v1nf7k rhey4t1 _1y2v1nfj0 _1y2v1nfi3 _1y2v1nf22 _1y2v1nfh5", j = "rhey4te", L = "rhey4tf";
|
|
@@ -1,19 +1,42 @@
|
|
|
1
|
-
export declare const
|
|
2
|
-
export declare const
|
|
1
|
+
export declare const fieldVerticalPadding: number;
|
|
2
|
+
export declare const fieldLeftPadding: number;
|
|
3
|
+
export declare const fieldRightPadding: number;
|
|
4
|
+
export declare const fieldElementsGap = 12;
|
|
5
|
+
export declare const iconSize: string;
|
|
6
|
+
export declare const iconButtonSize: string;
|
|
7
|
+
export declare const mobileFontSize: string;
|
|
8
|
+
export declare const desktopFontSize: string;
|
|
9
|
+
export declare const labelLineHeight: string;
|
|
10
|
+
export declare const inputLineHeight: string;
|
|
11
|
+
export declare const shrinkedLabelLineHeight: {
|
|
12
|
+
mobile: string;
|
|
13
|
+
desktop: string;
|
|
14
|
+
};
|
|
15
|
+
export declare const labelFontSize: {
|
|
16
|
+
mobile: string;
|
|
17
|
+
desktop: string;
|
|
18
|
+
};
|
|
3
19
|
export declare const container: string;
|
|
4
20
|
export declare const fullWidth: string;
|
|
5
21
|
export declare const textArea: string;
|
|
6
|
-
export declare const
|
|
7
|
-
export declare const
|
|
22
|
+
export declare const hiddenDatePlaceholder: string;
|
|
23
|
+
export declare const emptyDateValue: string;
|
|
8
24
|
export declare const input: string;
|
|
25
|
+
/**
|
|
26
|
+
* Firefox: hide value if not valid or focused
|
|
27
|
+
* Only apply when Firefox, otherwise it breaks styles in safari mobile
|
|
28
|
+
*/
|
|
9
29
|
export declare const inputFirefoxStyles: string;
|
|
10
30
|
export declare const inputWithLabel: string;
|
|
11
31
|
export declare const inputWithoutLabel: string;
|
|
12
|
-
export declare const
|
|
32
|
+
export declare const textAreaWithLabel: string;
|
|
33
|
+
export declare const textAreaWithoutLabel: string;
|
|
34
|
+
export declare const endIconContainer: string;
|
|
13
35
|
export declare const startIcon: string;
|
|
14
36
|
export declare const prefix: string;
|
|
15
|
-
export declare const prefixWithLabel: string;
|
|
16
|
-
export declare const prefixWithoutLabel: string;
|
|
17
37
|
export declare const menuItem: string;
|
|
18
38
|
export declare const menuItemSelected: string;
|
|
19
39
|
export declare const suggestionsContainer: string;
|
|
40
|
+
export declare const endIcon: string;
|
|
41
|
+
export declare const endIconWithShadow: string;
|
|
42
|
+
export declare const fieldEndIconContainer: string;
|
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
+
import type { DataAttributes, IconProps } from './utils/types';
|
|
2
3
|
import type { FieldValidator } from './form-context';
|
|
4
|
+
interface FieldEndIconProps {
|
|
5
|
+
Icon: React.FC<IconProps>;
|
|
6
|
+
className?: string;
|
|
7
|
+
onPress: (event: React.MouseEvent<HTMLElement>) => void;
|
|
8
|
+
disabled?: boolean;
|
|
9
|
+
'aria-label'?: string;
|
|
10
|
+
}
|
|
11
|
+
export declare const FieldEndIcon: React.FC<FieldEndIconProps>;
|
|
3
12
|
/**
|
|
4
13
|
* Incomplete list, add more if needed
|
|
5
14
|
* https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/autocomplete
|
|
@@ -27,6 +36,7 @@ export interface CommonFormFieldProps<T = HTMLInputElement> {
|
|
|
27
36
|
onChange?: (event: React.ChangeEvent<HTMLInputElement>) => void;
|
|
28
37
|
children?: void;
|
|
29
38
|
readOnly?: boolean;
|
|
39
|
+
dataAttributes?: DataAttributes;
|
|
30
40
|
}
|
|
31
41
|
interface TextFieldBaseProps {
|
|
32
42
|
id?: string;
|
|
@@ -71,6 +81,7 @@ interface TextFieldBaseProps {
|
|
|
71
81
|
min?: string;
|
|
72
82
|
max?: string;
|
|
73
83
|
role?: string;
|
|
84
|
+
dataAttributes?: DataAttributes;
|
|
74
85
|
}
|
|
75
86
|
export declare const TextFieldBase: React.ForwardRefExoticComponent<TextFieldBaseProps & React.RefAttributes<any>>;
|
|
76
87
|
export declare const TextFieldBaseAutosuggest: React.ForwardRefExoticComponent<TextFieldBaseProps & React.RefAttributes<any>>;
|
package/dist/text-field-base.js
CHANGED
|
@@ -10,11 +10,14 @@ function _export(target, all) {
|
|
|
10
10
|
});
|
|
11
11
|
}
|
|
12
12
|
_export(exports, {
|
|
13
|
+
FieldEndIcon: function() {
|
|
14
|
+
return Ue;
|
|
15
|
+
},
|
|
13
16
|
TextFieldBase: function() {
|
|
14
|
-
return
|
|
17
|
+
return F;
|
|
15
18
|
},
|
|
16
19
|
TextFieldBaseAutosuggest: function() {
|
|
17
|
-
return
|
|
20
|
+
return Xe;
|
|
18
21
|
}
|
|
19
22
|
});
|
|
20
23
|
const _jsxruntime = require("react/jsx-runtime");
|
|
@@ -27,8 +30,9 @@ const _hooks = require("./hooks.js");
|
|
|
27
30
|
const _classnames = /*#__PURE__*/ _interop_require_default(require("classnames"));
|
|
28
31
|
const _common = require("./utils/common.js");
|
|
29
32
|
const _textfieldbasecssmistica = require("./text-field-base.css-mistica.js");
|
|
30
|
-
const _sprinklescssmistica = require("./sprinkles.css-mistica.js");
|
|
31
33
|
const _skincontractcssmistica = require("./skins/skin-contract.css-mistica.js");
|
|
34
|
+
const _iconbutton = require("./icon-button.js");
|
|
35
|
+
const _themevariantcontext = require("./theme-variant-context.js");
|
|
32
36
|
function _interop_require_default(obj) {
|
|
33
37
|
return obj && obj.__esModule ? obj : {
|
|
34
38
|
default: obj
|
|
@@ -154,8 +158,31 @@ function _object_without_properties_loose(source, excluded) {
|
|
|
154
158
|
}
|
|
155
159
|
return target;
|
|
156
160
|
}
|
|
157
|
-
const
|
|
158
|
-
|
|
161
|
+
const we = (l, u)=>{
|
|
162
|
+
if (!u) return !0;
|
|
163
|
+
const i = document.createElement("input");
|
|
164
|
+
return i.type = u, i.value = l || "", i.value !== "";
|
|
165
|
+
}, Ue = (param)=>{
|
|
166
|
+
let { Icon: l, className: u, onPress: i, disabled: h, "aria-label": m } = param;
|
|
167
|
+
return(/**
|
|
168
|
+
* If we try to add fieldEndIconContainer styles to the BaseIconButton instead,
|
|
169
|
+
* there may be collisions because that component sets margin internally. We
|
|
170
|
+
* create a wrapper around it so that the margin's value won't be overrided.
|
|
171
|
+
*/ /* @__PURE__ */ (0, _jsxruntime.jsx)("div", {
|
|
172
|
+
className: _textfieldbasecssmistica.fieldEndIconContainer,
|
|
173
|
+
children: /* @__PURE__ */ (0, _jsxruntime.jsx)(_iconbutton.BaseIconButton, {
|
|
174
|
+
disabled: h,
|
|
175
|
+
"aria-label": m,
|
|
176
|
+
onPress: i,
|
|
177
|
+
size: _textfieldbasecssmistica.iconButtonSize,
|
|
178
|
+
className: u,
|
|
179
|
+
children: /* @__PURE__ */ (0, _jsxruntime.jsx)(l, {
|
|
180
|
+
size: _textfieldbasecssmistica.iconSize
|
|
181
|
+
})
|
|
182
|
+
})
|
|
183
|
+
}));
|
|
184
|
+
}, F = /*#__PURE__*/ _react.forwardRef((_param, Z)=>{
|
|
185
|
+
var { error: l, helperText: u, label: i, inputProps: h, inputRef: m, defaultValue: s, value: r, onFocus: S, onBlur: x, inputComponent: g, prefix: y, startIcon: t, endIcon: f, endIconOverlay: p, shrinkLabel: P, multiline: L = !1, focus: b, fieldRef: J, maxLength: C, id: Q, autoComplete: U, fullWidth: X, dataAttributes: Y } = _param, a = _object_without_properties(_param, [
|
|
159
186
|
"error",
|
|
160
187
|
"helperText",
|
|
161
188
|
"label",
|
|
@@ -177,182 +204,190 @@ const W = /*#__PURE__*/ _react.forwardRef((_param, H)=>{
|
|
|
177
204
|
"maxLength",
|
|
178
205
|
"id",
|
|
179
206
|
"autoComplete",
|
|
180
|
-
"fullWidth"
|
|
207
|
+
"fullWidth",
|
|
208
|
+
"dataAttributes"
|
|
181
209
|
]);
|
|
182
210
|
var _ref;
|
|
183
|
-
const
|
|
211
|
+
const w = (0, _hooks.useAriaId)(Q), z = (0, _hooks.useAriaId)(), [d, c] = _react.useState(s != null && s.length || r != null && r.length ? "filled" : "default"), { isTabletOrSmaller: V } = (0, _hooks.useScreenSize)(), [B, D] = _react.useState((_ref = s == null ? void 0 : s.length) !== null && _ref !== void 0 ? _ref : 0), I = !!i || !a.required, E = a.type === "date" || a.type === "datetime-local" || a.type === "month", q = _react.useRef(void 0);
|
|
184
212
|
(0, _hooks.useIsomorphicLayoutEffect)(()=>{
|
|
185
|
-
(
|
|
186
|
-
|
|
187
|
-
f !== "focused" && t != null && t.length && (O(t.length), d("filled")), C && d("focused"), C === !1 && !(t != null && t.length) && d("default"), C === !1 && t != null && t.length && d("filled");
|
|
213
|
+
const e = E && !we(r, a.type) ? "" : r;
|
|
214
|
+
q.current !== r && E && !(e != null && e.length) && d === "filled" && b === void 0 && c("default"), q.current = r, d !== "focused" && e != null && e.length && (D(e.length), c("filled")), b && c("focused"), b === !1 && !(e != null && e.length) && c("default"), b === !1 && e != null && e.length && c("filled");
|
|
188
215
|
}, [
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
216
|
+
d,
|
|
217
|
+
r,
|
|
218
|
+
b,
|
|
219
|
+
E,
|
|
220
|
+
a.type
|
|
192
221
|
]), _react.useEffect(()=>{
|
|
193
|
-
|
|
222
|
+
a.autoFocus && c("focused");
|
|
194
223
|
}, [
|
|
195
|
-
|
|
224
|
+
a.autoFocus
|
|
196
225
|
]);
|
|
197
|
-
const
|
|
198
|
-
inputRef:
|
|
226
|
+
const ee = L ? "textarea" : "input", te = g ? {
|
|
227
|
+
inputRef: m
|
|
199
228
|
} : {
|
|
200
|
-
ref: (0, _common.combineRefs)(
|
|
201
|
-
},
|
|
202
|
-
maxLength:
|
|
203
|
-
autoComplete:
|
|
204
|
-
}),
|
|
205
|
-
left:
|
|
229
|
+
ref: (0, _common.combineRefs)(Z, m)
|
|
230
|
+
}, R = _object_spread(_object_spread_props(_object_spread({}, a), {
|
|
231
|
+
maxLength: C,
|
|
232
|
+
autoComplete: U
|
|
233
|
+
}), h), v = `calc(${_textfieldbasecssmistica.iconSize} + ${_textfieldbasecssmistica.fieldElementsGap}px)`, O = `calc(${_textfieldbasecssmistica.iconButtonSize} + ${_textfieldbasecssmistica.fieldElementsGap}px)`, ie = P || d === "focused" || d === "filled" ? V ? _textfieldcomponentscssmistica.LABEL_SCALE_MOBILE : _textfieldcomponentscssmistica.LABEL_SCALE_DESKTOP : 1, ne = {
|
|
234
|
+
left: `calc(${_textfieldbasecssmistica.fieldLeftPadding}px + ${t ? v : "0px"})`,
|
|
206
235
|
// shrinking means applying a scale transformation, so width will be proportionally reduced.
|
|
207
236
|
// Let's keep the original width.
|
|
208
|
-
width: `calc((
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
paddingLeft: h ? 0 : e ? 48 : 12
|
|
213
|
-
}), $ = r.type === "password" ? "Lucida Grande, Arial, sans-serif" : "inherit";
|
|
214
|
-
return /* @__PURE__ */ (0, _jsxruntime.jsxs)(_textfieldcomponents.FieldContainer, {
|
|
215
|
-
disabled: r.disabled,
|
|
237
|
+
width: `calc((100% - ${_textfieldbasecssmistica.fieldLeftPadding}px - ${t ? v : "0px"} - ${f || p ? O : `${_textfieldbasecssmistica.fieldRightPadding}px`}) / ${ie})`
|
|
238
|
+
}, re = a.type === "password" && B > 0 ? "Lucida Grande, Arial, sans-serif" : "inherit";
|
|
239
|
+
return /* @__PURE__ */ (0, _jsxruntime.jsx)(_textfieldcomponents.FieldContainer, {
|
|
240
|
+
disabled: a.disabled,
|
|
216
241
|
helperText: /* @__PURE__ */ (0, _jsxruntime.jsx)(_textfieldcomponents.HelperText, {
|
|
217
|
-
error:
|
|
218
|
-
leftText:
|
|
219
|
-
|
|
242
|
+
error: l,
|
|
243
|
+
leftText: u,
|
|
244
|
+
id: z,
|
|
245
|
+
rightText: L && C ? `${B}/${C}` : void 0
|
|
220
246
|
}),
|
|
221
|
-
multiline:
|
|
222
|
-
fullWidth:
|
|
223
|
-
fieldRef:
|
|
224
|
-
readOnly:
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
247
|
+
multiline: L,
|
|
248
|
+
fullWidth: X,
|
|
249
|
+
fieldRef: J,
|
|
250
|
+
readOnly: a.readOnly,
|
|
251
|
+
dataAttributes: Y,
|
|
252
|
+
children: /* @__PURE__ */ (0, _jsxruntime.jsxs)(_themevariantcontext.ThemeVariant, {
|
|
253
|
+
isInverse: !1,
|
|
254
|
+
children: [
|
|
255
|
+
t && /* @__PURE__ */ (0, _jsxruntime.jsx)("div", {
|
|
256
|
+
className: _textfieldbasecssmistica.startIcon,
|
|
257
|
+
children: t
|
|
258
|
+
}),
|
|
259
|
+
y && /* @__PURE__ */ (0, _jsxruntime.jsx)("div", {
|
|
260
|
+
className: (0, _classnames.default)(_textfieldbasecssmistica.prefix, I ? _textfieldbasecssmistica.inputWithLabel : _textfieldbasecssmistica.inputWithoutLabel),
|
|
261
|
+
style: {
|
|
262
|
+
opacity: d === "default" ? 0 : 1
|
|
263
|
+
},
|
|
264
|
+
children: /* @__PURE__ */ (0, _jsxruntime.jsx)(_text.Text3, {
|
|
265
|
+
color: _skincontractcssmistica.vars.colors.textSecondary,
|
|
266
|
+
regular: !0,
|
|
267
|
+
wordBreak: !1,
|
|
268
|
+
children: y
|
|
269
|
+
})
|
|
270
|
+
}),
|
|
271
|
+
/* @__PURE__ */ (0, _jsxruntime.jsx)("div", {
|
|
272
|
+
className: _textfieldbasecssmistica.fullWidth,
|
|
273
|
+
children: /* @__PURE__ */ (0, _jsxruntime.jsx)(_text.Text3, {
|
|
274
|
+
as: "div",
|
|
275
|
+
regular: !0,
|
|
276
|
+
children: /*#__PURE__*/ _react.createElement(g || ee, _object_spread(_object_spread_props(_object_spread({}, te, R), {
|
|
277
|
+
id: w,
|
|
278
|
+
style: _object_spread_props(_object_spread({
|
|
279
|
+
paddingRight: f ? 0 : p ? `calc(${_textfieldbasecssmistica.fieldRightPadding}px + ${O})` : _textfieldbasecssmistica.fieldRightPadding,
|
|
280
|
+
paddingLeft: y ? 0 : t ? `calc(${v} + ${_textfieldbasecssmistica.fieldLeftPadding}px)` : _textfieldbasecssmistica.fieldLeftPadding
|
|
281
|
+
}, R.style), {
|
|
282
|
+
fontFamily: re
|
|
283
|
+
}),
|
|
284
|
+
className: L ? (0, _classnames.default)(_textfieldbasecssmistica.textArea, I ? _textfieldbasecssmistica.textAreaWithLabel : _textfieldbasecssmistica.textAreaWithoutLabel) : (0, _classnames.default)(_textfieldbasecssmistica.input, I ? _textfieldbasecssmistica.inputWithLabel : _textfieldbasecssmistica.inputWithoutLabel, {
|
|
285
|
+
[_textfieldbasecssmistica.inputFirefoxStyles]: (0, _platform.isFirefox)(),
|
|
286
|
+
// Hide webkit placeholder when label is not shrinked and value is empty
|
|
287
|
+
[_textfieldbasecssmistica.hiddenDatePlaceholder]: E && d === "default",
|
|
288
|
+
// Force height of input when value is empty to avoid field from having height 0 in iOS
|
|
289
|
+
[_textfieldbasecssmistica.emptyDateValue]: E && d !== "filled"
|
|
290
|
+
}),
|
|
291
|
+
onFocus: (e)=>{
|
|
292
|
+
c("focused"), S == null || S(e);
|
|
293
|
+
},
|
|
294
|
+
onBlur: (e)=>{
|
|
295
|
+
e.target.value.length > 0 ? c("filled") : c("default"), x == null || x(e);
|
|
296
|
+
},
|
|
297
|
+
onChange: (e)=>{
|
|
298
|
+
var _;
|
|
299
|
+
C === void 0 || e.target.value.length <= C ? (D(e.target.value.length), e.target.value.length > 0 && d !== "focused" && c(e.target.value.length > 0 ? "filled" : "default"), (_ = R.onChange) == null || _.call(R, e)) : (e.stopPropagation(), e.preventDefault());
|
|
300
|
+
},
|
|
301
|
+
defaultValue: s,
|
|
302
|
+
value: r
|
|
303
|
+
}), l && {
|
|
304
|
+
"aria-invalid": !0
|
|
305
|
+
}, u && {
|
|
306
|
+
"aria-describedby": z
|
|
307
|
+
}))
|
|
308
|
+
})
|
|
309
|
+
}),
|
|
310
|
+
i && /* @__PURE__ */ (0, _jsxruntime.jsx)(_textfieldcomponents.Label, {
|
|
311
|
+
style: ne,
|
|
312
|
+
error: l,
|
|
313
|
+
forId: w,
|
|
314
|
+
inputState: d,
|
|
315
|
+
shrinkLabel: P,
|
|
316
|
+
optional: !a.required,
|
|
317
|
+
children: i
|
|
318
|
+
}),
|
|
319
|
+
f && /* @__PURE__ */ (0, _jsxruntime.jsx)("div", {
|
|
320
|
+
className: _textfieldbasecssmistica.endIconContainer,
|
|
321
|
+
children: f
|
|
322
|
+
}),
|
|
323
|
+
p
|
|
324
|
+
]
|
|
325
|
+
})
|
|
291
326
|
});
|
|
292
|
-
}),
|
|
293
|
-
var { getSuggestions:
|
|
327
|
+
}), ze = /*#__PURE__*/ _react.lazy(()=>Promise.resolve().then(()=>/*#__PURE__*/ _interop_require_wildcard(require(/* webpackChunkName: "react-autosuggest" */ "react-autosuggest")))), Xe = /*#__PURE__*/ _react.forwardRef((_param, h)=>{
|
|
328
|
+
var { getSuggestions: l, id: u } = _param, i = _object_without_properties(_param, [
|
|
294
329
|
"getSuggestions",
|
|
295
330
|
"id"
|
|
296
331
|
]);
|
|
297
|
-
const [
|
|
298
|
-
if (
|
|
299
|
-
return
|
|
300
|
-
fallback: /* @__PURE__ */ (0, _jsxruntime.jsx)(
|
|
301
|
-
label: (0, _platform.isRunningAcceptanceTest)(
|
|
332
|
+
const [m, s] = _react.useState([]), r = _react.useRef(null), { platformOverrides: S, texts: x } = (0, _hooks.useTheme)(), g = (0, _hooks.useAriaId)(u), y = (0, _hooks.useAriaId)();
|
|
333
|
+
if (l && (i.value === void 0 || i.defaultValue !== void 0)) throw Error("Fields with suggestions must be used in controlled mode");
|
|
334
|
+
return l ? /* @__PURE__ */ (0, _jsxruntime.jsx)(_react.Suspense, {
|
|
335
|
+
fallback: /* @__PURE__ */ (0, _jsxruntime.jsx)(F, _object_spread_props(_object_spread({}, i), {
|
|
336
|
+
label: (0, _platform.isRunningAcceptanceTest)(S) ? "" : i.label,
|
|
302
337
|
autoComplete: "off",
|
|
303
|
-
ref:
|
|
338
|
+
ref: h,
|
|
304
339
|
id: g
|
|
305
340
|
})),
|
|
306
|
-
children: /* @__PURE__ */ (0, _jsxruntime.jsx)(
|
|
307
|
-
id:
|
|
308
|
-
inputProps: _object_spread_props(_object_spread({},
|
|
341
|
+
children: /* @__PURE__ */ (0, _jsxruntime.jsx)(ze, {
|
|
342
|
+
id: y,
|
|
343
|
+
inputProps: _object_spread_props(_object_spread({}, i), {
|
|
309
344
|
id: g,
|
|
310
345
|
autoComplete: "off",
|
|
311
346
|
// @ts-expect-error Autosuggest expects slightly different types
|
|
312
|
-
onChange: (
|
|
313
|
-
let { newValue:
|
|
314
|
-
var
|
|
315
|
-
|
|
316
|
-
value:
|
|
317
|
-
}),
|
|
318
|
-
value:
|
|
319
|
-
}), (
|
|
347
|
+
onChange: (t, param)=>{
|
|
348
|
+
let { newValue: f } = param;
|
|
349
|
+
var p;
|
|
350
|
+
t.target = _object_spread_props(_object_spread({}, t.target), {
|
|
351
|
+
value: f
|
|
352
|
+
}), t.currentTarget = _object_spread_props(_object_spread({}, t.currentTarget), {
|
|
353
|
+
value: f
|
|
354
|
+
}), (p = i.onChange) == null || p.call(i, t);
|
|
320
355
|
}
|
|
321
356
|
}),
|
|
322
|
-
renderInputComponent: (
|
|
323
|
-
inputRef: (0, _common.combineRefs)(
|
|
357
|
+
renderInputComponent: (t)=>/* @__PURE__ */ (0, _jsxruntime.jsx)(F, _object_spread_props(_object_spread({}, t), {
|
|
358
|
+
inputRef: (0, _common.combineRefs)(r, i.inputRef, h)
|
|
324
359
|
})),
|
|
325
|
-
suggestions:
|
|
360
|
+
suggestions: m,
|
|
326
361
|
onSuggestionsFetchRequested: (param)=>{
|
|
327
|
-
let { value:
|
|
328
|
-
return
|
|
362
|
+
let { value: t } = param;
|
|
363
|
+
return s(l(t));
|
|
329
364
|
},
|
|
330
|
-
onSuggestionsClearRequested: ()=>
|
|
331
|
-
getSuggestionValue: (
|
|
332
|
-
renderSuggestion: (
|
|
333
|
-
let { isHighlighted:
|
|
365
|
+
onSuggestionsClearRequested: ()=>s([]),
|
|
366
|
+
getSuggestionValue: (t)=>t,
|
|
367
|
+
renderSuggestion: (t, param)=>{
|
|
368
|
+
let { isHighlighted: f } = param;
|
|
334
369
|
return /* @__PURE__ */ (0, _jsxruntime.jsx)("div", {
|
|
335
370
|
role: "menuitem",
|
|
336
371
|
className: (0, _classnames.default)(_textfieldbasecssmistica.menuItem, {
|
|
337
|
-
[_textfieldbasecssmistica.menuItemSelected]:
|
|
372
|
+
[_textfieldbasecssmistica.menuItemSelected]: f
|
|
338
373
|
}),
|
|
339
374
|
children: /* @__PURE__ */ (0, _jsxruntime.jsx)(_text.Text3, {
|
|
340
375
|
regular: !0,
|
|
341
|
-
children:
|
|
376
|
+
children: t
|
|
342
377
|
})
|
|
343
378
|
});
|
|
344
379
|
},
|
|
345
|
-
renderSuggestionsContainer: (
|
|
380
|
+
renderSuggestionsContainer: (t)=>/* @__PURE__ */ (0, _jsxruntime.jsx)("div", _object_spread_props(_object_spread({}, t.containerProps), {
|
|
346
381
|
style: {
|
|
347
|
-
width:
|
|
382
|
+
width: r.current ? r.current.clientWidth + 2 : 0
|
|
348
383
|
},
|
|
349
384
|
className: _textfieldbasecssmistica.suggestionsContainer,
|
|
350
|
-
"aria-label": `${
|
|
351
|
-
children:
|
|
385
|
+
"aria-label": `${i.label} ${x.menuLabelSuffix}`,
|
|
386
|
+
children: t.children
|
|
352
387
|
}))
|
|
353
388
|
})
|
|
354
|
-
}) : /* @__PURE__ */ (0, _jsxruntime.jsx)(
|
|
389
|
+
}) : /* @__PURE__ */ (0, _jsxruntime.jsx)(F, _object_spread_props(_object_spread({}, i), {
|
|
355
390
|
id: g,
|
|
356
|
-
ref:
|
|
391
|
+
ref: h
|
|
357
392
|
}));
|
|
358
393
|
});
|