@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/es/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import * as reactNative from 'react-native';
2
- import { Dimensions, StyleSheet as StyleSheet$1, Animated, View, Easing, TouchableOpacity, Text as Text$1, Image, Platform, TouchableWithoutFeedback, Pressable, SafeAreaView, TouchableHighlight, Modal, TextInput as TextInput$1, InteractionManager, FlatList, Keyboard, LayoutAnimation } from 'react-native';
2
+ import { Dimensions, StyleSheet as StyleSheet$1, Animated, View, Easing, TouchableOpacity, Text as Text$1, Image, Platform, TouchableWithoutFeedback, Pressable, SafeAreaView, TouchableHighlight, Modal, TextInput as TextInput$1, InteractionManager, Keyboard, SectionList, FlatList, LayoutAnimation } from 'react-native';
3
3
  import React, { useContext, createContext, createElement, forwardRef, useEffect, useCallback, useRef, useMemo, useState, useLayoutEffect, useImperativeHandle } from 'react';
4
4
  import { createIconSetFromIcoMoon } from 'react-native-vector-icons';
5
5
  import { useSafeAreaInsets } from 'react-native-safe-area-context';
@@ -2360,7 +2360,7 @@ var blue$1 = colorScales.blue,
2360
2360
  smalt = colorScales.smalt,
2361
2361
  violet$1 = colorScales.violet,
2362
2362
  yellow$1 = colorScales.yellow;
