@telefonica/mistica 10.1.0 → 10.4.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 (47) hide show
  1. package/CHANGELOG.md +36 -0
  2. package/README.md +2 -2
  3. package/dist/card.d.ts +1 -1
  4. package/dist/card.js +1 -1
  5. package/dist/card.js.flow +1 -1
  6. package/dist/icon-button.js +4 -6
  7. package/dist/list.js +9 -14
  8. package/dist/navigation-bar.d.ts +1 -0
  9. package/dist/navigation-bar.js +89 -95
  10. package/dist/navigation-bar.js.flow +1 -0
  11. package/dist/password-field.js +16 -8
  12. package/dist/select.js +67 -63
  13. package/dist/skins/movistar.js +1 -1
  14. package/dist/skins/o2-classic.js +1 -1
  15. package/dist/skins/o2.js +1 -1
  16. package/dist/skins/telefonica.js +1 -1
  17. package/dist/skins/vivo.js +1 -1
  18. package/dist/tabs.js +10 -8
  19. package/dist/text-field-base.js +60 -46
  20. package/dist/text-field-components.d.ts +1 -0
  21. package/dist/text-field-components.js +18 -9
  22. package/dist/text-field-components.js.flow +1 -0
  23. package/dist/text-link.js +20 -23
  24. package/dist/theme-context-provider.js +2 -2
  25. package/dist/theme.d.ts +1 -0
  26. package/dist/theme.js.flow +1 -0
  27. package/dist/utils/media-queries.d.ts +1 -0
  28. package/dist/utils/media-queries.js +6 -1
  29. package/dist/utils/media-queries.js.flow +1 -0
  30. package/dist-es/card.js +1 -1
  31. package/dist-es/icon-button.js +4 -5
  32. package/dist-es/list.js +9 -14
  33. package/dist-es/navigation-bar.js +89 -95
  34. package/dist-es/password-field.js +16 -8
  35. package/dist-es/select.js +67 -63
  36. package/dist-es/skins/movistar.js +1 -1
  37. package/dist-es/skins/o2-classic.js +1 -1
  38. package/dist-es/skins/o2.js +1 -1
  39. package/dist-es/skins/telefonica.js +1 -1
  40. package/dist-es/skins/vivo.js +1 -1
  41. package/dist-es/tabs.js +10 -8
  42. package/dist-es/text-field-base.js +60 -46
  43. package/dist-es/text-field-components.js +18 -9
  44. package/dist-es/text-link.js +7 -10
  45. package/dist-es/theme-context-provider.js +2 -2
  46. package/dist-es/utils/media-queries.js +6 -1
  47. package/package.json +1 -1
