@hero-design/rn 7.16.2 → 7.17.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 (122) hide show
  1. package/.turbo/turbo-build.log +2 -2
  2. package/es/index.js +331 -259
  3. package/lib/index.js +330 -258
  4. package/package.json +2 -2
  5. package/src/components/Accordion/__tests__/__snapshots__/AccordionItem.spec.tsx.snap +12 -12
  6. package/src/components/Accordion/__tests__/__snapshots__/index.spec.tsx.snap +18 -18
  7. package/src/components/Alert/__tests__/__snapshots__/index.spec.tsx.snap +26 -26
  8. package/src/components/Avatar/__tests__/__snapshots__/StyledAvatar.spec.tsx.snap +3 -3
  9. package/src/components/Avatar/__tests__/__snapshots__/index.spec.tsx.snap +2 -2
  10. package/src/components/Badge/__tests__/__snapshots__/Badge.spec.tsx.snap +1 -1
  11. package/src/components/Badge/__tests__/__snapshots__/Status.spec.tsx.snap +2 -2
  12. package/src/components/BottomNavigation/__tests__/__snapshots__/index.spec.tsx.snap +9 -9
  13. package/src/components/BottomSheet/__tests__/__snapshots__/index.spec.tsx.snap +12 -12
  14. package/src/components/Button/LoadingIndicator/__tests__/__snapshots__/StyledLoadingIndicator.spec.tsx.snap +2 -2
  15. package/src/components/Button/LoadingIndicator/__tests__/__snapshots__/index.spec.tsx.snap +6 -6
  16. package/src/components/Button/UtilityButton/__tests__/__snapshots__/index.spec.tsx.snap +6 -6
  17. package/src/components/Button/__tests__/__snapshots__/IconButton.spec.tsx.snap +1 -1
  18. package/src/components/Button/__tests__/__snapshots__/StyledButton.spec.tsx.snap +67 -67
  19. package/src/components/Calendar/__tests__/__snapshots__/CalendarRowItem.spec.tsx.snap +12 -12
  20. package/src/components/Card/__tests__/__snapshots__/StyledCard.spec.tsx.snap +1 -1
  21. package/src/components/Checkbox/__tests__/__snapshots__/StyledCheckbox.spec.tsx.snap +1 -1
  22. package/src/components/Checkbox/__tests__/__snapshots__/index.spec.tsx.snap +2 -2
  23. package/src/components/ContentNavigator/__tests__/__snapshots__/StyledContentNavigator.spec.tsx.snap +1 -1
  24. package/src/components/ContentNavigator/__tests__/__snapshots__/index.spec.tsx.snap +6 -6
  25. package/src/components/DatePicker/__tests__/__snapshots__/DatePickerAndroid.spec.tsx.snap +5 -5
  26. package/src/components/DatePicker/__tests__/__snapshots__/DatePickerIOS.spec.tsx.snap +12 -12
  27. package/src/components/Divider/__tests__/__snapshots__/StyledDivider.spec.tsx.snap +12 -12
  28. package/src/components/Drawer/__tests__/__snapshots__/index.spec.tsx.snap +3 -3
  29. package/src/components/Empty/__tests__/__snapshots__/index.spec.tsx.snap +3 -3
  30. package/src/components/FAB/ActionGroup/__tests__/__snapshots__/index.spec.tsx.snap +28 -28
  31. package/src/components/FAB/__tests__/__snapshots__/AnimatedFABIcon.spec.tsx.snap +2 -2
  32. package/src/components/FAB/__tests__/__snapshots__/StyledFAB.spec.tsx.snap +3 -3
  33. package/src/components/FAB/__tests__/__snapshots__/index.spec.tsx.snap +9 -9
  34. package/src/components/Icon/__tests__/__snapshots__/index.spec.tsx.snap +3 -3
  35. package/src/components/List/BasicListItem.tsx +8 -4
  36. package/src/components/List/__tests__/__snapshots__/BasicListItem.spec.tsx.snap +3 -3
  37. package/src/components/List/__tests__/__snapshots__/ListItem.spec.tsx.snap +20 -20
  38. package/src/components/List/__tests__/__snapshots__/StyledBasicListItem.spec.tsx.snap +6 -6
  39. package/src/components/List/__tests__/__snapshots__/StyledListItem.spec.tsx.snap +12 -12
  40. package/src/components/PinInput/__tests__/__snapshots__/PinCell.spec.tsx.snap +4 -4
  41. package/src/components/PinInput/__tests__/__snapshots__/index.spec.tsx.snap +22 -22
  42. package/src/components/Progress/ProgressCircle.tsx +25 -22
  43. package/src/components/Progress/StyledProgressCircle.tsx +33 -28
  44. package/src/components/Progress/__tests__/__snapshots__/index.spec.js.snap +102 -92
  45. package/src/components/Radio/__tests__/__snapshots__/Radio.spec.tsx.snap +5 -5
  46. package/src/components/Radio/__tests__/__snapshots__/RadioGroup.spec.tsx.snap +6 -6
  47. package/src/components/Radio/__tests__/__snapshots__/StyledRadio.spec.tsx.snap +3 -3
  48. package/src/components/RichTextEditor/__tests__/__snapshots__/EditorToolbar.spec.tsx.snap +11 -11
  49. package/src/components/RichTextEditor/__tests__/__snapshots__/RichTextEditor.spec.tsx.snap +6 -6
  50. package/src/components/SectionHeading/__tests__/__snapshots__/StyledHeading.spec.tsx.snap +1 -1
  51. package/src/components/SectionHeading/__tests__/__snapshots__/index.spec.tsx.snap +9 -9
  52. package/src/components/Select/MultiSelect/Option.tsx +20 -11
  53. package/src/components/Select/MultiSelect/OptionList.tsx +47 -41
  54. package/src/components/Select/MultiSelect/__tests__/OptionList.spec.tsx +25 -14
  55. package/src/components/Select/MultiSelect/__tests__/__snapshots__/Option.spec.tsx.snap +6 -4
  56. package/src/components/Select/MultiSelect/__tests__/__snapshots__/OptionList.spec.tsx.snap +1638 -134
  57. package/src/components/Select/MultiSelect/__tests__/__snapshots__/index.spec.tsx.snap +5312 -366
  58. package/src/components/Select/MultiSelect/__tests__/index.spec.tsx +122 -1
  59. package/src/components/Select/MultiSelect/index.tsx +26 -36
  60. package/src/components/Select/SingleSelect/Option.tsx +19 -3
  61. package/src/components/Select/SingleSelect/OptionList.tsx +47 -39
  62. package/src/components/Select/SingleSelect/__tests__/OptionList.spec.tsx +23 -12
  63. package/src/components/Select/SingleSelect/__tests__/__snapshots__/Option.spec.tsx.snap +5 -3
  64. package/src/components/Select/SingleSelect/__tests__/__snapshots__/OptionList.spec.tsx.snap +1632 -128
  65. package/src/components/Select/SingleSelect/__tests__/__snapshots__/index.spec.tsx.snap +4932 -302
  66. package/src/components/Select/SingleSelect/__tests__/index.spec.tsx +117 -1
  67. package/src/components/Select/SingleSelect/index.tsx +26 -37
  68. package/src/components/Select/StyledOptionList.tsx +43 -44
  69. package/src/components/Select/StyledSelect.tsx +7 -3
  70. package/src/components/Select/__tests__/StyledSelect.spec.tsx +1 -9
  71. package/src/components/Select/__tests__/__snapshots__/StyledSelect.spec.tsx.snap +2 -15
  72. package/src/components/Select/__tests__/helpers.spec.tsx +74 -0
  73. package/src/components/Select/helpers.tsx +87 -4
  74. package/src/components/Select/types.ts +99 -0
  75. package/src/components/Spinner/__tests__/__snapshots__/AnimatedSpinner.spec.tsx.snap +4 -4
  76. package/src/components/Spinner/__tests__/__snapshots__/StyledSpinner.spec.tsx.snap +8 -8
  77. package/src/components/Spinner/__tests__/__snapshots__/index.spec.tsx.snap +4 -4
  78. package/src/components/Switch/__tests__/__snapshots__/StyledHeading.spec.tsx.snap +1 -1
  79. package/src/components/Switch/__tests__/__snapshots__/index.spec.tsx.snap +2 -2
  80. package/src/components/Tabs/__tests__/__snapshots__/ScrollableTabs.spec.tsx.snap +6 -6
  81. package/src/components/Tabs/__tests__/__snapshots__/index.spec.tsx.snap +8 -8
  82. package/src/components/Tag/__tests__/__snapshots__/Tag.spec.tsx.snap +8 -8
  83. package/src/components/TextInput/__tests__/__snapshots__/StyledTextInput.spec.tsx.snap +50 -50
  84. package/src/components/TextInput/__tests__/__snapshots__/index.spec.tsx.snap +241 -85
  85. package/src/components/TextInput/__tests__/index.spec.tsx +29 -8
  86. package/src/components/TextInput/index.tsx +18 -7
  87. package/src/components/TimePicker/__tests__/__snapshots__/TimePickerAndroid.spec.tsx.snap +5 -5
  88. package/src/components/TimePicker/__tests__/__snapshots__/TimePickerIOS.spec.tsx.snap +12 -12
  89. package/src/components/Toast/__tests__/__snapshots__/Toast.spec.tsx.snap +22 -22
  90. package/src/components/Toolbar/__tests__/__snapshots__/ToolbarGroup.spec.tsx.snap +12 -12
  91. package/src/components/Toolbar/__tests__/__snapshots__/ToolbarItem.spec.tsx.snap +8 -8
  92. package/src/components/Typography/Text/__tests__/__snapshots__/StyledText.spec.tsx.snap +13 -13
  93. package/src/theme/__tests__/__snapshots__/index.spec.ts.snap +145 -146
  94. package/src/theme/components/alert.ts +3 -3
  95. package/src/theme/components/badge.ts +1 -1
  96. package/src/theme/components/card.ts +4 -4
  97. package/src/theme/components/list.ts +4 -4
  98. package/src/theme/components/pinInput.ts +2 -2
  99. package/src/theme/components/progress.ts +5 -5
  100. package/src/theme/components/select.ts +3 -3
  101. package/src/theme/components/toast.ts +3 -3
  102. package/src/theme/global/colors.ts +40 -39
  103. package/src/types.ts +7 -1
  104. package/types/components/List/BasicListItem.d.ts +1 -1
  105. package/types/components/Progress/StyledProgressCircle.d.ts +12 -6
  106. package/types/components/Select/MultiSelect/Option.d.ts +4 -2
  107. package/types/components/Select/MultiSelect/OptionList.d.ts +6 -7
  108. package/types/components/Select/MultiSelect/index.d.ts +5 -5
  109. package/types/components/Select/SingleSelect/Option.d.ts +4 -2
  110. package/types/components/Select/SingleSelect/OptionList.d.ts +6 -7
  111. package/types/components/Select/SingleSelect/index.d.ts +5 -5
  112. package/types/components/Select/StyledOptionList.d.ts +10 -16
  113. package/types/components/Select/StyledSelect.d.ts +8 -2
  114. package/types/components/Select/__tests__/helpers.spec.d.ts +1 -0
  115. package/types/components/Select/helpers.d.ts +14 -2
  116. package/types/components/Select/index.d.ts +1 -1
  117. package/types/components/Select/types.d.ts +32 -7
  118. package/types/components/TextInput/index.d.ts +4 -2
  119. package/types/theme/components/progress.d.ts +1 -2
  120. package/types/theme/components/select.d.ts +3 -3
  121. package/types/types.d.ts +2 -1
  122. package/src/components/Select/types.tsx +0 -52
