@telefonica/mistica 10.14.2 → 10.18.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.
- package/CHANGELOG.md +34 -0
- package/dist/button.js +16 -26
- package/dist/card.d.ts +10 -1
- package/dist/card.js +4 -1
- package/dist/card.js.flow +16 -1
- package/dist/checkbox.js +11 -7
- package/dist/credit-card-expiration-field.js +2 -7
- package/dist/credit-card-number-field.js +2 -2
- package/dist/cvv-field.js +2 -2
- package/dist/date-field.js +2 -2
- package/dist/date-time-field.js +2 -2
- package/dist/date-time-picker.js +12 -6
- package/dist/decimal-field.js +2 -7
- package/dist/email-field.js +2 -7
- package/dist/feedback.js +5 -8
- package/dist/iban-field.js +2 -7
- package/dist/image.d.ts +25 -4
- package/dist/image.js +64 -7
- package/dist/image.js.flow +30 -4
- package/dist/index.d.ts +3 -1
- package/dist/index.js +20 -0
- package/dist/index.js.flow +3 -1
- package/dist/integer-field.js +2 -7
- package/dist/list.d.ts +1 -0
- package/dist/list.js +63 -26
- package/dist/list.js.flow +1 -0
- package/dist/menu.d.ts +1 -1
- package/dist/menu.js +34 -27
- package/dist/menu.js.flow +1 -1
- package/dist/month-field.js +2 -2
- package/dist/package-version.js +1 -1
- package/dist/password-field.js +2 -2
- package/dist/phone-number-field.js +2 -7
- package/dist/radio-button.js +13 -9
- package/dist/search-field.js +2 -2
- package/dist/select.js +7 -18
- package/dist/skins/blau.js +0 -24
- package/dist/skins/movistar.js +0 -23
- package/dist/skins/o2-classic.js +0 -24
- package/dist/skins/o2.js +0 -23
- package/dist/skins/types.d.ts +0 -12
- package/dist/skins/types.js.flow +0 -12
- package/dist/skins/vivo.js +0 -23
- package/dist/switch-component.js +12 -9
- package/dist/text-field-base.d.ts +3 -2
- package/dist/text-field-base.js +15 -33
- package/dist/text-field-base.js.flow +6 -2
- package/dist/text-field-components.d.ts +0 -1
- package/dist/text-field-components.js +8 -15
- package/dist/text-field-components.js.flow +0 -1
- package/dist/text-field.d.ts +2 -1
- package/dist/text-field.js +10 -16
- package/dist/text-field.js.flow +5 -1
- package/dist/text-link.d.ts +1 -0
- package/dist/text-link.js +16 -9
- package/dist/text-link.js.flow +1 -0
- package/dist/touchable.js +2 -3
- package/dist/video.d.ts +32 -0
- package/dist/video.js +161 -0
- package/dist/video.js.flow +50 -0
- package/dist-es/button.js +16 -26
- package/dist-es/card.js +4 -1
- package/dist-es/checkbox.js +11 -7
- package/dist-es/credit-card-expiration-field.js +2 -2
- package/dist-es/credit-card-number-field.js +2 -2
- package/dist-es/cvv-field.js +2 -2
- package/dist-es/date-field.js +2 -2
- package/dist-es/date-time-field.js +2 -2
- package/dist-es/date-time-picker.js +12 -6
- package/dist-es/decimal-field.js +2 -2
- package/dist-es/email-field.js +2 -2
- package/dist-es/feedback.js +5 -8
- package/dist-es/iban-field.js +2 -2
- package/dist-es/image.js +38 -6
- package/dist-es/index.js +3 -1
- package/dist-es/integer-field.js +2 -2
- package/dist-es/list.js +63 -26
- package/dist-es/menu.js +35 -28
- package/dist-es/month-field.js +2 -2
- package/dist-es/package-version.js +1 -1
- package/dist-es/password-field.js +2 -2
- package/dist-es/phone-number-field.js +2 -2
- package/dist-es/radio-button.js +13 -9
- package/dist-es/search-field.js +2 -2
- package/dist-es/select.js +7 -18
- package/dist-es/skins/blau.js +0 -24
- package/dist-es/skins/movistar.js +0 -23
- package/dist-es/skins/o2-classic.js +0 -24
- package/dist-es/skins/o2.js +0 -23
- package/dist-es/skins/vivo.js +0 -23
- package/dist-es/switch-component.js +12 -9
- package/dist-es/text-field-base.js +15 -32
- package/dist-es/text-field-components.js +8 -15
- package/dist-es/text-field.js +9 -12
- package/dist-es/text-link.js +14 -8
- package/dist-es/touchable.js +2 -3
- package/dist-es/video.js +123 -0
- package/package.json +2 -2
package/dist/skins/types.js.flow
CHANGED
|
@@ -31,22 +31,17 @@ export type Colors = {
|
|
|
31
31
|
borderDark: string,
|
|
32
32
|
borderSelected: string,
|
|
33
33
|
buttonDangerBackground: string,
|
|
34
|
-
buttonDangerBackgroundDisabled: string,
|
|
35
34
|
buttonDangerBackgroundSelected: string,
|
|
36
35
|
buttonDangerBackgroundHover: string,
|
|
37
36
|
buttonLinkBackgroundSelected: string,
|
|
38
37
|
buttonLinkBackgroundSelectedInverse: string,
|
|
39
38
|
buttonPrimaryBackground: string,
|
|
40
|
-
buttonPrimaryBackgroundDisabled: string,
|
|
41
|
-
buttonPrimaryBackgroundDisabledInverse: string,
|
|
42
39
|
buttonPrimaryBackgroundInverse: string,
|
|
43
40
|
buttonPrimaryBackgroundSelected: string,
|
|
44
41
|
buttonPrimaryBackgroundSelectedInverse: string,
|
|
45
42
|
buttonPrimaryBackgroundHover: string,
|
|
46
43
|
buttonSecondaryBackground: string,
|
|
47
|
-
buttonSecondaryBackgroundDisabled: string,
|
|
48
44
|
buttonSecondaryBackgroundSelected: string,
|
|
49
|
-
buttonSecondaryBorderDisabledInverse: string,
|
|
50
45
|
buttonSecondaryBorderInverse: string,
|
|
51
46
|
buttonSecondaryBorderSelectedInverse: string,
|
|
52
47
|
control: string,
|
|
@@ -78,24 +73,17 @@ export type Colors = {
|
|
|
78
73
|
textPrimaryInverse: string,
|
|
79
74
|
textSecondary: string,
|
|
80
75
|
textSecondaryInverse: string,
|
|
81
|
-
textDisabled: string,
|
|
82
76
|
textAmount: string,
|
|
83
77
|
textButtonPrimary: string,
|
|
84
|
-
textButtonPrimaryDisabled: string,
|
|
85
78
|
textButtonPrimaryInverse: string,
|
|
86
|
-
textButtonPrimaryInverseDisabled: string,
|
|
87
79
|
textButtonPrimaryInverseSelected: string,
|
|
88
80
|
textButtonSecondary: string,
|
|
89
|
-
textButtonSecondaryDisabled: string,
|
|
90
81
|
textButtonSecondarySelected: string,
|
|
91
82
|
textButtonSecondaryInverse: string,
|
|
92
|
-
textButtonSecondaryInverseDisabled: string,
|
|
93
83
|
textButtonSecondaryInverseSelected: string,
|
|
94
84
|
textLink: string,
|
|
95
85
|
textLinkInverse: string,
|
|
96
86
|
textLinkDanger: string,
|
|
97
|
-
textLinkDangerDisabled: string,
|
|
98
|
-
textLinkDisabled: string,
|
|
99
87
|
textLinkSnackbar: string,
|
|
100
88
|
textNavigationBarPrimary: string,
|
|
101
89
|
textNavigationBarSecondary: string,
|
package/dist/skins/vivo.js
CHANGED
|
@@ -60,40 +60,29 @@ var getVivoSkin = function getVivoSkin() {
|
|
|
60
60
|
borderSelected: palette.vivoPurple,
|
|
61
61
|
// BUTTONS
|
|
62
62
|
buttonDangerBackground: palette.pepper,
|
|
63
|
-
buttonDangerBackgroundDisabled: palette.pepperLight30,
|
|
64
63
|
buttonDangerBackgroundSelected: palette.pepperDark,
|
|
65
64
|
buttonDangerBackgroundHover: palette.pepperDark,
|
|
66
65
|
buttonLinkBackgroundSelected: palette.vivoPurpleLight10,
|
|
67
66
|
buttonLinkBackgroundSelectedInverse: (0, _color).applyAlpha(palette.white, 0.2),
|
|
68
67
|
buttonPrimaryBackground: palette.vivoPurple,
|
|
69
|
-
buttonPrimaryBackgroundDisabled: palette.vivoPurpleLight20,
|
|
70
|
-
buttonPrimaryBackgroundDisabledInverse: palette.vivoPurpleLight50,
|
|
71
68
|
buttonPrimaryBackgroundInverse: palette.white,
|
|
72
69
|
buttonPrimaryBackgroundSelected: palette.vivoPurpleDark,
|
|
73
70
|
buttonPrimaryBackgroundHover: palette.vivoPurpleDark,
|
|
74
71
|
buttonPrimaryBackgroundSelectedInverse: palette.vivoPurpleLight50,
|
|
75
72
|
buttonSecondaryBackground: palette.vivoPurple,
|
|
76
|
-
buttonSecondaryBackgroundDisabled: palette.vivoPurpleLight20,
|
|
77
73
|
buttonSecondaryBackgroundSelected: palette.vivoPurpleDark,
|
|
78
|
-
buttonSecondaryBorderDisabledInverse: palette.vivoPurpleLight50,
|
|
79
74
|
buttonSecondaryBorderInverse: palette.white,
|
|
80
75
|
buttonSecondaryBorderSelectedInverse: palette.vivoPurpleLight50,
|
|
81
76
|
textButtonPrimary: palette.white,
|
|
82
|
-
textButtonPrimaryDisabled: palette.white,
|
|
83
77
|
textButtonPrimaryInverse: palette.vivoPurple,
|
|
84
|
-
textButtonPrimaryInverseDisabled: palette.vivoPurpleLight20,
|
|
85
78
|
textButtonPrimaryInverseSelected: palette.vivoPurple,
|
|
86
79
|
textButtonSecondary: palette.vivoPurple,
|
|
87
|
-
textButtonSecondaryDisabled: palette.vivoPurpleLight20,
|
|
88
80
|
textButtonSecondarySelected: palette.vivoPurpleDark,
|
|
89
81
|
textButtonSecondaryInverse: palette.white,
|
|
90
|
-
textButtonSecondaryInverseDisabled: palette.vivoPurpleLight50,
|
|
91
82
|
textButtonSecondaryInverseSelected: palette.white,
|
|
92
83
|
textLink: palette.vivoPurple,
|
|
93
84
|
textLinkInverse: palette.white,
|
|
94
85
|
textLinkDanger: palette.pepper,
|
|
95
|
-
textLinkDangerDisabled: palette.pepperLight30,
|
|
96
|
-
textLinkDisabled: palette.vivoPurpleLight50,
|
|
97
86
|
textLinkSnackbar: palette.vivoPurpleLight50,
|
|
98
87
|
// CONTROLS
|
|
99
88
|
control: palette.grey3,
|
|
@@ -127,7 +116,6 @@ var getVivoSkin = function getVivoSkin() {
|
|
|
127
116
|
textPrimaryInverse: palette.white,
|
|
128
117
|
textSecondary: palette.grey5,
|
|
129
118
|
textSecondaryInverse: palette.white,
|
|
130
|
-
textDisabled: palette.grey4,
|
|
131
119
|
textAmount: palette.vivoPurple,
|
|
132
120
|
// STATES
|
|
133
121
|
error: palette.pepper,
|
|
@@ -157,36 +145,26 @@ var getVivoSkin = function getVivoSkin() {
|
|
|
157
145
|
border: palette.darkModeGrey,
|
|
158
146
|
borderDark: palette.grey5,
|
|
159
147
|
borderSelected: palette.vivoPurpleLight80,
|
|
160
|
-
buttonDangerBackgroundDisabled: (0, _color).applyAlpha(palette.white, 0.05),
|
|
161
148
|
buttonLinkBackgroundSelected: (0, _color).applyAlpha(palette.white, 0.05),
|
|
162
149
|
buttonLinkBackgroundSelectedInverse: (0, _color).applyAlpha(palette.white, 0.05),
|
|
163
150
|
buttonPrimaryBackground: palette.vivoPurpleLight80,
|
|
164
|
-
buttonPrimaryBackgroundDisabled: (0, _color).applyAlpha(palette.white, 0.05),
|
|
165
|
-
buttonPrimaryBackgroundDisabledInverse: (0, _color).applyAlpha(palette.white, 0.05),
|
|
166
151
|
buttonPrimaryBackgroundInverse: palette.vivoPurpleLight80,
|
|
167
152
|
buttonPrimaryBackgroundSelected: palette.vivoPurpleDark,
|
|
168
153
|
buttonPrimaryBackgroundHover: palette.vivoPurpleDark,
|
|
169
154
|
buttonPrimaryBackgroundSelectedInverse: palette.vivoPurpleDark,
|
|
170
155
|
buttonSecondaryBackground: palette.vivoPurpleLight80,
|
|
171
|
-
buttonSecondaryBackgroundDisabled: (0, _color).applyAlpha(palette.white, 0.05),
|
|
172
156
|
buttonSecondaryBackgroundSelected: palette.vivoPurpleDark,
|
|
173
|
-
buttonSecondaryBorderDisabledInverse: (0, _color).applyAlpha(palette.white, 0.05),
|
|
174
157
|
buttonSecondaryBorderInverse: palette.vivoPurpleLight80,
|
|
175
158
|
buttonSecondaryBorderSelectedInverse: palette.vivoPurpleDark,
|
|
176
159
|
textButtonPrimary: palette.grey2,
|
|
177
|
-
textButtonPrimaryDisabled: palette.grey5,
|
|
178
160
|
textButtonPrimaryInverse: palette.grey2,
|
|
179
|
-
textButtonPrimaryInverseDisabled: palette.grey5,
|
|
180
161
|
textButtonPrimaryInverseSelected: palette.grey2,
|
|
181
162
|
textButtonSecondary: palette.grey2,
|
|
182
|
-
textButtonSecondaryDisabled: palette.grey5,
|
|
183
163
|
textButtonSecondarySelected: palette.grey4,
|
|
184
164
|
textButtonSecondaryInverse: palette.grey2,
|
|
185
|
-
textButtonSecondaryInverseDisabled: palette.grey5,
|
|
186
165
|
textButtonSecondaryInverseSelected: palette.grey4,
|
|
187
166
|
textLink: palette.vivoPurpleLight50,
|
|
188
167
|
textLinkInverse: palette.vivoPurpleLight50,
|
|
189
|
-
textLinkDisabled: palette.darkModeGrey6,
|
|
190
168
|
control: palette.darkModeGrey6,
|
|
191
169
|
controlActivated: palette.vivoPurpleLight80,
|
|
192
170
|
loadingBar: palette.vivoPurpleLight80,
|
|
@@ -211,7 +189,6 @@ var getVivoSkin = function getVivoSkin() {
|
|
|
211
189
|
textPrimaryInverse: palette.grey2,
|
|
212
190
|
textSecondary: palette.grey4,
|
|
213
191
|
textSecondaryInverse: palette.grey4,
|
|
214
|
-
textDisabled: palette.grey5,
|
|
215
192
|
textAmount: palette.vivoPurpleLight50,
|
|
216
193
|
textNavigationBarPrimary: palette.grey2,
|
|
217
194
|
textNavigationBarSecondary: palette.grey4,
|
package/dist/switch-component.js
CHANGED
|
@@ -109,7 +109,8 @@ var useStyles = (0, _jss).createUseStyles(function(param) {
|
|
|
109
109
|
return {
|
|
110
110
|
checkbox: {
|
|
111
111
|
display: 'inline-block',
|
|
112
|
-
padding: isIos ? 0 : 4
|
|
112
|
+
padding: isIos ? 0 : 4,
|
|
113
|
+
cursor: 'pointer'
|
|
113
114
|
},
|
|
114
115
|
switchCheckboxContainer: {
|
|
115
116
|
position: 'relative',
|
|
@@ -119,7 +120,6 @@ var useStyles = (0, _jss).createUseStyles(function(param) {
|
|
|
119
120
|
switchCheckboxLabel: {
|
|
120
121
|
display: 'block',
|
|
121
122
|
overflow: 'hidden',
|
|
122
|
-
cursor: 'pointer',
|
|
123
123
|
borderRadius: 40,
|
|
124
124
|
'& > *': {
|
|
125
125
|
pointerEvents: 'none'
|
|
@@ -165,8 +165,8 @@ var useStyles = (0, _jss).createUseStyles(function(param) {
|
|
|
165
165
|
cursor: 'default'
|
|
166
166
|
},
|
|
167
167
|
disabled: {
|
|
168
|
-
|
|
169
|
-
|
|
168
|
+
cursor: 'default',
|
|
169
|
+
opacity: 0.5
|
|
170
170
|
}
|
|
171
171
|
};
|
|
172
172
|
});
|
|
@@ -212,7 +212,8 @@ var Switch = function Switch(props) {
|
|
|
212
212
|
}
|
|
213
213
|
};
|
|
214
214
|
var switchEl = /*#__PURE__*/ (0, _jsxRuntime).jsx("div", {
|
|
215
|
-
className: classes.checkbox,
|
|
215
|
+
className: (0, _classnames).default(classes.checkbox, _defineProperty({
|
|
216
|
+
}, classes.disabled, disabled)),
|
|
216
217
|
children: /*#__PURE__*/ (0, _jsxRuntime).jsx("div", {
|
|
217
218
|
className: classes.switchCheckboxContainer,
|
|
218
219
|
children: /*#__PURE__*/ (0, _jsxRuntime).jsxs("div", {
|
|
@@ -236,8 +237,7 @@ var Switch = function Switch(props) {
|
|
|
236
237
|
onKeyDown: disabled ? undefined : handleKeyDown,
|
|
237
238
|
tabIndex: disabled ? undefined : 0,
|
|
238
239
|
ref: focusableRef,
|
|
239
|
-
className:
|
|
240
|
-
}, classes.disabled, disabled)),
|
|
240
|
+
className: classes.container,
|
|
241
241
|
"aria-disabled": disabled,
|
|
242
242
|
"aria-labelledby": labelId
|
|
243
243
|
}, (0, _dom).getPrefixedDataAttributes(props.dataAttributes), {
|
|
@@ -248,11 +248,14 @@ var Switch = function Switch(props) {
|
|
|
248
248
|
alignItems: "center",
|
|
249
249
|
children: [
|
|
250
250
|
switchEl,
|
|
251
|
-
/*#__PURE__*/ (0, _jsxRuntime).jsx(_text.Text3, {
|
|
251
|
+
props.children && /*#__PURE__*/ (0, _jsxRuntime).jsx(_text.Text3, {
|
|
252
252
|
regular: true,
|
|
253
253
|
as: "div",
|
|
254
254
|
id: labelId,
|
|
255
|
-
children:
|
|
255
|
+
children: /*#__PURE__*/ (0, _jsxRuntime).jsx("span", {
|
|
256
|
+
className: disabled ? classes.disabled : '',
|
|
257
|
+
children: props.children
|
|
258
|
+
})
|
|
256
259
|
})
|
|
257
260
|
]
|
|
258
261
|
})
|
|
@@ -71,5 +71,6 @@ interface TextFieldBaseProps {
|
|
|
71
71
|
min?: string;
|
|
72
72
|
max?: string;
|
|
73
73
|
}
|
|
74
|
-
declare const TextFieldBase: React.ForwardRefExoticComponent<TextFieldBaseProps & React.RefAttributes<any>>;
|
|
75
|
-
export
|
|
74
|
+
export declare const TextFieldBase: React.ForwardRefExoticComponent<TextFieldBaseProps & React.RefAttributes<any>>;
|
|
75
|
+
export declare const TextFieldBaseAutosuggest: React.ForwardRefExoticComponent<TextFieldBaseProps & React.RefAttributes<any>>;
|
|
76
|
+
export {};
|
package/dist/text-field-base.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", {
|
|
3
3
|
value: true
|
|
4
4
|
});
|
|
5
|
-
exports.
|
|
5
|
+
exports.TextFieldBase = exports.TextFieldBaseAutosuggest = void 0;
|
|
6
6
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
7
7
|
var React = _interopRequireWildcard(require("react"));
|
|
8
8
|
var _jss = require("./jss");
|
|
@@ -171,10 +171,6 @@ var commonInputStyles = function commonInputStyles(theme) {
|
|
|
171
171
|
opacity: 0.5
|
|
172
172
|
}
|
|
173
173
|
},
|
|
174
|
-
'&:disabled': {
|
|
175
|
-
color: theme.colors.textDisabled,
|
|
176
|
-
cursor: 'not-allowed'
|
|
177
|
-
},
|
|
178
174
|
boxShadow: 'none'
|
|
179
175
|
};
|
|
180
176
|
};
|
|
@@ -288,11 +284,7 @@ var useStyles = (0, _jss).createUseStyles(function(theme) {
|
|
|
288
284
|
paddingRight: 16,
|
|
289
285
|
display: 'flex',
|
|
290
286
|
alignItems: 'center',
|
|
291
|
-
alignSelf: 'center'
|
|
292
|
-
opacity: function opacity(param) {
|
|
293
|
-
var disabled = param.disabled;
|
|
294
|
-
return disabled ? 0.3 : 1;
|
|
295
|
-
}
|
|
287
|
+
alignSelf: 'center'
|
|
296
288
|
},
|
|
297
289
|
startIcon: {
|
|
298
290
|
pointerEvents: 'none',
|
|
@@ -301,11 +293,7 @@ var useStyles = (0, _jss).createUseStyles(function(theme) {
|
|
|
301
293
|
display: 'flex',
|
|
302
294
|
alignItems: 'center',
|
|
303
295
|
height: '100%',
|
|
304
|
-
position: 'absolute'
|
|
305
|
-
opacity: function opacity(param) {
|
|
306
|
-
var disabled = param.disabled;
|
|
307
|
-
return disabled ? 0.3 : 1;
|
|
308
|
-
}
|
|
296
|
+
position: 'absolute'
|
|
309
297
|
},
|
|
310
298
|
prefix: (_obj2 = {
|
|
311
299
|
alignSelf: 'baseline',
|
|
@@ -327,11 +315,7 @@ var useStyles = (0, _jss).createUseStyles(function(theme) {
|
|
|
327
315
|
}), _defineProperty(_obj2, "transition", 'opacity 150ms cubic-bezier(0.0, 0, 0.2, 1) 0ms'), _obj2)
|
|
328
316
|
};
|
|
329
317
|
});
|
|
330
|
-
|
|
331
|
-
var fixAutoComplete = function fixAutoComplete(platformOverrides, autoComplete) {
|
|
332
|
-
return autoComplete === 'off' && (0, _platform).isChrome(platformOverrides) ? 'nope' : autoComplete;
|
|
333
|
-
};
|
|
334
|
-
var TextFieldBaseComponent = /*#__PURE__*/ React.forwardRef(function(_param, ref) {
|
|
318
|
+
var TextFieldBase = /*#__PURE__*/ React.forwardRef(function(_param, ref) {
|
|
335
319
|
var error = _param.error, helperText = _param.helperText, label = _param.label, inputProps = _param.inputProps, inputRef = _param.inputRef, defaultValue = _param.defaultValue, value = _param.value, onFocus = _param.onFocus, onBlur = _param.onBlur, inputComponent = _param.inputComponent, prefix = _param.prefix, startIcon = _param.startIcon, endIcon = _param.endIcon, endIconOverlay = _param.endIconOverlay, shrinkLabelProp = _param.shrinkLabel, _multiline = _param.multiline, multiline = _multiline === void 0 ? false : _multiline, focus = _param.focus, fieldRef = _param.fieldRef, maxLength = _param.maxLength, idProp = _param.id, autoCompleteProp = _param.autoComplete, fullWidth = _param.fullWidth, rest = _objectWithoutProperties(_param, [
|
|
336
320
|
"error",
|
|
337
321
|
"helperText",
|
|
@@ -358,7 +342,7 @@ var TextFieldBaseComponent = /*#__PURE__*/ React.forwardRef(function(_param, ref
|
|
|
358
342
|
]);
|
|
359
343
|
var id = (0, _hooks).useAriaId(idProp);
|
|
360
344
|
var ref1 = _slicedToArray(React.useState((defaultValue === null || defaultValue === void 0 ? void 0 : defaultValue.length) || (value === null || value === void 0 ? void 0 : value.length) ? 'filled' : 'default'), 2), inputState = ref1[0], setInputState = ref1[1];
|
|
361
|
-
var ref2 = (0, _hooks).useTheme(),
|
|
345
|
+
var ref2 = (0, _hooks).useTheme(), colors = ref2.colors;
|
|
362
346
|
var ref3 = (0, _hooks).useScreenSize(), isTabletOrSmaller = ref3.isTabletOrSmaller;
|
|
363
347
|
var ref4;
|
|
364
348
|
var ref5 = _slicedToArray(React.useState((ref4 = defaultValue === null || defaultValue === void 0 ? void 0 : defaultValue.length) !== null && ref4 !== void 0 ? ref4 : 0), 2), characterCount = ref5[0], setCharacterCount = ref5[1];
|
|
@@ -415,7 +399,7 @@ var TextFieldBaseComponent = /*#__PURE__*/ React.forwardRef(function(_param, ref
|
|
|
415
399
|
var props = _objectSpread({
|
|
416
400
|
}, rest, {
|
|
417
401
|
maxLength: maxLength,
|
|
418
|
-
autoComplete:
|
|
402
|
+
autoComplete: autoCompleteProp
|
|
419
403
|
}, inputProps);
|
|
420
404
|
var isShrinked = shrinkLabel || inputState === 'focused' || inputState === 'filled';
|
|
421
405
|
var scale = isShrinked ? isTabletOrSmaller ? _textFieldComponents.LABEL_SCALE_MOBILE : _textFieldComponents.LABEL_SCALE_DESKTOP : 1;
|
|
@@ -426,7 +410,6 @@ var TextFieldBaseComponent = /*#__PURE__*/ React.forwardRef(function(_param, ref
|
|
|
426
410
|
width: "calc(((100% - ".concat(_textFieldComponents.LABEL_LEFT_POSITION + (startIcon ? 48 : _textFieldComponents.LABEL_LEFT_POSITION), "px)) / ").concat(scale, ")"),
|
|
427
411
|
paddingRight: endIcon && !isShrinked ? 36 : 0
|
|
428
412
|
};
|
|
429
|
-
var prefixColor = rest.disabled ? colors.textDisabled : colors.textSecondary;
|
|
430
413
|
return(/*#__PURE__*/ (0, _jsxRuntime).jsxs(_textFieldComponents.FieldContainer, {
|
|
431
414
|
disabled: rest.disabled,
|
|
432
415
|
helperText: /*#__PURE__*/ (0, _jsxRuntime).jsx(_textFieldComponents.HelperText, {
|
|
@@ -445,7 +428,7 @@ var TextFieldBaseComponent = /*#__PURE__*/ React.forwardRef(function(_param, ref
|
|
|
445
428
|
prefix && /*#__PURE__*/ (0, _jsxRuntime).jsx("div", {
|
|
446
429
|
className: classes.prefix,
|
|
447
430
|
children: /*#__PURE__*/ (0, _jsxRuntime).jsx(_text.Text3, {
|
|
448
|
-
color:
|
|
431
|
+
color: colors.textSecondary,
|
|
449
432
|
regular: true,
|
|
450
433
|
children: prefix
|
|
451
434
|
})
|
|
@@ -495,7 +478,6 @@ var TextFieldBaseComponent = /*#__PURE__*/ React.forwardRef(function(_param, ref
|
|
|
495
478
|
forId: id,
|
|
496
479
|
inputState: inputState,
|
|
497
480
|
shrinkLabel: shrinkLabel,
|
|
498
|
-
disabled: rest.disabled,
|
|
499
481
|
optional: !rest.required,
|
|
500
482
|
children: label
|
|
501
483
|
}),
|
|
@@ -507,6 +489,7 @@ var TextFieldBaseComponent = /*#__PURE__*/ React.forwardRef(function(_param, ref
|
|
|
507
489
|
]
|
|
508
490
|
}));
|
|
509
491
|
});
|
|
492
|
+
exports.TextFieldBase = TextFieldBase;
|
|
510
493
|
var useSuggestionsStyles = (0, _jss).createUseStyles(function() {
|
|
511
494
|
return {
|
|
512
495
|
menuItem: {
|
|
@@ -541,7 +524,7 @@ var Autosuggest = /*#__PURE__*/ React.lazy(function() {
|
|
|
541
524
|
return _interopRequireWildcard(require(/* webpackChunkName: "react-autosuggest" */ 'react-autosuggest'));
|
|
542
525
|
});
|
|
543
526
|
});
|
|
544
|
-
var
|
|
527
|
+
var TextFieldBaseAutosuggest = /*#__PURE__*/ React.forwardRef(function(_param, ref) {
|
|
545
528
|
var getSuggestions = _param.getSuggestions, idProp = _param.id, props = _objectWithoutProperties(_param, [
|
|
546
529
|
"getSuggestions",
|
|
547
530
|
"id"
|
|
@@ -556,13 +539,13 @@ var TextFieldBase = /*#__PURE__*/ React.forwardRef(function(_param, ref) {
|
|
|
556
539
|
throw Error('Fields with suggestions must be used in controlled mode');
|
|
557
540
|
}
|
|
558
541
|
return getSuggestions ? /*#__PURE__*/ (0, _jsxRuntime).jsx(React.Suspense, {
|
|
559
|
-
fallback: /*#__PURE__*/ (0, _jsxRuntime).jsx(
|
|
542
|
+
fallback: /*#__PURE__*/ (0, _jsxRuntime).jsx(TextFieldBase, _objectSpread({
|
|
560
543
|
}, props, {
|
|
561
544
|
// This label override while loading is needed in acceptance tests because
|
|
562
545
|
// while the test is typing, the component could be remounted.
|
|
563
546
|
// By hiding the label, we ensure that the test selects the loaded component
|
|
564
547
|
label: (0, _platform).isRunningAcceptanceTest(platformOverrides) ? '' : props.label,
|
|
565
|
-
autoComplete:
|
|
548
|
+
autoComplete: "off",
|
|
566
549
|
ref: ref,
|
|
567
550
|
id: id
|
|
568
551
|
})),
|
|
@@ -571,7 +554,7 @@ var TextFieldBase = /*#__PURE__*/ React.forwardRef(function(_param, ref) {
|
|
|
571
554
|
inputProps: _objectSpread({
|
|
572
555
|
}, props, {
|
|
573
556
|
id: id,
|
|
574
|
-
autoComplete:
|
|
557
|
+
autoComplete: 'off',
|
|
575
558
|
// @ts-expect-error Autosuggest expects slightly different types
|
|
576
559
|
onChange: function onChange(e, param) {
|
|
577
560
|
var newValue = param.newValue;
|
|
@@ -589,7 +572,7 @@ var TextFieldBase = /*#__PURE__*/ React.forwardRef(function(_param, ref) {
|
|
|
589
572
|
}
|
|
590
573
|
}),
|
|
591
574
|
renderInputComponent: function renderInputComponent(inputProps) {
|
|
592
|
-
/*#__PURE__*/ return (0, _jsxRuntime).jsx(
|
|
575
|
+
/*#__PURE__*/ return (0, _jsxRuntime).jsx(TextFieldBase, _objectSpread({
|
|
593
576
|
}, inputProps, {
|
|
594
577
|
inputRef: (0, _common).combineRefs(inputRef, props.inputRef, ref)
|
|
595
578
|
}));
|
|
@@ -629,11 +612,10 @@ var TextFieldBase = /*#__PURE__*/ React.forwardRef(function(_param, ref) {
|
|
|
629
612
|
}));
|
|
630
613
|
}
|
|
631
614
|
})
|
|
632
|
-
}) : /*#__PURE__*/ (0, _jsxRuntime).jsx(
|
|
615
|
+
}) : /*#__PURE__*/ (0, _jsxRuntime).jsx(TextFieldBase, _objectSpread({
|
|
633
616
|
}, props, {
|
|
634
617
|
id: id,
|
|
635
618
|
ref: ref
|
|
636
619
|
}));
|
|
637
620
|
});
|
|
638
|
-
|
|
639
|
-
exports.default = _default;
|
|
621
|
+
exports.TextFieldBaseAutosuggest = TextFieldBaseAutosuggest;
|
|
@@ -97,10 +97,14 @@ declare type TextFieldBaseProps = {
|
|
|
97
97
|
min?: string,
|
|
98
98
|
max?: string,
|
|
99
99
|
};
|
|
100
|
-
declare var TextFieldBase: React.ComponentType<{
|
|
100
|
+
declare export var TextFieldBase: React.ComponentType<{
|
|
101
101
|
...TextFieldBaseProps,
|
|
102
102
|
...{},
|
|
103
103
|
}>;
|
|
104
|
-
declare export
|
|
104
|
+
declare export var TextFieldBaseAutosuggest: React.ComponentType<{
|
|
105
|
+
...TextFieldBaseProps,
|
|
106
|
+
...{},
|
|
107
|
+
}>;
|
|
108
|
+
declare export {};
|
|
105
109
|
|
|
106
110
|
import { type CssStyle } from "./__types__.js.flow";
|
|
@@ -123,10 +123,7 @@ var useLabelStyles = (0, _jss).createUseStyles(function(theme) {
|
|
|
123
123
|
fontSize: 18,
|
|
124
124
|
lineHeight: '24px',
|
|
125
125
|
color: function color(param) {
|
|
126
|
-
var inputState = param.inputState, error = param.error
|
|
127
|
-
if (inputState === 'default' && disabled) {
|
|
128
|
-
return theme.colors.textDisabled;
|
|
129
|
-
}
|
|
126
|
+
var inputState = param.inputState, error = param.error;
|
|
130
127
|
if (error && inputState !== 'default') {
|
|
131
128
|
return theme.colors.error;
|
|
132
129
|
}
|
|
@@ -162,13 +159,11 @@ var useLabelStyles = (0, _jss).createUseStyles(function(theme) {
|
|
|
162
159
|
};
|
|
163
160
|
});
|
|
164
161
|
var Label = function Label(param) {
|
|
165
|
-
var shrinkLabel = param.shrinkLabel, forId = param.forId, inputState = param.inputState, error = param.error, children = param.children,
|
|
162
|
+
var shrinkLabel = param.shrinkLabel, forId = param.forId, inputState = param.inputState, error = param.error, children = param.children, style = param.style, optional = param.optional;
|
|
166
163
|
var isShrinked = shrinkLabel || inputState === 'focused' || inputState === 'filled';
|
|
167
164
|
var classes = useLabelStyles({
|
|
168
|
-
isShrinked: isShrinked,
|
|
169
165
|
inputState: inputState,
|
|
170
|
-
error: error
|
|
171
|
-
disabled: disabled
|
|
166
|
+
error: error
|
|
172
167
|
});
|
|
173
168
|
var ref = _slicedToArray(React.useState(''), 2), transitionStyle = ref[0], setTransitionStyle = ref[1];
|
|
174
169
|
var ref1 = (0, _hooks).useTheme(), texts = ref1.texts;
|
|
@@ -264,6 +259,10 @@ var _obj1, _obj2;
|
|
|
264
259
|
var useFieldContainerStyles = (0, _jss).createUseStyles(function(theme) {
|
|
265
260
|
return {
|
|
266
261
|
fieldContainer: (_obj1 = {
|
|
262
|
+
opacity: function opacity(param) {
|
|
263
|
+
var disabled = param.disabled;
|
|
264
|
+
return disabled ? 0.5 : 1;
|
|
265
|
+
},
|
|
267
266
|
display: 'flex',
|
|
268
267
|
flexDirection: 'column',
|
|
269
268
|
minWidth: 96
|
|
@@ -288,13 +287,7 @@ var useFieldContainerStyles = (0, _jss).createUseStyles(function(theme) {
|
|
|
288
287
|
var multiline = param.multiline;
|
|
289
288
|
return multiline ? 152 : 56;
|
|
290
289
|
}
|
|
291
|
-
}), _defineProperty(_obj2, "display", 'flex'), _defineProperty(_obj2, "position", 'relative'), _defineProperty(_obj2, "backgroundColor",
|
|
292
|
-
var disabled = param.disabled;
|
|
293
|
-
return disabled ? theme.colors.backgroundAlternative : theme.colors.backgroundContainer;
|
|
294
|
-
}), _defineProperty(_obj2, "cursor", function(param) {
|
|
295
|
-
var disabled = param.disabled;
|
|
296
|
-
return disabled ? 'not-allowed' : 'initial';
|
|
297
|
-
}), _obj2)
|
|
290
|
+
}), _defineProperty(_obj2, "display", 'flex'), _defineProperty(_obj2, "position", 'relative'), _defineProperty(_obj2, "backgroundColor", theme.colors.backgroundContainer), _obj2)
|
|
298
291
|
};
|
|
299
292
|
});
|
|
300
293
|
var FieldContainer = function FieldContainer(param) {
|
package/dist/text-field.d.ts
CHANGED
|
@@ -2,10 +2,11 @@ import * as React from 'react';
|
|
|
2
2
|
import type { CommonFormFieldProps } from './text-field-base';
|
|
3
3
|
export interface TextFieldProps extends CommonFormFieldProps {
|
|
4
4
|
onChangeValue?: (value: string, rawValue: string) => void;
|
|
5
|
+
onPress?: (event: React.MouseEvent) => void;
|
|
5
6
|
multiline?: boolean;
|
|
6
7
|
prefix?: React.ReactNode;
|
|
7
8
|
endIcon?: React.ReactNode;
|
|
8
9
|
getSuggestions?: (value: string) => Array<string>;
|
|
9
10
|
}
|
|
10
|
-
declare const TextField: React.
|
|
11
|
+
declare const TextField: React.ForwardRefExoticComponent<TextFieldProps & React.RefAttributes<HTMLInputElement>>;
|
|
11
12
|
export default TextField;
|
package/dist/text-field.js
CHANGED
|
@@ -6,12 +6,8 @@ exports.default = void 0;
|
|
|
6
6
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
7
7
|
var React = _interopRequireWildcard(require("react"));
|
|
8
8
|
var _formContext = require("./form-context");
|
|
9
|
-
var _textFieldBase =
|
|
10
|
-
|
|
11
|
-
return obj && obj.__esModule ? obj : {
|
|
12
|
-
default: obj
|
|
13
|
-
};
|
|
14
|
-
}
|
|
9
|
+
var _textFieldBase = require("./text-field-base");
|
|
10
|
+
var _common = require("./utils/common");
|
|
15
11
|
function _interopRequireWildcard(obj) {
|
|
16
12
|
if (obj && obj.__esModule) {
|
|
17
13
|
return obj;
|
|
@@ -95,8 +91,8 @@ function _objectWithoutPropertiesLoose(source, excluded) {
|
|
|
95
91
|
}
|
|
96
92
|
return target;
|
|
97
93
|
}
|
|
98
|
-
var TextField =
|
|
99
|
-
var disabled = _param.disabled, error = _param.error, helperText = _param.helperText, name = _param.name, optional = _param.optional, validate = _param.validate, onChangeValue = _param.onChangeValue, onChange = _param.onChange, value = _param.value, defaultValue = _param.defaultValue, onBlurProp = _param.onBlur, onFocusProp = _param.onFocus, rest = _objectWithoutProperties(_param, [
|
|
94
|
+
var TextField = /*#__PURE__*/ React.forwardRef(function(_param, ref) {
|
|
95
|
+
var disabled = _param.disabled, error = _param.error, helperText = _param.helperText, name = _param.name, optional = _param.optional, validate = _param.validate, onChangeValue = _param.onChangeValue, onChange = _param.onChange, value = _param.value, defaultValue = _param.defaultValue, onBlurProp = _param.onBlur, onFocusProp = _param.onFocus, onPress = _param.onPress, rest = _objectWithoutProperties(_param, [
|
|
100
96
|
"disabled",
|
|
101
97
|
"error",
|
|
102
98
|
"helperText",
|
|
@@ -108,7 +104,8 @@ var TextField = function TextField(_param) {
|
|
|
108
104
|
"value",
|
|
109
105
|
"defaultValue",
|
|
110
106
|
"onBlur",
|
|
111
|
-
"onFocus"
|
|
107
|
+
"onFocus",
|
|
108
|
+
"onPress"
|
|
112
109
|
]);
|
|
113
110
|
var inputRef = React.useRef(null);
|
|
114
111
|
var processValue = function processValue(v) {
|
|
@@ -150,16 +147,13 @@ var TextField = function TextField(_param) {
|
|
|
150
147
|
onChange: onChange,
|
|
151
148
|
onChangeValue: onChangeValue
|
|
152
149
|
});
|
|
153
|
-
|
|
154
|
-
inputRef.current = field;
|
|
155
|
-
fieldProps.inputRef(field);
|
|
156
|
-
};
|
|
157
|
-
return(/*#__PURE__*/ (0, _jsxRuntime).jsx(_textFieldBase.default, _objectSpread({
|
|
150
|
+
return(/*#__PURE__*/ (0, _jsxRuntime).jsx(_textFieldBase.TextFieldBaseAutosuggest, _objectSpread({
|
|
158
151
|
}, rest, fieldProps, {
|
|
159
|
-
|
|
152
|
+
onClick: onPress,
|
|
153
|
+
inputRef: (0, _common).combineRefs(inputRef, fieldProps.inputRef, ref),
|
|
160
154
|
onFocus: onFocus,
|
|
161
155
|
type: "text"
|
|
162
156
|
})));
|
|
163
|
-
};
|
|
157
|
+
});
|
|
164
158
|
var _default = TextField;
|
|
165
159
|
exports.default = _default;
|
package/dist/text-field.js.flow
CHANGED
|
@@ -6,10 +6,14 @@ export type TextFieldProps = {
|
|
|
6
6
|
...$Exact<CommonFormFieldProps>,
|
|
7
7
|
|
|
8
8
|
onChangeValue?: (value: string, rawValue: string) => void,
|
|
9
|
+
onPress?: (event: SyntheticMouseEvent<>) => void,
|
|
9
10
|
multiline?: boolean,
|
|
10
11
|
prefix?: React.Node,
|
|
11
12
|
endIcon?: React.Node,
|
|
12
13
|
getSuggestions?: (value: string) => Array<string>,
|
|
13
14
|
};
|
|
14
|
-
declare var TextField: React.ComponentType<
|
|
15
|
+
declare var TextField: React.ComponentType<{
|
|
16
|
+
...TextFieldProps,
|
|
17
|
+
ref?: React.Ref<HTMLInputElement>,
|
|
18
|
+
}>;
|
|
15
19
|
declare export default typeof TextField;
|
package/dist/text-link.d.ts
CHANGED
|
@@ -8,6 +8,7 @@ interface CommonProps {
|
|
|
8
8
|
[className: string]: string;
|
|
9
9
|
};
|
|
10
10
|
small?: boolean;
|
|
11
|
+
disabled?: boolean;
|
|
11
12
|
trackingEvent?: TrackingEvent | ReadonlyArray<TrackingEvent>;
|
|
12
13
|
/** "data-" prefix is automatically added. For example, use "testid" instead of "data-testid" */
|
|
13
14
|
dataAttributes?: DataAttributes;
|
package/dist/text-link.js
CHANGED
|
@@ -8,6 +8,7 @@ var _jss = require("./jss");
|
|
|
8
8
|
var _touchable = _interopRequireDefault(require("./touchable"));
|
|
9
9
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
10
10
|
var _themeVariantContext = require("./theme-variant-context");
|
|
11
|
+
var _formContext = require("./form-context");
|
|
11
12
|
function _interopRequireDefault(obj) {
|
|
12
13
|
return obj && obj.__esModule ? obj : {
|
|
13
14
|
default: obj
|
|
@@ -73,19 +74,22 @@ function _objectWithoutPropertiesLoose(source, excluded) {
|
|
|
73
74
|
}
|
|
74
75
|
return target;
|
|
75
76
|
}
|
|
77
|
+
var _obj;
|
|
76
78
|
var useStyles = (0, _jss).createUseStyles(function(theme) {
|
|
77
79
|
return {
|
|
78
|
-
textLink:
|
|
80
|
+
textLink: (_obj = {
|
|
79
81
|
width: 'auto',
|
|
80
82
|
lineHeight: 'inherit',
|
|
81
83
|
display: 'inline-block',
|
|
82
84
|
color: theme.colors.textLink,
|
|
83
85
|
wordBreak: 'break-word'
|
|
84
|
-
}, theme.mq.supportsHover, {
|
|
85
|
-
'&:hover': {
|
|
86
|
+
}, _defineProperty(_obj, theme.mq.supportsHover, {
|
|
87
|
+
'&:hover:not([disabled])': {
|
|
86
88
|
textDecoration: 'underline'
|
|
87
89
|
}
|
|
88
|
-
}),
|
|
90
|
+
}), _defineProperty(_obj, '&[disabled]', {
|
|
91
|
+
opacity: 0.5
|
|
92
|
+
}), _obj),
|
|
89
93
|
inverse: {
|
|
90
94
|
color: theme.colors.textLinkInverse
|
|
91
95
|
},
|
|
@@ -94,19 +98,22 @@ var useStyles = (0, _jss).createUseStyles(function(theme) {
|
|
|
94
98
|
}
|
|
95
99
|
};
|
|
96
100
|
});
|
|
97
|
-
var
|
|
101
|
+
var _obj1;
|
|
98
102
|
var TextLink = function TextLink(_param) {
|
|
99
|
-
var children = _param.children, _className = _param.className, className = _className === void 0 ? '' : _className, small = _param.small, props = _objectWithoutProperties(_param, [
|
|
103
|
+
var children = _param.children, _className = _param.className, className = _className === void 0 ? '' : _className, small = _param.small, disabled = _param.disabled, props = _objectWithoutProperties(_param, [
|
|
100
104
|
"children",
|
|
101
105
|
"className",
|
|
102
|
-
"small"
|
|
106
|
+
"small",
|
|
107
|
+
"disabled"
|
|
103
108
|
]);
|
|
104
109
|
var classes = useStyles();
|
|
105
110
|
var isInverse = (0, _themeVariantContext).useIsInverseVariant();
|
|
111
|
+
var ref = (0, _formContext).useForm(), formStatus = ref.formStatus;
|
|
106
112
|
return(/*#__PURE__*/ (0, _jsxRuntime).jsx(_touchable.default, _objectSpread({
|
|
107
113
|
}, props, {
|
|
108
|
-
|
|
109
|
-
|
|
114
|
+
disabled: disabled || formStatus === 'sending',
|
|
115
|
+
className: (0, _classnames).default(classes.textLink, className, (_obj1 = {
|
|
116
|
+
}, _defineProperty(_obj1, classes.small, small), _defineProperty(_obj1, classes.inverse, isInverse), _obj1)),
|
|
110
117
|
children: children
|
|
111
118
|
})));
|
|
112
119
|
};
|
package/dist/text-link.js.flow
CHANGED
package/dist/touchable.js
CHANGED
|
@@ -102,8 +102,7 @@ var useStyles = (0, _jss).createUseStyles(function() {
|
|
|
102
102
|
border: 'none'
|
|
103
103
|
},
|
|
104
104
|
'&[disabled]': {
|
|
105
|
-
cursor: '
|
|
106
|
-
pointerEvents: 'none'
|
|
105
|
+
cursor: 'default'
|
|
107
106
|
},
|
|
108
107
|
'&:active, &:hover': {
|
|
109
108
|
textDecoration: 'none'
|
|
@@ -207,7 +206,7 @@ var Touchable = /*#__PURE__*/ React.forwardRef(function(props, ref) {
|
|
|
207
206
|
"aria-labelledby": props['aria-labelledby'],
|
|
208
207
|
onClick: handleHrefClick,
|
|
209
208
|
onKeyDown: handleKeyDown,
|
|
210
|
-
href: props.disabled ?
|
|
209
|
+
href: props.disabled ? undefined : getHref(),
|
|
211
210
|
target: openNewTab ? '_blank' : undefined,
|
|
212
211
|
rel: openNewTab ? 'noopener noreferrer' : undefined,
|
|
213
212
|
ref: ref,
|