@hero-design/rn 7.28.0 → 7.29.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (80) hide show
  1. package/.eslintrc.js +2 -1
  2. package/.turbo/turbo-build.log +9 -9
  3. package/es/index.js +119 -95
  4. package/lib/index.js +119 -95
  5. package/package.json +5 -4
  6. package/src/components/Alert/index.tsx +1 -0
  7. package/src/components/BottomSheet/Header.tsx +1 -1
  8. package/src/components/BottomSheet/StyledBottomSheet.tsx +1 -2
  9. package/src/components/BottomSheet/__tests__/__snapshots__/index.spec.tsx.snap +12 -14
  10. package/src/components/DatePicker/DatePickerIOS.tsx +5 -11
  11. package/src/components/DatePicker/__tests__/__snapshots__/DatePickerAndroid.spec.tsx.snap +1 -0
  12. package/src/components/DatePicker/__tests__/__snapshots__/DatePickerIOS.spec.tsx.snap +35 -16
  13. package/src/components/Empty/StyledEmpty.tsx +1 -1
  14. package/src/components/Empty/__tests__/__snapshots__/index.spec.tsx.snap +10 -10
  15. package/src/components/FAB/ActionGroup/__tests__/__snapshots__/index.spec.tsx.snap +3 -3
  16. package/src/components/FAB/ActionGroup/index.tsx +1 -1
  17. package/src/components/List/ListItem.tsx +2 -2
  18. package/src/components/Progress/ProgressCircle.tsx +1 -1
  19. package/src/components/Select/{StyledOptionList.tsx → BaseOptionList.tsx} +6 -6
  20. package/src/components/Select/Footer.tsx +2 -7
  21. package/src/components/Select/MultiSelect/Option.tsx +24 -11
  22. package/src/components/Select/MultiSelect/OptionList.tsx +3 -2
  23. package/src/components/Select/MultiSelect/__tests__/__snapshots__/Option.spec.tsx.snap +3 -2
  24. package/src/components/Select/MultiSelect/__tests__/__snapshots__/OptionList.spec.tsx.snap +47 -21
  25. package/src/components/Select/MultiSelect/__tests__/__snapshots__/index.spec.tsx.snap +204 -107
  26. package/src/components/Select/MultiSelect/index.tsx +16 -0
  27. package/src/components/Select/SingleSelect/Option.tsx +12 -12
  28. package/src/components/Select/SingleSelect/OptionList.tsx +3 -2
  29. package/src/components/Select/SingleSelect/StyledSingleSelect.tsx +6 -0
  30. package/src/components/Select/SingleSelect/__tests__/__snapshots__/Option.spec.tsx.snap +0 -1
  31. package/src/components/Select/SingleSelect/__tests__/__snapshots__/OptionList.spec.tsx.snap +32 -16
  32. package/src/components/Select/SingleSelect/__tests__/__snapshots__/index.spec.tsx.snap +70 -54
  33. package/src/components/Select/SingleSelect/index.tsx +16 -0
  34. package/src/components/Select/StyledSelect.tsx +6 -7
  35. package/src/components/Select/types.ts +1 -0
  36. package/src/components/Tabs/ScrollableTabs.tsx +1 -1
  37. package/src/components/Tabs/__tests__/__snapshots__/ScrollableTabs.spec.tsx.snap +9 -3
  38. package/src/components/Tag/index.tsx +2 -2
  39. package/src/components/TextInput/__tests__/__snapshots__/index.spec.tsx.snap +12 -0
  40. package/src/components/TextInput/__tests__/index.spec.tsx +4 -2
  41. package/src/components/TextInput/index.tsx +7 -1
  42. package/src/components/TimePicker/TimePickerIOS.tsx +5 -11
  43. package/src/components/TimePicker/__tests__/__snapshots__/TimePickerAndroid.spec.tsx.snap +1 -0
  44. package/src/components/TimePicker/__tests__/__snapshots__/TimePickerIOS.spec.tsx.snap +35 -16
  45. package/src/components/Toast/ToastContainer.tsx +1 -1
  46. package/src/components/Toast/ToastProvider.tsx +10 -1
  47. package/src/components/Toast/__tests__/ToastContainer.spec.tsx +5 -5
  48. package/src/components/Toast/__tests__/__snapshots__/ToastContainer.spec.tsx.snap +4 -4
  49. package/src/components/Typography/Text/StyledText.tsx +2 -1
  50. package/src/components/Typography/Text/index.tsx +2 -1
  51. package/src/theme/__tests__/__snapshots__/index.spec.ts.snap +19 -15
  52. package/src/theme/components/bottomSheet.ts +4 -5
  53. package/src/theme/components/empty.ts +6 -5
  54. package/src/theme/components/fab.ts +1 -1
  55. package/src/theme/components/select.ts +4 -6
  56. package/src/theme/components/typography.ts +2 -0
  57. package/src/theme/global/colors/global.ts +1 -0
  58. package/src/theme/global/colors/types.ts +1 -0
  59. package/src/theme/global/typography.ts +4 -1
  60. package/types/components/Alert/index.d.ts +1 -0
  61. package/types/components/List/ListItem.d.ts +2 -2
  62. package/types/components/Select/{StyledOptionList.d.ts → BaseOptionList.d.ts} +3 -3
  63. package/types/components/Select/MultiSelect/Option.d.ts +2 -1
  64. package/types/components/Select/SingleSelect/Option.d.ts +2 -1
  65. package/types/components/Select/SingleSelect/StyledSingleSelect.d.ts +1 -0
  66. package/types/components/Select/StyledSelect.d.ts +3 -6
  67. package/types/components/Select/types.d.ts +1 -0
  68. package/types/components/Toast/ToastProvider.d.ts +1 -1
  69. package/types/components/Toast/index.d.ts +1 -1
  70. package/types/components/Typography/Text/StyledText.d.ts +1 -1
  71. package/types/components/Typography/Text/index.d.ts +1 -1
  72. package/types/theme/components/bottomSheet.d.ts +0 -1
  73. package/types/theme/components/empty.d.ts +1 -0
  74. package/types/theme/components/select.d.ts +3 -4
  75. package/types/theme/components/typography.d.ts +2 -0
  76. package/types/theme/global/colors/types.d.ts +1 -0
  77. package/types/theme/global/index.d.ts +1 -0
  78. package/types/theme/global/typography.d.ts +1 -0
  79. package/src/components/Select/__tests__/StyledSelect.spec.tsx +0 -14
  80. package/src/components/Select/__tests__/__snapshots__/StyledSelect.spec.tsx.snap +0 -29