2363
- var palette$6 = {
2363
+ ({
2364
2364
  black: '#000000',
2365
2365
  white: '#ffffff',
2366
2366
  blue: blue$1.base,
@@ -2445,7 +2445,7 @@ var palette$6 = {
2445
2445
  yellowDark75: yellow$1.darken75,
2446
2446
  yellowLight60: yellow$1.lighten60,
2447
2447
  yellowLight90: yellow$1.lighten90
2448
- };
2448
+ });
2449
2449
  var maasstrichtBlue = colorScales.maasstrichtBlue,
2450
2450
  grey$1 = colorScales.grey,
2451
2451
  pastelRed$1 = colorScales.pastelRed,
@@ -2535,7 +2535,7 @@ _objectSpread2(_objectSpread2({}, palette$5), {}, {
2535
2535
  var scarletGum = colorScales.scarletGum,
2536
2536
  violet1 = colorScales.violet1;
2537
2537
 
2538
- _objectSpread2(_objectSpread2({}, palette$5), {}, {
2538
+ var palette$2 = _objectSpread2(_objectSpread2({}, palette$5), {}, {
2539
2539
  scarletGumLight30: scarletGum.lighten30,
2540
2540
  scarletGumLight50: scarletGum.lighten50,
2541
2541
  scarletGumLight80: scarletGum.lighten80,
@@ -2573,46 +2573,47 @@ _objectSpread2(_objectSpread2({}, palette$5), {}, {
2573
2573
  });
2574
2574
 
2575
2575
  var systemPalette = {
2576
- primary: palette$6.violet,
2577
- primaryLight: palette$6.violetLight60,
2578
- primaryDark: palette$6.purpleDark15,
2579
- primaryBackground: palette$6.violetLight90,
2576
+ primary: palette$2.violet,
2577
+ primaryLight: palette$2.violetLight50,
2578
+ primaryDark: palette$2.scarletGumLight30,
2579
+ primaryBackground: palette$2.violetLight90,
2580
2580
  primaryBackgroundDark: palette$5.maasstrichtBlueLight30,
2581
- secondary: palette$6.dodgerBlue,
2582
- secondaryLight: palette$6.dodgerBlueLight75,
2583
- secondaryBackground: palette$6.dodgerBlueLight90,
2584
- info: palette$6.dodgerBlue,
2581
+ secondary: palette$2.ultramarineBlue,
2582
+ secondaryLight: palette$2.vodka,
2583
+ secondaryBackground: palette$2.aliceBlue,
2584
+ info: palette$5.ultramarineBlue,
2585
2585
  infoMediumLight: palette$5.vodka,
2586
- infoLight: palette$6.dodgerBlueLight75,
2587
- infoBackground: palette$6.dodgerBlueLight90,
2588
- success: palette$6.green,
2586
+ infoLight: palette$5.vodka,
2587
+ infoBackground: palette$5.aliceBlue,
2588
+ success: palette$5.emerald,
2589
2589
  successLight: palette$5.emerald,
2590
- successDark: palette$6.greenDark30,
2591
- successBackground: palette$6.grotesqueGreenLight90,
2592
- danger: palette$6.red,
2590
+ successDark: palette$5.pineGreen,
2591
+ successBackground: palette$5.honeydew,
2592
+ danger: palette$5.vermilion,
2593
2593
  dangerMediumLight: palette$5.apple,
2594
- dangerLight: palette$6.redLight60,
2595
- dangerBackground: palette$6.redLight90,
2596
- warning: palette$6.orange,
2594
+ dangerLight: palette$5.pastelRed,
2595
+ dangerBackground: palette$5.linen,
2596
+ warning: palette$5.mellowApricot,
2597
2597
  warningLight: palette$5.mellowApricot,
2598
- warningDark: palette$6.orangeDark15,
2599
- warningBackground: palette$6.orangeLight90,
2600
- platformBackground: palette$6.white,
2601
- backgroundLight: palette$6.greyLight95,
2602
- backgroundDark: palette$6.greyDark75,
2603
- text: palette$6.greyDark75,
2604
- subduedText: palette$6.greyDark30,
2605
- disabledText: palette$6.greyDark15,
2606
- disabledLightText: palette$6.greyLight45,
2607
- invertedText: palette$6.white,
2608
- outline: palette$6.greyLight60,
2609
- archived: palette$6.greyLight45,
2598
+ warningDark: palette$5.deepSaffron,
2599
+ warningBackground: palette$5.seashell,
2600
+ platformBackground: palette$5.white,
2601
+ backgroundLight: palette$5.greyLight90,
2602
+ backgroundDark: palette$5.maasstrichtBlue,
2603
+ text: palette$5.maasstrichtBlue,
2604
+ subduedText: palette$5.maasstrichtBlueLight30,
2605
+ disabledText: palette$5.maasstrichtBlueLight50,
2606
+ disabledLightText: palette$5.greyLight30,
2607
+ invertedText: palette$5.white,
2608
+ outline: palette$5.greyLight75,
2609
+ archived: palette$5.greyLight45,
2610
2610
  archivedLight: palette$5.greyLight30,
2611
2611
  archivedDark: palette$5.sonicSilver,
2612
2612
  archivedBackground: palette$5.antiFlashWhite,
2613
- black: palette$6.black,
2614
- inactiveBackground: palette$6.greyDark30,
2615
- shadow: palette$6.greyLight60
2613
+ black: palette$5.black,
2614
+ inactiveBackground: palette$5.maasstrichtBlueLight50,
2615
+ shadow: palette$5.greyLight45 // waiting for new color
2616
+
2616
2617
  };
2617
2618
 
2618
2619
  var BASE_WIDTH = 390; // Based on iPhone 13's viewport size
@@ -2758,9 +2759,9 @@ var getAlertTheme = function getAlertTheme(theme) {
2758
2759
  var colors = {
2759
2760
  success: theme.colors.success,
2760
2761
  warning: theme.colors.warning,
2761
- error: theme.colors.danger,
2762
- info: theme.colors.infoMediumLight,
2763
- divider: theme.colors.backgroundLight
2762
+ error: theme.colors.dangerLight,
2763
+ info: theme.colors.infoLight,
2764
+ divider: theme.colors.outline
2764
2765
  };
2765
2766
  var sizes = {
2766
2767
  height: scale(48)
@@ -2830,7 +2831,7 @@ var getBadgeTheme = function getBadgeTheme(theme) {
2830
2831
  info: theme.colors.info,
2831
2832
  success: theme.colors.successDark,
2832
2833
  warning: theme.colors.warningDark,
2833
- archived: theme.colors.archived,
2834
+ archived: theme.colors.archivedDark,
2834
2835
  text: theme.colors.invertedText
2835
2836
  };
2836
2837
  var fonts = {
@@ -3024,12 +3025,12 @@ var getCalendarTheme = function getCalendarTheme(theme) {
3024
3025
 
3025
3026
  var getCardTheme = function getCardTheme(theme) {
3026
3027
  var colors = {
3027
- dataCardIndicator: theme.colors.primaryDark,
3028
+ dataCardIndicator: theme.colors.primary,
3028
3029
  indicator: {
3029
3030
  archived: theme.colors.archivedLight,
3030
- info: theme.colors.infoMediumLight,
3031
- success: theme.colors.successLight,
3032
- warning: theme.colors.warningLight,
3031
+ info: theme.colors.infoLight,
3032
+ success: theme.colors.success,
3033
+ warning: theme.colors.warning,
3033
3034
  danger: theme.colors.dangerMediumLight
3034
3035
  }
3035
3036
  };
@@ -3264,11 +3265,11 @@ var getListTheme = function getListTheme(theme) {
3264
3265
  highlightedListItemContainerBackground: theme.colors.primaryBackground,
3265
3266
  listItemContainerBackground: theme.colors.platformBackground,
3266
3267
  leadingStatus: {
3267
- danger: theme.colors.danger,
3268
+ danger: theme.colors.dangerMediumLight,
3268
3269
  info: theme.colors.infoLight,
3269
- success: theme.colors.successDark,
3270
- warning: theme.colors.warningLight,
3271
- archived: theme.colors.archived
3270
+ success: theme.colors.success,
3271
+ warning: theme.colors.warning,
3272
+ archived: theme.colors.archivedLight
3272
3273
  }
3273
3274
  };
3274
3275
  var space = {
@@ -3353,16 +3354,15 @@ var getProgressTheme = function getProgressTheme(theme) {
3353
3354
  var colors = {
3354
3355
  primary: theme.colors.primary,
3355
3356
  success: theme.colors.success,
3356
- warning: theme.colors.warning,
3357
+ warning: theme.colors.warningDark,
3357
3358
  danger: theme.colors.danger,
3358
3359
  info: theme.colors.info,
3359
3360
  background: theme.colors.outline,
3360
3361
  innerBackground: theme.colors.platformBackground
3361
3362
  };
3362
3363
  var sizes = {
3363
- radius: theme.space.xxxlarge,
3364
- strokeWidth: theme.space.small,
3365
- barHeight: theme.space.xsmall
3364
+ circleWidth: scale(76),
3365
+ barHeight: scale(4)
3366
3366
  };
3367
3367
  var radii = {
3368
3368
  "default": theme.radii.rounded
@@ -3459,9 +3459,9 @@ var getSelectTheme = function getSelectTheme(theme) {
3459
3459
  };
3460
3460
  var space = {
3461
3461
  minimumOptionListHeight: theme.space.xxxxlarge * 5,
3462
- optionPadding: theme.space.medium,
3463
- optionListPadding: theme.space.medium,
3464
- optionListSpacing: theme.space.xsmall,
3462
+ sectionSpacing: theme.space.smallMedium,
3463
+ optionSpacing: theme.space.xsmall,
3464
+ optionHorizontalMargin: theme.space.smallMedium,
3465
3465
  searchBarMarginTopSpacing: theme.space.small,
3466
3466
  searchBarHorizontalSpacing: theme.space.medium,
3467
3467
  searchBarBottomSpacing: theme.space.small
@@ -3713,9 +3713,9 @@ var getToastTheme = function getToastTheme(theme) {
3713
3713
  var colors = {
3714
3714
  success: theme.colors.success,
3715
3715
  warning: theme.colors.warning,
3716
- error: theme.colors.danger,
3717
- info: theme.colors.infoMediumLight,
3718
- divider: theme.colors.backgroundLight
3716
+ error: theme.colors.dangerLight,
3717
+ info: theme.colors.infoLight,
3718
+ divider: theme.colors.outline
3719
3719
  };
3720
3720
  var sizes = {
3721
3721
  height: scale(48)
@@ -18330,7 +18330,7 @@ function ContentNavigator(_ref) {
18330
18330
  }));
18331
18331
  }
18332
18332
 
18333
- var StyledContainer$3 = index$6(View)(function (_ref) {
18333
+ var StyledContainer$4 = index$6(View)(function (_ref) {
18334
18334
  var theme = _ref.theme;
18335
18335
  return {
18336
18336
  backgroundColor: theme.__hd__.calendar.colors.background
@@ -18519,7 +18519,7 @@ var Calendar = function Calendar(_ref) {
18519
18519
  var disableNextButton = maxDate === undefined ? false : !daysOfNextMonth.some(function (date) {
18520
18520
  return date !== undefined;
18521
18521
  }) || maxDate <= lastDateOfMonth;
18522
- return /*#__PURE__*/React.createElement(StyledContainer$3, null, /*#__PURE__*/React.createElement(StyledCalendarHeader, null, /*#__PURE__*/React.createElement(ContentNavigator, {
18522
+ return /*#__PURE__*/React.createElement(StyledContainer$4, null, /*#__PURE__*/React.createElement(StyledCalendarHeader, null, /*#__PURE__*/React.createElement(ContentNavigator, {
18523
18523
  value: formatTime('MMMM yyyy', visibleDate),
18524
18524
  onPreviousPress: onPreviousPress,
18525
18525
  onNextPress: onNextPress,
@@ -18694,7 +18694,7 @@ var CheckBox = function CheckBox(_ref) {
18694
18694
  }));
18695
18695
  };
18696
18696
 
18697
- var StyledContainer$2 = index$6(View)(function (_ref) {
18697
+ var StyledContainer$3 = index$6(View)(function (_ref) {
18698
18698
  var theme = _ref.theme;
18699
18699
  return {
18700
18700
  width: '100%',
@@ -18840,11 +18840,12 @@ var StyledErrorAndMaxLengthContainer = index$6(View)(function () {
18840
18840
  };
18841
18841
  });
18842
18842
 
18843
- var _excluded$5 = ["label", "prefix", "suffix", "style", "textStyle", "testID", "accessibilityLabelledBy", "error", "required", "editable", "disabled", "maxLength", "helpText", "value", "defaultValue"];
18843
+ var _excluded$5 = ["label", "prefix", "suffix", "style", "textStyle", "testID", "accessibilityLabelledBy", "error", "required", "editable", "disabled", "loading", "maxLength", "helpText", "value", "defaultValue"];
18844
18844
  var getVariant = function getVariant(_ref) {
18845
18845
  var disabled = _ref.disabled,
18846
18846
  error = _ref.error,
18847
18847
  editable = _ref.editable,
18848
+ loading = _ref.loading,
18848
18849
  isFocused = _ref.isFocused,
18849
18850
  isEmptyValue = _ref.isEmptyValue;
18850
18851
 
@@ -18856,7 +18857,7 @@ var getVariant = function getVariant(_ref) {
18856
18857
  return 'error';
18857
18858
  }
18858
18859
 
18859
- if (!editable) {
18860
+ if (!editable || loading) {
18860
18861
  return 'readonly';
18861
18862
  }
18862
18863
 
@@ -18887,6 +18888,8 @@ var TextInput = function TextInput(_ref2) {
18887
18888
  editable = _ref2$editable === void 0 ? true : _ref2$editable,
18888
18889
  _ref2$disabled = _ref2.disabled,
18889
18890
  disabled = _ref2$disabled === void 0 ? false : _ref2$disabled,
18891
+ _ref2$loading = _ref2.loading,
18892
+ loading = _ref2$loading === void 0 ? false : _ref2$loading,
18890
18893
  maxLength = _ref2.maxLength,
18891
18894
  helpText = _ref2.helpText,
18892
18895
  value = _ref2.value,
@@ -18896,6 +18899,7 @@ var TextInput = function TextInput(_ref2) {
18896
18899
  var textInputReference = useRef(null);
18897
18900
  var displayText = (_ref3 = value !== undefined ? value : defaultValue) !== null && _ref3 !== void 0 ? _ref3 : '';
18898
18901
  var isEmptyValue = displayText.length === 0;
18902
+ var actualSuffix = loading ? 'loading' : suffix;
18899
18903
 
18900
18904
  var _React$useState = React.useState(false),
18901
18905
  _React$useState2 = _slicedToArray(_React$useState, 2),
@@ -18906,12 +18910,13 @@ var TextInput = function TextInput(_ref2) {
18906
18910
  disabled: disabled,
18907
18911
  error: error,
18908
18912
  editable: editable,
18913
+ loading: loading,
18909
18914
  isFocused: isFocused,
18910
18915
  isEmptyValue: isEmptyValue
18911
18916
  });
18912
18917
  var shouldShowMaxLength = maxLength !== undefined;
18913
18918
  var theme = useTheme();
18914
- return /*#__PURE__*/React.createElement(StyledContainer$2, {
18919
+ return /*#__PURE__*/React.createElement(StyledContainer$3, {
18915
18920
  style: style,
18916
18921
  pointerEvents: variant === 'disabled' || variant === 'readonly' ? 'none' : 'auto',
18917
18922
  testID: testID
@@ -18928,7 +18933,7 @@ var TextInput = function TextInput(_ref2) {
18928
18933
  fontSize: "small",
18929
18934
  themeVariant: variant
18930
18935
  }, label)), typeof prefix === 'string' ? /*#__PURE__*/React.createElement(Icon, {
18931
- intent: disabled ? 'disabled-text' : 'text',
18936
+ intent: variant === 'disabled' ? 'disabled-text' : 'text',
18932
18937
  testID: "input-prefix",
18933
18938
  icon: prefix,
18934
18939
  size: "xsmall"
@@ -18949,7 +18954,7 @@ var TextInput = function TextInput(_ref2) {
18949
18954
  }, textStyle]),
18950
18955
  testID: "text-input",
18951
18956
  accessibilityState: {
18952
- disabled: disabled
18957
+ disabled: variant === 'disabled' || variant === 'readonly'
18953
18958
  } // @ts-ignore
18954
18959
  ,
18955
18960
  accessibilityLabelledBy: accessibilityLabelledBy
@@ -18977,10 +18982,11 @@ var TextInput = function TextInput(_ref2) {
18977
18982
  },
18978
18983
  defaultValue: defaultValue,
18979
18984
  placeholder: variant === 'focused' ? nativeProps.placeholder : undefined
18980
- }))), typeof suffix === 'string' ? /*#__PURE__*/React.createElement(Icon, {
18981
- intent: disabled ? 'disabled-text' : 'text',
18985
+ }))), typeof actualSuffix === 'string' ? /*#__PURE__*/React.createElement(Icon, {
18986
+ intent: variant === 'disabled' ? 'disabled-text' : 'text',
18982
18987
  testID: "input-suffix",
18983
- icon: suffix,
18988
+ icon: actualSuffix,
18989
+ spin: actualSuffix === 'loading',
18984
18990
  size: "xsmall"
18985
18991
  }) : suffix), /*#__PURE__*/React.createElement(StyledErrorAndHelpTextContainer, null, /*#__PURE__*/React.createElement(StyledErrorAndMaxLengthContainer, null, error && /*#__PURE__*/React.createElement(StyledErrorContainer$1, null, /*#__PURE__*/React.createElement(Icon, {
18986
18992
  testID: "input-error-icon",
@@ -19148,7 +19154,7 @@ var DatePicker = function DatePicker(props) {
19148
19154
  };
19149
19155
 
19150
19156
  var AnimatedPressable = Animated.createAnimatedComponent(Pressable);
19151
- var StyledContainer$1 = index$6(View)(function (_ref) {
19157
+ var StyledContainer$2 = index$6(View)(function (_ref) {
19152
19158
  var theme = _ref.theme,
19153
19159
  enableShadow = _ref.enableShadow;
19154
19160
  return _objectSpread2(_objectSpread2({}, StyleSheet$1.absoluteFillObject), {}, {
@@ -19213,7 +19219,7 @@ var Drawer = function Drawer(_ref) {
19213
19219
  return animation.stop();
19214
19220
  };
19215
19221
  }, [visible]);
19216
- return /*#__PURE__*/React.createElement(StyledContainer$1, {
19222
+ return /*#__PURE__*/React.createElement(StyledContainer$2, {
19217
19223
  testID: testID,
19218
19224
  enableShadow: enableShadow,
19219
19225
  pointerEvents: "box-none"
@@ -19464,7 +19470,7 @@ var ActionItem = function ActionItem(_ref) {
19464
19470
  }), /*#__PURE__*/React.createElement(StyledActionItemText, null, title));
19465
19471
  };
19466
19472
 
19467
- var StyledContainer = index$6(View)({
19473
+ var StyledContainer$1 = index$6(View)({
19468
19474
  position: 'absolute',
19469
19475
  left: 0,
19470
19476
  right: 0,
@@ -19552,7 +19558,7 @@ var ActionGroup = function ActionGroup(_ref2) {
19552
19558
  inputRange: [0, 1],
19553
19559
  outputRange: [0, 1]
19554
19560
  });
19555
- return /*#__PURE__*/React.createElement(StyledContainer, {
19561
+ return /*#__PURE__*/React.createElement(StyledContainer$1, {
19556
19562
  testID: testID,
19557
19563
  pointerEvents: "box-none",
19558
19564
  style: style
@@ -19763,10 +19769,10 @@ var BasicListItem = function BasicListItem(_ref) {
19763
19769
  underlayColor: theme.__hd__.list.colors.highlightedListItemContainerBackground
19764
19770
  }, /*#__PURE__*/React.createElement(React.Fragment, null, prefix && /*#__PURE__*/React.createElement(StyledPrefixContainer, null, typeof prefix === 'string' ? /*#__PURE__*/React.createElement(Icon, {
19765
19771
  icon: prefix
19766
- }) : prefix), /*#__PURE__*/React.createElement(StyledTitleContainer, null, /*#__PURE__*/React.createElement(Typography.Text, {
19772
+ }) : prefix), /*#__PURE__*/React.createElement(StyledTitleContainer, null, typeof title === 'string' ? /*#__PURE__*/React.createElement(Typography.Text, {
19767
19773
  intent: "body",
19768
19774
  fontSize: "large"
19769
- }, title), subtitle && /*#__PURE__*/React.createElement(Typography.Text, {
19775
+ }, title) : title, subtitle && /*#__PURE__*/React.createElement(Typography.Text, {
19770
19776
  intent: "subdued",
19771
19777
  fontSize: "small"
19772
19778
  }, subtitle)), suffix && /*#__PURE__*/React.createElement(StyledSuffixContainer, null, typeof suffix === 'string' ? /*#__PURE__*/React.createElement(Icon, {
@@ -20002,41 +20008,52 @@ function PinInput(_ref2) {
20002
20008
  }));
20003
20009
  }
20004
20010
 
20005
- var HalfCircleWrapper = index$6(View)(function (_ref) {
20011
+ var INNER_CIRCLE_PERCENTAGE = 0.85; // 85% width according to design
20012
+
20013
+ var STROKE_WIDTH_PERCENTAGE = 0.075; // 7.5% width according to design
20014
+
20015
+ var StyledContainer = index$6(View)(function (_ref) {
20006
20016
  var theme = _ref.theme;
20007
20017
  return {
20008
- width: theme.__hd__.progress.sizes.radius,
20009
- height: theme.__hd__.progress.sizes.radius * 2,
20018
+ flexDirection: 'row',
20019
+ borderRadius: theme.__hd__.progress.radii["default"]
20020
+ };
20021
+ });
20022
+ var StyledHalfCircleWrapper = index$6(View)(function (_ref2) {
20023
+ var theme = _ref2.theme;
20024
+ return {
20025
+ width: theme.__hd__.progress.sizes.circleWidth / 2,
20026
+ height: theme.__hd__.progress.sizes.circleWidth,
20010
20027
  overflow: 'hidden'
20011
20028
  };
20012
20029
  });
20013
- var HalfCircleInnerFG = index$6(View)(function (_ref2) {
20014
- var theme = _ref2.theme,
20015
- themeIntent = _ref2.themeIntent;
20030
+ var StyledHalfCircleInnerFG = index$6(View)(function (_ref3) {
20031
+ var theme = _ref3.theme,
20032
+ themeIntent = _ref3.themeIntent;
20016
20033
  return {
20017
- width: theme.__hd__.progress.sizes.radius * 2,
20018
- height: theme.__hd__.progress.sizes.radius * 2,
20034
+ width: theme.__hd__.progress.sizes.circleWidth,
20035
+ height: theme.__hd__.progress.sizes.circleWidth,
20019
20036
  backgroundColor: theme.__hd__.progress.colors[themeIntent],
20020
20037
  borderRadius: theme.__hd__.progress.radii["default"]
20021
20038
  };
20022
20039
  });
20023
- var HalfCircleInnerBG = index$6(View)(function (_ref3) {
20024
- var theme = _ref3.theme;
20040
+ var StyledHalfCircleInnerBG = index$6(View)(function (_ref4) {
20041
+ var theme = _ref4.theme;
20025
20042
  return {
20026
- width: theme.__hd__.progress.sizes.radius * 2,
20027
- height: theme.__hd__.progress.sizes.radius * 2,
20043
+ width: theme.__hd__.progress.sizes.circleWidth,
20044
+ height: theme.__hd__.progress.sizes.circleWidth,
20028
20045
  backgroundColor: theme.__hd__.progress.colors.background,
20029
20046
  borderRadius: theme.__hd__.progress.radii["default"]
20030
20047
  };
20031
20048
  });
20032
- var DonutCircle = index$6(View)(function (_ref4) {
20033
- var theme = _ref4.theme;
20049
+ var StyledDonutCircle = index$6(View)(function (_ref5) {
20050
+ var theme = _ref5.theme;
20034
20051
  return {
20035
20052
  position: 'absolute',
20036
- top: theme.__hd__.progress.sizes.strokeWidth,
20037
- left: theme.__hd__.progress.sizes.strokeWidth,
20038
- width: theme.__hd__.progress.sizes.radius * 2 - theme.__hd__.progress.sizes.strokeWidth * 2,
20039
- height: theme.__hd__.progress.sizes.radius * 2 - theme.__hd__.progress.sizes.strokeWidth * 2,
20053
+ top: theme.__hd__.progress.sizes.circleWidth * STROKE_WIDTH_PERCENTAGE,
20054
+ left: theme.__hd__.progress.sizes.circleWidth * STROKE_WIDTH_PERCENTAGE,
20055
+ width: theme.__hd__.progress.sizes.circleWidth * INNER_CIRCLE_PERCENTAGE,
20056
+ height: theme.__hd__.progress.sizes.circleWidth * INNER_CIRCLE_PERCENTAGE,
20040
20057
  zIndex: 3,
20041
20058
  backgroundColor: theme.__hd__.progress.colors.innerBackground,
20042
20059
  borderRadius: theme.__hd__.progress.radii["default"],
@@ -20044,15 +20061,15 @@ var DonutCircle = index$6(View)(function (_ref4) {
20044
20061
  justifyContent: 'center'
20045
20062
  };
20046
20063
  });
20047
- var StrokeEnd = index$6(View)(function (_ref5) {
20048
- var theme = _ref5.theme,
20049
- themeIntent = _ref5.themeIntent;
20064
+ var StyledStrokeEnd = index$6(View)(function (_ref6) {
20065
+ var theme = _ref6.theme,
20066
+ themeIntent = _ref6.themeIntent;
20050
20067
  return {
20051
20068
  position: 'absolute',
20052
20069
  top: 0,
20053
- left: theme.__hd__.progress.sizes.radius - theme.__hd__.progress.sizes.strokeWidth / 2,
20054
- width: theme.__hd__.progress.sizes.strokeWidth,
20055
- height: theme.__hd__.progress.sizes.strokeWidth,
20070
+ left: theme.__hd__.progress.sizes.circleWidth / 2 - theme.__hd__.progress.sizes.circleWidth * STROKE_WIDTH_PERCENTAGE / 2,
20071
+ width: theme.__hd__.progress.sizes.circleWidth * STROKE_WIDTH_PERCENTAGE,
20072
+ height: theme.__hd__.progress.sizes.circleWidth * STROKE_WIDTH_PERCENTAGE,
20056
20073
  borderRadius: theme.__hd__.progress.radii["default"],
20057
20074
  backgroundColor: theme.__hd__.progress.colors[themeIntent],
20058
20075
  zIndex: 2
@@ -20065,7 +20082,7 @@ var HalfCircle = function HalfCircle(_ref) {
20065
20082
  var type = _ref.type,
20066
20083
  _ref$themeIntent = _ref.themeIntent,
20067
20084
  themeIntent = _ref$themeIntent === void 0 ? 'primary' : _ref$themeIntent;
20068
- return /*#__PURE__*/React.createElement(HalfCircleWrapper, null, type === 'background' ? /*#__PURE__*/React.createElement(HalfCircleInnerBG, null) : /*#__PURE__*/React.createElement(HalfCircleInnerFG, {
20085
+ return /*#__PURE__*/React.createElement(StyledHalfCircleWrapper, null, type === 'background' ? /*#__PURE__*/React.createElement(StyledHalfCircleInnerBG, null) : /*#__PURE__*/React.createElement(StyledHalfCircleInnerFG, {
20069
20086
  themeIntent: themeIntent
20070
20087
  }));
20071
20088
  };
@@ -20079,7 +20096,7 @@ var ProgressCircle = function ProgressCircle(_ref2) {
20079
20096
  nativeProps = _objectWithoutProperties(_ref2, _excluded$3);
20080
20097
 
20081
20098
  var theme = useTheme$1();
20082
- var radius = theme.__hd__.progress.sizes.radius;
20099
+ var radius = theme.__hd__.progress.sizes.circleWidth / 2;
20083
20100
  var progressAnimatedValue = useRef(new Animated.Value(0));
20084
20101
  useEffect(function () {
20085
20102
  var animation = Animated.timing(progressAnimatedValue.current, {
@@ -20117,11 +20134,7 @@ var ProgressCircle = function ProgressCircle(_ref2) {
20117
20134
  return /*#__PURE__*/React.createElement(View, _extends$1({}, nativeProps, {
20118
20135
  testID: testID,
20119
20136
  style: style
20120
- }), /*#__PURE__*/React.createElement(View, {
20121
- style: {
20122
- flexDirection: 'row'
20123
- }
20124
- }, /*#__PURE__*/React.createElement(View, null, /*#__PURE__*/React.createElement(HalfCircle, {
20137
+ }), /*#__PURE__*/React.createElement(StyledContainer, null, /*#__PURE__*/React.createElement(View, null, /*#__PURE__*/React.createElement(HalfCircle, {
20125
20138
  type: "foreground",
20126
20139
  themeIntent: intent
20127
20140
  }), /*#__PURE__*/React.createElement(Animated.View, {
@@ -20141,7 +20154,8 @@ var ProgressCircle = function ProgressCircle(_ref2) {
20141
20154
  transform: [{
20142
20155
  rotate: '180deg'
20143
20156
  }],
20144
- zIndex: 1
20157
+ zIndex: 1,
20158
+ marginLeft: -0.1
20145
20159
  }
20146
20160
  }, /*#__PURE__*/React.createElement(HalfCircle, {
20147
20161
  type: "foreground",
@@ -20159,7 +20173,7 @@ var ProgressCircle = function ProgressCircle(_ref2) {
20159
20173
  })
20160
20174
  }, /*#__PURE__*/React.createElement(HalfCircle, {
20161
20175
  type: "background"
20162
- }))), /*#__PURE__*/React.createElement(StrokeEnd, {
20176
+ }))), /*#__PURE__*/React.createElement(StyledStrokeEnd, {
20163
20177
  themeIntent: intent
20164
20178
  }), /*#__PURE__*/React.createElement(Animated.View, {
20165
20179
  style: _objectSpread2(_objectSpread2({}, StyleSheet$1.absoluteFillObject), {}, {
@@ -20168,10 +20182,10 @@ var ProgressCircle = function ProgressCircle(_ref2) {
20168
20182
  rotate: interpolateDotRotate
20169
20183
  }]
20170
20184
  })
20171
- }, /*#__PURE__*/React.createElement(StrokeEnd, {
20185
+ }, /*#__PURE__*/React.createElement(StyledStrokeEnd, {
20172
20186
  themeIntent: intent
20173
- })), /*#__PURE__*/React.createElement(DonutCircle, null, /*#__PURE__*/React.createElement(Typography.Text, {
20174
- fontSize: "xlarge"
20187
+ })), /*#__PURE__*/React.createElement(StyledDonutCircle, null, /*#__PURE__*/React.createElement(Typography.Text, {
20188
+ fontSize: "large"
20175
20189
  }, "".concat(value, "%")))));
20176
20190
  };
20177
20191
 
@@ -20425,7 +20439,7 @@ var Radio = function Radio(_ref) {
20425
20439
  })));
20426
20440
  };
20427
20441
 
20428
- function getKey$1(option, index, keyExtractor) {
20442
+ function getKey(option, index, keyExtractor) {
20429
20443
  var key = '';
20430
20444
 
20431
20445
  if (keyExtractor !== undefined) {
@@ -20451,7 +20465,7 @@ var RadioGroup = function RadioGroup(_ref) {
20451
20465
  testID: testID
20452
20466
  }, options.map(function (option, index) {
20453
20467
  return /*#__PURE__*/React.createElement(React.Fragment, {
20454
- key: getKey$1(option, index, keyExtractor)
20468
+ key: getKey(option, index, keyExtractor)
20455
20469
  }, index !== 0 && /*#__PURE__*/React.createElement(Spacer, null), /*#__PURE__*/React.createElement(Radio, {
20456
20470
  text: option.text,
20457
20471
  checked: option.value === value,
@@ -20533,20 +20547,26 @@ var SectionHeading = function SectionHeading(_ref) {
20533
20547
  }, text)), rightChildren);
20534
20548
  };
20535
20549
 
20536
- index$6(View)(function (_ref) {
20550
+ var SectionSpacer = index$6(View)(function (_ref) {
20537
20551
  var theme = _ref.theme;
20538
20552
  return {
20539
- marginTop: theme.__hd__.select.space.optionListSpacing
20553
+ marginTop: theme.__hd__.select.space.sectionSpacing
20540
20554
  };
20541
20555
  });
20542
- var FooterText = index$6(Typography.Text)(function (_ref2) {
20556
+ var OptionSpacer = index$6(View)(function (_ref2) {
20543
20557
  var theme = _ref2.theme;
20544
20558
  return {
20545
- color: theme.__hd__.select.colors.footerText
20559
+ marginTop: theme.__hd__.select.space.optionSpacing
20546
20560
  };
20547
20561
  });
20548
- var StyledSearchBar = index$6(View)(function (_ref3) {
20562
+ var FooterText = index$6(Typography.Text)(function (_ref3) {
20549
20563
  var theme = _ref3.theme;
20564
+ return {
20565
+ color: theme.__hd__.select.colors.footerText
20566
+ };
20567
+ });
20568
+ var StyledSearchBar = index$6(View)(function (_ref4) {
20569
+ var theme = _ref4.theme;
20550
20570
  return {
20551
20571
  marginTop: theme.__hd__.select.space.searchBarMarginTopSpacing,
20552
20572
  paddingHorizontal: theme.__hd__.select.space.searchBarHorizontalSpacing,
@@ -20565,18 +20585,70 @@ var Footer = function Footer(_ref) {
20565
20585
  }, label));
20566
20586
  };
20567
20587
 
20568
- var getKey = function getKey(option, index, keyExtractor) {
20569
- var key = '';
20588
+ var isSections = function isSections(options) {
20589
+ var firstOption = options[0];
20590
+ return firstOption !== undefined && firstOption.category !== undefined;
20591
+ };
20592
+ var toSections = function toSections(options) {
20593
+ if (isSections(options)) {
20594
+ return options;
20595
+ }
20570
20596
 
20571
- if (keyExtractor !== undefined) {
20572
- key = keyExtractor(option, index);
20573
- } else if (option.key !== undefined) {
20574
- key = option.key;
20575
- } else {
20576
- key = index;
20597
+ return [{
20598
+ category: '',
20599
+ data: options
20600
+ }];
20601
+ };
20602
+ var toFlatOptions = function toFlatOptions(options) {
20603
+ if (isSections(options)) {
20604
+ return options.flatMap(function (opt) {
20605
+ return opt.data;
20606
+ });
20577
20607
  }
20578
20608
 
20579
- return key;
20609
+ return options;
20610
+ };
20611
+ var getScrollParams = function getScrollParams(value, sections) {
20612
+ var itemIndex = -1;
20613
+ var sectionIndex = sections.findIndex(function (section) {
20614
+ itemIndex = section.data.findIndex(function (opt) {
20615
+ return opt.value === value;
20616
+ });
20617
+ return itemIndex !== -1;
20618
+ });
20619
+ return {
20620
+ sectionIndex: sectionIndex < 0 ? 0 : sectionIndex,
20621
+ itemIndex: itemIndex < 0 ? 0 : itemIndex
20622
+ };
20623
+ };
20624
+ var useKeyboard = function useKeyboard() {
20625
+ var _useState = useState(false),
20626
+ _useState2 = _slicedToArray(_useState, 2),
20627
+ isKeyboardVisible = _useState2[0],
20628
+ setKeyboardVisible = _useState2[1];
20629
+
20630
+ var _useState3 = useState(0),
20631
+ _useState4 = _slicedToArray(_useState3, 2),
20632
+ keyboardHeight = _useState4[0],
20633
+ setKeyboardHeight = _useState4[1];
20634
+
20635
+ useEffect(function () {
20636
+ var keyboardWillShowListener = Keyboard.addListener('keyboardWillShow', function (e) {
20637
+ setKeyboardVisible(true);
20638
+ setKeyboardHeight(e.endCoordinates.height);
20639
+ });
20640
+ var keyboardWillHideListener = Keyboard.addListener('keyboardWillHide', function () {
20641
+ setKeyboardVisible(false);
20642
+ });
20643
+ return function () {
20644
+ keyboardWillShowListener.remove();
20645
+ keyboardWillHideListener.remove();
20646
+ };
20647
+ }, []);
20648
+ return {
20649
+ isKeyboardVisible: isKeyboardVisible,
20650
+ keyboardHeight: keyboardHeight
20651
+ };
20580
20652
  };
20581
20653
 
20582
20654
  var StyledOptionList = function StyledOptionList(_ref) {
@@ -20584,26 +20656,23 @@ var StyledOptionList = function StyledOptionList(_ref) {
20584
20656
  loading = _ref.loading,
20585
20657
  onEndReached = _ref.onEndReached,
20586
20658
  onQueryChange = _ref.onQueryChange,
20587
- options = _ref.options,
20588
- RenderItem = _ref.RenderItem,
20589
- _ref$scrollIndex = _ref.scrollIndex,
20590
- scrollIndex = _ref$scrollIndex === void 0 ? 0 : _ref$scrollIndex;
20659
+ sections = _ref.sections,
20660
+ renderItem = _ref.renderItem,
20661
+ scrollParams = _ref.scrollParams;
20591
20662
  var theme = useTheme$1();
20592
- var flatListRef = useRef(null);
20663
+ var sectionListRef = useRef(null);
20593
20664
 
20594
20665
  var _useState = useState(false),
20595
20666
  _useState2 = _slicedToArray(_useState, 2),
20596
20667
  onEndReachedCalled = _useState2[0],
20597
20668
  setOnEndReachedCalled = _useState2[1];
20598
20669
 
20599
- return /*#__PURE__*/React.createElement(FlatList, {
20600
- ref: flatListRef,
20601
- style: _objectSpread2({
20602
- paddingHorizontal: theme.__hd__.select.space.optionListPadding
20603
- }, onQueryChange ? {
20670
+ return /*#__PURE__*/React.createElement(SectionList, {
20671
+ ref: sectionListRef,
20672
+ style: _objectSpread2({}, onQueryChange ? {
20604
20673
  height: Dimensions.get('screen').height
20605
20674
  } : {}),
20606
- data: options,
20675
+ sections: sections,
20607
20676
  keyExtractor: keyExtractor,
20608
20677
  onEndReachedThreshold: 0.1,
20609
20678
  onEndReached: function onEndReached() {
@@ -20611,11 +20680,9 @@ var StyledOptionList = function StyledOptionList(_ref) {
20611
20680
  },
20612
20681
  onScrollToIndexFailed: function onScrollToIndexFailed() {},
20613
20682
  onContentSizeChange: function onContentSizeChange() {
20614
- var _flatListRef$current;
20683
+ var _sectionListRef$curre;
20615
20684
 
20616
- return options.length && ((_flatListRef$current = flatListRef.current) === null || _flatListRef$current === void 0 ? void 0 : _flatListRef$current.scrollToIndex({
20617
- index: scrollIndex
20618
- }));
20685
+ return sections.length && ((_sectionListRef$curre = sectionListRef.current) === null || _sectionListRef$curre === void 0 ? void 0 : _sectionListRef$curre.scrollToLocation(scrollParams));
20619
20686
  },
20620
20687
  onMomentumScrollBegin: function onMomentumScrollBegin() {
20621
20688
  if (onEndReached && onEndReachedCalled && !loading) onEndReached();
@@ -20628,30 +20695,37 @@ var StyledOptionList = function StyledOptionList(_ref) {
20628
20695
  height: theme.space.xxxxlarge
20629
20696
  }
20630
20697
  }, /*#__PURE__*/React.createElement(Spinner, null)) : null,
20631
- renderItem: function renderItem(_ref2) {
20632
- var item = _ref2.item,
20633
- index = _ref2.index;
20634
- return /*#__PURE__*/React.createElement(View, {
20635
- key: getKey(item, index, keyExtractor)
20636
- }, /*#__PURE__*/React.createElement(RenderItem, {
20637
- item: item
20638
- }));
20639
- }
20698
+ renderSectionHeader: function renderSectionHeader(_ref2) {
20699
+ var category = _ref2.section.category;
20700
+ return category !== '' ? /*#__PURE__*/React.createElement(SectionHeading, {
20701
+ text: category,
20702
+ style: {
20703
+ marginBottom: 0
20704
+ }
20705
+ }) : null;
20706
+ },
20707
+ renderItem: renderItem,
20708
+ ItemSeparatorComponent: OptionSpacer,
20709
+ SectionSeparatorComponent: SectionSpacer
20640
20710
  });
20641
20711
  };
20642
20712
 
20643
20713
  var Option$1 = function Option(_ref) {
20644
20714
  var text = _ref.text,
20715
+ _ref$disabled = _ref.disabled,
20716
+ disabled = _ref$disabled === void 0 ? false : _ref$disabled,
20645
20717
  selected = _ref.selected,
20646
20718
  onPress = _ref.onPress;
20719
+ var theme = useTheme();
20647
20720
  return /*#__PURE__*/React.createElement(List.BasicItem, {
20648
20721
  selected: selected,
20722
+ disabled: disabled,
20649
20723
  onPress: onPress,
20650
20724
  title: text,
20651
- suffix: selected ? /*#__PURE__*/React.createElement(Icon, {
20652
- icon: "checkmark",
20653
- size: "small"
20654
- }) : undefined
20725
+ suffix: selected ? 'checkmark' : undefined,
20726
+ style: {
20727
+ marginHorizontal: theme.__hd__.select.space.optionHorizontalMargin
20728
+ }
20655
20729
  });
20656
20730
  };
20657
20731
 
@@ -20659,51 +20733,62 @@ var OptionList$1 = function OptionList(_ref) {
20659
20733
  var keyExtractor = _ref.keyExtractor,
20660
20734
  loading = _ref.loading,
20661
20735
  onEndReached = _ref.onEndReached,
20662
- _onPress = _ref.onPress,
20736
+ onPress = _ref.onPress,
20663
20737
  onQueryChange = _ref.onQueryChange,
20664
- options = _ref.options,
20738
+ sections = _ref.sections,
20739
+ renderOption = _ref.renderOption,
20665
20740
  value = _ref.value;
20666
20741
  var firstValue = value === null || value === void 0 ? void 0 : value[0];
20667
- var rawScrollIndex = firstValue ? options.findIndex(function (option) {
20668
- return option.value === firstValue;
20669
- }) : 0;
20670
- var scrollIndex = rawScrollIndex - 2 >= 0 ? rawScrollIndex - 2 : 0;
20671
- var RenderItem = /*#__PURE__*/React.memo(function (_ref2) {
20672
- var item = _ref2.item;
20673
- return /*#__PURE__*/React.createElement(Option$1, {
20674
- text: item.text,
20675
- selected: value.includes(item.value),
20676
- onPress: function onPress() {
20677
- if (value.includes(item.value)) {
20678
- _onPress(value.filter(function (val) {
20679
- return val !== item.value;
20680
- }));
20681
- } else {
20682
- _onPress([].concat(_toConsumableArray(value), [item.value]));
20683
- }
20742
+ var scrollParams = getScrollParams(firstValue, sections);
20743
+
20744
+ var renderItem = function renderItem(info) {
20745
+ var item = info.item;
20746
+ var selected = value.includes(info.item.value);
20747
+
20748
+ var onItemPress = function onItemPress() {
20749
+ if (value.includes(info.item.value)) {
20750
+ onPress(value.filter(function (val) {
20751
+ return val !== info.item.value;
20752
+ }));
20753
+ } else {
20754
+ onPress([].concat(_toConsumableArray(value), [info.item.value]));
20684
20755
  }
20756
+ };
20757
+
20758
+ return renderOption ? renderOption(_objectSpread2(_objectSpread2({}, info), {}, {
20759
+ selected: selected,
20760
+ onPress: onItemPress
20761
+ })) : /*#__PURE__*/React.createElement(Option$1, {
20762
+ selected: selected,
20763
+ text: item.text,
20764
+ disabled: item.disabled,
20765
+ onPress: onItemPress
20685
20766
  });
20686
- });
20767
+ };
20768
+
20687
20769
  return /*#__PURE__*/React.createElement(StyledOptionList, {
20688
20770
  keyExtractor: keyExtractor,
20689
20771
  loading: loading,
20690
20772
  onEndReached: onEndReached,
20691
20773
  onQueryChange: onQueryChange,
20692
- options: options,
20693
- RenderItem: RenderItem,
20694
- scrollIndex: scrollIndex
20774
+ sections: sections,
20775
+ renderItem: renderItem,
20776
+ scrollParams: scrollParams
20695
20777
  });
20696
20778
  };
20697
20779
 
20698
20780
  function MultiSelect(_ref) {
20699
20781
  var footerLabel = _ref.footerLabel,
20700
20782
  label = _ref.label,
20701
- loading = _ref.loading,
20783
+ _ref$loading = _ref.loading,
20784
+ loading = _ref$loading === void 0 ? false : _ref$loading,
20785
+ inputProps = _ref.inputProps,
20702
20786
  onConfirm = _ref.onConfirm,
20703
20787
  onDimiss = _ref.onDimiss,
20704
20788
  onEndReached = _ref.onEndReached,
20705
20789
  onQueryChange = _ref.onQueryChange,
20706
20790
  options = _ref.options,
20791
+ renderOption = _ref.renderOption,
20707
20792
  query = _ref.query,
20708
20793
  error = _ref.error,
20709
20794
  _ref$editable = _ref.editable,
@@ -20715,6 +20800,10 @@ function MultiSelect(_ref) {
20715
20800
  testID = _ref.testID,
20716
20801
  value = _ref.value;
20717
20802
 
20803
+ var _useKeyboard = useKeyboard(),
20804
+ isKeyboardVisible = _useKeyboard.isKeyboardVisible,
20805
+ keyboardHeight = _useKeyboard.keyboardHeight;
20806
+
20718
20807
  var _useState = useState(false),
20719
20808
  _useState2 = _slicedToArray(_useState, 2),
20720
20809
  open = _useState2[0],
@@ -20725,37 +20814,15 @@ function MultiSelect(_ref) {
20725
20814
  selectingValue = _useState4[0],
20726
20815
  setSelectingValue = _useState4[1];
20727
20816
 
20728
- var displayedValue = options.filter(function (opt) {
20817
+ var sections = toSections(options);
20818
+ var flatOptions = toFlatOptions(options);
20819
+ var displayedValue = flatOptions.filter(function (opt) {
20729
20820
  return value.includes(opt.value);
20730
20821
  }).map(function (opt) {
20731
20822
  return opt.text;
20732
20823
  }).join(', ');
20733
-
20734
- var _useState5 = useState(false),
20735
- _useState6 = _slicedToArray(_useState5, 2),
20736
- isKeyboardVisible = _useState6[0],
20737
- setKeyboardVisible = _useState6[1];
20738
-
20739
- var _useState7 = useState(0),
20740
- _useState8 = _slicedToArray(_useState7, 2),
20741
- keyboardHeight = _useState8[0],
20742
- setKeyboardHeight = _useState8[1];
20743
-
20744
- useEffect(function () {
20745
- var keyboardDidShowListener = Keyboard.addListener('keyboardDidShow', function (e) {
20746
- setKeyboardVisible(true);
20747
- setKeyboardHeight(e.endCoordinates.height);
20748
- });
20749
- var keyboardDidHideListener = Keyboard.addListener('keyboardDidHide', function () {
20750
- setKeyboardVisible(false);
20751
- });
20752
- return function () {
20753
- keyboardDidHideListener.remove();
20754
- keyboardDidShowListener.remove();
20755
- };
20756
- }, []);
20757
20824
  return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(View, {
20758
- pointerEvents: !editable || disabled ? 'none' : 'auto'
20825
+ pointerEvents: !editable || disabled || inputProps !== null && inputProps !== void 0 && inputProps.loading ? 'none' : 'auto'
20759
20826
  }, /*#__PURE__*/React.createElement(TouchableOpacity, {
20760
20827
  onPress: function onPress() {
20761
20828
  return setOpen(true);
@@ -20768,6 +20835,7 @@ function MultiSelect(_ref) {
20768
20835
  error: error,
20769
20836
  editable: editable,
20770
20837
  disabled: disabled,
20838
+ loading: inputProps === null || inputProps === void 0 ? void 0 : inputProps.loading,
20771
20839
  numberOfLines: numberOfLines,
20772
20840
  pointerEvents: "none",
20773
20841
  style: style,
@@ -20799,9 +20867,11 @@ function MultiSelect(_ref) {
20799
20867
  onChangeText: onQueryChange,
20800
20868
  value: query
20801
20869
  })), /*#__PURE__*/React.createElement(OptionList$1, {
20870
+ onQueryChange: onQueryChange,
20802
20871
  onEndReached: onEndReached,
20803
20872
  loading: loading,
20804
- options: options,
20873
+ sections: sections,
20874
+ renderOption: renderOption,
20805
20875
  value: selectingValue,
20806
20876
  onPress: setSelectingValue
20807
20877
  })));
@@ -20809,12 +20879,19 @@ function MultiSelect(_ref) {
20809
20879
 
20810
20880
  var Option = function Option(_ref) {
20811
20881
  var text = _ref.text,
20882
+ _ref$disabled = _ref.disabled,
20883
+ disabled = _ref$disabled === void 0 ? false : _ref$disabled,
20812
20884
  selected = _ref.selected,
20813
20885
  onPress = _ref.onPress;
20886
+ var theme = useTheme();
20814
20887
  return /*#__PURE__*/React.createElement(List.BasicItem, {
20815
20888
  selected: selected,
20889
+ disabled: disabled,
20816
20890
  onPress: onPress,
20817
- title: text
20891
+ title: text,
20892
+ style: {
20893
+ marginHorizontal: theme.__hd__.select.space.optionHorizontalMargin
20894
+ }
20818
20895
  });
20819
20896
  };
20820
20897
 
@@ -20822,49 +20899,60 @@ var OptionList = function OptionList(_ref) {
20822
20899
  var keyExtractor = _ref.keyExtractor,
20823
20900
  loading = _ref.loading,
20824
20901
  onEndReached = _ref.onEndReached,
20825
- _onPress = _ref.onPress,
20902
+ onPress = _ref.onPress,
20826
20903
  onQueryChange = _ref.onQueryChange,
20827
- options = _ref.options,
20904
+ sections = _ref.sections,
20905
+ renderOption = _ref.renderOption,
20828
20906
  value = _ref.value;
20829
- var rawScrollIndex = options.findIndex(function (option) {
20830
- return option.value === value;
20831
- });
20832
- var scrollIndex = rawScrollIndex - 2 >= 0 ? rawScrollIndex - 2 : 0;
20833
- var RenderItem = /*#__PURE__*/React.memo(function (_ref2) {
20834
- var item = _ref2.item;
20835
- return /*#__PURE__*/React.createElement(Option, {
20836
- selected: value === item.value,
20837
- text: item.text,
20838
- onPress: function onPress() {
20839
- if (value === item.value) {
20840
- _onPress(null);
20841
- } else {
20842
- _onPress(item.value);
20843
- }
20907
+ var scrollParams = getScrollParams(value, sections);
20908
+
20909
+ var renderItem = function renderItem(info) {
20910
+ var item = info.item;
20911
+ var selected = item.value === value;
20912
+
20913
+ var onItemPress = function onItemPress() {
20914
+ if (value === item.value) {
20915
+ onPress(null);
20916
+ } else {
20917
+ onPress(item.value);
20844
20918
  }
20919
+ };
20920
+
20921
+ return renderOption ? renderOption(_objectSpread2(_objectSpread2({}, info), {}, {
20922
+ selected: selected,
20923
+ onPress: onItemPress
20924
+ })) : /*#__PURE__*/React.createElement(Option, {
20925
+ selected: selected,
20926
+ text: item.text,
20927
+ disabled: item.disabled,
20928
+ onPress: onItemPress
20845
20929
  });
20846
- });
20930
+ };
20931
+
20847
20932
  return /*#__PURE__*/React.createElement(StyledOptionList, {
20848
20933
  keyExtractor: keyExtractor,
20849
20934
  loading: loading,
20850
20935
  onEndReached: onEndReached,
20851
20936
  onQueryChange: onQueryChange,
20852
- options: options,
20853
- RenderItem: RenderItem,
20854
- scrollIndex: scrollIndex
20937
+ sections: sections,
20938
+ renderItem: renderItem,
20939
+ scrollParams: scrollParams
20855
20940
  });
20856
20941
  };
20857
20942
 
20858
20943
  var SingleSelect = function SingleSelect(_ref) {
20859
- var _options$find;
20944
+ var _flatOptions$find;
20860
20945
 
20861
20946
  var label = _ref.label,
20862
- loading = _ref.loading,
20947
+ _ref$loading = _ref.loading,
20948
+ loading = _ref$loading === void 0 ? false : _ref$loading,
20949
+ inputProps = _ref.inputProps,
20863
20950
  onConfirm = _ref.onConfirm,
20864
20951
  onDimiss = _ref.onDimiss,
20865
20952
  onEndReached = _ref.onEndReached,
20866
20953
  onQueryChange = _ref.onQueryChange,
20867
20954
  options = _ref.options,
20955
+ renderOption = _ref.renderOption,
20868
20956
  query = _ref.query,
20869
20957
  error = _ref.error,
20870
20958
  _ref$editable = _ref.editable,
@@ -20876,6 +20964,10 @@ var SingleSelect = function SingleSelect(_ref) {
20876
20964
  testID = _ref.testID,
20877
20965
  value = _ref.value;
20878
20966
 
20967
+ var _useKeyboard = useKeyboard(),
20968
+ isKeyboardVisible = _useKeyboard.isKeyboardVisible,
20969
+ keyboardHeight = _useKeyboard.keyboardHeight;
20970
+
20879
20971
  var _useState = useState(false),
20880
20972
  _useState2 = _slicedToArray(_useState, 2),
20881
20973
  open = _useState2[0],
@@ -20886,35 +20978,13 @@ var SingleSelect = function SingleSelect(_ref) {
20886
20978
  selectingValue = _useState4[0],
20887
20979
  setSelectingValue = _useState4[1];
20888
20980
 
20889
- var displayedValue = (_options$find = options.find(function (opt) {
20981
+ var sections = toSections(options);
20982
+ var flatOptions = toFlatOptions(options);
20983
+ var displayedValue = (_flatOptions$find = flatOptions.find(function (opt) {
20890
20984
  return value === opt.value;
20891
- })) === null || _options$find === void 0 ? void 0 : _options$find.text;
20892
-
20893
- var _useState5 = useState(false),
20894
- _useState6 = _slicedToArray(_useState5, 2),
20895
- isKeyboardVisible = _useState6[0],
20896
- setKeyboardVisible = _useState6[1];
20897
-
20898
- var _useState7 = useState(0),
20899
- _useState8 = _slicedToArray(_useState7, 2),
20900
- keyboardHeight = _useState8[0],
20901
- setKeyboardHeight = _useState8[1];
20902
-
20903
- useEffect(function () {
20904
- var keyboardDidShowListener = Keyboard.addListener('keyboardWillShow', function (e) {
20905
- setKeyboardVisible(true);
20906
- setKeyboardHeight(e.endCoordinates.height);
20907
- });
20908
- var keyboardDidHideListener = Keyboard.addListener('keyboardWillHide', function () {
20909
- setKeyboardVisible(false);
20910
- });
20911
- return function () {
20912
- keyboardDidHideListener.remove();
20913
- keyboardDidShowListener.remove();
20914
- };
20915
- }, []);
20985
+ })) === null || _flatOptions$find === void 0 ? void 0 : _flatOptions$find.text;
20916
20986
  return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(View, {
20917
- pointerEvents: !editable || disabled ? 'none' : 'auto'
20987
+ pointerEvents: !editable || disabled || inputProps !== null && inputProps !== void 0 && inputProps.loading ? 'none' : 'auto'
20918
20988
  }, /*#__PURE__*/React.createElement(TouchableOpacity, {
20919
20989
  onPress: function onPress() {
20920
20990
  return setOpen(true);
@@ -20927,6 +20997,7 @@ var SingleSelect = function SingleSelect(_ref) {
20927
20997
  error: error,
20928
20998
  editable: editable,
20929
20999
  disabled: disabled,
21000
+ loading: inputProps === null || inputProps === void 0 ? void 0 : inputProps.loading,
20930
21001
  numberOfLines: numberOfLines,
20931
21002
  pointerEvents: "none",
20932
21003
  style: style,
@@ -20954,7 +21025,8 @@ var SingleSelect = function SingleSelect(_ref) {
20954
21025
  onQueryChange: onQueryChange,
20955
21026
  onEndReached: onEndReached,
20956
21027
  loading: loading,
20957
- options: options,
21028
+ sections: sections,
21029
+ renderOption: renderOption,
20958
21030
  value: selectingValue,
20959
21031
  onPress: function onPress(selectedValue) {
20960
21032
  setOpen(false);
@@ -40291,7 +40363,7 @@ var RichTextEditor = function RichTextEditor(_ref) {
40291
40363
  break;
40292
40364
  }
40293
40365
  }, []);
40294
- return /*#__PURE__*/React.createElement(StyledContainer$2, {
40366
+ return /*#__PURE__*/React.createElement(StyledContainer$3, {
40295
40367
  style: style,
40296
40368
  testID: testID
40297
40369
  }, /*#__PURE__*/React.createElement(StyledTextInputContainer, null, /*#__PURE__*/React.createElement(StyledBorderBackDrop, {