package/lib/index.js CHANGED
@@ -2388,7 +2388,7 @@ var blue$1 = colorScales.blue,
2388
2388
  smalt = colorScales.smalt,
2389
2389
  violet$1 = colorScales.violet,
2390
2390
  yellow$1 = colorScales.yellow;
2391
- var palette$6 = {
2391
+ ({
2392
2392
  black: '#000000',
2393
2393
  white: '#ffffff',
2394
2394
  blue: blue$1.base,
@@ -2473,7 +2473,7 @@ var palette$6 = {
2473
2473
  yellowDark75: yellow$1.darken75,
2474
2474
  yellowLight60: yellow$1.lighten60,
2475
2475
  yellowLight90: yellow$1.lighten90
2476
- };
2476
+ });
2477
2477
  var maasstrichtBlue = colorScales.maasstrichtBlue,
2478
2478
  grey$1 = colorScales.grey,
2479
2479
  pastelRed$1 = colorScales.pastelRed,
@@ -2563,7 +2563,7 @@ _objectSpread2(_objectSpread2({}, palette$5), {}, {
2563
2563
  var scarletGum = colorScales.scarletGum,
2564
2564
  violet1 = colorScales.violet1;
2565
2565
 
2566
- _objectSpread2(_objectSpread2({}, palette$5), {}, {
2566
+ var palette$2 = _objectSpread2(_objectSpread2({}, palette$5), {}, {
2567
2567
  scarletGumLight30: scarletGum.lighten30,
2568
2568
  scarletGumLight50: scarletGum.lighten50,
2569
2569
  scarletGumLight80: scarletGum.lighten80,
@@ -2601,46 +2601,47 @@ _objectSpread2(_objectSpread2({}, palette$5), {}, {
2601
2601
  });
2602
2602
 
2603
2603
  var systemPalette = {
2604
- primary: palette$6.violet,
2605
- primaryLight: palette$6.violetLight60,
2606
- primaryDark: palette$6.purpleDark15,
2607
- primaryBackground: palette$6.violetLight90,
2604
+ primary: palette$2.violet,
2605
+ primaryLight: palette$2.violetLight50,
2606
+ primaryDark: palette$2.scarletGumLight30,
2607
+ primaryBackground: palette$2.violetLight90,
2608
2608
  primaryBackgroundDark: palette$5.maasstrichtBlueLight30,
2609
- secondary: palette$6.dodgerBlue,
2610
- secondaryLight: palette$6.dodgerBlueLight75,
2611
- secondaryBackground: palette$6.dodgerBlueLight90,
2612
- info: palette$6.dodgerBlue,
2609
+ secondary: palette$2.ultramarineBlue,
2610
+ secondaryLight: palette$2.vodka,
2611
+ secondaryBackground: palette$2.aliceBlue,
2612
+ info: palette$5.ultramarineBlue,
2613
2613
  infoMediumLight: palette$5.vodka,
2614
- infoLight: palette$6.dodgerBlueLight75,
2615
- infoBackground: palette$6.dodgerBlueLight90,
2616
- success: palette$6.green,
2614
+ infoLight: palette$5.vodka,
2615
+ infoBackground: palette$5.aliceBlue,
2616
+ success: palette$5.emerald,
2617
2617
  successLight: palette$5.emerald,
2618
- successDark: palette$6.greenDark30,
2619
- successBackground: palette$6.grotesqueGreenLight90,
2620
- danger: palette$6.red,
2618
+ successDark: palette$5.pineGreen,
2619
+ successBackground: palette$5.honeydew,
2620
+ danger: palette$5.vermilion,
2621
2621
  dangerMediumLight: palette$5.apple,
2622
- dangerLight: palette$6.redLight60,
2623
- dangerBackground: palette$6.redLight90,
2624
- warning: palette$6.orange,
2622
+ dangerLight: palette$5.pastelRed,
2623
+ dangerBackground: palette$5.linen,
2624
+ warning: palette$5.mellowApricot,
2625
2625
  warningLight: palette$5.mellowApricot,
2626
- warningDark: palette$6.orangeDark15,
2627
- warningBackground: palette$6.orangeLight90,
2628
- platformBackground: palette$6.white,
2629
- backgroundLight: palette$6.greyLight95,
2630
- backgroundDark: palette$6.greyDark75,
2631
- text: palette$6.greyDark75,
2632
- subduedText: palette$6.greyDark30,
2633
- disabledText: palette$6.greyDark15,
2634
- disabledLightText: palette$6.greyLight45,
2635
- invertedText: palette$6.white,
2636
- outline: palette$6.greyLight60,
2637
- archived: palette$6.greyLight45,
2626
+ warningDark: palette$5.deepSaffron,
2627
+ warningBackground: palette$5.seashell,
2628
+ platformBackground: palette$5.white,
2629
+ backgroundLight: palette$5.greyLight90,
2630
+ backgroundDark: palette$5.maasstrichtBlue,
2631
+ text: palette$5.maasstrichtBlue,
2632
+ subduedText: palette$5.maasstrichtBlueLight30,
2633
+ disabledText: palette$5.maasstrichtBlueLight50,
2634
+ disabledLightText: palette$5.greyLight30,
2635
+ invertedText: palette$5.white,
2636
+ outline: palette$5.greyLight75,
2637
+ archived: palette$5.greyLight45,
2638
2638
  archivedLight: palette$5.greyLight30,
2639
2639
  archivedDark: palette$5.sonicSilver,
2640
2640
  archivedBackground: palette$5.antiFlashWhite,
2641
- black: palette$6.black,
2642
- inactiveBackground: palette$6.greyDark30,
2643
- shadow: palette$6.greyLight60
2641
+ black: palette$5.black,
2642
+ inactiveBackground: palette$5.maasstrichtBlueLight50,
2643
+ shadow: palette$5.greyLight45 // waiting for new color
2644
+
2644
2645
  };
2645
2646
 
2646
2647
  var BASE_WIDTH = 390; // Based on iPhone 13's viewport size
@@ -2786,9 +2787,9 @@ var getAlertTheme = function getAlertTheme(theme) {
2786
2787
  var colors = {
2787
2788
  success: theme.colors.success,
2788
2789
  warning: theme.colors.warning,
2789
- error: theme.colors.danger,
2790
- info: theme.colors.infoMediumLight,
2791
- divider: theme.colors.backgroundLight
2790
+ error: theme.colors.dangerLight,
2791
+ info: theme.colors.infoLight,
2792
+ divider: theme.colors.outline
2792
2793
  };
2793
2794
  var sizes = {
2794
2795
  height: scale(48)
@@ -2858,7 +2859,7 @@ var getBadgeTheme = function getBadgeTheme(theme) {
2858
2859
  info: theme.colors.info,
2859
2860
  success: theme.colors.successDark,
2860
2861
  warning: theme.colors.warningDark,
2861
- archived: theme.colors.archived,
2862
+ archived: theme.colors.archivedDark,
2862
2863
  text: theme.colors.invertedText
2863
2864
  };
2864
2865
  var fonts = {
@@ -3052,12 +3053,12 @@ var getCalendarTheme = function getCalendarTheme(theme) {
3052
3053
 
3053
3054
  var getCardTheme = function getCardTheme(theme) {
3054
3055
  var colors = {
3055
- dataCardIndicator: theme.colors.primaryDark,
3056
+ dataCardIndicator: theme.colors.primary,
3056
3057
  indicator: {
3057
3058
  archived: theme.colors.archivedLight,
3058
- info: theme.colors.infoMediumLight,
3059
- success: theme.colors.successLight,
3060
- warning: theme.colors.warningLight,
3059
+ info: theme.colors.infoLight,
3060
+ success: theme.colors.success,
3061
+ warning: theme.colors.warning,
3061
3062
  danger: theme.colors.dangerMediumLight
3062
3063
  }
3063
3064
  };
@@ -3292,11 +3293,11 @@ var getListTheme = function getListTheme(theme) {
3292
3293
  highlightedListItemContainerBackground: theme.colors.primaryBackground,
3293
3294
  listItemContainerBackground: theme.colors.platformBackground,
3294
3295
  leadingStatus: {
3295
- danger: theme.colors.danger,
3296
+ danger: theme.colors.dangerMediumLight,
3296
3297
  info: theme.colors.infoLight,
3297
- success: theme.colors.successDark,
3298
- warning: theme.colors.warningLight,
3299
- archived: theme.colors.archived
3298
+ success: theme.colors.success,
3299
+ warning: theme.colors.warning,
3300
+ archived: theme.colors.archivedLight
3300
3301
  }
3301
3302
  };
3302
3303
  var space = {
@@ -3381,16 +3382,15 @@ var getProgressTheme = function getProgressTheme(theme) {
3381
3382
  var colors = {
3382
3383
  primary: theme.colors.primary,
3383
3384
  success: theme.colors.success,
3384
- warning: theme.colors.warning,
3385
+ warning: theme.colors.warningDark,
3385
3386
  danger: theme.colors.danger,
3386
3387
  info: theme.colors.info,
3387
3388
  background: theme.colors.outline,
3388
3389
  innerBackground: theme.colors.platformBackground
3389
3390
  };
3390
3391
  var sizes = {
3391
- radius: theme.space.xxxlarge,
3392
- strokeWidth: theme.space.small,
3393
- barHeight: theme.space.xsmall
3392
+ circleWidth: scale(76),
3393
+ barHeight: scale(4)
3394
3394
  };
3395
3395
  var radii = {
3396
3396
  "default": theme.radii.rounded
@@ -3487,9 +3487,9 @@ var getSelectTheme = function getSelectTheme(theme) {
3487
3487
  };
3488
3488
  var space = {
3489
3489
  minimumOptionListHeight: theme.space.xxxxlarge * 5,
3490
- optionPadding: theme.space.medium,
3491
- optionListPadding: theme.space.medium,
3492
- optionListSpacing: theme.space.xsmall,
3490
+ sectionSpacing: theme.space.smallMedium,
3491
+ optionSpacing: theme.space.xsmall,
3492
+ optionHorizontalMargin: theme.space.smallMedium,
3493
3493
  searchBarMarginTopSpacing: theme.space.small,
3494
3494
  searchBarHorizontalSpacing: theme.space.medium,
3495
3495
  searchBarBottomSpacing: theme.space.small
@@ -3741,9 +3741,9 @@ var getToastTheme = function getToastTheme(theme) {
3741
3741
  var colors = {
3742
3742
  success: theme.colors.success,
3743
3743
  warning: theme.colors.warning,
3744
- error: theme.colors.danger,
3745
- info: theme.colors.infoMediumLight,
3746
- divider: theme.colors.backgroundLight
3744
+ error: theme.colors.dangerLight,
3745
+ info: theme.colors.infoLight,
3746
+ divider: theme.colors.outline
3747
3747
  };
3748
3748
  var sizes = {
3749
3749
  height: scale(48)
@@ -18358,7 +18358,7 @@ function ContentNavigator(_ref) {
18358
18358
  }));
18359
18359
  }
18360
18360
 
18361
- var StyledContainer$3 = index$6(reactNative.View)(function (_ref) {
18361
+ var StyledContainer$4 = index$6(reactNative.View)(function (_ref) {
18362
18362
  var theme = _ref.theme;
18363
18363
  return {
18364
18364
  backgroundColor: theme.__hd__.calendar.colors.background
@@ -18547,7 +18547,7 @@ var Calendar = function Calendar(_ref) {
18547
18547
  var disableNextButton = maxDate === undefined ? false : !daysOfNextMonth.some(function (date) {
18548
18548
  return date !== undefined;
18549
18549
  }) || maxDate <= lastDateOfMonth;
18550
- return /*#__PURE__*/React__default["default"].createElement(StyledContainer$3, null, /*#__PURE__*/React__default["default"].createElement(StyledCalendarHeader, null, /*#__PURE__*/React__default["default"].createElement(ContentNavigator, {
18550
+ return /*#__PURE__*/React__default["default"].createElement(StyledContainer$4, null, /*#__PURE__*/React__default["default"].createElement(StyledCalendarHeader, null, /*#__PURE__*/React__default["default"].createElement(ContentNavigator, {
18551
18551
  value: formatTime('MMMM yyyy', visibleDate),
18552
18552
  onPreviousPress: onPreviousPress,
18553
18553
  onNextPress: onNextPress,
@@ -18722,7 +18722,7 @@ var CheckBox = function CheckBox(_ref) {
18722
18722
  }));
18723
18723
  };
18724
18724
 
18725
- var StyledContainer$2 = index$6(reactNative.View)(function (_ref) {
18725
+ var StyledContainer$3 = index$6(reactNative.View)(function (_ref) {
18726
18726
  var theme = _ref.theme;
18727
18727
  return {
18728
18728
  width: '100%',
@@ -18868,11 +18868,12 @@ var StyledErrorAndMaxLengthContainer = index$6(reactNative.View)(function () {
18868
18868
  };
18869
18869
  });
18870
18870
 
18871
- var _excluded$5 = ["label", "prefix", "suffix", "style", "textStyle", "testID", "accessibilityLabelledBy", "error", "required", "editable", "disabled", "maxLength", "helpText", "value", "defaultValue"];
18871
+ var _excluded$5 = ["label", "prefix", "suffix", "style", "textStyle", "testID", "accessibilityLabelledBy", "error", "required", "editable", "disabled", "loading", "maxLength", "helpText", "value", "defaultValue"];
18872
18872
  var getVariant = function getVariant(_ref) {
18873
18873
  var disabled = _ref.disabled,
18874
18874
  error = _ref.error,
18875
18875
  editable = _ref.editable,
18876
+ loading = _ref.loading,
18876
18877
  isFocused = _ref.isFocused,
18877
18878
  isEmptyValue = _ref.isEmptyValue;
18878
18879
 
@@ -18884,7 +18885,7 @@ var getVariant = function getVariant(_ref) {
18884
18885
  return 'error';
18885
18886
  }
18886
18887
 
18887
- if (!editable) {
18888
+ if (!editable || loading) {
18888
18889
  return 'readonly';
18889
18890
  }
18890
18891
 
@@ -18915,6 +18916,8 @@ var TextInput = function TextInput(_ref2) {
18915
18916
  editable = _ref2$editable === void 0 ? true : _ref2$editable,
18916
18917
  _ref2$disabled = _ref2.disabled,
18917
18918
  disabled = _ref2$disabled === void 0 ? false : _ref2$disabled,
18919
+ _ref2$loading = _ref2.loading,
18920
+ loading = _ref2$loading === void 0 ? false : _ref2$loading,
18918
18921
  maxLength = _ref2.maxLength,
18919
18922
  helpText = _ref2.helpText,
18920
18923
  value = _ref2.value,
@@ -18924,6 +18927,7 @@ var TextInput = function TextInput(_ref2) {
18924
18927
  var textInputReference = React.useRef(null);
18925
18928
  var displayText = (_ref3 = value !== undefined ? value : defaultValue) !== null && _ref3 !== void 0 ? _ref3 : '';
18926
18929
  var isEmptyValue = displayText.length === 0;
18930
+ var actualSuffix = loading ? 'loading' : suffix;
18927
18931
 
18928
18932
  var _React$useState = React__default["default"].useState(false),
18929
18933
  _React$useState2 = _slicedToArray(_React$useState, 2),
@@ -18934,12 +18938,13 @@ var TextInput = function TextInput(_ref2) {
18934
18938
  disabled: disabled,
18935
18939
  error: error,
18936
18940
  editable: editable,
18941
+ loading: loading,
18937
18942
  isFocused: isFocused,
18938
18943
  isEmptyValue: isEmptyValue
18939
18944
  });
18940
18945
  var shouldShowMaxLength = maxLength !== undefined;
18941
18946
  var theme = useTheme();
18942
- return /*#__PURE__*/React__default["default"].createElement(StyledContainer$2, {
18947
+ return /*#__PURE__*/React__default["default"].createElement(StyledContainer$3, {
18943
18948
  style: style,
18944
18949
  pointerEvents: variant === 'disabled' || variant === 'readonly' ? 'none' : 'auto',
18945
18950
  testID: testID
@@ -18956,7 +18961,7 @@ var TextInput = function TextInput(_ref2) {
18956
18961
  fontSize: "small",
18957
18962
  themeVariant: variant
18958
18963
  }, label)), typeof prefix === 'string' ? /*#__PURE__*/React__default["default"].createElement(Icon, {
18959
- intent: disabled ? 'disabled-text' : 'text',
18964
+ intent: variant === 'disabled' ? 'disabled-text' : 'text',
18960
18965
  testID: "input-prefix",
18961
18966
  icon: prefix,
18962
18967
  size: "xsmall"
@@ -18977,7 +18982,7 @@ var TextInput = function TextInput(_ref2) {
18977
18982
  }, textStyle]),
18978
18983
  testID: "text-input",
18979
18984
  accessibilityState: {
18980
- disabled: disabled
18985
+ disabled: variant === 'disabled' || variant === 'readonly'
18981
18986
  } // @ts-ignore
18982
18987
  ,
18983
18988
  accessibilityLabelledBy: accessibilityLabelledBy
@@ -19005,10 +19010,11 @@ var TextInput = function TextInput(_ref2) {
19005
19010
  },
19006
19011
  defaultValue: defaultValue,
19007
19012
  placeholder: variant === 'focused' ? nativeProps.placeholder : undefined
19008
- }))), typeof suffix === 'string' ? /*#__PURE__*/React__default["default"].createElement(Icon, {
19009
- intent: disabled ? 'disabled-text' : 'text',
19013
+ }))), typeof actualSuffix === 'string' ? /*#__PURE__*/React__default["default"].createElement(Icon, {
19014
+ intent: variant === 'disabled' ? 'disabled-text' : 'text',
19010
19015
  testID: "input-suffix",
19011
- icon: suffix,
19016
+ icon: actualSuffix,
19017
+ spin: actualSuffix === 'loading',
19012
19018
  size: "xsmall"
19013
19019
  }) : suffix), /*#__PURE__*/React__default["default"].createElement(StyledErrorAndHelpTextContainer, null, /*#__PURE__*/React__default["default"].createElement(StyledErrorAndMaxLengthContainer, null, error && /*#__PURE__*/React__default["default"].createElement(StyledErrorContainer$1, null, /*#__PURE__*/React__default["default"].createElement(Icon, {
19014
19020
  testID: "input-error-icon",
@@ -19176,7 +19182,7 @@ var DatePicker = function DatePicker(props) {
19176
19182
  };
19177
19183
 
19178
19184
  var AnimatedPressable = reactNative.Animated.createAnimatedComponent(reactNative.Pressable);
19179
- var StyledContainer$1 = index$6(reactNative.View)(function (_ref) {
19185
+ var StyledContainer$2 = index$6(reactNative.View)(function (_ref) {
19180
19186
  var theme = _ref.theme,
19181
19187
  enableShadow = _ref.enableShadow;
19182
19188
  return _objectSpread2(_objectSpread2({}, reactNative.StyleSheet.absoluteFillObject), {}, {
@@ -19241,7 +19247,7 @@ var Drawer = function Drawer(_ref) {
19241
19247
  return animation.stop();
19242
19248
  };
19243
19249
  }, [visible]);
19244
- return /*#__PURE__*/React__default["default"].createElement(StyledContainer$1, {
19250
+ return /*#__PURE__*/React__default["default"].createElement(StyledContainer$2, {
19245
19251
  testID: testID,
19246
19252
  enableShadow: enableShadow,
19247
19253
  pointerEvents: "box-none"
@@ -19492,7 +19498,7 @@ var ActionItem = function ActionItem(_ref) {
19492
19498
  }), /*#__PURE__*/React__default["default"].createElement(StyledActionItemText, null, title));
19493
19499
  };
19494
19500
 
19495
- var StyledContainer = index$6(reactNative.View)({
19501
+ var StyledContainer$1 = index$6(reactNative.View)({
19496
19502
  position: 'absolute',
19497
19503
  left: 0,
19498
19504
  right: 0,
@@ -19580,7 +19586,7 @@ var ActionGroup = function ActionGroup(_ref2) {
19580
19586
  inputRange: [0, 1],
19581
19587
  outputRange: [0, 1]
19582
19588
  });
19583
- return /*#__PURE__*/React__default["default"].createElement(StyledContainer, {
19589
+ return /*#__PURE__*/React__default["default"].createElement(StyledContainer$1, {
19584
19590
  testID: testID,
19585
19591
  pointerEvents: "box-none",
19586
19592
  style: style
@@ -19791,10 +19797,10 @@ var BasicListItem = function BasicListItem(_ref) {
19791
19797
  underlayColor: theme.__hd__.list.colors.highlightedListItemContainerBackground
19792
19798
  }, /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, prefix && /*#__PURE__*/React__default["default"].createElement(StyledPrefixContainer, null, typeof prefix === 'string' ? /*#__PURE__*/React__default["default"].createElement(Icon, {
19793
19799
  icon: prefix
19794
- }) : prefix), /*#__PURE__*/React__default["default"].createElement(StyledTitleContainer, null, /*#__PURE__*/React__default["default"].createElement(Typography.Text, {
19800
+ }) : prefix), /*#__PURE__*/React__default["default"].createElement(StyledTitleContainer, null, typeof title === 'string' ? /*#__PURE__*/React__default["default"].createElement(Typography.Text, {
19795
19801
  intent: "body",
19796
19802
  fontSize: "large"
19797
- }, title), subtitle && /*#__PURE__*/React__default["default"].createElement(Typography.Text, {
19803
+ }, title) : title, subtitle && /*#__PURE__*/React__default["default"].createElement(Typography.Text, {
19798
19804
  intent: "subdued",
19799
19805
  fontSize: "small"
19800
19806
  }, subtitle)), suffix && /*#__PURE__*/React__default["default"].createElement(StyledSuffixContainer, null, typeof suffix === 'string' ? /*#__PURE__*/React__default["default"].createElement(Icon, {
@@ -20030,41 +20036,52 @@ function PinInput(_ref2) {
20030
20036
  }));
20031
20037
  }
20032
20038
 
20033
- var HalfCircleWrapper = index$6(reactNative.View)(function (_ref) {
20039
+ var INNER_CIRCLE_PERCENTAGE = 0.85; // 85% width according to design
20040
+
20041
+ var STROKE_WIDTH_PERCENTAGE = 0.075; // 7.5% width according to design
20042
+
20043
+ var StyledContainer = index$6(reactNative.View)(function (_ref) {
20034
20044
  var theme = _ref.theme;
20035
20045
  return {
20036
- width: theme.__hd__.progress.sizes.radius,
20037
- height: theme.__hd__.progress.sizes.radius * 2,
20046
+ flexDirection: 'row',
20047
+ borderRadius: theme.__hd__.progress.radii["default"]
20048
+ };
20049
+ });
20050
+ var StyledHalfCircleWrapper = index$6(reactNative.View)(function (_ref2) {
20051
+ var theme = _ref2.theme;
20052
+ return {
20053
+ width: theme.__hd__.progress.sizes.circleWidth / 2,
20054
+ height: theme.__hd__.progress.sizes.circleWidth,
20038
20055
  overflow: 'hidden'
20039
20056
  };
20040
20057
  });
20041
- var HalfCircleInnerFG = index$6(reactNative.View)(function (_ref2) {
20042
- var theme = _ref2.theme,
20043
- themeIntent = _ref2.themeIntent;
20058
+ var StyledHalfCircleInnerFG = index$6(reactNative.View)(function (_ref3) {
20059
+ var theme = _ref3.theme,
20060
+ themeIntent = _ref3.themeIntent;
20044
20061
  return {
20045
- width: theme.__hd__.progress.sizes.radius * 2,
20046
- height: theme.__hd__.progress.sizes.radius * 2,
20062
+ width: theme.__hd__.progress.sizes.circleWidth,
20063
+ height: theme.__hd__.progress.sizes.circleWidth,
20047
20064
  backgroundColor: theme.__hd__.progress.colors[themeIntent],
20048
20065
  borderRadius: theme.__hd__.progress.radii["default"]
20049
20066
  };
20050
20067
  });
20051
- var HalfCircleInnerBG = index$6(reactNative.View)(function (_ref3) {
20052
- var theme = _ref3.theme;
20068
+ var StyledHalfCircleInnerBG = index$6(reactNative.View)(function (_ref4) {
20069
+ var theme = _ref4.theme;
20053
20070
  return {
20054
- width: theme.__hd__.progress.sizes.radius * 2,
20055
- height: theme.__hd__.progress.sizes.radius * 2,
20071
+ width: theme.__hd__.progress.sizes.circleWidth,
20072
+ height: theme.__hd__.progress.sizes.circleWidth,
20056
20073
  backgroundColor: theme.__hd__.progress.colors.background,
20057
20074
  borderRadius: theme.__hd__.progress.radii["default"]
20058
20075
  };
20059
20076
  });
20060
- var DonutCircle = index$6(reactNative.View)(function (_ref4) {
20061
- var theme = _ref4.theme;
20077
+ var StyledDonutCircle = index$6(reactNative.View)(function (_ref5) {
20078
+ var theme = _ref5.theme;
20062
20079
  return {
20063
20080
  position: 'absolute',
20064
- top: theme.__hd__.progress.sizes.strokeWidth,
20065
- left: theme.__hd__.progress.sizes.strokeWidth,
20066
- width: theme.__hd__.progress.sizes.radius * 2 - theme.__hd__.progress.sizes.strokeWidth * 2,
20067
- height: theme.__hd__.progress.sizes.radius * 2 - theme.__hd__.progress.sizes.strokeWidth * 2,
20081
+ top: theme.__hd__.progress.sizes.circleWidth * STROKE_WIDTH_PERCENTAGE,
20082
+ left: theme.__hd__.progress.sizes.circleWidth * STROKE_WIDTH_PERCENTAGE,
20083
+ width: theme.__hd__.progress.sizes.circleWidth * INNER_CIRCLE_PERCENTAGE,
20084
+ height: theme.__hd__.progress.sizes.circleWidth * INNER_CIRCLE_PERCENTAGE,
20068
20085
  zIndex: 3,
20069
20086
  backgroundColor: theme.__hd__.progress.colors.innerBackground,
20070
20087
  borderRadius: theme.__hd__.progress.radii["default"],
@@ -20072,15 +20089,15 @@ var DonutCircle = index$6(reactNative.View)(function (_ref4) {
20072
20089
  justifyContent: 'center'
20073
20090
  };
20074
20091
  });
20075
- var StrokeEnd = index$6(reactNative.View)(function (_ref5) {
20076
- var theme = _ref5.theme,
20077
- themeIntent = _ref5.themeIntent;
20092
+ var StyledStrokeEnd = index$6(reactNative.View)(function (_ref6) {
20093
+ var theme = _ref6.theme,
20094
+ themeIntent = _ref6.themeIntent;
20078
20095
  return {
20079
20096
  position: 'absolute',
20080
20097
  top: 0,
20081
- left: theme.__hd__.progress.sizes.radius - theme.__hd__.progress.sizes.strokeWidth / 2,
20082
- width: theme.__hd__.progress.sizes.strokeWidth,
20083
- height: theme.__hd__.progress.sizes.strokeWidth,
20098
+ left: theme.__hd__.progress.sizes.circleWidth / 2 - theme.__hd__.progress.sizes.circleWidth * STROKE_WIDTH_PERCENTAGE / 2,
20099
+ width: theme.__hd__.progress.sizes.circleWidth * STROKE_WIDTH_PERCENTAGE,
20100
+ height: theme.__hd__.progress.sizes.circleWidth * STROKE_WIDTH_PERCENTAGE,
20084
20101
  borderRadius: theme.__hd__.progress.radii["default"],
20085
20102
  backgroundColor: theme.__hd__.progress.colors[themeIntent],
20086
20103
  zIndex: 2
@@ -20093,7 +20110,7 @@ var HalfCircle = function HalfCircle(_ref) {
20093
20110
  var type = _ref.type,
20094
20111
  _ref$themeIntent = _ref.themeIntent,
20095
20112
  themeIntent = _ref$themeIntent === void 0 ? 'primary' : _ref$themeIntent;
20096
- return /*#__PURE__*/React__default["default"].createElement(HalfCircleWrapper, null, type === 'background' ? /*#__PURE__*/React__default["default"].createElement(HalfCircleInnerBG, null) : /*#__PURE__*/React__default["default"].createElement(HalfCircleInnerFG, {
20113
+ return /*#__PURE__*/React__default["default"].createElement(StyledHalfCircleWrapper, null, type === 'background' ? /*#__PURE__*/React__default["default"].createElement(StyledHalfCircleInnerBG, null) : /*#__PURE__*/React__default["default"].createElement(StyledHalfCircleInnerFG, {
20097
20114
  themeIntent: themeIntent
20098
20115
  }));
20099
20116
  };
@@ -20107,7 +20124,7 @@ var ProgressCircle = function ProgressCircle(_ref2) {
20107
20124
  nativeProps = _objectWithoutProperties(_ref2, _excluded$3);
20108
20125
 
20109
20126
  var theme = useTheme$1();
20110
- var radius = theme.__hd__.progress.sizes.radius;
20127
+ var radius = theme.__hd__.progress.sizes.circleWidth / 2;
20111
20128
  var progressAnimatedValue = React.useRef(new reactNative.Animated.Value(0));
20112
20129
  React.useEffect(function () {
20113
20130
  var animation = reactNative.Animated.timing(progressAnimatedValue.current, {
@@ -20145,11 +20162,7 @@ var ProgressCircle = function ProgressCircle(_ref2) {
20145
20162
  return /*#__PURE__*/React__default["default"].createElement(reactNative.View, _extends$1({}, nativeProps, {
20146
20163
  testID: testID,
20147
20164
  style: style
20148
- }), /*#__PURE__*/React__default["default"].createElement(reactNative.View, {
20149
- style: {
20150
- flexDirection: 'row'
20151
- }
20152
- }, /*#__PURE__*/React__default["default"].createElement(reactNative.View, null, /*#__PURE__*/React__default["default"].createElement(HalfCircle, {
20165
+ }), /*#__PURE__*/React__default["default"].createElement(StyledContainer, null, /*#__PURE__*/React__default["default"].createElement(reactNative.View, null, /*#__PURE__*/React__default["default"].createElement(HalfCircle, {
20153
20166
  type: "foreground",
20154
20167
  themeIntent: intent
20155
20168
  }), /*#__PURE__*/React__default["default"].createElement(reactNative.Animated.View, {
@@ -20169,7 +20182,8 @@ var ProgressCircle = function ProgressCircle(_ref2) {
20169
20182
  transform: [{
20170
20183
  rotate: '180deg'
20171
20184
  }],
20172
- zIndex: 1
20185
+ zIndex: 1,
20186
+ marginLeft: -0.1
20173
20187
  }
20174
20188
  }, /*#__PURE__*/React__default["default"].createElement(HalfCircle, {
20175
20189
  type: "foreground",
@@ -20187,7 +20201,7 @@ var ProgressCircle = function ProgressCircle(_ref2) {
20187
20201
  })
20188
20202
  }, /*#__PURE__*/React__default["default"].createElement(HalfCircle, {
20189
20203
  type: "background"
20190
- }))), /*#__PURE__*/React__default["default"].createElement(StrokeEnd, {
20204
+ }))), /*#__PURE__*/React__default["default"].createElement(StyledStrokeEnd, {
20191
20205
  themeIntent: intent
20192
20206
  }), /*#__PURE__*/React__default["default"].createElement(reactNative.Animated.View, {
20193
20207
  style: _objectSpread2(_objectSpread2({}, reactNative.StyleSheet.absoluteFillObject), {}, {
@@ -20196,10 +20210,10 @@ var ProgressCircle = function ProgressCircle(_ref2) {
20196
20210
  rotate: interpolateDotRotate
20197
20211
  }]
20198
20212
  })
20199
- }, /*#__PURE__*/React__default["default"].createElement(StrokeEnd, {
20213
+ }, /*#__PURE__*/React__default["default"].createElement(StyledStrokeEnd, {
20200
20214
  themeIntent: intent
20201
- })), /*#__PURE__*/React__default["default"].createElement(DonutCircle, null, /*#__PURE__*/React__default["default"].createElement(Typography.Text, {
20202
- fontSize: "xlarge"
20215
+ })), /*#__PURE__*/React__default["default"].createElement(StyledDonutCircle, null, /*#__PURE__*/React__default["default"].createElement(Typography.Text, {
20216
+ fontSize: "large"
20203
20217
  }, "".concat(value, "%")))));
20204
20218
  };
20205
20219
 
@@ -20453,7 +20467,7 @@ var Radio = function Radio(_ref) {
20453
20467
  })));
20454
20468
  };
20455
20469
 
20456
- function getKey$1(option, index, keyExtractor) {
20470
+ function getKey(option, index, keyExtractor) {
20457
20471
  var key = '';
20458
20472
 
20459
20473
  if (keyExtractor !== undefined) {
@@ -20479,7 +20493,7 @@ var RadioGroup = function RadioGroup(_ref) {
20479
20493
  testID: testID
20480
20494
  }, options.map(function (option, index) {
20481
20495
  return /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, {
20482
- key: getKey$1(option, index, keyExtractor)
20496
+ key: getKey(option, index, keyExtractor)
20483
20497
  }, index !== 0 && /*#__PURE__*/React__default["default"].createElement(Spacer, null), /*#__PURE__*/React__default["default"].createElement(Radio, {
20484
20498
  text: option.text,
20485
20499
  checked: option.value === value,
@@ -20561,20 +20575,26 @@ var SectionHeading = function SectionHeading(_ref) {
20561
20575
  }, text)), rightChildren);
20562
20576
  };
20563
20577
 
20564
- index$6(reactNative.View)(function (_ref) {
20578
+ var SectionSpacer = index$6(reactNative.View)(function (_ref) {
20565
20579
  var theme = _ref.theme;
20566
20580
  return {
20567
- marginTop: theme.__hd__.select.space.optionListSpacing
20581
+ marginTop: theme.__hd__.select.space.sectionSpacing
20568
20582
  };
20569
20583
  });
20570
- var FooterText = index$6(Typography.Text)(function (_ref2) {
20584
+ var OptionSpacer = index$6(reactNative.View)(function (_ref2) {
20571
20585
  var theme = _ref2.theme;
20572
20586
  return {
20573
- color: theme.__hd__.select.colors.footerText
20587
+ marginTop: theme.__hd__.select.space.optionSpacing
20574
20588
  };
20575
20589
  });
20576
- var StyledSearchBar = index$6(reactNative.View)(function (_ref3) {
20590
+ var FooterText = index$6(Typography.Text)(function (_ref3) {
20577
20591
  var theme = _ref3.theme;
20592
+ return {
20593
+ color: theme.__hd__.select.colors.footerText
20594
+ };
20595
+ });
20596
+ var StyledSearchBar = index$6(reactNative.View)(function (_ref4) {
20597
+ var theme = _ref4.theme;
20578
20598
  return {
20579
20599
  marginTop: theme.__hd__.select.space.searchBarMarginTopSpacing,
20580
20600
  paddingHorizontal: theme.__hd__.select.space.searchBarHorizontalSpacing,
@@ -20593,18 +20613,70 @@ var Footer = function Footer(_ref) {
20593
20613
  }, label));
20594
20614
  };
20595
20615
 
20596
- var getKey = function getKey(option, index, keyExtractor) {
20597
- var key = '';
20616
+ var isSections = function isSections(options) {
20617
+ var firstOption = options[0];
20618
+ return firstOption !== undefined && firstOption.category !== undefined;
20619
+ };
20620
+ var toSections = function toSections(options) {
20621
+ if (isSections(options)) {
20622
+ return options;
20623
+ }
20598
20624
 
20599
- if (keyExtractor !== undefined) {
20600
- key = keyExtractor(option, index);
20601
- } else if (option.key !== undefined) {
20602
- key = option.key;
20603
- } else {
20604
- key = index;
20625
+ return [{
20626
+ category: '',
20627
+ data: options
20628
+ }];
20629
+ };
20630
+ var toFlatOptions = function toFlatOptions(options) {
20631
+ if (isSections(options)) {
20632
+ return options.flatMap(function (opt) {
20633
+ return opt.data;
20634
+ });
20605
20635
  }
20606
20636
 
20607
- return key;
20637
+ return options;
20638
+ };
20639
+ var getScrollParams = function getScrollParams(value, sections) {
20640
+ var itemIndex = -1;
20641
+ var sectionIndex = sections.findIndex(function (section) {
20642
+ itemIndex = section.data.findIndex(function (opt) {
20643
+ return opt.value === value;
20644
+ });
20645
+ return itemIndex !== -1;
20646
+ });
20647
+ return {
20648
+ sectionIndex: sectionIndex < 0 ? 0 : sectionIndex,
20649
+ itemIndex: itemIndex < 0 ? 0 : itemIndex
20650
+ };
20651
+ };
20652
+ var useKeyboard = function useKeyboard() {
20653
+ var _useState = React.useState(false),
20654
+ _useState2 = _slicedToArray(_useState, 2),
20655
+ isKeyboardVisible = _useState2[0],
20656
+ setKeyboardVisible = _useState2[1];
20657
+
20658
+ var _useState3 = React.useState(0),
20659
+ _useState4 = _slicedToArray(_useState3, 2),
20660
+ keyboardHeight = _useState4[0],
20661
+ setKeyboardHeight = _useState4[1];
20662
+
20663
+ React.useEffect(function () {
20664
+ var keyboardWillShowListener = reactNative.Keyboard.addListener('keyboardWillShow', function (e) {
20665
+ setKeyboardVisible(true);
20666
+ setKeyboardHeight(e.endCoordinates.height);
20667
+ });
20668
+ var keyboardWillHideListener = reactNative.Keyboard.addListener('keyboardWillHide', function () {
20669
+ setKeyboardVisible(false);
20670
+ });
20671
+ return function () {
20672
+ keyboardWillShowListener.remove();
20673
+ keyboardWillHideListener.remove();
20674
+ };
20675
+ }, []);
20676
+ return {
20677
+ isKeyboardVisible: isKeyboardVisible,
20678
+ keyboardHeight: keyboardHeight
20679
+ };
20608
20680
  };
20609
20681
 
20610
20682
  var StyledOptionList = function StyledOptionList(_ref) {
@@ -20612,26 +20684,23 @@ var StyledOptionList = function StyledOptionList(_ref) {
20612
20684
  loading = _ref.loading,
20613
20685
  onEndReached = _ref.onEndReached,
20614
20686
  onQueryChange = _ref.onQueryChange,
20615
- options = _ref.options,
20616
- RenderItem = _ref.RenderItem,
20617
- _ref$scrollIndex = _ref.scrollIndex,
20618
- scrollIndex = _ref$scrollIndex === void 0 ? 0 : _ref$scrollIndex;
20687
+ sections = _ref.sections,
20688
+ renderItem = _ref.renderItem,
20689
+ scrollParams = _ref.scrollParams;
20619
20690
  var theme = useTheme$1();
20620
- var flatListRef = React.useRef(null);
20691
+ var sectionListRef = React.useRef(null);
20621
20692
 
20622
20693
  var _useState = React.useState(false),
20623
20694
  _useState2 = _slicedToArray(_useState, 2),
20624
20695
  onEndReachedCalled = _useState2[0],
20625
20696
  setOnEndReachedCalled = _useState2[1];
20626
20697
 
20627
- return /*#__PURE__*/React__default["default"].createElement(reactNative.FlatList, {
20628
- ref: flatListRef,
20629
- style: _objectSpread2({
20630
- paddingHorizontal: theme.__hd__.select.space.optionListPadding
20631
- }, onQueryChange ? {
20698
+ return /*#__PURE__*/React__default["default"].createElement(reactNative.SectionList, {
20699
+ ref: sectionListRef,
20700
+ style: _objectSpread2({}, onQueryChange ? {
20632
20701
  height: reactNative.Dimensions.get('screen').height
20633
20702
  } : {}),
20634
- data: options,
20703
+ sections: sections,
20635
20704
  keyExtractor: keyExtractor,
20636
20705
  onEndReachedThreshold: 0.1,
20637
20706
  onEndReached: function onEndReached() {
@@ -20639,11 +20708,9 @@ var StyledOptionList = function StyledOptionList(_ref) {
20639
20708
  },
20640
20709
  onScrollToIndexFailed: function onScrollToIndexFailed() {},
20641
20710
  onContentSizeChange: function onContentSizeChange() {
20642
- var _flatListRef$current;
20711
+ var _sectionListRef$curre;
20643
20712
 
20644
- return options.length && ((_flatListRef$current = flatListRef.current) === null || _flatListRef$current === void 0 ? void 0 : _flatListRef$current.scrollToIndex({
20645
- index: scrollIndex
20646
- }));
20713
+ return sections.length && ((_sectionListRef$curre = sectionListRef.current) === null || _sectionListRef$curre === void 0 ? void 0 : _sectionListRef$curre.scrollToLocation(scrollParams));
20647
20714
  },
20648
20715
  onMomentumScrollBegin: function onMomentumScrollBegin() {
20649
20716
  if (onEndReached && onEndReachedCalled && !loading) onEndReached();
@@ -20656,30 +20723,37 @@ var StyledOptionList = function StyledOptionList(_ref) {
20656
20723
  height: theme.space.xxxxlarge
20657
20724
  }
20658
20725
  }, /*#__PURE__*/React__default["default"].createElement(Spinner, null)) : null,
20659
- renderItem: function renderItem(_ref2) {
20660
- var item = _ref2.item,
20661
- index = _ref2.index;
20662
- return /*#__PURE__*/React__default["default"].createElement(reactNative.View, {
20663
- key: getKey(item, index, keyExtractor)
20664
- }, /*#__PURE__*/React__default["default"].createElement(RenderItem, {
20665
- item: item
20666
- }));
20667
- }
20726
+ renderSectionHeader: function renderSectionHeader(_ref2) {
20727
+ var category = _ref2.section.category;
20728
+ return category !== '' ? /*#__PURE__*/React__default["default"].createElement(SectionHeading, {
20729
+ text: category,
20730
+ style: {
20731
+ marginBottom: 0
20732
+ }
20733
+ }) : null;
20734
+ },
20735
+ renderItem: renderItem,
20736
+ ItemSeparatorComponent: OptionSpacer,
20737
+ SectionSeparatorComponent: SectionSpacer
20668
20738
  });
20669
20739
  };
20670
20740
 
20671
20741
  var Option$1 = function Option(_ref) {
20672
20742
  var text = _ref.text,
20743
+ _ref$disabled = _ref.disabled,
20744
+ disabled = _ref$disabled === void 0 ? false : _ref$disabled,
20673
20745
  selected = _ref.selected,
20674
20746
  onPress = _ref.onPress;
20747
+ var theme = useTheme();
20675
20748
  return /*#__PURE__*/React__default["default"].createElement(List.BasicItem, {
20676
20749
  selected: selected,
20750
+ disabled: disabled,
20677
20751
  onPress: onPress,
20678
20752
  title: text,
20679
- suffix: selected ? /*#__PURE__*/React__default["default"].createElement(Icon, {
20680
- icon: "checkmark",
20681
- size: "small"
20682
- }) : undefined
20753
+ suffix: selected ? 'checkmark' : undefined,
20754
+ style: {
20755
+ marginHorizontal: theme.__hd__.select.space.optionHorizontalMargin
20756
+ }
20683
20757
  });
20684
20758
  };
20685
20759
 
@@ -20687,51 +20761,62 @@ var OptionList$1 = function OptionList(_ref) {
20687
20761
  var keyExtractor = _ref.keyExtractor,
20688
20762
  loading = _ref.loading,
20689
20763
  onEndReached = _ref.onEndReached,
20690
- _onPress = _ref.onPress,
20764
+ onPress = _ref.onPress,
20691
20765
  onQueryChange = _ref.onQueryChange,
20692
- options = _ref.options,
20766
+ sections = _ref.sections,
20767
+ renderOption = _ref.renderOption,
20693
20768
  value = _ref.value;
20694
20769
  var firstValue = value === null || value === void 0 ? void 0 : value[0];
20695
- var rawScrollIndex = firstValue ? options.findIndex(function (option) {
20696
- return option.value === firstValue;
20697
- }) : 0;
20698
- var scrollIndex = rawScrollIndex - 2 >= 0 ? rawScrollIndex - 2 : 0;
20699
- var RenderItem = /*#__PURE__*/React__default["default"].memo(function (_ref2) {
20700
- var item = _ref2.item;
20701
- return /*#__PURE__*/React__default["default"].createElement(Option$1, {
20702
- text: item.text,
20703
- selected: value.includes(item.value),
20704
- onPress: function onPress() {
20705
- if (value.includes(item.value)) {
20706
- _onPress(value.filter(function (val) {
20707
- return val !== item.value;
20708
- }));
20709
- } else {
20710
- _onPress([].concat(_toConsumableArray(value), [item.value]));
20711
- }
20770
+ var scrollParams = getScrollParams(firstValue, sections);
20771
+
20772
+ var renderItem = function renderItem(info) {
20773
+ var item = info.item;
20774
+ var selected = value.includes(info.item.value);
20775
+
20776
+ var onItemPress = function onItemPress() {
20777
+ if (value.includes(info.item.value)) {
20778
+ onPress(value.filter(function (val) {
20779
+ return val !== info.item.value;
20780
+ }));
20781
+ } else {
20782
+ onPress([].concat(_toConsumableArray(value), [info.item.value]));
20712
20783
  }
20784
+ };
20785
+
20786
+ return renderOption ? renderOption(_objectSpread2(_objectSpread2({}, info), {}, {
20787
+ selected: selected,
20788
+ onPress: onItemPress
20789
+ })) : /*#__PURE__*/React__default["default"].createElement(Option$1, {
20790
+ selected: selected,
20791
+ text: item.text,
20792
+ disabled: item.disabled,
20793
+ onPress: onItemPress
20713
20794
  });
20714
- });
20795
+ };
20796
+
20715
20797
  return /*#__PURE__*/React__default["default"].createElement(StyledOptionList, {
20716
20798
  keyExtractor: keyExtractor,
20717
20799
  loading: loading,
20718
20800
  onEndReached: onEndReached,
20719
20801
  onQueryChange: onQueryChange,
20720
- options: options,
20721
- RenderItem: RenderItem,
20722
- scrollIndex: scrollIndex
20802
+ sections: sections,
20803
+ renderItem: renderItem,
20804
+ scrollParams: scrollParams
20723
20805
  });
20724
20806
  };
20725
20807
 
20726
20808
  function MultiSelect(_ref) {
20727
20809
  var footerLabel = _ref.footerLabel,
20728
20810
  label = _ref.label,
20729
- loading = _ref.loading,
20811
+ _ref$loading = _ref.loading,
20812
+ loading = _ref$loading === void 0 ? false : _ref$loading,
20813
+ inputProps = _ref.inputProps,
20730
20814
  onConfirm = _ref.onConfirm,
20731
20815
  onDimiss = _ref.onDimiss,
20732
20816
  onEndReached = _ref.onEndReached,
20733
20817
  onQueryChange = _ref.onQueryChange,
20734
20818
  options = _ref.options,
20819
+ renderOption = _ref.renderOption,
20735
20820
  query = _ref.query,
20736
20821
  error = _ref.error,
20737
20822
  _ref$editable = _ref.editable,
@@ -20743,6 +20828,10 @@ function MultiSelect(_ref) {
20743
20828
  testID = _ref.testID,
20744
20829
  value = _ref.value;
20745
20830
 
20831
+ var _useKeyboard = useKeyboard(),
20832
+ isKeyboardVisible = _useKeyboard.isKeyboardVisible,
20833
+ keyboardHeight = _useKeyboard.keyboardHeight;
20834
+
20746
20835
  var _useState = React.useState(false),
20747
20836
  _useState2 = _slicedToArray(_useState, 2),
20748
20837
  open = _useState2[0],
@@ -20753,37 +20842,15 @@ function MultiSelect(_ref) {
20753
20842
  selectingValue = _useState4[0],
20754
20843
  setSelectingValue = _useState4[1];
20755
20844
 
20756
- var displayedValue = options.filter(function (opt) {
20845
+ var sections = toSections(options);
20846
+ var flatOptions = toFlatOptions(options);
20847
+ var displayedValue = flatOptions.filter(function (opt) {
20757
20848
  return value.includes(opt.value);
20758
20849
  }).map(function (opt) {
20759
20850
  return opt.text;
20760
20851
  }).join(', ');
20761
-
20762
- var _useState5 = React.useState(false),
20763
- _useState6 = _slicedToArray(_useState5, 2),
20764
- isKeyboardVisible = _useState6[0],
20765
- setKeyboardVisible = _useState6[1];
20766
-
20767
- var _useState7 = React.useState(0),
20768
- _useState8 = _slicedToArray(_useState7, 2),
20769
- keyboardHeight = _useState8[0],
20770
- setKeyboardHeight = _useState8[1];
20771
-
20772
- React.useEffect(function () {
20773
- var keyboardDidShowListener = reactNative.Keyboard.addListener('keyboardDidShow', function (e) {
20774
- setKeyboardVisible(true);
20775
- setKeyboardHeight(e.endCoordinates.height);
20776
- });
20777
- var keyboardDidHideListener = reactNative.Keyboard.addListener('keyboardDidHide', function () {
20778
- setKeyboardVisible(false);
20779
- });
20780
- return function () {
20781
- keyboardDidHideListener.remove();
20782
- keyboardDidShowListener.remove();
20783
- };
20784
- }, []);
20785
20852
  return /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, /*#__PURE__*/React__default["default"].createElement(reactNative.View, {
20786
- pointerEvents: !editable || disabled ? 'none' : 'auto'
20853
+ pointerEvents: !editable || disabled || inputProps !== null && inputProps !== void 0 && inputProps.loading ? 'none' : 'auto'
20787
20854
  }, /*#__PURE__*/React__default["default"].createElement(reactNative.TouchableOpacity, {
20788
20855
  onPress: function onPress() {
20789
20856
  return setOpen(true);
@@ -20796,6 +20863,7 @@ function MultiSelect(_ref) {
20796
20863
  error: error,
20797
20864
  editable: editable,
20798
20865
  disabled: disabled,
20866
+ loading: inputProps === null || inputProps === void 0 ? void 0 : inputProps.loading,
20799
20867
  numberOfLines: numberOfLines,
20800
20868
  pointerEvents: "none",
20801
20869
  style: style,
@@ -20827,9 +20895,11 @@ function MultiSelect(_ref) {
20827
20895
  onChangeText: onQueryChange,
20828
20896
  value: query
20829
20897
  })), /*#__PURE__*/React__default["default"].createElement(OptionList$1, {
20898
+ onQueryChange: onQueryChange,
20830
20899
  onEndReached: onEndReached,
20831
20900
  loading: loading,
20832
- options: options,
20901
+ sections: sections,
20902
+ renderOption: renderOption,
20833
20903
  value: selectingValue,
20834
20904
  onPress: setSelectingValue
20835
20905
  })));
@@ -20837,12 +20907,19 @@ function MultiSelect(_ref) {
20837
20907
 
20838
20908
  var Option = function Option(_ref) {
20839
20909
  var text = _ref.text,
20910
+ _ref$disabled = _ref.disabled,
20911
+ disabled = _ref$disabled === void 0 ? false : _ref$disabled,
20840
20912
  selected = _ref.selected,
20841
20913
  onPress = _ref.onPress;
20914
+ var theme = useTheme();
20842
20915
  return /*#__PURE__*/React__default["default"].createElement(List.BasicItem, {
20843
20916
  selected: selected,
20917
+ disabled: disabled,
20844
20918
  onPress: onPress,
20845
- title: text
20919
+ title: text,
20920
+ style: {
20921
+ marginHorizontal: theme.__hd__.select.space.optionHorizontalMargin
20922
+ }
20846
20923
  });
20847
20924
  };
20848
20925
 
@@ -20850,49 +20927,60 @@ var OptionList = function OptionList(_ref) {
20850
20927
  var keyExtractor = _ref.keyExtractor,
20851
20928
  loading = _ref.loading,
20852
20929
  onEndReached = _ref.onEndReached,
20853
- _onPress = _ref.onPress,
20930
+ onPress = _ref.onPress,
20854
20931
  onQueryChange = _ref.onQueryChange,
20855
- options = _ref.options,
20932
+ sections = _ref.sections,
20933
+ renderOption = _ref.renderOption,
20856
20934
  value = _ref.value;
20857
- var rawScrollIndex = options.findIndex(function (option) {
20858
- return option.value === value;
20859
- });
20860
- var scrollIndex = rawScrollIndex - 2 >= 0 ? rawScrollIndex - 2 : 0;
20861
- var RenderItem = /*#__PURE__*/React__default["default"].memo(function (_ref2) {
20862
- var item = _ref2.item;
20863
- return /*#__PURE__*/React__default["default"].createElement(Option, {
20864
- selected: value === item.value,
20865
- text: item.text,
20866
- onPress: function onPress() {
20867
- if (value === item.value) {
20868
- _onPress(null);
20869
- } else {
20870
- _onPress(item.value);
20871
- }
20935
+ var scrollParams = getScrollParams(value, sections);
20936
+
20937
+ var renderItem = function renderItem(info) {
20938
+ var item = info.item;
20939
+ var selected = item.value === value;
20940
+
20941
+ var onItemPress = function onItemPress() {
20942
+ if (value === item.value) {
20943
+ onPress(null);
20944
+ } else {
20945
+ onPress(item.value);
20872
20946
  }
20947
+ };
20948
+
20949
+ return renderOption ? renderOption(_objectSpread2(_objectSpread2({}, info), {}, {
20950
+ selected: selected,
20951
+ onPress: onItemPress
20952
+ })) : /*#__PURE__*/React__default["default"].createElement(Option, {
20953
+ selected: selected,
20954
+ text: item.text,
20955
+ disabled: item.disabled,
20956
+ onPress: onItemPress
20873
20957
  });
20874
- });
20958
+ };
20959
+
20875
20960
  return /*#__PURE__*/React__default["default"].createElement(StyledOptionList, {
20876
20961
  keyExtractor: keyExtractor,
20877
20962
  loading: loading,
20878
20963
  onEndReached: onEndReached,
20879
20964
  onQueryChange: onQueryChange,
20880
- options: options,
20881
- RenderItem: RenderItem,
20882
- scrollIndex: scrollIndex
20965
+ sections: sections,
20966
+ renderItem: renderItem,
20967
+ scrollParams: scrollParams
20883
20968
  });
20884
20969
  };
20885
20970
 
20886
20971
  var SingleSelect = function SingleSelect(_ref) {
20887
- var _options$find;
20972
+ var _flatOptions$find;
20888
20973
 
20889
20974
  var label = _ref.label,
20890
- loading = _ref.loading,
20975
+ _ref$loading = _ref.loading,
20976
+ loading = _ref$loading === void 0 ? false : _ref$loading,
20977
+ inputProps = _ref.inputProps,
20891
20978
  onConfirm = _ref.onConfirm,
20892
20979
  onDimiss = _ref.onDimiss,
20893
20980
  onEndReached = _ref.onEndReached,
20894
20981
  onQueryChange = _ref.onQueryChange,
20895
20982
  options = _ref.options,
20983
+ renderOption = _ref.renderOption,
20896
20984
  query = _ref.query,
20897
20985
  error = _ref.error,
20898
20986
  _ref$editable = _ref.editable,
@@ -20904,6 +20992,10 @@ var SingleSelect = function SingleSelect(_ref) {
20904
20992
  testID = _ref.testID,
20905
20993
  value = _ref.value;
20906
20994
 
20995
+ var _useKeyboard = useKeyboard(),
20996
+ isKeyboardVisible = _useKeyboard.isKeyboardVisible,
20997
+ keyboardHeight = _useKeyboard.keyboardHeight;
20998
+
20907
20999
  var _useState = React.useState(false),
20908
21000
  _useState2 = _slicedToArray(_useState, 2),
20909
21001
  open = _useState2[0],
@@ -20914,35 +21006,13 @@ var SingleSelect = function SingleSelect(_ref) {
20914
21006
  selectingValue = _useState4[0],
20915
21007
  setSelectingValue = _useState4[1];
20916
21008
 
20917
- var displayedValue = (_options$find = options.find(function (opt) {
21009
+ var sections = toSections(options);
21010
+ var flatOptions = toFlatOptions(options);
21011
+ var displayedValue = (_flatOptions$find = flatOptions.find(function (opt) {
20918
21012
  return value === opt.value;
20919
- })) === null || _options$find === void 0 ? void 0 : _options$find.text;
20920
-
20921
- var _useState5 = React.useState(false),
20922
- _useState6 = _slicedToArray(_useState5, 2),
20923
- isKeyboardVisible = _useState6[0],
20924
- setKeyboardVisible = _useState6[1];
20925
-
20926
- var _useState7 = React.useState(0),
20927
- _useState8 = _slicedToArray(_useState7, 2),
20928
- keyboardHeight = _useState8[0],
20929
- setKeyboardHeight = _useState8[1];
20930
-
20931
- React.useEffect(function () {
20932
- var keyboardDidShowListener = reactNative.Keyboard.addListener('keyboardWillShow', function (e) {
20933
- setKeyboardVisible(true);
20934
- setKeyboardHeight(e.endCoordinates.height);
20935
- });
20936
- var keyboardDidHideListener = reactNative.Keyboard.addListener('keyboardWillHide', function () {
20937
- setKeyboardVisible(false);
20938
- });
20939
- return function () {
20940
- keyboardDidHideListener.remove();
20941
- keyboardDidShowListener.remove();
20942
- };
20943
- }, []);
21013
+ })) === null || _flatOptions$find === void 0 ? void 0 : _flatOptions$find.text;
20944
21014
  return /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, /*#__PURE__*/React__default["default"].createElement(reactNative.View, {
20945
- pointerEvents: !editable || disabled ? 'none' : 'auto'
21015
+ pointerEvents: !editable || disabled || inputProps !== null && inputProps !== void 0 && inputProps.loading ? 'none' : 'auto'
20946
21016
  }, /*#__PURE__*/React__default["default"].createElement(reactNative.TouchableOpacity, {
20947
21017
  onPress: function onPress() {
20948
21018
  return setOpen(true);
@@ -20955,6 +21025,7 @@ var SingleSelect = function SingleSelect(_ref) {
20955
21025
  error: error,
20956
21026
  editable: editable,
20957
21027
  disabled: disabled,
21028
+ loading: inputProps === null || inputProps === void 0 ? void 0 : inputProps.loading,
20958
21029
  numberOfLines: numberOfLines,
20959
21030
  pointerEvents: "none",
20960
21031
  style: style,
@@ -20982,7 +21053,8 @@ var SingleSelect = function SingleSelect(_ref) {
20982
21053
  onQueryChange: onQueryChange,
20983
21054
  onEndReached: onEndReached,
20984
21055
  loading: loading,
20985
- options: options,
21056
+ sections: sections,
21057
+ renderOption: renderOption,
20986
21058
  value: selectingValue,
20987
21059
  onPress: function onPress(selectedValue) {
20988
21060
  setOpen(false);
@@ -40319,7 +40391,7 @@ var RichTextEditor = function RichTextEditor(_ref) {
40319
40391
  break;
40320
40392
  }
40321
40393
  }, []);
40322
- return /*#__PURE__*/React__default["default"].createElement(StyledContainer$2, {
40394
+ return /*#__PURE__*/React__default["default"].createElement(StyledContainer$3, {
40323
40395
  style: style,
40324
40396
  testID: testID
40325
40397
  }, /*#__PURE__*/React__default["default"].createElement(StyledTextInputContainer, null, /*#__PURE__*/React__default["default"].createElement(StyledBorderBackDrop, {