@telefonica/mistica 10.0.1 → 10.3.1

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 (69) hide show
  1. package/CHANGELOG.md +43 -0
  2. package/dist/button-fixed-footer-layout.d.ts +2 -2
  3. package/dist/button-layout.d.ts +2 -2
  4. package/dist/button.d.ts +1 -1
  5. package/dist/callout.d.ts +4 -3
  6. package/dist/card.d.ts +9 -7
  7. package/dist/circle.d.ts +1 -1
  8. package/dist/dialog.d.ts +1 -1
  9. package/dist/double-field.d.ts +11 -1
  10. package/dist/double-field.js.flow +20 -20
  11. package/dist/empty-state-card.d.ts +1 -1
  12. package/dist/empty-state-card.js.flow +0 -1
  13. package/dist/empty-state.d.ts +1 -1
  14. package/dist/empty-state.js.flow +0 -1
  15. package/dist/feedback-screen.d.ts +4 -3
  16. package/dist/header.d.ts +7 -5
  17. package/dist/highlighted-card.d.ts +2 -2
  18. package/dist/icon-button.js +4 -6
  19. package/dist/list.js +9 -14
  20. package/dist/navigation-bar.d.ts +16 -4
  21. package/dist/navigation-bar.js +123 -88
  22. package/dist/navigation-bar.js.flow +20 -4
  23. package/dist/navigation-breadcrumbs.d.ts +1 -1
  24. package/dist/navigation-breadcrumbs.js.flow +1 -1
  25. package/dist/password-field.js +16 -8
  26. package/dist/radio-button.d.ts +1 -1
  27. package/dist/section-title.d.ts +2 -1
  28. package/dist/select.js +74 -65
  29. package/dist/skins/movistar.js +1 -1
  30. package/dist/skins/o2-classic.js +1 -1
  31. package/dist/skins/o2.js +1 -1
  32. package/dist/skins/telefonica.js +1 -1
  33. package/dist/skins/vivo.js +1 -1
  34. package/dist/switch-component.d.ts +1 -1
  35. package/dist/tabs.js +10 -8
  36. package/dist/tag.d.ts +2 -2
  37. package/dist/tag.js.flow +2 -2
  38. package/dist/text-field-base.js +80 -50
  39. package/dist/text-field-components.d.ts +1 -0
  40. package/dist/text-field-components.js +18 -9
  41. package/dist/text-field-components.js.flow +1 -0
  42. package/dist/text-link.d.ts +2 -2
  43. package/dist/text-link.js +20 -23
  44. package/dist/text-link.js.flow +2 -2
  45. package/dist/theme-context-provider.js +2 -2
  46. package/dist/theme.d.ts +2 -0
  47. package/dist/theme.js +8 -4
  48. package/dist/theme.js.flow +2 -0
  49. package/dist/utils/media-queries.d.ts +1 -0
  50. package/dist/utils/media-queries.js +6 -1
  51. package/dist/utils/media-queries.js.flow +1 -0
  52. package/dist-es/icon-button.js +4 -5
  53. package/dist-es/list.js +9 -14
  54. package/dist-es/navigation-bar.js +122 -88
  55. package/dist-es/password-field.js +16 -8
  56. package/dist-es/select.js +74 -65
  57. package/dist-es/skins/movistar.js +1 -1
  58. package/dist-es/skins/o2-classic.js +1 -1
  59. package/dist-es/skins/o2.js +1 -1
  60. package/dist-es/skins/telefonica.js +1 -1
  61. package/dist-es/skins/vivo.js +1 -1
  62. package/dist-es/tabs.js +10 -8
  63. package/dist-es/text-field-base.js +80 -50
  64. package/dist-es/text-field-components.js +18 -9
  65. package/dist-es/text-link.js +7 -10
  66. package/dist-es/theme-context-provider.js +2 -2
  67. package/dist-es/theme.js +8 -4
  68. package/dist-es/utils/media-queries.js +6 -1
  69. package/package.json +2 -1
@@ -17,6 +17,8 @@ var _responsiveLayout = _interopRequireDefault(require("./responsive-layout"));
17
17
 
18
18
  var _inline = _interopRequireDefault(require("./inline"));
19
19
 
20
+ var _box = _interopRequireDefault(require("./box"));
21
+
20
22
  var _touchable = _interopRequireDefault(require("./touchable"));
21
23
 
22
24
  var _text = require("./text");
