@hero-design/rn 8.113.0 → 8.113.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 (81) hide show
  1. package/.turbo/turbo-build.log +3 -3
  2. package/CHANGELOG.md +11 -0
  3. package/es/index.js +116 -133
  4. package/lib/index.js +115 -132
  5. package/package.json +4 -4
  6. package/src/components/Alert/index.tsx +1 -1
  7. package/src/components/Badge/Count.tsx +2 -2
  8. package/src/components/Badge/Status.tsx +2 -2
  9. package/src/components/Badge/index.tsx +2 -1
  10. package/src/components/BottomNavigation/StyledBottomNavigation.tsx +1 -1
  11. package/src/components/BottomNavigation/__tests__/__snapshots__/index.spec.tsx.snap +32 -36
  12. package/src/components/BottomNavigation/__tests__/index.spec.tsx +17 -8
  13. package/src/components/BottomNavigation/index.tsx +4 -5
  14. package/src/components/BottomSheet/ScrollView.tsx +2 -1
  15. package/src/components/BottomSheet/index.tsx +1 -1
  16. package/src/components/Button/Button.tsx +2 -2
  17. package/src/components/Calendar/__tests__/index.spec.tsx +3 -8
  18. package/src/components/Card/DataCard/index.tsx +2 -2
  19. package/src/components/Card/index.tsx +2 -2
  20. package/src/components/Carousel/index.tsx +2 -2
  21. package/src/components/DatePicker/Dialog/__tests__/IOSDialog.spec.tsx +0 -6
  22. package/src/components/DatePicker/__tests__/DatePickerCalendar.spec.tsx +2 -10
  23. package/src/components/DatePicker/__tests__/DatePickerIOS.spec.tsx +27 -0
  24. package/src/components/DatePicker/__tests__/__snapshots__/DatePickerIOS.spec.tsx.snap +176 -728
  25. package/src/components/Drawer/DragableDrawer/index.tsx +2 -2
  26. package/src/components/Drawer/index.tsx +2 -2
  27. package/src/components/FAB/__tests__/index.spec.tsx +33 -8
  28. package/src/components/Image/index.tsx +2 -1
  29. package/src/components/List/BasicListItem.tsx +2 -1
  30. package/src/components/List/ListItem.tsx +1 -1
  31. package/src/components/MapPin/Focussed.tsx +2 -1
  32. package/src/components/MapPin/index.tsx +2 -1
  33. package/src/components/Modal/__tests__/index.spec.tsx +46 -0
  34. package/src/components/Modal/index.tsx +121 -149
  35. package/src/components/Progress/ProgressBar.tsx +2 -1
  36. package/src/components/Progress/ProgressCircle.tsx +2 -1
  37. package/src/components/RichTextEditor/MentionList.tsx +2 -1
  38. package/src/components/Tabs/ScrollableTabsHeader/ScrollableTabsHeader.tsx +4 -6
  39. package/src/components/Tabs/__tests__/ScrollableTabs.spec.tsx +43 -32
  40. package/src/components/Tabs/__tests__/__snapshots__/ScrollableTabs.spec.tsx.snap +105 -129
  41. package/src/components/Tabs/__tests__/__snapshots__/ScrollableTabsHeader.spec.tsx.snap +30 -42
  42. package/src/components/Tabs/__tests__/__snapshots__/index.spec.tsx.snap +0 -683
  43. package/src/components/Tabs/__tests__/index.spec.tsx +37 -25
  44. package/src/components/Tabs/index.tsx +2 -2
  45. package/src/components/Tag/index.tsx +1 -1
  46. package/src/components/TimePicker/__tests__/TimePickerIOS.spec.tsx +0 -6
  47. package/src/components/TimePicker/__tests__/__snapshots__/TimePickerIOS.spec.tsx.snap +237 -282
  48. package/src/components/Toast/Toast.tsx +2 -1
  49. package/src/components/Toolbar/ToolbarItem.tsx +2 -1
  50. package/src/components/Typography/Label/index.tsx +1 -1
  51. package/src/testHelpers/renderWithTheme.tsx +2 -1
  52. package/src/theme/__tests__/__snapshots__/index.spec.ts.snap +1 -1
  53. package/src/theme/components/bottomNavigation.ts +1 -1
  54. package/types/components/Alert/index.d.ts +1 -1
  55. package/types/components/Badge/Count.d.ts +2 -2
  56. package/types/components/Badge/Status.d.ts +2 -2
  57. package/types/components/Badge/index.d.ts +4 -3
  58. package/types/components/BottomNavigation/StyledBottomNavigation.d.ts +1 -1
  59. package/types/components/BottomNavigation/index.d.ts +2 -2
  60. package/types/components/BottomSheet/index.d.ts +1 -1
  61. package/types/components/Button/Button.d.ts +2 -2
  62. package/types/components/Card/DataCard/index.d.ts +2 -2
  63. package/types/components/Card/index.d.ts +3 -3
  64. package/types/components/Carousel/index.d.ts +2 -2
  65. package/types/components/Drawer/DragableDrawer/index.d.ts +2 -2
  66. package/types/components/Drawer/index.d.ts +3 -3
  67. package/types/components/Image/index.d.ts +2 -1
  68. package/types/components/List/BasicListItem.d.ts +2 -1
  69. package/types/components/List/ListItem.d.ts +1 -1
  70. package/types/components/MapPin/Focussed.d.ts +2 -1
  71. package/types/components/MapPin/index.d.ts +3 -2
  72. package/types/components/Modal/index.d.ts +2 -2
  73. package/types/components/Progress/ProgressBar.d.ts +2 -1
  74. package/types/components/Progress/ProgressCircle.d.ts +2 -1
  75. package/types/components/Progress/index.d.ts +2 -2
  76. package/types/components/RichTextEditor/MentionList.d.ts +2 -1
  77. package/types/components/Tabs/index.d.ts +2 -2
  78. package/types/components/Tag/index.d.ts +1 -1
  79. package/types/components/Toast/Toast.d.ts +2 -1
  80. package/types/components/Typography/Label/index.d.ts +1 -1
  81. package/types/testHelpers/renderWithTheme.d.ts +84 -1