package/lib/index.js CHANGED
@@ -1260,6 +1260,7 @@ var globalPalette = {
1260
1260
  disabledOnDefaultGlobalSurface: palette$6.greyLight30,
1261
1261
  darkGlobalSurface: palette$6.maasstrichtBlue,
1262
1262
  onDarkGlobalSurface: palette$6.white,
1263
+ overlayGlobalSurface: palette$6.black,
1263
1264
  // Outlines
1264
1265
  primaryOutline: palette$6.maasstrichtBlue,
1265
1266
  secondaryOutline: palette$6.greyLight75,
@@ -1445,7 +1446,7 @@ var getFonts = function getFonts(_ref) {
1445
1446
  };
1446
1447
  };
1447
1448
  var getFontSizes = function getFontSizes(baseFontSize) {
1448
- var fontSizes = Array.from(new Array(9));
1449
+ var fontSizes = Array.from(new Array(11));
1449
1450
  fontSizes.forEach(function (_, index) {
1450
1451
  if (index === 0) {
1451
1452
  fontSizes[0] = baseFontSize;
@@ -1455,6 +1456,7 @@ var getFontSizes = function getFontSizes(baseFontSize) {
1455
1456
  return undefined;
1456
1457
  });
1457
1458
  return {
1459
+ '7xlarge': scale(fontSizes[10]),
1458
1460
  xxxxxlarge: scale(fontSizes[8]),
1459
1461
  xxxxlarge: scale(fontSizes[7]),
1460
1462
  xxxlarge: scale(fontSizes[6]),
@@ -1470,6 +1472,7 @@ var getFontSizes = function getFontSizes(baseFontSize) {
1470
1472
  var getLineHeights = function getLineHeights(fontSizes) {
1471
1473
  var additionalSpace = 8;
1472
1474
  return {
1475
+ '7xlarge': fontSizes['7xlarge'] + additionalSpace,
1473
1476
  xxxxxlarge: fontSizes.xxxxxlarge + additionalSpace,
1474
1477
  xxxxlarge: fontSizes.xxxxlarge + additionalSpace,
1475
1478
  xxxlarge: fontSizes.xxxlarge + additionalSpace,
@@ -1735,17 +1738,16 @@ var getBottomSheetTheme = function getBottomSheetTheme(theme) {
1735
1738
  var colors = {
1736
1739
  shadow: theme.colors.primaryOutline,
1737
1740
  background: theme.colors.defaultGlobalSurface,
1738
- backdrop: theme.colors.darkGlobalSurface
1741
+ backdrop: theme.colors.overlayGlobalSurface
1739
1742
  };
1740
1743
  var sizes = {
1741
- sectionHeight: theme.sizes.xxxxxlarge,
1742
1744
  closeIcon: theme.sizes.xxxlarge
1743
1745
  };
1744
1746
  var space = {
1745
1747
  headerWrapperVerticalPadding: theme.space.small,
1746
1748
  headerWrapperHorizontalPadding: theme.space.medium,
1747
1749
  closeIconMargin: theme.space.smallMedium,
1748
- footerVerticalPadding: theme.space.small,
1750
+ footerVerticalPadding: theme.space.xxsmall,
1749
1751
  footerHorizontalPadding: theme.space.smallMedium
1750
1752
  };
1751
1753
  var shadows = {
@@ -1753,8 +1755,8 @@ var getBottomSheetTheme = function getBottomSheetTheme(theme) {
1753
1755
  width: 0,
1754
1756
  height: 3
1755
1757
  },
1756
- opacity: 0.27,
1757
- radius: 4.65,
1758
+ opacity: 0.4,
1759
+ radius: theme.radii.xlarge,
1758
1760
  elevation: 10
1759
1761
  };
1760
1762
  var radii = {
@@ -1993,15 +1995,16 @@ var getEmptyTheme = function getEmptyTheme(theme) {
1993
1995
  var colors = {
1994
1996
  text: theme.colors.onDefaultGlobalSurface,
1995
1997
  invertedText: theme.colors.onDarkGlobalSurface,
1996
- subduedText: theme.colors.disabledOnDefaultGlobalSurface
1998
+ subduedText: theme.colors.mutedOnDefaultGlobalSurface,
1999
+ invertedSubduedText: theme.colors.onDarkGlobalSurface
1997
2000
  };
1998
2001
  var fontSizes = {
1999
- title: theme.fontSizes.xxxxlarge,
2000
- description: theme.fontSizes.large
2002
+ title: theme.fontSizes.xxxlarge,
2003
+ description: theme.fontSizes.xlarge
2001
2004
  };
2002
2005
  var fonts = {
2003
- title: theme.fonts.neutral.semiBold,
2004
- description: theme.fonts.neutral.light
2006
+ title: theme.fonts.playful.semiBold,
2007
+ description: theme.fonts.playful.regular
2005
2008
  };
2006
2009
  return {
2007
2010
  fontSizes: fontSizes,
@@ -2018,7 +2021,7 @@ var getFABTheme = function getFABTheme(theme) {
2018
2021
  icon: theme.colors.onPrimary,
2019
2022
  headerText: theme.colors.onDarkGlobalSurface,
2020
2023
  actionItemBackground: theme.colors.primary,
2021
- backdropBackground: theme.colors.darkGlobalSurface,
2024
+ backdropBackground: theme.colors.overlayGlobalSurface,
2022
2025
  titleText: theme.colors.onDarkGlobalSurface,
2023
2026
  actionItemText: theme.colors.onPrimary
2024
2027
  };
@@ -2332,24 +2335,22 @@ var getSectionHeadingTheme = function getSectionHeadingTheme(theme) {
2332
2335
  };
2333
2336
 
2334
2337
  var getSelectTheme = function getSelectTheme(theme) {
2335
- var colors = {
2336
- footerText: theme.colors.secondary
2337
- };
2338
2338
  var space = {
2339
2339
  minimumOptionListHeight: theme.space.xxxxlarge * 5,
2340
2340
  sectionSpacing: theme.space.smallMedium,
2341
2341
  optionSpacing: theme.space.xsmall,
2342
- optionHorizontalMargin: theme.space.smallMedium,
2342
+ optionListHorizontalPadding: theme.space.smallMedium,
2343
2343
  searchBarMarginTopSpacing: theme.space.small,
2344
2344
  searchBarHorizontalSpacing: theme.space.medium,
2345
- searchBarBottomSpacing: theme.space.small
2345
+ searchBarBottomSpacing: theme.space.small,
2346
+ singleSelectContentPaddingBottom: theme.space.medium,
2347
+ suffixMarginRight: theme.space.smallMedium
2346
2348
  };
2347
2349
  var radii = {
2348
2350
  option: theme.radii.base
2349
2351
  };
2350
2352
  return {
2351
2353
  space: space,
2352
- colors: colors,
2353
2354
  radii: radii
2354
2355
  };
2355
2356
  };
@@ -2718,7 +2719,8 @@ var getTypographyTheme = function getTypographyTheme(theme) {
2718
2719
  large: theme.fontSizes.large,
2719
2720
  xlarge: theme.fontSizes.xlarge,
2720
2721
  xxxlarge: theme.fontSizes.xxxlarge,
2721
- xxxxxlarge: theme.fontSizes.xxxxxlarge
2722
+ xxxxxlarge: theme.fontSizes.xxxxxlarge,
2723
+ '7xlarge': theme.fontSizes['7xlarge']
2722
2724
  };
2723
2725
  var lineHeights = {
2724
2726
  small: theme.lineHeights.small,
@@ -2726,7 +2728,8 @@ var getTypographyTheme = function getTypographyTheme(theme) {
2726
2728
  large: theme.lineHeights.large,
2727
2729
  xlarge: theme.lineHeights.xlarge,
2728
2730
  xxxlarge: theme.lineHeights.xxxlarge,
2729
- xxxxxlarge: theme.lineHeights.xxxxxlarge
2731
+ xxxxxlarge: theme.lineHeights.xxxxxlarge,
2732
+ '7xlarge': theme.lineHeights['7xlarge']
2730
2733
  };
2731
2734
  return {
2732
2735
  colors: colors,
@@ -7073,7 +7076,7 @@ var StyledBackdrop$2 = index$a(AnimatedPressable$1)(function (_ref2) {
7073
7076
  var theme = _ref2.theme;
7074
7077
  return _objectSpread2(_objectSpread2({}, reactNative.StyleSheet.absoluteFillObject), {}, {
7075
7078
  backgroundColor: theme.__hd__.bottomSheet.colors.backdrop,
7076
- opacity: 0.48
7079
+ opacity: 0.4
7077
7080
  });
7078
7081
  });
7079
7082
  var StyledHeaderWrapper = index$a(reactNative.View)(function (_ref3) {
@@ -7093,7 +7096,6 @@ var StyledFooter = index$a(reactNative.View)(function (_ref4) {
7093
7096
  return {
7094
7097
  paddingHorizontal: theme.__hd__.bottomSheet.space.footerHorizontalPadding,
7095
7098
  paddingVertical: theme.__hd__.bottomSheet.space.footerVerticalPadding,
7096
- minHeight: theme.__hd__.bottomSheet.sizes.sectionHeight,
7097
7099
  alignItems: 'center',
7098
7100
  justifyContent: 'flex-end',
7099
7101
  flexDirection: 'row'
@@ -7626,7 +7628,7 @@ var Header = function Header(_ref) {
7626
7628
  onPress: onRequestClose,
7627
7629
  intent: "text",
7628
7630
  testID: "bottom-sheet-close-icon",
7629
- size: "small"
7631
+ size: "xsmall"
7630
7632
  })) : null), showDivider ? /*#__PURE__*/React__default["default"].createElement(Divider, null) : null);
7631
7633
  };
7632
7634
 
@@ -10824,6 +10826,9 @@ var getVariant$1 = function getVariant(_ref) {
10824
10826
  }
10825
10827
  return 'default';
10826
10828
  };
10829
+ // Fix issue: Placeholder is not shown on iOS when multiline is true
10830
+ // https://github.com/callstack/react-native-paper/pull/3331
10831
+ var EMPTY_PLACEHOLDER_VALUE = ' ';
10827
10832
  var TextInput = function TextInput(_ref2) {
10828
10833
  var _ref3;
10829
10834
  var label = _ref2.label,
@@ -10909,7 +10914,7 @@ var TextInput = function TextInput(_ref2) {
10909
10914
  (_nativeProps$onChange = nativeProps.onChangeText) === null || _nativeProps$onChange === void 0 ? void 0 : _nativeProps$onChange.call(nativeProps, text);
10910
10915
  },
10911
10916
  defaultValue: defaultValue,
10912
- placeholder: isFocused || label === undefined ? nativeProps.placeholder : undefined
10917
+ placeholder: isFocused || label === undefined ? nativeProps.placeholder : EMPTY_PLACEHOLDER_VALUE
10913
10918
  });
10914
10919
  return /*#__PURE__*/React__default["default"].createElement(StyledContainer$3, {
10915
10920
  style: style,
@@ -11071,18 +11076,16 @@ var DatePickerIOS = function DatePickerIOS(_ref) {
11071
11076
  return setOpen(false);
11072
11077
  },
11073
11078
  header: label,
11074
- footer: /*#__PURE__*/React__default["default"].createElement(reactNative.TouchableOpacity, {
11079
+ footer: /*#__PURE__*/React__default["default"].createElement(CompoundButton, {
11080
+ variant: "text",
11081
+ text: confirmLabel,
11075
11082
  onPress: function onPress() {
11076
11083
  if (selectingDate) {
11077
11084
  onChange(selectingDate);
11078
11085
  }
11079
11086
  setOpen(false);
11080
11087
  }
11081
- }, /*#__PURE__*/React__default["default"].createElement(Typography.Text, {
11082
- fontSize: "large",
11083
- fontWeight: "semi-bold",
11084
- intent: "primary"
11085
- }, confirmLabel))
11088
+ })
11086
11089
  }, /*#__PURE__*/React__default["default"].createElement(StyledPickerWrapper$1, null, /*#__PURE__*/React__default["default"].createElement(DateTimePicker__default["default"], {
11087
11090
  testID: "datePickerIOS",
11088
11091
  value: selectingDate,
@@ -11422,7 +11425,7 @@ var StyledDescription = index$a(reactNative.Text)(function (_ref3) {
11422
11425
  fontFamily: theme.__hd__.empty.fonts.description,
11423
11426
  fontSize: theme.__hd__.empty.fontSizes.description,
11424
11427
  textAlign: 'center',
11425
- color: themeVariant === 'dark' ? theme.__hd__.empty.colors.invertedText : theme.__hd__.empty.colors.subduedText
11428
+ color: themeVariant === 'dark' ? theme.__hd__.empty.colors.invertedSubduedText : theme.__hd__.empty.colors.subduedText
11426
11429
  };
11427
11430
  });
11428
11431
 
@@ -11693,7 +11696,7 @@ var ActionGroup = function ActionGroup(_ref2) {
11693
11696
  });
11694
11697
  var interpolatedBackdropOpacityAnimation = tranlateXAnimation.current.interpolate({
11695
11698
  inputRange: [0, 1],
11696
- outputRange: [0, 0.9]
11699
+ outputRange: [0, 0.4]
11697
11700
  });
11698
11701
  var interpolatedActionGroupOpacityAnimation = tranlateXAnimation.current.interpolate({
11699
11702
  inputRange: [0, 1],
@@ -12847,42 +12850,14 @@ var SectionHeading = function SectionHeading(_ref) {
12847
12850
  }, text)), rightChildren);
12848
12851
  };
12849
12852
 
12850
- var SectionSpacer = index$a(reactNative.View)(function (_ref) {
12851
- var theme = _ref.theme;
12852
- return {
12853
- marginTop: theme.__hd__.select.space.sectionSpacing
12854
- };
12855
- });
12856
- var OptionSpacer = index$a(reactNative.View)(function (_ref2) {
12857
- var theme = _ref2.theme;
12858
- return {
12859
- marginTop: theme.__hd__.select.space.optionSpacing
12860
- };
12861
- });
12862
- var FooterText = index$a(Typography.Text)(function (_ref3) {
12863
- var theme = _ref3.theme;
12864
- return {
12865
- color: theme.__hd__.select.colors.footerText
12866
- };
12867
- });
12868
- var StyledSearchBar = index$a(reactNative.View)(function (_ref4) {
12869
- var theme = _ref4.theme;
12870
- return {
12871
- marginTop: theme.__hd__.select.space.searchBarMarginTopSpacing,
12872
- paddingHorizontal: theme.__hd__.select.space.searchBarHorizontalSpacing,
12873
- paddingBottom: theme.__hd__.select.space.searchBarBottomSpacing
12874
- };
12875
- });
12876
-
12877
12853
  var Footer = function Footer(_ref) {
12878
12854
  var label = _ref.label,
12879
12855
  onPress = _ref.onPress;
12880
- return /*#__PURE__*/React__default["default"].createElement(reactNative.TouchableOpacity, {
12856
+ return /*#__PURE__*/React__default["default"].createElement(CompoundButton, {
12857
+ variant: "text",
12858
+ text: label,
12881
12859
  onPress: onPress
12882
- }, /*#__PURE__*/React__default["default"].createElement(FooterText, {
12883
- fontSize: "large",
12884
- fontWeight: "semi-bold"
12885
- }, label));
12860
+ });
12886
12861
  };
12887
12862
 
12888
12863
  var isSections = function isSections(options) {
@@ -12947,7 +12922,34 @@ var useKeyboard = function useKeyboard() {
12947
12922
  };
12948
12923
  };
12949
12924
 
12950
- var StyledOptionList = function StyledOptionList(_ref) {
12925
+ var SectionSpacer = index$a(reactNative.View)(function (_ref) {
12926
+ var theme = _ref.theme;
12927
+ return {
12928
+ marginTop: theme.__hd__.select.space.sectionSpacing
12929
+ };
12930
+ });
12931
+ var OptionSpacer = index$a(reactNative.View)(function (_ref2) {
12932
+ var theme = _ref2.theme;
12933
+ return {
12934
+ marginTop: theme.__hd__.select.space.optionSpacing
12935
+ };
12936
+ });
12937
+ var StyledSearchBar = index$a(reactNative.View)(function (_ref3) {
12938
+ var theme = _ref3.theme;
12939
+ return {
12940
+ marginTop: theme.__hd__.select.space.searchBarMarginTopSpacing,
12941
+ paddingHorizontal: theme.__hd__.select.space.searchBarHorizontalSpacing,
12942
+ paddingBottom: theme.__hd__.select.space.searchBarBottomSpacing
12943
+ };
12944
+ });
12945
+ var StyledSectionList = index$a(reactNative.SectionList)(function (_ref4) {
12946
+ var theme = _ref4.theme;
12947
+ return {
12948
+ paddingHorizontal: theme.__hd__.select.space.optionListHorizontalPadding
12949
+ };
12950
+ });
12951
+
12952
+ var BaseOptionList = function BaseOptionList(_ref) {
12951
12953
  var keyExtractor = _ref.keyExtractor,
12952
12954
  loading = _ref.loading,
12953
12955
  onEndReached = _ref.onEndReached,
@@ -12960,7 +12962,7 @@ var StyledOptionList = function StyledOptionList(_ref) {
12960
12962
  _useState2 = _slicedToArray(_useState, 2),
12961
12963
  onEndReachedCalled = _useState2[0],
12962
12964
  setOnEndReachedCalled = _useState2[1];
12963
- return /*#__PURE__*/React__default["default"].createElement(reactNative.SectionList, {
12965
+ return /*#__PURE__*/React__default["default"].createElement(StyledSectionList, {
12964
12966
  ref: sectionListRef,
12965
12967
  style: _objectSpread2({}, onQueryChange ? {
12966
12968
  height: reactNative.Dimensions.get('screen').height
@@ -13002,18 +13004,25 @@ var Option$2 = function Option(_ref) {
13002
13004
  _ref$disabled = _ref.disabled,
13003
13005
  disabled = _ref$disabled === void 0 ? false : _ref$disabled,
13004
13006
  selected = _ref.selected,
13005
- onPress = _ref.onPress;
13007
+ onPress = _ref.onPress,
13008
+ _ref$highlighted = _ref.highlighted,
13009
+ highlighted = _ref$highlighted === void 0 ? false : _ref$highlighted;
13006
13010
  var theme = useTheme();
13007
- return /*#__PURE__*/React__default["default"].createElement(List.BasicItem, {
13011
+ var props = {
13008
13012
  selected: selected,
13009
13013
  disabled: disabled,
13010
13014
  onPress: onPress,
13011
13015
  title: text,
13012
- suffix: selected ? 'checkmark' : undefined,
13013
- style: {
13014
- marginHorizontal: theme.__hd__.select.space.optionHorizontalMargin
13015
- }
13016
- });
13016
+ suffix: selected === true ? /*#__PURE__*/React__default["default"].createElement(Icon, {
13017
+ icon: "checkmark",
13018
+ intent: disabled ? 'disabled-text' : 'primary',
13019
+ size: "small",
13020
+ style: {
13021
+ marginRight: theme.__hd__.select.space.suffixMarginRight
13022
+ }
13023
+ }) : undefined
13024
+ };
13025
+ return highlighted === true ? /*#__PURE__*/React__default["default"].createElement(List.Item, props) : /*#__PURE__*/React__default["default"].createElement(List.BasicItem, props);
13017
13026
  };
13018
13027
 
13019
13028
  var OptionList$1 = function OptionList(_ref) {
@@ -13045,10 +13054,11 @@ var OptionList$1 = function OptionList(_ref) {
13045
13054
  selected: selected,
13046
13055
  text: item.text,
13047
13056
  disabled: item.disabled,
13048
- onPress: onItemPress
13057
+ onPress: onItemPress,
13058
+ highlighted: item.highlighted
13049
13059
  });
13050
13060
  };
13051
- return /*#__PURE__*/React__default["default"].createElement(StyledOptionList, {
13061
+ return /*#__PURE__*/React__default["default"].createElement(BaseOptionList, {
13052
13062
  keyExtractor: keyExtractor,
13053
13063
  loading: loading,
13054
13064
  onEndReached: onEndReached,
@@ -13103,6 +13113,9 @@ function MultiSelect(_ref) {
13103
13113
  }).map(function (opt) {
13104
13114
  return opt.text;
13105
13115
  }).join(', ');
13116
+ useDeprecation("Select's onDimiss is deprecated and will be removed in the next major release. Please use onDismiss instead.", onDimiss !== undefined);
13117
+ useDeprecation("Select's numberOfLines is deprecated and will be removed in the next major release. Please use inputProps.numberOfLines instead.", numberOfLines !== undefined);
13118
+ useDeprecation("Select's inputProps.required is deprecated and will be removed in the next major release. Please use Select's required prop instead.", (inputProps === null || inputProps === void 0 ? void 0 : inputProps.required) !== undefined);
13106
13119
  React.useEffect(function () {
13107
13120
  setSelectingValue(value);
13108
13121
  }, [open]);
@@ -13187,19 +13200,25 @@ var Option$1 = function Option(_ref) {
13187
13200
  _ref$disabled = _ref.disabled,
13188
13201
  disabled = _ref$disabled === void 0 ? false : _ref$disabled,
13189
13202
  selected = _ref.selected,
13190
- onPress = _ref.onPress;
13191
- var theme = useTheme();
13192
- return /*#__PURE__*/React__default["default"].createElement(List.BasicItem, {
13203
+ onPress = _ref.onPress,
13204
+ _ref$highlighted = _ref.highlighted,
13205
+ highlighted = _ref$highlighted === void 0 ? false : _ref$highlighted;
13206
+ var props = {
13193
13207
  selected: selected,
13194
13208
  disabled: disabled,
13195
13209
  onPress: onPress,
13196
- title: text,
13197
- style: {
13198
- marginHorizontal: theme.__hd__.select.space.optionHorizontalMargin
13199
- }
13200
- });
13210
+ title: text
13211
+ };
13212
+ return highlighted === true ? /*#__PURE__*/React__default["default"].createElement(List.Item, props) : /*#__PURE__*/React__default["default"].createElement(List.BasicItem, props);
13201
13213
  };
13202
13214
 
13215
+ var StyledOptionList = index$a(BaseOptionList)(function (_ref) {
13216
+ var theme = _ref.theme;
13217
+ return {
13218
+ paddingBottom: theme.__hd__.select.space.singleSelectContentPaddingBottom
13219
+ };
13220
+ });
13221
+
13203
13222
  var OptionList = function OptionList(_ref) {
13204
13223
  var keyExtractor = _ref.keyExtractor,
13205
13224
  loading = _ref.loading,
@@ -13227,7 +13246,8 @@ var OptionList = function OptionList(_ref) {
13227
13246
  selected: selected,
13228
13247
  text: item.text,
13229
13248
  disabled: item.disabled,
13230
- onPress: onItemPress
13249
+ onPress: onItemPress,
13250
+ highlighted: item.highlighted
13231
13251
  });
13232
13252
  };
13233
13253
  return /*#__PURE__*/React__default["default"].createElement(StyledOptionList, {
@@ -13279,6 +13299,9 @@ var SingleSelect = function SingleSelect(_ref) {
13279
13299
  var displayedValue = (_flatOptions$find = flatOptions.find(function (opt) {
13280
13300
  return value === opt.value;
13281
13301
  })) === null || _flatOptions$find === void 0 ? void 0 : _flatOptions$find.text;
13302
+ useDeprecation("Select's onDimiss is deprecated and will be removed in the next major release. Please use onDismiss instead.", onDimiss !== undefined);
13303
+ useDeprecation("Select's numberOfLines is deprecated and will be removed in the next major release. Please use inputProps.numberOfLines instead.", numberOfLines !== undefined);
13304
+ useDeprecation("Select's inputProps.required is deprecated and will be removed in the next major release. Please use Select's required prop instead.", (inputProps === null || inputProps === void 0 ? void 0 : inputProps.required) !== undefined);
13282
13305
  return /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, /*#__PURE__*/React__default["default"].createElement(reactNative.View, {
13283
13306
  pointerEvents: !editable || disabled || inputProps !== null && inputProps !== void 0 && inputProps.loading ? 'none' : 'auto'
13284
13307
  }, /*#__PURE__*/React__default["default"].createElement(reactNative.TouchableOpacity, {
@@ -13694,7 +13717,9 @@ var getTabItem$1 = function getTabItem(_ref) {
13694
13717
  icon: item,
13695
13718
  testID: "hero-icon-".concat(item),
13696
13719
  size: "small",
13697
- intent: active ? 'info' : 'text'
13720
+ style: {
13721
+ color: color
13722
+ }
13698
13723
  });
13699
13724
  }
13700
13725
  if (typeof item === 'string') {
@@ -14043,7 +14068,7 @@ var Tag = function Tag(_ref) {
14043
14068
  style = _ref.style,
14044
14069
  testID = _ref.testID,
14045
14070
  nativeProps = _objectWithoutProperties(_ref, _excluded);
14046
- useDeprecation("Tag's default intent is deprecated and will be removed in the next major release.\nPlease use other intents instead.", intent !== 'default');
14071
+ useDeprecation("Tag's default intent is deprecated and will be removed in the next major release.\nPlease use primary intent instead.", intent === 'default');
14047
14072
  return /*#__PURE__*/React__default["default"].createElement(StyledView, _extends$1({}, nativeProps, {
14048
14073
  themeIntent: intent,
14049
14074
  themeVariant: variant,
@@ -14167,18 +14192,16 @@ var TimePickerIOS = function TimePickerIOS(_ref) {
14167
14192
  return setOpen(false);
14168
14193
  },
14169
14194
  header: label,
14170
- footer: /*#__PURE__*/React__default["default"].createElement(reactNative.TouchableOpacity, {
14195
+ footer: /*#__PURE__*/React__default["default"].createElement(CompoundButton, {
14196
+ variant: "text",
14197
+ text: confirmLabel,
14171
14198
  onPress: function onPress() {
14172
14199
  if (selectingDate) {
14173
14200
  onChange(selectingDate);
14174
14201
  }
14175
14202
  setOpen(false);
14176
14203
  }
14177
- }, /*#__PURE__*/React__default["default"].createElement(Typography.Text, {
14178
- fontSize: "large",
14179
- fontWeight: "semi-bold",
14180
- intent: "primary"
14181
- }, confirmLabel))
14204
+ })
14182
14205
  }, /*#__PURE__*/React__default["default"].createElement(StyledPickerWrapper, null, /*#__PURE__*/React__default["default"].createElement(DateTimePicker__default["default"], {
14183
14206
  testID: "timePickerIOS",
14184
14207
  value: selectingDate,
@@ -14399,7 +14422,7 @@ var ToastContainer = /*#__PURE__*/React__default["default"].forwardRef(function
14399
14422
  var _ref2$displayType = _ref2.displayType,
14400
14423
  displayType = _ref2$displayType === void 0 ? 'single' : _ref2$displayType,
14401
14424
  _ref2$position = _ref2.position,
14402
- position = _ref2$position === void 0 ? 'top' : _ref2$position,
14425
+ position = _ref2$position === void 0 ? 'bottom' : _ref2$position,
14403
14426
  style = _ref2.style;
14404
14427
  var theme = useTheme$1();
14405
14428
  var _useState = React.useState([]),
@@ -14462,8 +14485,9 @@ var ToastProvider = function ToastProvider(_ref) {
14462
14485
  var children = _ref.children,
14463
14486
  _ref$displayType = _ref.displayType,
14464
14487
  displayType = _ref$displayType === void 0 ? 'single' : _ref$displayType,
14465
- _ref$position = _ref.position,
14466
- position = _ref$position === void 0 ? 'top' : _ref$position;
14488
+ _position = _ref.position;
14489
+ var position = _position === undefined ? 'bottom' : _position;
14490
+ useDeprecation("Toast's position prop is deprecated and will be removed in the next major release.\nPlease remove it.", _position !== undefined);
14467
14491
  var toastRef = React.useRef(null);
14468
14492
  // @ts-expect-error: TODO: @tungv Fix this type error
14469
14493
  var _useState = React.useState(null),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hero-design/rn",
3
- "version": "7.28.0",
3
+ "version": "7.29.0",
4
4
  "license": "MIT",
5
5
  "main": "lib/index.js",
6
6
  "module": "es/index.js",
@@ -20,7 +20,7 @@
20
20
  "dependencies": {
21
21
  "@emotion/native": "^11.9.3",
22
22
  "@emotion/react": "^11.9.3",
23
- "@hero-design/colors": "7.28.0",
23
+ "@hero-design/colors": "7.29.0",
24
24
  "date-fns": "^2.16.1",
25
25
  "events": "^3.2.0",
26
26
  "hero-editor": "^1.9.12"
@@ -43,6 +43,7 @@
43
43
  "@babel/preset-typescript": "^7.17.12",
44
44
  "@babel/runtime": "^7.18.9",
45
45
  "@emotion/jest": "^11.9.3",
46
+ "@hero-design/eslint-plugin": "7.29.0",
46
47
  "@react-native-community/datetimepicker": "^3.5.2",
47
48
  "@react-native-community/slider": "4.1.12",
48
49
  "@rollup/plugin-babel": "^5.3.1",
@@ -58,7 +59,7 @@
58
59
  "@types/react-native": "^0.67.7",
59
60
  "@types/react-native-vector-icons": "^6.4.10",
60
61
  "babel-plugin-inline-import": "^3.0.0",
61
- "eslint-config-hd": "7.28.0",
62
+ "eslint-config-hd": "7.29.0",
62
63
  "jest": "^27.3.1",
63
64
  "react": "17.0.2",
64
65
  "react-native": "0.65.1",
@@ -72,7 +73,7 @@
72
73
  "rollup-plugin-copy": "^3.4.0",
73
74
  "rollup-plugin-flow": "^1.1.1",
74
75
  "ts-jest": "^27.0.7",
75
- "prettier-config-hd": "7.28.0",
76
+ "prettier-config-hd": "7.29.0",
76
77
  "rn-7-23-0": "npm:@hero-design/rn@7.23.0"
77
78
  },
78
79
  "prettier": "prettier-config-hd"
@@ -62,6 +62,7 @@ interface AlertProps {
62
62
  */
63
63
  onClose?: () => void;
64
64
  /**
65
+ * @deprecated
65
66
  * Use rounded variant.
66
67
  */
67
68
  variant?: 'default' | 'round';
@@ -40,7 +40,7 @@ const Header = ({
40
40
  onPress={onRequestClose}
41
41
  intent="text"
42
42
  testID="bottom-sheet-close-icon"
43
- size="small"
43
+ size="xsmall"
44
44
  />
45
45
  </StyledIconWrapper>
46
46
  ) : null}
@@ -46,7 +46,7 @@ const StyledBackdrop = styled(AnimatedPressable)<
46
46
  >(({ theme }) => ({
47
47
  ...StyleSheet.absoluteFillObject,
48
48
  backgroundColor: theme.__hd__.bottomSheet.colors.backdrop,
49
- opacity: 0.48,
49
+ opacity: 0.4,
50
50
  }));
51
51
 
52
52
  const StyledHeaderWrapper = styled(View)(({ theme }) => ({
@@ -64,7 +64,6 @@ const StyledHeader = styled(View)<ViewProps>({
64
64
  const StyledFooter = styled(View)<ViewProps>(({ theme }) => ({
65
65
  paddingHorizontal: theme.__hd__.bottomSheet.space.footerHorizontalPadding,
66
66
  paddingVertical: theme.__hd__.bottomSheet.space.footerVerticalPadding,
67
- minHeight: theme.__hd__.bottomSheet.sizes.sectionHeight,
68
67
  alignItems: 'center',
69
68
  justifyContent: 'flex-end',
70
69
  flexDirection: 'row',
@@ -56,7 +56,7 @@ exports[`BottomSheet renders correctly with close state 1`] = `
56
56
  onStartShouldSetResponder={[Function]}
57
57
  style={
58
58
  Object {
59
- "backgroundColor": "#001f23",
59
+ "backgroundColor": "#000000",
60
60
  "bottom": 0,
61
61
  "left": 0,
62
62
  "opacity": 0.48,
@@ -82,8 +82,8 @@ exports[`BottomSheet renders correctly with close state 1`] = `
82
82
  "height": 3,
83
83
  "width": 0,
84
84
  },
85
- "shadowOpacity": 0.27,
86
- "shadowRadius": 4.65,
85
+ "shadowOpacity": 0.4,
86
+ "shadowRadius": 16,
87
87
  "transform": Array [
88
88
  Object {
89
89
  "scaleY": 1,
@@ -179,13 +179,13 @@ exports[`BottomSheet renders correctly with close state 1`] = `
179
179
  Array [
180
180
  Object {
181
181
  "color": "#001f23",
182
- "fontSize": 20,
182
+ "fontSize": 16,
183
183
  },
184
184
  undefined,
185
185
  ]
186
186
  }
187
187
  themeIntent="text"
188
- themeSize="small"
188
+ themeSize="xsmall"
189
189
  />
190
190
  </View>
191
191
  </View>
@@ -225,9 +225,8 @@ exports[`BottomSheet renders correctly with close state 1`] = `
225
225
  "alignItems": "center",
226
226
  "flexDirection": "row",
227
227
  "justifyContent": "flex-end",
228
- "minHeight": 64,
229
228
  "paddingHorizontal": 12,
230
- "paddingVertical": 8,
229
+ "paddingVertical": 2,
231
230
  },
232
231
  undefined,
233
232
  ]
@@ -339,7 +338,7 @@ exports[`BottomSheet renders correctly with open state 1`] = `
339
338
  onStartShouldSetResponder={[Function]}
340
339
  style={
341
340
  Object {
342
- "backgroundColor": "#001f23",
341
+ "backgroundColor": "#000000",
343
342
  "bottom": 0,
344
343
  "left": 0,
345
344
  "opacity": 0,
@@ -365,8 +364,8 @@ exports[`BottomSheet renders correctly with open state 1`] = `
365
364
  "height": 3,
366
365
  "width": 0,
367
366
  },
368
- "shadowOpacity": 0.27,
369
- "shadowRadius": 4.65,
367
+ "shadowOpacity": 0.4,
368
+ "shadowRadius": 16,
370
369
  "transform": Array [
371
370
  Object {
372
371
  "scaleY": 1,
@@ -462,13 +461,13 @@ exports[`BottomSheet renders correctly with open state 1`] = `
462
461
  Array [
463
462
  Object {
464
463
  "color": "#001f23",
465
- "fontSize": 20,
464
+ "fontSize": 16,
466
465
  },
467
466
  undefined,
468
467
  ]
469
468
  }
470
469
  themeIntent="text"
471
- themeSize="small"
470
+ themeSize="xsmall"
472
471
  />
473
472
  </View>
474
473
  </View>
@@ -508,9 +507,8 @@ exports[`BottomSheet renders correctly with open state 1`] = `
508
507
  "alignItems": "center",
509
508
  "flexDirection": "row",
510
509
  "justifyContent": "flex-end",
511
- "minHeight": 64,
512
510
  "paddingHorizontal": 12,
513
- "paddingVertical": 8,
511
+ "paddingVertical": 2,
514
512
  },
515
513
  undefined,
516
514
  ]