@telefonica/mistica 10.14.1 → 10.17.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/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/index.d.ts +2 -1
- package/dist/index.js +13 -0
- package/dist/index.js.flow +2 -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-es/button.js +16 -26
- 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/index.js +2 -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/package.json +12 -3
|
@@ -79,7 +79,8 @@ var useStyles = createUseStyles(function(param) {
|
|
|
79
79
|
return {
|
|
80
80
|
checkbox: {
|
|
81
81
|
display: 'inline-block',
|
|
82
|
-
padding: isIos ? 0 : 4
|
|
82
|
+
padding: isIos ? 0 : 4,
|
|
83
|
+
cursor: 'pointer'
|
|
83
84
|
},
|
|
84
85
|
switchCheckboxContainer: {
|
|
85
86
|
position: 'relative',
|
|
@@ -89,7 +90,6 @@ var useStyles = createUseStyles(function(param) {
|
|
|
89
90
|
switchCheckboxLabel: {
|
|
90
91
|
display: 'block',
|
|
91
92
|
overflow: 'hidden',
|
|
92
|
-
cursor: 'pointer',
|
|
93
93
|
borderRadius: 40,
|
|
94
94
|
'& > *': {
|
|
95
95
|
pointerEvents: 'none'
|
|
@@ -135,8 +135,8 @@ var useStyles = createUseStyles(function(param) {
|
|
|
135
135
|
cursor: 'default'
|
|
136
136
|
},
|
|
137
137
|
disabled: {
|
|
138
|
-
|
|
139
|
-
|
|
138
|
+
cursor: 'default',
|
|
139
|
+
opacity: 0.5
|
|
140
140
|
}
|
|
141
141
|
};
|
|
142
142
|
});
|
|
@@ -182,7 +182,8 @@ var Switch = function(props) {
|
|
|
182
182
|
}
|
|
183
183
|
};
|
|
184
184
|
var switchEl = /*#__PURE__*/ _jsx("div", {
|
|
185
|
-
className: classes.checkbox,
|
|
185
|
+
className: classNames(classes.checkbox, _defineProperty({
|
|
186
|
+
}, classes.disabled, disabled)),
|
|
186
187
|
children: /*#__PURE__*/ _jsx("div", {
|
|
187
188
|
className: classes.switchCheckboxContainer,
|
|
188
189
|
children: /*#__PURE__*/ _jsxs("div", {
|
|
@@ -207,8 +208,7 @@ var Switch = function(props) {
|
|
|
207
208
|
onKeyDown: disabled ? undefined : handleKeyDown,
|
|
208
209
|
tabIndex: disabled ? undefined : 0,
|
|
209
210
|
ref: focusableRef,
|
|
210
|
-
className:
|
|
211
|
-
}, classes.disabled, disabled)),
|
|
211
|
+
className: classes.container,
|
|
212
212
|
"aria-disabled": disabled,
|
|
213
213
|
"aria-labelledby": labelId
|
|
214
214
|
}, getPrefixedDataAttributes(props.dataAttributes), {
|
|
@@ -219,11 +219,14 @@ var Switch = function(props) {
|
|
|
219
219
|
alignItems: "center",
|
|
220
220
|
children: [
|
|
221
221
|
switchEl,
|
|
222
|
-
/*#__PURE__*/ _jsx(Text3, {
|
|
222
|
+
props.children && /*#__PURE__*/ _jsx(Text3, {
|
|
223
223
|
regular: true,
|
|
224
224
|
as: "div",
|
|
225
225
|
id: labelId,
|
|
226
|
-
children:
|
|
226
|
+
children: /*#__PURE__*/ _jsx("span", {
|
|
227
|
+
className: disabled ? classes.disabled : '',
|
|
228
|
+
children: props.children
|
|
229
|
+
})
|
|
227
230
|
})
|
|
228
231
|
]
|
|
229
232
|
})
|
|
@@ -3,7 +3,7 @@ import * as React from 'react';
|
|
|
3
3
|
import { createUseStyles } from './jss';
|
|
4
4
|
import { Label, HelperText, FieldContainer, LABEL_LEFT_POSITION, LABEL_SCALE_MOBILE, LABEL_SCALE_DESKTOP } from './text-field-components';
|
|
5
5
|
import { Text3 } from './text';
|
|
6
|
-
import { isIos, isRunningAcceptanceTest,
|
|
6
|
+
import { isIos, isRunningAcceptanceTest, isFirefox } from './utils/platform';
|
|
7
7
|
import { useAriaId, useTheme, useScreenSize } from './hooks';
|
|
8
8
|
import classNames from 'classnames';
|
|
9
9
|
import { combineRefs } from './utils/common';
|
|
@@ -137,10 +137,6 @@ var commonInputStyles = function(theme) {
|
|
|
137
137
|
opacity: 0.5
|
|
138
138
|
}
|
|
139
139
|
},
|
|
140
|
-
'&:disabled': {
|
|
141
|
-
color: theme.colors.textDisabled,
|
|
142
|
-
cursor: 'not-allowed'
|
|
143
|
-
},
|
|
144
140
|
boxShadow: 'none'
|
|
145
141
|
};
|
|
146
142
|
};
|
|
@@ -254,11 +250,7 @@ var useStyles = createUseStyles(function(theme) {
|
|
|
254
250
|
paddingRight: 16,
|
|
255
251
|
display: 'flex',
|
|
256
252
|
alignItems: 'center',
|
|
257
|
-
alignSelf: 'center'
|
|
258
|
-
opacity: function(param) {
|
|
259
|
-
var disabled = param.disabled;
|
|
260
|
-
return disabled ? 0.3 : 1;
|
|
261
|
-
}
|
|
253
|
+
alignSelf: 'center'
|
|
262
254
|
},
|
|
263
255
|
startIcon: {
|
|
264
256
|
pointerEvents: 'none',
|
|
@@ -267,11 +259,7 @@ var useStyles = createUseStyles(function(theme) {
|
|
|
267
259
|
display: 'flex',
|
|
268
260
|
alignItems: 'center',
|
|
269
261
|
height: '100%',
|
|
270
|
-
position: 'absolute'
|
|
271
|
-
opacity: function(param) {
|
|
272
|
-
var disabled = param.disabled;
|
|
273
|
-
return disabled ? 0.3 : 1;
|
|
274
|
-
}
|
|
262
|
+
position: 'absolute'
|
|
275
263
|
},
|
|
276
264
|
prefix: (_obj2 = {
|
|
277
265
|
alignSelf: 'baseline',
|
|
@@ -293,16 +281,12 @@ var useStyles = createUseStyles(function(theme) {
|
|
|
293
281
|
}), _defineProperty(_obj2, "transition", 'opacity 150ms cubic-bezier(0.0, 0, 0.2, 1) 0ms'), _obj2)
|
|
294
282
|
};
|
|
295
283
|
});
|
|
296
|
-
|
|
297
|
-
var fixAutoComplete = function(platformOverrides, autoComplete) {
|
|
298
|
-
return autoComplete === 'off' && isChrome(platformOverrides) ? 'nope' : autoComplete;
|
|
299
|
-
};
|
|
300
|
-
var TextFieldBaseComponent = /*#__PURE__*/ React.forwardRef(function(_param, ref) {
|
|
284
|
+
var TextFieldBase = /*#__PURE__*/ React.forwardRef(function(_param, ref) {
|
|
301
285
|
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, ["error", "helperText", "label", "inputProps", "inputRef", "defaultValue", "value", "onFocus", "onBlur", "inputComponent", "prefix", "startIcon", "endIcon", "endIconOverlay", "shrinkLabel", "multiline", "focus", "fieldRef", "maxLength", "id",
|
|
302
286
|
"autoComplete", "fullWidth"]);
|
|
303
287
|
var id = useAriaId(idProp);
|
|
304
288
|
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];
|
|
305
|
-
var ref2 = useTheme(),
|
|
289
|
+
var ref2 = useTheme(), colors = ref2.colors;
|
|
306
290
|
var ref3 = useScreenSize(), isTabletOrSmaller = ref3.isTabletOrSmaller;
|
|
307
291
|
var ref4;
|
|
308
292
|
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];
|
|
@@ -359,7 +343,7 @@ var TextFieldBaseComponent = /*#__PURE__*/ React.forwardRef(function(_param, ref
|
|
|
359
343
|
var props = _objectSpread({
|
|
360
344
|
}, rest, {
|
|
361
345
|
maxLength: maxLength,
|
|
362
|
-
autoComplete:
|
|
346
|
+
autoComplete: autoCompleteProp
|
|
363
347
|
}, inputProps);
|
|
364
348
|
var isShrinked = shrinkLabel || inputState === 'focused' || inputState === 'filled';
|
|
365
349
|
var scale = isShrinked ? isTabletOrSmaller ? LABEL_SCALE_MOBILE : LABEL_SCALE_DESKTOP : 1;
|
|
@@ -370,7 +354,6 @@ var TextFieldBaseComponent = /*#__PURE__*/ React.forwardRef(function(_param, ref
|
|
|
370
354
|
width: "calc(((100% - ".concat(LABEL_LEFT_POSITION + (startIcon ? 48 : LABEL_LEFT_POSITION), "px)) / ").concat(scale, ")"),
|
|
371
355
|
paddingRight: endIcon && !isShrinked ? 36 : 0
|
|
372
356
|
};
|
|
373
|
-
var prefixColor = rest.disabled ? colors.textDisabled : colors.textSecondary;
|
|
374
357
|
return(/*#__PURE__*/ _jsxs(FieldContainer, {
|
|
375
358
|
disabled: rest.disabled,
|
|
376
359
|
helperText: /*#__PURE__*/ _jsx(HelperText, {
|
|
@@ -389,7 +372,7 @@ var TextFieldBaseComponent = /*#__PURE__*/ React.forwardRef(function(_param, ref
|
|
|
389
372
|
prefix && /*#__PURE__*/ _jsx("div", {
|
|
390
373
|
className: classes.prefix,
|
|
391
374
|
children: /*#__PURE__*/ _jsx(Text3, {
|
|
392
|
-
color:
|
|
375
|
+
color: colors.textSecondary,
|
|
393
376
|
regular: true,
|
|
394
377
|
children: prefix
|
|
395
378
|
})
|
|
@@ -439,7 +422,6 @@ var TextFieldBaseComponent = /*#__PURE__*/ React.forwardRef(function(_param, ref
|
|
|
439
422
|
forId: id,
|
|
440
423
|
inputState: inputState,
|
|
441
424
|
shrinkLabel: shrinkLabel,
|
|
442
|
-
disabled: rest.disabled,
|
|
443
425
|
optional: !rest.required,
|
|
444
426
|
children: label
|
|
445
427
|
}),
|
|
@@ -451,6 +433,7 @@ var TextFieldBaseComponent = /*#__PURE__*/ React.forwardRef(function(_param, ref
|
|
|
451
433
|
]
|
|
452
434
|
}));
|
|
453
435
|
});
|
|
436
|
+
export { TextFieldBase };
|
|
454
437
|
var useSuggestionsStyles = createUseStyles(function() {
|
|
455
438
|
return {
|
|
456
439
|
menuItem: {
|
|
@@ -483,7 +466,7 @@ var useSuggestionsStyles = createUseStyles(function() {
|
|
|
483
466
|
var Autosuggest = /*#__PURE__*/ React.lazy(function() {
|
|
484
467
|
return import(/* webpackChunkName: "react-autosuggest" */ 'react-autosuggest');
|
|
485
468
|
});
|
|
486
|
-
var
|
|
469
|
+
var TextFieldBaseAutosuggest = /*#__PURE__*/ React.forwardRef(function(_param, ref) {
|
|
487
470
|
var getSuggestions = _param.getSuggestions, idProp = _param.id, props = _objectWithoutProperties(_param, ["getSuggestions", "id"
|
|
488
471
|
]);
|
|
489
472
|
var ref1 = _slicedToArray(React.useState([]), 2), suggestions = ref1[0], setSuggestions = ref1[1];
|
|
@@ -496,13 +479,13 @@ var TextFieldBase = /*#__PURE__*/ React.forwardRef(function(_param, ref) {
|
|
|
496
479
|
throw Error('Fields with suggestions must be used in controlled mode');
|
|
497
480
|
}
|
|
498
481
|
return getSuggestions ? /*#__PURE__*/ _jsx(React.Suspense, {
|
|
499
|
-
fallback: /*#__PURE__*/ _jsx(
|
|
482
|
+
fallback: /*#__PURE__*/ _jsx(TextFieldBase, _objectSpread({
|
|
500
483
|
}, props, {
|
|
501
484
|
// This label override while loading is needed in acceptance tests because
|
|
502
485
|
// while the test is typing, the component could be remounted.
|
|
503
486
|
// By hiding the label, we ensure that the test selects the loaded component
|
|
504
487
|
label: isRunningAcceptanceTest(platformOverrides) ? '' : props.label,
|
|
505
|
-
autoComplete:
|
|
488
|
+
autoComplete: "off",
|
|
506
489
|
ref: ref,
|
|
507
490
|
id: id
|
|
508
491
|
})),
|
|
@@ -511,7 +494,7 @@ var TextFieldBase = /*#__PURE__*/ React.forwardRef(function(_param, ref) {
|
|
|
511
494
|
inputProps: _objectSpread({
|
|
512
495
|
}, props, {
|
|
513
496
|
id: id,
|
|
514
|
-
autoComplete:
|
|
497
|
+
autoComplete: 'off',
|
|
515
498
|
// @ts-expect-error Autosuggest expects slightly different types
|
|
516
499
|
onChange: function(e, param) {
|
|
517
500
|
var newValue = param.newValue;
|
|
@@ -529,7 +512,7 @@ var TextFieldBase = /*#__PURE__*/ React.forwardRef(function(_param, ref) {
|
|
|
529
512
|
}
|
|
530
513
|
}),
|
|
531
514
|
renderInputComponent: function(inputProps) {
|
|
532
|
-
/*#__PURE__*/ return _jsx(
|
|
515
|
+
/*#__PURE__*/ return _jsx(TextFieldBase, _objectSpread({
|
|
533
516
|
}, inputProps, {
|
|
534
517
|
inputRef: combineRefs(inputRef, props.inputRef, ref)
|
|
535
518
|
}));
|
|
@@ -569,10 +552,10 @@ var TextFieldBase = /*#__PURE__*/ React.forwardRef(function(_param, ref) {
|
|
|
569
552
|
}));
|
|
570
553
|
}
|
|
571
554
|
})
|
|
572
|
-
}) : /*#__PURE__*/ _jsx(
|
|
555
|
+
}) : /*#__PURE__*/ _jsx(TextFieldBase, _objectSpread({
|
|
573
556
|
}, props, {
|
|
574
557
|
id: id,
|
|
575
558
|
ref: ref
|
|
576
559
|
}));
|
|
577
560
|
});
|
|
578
|
-
export
|
|
561
|
+
export { TextFieldBaseAutosuggest };
|
|
@@ -86,10 +86,7 @@ var useLabelStyles = createUseStyles(function(theme) {
|
|
|
86
86
|
fontSize: 18,
|
|
87
87
|
lineHeight: '24px',
|
|
88
88
|
color: function(param) {
|
|
89
|
-
var inputState = param.inputState, error = param.error
|
|
90
|
-
if (inputState === 'default' && disabled) {
|
|
91
|
-
return theme.colors.textDisabled;
|
|
92
|
-
}
|
|
89
|
+
var inputState = param.inputState, error = param.error;
|
|
93
90
|
if (error && inputState !== 'default') {
|
|
94
91
|
return theme.colors.error;
|
|
95
92
|
}
|
|
@@ -125,13 +122,11 @@ var useLabelStyles = createUseStyles(function(theme) {
|
|
|
125
122
|
};
|
|
126
123
|
});
|
|
127
124
|
export var Label = function(param) {
|
|
128
|
-
var shrinkLabel = param.shrinkLabel, forId = param.forId, inputState = param.inputState, error = param.error, children = param.children,
|
|
125
|
+
var shrinkLabel = param.shrinkLabel, forId = param.forId, inputState = param.inputState, error = param.error, children = param.children, style = param.style, optional = param.optional;
|
|
129
126
|
var isShrinked = shrinkLabel || inputState === 'focused' || inputState === 'filled';
|
|
130
127
|
var classes = useLabelStyles({
|
|
131
|
-
isShrinked: isShrinked,
|
|
132
128
|
inputState: inputState,
|
|
133
|
-
error: error
|
|
134
|
-
disabled: disabled
|
|
129
|
+
error: error
|
|
135
130
|
});
|
|
136
131
|
var ref = _slicedToArray(React.useState(''), 2), transitionStyle = ref[0], setTransitionStyle = ref[1];
|
|
137
132
|
var ref1 = useTheme(), texts = ref1.texts;
|
|
@@ -225,6 +220,10 @@ var _obj1, _obj2;
|
|
|
225
220
|
var useFieldContainerStyles = createUseStyles(function(theme) {
|
|
226
221
|
return {
|
|
227
222
|
fieldContainer: (_obj1 = {
|
|
223
|
+
opacity: function(param) {
|
|
224
|
+
var disabled = param.disabled;
|
|
225
|
+
return disabled ? 0.5 : 1;
|
|
226
|
+
},
|
|
228
227
|
display: 'flex',
|
|
229
228
|
flexDirection: 'column',
|
|
230
229
|
minWidth: 96
|
|
@@ -249,13 +248,7 @@ var useFieldContainerStyles = createUseStyles(function(theme) {
|
|
|
249
248
|
var multiline = param.multiline;
|
|
250
249
|
return multiline ? 152 : 56;
|
|
251
250
|
}
|
|
252
|
-
}), _defineProperty(_obj2, "display", 'flex'), _defineProperty(_obj2, "position", 'relative'), _defineProperty(_obj2, "backgroundColor",
|
|
253
|
-
var disabled = param.disabled;
|
|
254
|
-
return disabled ? theme.colors.backgroundAlternative : theme.colors.backgroundContainer;
|
|
255
|
-
}), _defineProperty(_obj2, "cursor", function(param) {
|
|
256
|
-
var disabled = param.disabled;
|
|
257
|
-
return disabled ? 'not-allowed' : 'initial';
|
|
258
|
-
}), _obj2)
|
|
251
|
+
}), _defineProperty(_obj2, "display", 'flex'), _defineProperty(_obj2, "position", 'relative'), _defineProperty(_obj2, "backgroundColor", theme.colors.backgroundContainer), _obj2)
|
|
259
252
|
};
|
|
260
253
|
});
|
|
261
254
|
export var FieldContainer = function(param) {
|
package/dist-es/text-field.js
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
import { useFieldProps } from './form-context';
|
|
4
|
-
import
|
|
4
|
+
import { TextFieldBaseAutosuggest } from './text-field-base';
|
|
5
|
+
import { combineRefs } from './utils/common';
|
|
5
6
|
function _defineProperty(obj, key, value) {
|
|
6
7
|
if (key in obj) {
|
|
7
8
|
Object.defineProperty(obj, key, {
|
|
@@ -61,10 +62,9 @@ function _objectWithoutPropertiesLoose(source, excluded) {
|
|
|
61
62
|
}
|
|
62
63
|
return target;
|
|
63
64
|
}
|
|
64
|
-
var TextField = function(_param) {
|
|
65
|
-
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, ["disabled", "error", "helperText", "name", "optional", "validate", "onChangeValue", "onChange", "value", "defaultValue", "onBlur",
|
|
66
|
-
"onFocus"
|
|
67
|
-
]);
|
|
65
|
+
var TextField = /*#__PURE__*/ React.forwardRef(function(_param, ref) {
|
|
66
|
+
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, ["disabled", "error", "helperText", "name", "optional", "validate", "onChangeValue", "onChange", "value", "defaultValue", "onBlur",
|
|
67
|
+
"onFocus", "onPress"]);
|
|
68
68
|
var inputRef = React.useRef(null);
|
|
69
69
|
var processValue = function(v) {
|
|
70
70
|
return v;
|
|
@@ -105,15 +105,12 @@ var TextField = function(_param) {
|
|
|
105
105
|
onChange: onChange,
|
|
106
106
|
onChangeValue: onChangeValue
|
|
107
107
|
});
|
|
108
|
-
|
|
109
|
-
inputRef.current = field;
|
|
110
|
-
fieldProps.inputRef(field);
|
|
111
|
-
};
|
|
112
|
-
return(/*#__PURE__*/ _jsx(TextFieldBase, _objectSpread({
|
|
108
|
+
return(/*#__PURE__*/ _jsx(TextFieldBaseAutosuggest, _objectSpread({
|
|
113
109
|
}, rest, fieldProps, {
|
|
114
|
-
|
|
110
|
+
onClick: onPress,
|
|
111
|
+
inputRef: combineRefs(inputRef, fieldProps.inputRef, ref),
|
|
115
112
|
onFocus: onFocus,
|
|
116
113
|
type: "text"
|
|
117
114
|
})));
|
|
118
|
-
};
|
|
115
|
+
});
|
|
119
116
|
export default TextField;
|
package/dist-es/text-link.js
CHANGED
|
@@ -3,6 +3,7 @@ import { createUseStyles } from './jss';
|
|
|
3
3
|
import Touchable from './touchable';
|
|
4
4
|
import classnames from 'classnames';
|
|
5
5
|
import { useIsInverseVariant } from './theme-variant-context';
|
|
6
|
+
import { useForm } from './form-context';
|
|
6
7
|
function _defineProperty(obj, key, value) {
|
|
7
8
|
if (key in obj) {
|
|
8
9
|
Object.defineProperty(obj, key, {
|
|
@@ -62,19 +63,22 @@ function _objectWithoutPropertiesLoose(source, excluded) {
|
|
|
62
63
|
}
|
|
63
64
|
return target;
|
|
64
65
|
}
|
|
66
|
+
var _obj;
|
|
65
67
|
var useStyles = createUseStyles(function(theme) {
|
|
66
68
|
return {
|
|
67
|
-
textLink:
|
|
69
|
+
textLink: (_obj = {
|
|
68
70
|
width: 'auto',
|
|
69
71
|
lineHeight: 'inherit',
|
|
70
72
|
display: 'inline-block',
|
|
71
73
|
color: theme.colors.textLink,
|
|
72
74
|
wordBreak: 'break-word'
|
|
73
|
-
}, theme.mq.supportsHover, {
|
|
74
|
-
'&:hover': {
|
|
75
|
+
}, _defineProperty(_obj, theme.mq.supportsHover, {
|
|
76
|
+
'&:hover:not([disabled])': {
|
|
75
77
|
textDecoration: 'underline'
|
|
76
78
|
}
|
|
77
|
-
}),
|
|
79
|
+
}), _defineProperty(_obj, '&[disabled]', {
|
|
80
|
+
opacity: 0.5
|
|
81
|
+
}), _obj),
|
|
78
82
|
inverse: {
|
|
79
83
|
color: theme.colors.textLinkInverse
|
|
80
84
|
},
|
|
@@ -83,15 +87,17 @@ var useStyles = createUseStyles(function(theme) {
|
|
|
83
87
|
}
|
|
84
88
|
};
|
|
85
89
|
});
|
|
86
|
-
var
|
|
90
|
+
var _obj1;
|
|
87
91
|
var TextLink = function(_param) {
|
|
88
|
-
var children = _param.children, _className = _param.className, className = _className === void 0 ? '' : _className, small = _param.small, props = _objectWithoutProperties(_param, ["children", "className", "small"]);
|
|
92
|
+
var children = _param.children, _className = _param.className, className = _className === void 0 ? '' : _className, small = _param.small, disabled = _param.disabled, props = _objectWithoutProperties(_param, ["children", "className", "small", "disabled"]);
|
|
89
93
|
var classes = useStyles();
|
|
90
94
|
var isInverse = useIsInverseVariant();
|
|
95
|
+
var ref = useForm(), formStatus = ref.formStatus;
|
|
91
96
|
return(/*#__PURE__*/ _jsx(Touchable, _objectSpread({
|
|
92
97
|
}, props, {
|
|
93
|
-
|
|
94
|
-
|
|
98
|
+
disabled: disabled || formStatus === 'sending',
|
|
99
|
+
className: classnames(classes.textLink, className, (_obj1 = {
|
|
100
|
+
}, _defineProperty(_obj1, classes.small, small), _defineProperty(_obj1, classes.inverse, isInverse), _obj1)),
|
|
95
101
|
children: children
|
|
96
102
|
})));
|
|
97
103
|
};
|
package/dist-es/touchable.js
CHANGED
|
@@ -68,8 +68,7 @@ var useStyles = createUseStyles(function() {
|
|
|
68
68
|
border: 'none'
|
|
69
69
|
},
|
|
70
70
|
'&[disabled]': {
|
|
71
|
-
cursor: '
|
|
72
|
-
pointerEvents: 'none'
|
|
71
|
+
cursor: 'default'
|
|
73
72
|
},
|
|
74
73
|
'&:active, &:hover': {
|
|
75
74
|
textDecoration: 'none'
|
|
@@ -173,7 +172,7 @@ var Touchable = /*#__PURE__*/ React.forwardRef(function(props, ref) {
|
|
|
173
172
|
"aria-labelledby": props['aria-labelledby'],
|
|
174
173
|
onClick: handleHrefClick,
|
|
175
174
|
onKeyDown: handleKeyDown,
|
|
176
|
-
href: props.disabled ?
|
|
175
|
+
href: props.disabled ? undefined : getHref(),
|
|
177
176
|
target: openNewTab ? '_blank' : undefined,
|
|
178
177
|
rel: openNewTab ? 'noopener noreferrer' : undefined,
|
|
179
178
|
ref: ref,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@telefonica/mistica",
|
|
3
|
-
"version": "10.
|
|
3
|
+
"version": "10.17.0",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -76,7 +76,7 @@
|
|
|
76
76
|
"@swc/core": "^1.2.93",
|
|
77
77
|
"@swc/jest": "^0.2.4",
|
|
78
78
|
"@telefonica/acceptance-testing": "^2.5.0",
|
|
79
|
-
"@telefonica/eslint-config": "^1.0.
|
|
79
|
+
"@telefonica/eslint-config": "^1.0.2",
|
|
80
80
|
"@telefonica/prettier-config": "^1.1.0",
|
|
81
81
|
"@telefonica/ts-to-flow": "1.1.5",
|
|
82
82
|
"@testing-library/jest-dom": "^5.12.0",
|
|
@@ -163,7 +163,16 @@
|
|
|
163
163
|
"@semantic-release/changelog",
|
|
164
164
|
"./scripts/set-version.js",
|
|
165
165
|
"@semantic-release/npm",
|
|
166
|
-
|
|
166
|
+
[
|
|
167
|
+
"@semantic-release/git",
|
|
168
|
+
{
|
|
169
|
+
"assets": [
|
|
170
|
+
"CHANGELOG.md",
|
|
171
|
+
"package.json",
|
|
172
|
+
"src/package-version.tsx"
|
|
173
|
+
]
|
|
174
|
+
}
|
|
175
|
+
],
|
|
167
176
|
"@semantic-release/github"
|
|
168
177
|
]
|
|
169
178
|
},
|