package/lib/index.js CHANGED
@@ -5721,7 +5721,7 @@ var getBottomNavigationTheme = function getBottomNavigationTheme(theme) {
5721
5721
  wrapper: theme.shadows.medium
5722
5722
  };
5723
5723
  var space = {
5724
- titleMarginTop: theme.space.xsmall
5724
+ titleMarginTop: theme.space.xxsmall
5725
5725
  };
5726
5726
  return {
5727
5727
  colors: colors,
@@ -8062,7 +8062,7 @@ var StyledText$4 = index$c(reactNative.Text)(function (_ref) {
8062
8062
  });
8063
8063
  });
8064
8064
 
8065
- var _excluded$O = ["children", "fontSize", "fontWeight", "intent", "typeface", "allowFontScaling"];
8065
+ var _excluded$N = ["children", "fontSize", "fontWeight", "intent", "typeface", "allowFontScaling"];
8066
8066
  /**
8067
8067
  * @deprecated Typography.Text is deprecated and will be removed in the next major release, please refer to https://design.employmenthero.com/mobile/Components/typography for the appropriate alternatives.
8068
8068
  */
@@ -8078,7 +8078,7 @@ var Text = function Text(_ref) {
8078
8078
  typeface = _ref$typeface === void 0 ? 'neutral' : _ref$typeface,
8079
8079
  _ref$allowFontScaling = _ref.allowFontScaling,
8080
8080
  allowFontScaling = _ref$allowFontScaling === void 0 ? false : _ref$allowFontScaling,
8081
- nativeProps = _objectWithoutProperties(_ref, _excluded$O);
8081
+ nativeProps = _objectWithoutProperties(_ref, _excluded$N);
8082
8082
  useDeprecation('Typography.Text is deprecated and will be removed in the next major release, please refer to https://design.employmenthero.com/mobile/Components/typography for the appropriate alternatives.');
8083
8083
  return /*#__PURE__*/React__namespace.default.createElement(StyledText$4, _extends$1({}, nativeProps, {
8084
8084
  themeFontSize: fontSize,
@@ -8111,7 +8111,7 @@ var StyledCaption = index$c(reactNative.Text)(function (_ref) {
8111
8111
  };
8112
8112
  });
8113
8113
 
8114
- var _excluded$N = ["children", "fontWeight", "intent", "allowFontScaling", "fontStyle"];
8114
+ var _excluded$M = ["children", "fontWeight", "intent", "allowFontScaling", "fontStyle"];
8115
8115
  var Caption = function Caption(_ref) {
8116
8116
  var children = _ref.children,
8117
8117
  _ref$fontWeight = _ref.fontWeight,
@@ -8122,7 +8122,7 @@ var Caption = function Caption(_ref) {
8122
8122
  allowFontScaling = _ref$allowFontScaling === void 0 ? false : _ref$allowFontScaling,
8123
8123
  _ref$fontStyle = _ref.fontStyle,
8124
8124
  fontStyle = _ref$fontStyle === void 0 ? 'normal' : _ref$fontStyle,
8125
- nativeProps = _objectWithoutProperties(_ref, _excluded$N);
8125
+ nativeProps = _objectWithoutProperties(_ref, _excluded$M);
8126
8126
  return /*#__PURE__*/React__namespace.default.createElement(StyledCaption, _extends$1({}, nativeProps, {
8127
8127
  themeFontWeight: fontWeight,
8128
8128
  themeIntent: intent,
@@ -8147,7 +8147,7 @@ var StyledLabel$1 = index$c(reactNative.Text)(function (_ref) {
8147
8147
  };
8148
8148
  });
8149
8149
 
8150
- var _excluded$M = ["children", "intent", "allowFontScaling", "fontStyle"];
8150
+ var _excluded$L = ["children", "intent", "allowFontScaling", "fontStyle"];
8151
8151
  var Label = function Label(_ref) {
8152
8152
  var children = _ref.children,
8153
8153
  _ref$intent = _ref.intent,
@@ -8156,7 +8156,7 @@ var Label = function Label(_ref) {
8156
8156
  allowFontScaling = _ref$allowFontScaling === void 0 ? false : _ref$allowFontScaling,
8157
8157
  _ref$fontStyle = _ref.fontStyle,
8158
8158
  fontStyle = _ref$fontStyle === void 0 ? 'normal' : _ref$fontStyle,
8159
- nativeProps = _objectWithoutProperties(_ref, _excluded$M);
8159
+ nativeProps = _objectWithoutProperties(_ref, _excluded$L);
8160
8160
  return /*#__PURE__*/React__namespace.default.createElement(StyledLabel$1, _extends$1({}, nativeProps, {
8161
8161
  themeIntent: intent,
8162
8162
  themeIsItalic: fontStyle === 'italic',
@@ -8179,7 +8179,7 @@ var StyledTitle$1 = index$c(reactNative.Text)(function (_ref) {
8179
8179
  };
8180
8180
  });
8181
8181
 
8182
- var _excluded$L = ["children", "intent", "allowFontScaling", "level", "typeface", "fontStyle"];
8182
+ var _excluded$K = ["children", "intent", "allowFontScaling", "level", "typeface", "fontStyle"];
8183
8183
  var Title = function Title(_ref) {
8184
8184
  var children = _ref.children,
8185
8185
  _ref$intent = _ref.intent,
@@ -8192,7 +8192,7 @@ var Title = function Title(_ref) {
8192
8192
  typeface = _ref$typeface === void 0 ? 'neutral' : _ref$typeface,
8193
8193
  _ref$fontStyle = _ref.fontStyle,
8194
8194
  fontStyle = _ref$fontStyle === void 0 ? 'normal' : _ref$fontStyle,
8195
- nativeProps = _objectWithoutProperties(_ref, _excluded$L);
8195
+ nativeProps = _objectWithoutProperties(_ref, _excluded$K);
8196
8196
  return /*#__PURE__*/React__namespace.default.createElement(StyledTitle$1, _extends$1({}, nativeProps, {
8197
8197
  themeLevel: level,
8198
8198
  themeTypeface: typeface,
@@ -8231,7 +8231,7 @@ var StyledBody$2 = index$c(reactNative.Text)(function (_ref) {
8231
8231
  };
8232
8232
  });
8233
8233
 
8234
- var _excluded$K = ["children", "intent", "allowFontScaling", "typeface", "variant", "fontStyle"];
8234
+ var _excluded$J = ["children", "intent", "allowFontScaling", "typeface", "variant", "fontStyle"];
8235
8235
  var Body = function Body(_ref) {
8236
8236
  var children = _ref.children,
8237
8237
  _ref$intent = _ref.intent,
@@ -8244,7 +8244,7 @@ var Body = function Body(_ref) {
8244
8244
  variant = _ref$variant === void 0 ? 'regular' : _ref$variant,
8245
8245
  _ref$fontStyle = _ref.fontStyle,
8246
8246
  fontStyle = _ref$fontStyle === void 0 ? 'normal' : _ref$fontStyle,
8247
- nativeProps = _objectWithoutProperties(_ref, _excluded$K);
8247
+ nativeProps = _objectWithoutProperties(_ref, _excluded$J);
8248
8248
  return /*#__PURE__*/React__namespace.default.createElement(StyledBody$2, _extends$1({}, nativeProps, {
8249
8249
  themeTypeface: typeface,
8250
8250
  themeIntent: intent,
@@ -8858,10 +8858,10 @@ var StyledHeroIcon = index$c(HeroIcon)(function (_ref) {
8858
8858
  };
8859
8859
  });
8860
8860
 
8861
- var _excluded$J = ["style"];
8861
+ var _excluded$I = ["style"];
8862
8862
  var AnimatedIcon = function AnimatedIcon(_ref) {
8863
8863
  var style = _ref.style,
8864
- otherProps = _objectWithoutProperties(_ref, _excluded$J);
8864
+ otherProps = _objectWithoutProperties(_ref, _excluded$I);
8865
8865
  var rotateAnimation = React.useRef(new reactNative.Animated.Value(0));
8866
8866
  React.useEffect(function () {
8867
8867
  var animation = reactNative.Animated.loop(reactNative.Animated.timing(rotateAnimation.current, {
@@ -8966,7 +8966,7 @@ var AccordionItem = function AccordionItem(_ref) {
8966
8966
  }, content));
8967
8967
  };
8968
8968
 
8969
- var _excluded$I = ["key"];
8969
+ var _excluded$H = ["key"];
8970
8970
  var Accordion = function Accordion(_ref) {
8971
8971
  var items = _ref.items,
8972
8972
  activeItemKey = _ref.activeItemKey,
@@ -8989,7 +8989,7 @@ var Accordion = function Accordion(_ref) {
8989
8989
  accessible: accessible
8990
8990
  }, items.map(function (_ref2, index) {
8991
8991
  var key = _ref2.key,
8992
- props = _objectWithoutProperties(_ref2, _excluded$I);
8992
+ props = _objectWithoutProperties(_ref2, _excluded$H);
8993
8993
  var open = _activeItemKey === key;
8994
8994
  return /*#__PURE__*/React__namespace.default.createElement(React__namespace.default.Fragment, {
8995
8995
  key: key
@@ -9825,7 +9825,7 @@ var borderWidths = {
9825
9825
  var config = _objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2({}, colors), space), radii), borderWidths);
9826
9826
  var flexPropsKey = ['alignContent', 'alignItems', 'alignSelf', 'display', 'flex', 'flexBasis', 'flexDirection', 'flexGrow', 'flexShrink', 'flexWrap', 'justifyContent'];
9827
9827
 
9828
- var _excluded$H = ["theme"];
9828
+ var _excluded$G = ["theme"];
9829
9829
  var getThemeValue = function getThemeValue(theme, key, props) {
9830
9830
  var propConfig = config[key];
9831
9831
  var propValue = props[key];
@@ -9852,18 +9852,18 @@ var mapStylePropToThemeValue = function mapStylePropToThemeValue(theme, props) {
9852
9852
  var configKeys = Object.keys(config);
9853
9853
  var StyledBox = index$c(reactNative.View)(function (_ref5) {
9854
9854
  var theme = _ref5.theme,
9855
- otherProps = _objectWithoutProperties(_ref5, _excluded$H);
9855
+ otherProps = _objectWithoutProperties(_ref5, _excluded$G);
9856
9856
  var styleProps = pick(configKeys, otherProps);
9857
9857
  var flexProps = pick(_toConsumableArray(flexPropsKey), otherProps);
9858
9858
  return _objectSpread2(_objectSpread2({}, mapStylePropToThemeValue(theme, styleProps)), flexProps);
9859
9859
  });
9860
9860
 
9861
- var _excluded$G = ["children", "style", "testID"];
9861
+ var _excluded$F = ["children", "style", "testID"];
9862
9862
  var Box = function Box(_ref) {
9863
9863
  var children = _ref.children,
9864
9864
  style = _ref.style,
9865
9865
  testID = _ref.testID,
9866
- otherProps = _objectWithoutProperties(_ref, _excluded$G);
9866
+ otherProps = _objectWithoutProperties(_ref, _excluded$F);
9867
9867
  return /*#__PURE__*/React__namespace.default.createElement(StyledBox, _extends$1({}, otherProps, {
9868
9868
  style: style,
9869
9869
  testID: testID
@@ -10130,7 +10130,7 @@ var StyledIcon$4 = index$c(Icon)(function (_ref6) {
10130
10130
  };
10131
10131
  });
10132
10132
 
10133
- var _excluded$F = ["children", "visible", "intent", "style", "testID"];
10133
+ var _excluded$E = ["children", "visible", "intent", "style", "testID"];
10134
10134
  var Status$1 = function Status(_ref) {
10135
10135
  var children = _ref.children,
10136
10136
  _ref$visible = _ref.visible,
@@ -10139,7 +10139,7 @@ var Status$1 = function Status(_ref) {
10139
10139
  intent = _ref$intent === void 0 ? 'danger' : _ref$intent,
10140
10140
  style = _ref.style,
10141
10141
  testID = _ref.testID,
10142
- nativeProps = _objectWithoutProperties(_ref, _excluded$F);
10142
+ nativeProps = _objectWithoutProperties(_ref, _excluded$E);
10143
10143
  var _React$useRef = React__namespace.default.useRef(new reactNative.Animated.Value(visible ? 1 : 0)),
10144
10144
  opacity = _React$useRef.current;
10145
10145
  var isFirstRendering = React__namespace.default.useRef(true);
@@ -10175,7 +10175,7 @@ var Status$1 = function Status(_ref) {
10175
10175
 
10176
10176
  var DEFAULT_MAX_NUMBER = 99;
10177
10177
 
10178
- var _excluded$E = ["children", "visible", "style", "max", "testID", "content"];
10178
+ var _excluded$D = ["children", "visible", "style", "max", "testID", "content"];
10179
10179
  var Status = function Status(_ref) {
10180
10180
  var children = _ref.children,
10181
10181
  _ref$visible = _ref.visible,
@@ -10185,7 +10185,7 @@ var Status = function Status(_ref) {
10185
10185
  max = _ref$max === void 0 ? DEFAULT_MAX_NUMBER : _ref$max,
10186
10186
  testID = _ref.testID,
10187
10187
  originalContent = _ref.content,
10188
- nativeProps = _objectWithoutProperties(_ref, _excluded$E);
10188
+ nativeProps = _objectWithoutProperties(_ref, _excluded$D);
10189
10189
  var content = React.useMemo(function () {
10190
10190
  return originalContent > max ? "".concat(max, "+") : String(originalContent);
10191
10191
  }, [originalContent, max]);
@@ -10197,7 +10197,7 @@ var Status = function Status(_ref) {
10197
10197
  }, /*#__PURE__*/React__namespace.default.createElement(StyledCountText, null, content)));
10198
10198
  };
10199
10199
 
10200
- var _excluded$D = ["content", "visible", "max", "intent", "style", "testID", "size", "variant", "icon"];
10200
+ var _excluded$C = ["content", "visible", "max", "intent", "style", "testID", "size", "variant", "icon"];
10201
10201
  var getPaddingState = function getPaddingState(content) {
10202
10202
  return content.length > 1 ? 'wideContent' : 'narrowContent';
10203
10203
  };
@@ -10216,7 +10216,7 @@ var Badge = function Badge(_ref) {
10216
10216
  _ref$variant = _ref.variant,
10217
10217
  variant = _ref$variant === void 0 ? 'filled' : _ref$variant,
10218
10218
  icon = _ref.icon,
10219
- nativeProps = _objectWithoutProperties(_ref, _excluded$D);
10219
+ nativeProps = _objectWithoutProperties(_ref, _excluded$C);
10220
10220
  var _React$useRef = React__namespace.default.useRef(new reactNative.Animated.Value(visible ? 1 : 0)),
10221
10221
  opacity = _React$useRef.current;
10222
10222
  var isFirstRendering = React__namespace.default.useRef(true);
@@ -10308,14 +10308,14 @@ var BottomBarItem = index$c(reactNative.View)({
10308
10308
  flex: 1,
10309
10309
  alignItems: 'center'
10310
10310
  });
10311
- var StyledBottomBarText = index$c(Typography.Caption)(function (_ref3) {
10311
+ var StyledBottomBarText = index$c(Typography.Label)(function (_ref3) {
10312
10312
  var theme = _ref3.theme;
10313
10313
  return {
10314
10314
  marginTop: theme.__hd__.bottomNavigation.space.titleMarginTop
10315
10315
  };
10316
10316
  });
10317
10317
 
10318
- var _excluded$C = ["onTabPress", "renderActiveTabOnly", "selectedTabKey", "tabs"];
10318
+ var _excluded$B = ["onTabPress", "renderActiveTabOnly", "selectedTabKey", "tabs"];
10319
10319
  var getInactiveIcon = function getInactiveIcon(icon) {
10320
10320
  var inactiveIcon = "".concat(icon, "-outlined");
10321
10321
  return isHeroIcon(inactiveIcon) ? inactiveIcon : icon;
@@ -10326,7 +10326,7 @@ var BottomNavigation = function BottomNavigation(_ref) {
10326
10326
  renderActiveTabOnly = _ref$renderActiveTabO === void 0 ? false : _ref$renderActiveTabO,
10327
10327
  selectedTabKey = _ref.selectedTabKey,
10328
10328
  tabs = _ref.tabs,
10329
- nativeProps = _objectWithoutProperties(_ref, _excluded$C);
10329
+ nativeProps = _objectWithoutProperties(_ref, _excluded$B);
10330
10330
  var insets = reactNativeSafeAreaContext.useSafeAreaInsets();
10331
10331
  /**
10332
10332
  * List of loaded tabs, tabs will be loaded when navigated to.
@@ -10383,11 +10383,10 @@ var BottomNavigation = function BottomNavigation(_ref) {
10383
10383
  testID: testID
10384
10384
  }, /*#__PURE__*/React__namespace.default.createElement(BottomBarItem, null, /*#__PURE__*/React__namespace.default.createElement(Icon, {
10385
10385
  icon: active ? icon : inactiveIcon,
10386
- intent: active ? 'primary' : 'text',
10386
+ intent: active ? 'primary' : 'muted',
10387
10387
  testID: "hero-icon-".concat(icon)
10388
10388
  }), !!title && /*#__PURE__*/React__namespace.default.createElement(StyledBottomBarText, {
10389
- fontWeight: "semi-bold",
10390
- intent: active ? 'primary' : 'body',
10389
+ intent: active ? 'primary' : 'muted',
10391
10390
  numberOfLines: 1
10392
10391
  }, title)));
10393
10392
  }))));
@@ -10412,13 +10411,13 @@ var StyledDivider = index$c(reactNative.View)(function (_ref) {
10412
10411
  }, horizontalMargin), verticalMargin);
10413
10412
  });
10414
10413
 
10415
- var _excluded$B = ["marginHorizontal", "marginVertical", "style", "testID"];
10414
+ var _excluded$A = ["marginHorizontal", "marginVertical", "style", "testID"];
10416
10415
  var Divider = function Divider(_ref) {
10417
10416
  var marginHorizontal = _ref.marginHorizontal,
10418
10417
  marginVertical = _ref.marginVertical,
10419
10418
  style = _ref.style,
10420
10419
  testID = _ref.testID,
10421
- nativeProps = _objectWithoutProperties(_ref, _excluded$B);
10420
+ nativeProps = _objectWithoutProperties(_ref, _excluded$A);
10422
10421
  return /*#__PURE__*/React__namespace.default.createElement(StyledDivider, _extends$1({}, nativeProps, {
10423
10422
  themeMarginHorizontal: marginHorizontal,
10424
10423
  themeMarginVertical: marginVertical,
@@ -10548,7 +10547,7 @@ var StyledLoadingDot = index$c(reactNative.View)(function (_ref) {
10548
10547
  }, themeStyling());
10549
10548
  });
10550
10549
 
10551
- var _excluded$A = ["count", "size", "testID", "themeVariant"];
10550
+ var _excluded$z = ["count", "size", "testID", "themeVariant"];
10552
10551
  var AnimatedLoadingIndicatorWrapper = reactNative.Animated.createAnimatedComponent(StyledLoadingIndicatorWrapper);
10553
10552
  var AnimatedLoadingDot = reactNative.Animated.createAnimatedComponent(StyledLoadingDot);
10554
10553
  var renderDotComponent = function renderDotComponent(_ref) {
@@ -10580,7 +10579,7 @@ var LoadingIndicator = function LoadingIndicator(_ref2) {
10580
10579
  size = _ref2$size === void 0 ? 12 : _ref2$size,
10581
10580
  testID = _ref2.testID,
10582
10581
  themeVariant = _ref2.themeVariant,
10583
- nativeProps = _objectWithoutProperties(_ref2, _excluded$A);
10582
+ nativeProps = _objectWithoutProperties(_ref2, _excluded$z);
10584
10583
  var progressAnimation = React.useRef(new reactNative.Animated.Value(0));
10585
10584
  React.useEffect(function () {
10586
10585
  var animation = reactNative.Animated.loop(reactNative.Animated.timing(progressAnimation.current, {
@@ -11212,11 +11211,11 @@ var Header = function Header(_ref) {
11212
11211
  }))) : null), showDivider ? /*#__PURE__*/React__namespace.default.createElement(Divider, null) : null);
11213
11212
  };
11214
11213
 
11215
- var _excluded$z = ["scrollEventThrottle"];
11214
+ var _excluded$y = ["scrollEventThrottle"];
11216
11215
  var BottomSheetScrollView = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
11217
11216
  var _ref$scrollEventThrot = _ref.scrollEventThrottle,
11218
11217
  scrollEventThrottle = _ref$scrollEventThrot === void 0 ? 100 : _ref$scrollEventThrot,
11219
- props = _objectWithoutProperties(_ref, _excluded$z);
11218
+ props = _objectWithoutProperties(_ref, _excluded$y);
11220
11219
  var _useContext = React.useContext(BottomSheetContext),
11221
11220
  setInternalShowDivider = _useContext.setInternalShowDivider;
11222
11221
  var onScrollBeginDrag = React.useCallback(function (e) {
@@ -14344,12 +14343,12 @@ var Indicator = index$c(reactNative.View)(function (_ref3) {
14344
14343
  };
14345
14344
  });
14346
14345
 
14347
- var _excluded$y = ["intent", "children"];
14346
+ var _excluded$x = ["intent", "children"];
14348
14347
  var DataCard = function DataCard(_ref) {
14349
14348
  var _ref$intent = _ref.intent,
14350
14349
  intent = _ref$intent === void 0 ? 'info' : _ref$intent,
14351
14350
  children = _ref.children,
14352
- nativeProps = _objectWithoutProperties(_ref, _excluded$y);
14351
+ nativeProps = _objectWithoutProperties(_ref, _excluded$x);
14353
14352
  return /*#__PURE__*/React__namespace.default.createElement(StyledDataCard, nativeProps, /*#__PURE__*/React__namespace.default.createElement(Indicator, {
14354
14353
  themeIntent: intent,
14355
14354
  testID: "data-card-indicator"
@@ -14368,13 +14367,13 @@ var StyledCard$1 = index$c(reactNative.View)(function (_ref) {
14368
14367
  });
14369
14368
  });
14370
14369
 
14371
- var _excluded$x = ["intent", "children", "variant"];
14370
+ var _excluded$w = ["intent", "children", "variant"];
14372
14371
  var Card = function Card(_ref) {
14373
14372
  var intent = _ref.intent,
14374
14373
  children = _ref.children,
14375
14374
  _ref$variant = _ref.variant,
14376
14375
  variant = _ref$variant === void 0 ? 'basic' : _ref$variant,
14377
- nativeProps = _objectWithoutProperties(_ref, _excluded$x);
14376
+ nativeProps = _objectWithoutProperties(_ref, _excluded$w);
14378
14377
  return /*#__PURE__*/React__namespace.default.createElement(StyledCard$1, _extends$1({}, nativeProps, {
14379
14378
  themeIntent: intent,
14380
14379
  themeVariant: variant
@@ -14641,7 +14640,7 @@ var CardCarousel = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
14641
14640
  });
14642
14641
  CardCarousel.displayName = 'CardCarousel';
14643
14642
 
14644
- var _excluded$w = ["rounded", "size", "testID", "style"];
14643
+ var _excluded$v = ["rounded", "size", "testID", "style"];
14645
14644
  /**
14646
14645
  * @deprecated Image component will soon be deprecated. Please use `Image` from `react-native` instead.
14647
14646
  */
@@ -14652,7 +14651,7 @@ var Image = function Image(_ref) {
14652
14651
  size = _ref$size === void 0 ? '6xlarge' : _ref$size,
14653
14652
  testID = _ref.testID,
14654
14653
  style = _ref.style,
14655
- imageNativeProps = _objectWithoutProperties(_ref, _excluded$w);
14654
+ imageNativeProps = _objectWithoutProperties(_ref, _excluded$v);
14656
14655
  useDeprecation('Image component will soon be deprecated. Please use `Image` from `react-native` instead.');
14657
14656
  var theme = useTheme();
14658
14657
  var imageSize = theme.__hd__.image.sizes[size];
@@ -14787,7 +14786,7 @@ var CarouselItem = function CarouselItem(_ref) {
14787
14786
  }, heading), !!body && /*#__PURE__*/React__namespace.default.createElement(Typography.Body, null, body)));
14788
14787
  };
14789
14788
 
14790
- var _excluded$v = ["items", "onItemIndexChange", "renderActions", "selectedItemIndex", "style", "shouldShowPagination", "testID", "pageControlPosition"];
14789
+ var _excluded$u = ["items", "onItemIndexChange", "renderActions", "selectedItemIndex", "style", "shouldShowPagination", "testID", "pageControlPosition"];
14791
14790
  function useStateFromProp(initialValue) {
14792
14791
  var _useState = React.useState(initialValue),
14793
14792
  _useState2 = _slicedToArray(_useState, 2),
@@ -14814,7 +14813,7 @@ var Carousel = function Carousel(_ref) {
14814
14813
  testID = _ref.testID,
14815
14814
  _ref$pageControlPosit = _ref.pageControlPosition,
14816
14815
  pageControlPosition = _ref$pageControlPosit === void 0 ? 'top' : _ref$pageControlPosit,
14817
- nativeProps = _objectWithoutProperties(_ref, _excluded$v);
14816
+ nativeProps = _objectWithoutProperties(_ref, _excluded$u);
14818
14817
  useDeprecation("shouldShowPagination prop has been deprecated", shouldShowPagination !== noop$1);
14819
14818
  useDeprecation("The use of 'pageControlPosition == bottom' has been deprecated", pageControlPosition === 'bottom');
14820
14819
  var theme = useTheme();
@@ -20085,7 +20084,7 @@ var StyledChipIcon = index$c(Icon)(function (_ref2) {
20085
20084
  };
20086
20085
  });
20087
20086
 
20088
- var _excluded$u = ["label", "variant", "selected", "icon", "onPress", "showSelectedIcon", "accessible"];
20087
+ var _excluded$t = ["label", "variant", "selected", "icon", "onPress", "showSelectedIcon", "accessible"];
20089
20088
  var getChipLabel = function getChipLabel(label) {
20090
20089
  if (typeof label === 'string') {
20091
20090
  return /*#__PURE__*/React__namespace.default.createElement(Typography.Body, {
@@ -20119,7 +20118,7 @@ var Chip = function Chip(_ref) {
20119
20118
  _ref$showSelectedIcon = _ref.showSelectedIcon,
20120
20119
  showSelectedIcon = _ref$showSelectedIcon === void 0 ? true : _ref$showSelectedIcon,
20121
20120
  accessible = _ref.accessible,
20122
- otherProps = _objectWithoutProperties(_ref, _excluded$u);
20121
+ otherProps = _objectWithoutProperties(_ref, _excluded$t);
20123
20122
  useDeprecation('Chip variant `outlined` and `filled` are deprecated.', variant === 'outlined' || variant === 'filled');
20124
20123
  var renamedVariant = getChipVariant(variant);
20125
20124
  var shouldShowSelectedIcon = (renamedVariant === 'selection' || renamedVariant === 'compact-outlined') && selected && showSelectedIcon;
@@ -20472,7 +20471,7 @@ var StyledErrorAndMaxLengthContainer = index$c(reactNative.View)(function (_ref1
20472
20471
  };
20473
20472
  });
20474
20473
 
20475
- var _excluded$t = ["label", "prefix", "suffix", "style", "textStyle", "testID", "accessibilityLabelledBy", "error", "required", "editable", "disabled", "loading", "maxLength", "hideCharacterCount", "helpText", "value", "defaultValue", "renderInputValue", "allowFontScaling", "variant"];
20474
+ var _excluded$s = ["label", "prefix", "suffix", "style", "textStyle", "testID", "accessibilityLabelledBy", "error", "required", "editable", "disabled", "loading", "maxLength", "hideCharacterCount", "helpText", "value", "defaultValue", "renderInputValue", "allowFontScaling", "variant"];
20476
20475
  var getState$3 = function getState(_ref) {
20477
20476
  var disabled = _ref.disabled,
20478
20477
  error = _ref.error,
@@ -20591,7 +20590,7 @@ var TextInput = /*#__PURE__*/React.forwardRef(function (_ref8, ref) {
20591
20590
  allowFontScaling = _ref8$allowFontScalin === void 0 ? false : _ref8$allowFontScalin,
20592
20591
  _ref8$variant = _ref8.variant,
20593
20592
  variant = _ref8$variant === void 0 ? 'text' : _ref8$variant,
20594
- nativeProps = _objectWithoutProperties(_ref8, _excluded$t);
20593
+ nativeProps = _objectWithoutProperties(_ref8, _excluded$s);
20595
20594
  var displayText = getDisplayText(value, defaultValue);
20596
20595
  var isEmptyValue = displayText.length === 0;
20597
20596
  var _React$useState = React__namespace.default.useState({
@@ -21370,13 +21369,13 @@ var DatePickerIOS = function DatePickerIOS(_ref) {
21370
21369
  }));
21371
21370
  };
21372
21371
 
21373
- var _excluded$s = ["variant", "TextInputComponent"];
21372
+ var _excluded$r = ["variant", "TextInputComponent"];
21374
21373
  var DatePicker = function DatePicker(_ref) {
21375
21374
  var _ref$variant = _ref.variant,
21376
21375
  variant = _ref$variant === void 0 ? 'default' : _ref$variant,
21377
21376
  _ref$TextInputCompone = _ref.TextInputComponent,
21378
21377
  TextInputComponent = _ref$TextInputCompone === void 0 ? TextInput : _ref$TextInputCompone,
21379
- props = _objectWithoutProperties(_ref, _excluded$s);
21378
+ props = _objectWithoutProperties(_ref, _excluded$r);
21380
21379
  if (variant === 'calendar') {
21381
21380
  return /*#__PURE__*/React__namespace.default.createElement(DatePickerCalendar, _extends$1({}, props, {
21382
21381
  TextInputComponent: TextInputComponent
@@ -23242,15 +23241,16 @@ var Portal$1 = Object.assign(Portal, {
23242
23241
  Host: PortalHost
23243
23242
  });
23244
23243
 
23245
- var _excluded$r = ["visible"];
23246
23244
  var DEFAULT_BACKDROP_OPACITY = 0.4;
23247
23245
  var DEFAULT_ANIMATION_CONFIG = {
23248
23246
  easing: reactNative.Easing.inOut(reactNative.Easing.cubic),
23249
23247
  useNativeDriver: reactNative.Platform.OS !== 'web',
23250
23248
  duration: 400
23251
23249
  };
23252
- var Modal = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
23250
+ var Modal = function Modal(_ref) {
23253
23251
  var children = _ref.children,
23252
+ _ref$visible = _ref.visible,
23253
+ visible = _ref$visible === void 0 ? true : _ref$visible,
23254
23254
  onShow = _ref.onShow,
23255
23255
  onRequestClose = _ref.onRequestClose,
23256
23256
  testID = _ref.testID,
@@ -23262,56 +23262,58 @@ var Modal = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
23262
23262
  var theme = useTheme();
23263
23263
  var animatedBackdropValue = React.useRef(new reactNative.Animated.Value(0)).current;
23264
23264
  var animatedModalValue = React.useRef(new reactNative.Animated.Value(0)).current;
23265
- // Show or hide the backdrop and modal content
23266
- var animateBackdropAndContent = React.useCallback(function (_ref2) {
23267
- var toValue = _ref2.toValue,
23268
- callback = _ref2.callback;
23269
- if (animationType !== 'none') {
23270
- // Backdrop animation
23271
- if (!transparent) {
23272
- reactNative.Animated.timing(animatedBackdropValue, _objectSpread2({
23273
- toValue: toValue
23274
- }, DEFAULT_ANIMATION_CONFIG)).start();
23275
- }
23276
- // Modal content animation
23277
- reactNative.Animated.timing(animatedModalValue, _objectSpread2({
23278
- toValue: toValue
23279
- }, DEFAULT_ANIMATION_CONFIG)).start(callback);
23280
- } else {
23281
- callback === null || callback === void 0 || callback();
23282
- }
23283
- }, [animationType, onShow, transparent]);
23284
- var backdropOpacityAnimation = animatedBackdropValue.interpolate({
23285
- inputRange: [0, 1],
23286
- outputRange: [0, DEFAULT_BACKDROP_OPACITY]
23287
- });
23288
- var modalAnimation = animatedModalValue.interpolate({
23289
- inputRange: [0, 1],
23290
- outputRange: animationType === 'slide' ? [reactNative.Dimensions.get('window').height, 0] : [0, 1]
23291
- });
23292
- React.useImperativeHandle(ref, function () {
23293
- return {
23294
- show: function show() {
23295
- animateBackdropAndContent({
23296
- toValue: 1,
23297
- callback: onShow
23265
+ var _useState = React.useState(visible),
23266
+ _useState2 = _slicedToArray(_useState, 2),
23267
+ mounted = _useState2[0],
23268
+ setMounted = _useState2[1];
23269
+ var previousVisible = React.useRef(false);
23270
+ // Animate in/out based on visible prop
23271
+ React.useEffect(function () {
23272
+ if (visible && !previousVisible.current) {
23273
+ // Show animation
23274
+ setMounted(true);
23275
+ if (animationType !== 'none') {
23276
+ if (!transparent) {
23277
+ reactNative.Animated.timing(animatedBackdropValue, _objectSpread2({
23278
+ toValue: 1
23279
+ }, DEFAULT_ANIMATION_CONFIG)).start();
23280
+ }
23281
+ reactNative.Animated.timing(animatedModalValue, _objectSpread2({
23282
+ toValue: 1
23283
+ }, DEFAULT_ANIMATION_CONFIG)).start(function () {
23284
+ onShow === null || onShow === void 0 || onShow();
23298
23285
  });
23299
- },
23300
- hide: function hide(wrapperCallback) {
23301
- animateBackdropAndContent({
23302
- toValue: 0,
23303
- callback: function callback() {
23304
- if (reactNative.Platform.OS === 'ios') {
23305
- onDismiss === null || onDismiss === void 0 || onDismiss();
23306
- }
23307
- wrapperCallback();
23286
+ } else {
23287
+ onShow === null || onShow === void 0 || onShow();
23288
+ }
23289
+ } else if (!visible && previousVisible.current) {
23290
+ // Hide animation
23291
+ if (animationType !== 'none') {
23292
+ if (!transparent) {
23293
+ reactNative.Animated.timing(animatedBackdropValue, _objectSpread2({
23294
+ toValue: 0
23295
+ }, DEFAULT_ANIMATION_CONFIG)).start();
23296
+ }
23297
+ reactNative.Animated.timing(animatedModalValue, _objectSpread2({
23298
+ toValue: 0
23299
+ }, DEFAULT_ANIMATION_CONFIG)).start(function () {
23300
+ setMounted(false);
23301
+ if (reactNative.Platform.OS === 'ios') {
23302
+ onDismiss === null || onDismiss === void 0 || onDismiss();
23308
23303
  }
23309
23304
  });
23305
+ } else {
23306
+ setMounted(false);
23307
+ if (reactNative.Platform.OS === 'ios') {
23308
+ onDismiss === null || onDismiss === void 0 || onDismiss();
23309
+ }
23310
23310
  }
23311
- };
23312
- }, [onDismiss, onShow, animateBackdropAndContent]);
23311
+ }
23312
+ previousVisible.current = visible;
23313
+ }, [visible, animationType, transparent, onShow, onDismiss]);
23313
23314
  // Back button handler
23314
23315
  React.useEffect(function () {
23316
+ if (!visible) return;
23315
23317
  var backHandler = reactNative.BackHandler.addEventListener('hardwareBackPress', function () {
23316
23318
  onRequestClose === null || onRequestClose === void 0 || onRequestClose();
23317
23319
  return true;
@@ -23319,7 +23321,18 @@ var Modal = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
23319
23321
  return function () {
23320
23322
  return backHandler.remove();
23321
23323
  };
23322
- }, [onRequestClose]);
23324
+ }, [visible, onRequestClose]);
23325
+ var backdropOpacityAnimation = animatedBackdropValue.interpolate({
23326
+ inputRange: [0, 1],
23327
+ outputRange: [0, DEFAULT_BACKDROP_OPACITY]
23328
+ });
23329
+ var modalAnimation = animatedModalValue.interpolate({
23330
+ inputRange: [0, 1],
23331
+ outputRange: animationType === 'slide' ? [reactNative.Dimensions.get('window').height, 0] : [0, 1]
23332
+ });
23333
+ if (!visible && !mounted) {
23334
+ return null;
23335
+ }
23323
23336
  return /*#__PURE__*/React__namespace.default.createElement(Portal$1, null, /*#__PURE__*/React__namespace.default.createElement(reactNative.Animated.View, {
23324
23337
  style: _objectSpread2(_objectSpread2({}, reactNative.StyleSheet.absoluteFillObject), {}, {
23325
23338
  backgroundColor: transparent ? 'transparent' : theme.colors.overlayGlobalSurface,
@@ -23334,39 +23347,9 @@ var Modal = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
23334
23347
  }]
23335
23348
  })
23336
23349
  }, children));
23337
- });
23338
- var ModalWrapper = function ModalWrapper(_ref3) {
23339
- var _ref3$visible = _ref3.visible,
23340
- visible = _ref3$visible === void 0 ? true : _ref3$visible,
23341
- props = _objectWithoutProperties(_ref3, _excluded$r);
23342
- var modalRef = React.useRef(null);
23343
- var _useState = React.useState(visible),
23344
- _useState2 = _slicedToArray(_useState, 2),
23345
- internalVisible = _useState2[0],
23346
- setInternalVisible = _useState2[1];
23347
- React.useEffect(function () {
23348
- if (visible) {
23349
- setInternalVisible(true);
23350
- } else {
23351
- var _modalRef$current;
23352
- // Wait for animation to finish before hiding the modal
23353
- (_modalRef$current = modalRef.current) === null || _modalRef$current === void 0 || _modalRef$current.hide(function () {
23354
- return setInternalVisible(false);
23355
- });
23356
- }
23357
- }, [visible]);
23358
- React.useEffect(function () {
23359
- if (internalVisible) {
23360
- var _modalRef$current2;
23361
- (_modalRef$current2 = modalRef.current) === null || _modalRef$current2 === void 0 || _modalRef$current2.show();
23362
- }
23363
- }, [internalVisible]);
23364
- return internalVisible ? /*#__PURE__*/React__namespace.default.createElement(Modal, _extends$1({
23365
- ref: modalRef
23366
- }, props)) : null;
23367
23350
  };
23368
23351
 
23369
- var StyledErrorModal = index$c(ModalWrapper)({
23352
+ var StyledErrorModal = index$c(Modal)({
23370
23353
  height: '100%',
23371
23354
  width: '100%'
23372
23355
  });
@@ -26773,7 +26756,7 @@ var StyledSuccessButtonSecondary = index$c(CompoundButton)(function (_ref10) {
26773
26756
  marginTop: theme.__hd__.success.space.button.secondaryCTAMarginTop
26774
26757
  };
26775
26758
  });
26776
- var StyledSuccessModal = index$c(ModalWrapper)({
26759
+ var StyledSuccessModal = index$c(Modal)({
26777
26760
  height: '100%',
26778
26761
  width: '100%'
26779
26762
  });
@@ -27517,10 +27500,10 @@ var ScrollableTabHeader = function ScrollableTabHeader(_ref2) {
27517
27500
  badge = tab.badge;
27518
27501
  var active = selectedIndex === index;
27519
27502
  var activeAnimated = tabsAnims[index];
27520
- var outlineScale = active ? activeAnimated.interpolate({
27503
+ var outlineScale = activeAnimated.interpolate({
27521
27504
  inputRange: [0, 1],
27522
27505
  outputRange: [0.5, 1]
27523
- }) : 0;
27506
+ });
27524
27507
  var inactiveItem = originalInactiveItem !== null && originalInactiveItem !== void 0 ? originalInactiveItem : activeItem;
27525
27508
  var tabItem = getTabItem$1({
27526
27509
  item: active ? activeItem : inactiveItem,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hero-design/rn",
3
- "version": "8.113.0",
3
+ "version": "8.113.1",
4
4
  "license": "MIT",
5
5
  "main": "lib/index.js",
6
6
  "module": "es/index.js",
@@ -10,7 +10,7 @@
10
10
  "type-check": "tsc --noEmit",
11
11
  "test": "jest --runInBand",
12
12
  "test:watch": "jest --runInBand --watch",
13
- "test:ci": "jest --c=jest-ci.config.js --i --logHeapUsage --coverage && cat ./coverage/lcov.info",
13
+ "test:ci": "jest --c=jest-ci.config.js --i --logHeapUsage --coverage",
14
14
  "build:js": "rollup -c",
15
15
  "build:types": "tsc --noEmit false --emitDeclarationOnly --project tsconfig.prod.json",
16
16
  "build": "yarn build:js && yarn build:types",
@@ -69,7 +69,7 @@
69
69
  "@rollup/plugin-typescript": "^12.1.1",
70
70
  "@testing-library/jest-native": "^5.4.2",
71
71
  "@testing-library/react-hooks": "^8.0.1",
72
- "@testing-library/react-native": "^9.1.0",
72
+ "@testing-library/react-native": "^13.0.0",
73
73
  "@types/d3": "^7.4.3",
74
74
  "@types/events": "^3.0.3",
75
75
  "@types/jest": "^29.5.3",
@@ -94,7 +94,7 @@
94
94
  "react-native-svg": "15.8.0",
95
95
  "react-native-vector-icons": "^9.1.0",
96
96
  "react-native-webview": "13.10.3",
97
- "react-test-renderer": "18.2.0",
97
+ "react-test-renderer": "18.3.1",
98
98
  "rollup": "^4.24.3",
99
99
  "rollup-plugin-copy": "^3.5.0",
100
100
  "rollup-plugin-flow": "^1.1.1",
@@ -115,7 +115,7 @@ const Alert = ({
115
115
  style,
116
116
  testID,
117
117
  actionLabel,
118
- }: AlertProps): JSX.Element => {
118
+ }: AlertProps): ReactElement => {
119
119
  useDeprecation(
120
120
  `Alert's notification intent is deprecated and will be removed in the next major release. Please use other intents instead.`,
121
121
  intent === 'notification'