package/CHANGELOG.md CHANGED
@@ -1,3 +1,39 @@
1
+ # [10.4.0](https://github.com/Telefonica/mistica-web/compare/v10.3.1...v10.4.0) (2021-09-30)
2
+
3
+
4
+ ### Features
5
+
6
+ * **MediaCard:** make description optional ([#346](https://github.com/Telefonica/mistica-web/issues/346)) ([ce5a653](https://github.com/Telefonica/mistica-web/commit/ce5a653c099e830e7cb60fb1b8ce8db62d8ffa3a))
7
+
8
+ ## [10.3.1](https://github.com/Telefonica/mistica-web/compare/v10.3.0...v10.3.1) (2021-09-23)
9
+
10
+
11
+ ### Bug Fixes
12
+
13
+ * **NavigationBar:** remove wrong border transition in desktop ([b58d46c](https://github.com/Telefonica/mistica-web/commit/b58d46ccf14c5cebbfe95b5c62d7644525fddb86))
14
+
15
+ # [10.3.0](https://github.com/Telefonica/mistica-web/compare/v10.2.0...v10.3.0) (2021-09-23)
16
+
17
+
18
+ ### Features
19
+
20
+ * **Form fields:** change style of disabled fields ([#340](https://github.com/Telefonica/mistica-web/issues/340)) ([bdced15](https://github.com/Telefonica/mistica-web/commit/bdced15cc48fe3baf417f72fc6d453f91d172a62))
21
+ * **NavigationBar:** make border optional ([#342](https://github.com/Telefonica/mistica-web/issues/342)) ([2b63b96](https://github.com/Telefonica/mistica-web/commit/2b63b962b87600f972485eea268721e074047533))
22
+
23
+ # [10.2.0](https://github.com/Telefonica/mistica-web/compare/v10.1.0...v10.2.0) (2021-09-21)
24
+
25
+
26
+ ### Bug Fixes
27
+
28
+ * **form fields:** change disabled color ([#334](https://github.com/Telefonica/mistica-web/issues/334)) ([fdb9f89](https://github.com/Telefonica/mistica-web/commit/fdb9f890677d4fb5e5d6d1a6980efe6287e4d533))
29
+ * **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))
30
+ * **snippets:** wrong icon prop in Callout ([#337](https://github.com/Telefonica/mistica-web/issues/337)) ([a974a12](https://github.com/Telefonica/mistica-web/commit/a974a128107f7ce46ab9379ebe7155da160f0efc))
31
+
32
+
33
+ ### Features
34
+
35
+ * **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))
36
+
1
37
  # [10.1.0](https://github.com/Telefonica/mistica-web/compare/v10.0.1...v10.1.0) (2021-09-15)
2
38
 
3
39
 
package/README.md CHANGED
@@ -77,10 +77,10 @@ the library. There are multiple settings but the only two mandatory fields are `
77
77
 
78
78
  ## Components
79
79
 
80
- Explore the components in [Mistica storybook](https://mistica-web.now.sh)
80
+ Explore the components in [Mistica storybook](https://mistica-web.vercel.app)
81
81
 
82
82
  Start prototyping interfaces with Mistica components in the
83
- [Mistica playroom](https://mistica-web.now.sh/playroom)
83
+ [Mistica playroom](https://mistica-web.vercel.app/playroom)
84
84
 
85
85
  ## More docs
86
86
 
package/dist/card.d.ts CHANGED
@@ -22,7 +22,7 @@ declare type MediaCardProps = {
22
22
  headline?: string | React.ReactElement<TagProps, typeof Tag>;
23
23
  pretitle?: string;
24
24
  title?: string;
25
- description: string;
25
+ description?: string;
26
26
  extra?: React.ReactNode;
27
27
  button?: React.ReactElement<ButtonProps, typeof ButtonPrimary>;
28
28
  buttonLink?: React.ReactElement<ButtonProps, typeof ButtonLink>;
package/dist/card.js CHANGED
@@ -91,7 +91,7 @@ var CardContent = function CardContent(_ref2) {
91
91
  regular: true
92
92
  }, title), /*#__PURE__*/React.createElement(_text.Text2, {
93
93
  regular: true
94
- }, subtitle))), /*#__PURE__*/React.createElement(_text.Text2, {
94
+ }, subtitle))), description && /*#__PURE__*/React.createElement(_text.Text2, {
95
95
  as: "p",
96
96
  regular: true,
97
97
  color: theme.colors.textSecondary
package/dist/card.js.flow CHANGED
@@ -19,7 +19,7 @@ declare type MediaCardProps = {
19
19
  headline?: string | React.Element<typeof Tag>,
20
20
  pretitle?: string,
21
21
  title?: string,
22
- description: string,
22
+ description?: string,
23
23
  extra?: React.Node,
24
24
  button?: React.Element<typeof ButtonPrimary>,
25
25
  buttonLink?: React.Element<typeof ButtonLink>,
@@ -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',
@@ -36,6 +36,7 @@ interface NavigationBarCommonProps {
36
36
  onBack?: () => void;
37
37
  title?: string;
38
38
  right?: React.ReactElement;
39
+ withBorder?: boolean;
39
40
  children?: undefined;
40
41
  }
41
42
  interface NavigationBarTopFixedProps extends NavigationBarCommonProps {
@@ -417,44 +417,43 @@ var useStyles = (0, _jss.createUseStyles)(function (theme) {
417
417
  },
418
418
  height: DESKTOP_NAVBAR_HEIGHT,
419
419
  padding: '16px 0',
420
- transition: 'border 300ms',
421
- borderBottom: "1px solid ".concat(theme.colors.divider),
422
- borderColor: function borderColor(_ref9) {
423
- var isInverse = _ref9.isInverse;
420
+ borderBottomStyle: 'solid',
421
+ borderBottomWidth: function borderBottomWidth(_ref9) {
422
+ var withBorder = _ref9.withBorder;
423
+ return withBorder ? 1 : 0;
424
+ },
425
+ borderColor: function borderColor(_ref10) {
426
+ var isInverse = _ref10.isInverse;
424
427
  return isInverse && !theme.isDarkMode ? 'transparent' : theme.colors.divider;
425
428
  }
426
429
  }, theme.mq.tabletOrSmaller, {
427
- borderColor: function borderColor(_ref10) {
428
- var isMenuOpen = _ref10.isMenuOpen,
429
- isInverse = _ref10.isInverse;
430
+ transition: 'border-color 300ms',
431
+ borderColor: function borderColor(_ref11) {
432
+ var isMenuOpen = _ref11.isMenuOpen,
433
+ isInverse = _ref11.isInverse;
430
434
  return isMenuOpen || isInverse && !theme.isDarkMode ? 'transparent' : theme.colors.divider;
431
435
  },
432
436
  height: MOBILE_NAVBAR_HEIGHT,
433
437
  padding: '8px 0'
434
438
  }),
435
- section: {
439
+ section: _defineProperty({
436
440
  height: DESKTOP_NAVBAR_HEIGHT,
437
441
  display: 'flex',
438
442
  alignItems: 'center',
439
443
  padding: '0 8px',
440
444
  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
- }
445
+ transition: 'border-color 300ms ease-in-out'
446
+ }, theme.mq.supportsHover, {
447
+ '&:hover span': {
448
+ color: function color(_ref12) {
449
+ var isInverse = _ref12.isInverse;
450
+ return isInverse ? theme.colors.textSecondaryInverse : theme.colors.textSecondary;
452
451
  }
453
452
  }
454
- },
453
+ }),
455
454
  selectedSection: {
456
- borderColor: function borderColor(_ref12) {
457
- var isInverse = _ref12.isInverse;
455
+ borderColor: function borderColor(_ref13) {
456
+ var isInverse = _ref13.isInverse;
458
457
  return isInverse ? theme.colors.inverse : theme.colors.controlActivated;
459
458
  }
460
459
  },
@@ -472,8 +471,8 @@ var useStyles = (0, _jss.createUseStyles)(function (theme) {
472
471
  height: "calc(100vh - ".concat(MOBILE_NAVBAR_HEIGHT, "px)"),
473
472
  overflowY: 'auto',
474
473
  background: theme.colors.background,
475
- boxShadow: function boxShadow(_ref13) {
476
- var menuTransitionState = _ref13.menuTransitionState;
474
+ boxShadow: function boxShadow(_ref14) {
475
+ var menuTransitionState = _ref14.menuTransitionState;
477
476
  return menuTransitionState !== 'closed' ? "6px 0 4px -4px rgba(0, 0, 0, ".concat(shadowAlpha, ")") : 'none';
478
477
  },
479
478
  transition: "transform ".concat(BURGER_MENU_ANIMATION_DURATION_MS, "ms ease-out")
@@ -490,38 +489,33 @@ var useStyles = (0, _jss.createUseStyles)(function (theme) {
490
489
  burgerMenuExitActive: {
491
490
  transform: 'translate(-100vw)'
492
491
  },
493
- iconButton: {
494
- color: function color(_ref14) {
495
- var isInverse = _ref14.isInverse;
492
+ iconButton: _defineProperty({
493
+ color: function color(_ref15) {
494
+ var isInverse = _ref15.isInverse;
496
495
  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
- }
496
+ }
497
+ }, theme.mq.supportsHover, {
498
+ '&:hover': {
499
+ color: function color(_ref16) {
500
+ var isInverse = _ref16.isInverse;
501
+ return isInverse ? theme.colors.inverse : theme.colors.neutralMedium;
508
502
  }
509
503
  }
510
- }
504
+ })
511
505
  };
512
506
  });
513
507
 
514
- var MainNavigationBar = function MainNavigationBar(_ref16) {
508
+ var MainNavigationBar = function MainNavigationBar(_ref17) {
515
509
  var _logo;
516
510
 
517
- var sections = _ref16.sections,
518
- selectedIndex = _ref16.selectedIndex,
519
- right = _ref16.right,
520
- logo = _ref16.logo,
521
- _ref16$isInverse = _ref16.isInverse,
522
- isInverse = _ref16$isInverse === void 0 ? false : _ref16$isInverse,
523
- _ref16$topFixed = _ref16.topFixed,
524
- topFixed = _ref16$topFixed === void 0 ? true : _ref16$topFixed;
511
+ var sections = _ref17.sections,
512
+ selectedIndex = _ref17.selectedIndex,
513
+ right = _ref17.right,
514
+ logo = _ref17.logo,
515
+ _ref17$isInverse = _ref17.isInverse,
516
+ isInverse = _ref17$isInverse === void 0 ? false : _ref17$isInverse,
517
+ _ref17$topFixed = _ref17.topFixed,
518
+ topFixed = _ref17$topFixed === void 0 ? true : _ref17$topFixed;
525
519
 
526
520
  var _useTheme6 = (0, _hooks.useTheme)(),
527
521
  texts = _useTheme6.texts;
@@ -540,7 +534,8 @@ var MainNavigationBar = function MainNavigationBar(_ref16) {
540
534
  var classes = useStyles({
541
535
  isMenuOpen: isMenuOpen,
542
536
  isInverse: isInverse,
543
- menuTransitionState: menuTransitionState
537
+ menuTransitionState: menuTransitionState,
538
+ withBorder: true
544
539
  });
545
540
 
546
541
  var _useScreenSize2 = (0, _hooks.useScreenSize)(),
@@ -639,9 +634,9 @@ var MainNavigationBar = function MainNavigationBar(_ref16) {
639
634
  alignItems: "center"
640
635
  }, logo, /*#__PURE__*/React.createElement("nav", null, /*#__PURE__*/React.createElement(_inline.default, {
641
636
  space: 32
642
- }, sections.map(function (_ref17, idx) {
643
- var title = _ref17.title,
644
- touchableProps = _objectWithoutProperties(_ref17, _excluded);
637
+ }, sections.map(function (_ref18, idx) {
638
+ var title = _ref18.title,
639
+ touchableProps = _objectWithoutProperties(_ref18, _excluded);
645
640
 
646
641
  return /*#__PURE__*/React.createElement(_touchable.default, _extends({}, touchableProps, {
647
642
  key: idx,
@@ -656,22 +651,25 @@ var MainNavigationBar = function MainNavigationBar(_ref16) {
656
651
 
657
652
  exports.MainNavigationBar = MainNavigationBar;
658
653
 
659
- var NavigationBar = function NavigationBar(_ref18) {
660
- var onBack = _ref18.onBack,
661
- title = _ref18.title,
662
- right = _ref18.right,
663
- _ref18$isInverse = _ref18.isInverse,
664
- isInverse = _ref18$isInverse === void 0 ? false : _ref18$isInverse,
665
- _ref18$topFixed = _ref18.topFixed,
666
- topFixed = _ref18$topFixed === void 0 ? true : _ref18$topFixed,
667
- paddingX = _ref18.paddingX;
654
+ var NavigationBar = function NavigationBar(_ref19) {
655
+ var onBack = _ref19.onBack,
656
+ title = _ref19.title,
657
+ right = _ref19.right,
658
+ _ref19$isInverse = _ref19.isInverse,
659
+ isInverse = _ref19$isInverse === void 0 ? false : _ref19$isInverse,
660
+ _ref19$topFixed = _ref19.topFixed,
661
+ topFixed = _ref19$topFixed === void 0 ? true : _ref19$topFixed,
662
+ paddingX = _ref19.paddingX,
663
+ _ref19$withBorder = _ref19.withBorder,
664
+ withBorder = _ref19$withBorder === void 0 ? true : _ref19$withBorder;
668
665
 
669
666
  var _useTheme7 = (0, _hooks.useTheme)(),
670
667
  texts = _useTheme7.texts;
671
668
 
672
669
  var classes = useStyles({
673
670
  isInverse: isInverse,
674
- paddingX: paddingX !== null && paddingX !== void 0 ? paddingX : 0
671
+ paddingX: paddingX !== null && paddingX !== void 0 ? paddingX : 0,
672
+ withBorder: withBorder
675
673
  });
676
674
  var content = /*#__PURE__*/React.createElement(_inline.default, {
677
675
  space: "between",
@@ -704,15 +702,16 @@ var NavigationBar = function NavigationBar(_ref18) {
704
702
 
705
703
  exports.NavigationBar = NavigationBar;
706
704
 
707
- var FunnelNavigationBar = function FunnelNavigationBar(_ref19) {
708
- var logo = _ref19.logo,
709
- right = _ref19.right,
710
- _ref19$isInverse = _ref19.isInverse,
711
- isInverse = _ref19$isInverse === void 0 ? false : _ref19$isInverse,
712
- _ref19$topFixed = _ref19.topFixed,
713
- topFixed = _ref19$topFixed === void 0 ? true : _ref19$topFixed;
705
+ var FunnelNavigationBar = function FunnelNavigationBar(_ref20) {
706
+ var logo = _ref20.logo,
707
+ right = _ref20.right,
708
+ _ref20$isInverse = _ref20.isInverse,
709
+ isInverse = _ref20$isInverse === void 0 ? false : _ref20$isInverse,
710
+ _ref20$topFixed = _ref20.topFixed,
711
+ topFixed = _ref20$topFixed === void 0 ? true : _ref20$topFixed;
714
712
  var classes = useStyles({
715
- isInverse: isInverse
713
+ isInverse: isInverse,
714
+ withBorder: true
716
715
  });
717
716
  return /*#__PURE__*/React.createElement(_themeVariantContext.ThemeVariant, {
718
717
  isInverse: isInverse
@@ -739,8 +738,8 @@ var useNavigationBarActionGroupStyles = (0, _jss.createUseStyles)(function () {
739
738
  };
740
739
  });
741
740
 
742
- var NavigationBarActionGroup = function NavigationBarActionGroup(_ref20) {
743
- var children = _ref20.children;
741
+ var NavigationBarActionGroup = function NavigationBarActionGroup(_ref21) {
742
+ var children = _ref21.children;
744
743
  var classes = useNavigationBarActionGroupStyles();
745
744
  return /*#__PURE__*/React.createElement("div", {
746
745
  className: classes.lineHeightFix
@@ -753,39 +752,34 @@ var NavigationBarActionGroup = function NavigationBarActionGroup(_ref20) {
753
752
  exports.NavigationBarActionGroup = NavigationBarActionGroup;
754
753
  var useNavigationBarActionStyles = (0, _jss.createUseStyles)(function (theme) {
755
754
  return {
756
- touchable: {
755
+ touchable: _defineProperty({
757
756
  lineHeight: 0,
758
757
  '& svg': {
759
- color: function color(_ref21) {
760
- var isInverse = _ref21.isInverse;
758
+ color: function color(_ref22) {
759
+ var isInverse = _ref22.isInverse;
761
760
  return isInverse ? theme.colors.inverse : theme.colors.neutralHigh;
762
761
  }
762
+ }
763
+ }, theme.mq.supportsHover, {
764
+ '&:hover span': {
765
+ color: function color(_ref23) {
766
+ var isInverse = _ref23.isInverse;
767
+ return isInverse ? theme.colors.textSecondaryInverse : theme.colors.textSecondary;
768
+ }
763
769
  },
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
- }
770
+ '&:hover svg': {
771
+ color: function color(_ref24) {
772
+ var isInverse = _ref24.isInverse;
773
+ return isInverse ? theme.colors.inverse : theme.colors.neutralMedium;
780
774
  }
781
775
  }
782
- }
776
+ })
783
777
  };
784
778
  });
785
779
 
786
- var NavigationBarAction = function NavigationBarAction(_ref24) {
787
- var children = _ref24.children,
788
- touchableProps = _objectWithoutProperties(_ref24, _excluded2);
780
+ var NavigationBarAction = function NavigationBarAction(_ref25) {
781
+ var children = _ref25.children,
782
+ touchableProps = _objectWithoutProperties(_ref25, _excluded2);
789
783
 
790
784
  var isInverse = (0, _themeVariantContext.useIsInverseVariant)();
791
785
  var classes = useNavigationBarActionStyles({
@@ -31,6 +31,7 @@ declare type NavigationBarCommonProps = {|
31
31
  onBack?: () => void,
32
32
  title?: string,
33
33
  right?: React.Element<any>,
34
+ withBorder?: boolean,
34
35
  |};
35
36
  declare type NavigationBarTopFixedProps = {|
36
37
  ...$Exact<NavigationBarCommonProps>,
@@ -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,