@telefonica/mistica 10.1.0 → 10.2.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 CHANGED
@@ -1,3 +1,17 @@
1
+ # [10.2.0](https://github.com/Telefonica/mistica-web/compare/v10.1.0...v10.2.0) (2021-09-21)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * **form fields:** change disabled color ([#334](https://github.com/Telefonica/mistica-web/issues/334)) ([fdb9f89](https://github.com/Telefonica/mistica-web/commit/fdb9f890677d4fb5e5d6d1a6980efe6287e4d533))
7
+ * **PasswordField:** keep caret position when switching visibility ([#339](https://github.com/Telefonica/mistica-web/issues/339)) ([6d4b67b](https://github.com/Telefonica/mistica-web/commit/6d4b67b3bbfa935936fb456fa97d760af4522b0c))
8
+ * **snippets:** wrong icon prop in Callout ([#337](https://github.com/Telefonica/mistica-web/issues/337)) ([a974a12](https://github.com/Telefonica/mistica-web/commit/a974a128107f7ce46ab9379ebe7155da160f0efc))
9
+
10
+
11
+ ### Features
12
+
13
+ * **mq.suportsHover:** include mq for devices that support hover ([#341](https://github.com/Telefonica/mistica-web/issues/341)) ([b6b6389](https://github.com/Telefonica/mistica-web/commit/b6b638965b2253bd813ff42af4ef596949c59120))
14
+
1
15
  # [10.1.0](https://github.com/Telefonica/mistica-web/compare/v10.0.1...v10.1.0) (2021-09-15)
2
16
 
3
17
 
@@ -11,8 +11,6 @@ var React = _interopRequireWildcard(require("react"));
11
11
 
12
12
  var _touchable = _interopRequireDefault(require("./touchable"));
13
13
 
14
- var _dom = require("./utils/dom");
15
-
16
14
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
17
15
 
18
16
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
@@ -133,14 +131,14 @@ var IconButton = function IconButton(props) {
133
131
  iconSize = props.iconSize,
134
132
  _props$size = props.size,
135
133
  size = _props$size === void 0 ? ICON_SIZE_1 : _props$size;
136
-
137
- var commonProps = _objectSpread({
134
+ var commonProps = {
138
135
  className: props.className || '',
139
136
  disabled: props.disabled,
140
137
  style: _objectSpread(_objectSpread({}, getButtonStyle(icon, size, backgroundColor, iconSize, props.disabled)), props.style),
141
138
  trackingEvent: props.trackingEvent,
142
- 'aria-live': props['aria-live']
143
- }, (0, _dom.getPrefixedDataAttributes)(props.dataAttributes));
139
+ 'aria-live': props['aria-live'],
140
+ dataAttributes: props.dataAttributes
141
+ };
144
142
 
145
143
  if (props.href) {
146
144
  return /*#__PURE__*/React.createElement(_touchable.default, _extends({}, commonProps, {
package/dist/list.js CHANGED
@@ -149,22 +149,17 @@ function _defineProperty(obj, key, value) {
149
149
 
150
150
 
151
151
  var useStyles = (0, _jss.createUseStyles)(function (_ref) {
152
- var colors = _ref.colors;
152
+ var colors = _ref.colors,
153
+ mq = _ref.mq;
153
154
  return {
154
- hover: {
155
- // Only apply hover effect to user agents using fine pointer devices (a mouse, for example)
156
- // Also enabled for (pointer: none) for acceptance tests, where (pointer: fine) doesn't match.
157
- // WARNING: you may be tempted to use @media (hover: hover) instead, but that doesn't work as expected in some android browsers.
158
- // See: https://hover-pointer-media-query.glitch.me/ and https://github.com/mui-org/material-ui/issues/15736
159
- '@media (pointer: fine), (pointer: none)': {
160
- '&:hover': {
161
- background: function background(_ref2) {
162
- var isInverse = _ref2.isInverse;
163
- return isInverse ? 'initial' : colors.backgroundAlternative;
164
- }
155
+ hover: _defineProperty({}, mq.supportsHover, {
156
+ '&:hover': {
157
+ background: function background(_ref2) {
158
+ var isInverse = _ref2.isInverse;
159
+ return isInverse ? 'initial' : colors.backgroundAlternative;
165
160
  }
166
161
  }
167
- },
162
+ }),
168
163
  rowContent: {
169
164
  width: '100%',
170
165
  cursor: 'pointer'
@@ -526,7 +521,7 @@ var RowContent = function RowContent(props) {
526
521
 
527
522
  return /*#__PURE__*/React.createElement(_box.default, {
528
523
  paddingX: 16,
529
- className: (0, _classnames.default)((0, _classnames.default)(classes.rowContent, classes.hover), classes.hoverDisabled),
524
+ className: (0, _classnames.default)(classes.rowContent, classes.hover, classes.hoverDisabled),
530
525
  role: role
531
526
  }, props.right ? renderContent({
532
527
  type: 'custom',
@@ -432,26 +432,21 @@ var useStyles = (0, _jss.createUseStyles)(function (theme) {
432
432
  height: MOBILE_NAVBAR_HEIGHT,
433
433
  padding: '8px 0'
434
434
  }),
435
- section: {
435
+ section: _defineProperty({
436
436
  height: DESKTOP_NAVBAR_HEIGHT,
437
437
  display: 'flex',
438
438
  alignItems: 'center',
439
439
  padding: '0 8px',
440
440
  borderBottom: "2px solid transparent",
441
- transition: 'border-color 300ms ease-in-out',
442
- // Only apply hover effect to user agents using fine pointer devices (a mouse, for example)
443
- // Also enabled for (pointer: none) for acceptance tests, where (pointer: fine) doesn't match.
444
- // WARNING: you may be tempted to use @media (hover: hover) instead, but that doesn't work as expected in some android browsers.
445
- // See: https://hover-pointer-media-query.glitch.me/ and https://github.com/mui-org/material-ui/issues/15736
446
- '@media (pointer: fine), (pointer: none)': {
447
- '&:hover span': {
448
- color: function color(_ref11) {
449
- var isInverse = _ref11.isInverse;
450
- return isInverse ? theme.colors.textSecondaryInverse : theme.colors.textSecondary;
451
- }
441
+ transition: 'border-color 300ms ease-in-out'
442
+ }, theme.mq.supportsHover, {
443
+ '&:hover span': {
444
+ color: function color(_ref11) {
445
+ var isInverse = _ref11.isInverse;
446
+ return isInverse ? theme.colors.textSecondaryInverse : theme.colors.textSecondary;
452
447
  }
453
448
  }
454
- },
449
+ }),
455
450
  selectedSection: {
456
451
  borderColor: function borderColor(_ref12) {
457
452
  var isInverse = _ref12.isInverse;
@@ -490,24 +485,19 @@ var useStyles = (0, _jss.createUseStyles)(function (theme) {
490
485
  burgerMenuExitActive: {
491
486
  transform: 'translate(-100vw)'
492
487
  },
493
- iconButton: {
488
+ iconButton: _defineProperty({
494
489
  color: function color(_ref14) {
495
490
  var isInverse = _ref14.isInverse;
496
491
  return isInverse ? theme.colors.inverse : theme.colors.neutralHigh;
497
- },
498
- // Only apply hover effect to user agents using fine pointer devices (a mouse, for example)
499
- // Also enabled for (pointer: none) for acceptance tests, where (pointer: fine) doesn't match.
500
- // WARNING: you may be tempted to use @media (hover: hover) instead, but that doesn't work as expected in some android browsers.
501
- // See: https://hover-pointer-media-query.glitch.me/ and https://github.com/mui-org/material-ui/issues/15736
502
- '@media (pointer: fine), (pointer: none)': {
503
- '&:hover': {
504
- color: function color(_ref15) {
505
- var isInverse = _ref15.isInverse;
506
- return isInverse ? theme.colors.inverse : theme.colors.neutralMedium;
507
- }
492
+ }
493
+ }, theme.mq.supportsHover, {
494
+ '&:hover': {
495
+ color: function color(_ref15) {
496
+ var isInverse = _ref15.isInverse;
497
+ return isInverse ? theme.colors.inverse : theme.colors.neutralMedium;
508
498
  }
509
499
  }
510
- }
500
+ })
511
501
  };
512
502
  });
513
503
 
@@ -753,33 +743,28 @@ var NavigationBarActionGroup = function NavigationBarActionGroup(_ref20) {
753
743
  exports.NavigationBarActionGroup = NavigationBarActionGroup;
754
744
  var useNavigationBarActionStyles = (0, _jss.createUseStyles)(function (theme) {
755
745
  return {
756
- touchable: {
746
+ touchable: _defineProperty({
757
747
  lineHeight: 0,
758
748
  '& svg': {
759
749
  color: function color(_ref21) {
760
750
  var isInverse = _ref21.isInverse;
761
751
  return isInverse ? theme.colors.inverse : theme.colors.neutralHigh;
762
752
  }
753
+ }
754
+ }, theme.mq.supportsHover, {
755
+ '&:hover span': {
756
+ color: function color(_ref22) {
757
+ var isInverse = _ref22.isInverse;
758
+ return isInverse ? theme.colors.textSecondaryInverse : theme.colors.textSecondary;
759
+ }
763
760
  },
764
- // Only apply hover effect to user agents using fine pointer devices (a mouse, for example)
765
- // Also enabled for (pointer: none) for acceptance tests, where (pointer: fine) doesn't match.
766
- // WARNING: you may be tempted to use @media (hover: hover) instead, but that doesn't work as expected in some android browsers.
767
- // See: https://hover-pointer-media-query.glitch.me/ and https://github.com/mui-org/material-ui/issues/15736
768
- '@media (pointer: fine), (pointer: none)': {
769
- '&:hover span': {
770
- color: function color(_ref22) {
771
- var isInverse = _ref22.isInverse;
772
- return isInverse ? theme.colors.textSecondaryInverse : theme.colors.textSecondary;
773
- }
774
- },
775
- '&:hover svg': {
776
- color: function color(_ref23) {
777
- var isInverse = _ref23.isInverse;
778
- return isInverse ? theme.colors.inverse : theme.colors.neutralMedium;
779
- }
761
+ '&:hover svg': {
762
+ color: function color(_ref23) {
763
+ var isInverse = _ref23.isInverse;
764
+ return isInverse ? theme.colors.inverse : theme.colors.neutralMedium;
780
765
  }
781
766
  }
782
- }
767
+ })
783
768
  };
784
769
  });
785
770
 
@@ -161,9 +161,9 @@ function _defineProperty(obj, key, value) {
161
161
  return obj;
162
162
  }
163
163
 
164
- var usePasswordAdornmentStyles = (0, _jss.createUseStyles)(function () {
164
+ var usePasswordAdornmentStyles = (0, _jss.createUseStyles)(function (theme) {
165
165
  return {
166
- shadow: _defineProperty({}, '@media (hover: hover)', {
166
+ shadow: _defineProperty({}, theme.mq.supportsHover, {
167
167
  '&:hover': {
168
168
  backgroundColor: 'rgba(0, 0, 0, 0.08)'
169
169
  }
@@ -220,6 +220,8 @@ var PasswordField = function PasswordField(_ref2) {
220
220
  isVisible = _React$useState2[0],
221
221
  setIsVisible = _React$useState2[1];
222
222
 
223
+ var caretPositionRef = React.useRef(0);
224
+
223
225
  var _inputRef = React.useRef(null);
224
226
 
225
227
  var processValue = function processValue(value) {
@@ -230,16 +232,22 @@ var PasswordField = function PasswordField(_ref2) {
230
232
  var input = _inputRef.current;
231
233
 
232
234
  if (input) {
233
- input.focus(); // neeeded to place the caret at the end
235
+ if (input.selectionStart !== null) {
236
+ caretPositionRef.current = input.selectionStart;
237
+ }
234
238
 
235
- setTimeout(function () {
236
- var v = input.value;
237
- input.value = '';
238
- input.value = v;
239
- }, 0);
239
+ input.focus();
240
240
  }
241
241
  };
242
242
 
243
+ React.useEffect(function () {
244
+ var input = _inputRef.current;
245
+
246
+ if (input) {
247
+ input.selectionStart = caretPositionRef.current;
248
+ input.selectionEnd = caretPositionRef.current;
249
+ }
250
+ }, [isVisible, caretPositionRef, _inputRef]);
243
251
  var fieldProps = (0, _formContext.useFieldProps)({
244
252
  name: name,
245
253
  value: value,
package/dist/select.js CHANGED
@@ -132,7 +132,7 @@ function _defineProperty(obj, key, value) {
132
132
  }
133
133
 
134
134
  var useStyles = (0, _jss.createUseStyles)(function (theme) {
135
- var _selectContainer;
135
+ var _selectContainer, _menuItem;
136
136
 
137
137
  return {
138
138
  selectContainer: (_selectContainer = {
@@ -171,7 +171,7 @@ var useStyles = (0, _jss.createUseStyles)(function (theme) {
171
171
  height: '100%',
172
172
  textOverflow: 'ellipsis',
173
173
  '&:disabled': {
174
- color: theme.colors.border
174
+ color: theme.colors.textDisabled
175
175
  },
176
176
  appearance: 'none',
177
177
  cursor: function cursor(_ref5) {
@@ -252,19 +252,17 @@ var useStyles = (0, _jss.createUseStyles)(function (theme) {
252
252
  menuItemSelected: {
253
253
  backgroundColor: 'rgba(0, 0, 0, 0.14)'
254
254
  },
255
- menuItem: {
255
+ menuItem: (_menuItem = {
256
256
  color: theme.colors.textPrimary,
257
257
  lineHeight: 1.5,
258
258
  padding: '6px 16px',
259
259
  height: 48,
260
- transition: 'background-color 150ms cubic-bezier(0.4, 0, 0.2, 1) 0ms',
260
+ transition: 'background-color 150ms cubic-bezier(0.4, 0, 0.2, 1) 0ms'
261
+ }, _defineProperty(_menuItem, theme.mq.supportsHover, {
261
262
  '&:hover': {
262
263
  backgroundColor: 'rgba(0, 0, 0, 0.08)'
263
- },
264
- display: 'flex',
265
- alignItems: 'center',
266
- cursor: 'pointer'
267
- }
264
+ }
265
+ }), _defineProperty(_menuItem, "display", 'flex'), _defineProperty(_menuItem, "alignItems", 'center'), _defineProperty(_menuItem, "cursor", 'pointer'), _menuItem)
268
266
  };
269
267
  });
270
268
 
@@ -335,7 +333,8 @@ var Select = function Select(_ref15) {
335
333
  register = _useForm.register;
336
334
 
337
335
  var _useTheme = (0, _hooks.useTheme)(),
338
- platformOverrides = _useTheme.platformOverrides;
336
+ platformOverrides = _useTheme.platformOverrides,
337
+ colors = _useTheme.colors;
339
338
 
340
339
  var shouldUseNative = native || process.env.NODE_ENV === 'test' || (0, _platform.isAndroid)(platformOverrides) || (0, _platform.isIos)(platformOverrides);
341
340
  var disabled = disabledProp || formStatus === 'sending';
@@ -574,6 +573,9 @@ var Select = function Select(_ref15) {
574
573
  }
575
574
  }
576
575
  };
576
+ var arrowIcon = /*#__PURE__*/React.createElement(_iconArrowDown.default, {
577
+ color: disabledProp ? colors.neutralLow : undefined
578
+ });
577
579
  return shouldUseNative ? /*#__PURE__*/React.createElement(_textFieldComponents.FieldContainer, {
578
580
  helperText: /*#__PURE__*/React.createElement(_textFieldComponents.HelperText, {
579
581
  error: error,
@@ -639,7 +641,7 @@ var Select = function Select(_ref15) {
639
641
  })), /*#__PURE__*/React.createElement("div", {
640
642
  className: classes.arrowDown,
641
643
  "aria-hidden": true
642
- }, /*#__PURE__*/React.createElement(_iconArrowDown.default, null))) : /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", _extends({
644
+ }, arrowIcon)) : /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", _extends({
643
645
  className: classes.selectContainer,
644
646
  role: "button",
645
647
  "aria-haspopup": "listbox",
@@ -649,7 +651,7 @@ var Select = function Select(_ref15) {
649
651
  visibility: 'hidden'
650
652
  },
651
653
  fullWidth: fullWidth,
652
- endIcon: /*#__PURE__*/React.createElement(_iconArrowDown.default, null),
654
+ endIcon: arrowIcon,
653
655
  focus: isFocused,
654
656
  label: label,
655
657
  value: value,
@@ -138,7 +138,7 @@ var getMovistarSkin = function getMovistarSkin(variant) {
138
138
  textPrimaryInverse: palette.white,
139
139
  textSecondary: palette.grey5,
140
140
  textSecondaryInverse: palette.white,
141
- textDisabled: palette.grey3,
141
+ textDisabled: palette.grey4,
142
142
  textAmount: palette.movistarBlue,
143
143
  // STATES
144
144
  error: palette.pepper,
@@ -144,7 +144,7 @@ var getO2ClassicSkin = function getO2ClassicSkin() {
144
144
  textPrimaryInverse: palette.white,
145
145
  textSecondary: palette.grey5,
146
146
  textSecondaryInverse: palette.white,
147
- textDisabled: palette.grey3,
147
+ textDisabled: palette.grey4,
148
148
  textAmount: palette.o2SkyBlue,
149
149
  // STATES
150
150
  error: palette.pepper,
package/dist/skins/o2.js CHANGED
@@ -144,7 +144,7 @@ var getO2Skin = function getO2Skin() {
144
144
  textPrimaryInverse: palette.white,
145
145
  textSecondary: palette.grey5,
146
146
  textSecondaryInverse: palette.white,
147
- textDisabled: palette.grey3,
147
+ textDisabled: palette.grey4,
148
148
  textAmount: palette.o2BluePrimary,
149
149
  // STATES
150
150
  error: palette.pepper,
@@ -138,7 +138,7 @@ var getTelefonicaSkin = function getTelefonicaSkin() {
138
138
  textPrimaryInverse: palette.white,
139
139
  textSecondary: palette.grey5,
140
140
  textSecondaryInverse: palette.white,
141
- textDisabled: palette.grey3,
141
+ textDisabled: palette.grey4,
142
142
  textAmount: palette.telefonicaBlue,
143
143
  // STATES
144
144
  error: palette.coral,
@@ -132,7 +132,7 @@ var getVivoSkin = function getVivoSkin() {
132
132
  textPrimaryInverse: palette.white,
133
133
  textSecondary: palette.grey5,
134
134
  textSecondaryInverse: palette.white,
135
- textDisabled: palette.grey3,
135
+ textDisabled: palette.grey4,
136
136
  textAmount: palette.vivoPurple,
137
137
  // STATES
138
138
  error: palette.pepper,
package/dist/tabs.js CHANGED
@@ -111,6 +111,8 @@ var TAB_MAX_WIDTH = 284;
111
111
  var TAB_HEIGHT = 56;
112
112
  var LINE_ANIMATION_DURATION_MS = (0, _platform.isRunningAcceptanceTest)() ? 0 : 300;
113
113
  var useStyles = (0, _jss.createUseStyles)(function (_ref) {
114
+ var _tab;
115
+
114
116
  var colors = _ref.colors,
115
117
  mq = _ref.mq;
116
118
  return {
@@ -138,7 +140,7 @@ var useStyles = (0, _jss.createUseStyles)(function (_ref) {
138
140
  height: TAB_HEIGHT,
139
141
  display: 'flex'
140
142
  },
141
- tab: _defineProperty({
143
+ tab: (_tab = {
142
144
  flex: '1 0 80px',
143
145
  display: 'inline-flex',
144
146
  alignItems: 'center',
@@ -160,19 +162,19 @@ var useStyles = (0, _jss.createUseStyles)(function (_ref) {
160
162
  }
161
163
 
162
164
  return TAB_MAX_WIDTH;
163
- },
165
+ }
166
+ }, _defineProperty(_tab, mq.supportsHover, {
164
167
  '&:hover': {
165
168
  color: colors.textPrimary
166
- },
167
- fallbacks: {
168
- maxWidth: TAB_MAX_WIDTH // max() is not supported by all browsers
169
-
170
169
  }
171
- }, mq.desktopOrBigger, {
170
+ }), _defineProperty(_tab, "fallbacks", {
171
+ maxWidth: TAB_MAX_WIDTH // max() is not supported by all browsers
172
+
173
+ }), _defineProperty(_tab, mq.desktopOrBigger, {
172
174
  flex: '0 1 208px',
173
175
  padding: "16px 32px",
174
176
  maxWidth: TAB_MAX_WIDTH
175
- }),
177
+ }), _tab),
176
178
  tabWithIcon: _defineProperty({
177
179
  flexBasis: 112
178
180
  }, mq.desktopOrBigger, {
@@ -244,7 +244,7 @@ var commonInputStyles = function commonInputStyles(theme) {
244
244
  }
245
245
  },
246
246
  '&:disabled': {
247
- color: theme.colors.border
247
+ color: theme.colors.textDisabled
248
248
  },
249
249
  boxShadow: 'none' // reset FF red shadow styles for required inputs
250
250
 
package/dist/text-link.js CHANGED
@@ -43,21 +43,6 @@ function _extends() {
43
43
  return _extends.apply(this, arguments);
44
44
  }
45
45
 
46
- function _defineProperty(obj, key, value) {
47
- if (key in obj) {
48
- Object.defineProperty(obj, key, {
49
- value: value,
50
- enumerable: true,
51
- configurable: true,
52
- writable: true
53
- });
54
- } else {
55
- obj[key] = value;
56
- }
57
-
58
- return obj;
59
- }
60
-
61
46
  function _objectWithoutProperties(source, excluded) {
62
47
  if (source == null) return {};
63
48
 
@@ -94,22 +79,34 @@ function _objectWithoutPropertiesLoose(source, excluded) {
94
79
  return target;
95
80
  }
96
81
 
82
+ function _defineProperty(obj, key, value) {
83
+ if (key in obj) {
84
+ Object.defineProperty(obj, key, {
85
+ value: value,
86
+ enumerable: true,
87
+ configurable: true,
88
+ writable: true
89
+ });
90
+ } else {
91
+ obj[key] = value;
92
+ }
93
+
94
+ return obj;
95
+ }
96
+
97
97
  var useStyles = (0, _jss.createUseStyles)(function (theme) {
98
98
  return {
99
- textLink: {
99
+ textLink: _defineProperty({
100
100
  width: 'auto',
101
101
  lineHeight: 'inherit',
102
102
  display: 'inline-block',
103
103
  color: theme.colors.textLink,
104
- wordBreak: 'break-word',
104
+ wordBreak: 'break-word'
105
+ }, theme.mq.supportsHover, {
105
106
  '&:hover': {
106
- textDecoration: 'underline',
107
- // Revert hover effect in touch devices
108
- '@media (pointer: coarse)': {
109
- textDecoration: 'initial'
110
- }
107
+ textDecoration: 'underline'
111
108
  }
112
- },
109
+ }),
113
110
  inverse: {
114
111
  color: theme.colors.textLinkInverse
115
112
  },
@@ -227,7 +227,7 @@ var ThemeContextProvider = function ThemeContextProvider(_ref) {
227
227
  }, []);
228
228
  var isOsDarkModeEnabled = useIsOsDarkModeEnabled();
229
229
  var contextTheme = React.useMemo(function () {
230
- var _theme$colorScheme, _theme$Link; // TODO: In next major version we could change this to "auto" by default
230
+ var _theme$colorScheme, _theme$mediaQueries, _theme$Link; // TODO: In next major version we could change this to "auto" by default
231
231
 
232
232
 
233
233
  var colorScheme = (_theme$colorScheme = theme.colorScheme) !== null && _theme$colorScheme !== void 0 ? _theme$colorScheme : 'light';
@@ -254,7 +254,7 @@ var ThemeContextProvider = function ThemeContextProvider(_ref) {
254
254
  }
255
255
  }, theme.analytics),
256
256
  dimensions: _objectSpread(_objectSpread({}, _theme.dimensions), theme.dimensions),
257
- mq: theme.mediaQueries ? (0, _mediaQueries.createMediaQueries)(theme.mediaQueries) : (0, _mediaQueries.createMediaQueries)(_theme.mediaQueriesConfig),
257
+ mq: (0, _mediaQueries.createMediaQueries)((_theme$mediaQueries = theme.mediaQueries) !== null && _theme$mediaQueries !== void 0 ? _theme$mediaQueries : _theme.mediaQueriesConfig),
258
258
  colors: colors,
259
259
  Link: (_theme$Link = theme.Link) !== null && _theme$Link !== void 0 ? _theme$Link : _theme.AnchorLink,
260
260
  isDarkMode: isDarkModeEnabled,
package/dist/theme.d.ts CHANGED
@@ -125,6 +125,7 @@ export declare type Theme = {
125
125
  tabletOrBigger: string;
126
126
  tabletOrSmaller: string;
127
127
  desktopOrBigger: string;
128
+ supportsHover: string;
128
129
  };
129
130
  colors: Colors;
130
131
  Link: LinkComponent;
@@ -129,6 +129,7 @@ export type Theme = {
129
129
  tabletOrBigger: string,
130
130
  tabletOrSmaller: string,
131
131
  desktopOrBigger: string,
132
+ supportsHover: string,
132
133
  },
133
134
  colors: Colors,
134
135
  Link: LinkComponent,
@@ -11,4 +11,5 @@ export declare const createMediaQueries: ({ desktopOrTabletMinHeight, tabletMinW
11
11
  tabletOrBigger: string;
12
12
  tabletOrSmaller: string;
13
13
  desktopOrBigger: string;
14
+ supportsHover: string;
14
15
  };
@@ -17,7 +17,12 @@ var createMediaQueries = function createMediaQueries(_ref) {
17
17
  largeDesktop: "@media only screen " + "and (min-height: ".concat(desktopOrTabletMinHeight, "px) ") + "and (min-width: ".concat(largeDesktopMinWidth, "px)"),
18
18
  tabletOrBigger: "@media only screen " + "and (min-height: ".concat(desktopOrTabletMinHeight, "px) ") + "and (min-width: ".concat(tabletMinWidth, "px)"),
19
19
  tabletOrSmaller: "@media only screen and (max-width: ".concat(desktopMinWidth - 1, "px), ") + "(max-height: ".concat(desktopOrTabletMinHeight - 1, "px)"),
20
- desktopOrBigger: "@media only screen " + "and (min-height: ".concat(desktopOrTabletMinHeight, "px) ") + "and (min-width: ".concat(desktopMinWidth, "px)")
20
+ desktopOrBigger: "@media only screen " + "and (min-height: ".concat(desktopOrTabletMinHeight, "px) ") + "and (min-width: ".concat(desktopMinWidth, "px)"),
21
+ // Only apply hover effect to user agents using fine pointer devices (a mouse, for example)
22
+ // Also enabled for (pointer: none) for acceptance tests, where (pointer: fine) doesn't match.
23
+ // WARNING: you may be tempted to use @media (hover: hover) instead, but that doesn't work as expected in some android browsers.
24
+ // See: https://hover-pointer-media-query.glitch.me/ and https://github.com/mui-org/material-ui/issues/15736
25
+ supportsHover: '@media (pointer: fine), (pointer: none)'
21
26
  };
22
27
  };
23
28
 
@@ -13,4 +13,5 @@ declare export var createMediaQueries: (x: {
13
13
  tabletOrBigger: string,
14
14
  tabletOrSmaller: string,
15
15
  desktopOrBigger: string,
16
+ supportsHover: string,
16
17
  };
@@ -8,7 +8,6 @@ function _defineProperty(obj, key, value) { if (key in obj) { Object.definePrope
8
8
 
9
9
  import * as React from 'react';
10
10
  import Touchable from './touchable';
11
- import { getPrefixedDataAttributes } from './utils/dom';
12
11
  var ICON_SIZE_1 = 24;
13
12
 
14
13
  var getButtonStyle = function getButtonStyle(backgroundUrl, size, backgroundColor, iconSize, disabled) {
@@ -51,14 +50,14 @@ var IconButton = function IconButton(props) {
51
50
  iconSize = props.iconSize,
52
51
  _props$size = props.size,
53
52
  size = _props$size === void 0 ? ICON_SIZE_1 : _props$size;
54
-
55
- var commonProps = _objectSpread({
53
+ var commonProps = {
56
54
  className: props.className || '',
57
55
  disabled: props.disabled,
58
56
  style: _objectSpread(_objectSpread({}, getButtonStyle(icon, size, backgroundColor, iconSize, props.disabled)), props.style),
59
57
  trackingEvent: props.trackingEvent,
60
- 'aria-live': props['aria-live']
61
- }, getPrefixedDataAttributes(props.dataAttributes));
58
+ 'aria-live': props['aria-live'],
59
+ dataAttributes: props.dataAttributes
60
+ };
62
61
 
63
62
  if (props.href) {
64
63
  return /*#__PURE__*/React.createElement(Touchable, _extends({}, commonProps, {
package/dist-es/list.js CHANGED
@@ -38,22 +38,17 @@ import { Boxed } from './boxed';
38
38
  import Divider from './divider';
39
39
  import { getPrefixedDataAttributes } from './utils/dom';
40
40
  var useStyles = createUseStyles(function (_ref) {
41
- var colors = _ref.colors;
41
+ var colors = _ref.colors,
42
+ mq = _ref.mq;
42
43
  return {
43
- hover: {
44
- // Only apply hover effect to user agents using fine pointer devices (a mouse, for example)
45
- // Also enabled for (pointer: none) for acceptance tests, where (pointer: fine) doesn't match.
46
- // WARNING: you may be tempted to use @media (hover: hover) instead, but that doesn't work as expected in some android browsers.
47
- // See: https://hover-pointer-media-query.glitch.me/ and https://github.com/mui-org/material-ui/issues/15736
48
- '@media (pointer: fine), (pointer: none)': {
49
- '&:hover': {
50
- background: function background(_ref2) {
51
- var isInverse = _ref2.isInverse;
52
- return isInverse ? 'initial' : colors.backgroundAlternative;
53
- }
44
+ hover: _defineProperty({}, mq.supportsHover, {
45
+ '&:hover': {
46
+ background: function background(_ref2) {
47
+ var isInverse = _ref2.isInverse;
48
+ return isInverse ? 'initial' : colors.backgroundAlternative;
54
49
  }
55
50
  }
56
- },
51
+ }),
57
52
  rowContent: {
58
53
  width: '100%',
59
54
  cursor: 'pointer'
@@ -415,7 +410,7 @@ var RowContent = function RowContent(props) {
415
410
 
416
411
  return /*#__PURE__*/React.createElement(Box, {
417
412
  paddingX: 16,
418
- className: classNames(classNames(classes.rowContent, classes.hover), classes.hoverDisabled),
413
+ className: classNames(classes.rowContent, classes.hover, classes.hoverDisabled),
419
414
  role: role
420
415
  }, props.right ? renderContent({
421
416
  type: 'custom',
@@ -285,26 +285,21 @@ var useStyles = createUseStyles(function (theme) {
285
285
  height: MOBILE_NAVBAR_HEIGHT,
286
286
  padding: '8px 0'
287
287
  }),
288
- section: {
288
+ section: _defineProperty({
289
289
  height: DESKTOP_NAVBAR_HEIGHT,
290
290
  display: 'flex',
291
291
  alignItems: 'center',
292
292
  padding: '0 8px',
293
293
  borderBottom: "2px solid transparent",
294
- transition: 'border-color 300ms ease-in-out',
295
- // Only apply hover effect to user agents using fine pointer devices (a mouse, for example)
296
- // Also enabled for (pointer: none) for acceptance tests, where (pointer: fine) doesn't match.
297
- // WARNING: you may be tempted to use @media (hover: hover) instead, but that doesn't work as expected in some android browsers.
298
- // See: https://hover-pointer-media-query.glitch.me/ and https://github.com/mui-org/material-ui/issues/15736
299
- '@media (pointer: fine), (pointer: none)': {
300
- '&:hover span': {
301
- color: function color(_ref11) {
302
- var isInverse = _ref11.isInverse;
303
- return isInverse ? theme.colors.textSecondaryInverse : theme.colors.textSecondary;
304
- }
294
+ transition: 'border-color 300ms ease-in-out'
295
+ }, theme.mq.supportsHover, {
296
+ '&:hover span': {
297
+ color: function color(_ref11) {
298
+ var isInverse = _ref11.isInverse;
299
+ return isInverse ? theme.colors.textSecondaryInverse : theme.colors.textSecondary;
305
300
  }
306
301
  }
307
- },
302
+ }),
308
303
  selectedSection: {
309
304
  borderColor: function borderColor(_ref12) {
310
305
  var isInverse = _ref12.isInverse;
@@ -343,24 +338,19 @@ var useStyles = createUseStyles(function (theme) {
343
338
  burgerMenuExitActive: {
344
339
  transform: 'translate(-100vw)'
345
340
  },
346
- iconButton: {
341
+ iconButton: _defineProperty({
347
342
  color: function color(_ref14) {
348
343
  var isInverse = _ref14.isInverse;
349
344
  return isInverse ? theme.colors.inverse : theme.colors.neutralHigh;
350
- },
351
- // Only apply hover effect to user agents using fine pointer devices (a mouse, for example)
352
- // Also enabled for (pointer: none) for acceptance tests, where (pointer: fine) doesn't match.
353
- // WARNING: you may be tempted to use @media (hover: hover) instead, but that doesn't work as expected in some android browsers.
354
- // See: https://hover-pointer-media-query.glitch.me/ and https://github.com/mui-org/material-ui/issues/15736
355
- '@media (pointer: fine), (pointer: none)': {
356
- '&:hover': {
357
- color: function color(_ref15) {
358
- var isInverse = _ref15.isInverse;
359
- return isInverse ? theme.colors.inverse : theme.colors.neutralMedium;
360
- }
345
+ }
346
+ }, theme.mq.supportsHover, {
347
+ '&:hover': {
348
+ color: function color(_ref15) {
349
+ var isInverse = _ref15.isInverse;
350
+ return isInverse ? theme.colors.inverse : theme.colors.neutralMedium;
361
351
  }
362
352
  }
363
- }
353
+ })
364
354
  };
365
355
  });
366
356
  export var MainNavigationBar = function MainNavigationBar(_ref16) {
@@ -594,33 +584,28 @@ export var NavigationBarActionGroup = function NavigationBarActionGroup(_ref20)
594
584
  };
595
585
  var useNavigationBarActionStyles = createUseStyles(function (theme) {
596
586
  return {
597
- touchable: {
587
+ touchable: _defineProperty({
598
588
  lineHeight: 0,
599
589
  '& svg': {
600
590
  color: function color(_ref21) {
601
591
  var isInverse = _ref21.isInverse;
602
592
  return isInverse ? theme.colors.inverse : theme.colors.neutralHigh;
603
593
  }
594
+ }
595
+ }, theme.mq.supportsHover, {
596
+ '&:hover span': {
597
+ color: function color(_ref22) {
598
+ var isInverse = _ref22.isInverse;
599
+ return isInverse ? theme.colors.textSecondaryInverse : theme.colors.textSecondary;
600
+ }
604
601
  },
605
- // Only apply hover effect to user agents using fine pointer devices (a mouse, for example)
606
- // Also enabled for (pointer: none) for acceptance tests, where (pointer: fine) doesn't match.
607
- // WARNING: you may be tempted to use @media (hover: hover) instead, but that doesn't work as expected in some android browsers.
608
- // See: https://hover-pointer-media-query.glitch.me/ and https://github.com/mui-org/material-ui/issues/15736
609
- '@media (pointer: fine), (pointer: none)': {
610
- '&:hover span': {
611
- color: function color(_ref22) {
612
- var isInverse = _ref22.isInverse;
613
- return isInverse ? theme.colors.textSecondaryInverse : theme.colors.textSecondary;
614
- }
615
- },
616
- '&:hover svg': {
617
- color: function color(_ref23) {
618
- var isInverse = _ref23.isInverse;
619
- return isInverse ? theme.colors.inverse : theme.colors.neutralMedium;
620
- }
602
+ '&:hover svg': {
603
+ color: function color(_ref23) {
604
+ var isInverse = _ref23.isInverse;
605
+ return isInverse ? theme.colors.inverse : theme.colors.neutralMedium;
621
606
  }
622
607
  }
623
- }
608
+ })
624
609
  };
625
610
  });
626
611
  export var NavigationBarAction = function NavigationBarAction(_ref24) {
@@ -28,9 +28,9 @@ import IconButton from './icon-button';
28
28
  import Visibility from './icons/icon-visibility';
29
29
  import VisibilityOff from './icons/icon-visibility-off';
30
30
  import { createUseStyles } from './jss';
31
- var usePasswordAdornmentStyles = createUseStyles(function () {
31
+ var usePasswordAdornmentStyles = createUseStyles(function (theme) {
32
32
  return {
33
- shadow: _defineProperty({}, '@media (hover: hover)', {
33
+ shadow: _defineProperty({}, theme.mq.supportsHover, {
34
34
  '&:hover': {
35
35
  backgroundColor: 'rgba(0, 0, 0, 0.08)'
36
36
  }
@@ -87,6 +87,8 @@ var PasswordField = function PasswordField(_ref2) {
87
87
  isVisible = _React$useState2[0],
88
88
  setIsVisible = _React$useState2[1];
89
89
 
90
+ var caretPositionRef = React.useRef(0);
91
+
90
92
  var _inputRef = React.useRef(null);
91
93
 
92
94
  var processValue = function processValue(value) {
@@ -97,16 +99,22 @@ var PasswordField = function PasswordField(_ref2) {
97
99
  var input = _inputRef.current;
98
100
 
99
101
  if (input) {
100
- input.focus(); // neeeded to place the caret at the end
102
+ if (input.selectionStart !== null) {
103
+ caretPositionRef.current = input.selectionStart;
104
+ }
101
105
 
102
- setTimeout(function () {
103
- var v = input.value;
104
- input.value = '';
105
- input.value = v;
106
- }, 0);
106
+ input.focus();
107
107
  }
108
108
  };
109
109
 
110
+ React.useEffect(function () {
111
+ var input = _inputRef.current;
112
+
113
+ if (input) {
114
+ input.selectionStart = caretPositionRef.current;
115
+ input.selectionEnd = caretPositionRef.current;
116
+ }
117
+ }, [isVisible, caretPositionRef, _inputRef]);
110
118
  var fieldProps = useFieldProps({
111
119
  name: name,
112
120
  value: value,
package/dist-es/select.js CHANGED
@@ -27,7 +27,7 @@ import { isAndroid, isIos } from './utils/platform';
27
27
  import { createUseStyles } from './jss';
28
28
  import { cancelEvent } from './utils/dom';
29
29
  var useStyles = createUseStyles(function (theme) {
30
- var _selectContainer;
30
+ var _selectContainer, _menuItem;
31
31
 
32
32
  return {
33
33
  selectContainer: (_selectContainer = {
@@ -66,7 +66,7 @@ var useStyles = createUseStyles(function (theme) {
66
66
  height: '100%',
67
67
  textOverflow: 'ellipsis',
68
68
  '&:disabled': {
69
- color: theme.colors.border
69
+ color: theme.colors.textDisabled
70
70
  },
71
71
  appearance: 'none',
72
72
  cursor: function cursor(_ref5) {
@@ -147,19 +147,17 @@ var useStyles = createUseStyles(function (theme) {
147
147
  menuItemSelected: {
148
148
  backgroundColor: 'rgba(0, 0, 0, 0.14)'
149
149
  },
150
- menuItem: {
150
+ menuItem: (_menuItem = {
151
151
  color: theme.colors.textPrimary,
152
152
  lineHeight: 1.5,
153
153
  padding: '6px 16px',
154
154
  height: 48,
155
- transition: 'background-color 150ms cubic-bezier(0.4, 0, 0.2, 1) 0ms',
155
+ transition: 'background-color 150ms cubic-bezier(0.4, 0, 0.2, 1) 0ms'
156
+ }, _defineProperty(_menuItem, theme.mq.supportsHover, {
156
157
  '&:hover': {
157
158
  backgroundColor: 'rgba(0, 0, 0, 0.08)'
158
- },
159
- display: 'flex',
160
- alignItems: 'center',
161
- cursor: 'pointer'
162
- }
159
+ }
160
+ }), _defineProperty(_menuItem, "display", 'flex'), _defineProperty(_menuItem, "alignItems", 'center'), _defineProperty(_menuItem, "cursor", 'pointer'), _menuItem)
163
161
  };
164
162
  });
165
163
 
@@ -230,7 +228,8 @@ var Select = function Select(_ref15) {
230
228
  register = _useForm.register;
231
229
 
232
230
  var _useTheme = useTheme(),
233
- platformOverrides = _useTheme.platformOverrides;
231
+ platformOverrides = _useTheme.platformOverrides,
232
+ colors = _useTheme.colors;
234
233
 
235
234
  var shouldUseNative = native || process.env.NODE_ENV === 'test' || isAndroid(platformOverrides) || isIos(platformOverrides);
236
235
  var disabled = disabledProp || formStatus === 'sending';
@@ -469,6 +468,9 @@ var Select = function Select(_ref15) {
469
468
  }
470
469
  }
471
470
  };
471
+ var arrowIcon = /*#__PURE__*/React.createElement(IconArrowDown, {
472
+ color: disabledProp ? colors.neutralLow : undefined
473
+ });
472
474
  return shouldUseNative ? /*#__PURE__*/React.createElement(FieldContainer, {
473
475
  helperText: /*#__PURE__*/React.createElement(HelperText, {
474
476
  error: error,
@@ -534,7 +536,7 @@ var Select = function Select(_ref15) {
534
536
  })), /*#__PURE__*/React.createElement("div", {
535
537
  className: classes.arrowDown,
536
538
  "aria-hidden": true
537
- }, /*#__PURE__*/React.createElement(IconArrowDown, null))) : /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", _extends({
539
+ }, arrowIcon)) : /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", _extends({
538
540
  className: classes.selectContainer,
539
541
  role: "button",
540
542
  "aria-haspopup": "listbox",
@@ -544,7 +546,7 @@ var Select = function Select(_ref15) {
544
546
  visibility: 'hidden'
545
547
  },
546
548
  fullWidth: fullWidth,
547
- endIcon: /*#__PURE__*/React.createElement(IconArrowDown, null),
549
+ endIcon: arrowIcon,
548
550
  focus: isFocused,
549
551
  label: label,
550
552
  value: value,
@@ -127,7 +127,7 @@ export var getMovistarSkin = function getMovistarSkin(variant) {
127
127
  textPrimaryInverse: palette.white,
128
128
  textSecondary: palette.grey5,
129
129
  textSecondaryInverse: palette.white,
130
- textDisabled: palette.grey3,
130
+ textDisabled: palette.grey4,
131
131
  textAmount: palette.movistarBlue,
132
132
  // STATES
133
133
  error: palette.pepper,
@@ -133,7 +133,7 @@ export var getO2ClassicSkin = function getO2ClassicSkin() {
133
133
  textPrimaryInverse: palette.white,
134
134
  textSecondary: palette.grey5,
135
135
  textSecondaryInverse: palette.white,
136
- textDisabled: palette.grey3,
136
+ textDisabled: palette.grey4,
137
137
  textAmount: palette.o2SkyBlue,
138
138
  // STATES
139
139
  error: palette.pepper,
@@ -133,7 +133,7 @@ export var getO2Skin = function getO2Skin() {
133
133
  textPrimaryInverse: palette.white,
134
134
  textSecondary: palette.grey5,
135
135
  textSecondaryInverse: palette.white,
136
- textDisabled: palette.grey3,
136
+ textDisabled: palette.grey4,
137
137
  textAmount: palette.o2BluePrimary,
138
138
  // STATES
139
139
  error: palette.pepper,
@@ -127,7 +127,7 @@ export var getTelefonicaSkin = function getTelefonicaSkin() {
127
127
  textPrimaryInverse: palette.white,
128
128
  textSecondary: palette.grey5,
129
129
  textSecondaryInverse: palette.white,
130
- textDisabled: palette.grey3,
130
+ textDisabled: palette.grey4,
131
131
  textAmount: palette.telefonicaBlue,
132
132
  // STATES
133
133
  error: palette.coral,
@@ -121,7 +121,7 @@ export var getVivoSkin = function getVivoSkin() {
121
121
  textPrimaryInverse: palette.white,
122
122
  textSecondary: palette.grey5,
123
123
  textSecondaryInverse: palette.white,
124
- textDisabled: palette.grey3,
124
+ textDisabled: palette.grey4,
125
125
  textAmount: palette.vivoPurple,
126
126
  // STATES
127
127
  error: palette.pepper,
package/dist-es/tabs.js CHANGED
@@ -25,6 +25,8 @@ var TAB_MAX_WIDTH = 284;
25
25
  var TAB_HEIGHT = 56;
26
26
  var LINE_ANIMATION_DURATION_MS = isRunningAcceptanceTest() ? 0 : 300;
27
27
  var useStyles = createUseStyles(function (_ref) {
28
+ var _tab;
29
+
28
30
  var colors = _ref.colors,
29
31
  mq = _ref.mq;
30
32
  return {
@@ -52,7 +54,7 @@ var useStyles = createUseStyles(function (_ref) {
52
54
  height: TAB_HEIGHT,
53
55
  display: 'flex'
54
56
  },
55
- tab: _defineProperty({
57
+ tab: (_tab = {
56
58
  flex: '1 0 80px',
57
59
  display: 'inline-flex',
58
60
  alignItems: 'center',
@@ -74,19 +76,19 @@ var useStyles = createUseStyles(function (_ref) {
74
76
  }
75
77
 
76
78
  return TAB_MAX_WIDTH;
77
- },
79
+ }
80
+ }, _defineProperty(_tab, mq.supportsHover, {
78
81
  '&:hover': {
79
82
  color: colors.textPrimary
80
- },
81
- fallbacks: {
82
- maxWidth: TAB_MAX_WIDTH // max() is not supported by all browsers
83
-
84
83
  }
85
- }, mq.desktopOrBigger, {
84
+ }), _defineProperty(_tab, "fallbacks", {
85
+ maxWidth: TAB_MAX_WIDTH // max() is not supported by all browsers
86
+
87
+ }), _defineProperty(_tab, mq.desktopOrBigger, {
86
88
  flex: '0 1 208px',
87
89
  padding: "16px 32px",
88
90
  maxWidth: TAB_MAX_WIDTH
89
- }),
91
+ }), _tab),
90
92
  tabWithIcon: _defineProperty({
91
93
  flexBasis: 112
92
94
  }, mq.desktopOrBigger, {
@@ -79,7 +79,7 @@ var commonInputStyles = function commonInputStyles(theme) {
79
79
  }
80
80
  },
81
81
  '&:disabled': {
82
- color: theme.colors.border
82
+ color: theme.colors.textDisabled
83
83
  },
84
84
  boxShadow: 'none' // reset FF red shadow styles for required inputs
85
85
 
@@ -2,12 +2,12 @@ var _excluded = ["children", "className", "small"];
2
2
 
3
3
  function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
4
4
 
5
- function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
6
-
7
5
  function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
8
6
 
9
7
  function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
10
8
 
9
+ function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
10
+
11
11
  import * as React from 'react';
12
12
  import { createUseStyles } from './jss';
13
13
  import Touchable from './touchable';
@@ -15,20 +15,17 @@ import classnames from 'classnames';
15
15
  import { useIsInverseVariant } from './theme-variant-context';
16
16
  var useStyles = createUseStyles(function (theme) {
17
17
  return {
18
- textLink: {
18
+ textLink: _defineProperty({
19
19
  width: 'auto',
20
20
  lineHeight: 'inherit',
21
21
  display: 'inline-block',
22
22
  color: theme.colors.textLink,
23
- wordBreak: 'break-word',
23
+ wordBreak: 'break-word'
24
+ }, theme.mq.supportsHover, {
24
25
  '&:hover': {
25
- textDecoration: 'underline',
26
- // Revert hover effect in touch devices
27
- '@media (pointer: coarse)': {
28
- textDecoration: 'initial'
29
- }
26
+ textDecoration: 'underline'
30
27
  }
31
- },
28
+ }),
32
29
  inverse: {
33
30
  color: theme.colors.textLinkInverse
34
31
  },
@@ -96,7 +96,7 @@ var ThemeContextProvider = function ThemeContextProvider(_ref) {
96
96
  }, []);
97
97
  var isOsDarkModeEnabled = useIsOsDarkModeEnabled();
98
98
  var contextTheme = React.useMemo(function () {
99
- var _theme$colorScheme, _theme$Link;
99
+ var _theme$colorScheme, _theme$mediaQueries, _theme$Link;
100
100
 
101
101
  // TODO: In next major version we could change this to "auto" by default
102
102
  var colorScheme = (_theme$colorScheme = theme.colorScheme) !== null && _theme$colorScheme !== void 0 ? _theme$colorScheme : 'light';
@@ -123,7 +123,7 @@ var ThemeContextProvider = function ThemeContextProvider(_ref) {
123
123
  }
124
124
  }, theme.analytics),
125
125
  dimensions: _objectSpread(_objectSpread({}, dimensions), theme.dimensions),
126
- mq: theme.mediaQueries ? createMediaQueries(theme.mediaQueries) : createMediaQueries(mediaQueriesConfig),
126
+ mq: createMediaQueries((_theme$mediaQueries = theme.mediaQueries) !== null && _theme$mediaQueries !== void 0 ? _theme$mediaQueries : mediaQueriesConfig),
127
127
  colors: colors,
128
128
  Link: (_theme$Link = theme.Link) !== null && _theme$Link !== void 0 ? _theme$Link : AnchorLink,
129
129
  isDarkMode: isDarkModeEnabled,
@@ -10,6 +10,11 @@ export var createMediaQueries = function createMediaQueries(_ref) {
10
10
  largeDesktop: "@media only screen " + "and (min-height: ".concat(desktopOrTabletMinHeight, "px) ") + "and (min-width: ".concat(largeDesktopMinWidth, "px)"),
11
11
  tabletOrBigger: "@media only screen " + "and (min-height: ".concat(desktopOrTabletMinHeight, "px) ") + "and (min-width: ".concat(tabletMinWidth, "px)"),
12
12
  tabletOrSmaller: "@media only screen and (max-width: ".concat(desktopMinWidth - 1, "px), ") + "(max-height: ".concat(desktopOrTabletMinHeight - 1, "px)"),
13
- desktopOrBigger: "@media only screen " + "and (min-height: ".concat(desktopOrTabletMinHeight, "px) ") + "and (min-width: ".concat(desktopMinWidth, "px)")
13
+ desktopOrBigger: "@media only screen " + "and (min-height: ".concat(desktopOrTabletMinHeight, "px) ") + "and (min-width: ".concat(desktopMinWidth, "px)"),
14
+ // Only apply hover effect to user agents using fine pointer devices (a mouse, for example)
15
+ // Also enabled for (pointer: none) for acceptance tests, where (pointer: fine) doesn't match.
16
+ // WARNING: you may be tempted to use @media (hover: hover) instead, but that doesn't work as expected in some android browsers.
17
+ // See: https://hover-pointer-media-query.glitch.me/ and https://github.com/mui-org/material-ui/issues/15736
18
+ supportsHover: '@media (pointer: fine), (pointer: none)'
14
19
  };
15
20
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@telefonica/mistica",
3
- "version": "10.1.0",
3
+ "version": "10.2.0",
4
4
  "license": "MIT",
5
5
  "repository": {
6
6
  "type": "git",