@@ -398,54 +400,60 @@ var useStyles = (0, _jss.createUseStyles)(function (theme) {
398
400
  right: 0,
399
401
  zIndex: NAVBAR_ZINDEX
400
402
  },
403
+ notFixedPadding: {
404
+ width: '100%',
405
+ padding: function padding(_ref7) {
406
+ var paddingX = _ref7.paddingX;
407
+ return "0 ".concat(paddingX, "px");
408
+ }
409
+ },
401
410
  navbar: _defineProperty({
402
411
  width: '100%',
403
412
  display: 'flex',
404
413
  alignItems: 'center',
405
- background: function background(_ref7) {
406
- var isInverse = _ref7.isInverse;
414
+ background: function background(_ref8) {
415
+ var isInverse = _ref8.isInverse;
407
416
  return isInverse ? theme.colors.navigationBarBackground : theme.colors.background;
408
417
  },
409
418
  height: DESKTOP_NAVBAR_HEIGHT,
410
419
  padding: '16px 0',
411
- transition: 'border 300ms',
412
- borderBottom: "1px solid ".concat(theme.colors.divider),
413
- borderColor: function borderColor(_ref8) {
414
- var isInverse = _ref8.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;
415
427
  return isInverse && !theme.isDarkMode ? 'transparent' : theme.colors.divider;
416
428
  }
417
429
  }, theme.mq.tabletOrSmaller, {
418
- borderColor: function borderColor(_ref9) {
419
- var isMenuOpen = _ref9.isMenuOpen,
420
- isInverse = _ref9.isInverse;
430
+ transition: 'border-color 300ms',
431
+ borderColor: function borderColor(_ref11) {
432
+ var isMenuOpen = _ref11.isMenuOpen,
433
+ isInverse = _ref11.isInverse;
421
434
  return isMenuOpen || isInverse && !theme.isDarkMode ? 'transparent' : theme.colors.divider;
422
435
  },
423
436
  height: MOBILE_NAVBAR_HEIGHT,
424
437
  padding: '8px 0'
425
438
  }),
426
- section: {
439
+ section: _defineProperty({
427
440
  height: DESKTOP_NAVBAR_HEIGHT,
428
441
  display: 'flex',
429
442
  alignItems: 'center',
430
443
  padding: '0 8px',
431
444
  borderBottom: "2px solid transparent",
432
- transition: 'border-color 300ms ease-in-out',
433
- // Only apply hover effect to user agents using fine pointer devices (a mouse, for example)
434
- // Also enabled for (pointer: none) for acceptance tests, where (pointer: fine) doesn't match.
435
- // WARNING: you may be tempted to use @media (hover: hover) instead, but that doesn't work as expected in some android browsers.
436
- // See: https://hover-pointer-media-query.glitch.me/ and https://github.com/mui-org/material-ui/issues/15736
437
- '@media (pointer: fine), (pointer: none)': {
438
- '&:hover span': {
439
- color: function color(_ref10) {
440
- var isInverse = _ref10.isInverse;
441
- return isInverse ? theme.colors.textSecondaryInverse : theme.colors.textSecondary;
442
- }
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;
443
451
  }
444
452
  }
445
- },
453
+ }),
446
454
  selectedSection: {
447
- borderColor: function borderColor(_ref11) {
448
- var isInverse = _ref11.isInverse;
455
+ borderColor: function borderColor(_ref13) {
456
+ var isInverse = _ref13.isInverse;
449
457
  return isInverse ? theme.colors.inverse : theme.colors.controlActivated;
450
458
  }
451
459
  },
@@ -463,8 +471,8 @@ var useStyles = (0, _jss.createUseStyles)(function (theme) {
463
471
  height: "calc(100vh - ".concat(MOBILE_NAVBAR_HEIGHT, "px)"),
464
472
  overflowY: 'auto',
465
473
  background: theme.colors.background,
466
- boxShadow: function boxShadow(_ref12) {
467
- var menuTransitionState = _ref12.menuTransitionState;
474
+ boxShadow: function boxShadow(_ref14) {
475
+ var menuTransitionState = _ref14.menuTransitionState;
468
476
  return menuTransitionState !== 'closed' ? "6px 0 4px -4px rgba(0, 0, 0, ".concat(shadowAlpha, ")") : 'none';
469
477
  },
470
478
  transition: "transform ".concat(BURGER_MENU_ANIMATION_DURATION_MS, "ms ease-out")
@@ -480,21 +488,34 @@ var useStyles = (0, _jss.createUseStyles)(function (theme) {
480
488
  },
481
489
  burgerMenuExitActive: {
482
490
  transform: 'translate(-100vw)'
483
- }
491
+ },
492
+ iconButton: _defineProperty({
493
+ color: function color(_ref15) {
494
+ var isInverse = _ref15.isInverse;
495
+ return isInverse ? theme.colors.inverse : theme.colors.neutralHigh;
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;
502
+ }
503
+ }
504
+ })
484
505
  };
485
506
  });
486
507
 
487
- var MainNavigationBar = function MainNavigationBar(_ref13) {
508
+ var MainNavigationBar = function MainNavigationBar(_ref17) {
488
509
  var _logo;
489
510
 
490
- var sections = _ref13.sections,
491
- selectedIndex = _ref13.selectedIndex,
492
- right = _ref13.right,
493
- logo = _ref13.logo,
494
- _ref13$isInverse = _ref13.isInverse,
495
- isInverse = _ref13$isInverse === void 0 ? false : _ref13$isInverse,
496
- _ref13$topFixed = _ref13.topFixed,
497
- topFixed = _ref13$topFixed === void 0 ? true : _ref13$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;
498
519
 
499
520
  var _useTheme6 = (0, _hooks.useTheme)(),
500
521
  texts = _useTheme6.texts;
@@ -513,7 +534,8 @@ var MainNavigationBar = function MainNavigationBar(_ref13) {
513
534
  var classes = useStyles({
514
535
  isMenuOpen: isMenuOpen,
515
536
  isInverse: isInverse,
516
- menuTransitionState: menuTransitionState
537
+ menuTransitionState: menuTransitionState,
538
+ withBorder: true
517
539
  });
518
540
 
519
541
  var _useScreenSize2 = (0, _hooks.useScreenSize)(),
@@ -612,9 +634,9 @@ var MainNavigationBar = function MainNavigationBar(_ref13) {
612
634
  alignItems: "center"
613
635
  }, logo, /*#__PURE__*/React.createElement("nav", null, /*#__PURE__*/React.createElement(_inline.default, {
614
636
  space: 32
615
- }, sections.map(function (_ref14, idx) {
616
- var title = _ref14.title,
617
- touchableProps = _objectWithoutProperties(_ref14, _excluded);
637
+ }, sections.map(function (_ref18, idx) {
638
+ var title = _ref18.title,
639
+ touchableProps = _objectWithoutProperties(_ref18, _excluded);
618
640
 
619
641
  return /*#__PURE__*/React.createElement(_touchable.default, _extends({}, touchableProps, {
620
642
  key: idx,
@@ -629,16 +651,25 @@ var MainNavigationBar = function MainNavigationBar(_ref13) {
629
651
 
630
652
  exports.MainNavigationBar = MainNavigationBar;
631
653
 
632
- var NavigationBar = function NavigationBar(_ref15) {
633
- var onBack = _ref15.onBack,
634
- title = _ref15.title,
635
- right = _ref15.right,
636
- _ref15$isInverse = _ref15.isInverse,
637
- isInverse = _ref15$isInverse === void 0 ? false : _ref15$isInverse,
638
- _ref15$topFixed = _ref15.topFixed,
639
- topFixed = _ref15$topFixed === void 0 ? true : _ref15$topFixed;
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;
665
+
666
+ var _useTheme7 = (0, _hooks.useTheme)(),
667
+ texts = _useTheme7.texts;
668
+
640
669
  var classes = useStyles({
641
- isInverse: isInverse
670
+ isInverse: isInverse,
671
+ paddingX: paddingX !== null && paddingX !== void 0 ? paddingX : 0,
672
+ withBorder: withBorder
642
673
  });
643
674
  var content = /*#__PURE__*/React.createElement(_inline.default, {
644
675
  space: "between",
@@ -647,31 +678,40 @@ var NavigationBar = function NavigationBar(_ref15) {
647
678
  space: 24,
648
679
  alignItems: "center"
649
680
  }, onBack && /*#__PURE__*/React.createElement(_iconButton.default, {
650
- "aria-label": "back",
651
- onPress: onBack
652
- }, /*#__PURE__*/React.createElement(_iconChevronLeftRegular.default, null)), /*#__PURE__*/React.createElement(_text.Text3, {
653
- regular: true
654
- }, title)), right);
681
+ "aria-label": texts.backNavigationBar,
682
+ onPress: onBack,
683
+ className: classes.iconButton
684
+ }, /*#__PURE__*/React.createElement(_iconChevronLeftRegular.default, {
685
+ color: "currentColor"
686
+ })), /*#__PURE__*/React.createElement(_text.Text3, {
687
+ regular: true,
688
+ truncate: true
689
+ }, title)), /*#__PURE__*/React.createElement(_box.default, {
690
+ paddingLeft: 24
691
+ }, right));
655
692
  return /*#__PURE__*/React.createElement(_themeVariantContext.ThemeVariant, {
656
693
  isInverse: isInverse
657
694
  }, /*#__PURE__*/React.createElement("header", {
658
695
  className: (0, _classnames.default)(classes.navbar, _defineProperty({}, classes.topFixed, topFixed))
659
- }, topFixed ? /*#__PURE__*/React.createElement(_responsiveLayout.default, null, content) : content), topFixed && /*#__PURE__*/React.createElement("div", {
696
+ }, topFixed ? /*#__PURE__*/React.createElement(_responsiveLayout.default, null, content) : /*#__PURE__*/React.createElement("div", {
697
+ className: classes.notFixedPadding
698
+ }, content)), topFixed && /*#__PURE__*/React.createElement("div", {
660
699
  className: classes.spacer
661
700
  }));
662
701
  };
663
702
 
664
703
  exports.NavigationBar = NavigationBar;
665
704
 
666
- var FunnelNavigationBar = function FunnelNavigationBar(_ref16) {
667
- var logo = _ref16.logo,
668
- right = _ref16.right,
669
- _ref16$isInverse = _ref16.isInverse,
670
- isInverse = _ref16$isInverse === void 0 ? false : _ref16$isInverse,
671
- _ref16$topFixed = _ref16.topFixed,
672
- topFixed = _ref16$topFixed === void 0 ? true : _ref16$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;
673
712
  var classes = useStyles({
674
- isInverse: isInverse
713
+ isInverse: isInverse,
714
+ withBorder: true
675
715
  });
676
716
  return /*#__PURE__*/React.createElement(_themeVariantContext.ThemeVariant, {
677
717
  isInverse: isInverse
@@ -698,8 +738,8 @@ var useNavigationBarActionGroupStyles = (0, _jss.createUseStyles)(function () {
698
738
  };
699
739
  });
700
740
 
701
- var NavigationBarActionGroup = function NavigationBarActionGroup(_ref17) {
702
- var children = _ref17.children;
741
+ var NavigationBarActionGroup = function NavigationBarActionGroup(_ref21) {
742
+ var children = _ref21.children;
703
743
  var classes = useNavigationBarActionGroupStyles();
704
744
  return /*#__PURE__*/React.createElement("div", {
705
745
  className: classes.lineHeightFix
@@ -712,39 +752,34 @@ var NavigationBarActionGroup = function NavigationBarActionGroup(_ref17) {
712
752
  exports.NavigationBarActionGroup = NavigationBarActionGroup;
713
753
  var useNavigationBarActionStyles = (0, _jss.createUseStyles)(function (theme) {
714
754
  return {
715
- touchable: {
755
+ touchable: _defineProperty({
716
756
  lineHeight: 0,
717
757
  '& svg': {
718
- color: function color(_ref18) {
719
- var isInverse = _ref18.isInverse;
758
+ color: function color(_ref22) {
759
+ var isInverse = _ref22.isInverse;
720
760
  return isInverse ? theme.colors.inverse : theme.colors.neutralHigh;
721
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
+ }
722
769
  },
723
- // Only apply hover effect to user agents using fine pointer devices (a mouse, for example)
724
- // Also enabled for (pointer: none) for acceptance tests, where (pointer: fine) doesn't match.
725
- // WARNING: you may be tempted to use @media (hover: hover) instead, but that doesn't work as expected in some android browsers.
726
- // See: https://hover-pointer-media-query.glitch.me/ and https://github.com/mui-org/material-ui/issues/15736
727
- '@media (pointer: fine), (pointer: none)': {
728
- '&:hover span': {
729
- color: function color(_ref19) {
730
- var isInverse = _ref19.isInverse;
731
- return isInverse ? theme.colors.textSecondaryInverse : theme.colors.textSecondary;
732
- }
733
- },
734
- '&:hover svg': {
735
- color: function color(_ref20) {
736
- var isInverse = _ref20.isInverse;
737
- return isInverse ? theme.colors.inverse : theme.colors.neutralMedium;
738
- }
770
+ '&:hover svg': {
771
+ color: function color(_ref24) {
772
+ var isInverse = _ref24.isInverse;
773
+ return isInverse ? theme.colors.inverse : theme.colors.neutralMedium;
739
774
  }
740
775
  }
741
- }
776
+ })
742
777
  };
743
778
  });
744
779
 
745
- var NavigationBarAction = function NavigationBarAction(_ref21) {
746
- var children = _ref21.children,
747
- touchableProps = _objectWithoutProperties(_ref21, _excluded2);
780
+ var NavigationBarAction = function NavigationBarAction(_ref25) {
781
+ var children = _ref25.children,
782
+ touchableProps = _objectWithoutProperties(_ref25, _excluded2);
748
783
 
749
784
  var isInverse = (0, _themeVariantContext.useIsInverseVariant)();
750
785
  var classes = useNavigationBarActionStyles({
@@ -26,13 +26,26 @@ declare type MainNavigationBarProps = {
26
26
  topFixed?: boolean,
27
27
  };
28
28
  declare export var MainNavigationBar: React.ComponentType<MainNavigationBarProps>;
29
- declare type NavigationBarProps = {
29
+ declare type NavigationBarCommonProps = {|
30
30
  isInverse?: boolean,
31
31
  onBack?: () => void,
32
32
  title?: string,
33
33
  right?: React.Element<any>,
34
- topFixed?: boolean,
35
- };
34
+ withBorder?: boolean,
35
+ |};
36
+ declare type NavigationBarTopFixedProps = {|
37
+ ...$Exact<NavigationBarCommonProps>,
38
+ topFixed?: true,
39
+ |};
40
+ declare type NavigationBarNotFixedProps = {|
41
+ ...$Exact<NavigationBarCommonProps>,
42
+
43
+ topFixed: false,
44
+ paddingX?: number,
45
+ |};
46
+ declare type NavigationBarProps =
47
+ | NavigationBarTopFixedProps
48
+ | NavigationBarNotFixedProps;
36
49
  declare export var NavigationBar: React.ComponentType<NavigationBarProps>;
37
50
  declare type FunnelNavigationBarProps = {
38
51
  isInverse?: boolean,
@@ -41,7 +54,10 @@ declare type FunnelNavigationBarProps = {
41
54
  topFixed?: boolean,
42
55
  };
43
56
  declare export var FunnelNavigationBar: React.ComponentType<FunnelNavigationBarProps>;
44
- declare export var NavigationBarActionGroup: React.ComponentType<{}>;
57
+ declare type NavigationBarActionGroupProps = {
58
+ children: React.Node,
59
+ };
60
+ declare export var NavigationBarActionGroup: React.ComponentType<NavigationBarActionGroupProps>;
45
61
  declare type NavigationBarActionProps = TouchableProps;
46
62
  declare export var NavigationBarAction: React.ComponentType<NavigationBarActionProps>;
47
63
  declare export {};
@@ -1,5 +1,5 @@
1
1
  import * as React from 'react';
2
- declare type NavigationBreadcrumbsProps = {
2
+ export declare type NavigationBreadcrumbsProps = {
3
3
  title: string;
4
4
  breadcrumbs: ReadonlyArray<{
5
5
  readonly title: string;
@@ -1,7 +1,7 @@
1
1
  // @flow
2
2
 
3
3
  import * as React from "react";
4
- declare type NavigationBreadcrumbsProps = {
4
+ export type NavigationBreadcrumbsProps = {
5
5
  title: string,
6
6
  breadcrumbs: $ReadOnlyArray<{
7
7
  +title: string,
@@ -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,
@@ -12,7 +12,7 @@ export declare const useRadioContext: () => RadioContextType;
12
12
  declare type PropsRender = {
13
13
  value: string;
14
14
  id?: string;
15
- render: (radioElement: React.ReactElement<any>, disabled?: boolean) => React.ReactNode;
15
+ render: (radioElement: React.ReactElement, disabled?: boolean) => React.ReactNode;
16
16
  children?: undefined;
17
17
  dataAttributes?: DataAttributes;
18
18
  };
@@ -1,9 +1,10 @@
1
1
  import * as React from 'react';
2
2
  import TextLink from './text-link';
3
+ import type { TextLinkProps } from './text-link';
3
4
  declare type Props = {
4
5
  children: React.ReactNode;
5
6
  id?: string;
6
- right?: React.ReactElement<typeof TextLink>;
7
+ right?: React.ReactElement<TextLinkProps, typeof TextLink>;
7
8
  as?: 'h1' | 'h2' | 'h3' | 'h4';
8
9
  };
9
10
  declare const SectionTitle: React.FC<Props>;