@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.
Files changed (86) hide show
  1. package/CHANGELOG.md +34 -0
  2. package/dist/button.js +16 -26
  3. package/dist/checkbox.js +11 -7
  4. package/dist/credit-card-expiration-field.js +2 -7
  5. package/dist/credit-card-number-field.js +2 -2
  6. package/dist/cvv-field.js +2 -2
  7. package/dist/date-field.js +2 -2
  8. package/dist/date-time-field.js +2 -2
  9. package/dist/date-time-picker.js +12 -6
  10. package/dist/decimal-field.js +2 -7
  11. package/dist/email-field.js +2 -7
  12. package/dist/feedback.js +5 -8
  13. package/dist/iban-field.js +2 -7
  14. package/dist/index.d.ts +2 -1
  15. package/dist/index.js +13 -0
  16. package/dist/index.js.flow +2 -1
  17. package/dist/integer-field.js +2 -7
  18. package/dist/list.d.ts +1 -0
  19. package/dist/list.js +63 -26
  20. package/dist/list.js.flow +1 -0
  21. package/dist/menu.d.ts +1 -1
  22. package/dist/menu.js +34 -27
  23. package/dist/menu.js.flow +1 -1
  24. package/dist/month-field.js +2 -2
  25. package/dist/package-version.js +1 -1
  26. package/dist/password-field.js +2 -2
  27. package/dist/phone-number-field.js +2 -7
  28. package/dist/radio-button.js +13 -9
  29. package/dist/search-field.js +2 -2
  30. package/dist/select.js +7 -18
  31. package/dist/skins/blau.js +0 -24
  32. package/dist/skins/movistar.js +0 -23
  33. package/dist/skins/o2-classic.js +0 -24
  34. package/dist/skins/o2.js +0 -23
  35. package/dist/skins/types.d.ts +0 -12
  36. package/dist/skins/types.js.flow +0 -12
  37. package/dist/skins/vivo.js +0 -23
  38. package/dist/switch-component.js +12 -9
  39. package/dist/text-field-base.d.ts +3 -2
  40. package/dist/text-field-base.js +15 -33
  41. package/dist/text-field-base.js.flow +6 -2
  42. package/dist/text-field-components.d.ts +0 -1
  43. package/dist/text-field-components.js +8 -15
  44. package/dist/text-field-components.js.flow +0 -1
  45. package/dist/text-field.d.ts +2 -1
  46. package/dist/text-field.js +10 -16
  47. package/dist/text-field.js.flow +5 -1
  48. package/dist/text-link.d.ts +1 -0
  49. package/dist/text-link.js +16 -9
  50. package/dist/text-link.js.flow +1 -0
  51. package/dist/touchable.js +2 -3
  52. package/dist-es/button.js +16 -26
  53. package/dist-es/checkbox.js +11 -7
  54. package/dist-es/credit-card-expiration-field.js +2 -2
  55. package/dist-es/credit-card-number-field.js +2 -2
  56. package/dist-es/cvv-field.js +2 -2
  57. package/dist-es/date-field.js +2 -2
  58. package/dist-es/date-time-field.js +2 -2
  59. package/dist-es/date-time-picker.js +12 -6
  60. package/dist-es/decimal-field.js +2 -2
  61. package/dist-es/email-field.js +2 -2
  62. package/dist-es/feedback.js +5 -8
  63. package/dist-es/iban-field.js +2 -2
  64. package/dist-es/index.js +2 -1
  65. package/dist-es/integer-field.js +2 -2
  66. package/dist-es/list.js +63 -26
  67. package/dist-es/menu.js +35 -28
  68. package/dist-es/month-field.js +2 -2
  69. package/dist-es/package-version.js +1 -1
  70. package/dist-es/password-field.js +2 -2
  71. package/dist-es/phone-number-field.js +2 -2
  72. package/dist-es/radio-button.js +13 -9
  73. package/dist-es/search-field.js +2 -2
  74. package/dist-es/select.js +7 -18
  75. package/dist-es/skins/blau.js +0 -24
  76. package/dist-es/skins/movistar.js +0 -23
  77. package/dist-es/skins/o2-classic.js +0 -24
  78. package/dist-es/skins/o2.js +0 -23
  79. package/dist-es/skins/vivo.js +0 -23
  80. package/dist-es/switch-component.js +12 -9
  81. package/dist-es/text-field-base.js +15 -32
  82. package/dist-es/text-field-components.js +8 -15
  83. package/dist-es/text-field.js +9 -12
  84. package/dist-es/text-link.js +14 -8
  85. package/dist-es/touchable.js +2 -3
  86. 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
- opacity: 0.5,
139
- pointerEvents: 'none'
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: classNames(classes.container, _defineProperty({
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: props.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, isChrome, isFirefox } from './utils/platform';
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
- // Chrome ignores 'off': https://bugs.chromium.org/p/chromium/issues/detail?id=468153#c164
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(), platformOverrides = ref2.platformOverrides, colors = ref2.colors;
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: fixAutoComplete(platformOverrides, autoCompleteProp)
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: prefixColor,
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 TextFieldBase = /*#__PURE__*/ React.forwardRef(function(_param, ref) {
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(TextFieldBaseComponent, _objectSpread({
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: fixAutoComplete(platformOverrides, 'off'),
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: fixAutoComplete(platformOverrides, 'off'),
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(TextFieldBaseComponent, _objectSpread({
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(TextFieldBaseComponent, _objectSpread({
555
+ }) : /*#__PURE__*/ _jsx(TextFieldBase, _objectSpread({
573
556
  }, props, {
574
557
  id: id,
575
558
  ref: ref
576
559
  }));
577
560
  });
578
- export default TextFieldBase;
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, disabled = param.disabled;
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, disabled = param.disabled, style = param.style, optional = param.optional;
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", function(param) {
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) {
@@ -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 TextFieldBase from './text-field-base';
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
- var setInputRef = function(field) {
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
- inputRef: setInputRef,
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;
@@ -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: _defineProperty({
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 _obj;
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
- className: classnames(classes.textLink, className, (_obj = {
94
- }, _defineProperty(_obj, classes.small, small), _defineProperty(_obj, classes.inverse, isInverse), _obj)),
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
  };
@@ -68,8 +68,7 @@ var useStyles = createUseStyles(function() {
68
68
  border: 'none'
69
69
  },
70
70
  '&[disabled]': {
71
- cursor: 'auto',
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 ? '' : getHref(),
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.14.1",
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.1",
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
- "@semantic-release/git",
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
  },