@hero-design/rn 8.57.0 → 8.58.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 (28) hide show
  1. package/.turbo/turbo-build.log +1 -1
  2. package/CHANGELOG.md +25 -0
  3. package/es/index.js +172 -94
  4. package/lib/index.js +172 -94
  5. package/package.json +6 -6
  6. package/src/components/Calendar/__tests__/index.spec.tsx +5 -5
  7. package/src/components/Carousel/CardCarousel.tsx +7 -9
  8. package/src/components/Carousel/CarouselItem.tsx +26 -14
  9. package/src/components/Carousel/StyledCarousel.tsx +2 -3
  10. package/src/components/Carousel/__tests__/__snapshots__/index.spec.tsx.snap +494 -48
  11. package/src/components/Carousel/__tests__/index.spec.tsx +34 -1
  12. package/src/components/Carousel/types.ts +3 -3
  13. package/src/components/DatePicker/__tests__/DatePickerCalendar.spec.tsx +32 -29
  14. package/src/components/Tabs/ScrollableTabsHeader/ScrollableTabsHeader.tsx +10 -12
  15. package/src/components/Tabs/__tests__/__snapshots__/ScrollableTabs.spec.tsx.snap +18 -6
  16. package/src/components/Tabs/__tests__/__snapshots__/ScrollableTabsHeader.spec.tsx.snap +12 -4
  17. package/src/components/TextInput/__tests__/index.spec.tsx +148 -1
  18. package/src/components/TextInput/index.tsx +135 -57
  19. package/src/components/Toast/ToastContext.ts +20 -2
  20. package/src/components/Toast/ToastProvider.tsx +7 -4
  21. package/src/theme/__tests__/__snapshots__/index.spec.ts.snap +0 -1
  22. package/src/theme/components/carousel.ts +0 -1
  23. package/types/components/Carousel/CardCarousel.d.ts +1 -0
  24. package/types/components/Carousel/StyledCarousel.d.ts +2 -2
  25. package/types/components/Carousel/types.d.ts +3 -3
  26. package/types/components/TextInput/index.d.ts +29 -1
  27. package/types/components/Toast/ToastContext.d.ts +1 -0
  28. package/types/theme/components/carousel.d.ts +0 -1
@@ -2,4 +2,4 @@
2
2
  src/index.ts → lib/index.js, es/index.js...
3
3
  (!) Plugin replace: @rollup/plugin-replace: 'preventAssignment' currently defaults to false. It is recommended to set this option to `true`, as the next major version will default this option to `true`.
4
4
  (!) Plugin node-resolve: preferring built-in module 'events' over local alternative at '/home/runner/work/hero-design/hero-design/node_modules/events/events.js', pass 'preferBuiltins: false' to disable this behavior or 'preferBuiltins: true' to disable this warning
5
- created lib/index.js, es/index.js in 44.3s
5
+ created lib/index.js, es/index.js in 58.4s
package/CHANGELOG.md CHANGED
@@ -1,5 +1,30 @@
1
1
  # @hero-design/rn
2
2
 
3
+ ## 8.58.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [#2756](https://github.com/Thinkei/hero-design/pull/2756) [`de3e8fa92`](https://github.com/Thinkei/hero-design/commit/de3e8fa92aa4a3598fc24f6fbdf40c66066bbb90) Thanks [@vinhphan-eh](https://github.com/vinhphan-eh)! - [Carousel] Update styling and make image optional
8
+
9
+ ### Patch Changes
10
+
11
+ - [#2758](https://github.com/Thinkei/hero-design/pull/2758) [`61012afc4`](https://github.com/Thinkei/hero-design/commit/61012afc45105803d3bec4fc8ca8cf7cbe7f9363) Thanks [@vinhphan-eh](https://github.com/vinhphan-eh)! - [Tabs] Fix tabs bottom border on iOS not showing in full width
12
+
13
+ ## 8.57.1
14
+
15
+ ### Patch Changes
16
+
17
+ - [#2717](https://github.com/Thinkei/hero-design/pull/2717) [`7d56b99af`](https://github.com/Thinkei/hero-design/commit/7d56b99afa8cf585f78c2aba57e97817f9365441) Thanks [@ttkien](https://github.com/ttkien)! - refactor card carousel to reduce cognitive comlexity to 15
18
+
19
+ - [#2738](https://github.com/Thinkei/hero-design/pull/2738) [`819421b35`](https://github.com/Thinkei/hero-design/commit/819421b357b3e87f36326759c636b9958622215c) Thanks [@vinhphan-eh](https://github.com/vinhphan-eh)! - Upgrade Expo SDK to 49
20
+
21
+ - [#2719](https://github.com/Thinkei/hero-design/pull/2719) [`6985126e1`](https://github.com/Thinkei/hero-design/commit/6985126e14c4a1e43d9daf029afcbf21937d040e) Thanks [@ttkien](https://github.com/ttkien)! - [TextInput] refactor code
22
+
23
+ - [#2716](https://github.com/Thinkei/hero-design/pull/2716) [`481838499`](https://github.com/Thinkei/hero-design/commit/4818384992a154a309b6c66099069822082f2f77) Thanks [@phucdph](https://github.com/phucdph)! - Fix typing issue
24
+
25
+ - Updated dependencies [[`819421b35`](https://github.com/Thinkei/hero-design/commit/819421b357b3e87f36326759c636b9958622215c)]:
26
+ - @hero-design/react-native-month-year-picker@8.42.7
27
+
3
28
  ## 8.57.0
4
29
 
5
30
  ### Minor Changes
package/es/index.js CHANGED
@@ -2403,7 +2403,6 @@ var getCardTheme = function getCardTheme(theme) {
2403
2403
 
2404
2404
  var getCarouselTheme = function getCarouselTheme(theme) {
2405
2405
  var space = {
2406
- headingMarginTop: theme.space.small,
2407
2406
  headingMarginBottom: theme.space.medium,
2408
2407
  footerPaddingHorizontal: theme.space.large,
2409
2408
  footerPaddingVertical: theme.space.medium,
@@ -12039,6 +12038,9 @@ var ITEM_WIDTH_RATE = 0.85;
12039
12038
  */
12040
12039
  var VIEW_POSITION_CENTER = 0.5;
12041
12040
 
12041
+ var getCardCarouselValidIndex = function getCardCarouselValidIndex(index, length) {
12042
+ return Math.min(Math.max(index, 0), length - 1);
12043
+ };
12042
12044
  var CardCarousel = /*#__PURE__*/forwardRef(function (_ref, ref) {
12043
12045
  var onItemIndexChange = _ref.onItemIndexChange,
12044
12046
  items = _ref.items,
@@ -12065,18 +12067,13 @@ var CardCarousel = /*#__PURE__*/forwardRef(function (_ref, ref) {
12065
12067
  var viewPosition = Platform.OS === 'ios' ? VIEW_POSITION_CENTER : undefined;
12066
12068
  var _snapToIndex = useCallback(function (index) {
12067
12069
  var _carouselRef$current;
12068
- var validIndex = 0;
12069
- if (index >= items.length) {
12070
- validIndex = items.length - 1;
12071
- } else if (index >= 0) {
12072
- validIndex = index;
12073
- }
12070
+ var validIndex = getCardCarouselValidIndex(index, items.length);
12074
12071
  (_carouselRef$current = carouselRef.current) === null || _carouselRef$current === void 0 || _carouselRef$current.scrollToIndex({
12075
12072
  index: validIndex,
12076
12073
  animated: true,
12077
12074
  viewPosition: viewPosition
12078
12075
  });
12079
- }, [carouselRef, itemWidth]);
12076
+ }, [items.length, viewPosition]);
12080
12077
  /*
12081
12078
  * snap to the next index. If the curent index is the last one, snap to the first one.
12082
12079
  */
@@ -12091,7 +12088,7 @@ var CardCarousel = /*#__PURE__*/forwardRef(function (_ref, ref) {
12091
12088
  animated: true,
12092
12089
  viewPosition: viewPosition
12093
12090
  });
12094
- }, [carouselRef, currentIndex, itemWidth, items.length]);
12091
+ }, [currentIndex, items.length, viewPosition]);
12095
12092
  React.useImperativeHandle(ref, function () {
12096
12093
  return {
12097
12094
  snapToIndex: function snapToIndex(index) {
@@ -12241,7 +12238,6 @@ var StyledCarouselView = index$9(View)(function () {
12241
12238
  var StyledCarouselHeading = index$9(Typography.Title)(function (_ref2) {
12242
12239
  var theme = _ref2.theme;
12243
12240
  return {
12244
- marginTop: theme.__hd__.carousel.space.headingMarginTop,
12245
12241
  marginBottom: theme.__hd__.carousel.space.headingMarginBottom
12246
12242
  };
12247
12243
  });
@@ -12305,22 +12301,37 @@ var CarouselItem = function CarouselItem(_ref) {
12305
12301
  content = _ref.content,
12306
12302
  heading = _ref.heading,
12307
12303
  body = _ref.body;
12304
+ var theme = useTheme$1();
12305
+ var ImageComponent = React.useMemo(function () {
12306
+ if (image) {
12307
+ if (isCarouselImageProps(image)) {
12308
+ return /*#__PURE__*/React.createElement(StyledCustomSizeCarouselImage, {
12309
+ source: image,
12310
+ height: image.height,
12311
+ width: image.width,
12312
+ resizeMode: image.resizeMode,
12313
+ style: {
12314
+ marginBottom: theme.space.medium
12315
+ }
12316
+ });
12317
+ }
12318
+ return /*#__PURE__*/React.createElement(StyledCarouselImage, {
12319
+ source: typeof image === 'string' ? {
12320
+ uri: image
12321
+ } : image,
12322
+ style: {
12323
+ marginBottom: theme.space.medium
12324
+ }
12325
+ });
12326
+ }
12327
+ return null;
12328
+ }, [image]);
12308
12329
  return /*#__PURE__*/React.createElement(Box, {
12309
12330
  style: {
12310
12331
  width: width
12311
12332
  }
12312
- }, image && (isCarouselImageProps(image) ? /*#__PURE__*/React.createElement(StyledCustomSizeCarouselImage, {
12313
- source: image,
12314
- height: image.height,
12315
- width: image.width,
12316
- resizeMode: image.resizeMode
12317
- }) : /*#__PURE__*/React.createElement(StyledCarouselImage, {
12318
- source: typeof image === 'string' ? {
12319
- uri: image
12320
- } : image
12321
- })), /*#__PURE__*/React.createElement(StyledCarouselContentWrapper, {
12322
- paddingHorizontal: "large",
12323
- marginTop: "large",
12333
+ }, ImageComponent, /*#__PURE__*/React.createElement(StyledCarouselContentWrapper, {
12334
+ paddingHorizontal: "medium",
12324
12335
  width: width
12325
12336
  }, content, /*#__PURE__*/React.createElement(StyledCarouselHeading, {
12326
12337
  level: "h1",
@@ -12846,38 +12857,96 @@ var getState$1 = function getState(_ref) {
12846
12857
  // https://github.com/callstack/react-native-paper/pull/3331
12847
12858
  var EMPTY_PLACEHOLDER_VALUE = ' ';
12848
12859
  var LABEL_ANIMATION_DURATION = 150;
12849
- var TextInput = /*#__PURE__*/forwardRef(function (_ref2, ref) {
12850
- var _ref3;
12851
- var label = _ref2.label,
12852
- prefix = _ref2.prefix,
12853
- suffix = _ref2.suffix,
12854
- style = _ref2.style,
12855
- textStyle = _ref2.textStyle,
12856
- testID = _ref2.testID,
12857
- accessibilityLabelledBy = _ref2.accessibilityLabelledBy,
12858
- error = _ref2.error,
12859
- required = _ref2.required,
12860
- _ref2$editable = _ref2.editable,
12861
- editable = _ref2$editable === void 0 ? true : _ref2$editable,
12862
- _ref2$disabled = _ref2.disabled,
12863
- disabled = _ref2$disabled === void 0 ? false : _ref2$disabled,
12864
- _ref2$loading = _ref2.loading,
12865
- loading = _ref2$loading === void 0 ? false : _ref2$loading,
12866
- maxLength = _ref2.maxLength,
12867
- _ref2$hideCharacterCo = _ref2.hideCharacterCount,
12868
- hideCharacterCount = _ref2$hideCharacterCo === void 0 ? false : _ref2$hideCharacterCo,
12869
- helpText = _ref2.helpText,
12870
- value = _ref2.value,
12871
- defaultValue = _ref2.defaultValue,
12872
- renderInputValue = _ref2.renderInputValue,
12873
- _ref2$allowFontScalin = _ref2.allowFontScaling,
12874
- allowFontScaling = _ref2$allowFontScalin === void 0 ? false : _ref2$allowFontScalin,
12875
- _ref2$variant = _ref2.variant,
12876
- variant = _ref2$variant === void 0 ? 'text' : _ref2$variant,
12877
- nativeProps = _objectWithoutProperties(_ref2, _excluded$j);
12878
- var displayText = (_ref3 = value !== undefined ? value : defaultValue) !== null && _ref3 !== void 0 ? _ref3 : '';
12879
- var isEmptyValue = displayText.length === 0;
12860
+ var renderErrorOrHelpText = function renderErrorOrHelpText(_ref2) {
12861
+ var error = _ref2.error,
12862
+ helpText = _ref2.helpText;
12863
+ return error ? /*#__PURE__*/React.createElement(StyledErrorContainer$2, null, /*#__PURE__*/React.createElement(Icon, {
12864
+ testID: "input-error-icon",
12865
+ icon: "circle-info",
12866
+ size: "xsmall",
12867
+ intent: "danger"
12868
+ }), /*#__PURE__*/React.createElement(StyledError, {
12869
+ testID: "input-error-message"
12870
+ }, error)) : !!helpText && /*#__PURE__*/React.createElement(StyledHelperText, null, helpText);
12871
+ };
12872
+ var renderInput = function renderInput(_ref3) {
12873
+ var variant = _ref3.variant,
12874
+ nativeInputProps = _ref3.nativeInputProps,
12875
+ renderInputValue = _ref3.renderInputValue,
12876
+ ref = _ref3.ref;
12877
+ return renderInputValue ? renderInputValue(nativeInputProps) : /*#__PURE__*/React.createElement(StyledTextInput, _extends$1({}, nativeInputProps, {
12878
+ themeVariant: variant,
12879
+ multiline: variant === 'textarea' || nativeInputProps.multiline,
12880
+ ref: ref
12881
+ }));
12882
+ };
12883
+ var renderSuffix = function renderSuffix(_ref4) {
12884
+ var state = _ref4.state,
12885
+ loading = _ref4.loading,
12886
+ suffix = _ref4.suffix;
12880
12887
  var actualSuffix = loading ? 'loading' : suffix;
12888
+ return typeof actualSuffix === 'string' ? /*#__PURE__*/React.createElement(Icon, {
12889
+ intent: state === 'disabled' ? 'disabled-text' : 'text',
12890
+ testID: "input-suffix",
12891
+ icon: actualSuffix,
12892
+ spin: actualSuffix === 'loading',
12893
+ size: "medium"
12894
+ }) : suffix;
12895
+ };
12896
+ var renderPrefix = function renderPrefix(_ref5) {
12897
+ var state = _ref5.state,
12898
+ prefix = _ref5.prefix;
12899
+ return typeof prefix === 'string' ? /*#__PURE__*/React.createElement(Icon, {
12900
+ intent: state === 'disabled' ? 'disabled-text' : 'text',
12901
+ testID: "input-prefix",
12902
+ icon: prefix,
12903
+ size: "xsmall"
12904
+ }) : prefix;
12905
+ };
12906
+ var renderMaxLengthMessage = function renderMaxLengthMessage(_ref6) {
12907
+ var maxLength = _ref6.maxLength,
12908
+ state = _ref6.state,
12909
+ currentLength = _ref6.currentLength,
12910
+ hideCharacterCount = _ref6.hideCharacterCount;
12911
+ var shouldShowMaxLength = maxLength !== undefined && !hideCharacterCount;
12912
+ return shouldShowMaxLength && /*#__PURE__*/React.createElement(StyledMaxLengthMessage, {
12913
+ themeState: state
12914
+ }, currentLength, "/", maxLength);
12915
+ };
12916
+ var getDisplayText = function getDisplayText(value, defaultValue) {
12917
+ var _ref7;
12918
+ return (_ref7 = value !== undefined ? value : defaultValue) !== null && _ref7 !== void 0 ? _ref7 : '';
12919
+ };
12920
+ var TextInput = /*#__PURE__*/forwardRef(function (_ref8, ref) {
12921
+ var label = _ref8.label,
12922
+ prefix = _ref8.prefix,
12923
+ suffix = _ref8.suffix,
12924
+ style = _ref8.style,
12925
+ textStyle = _ref8.textStyle,
12926
+ testID = _ref8.testID,
12927
+ accessibilityLabelledBy = _ref8.accessibilityLabelledBy,
12928
+ error = _ref8.error,
12929
+ required = _ref8.required,
12930
+ _ref8$editable = _ref8.editable,
12931
+ editable = _ref8$editable === void 0 ? true : _ref8$editable,
12932
+ _ref8$disabled = _ref8.disabled,
12933
+ disabled = _ref8$disabled === void 0 ? false : _ref8$disabled,
12934
+ _ref8$loading = _ref8.loading,
12935
+ loading = _ref8$loading === void 0 ? false : _ref8$loading,
12936
+ maxLength = _ref8.maxLength,
12937
+ _ref8$hideCharacterCo = _ref8.hideCharacterCount,
12938
+ hideCharacterCount = _ref8$hideCharacterCo === void 0 ? false : _ref8$hideCharacterCo,
12939
+ helpText = _ref8.helpText,
12940
+ value = _ref8.value,
12941
+ defaultValue = _ref8.defaultValue,
12942
+ renderInputValue = _ref8.renderInputValue,
12943
+ _ref8$allowFontScalin = _ref8.allowFontScaling,
12944
+ allowFontScaling = _ref8$allowFontScalin === void 0 ? false : _ref8$allowFontScalin,
12945
+ _ref8$variant = _ref8.variant,
12946
+ variant = _ref8$variant === void 0 ? 'text' : _ref8$variant,
12947
+ nativeProps = _objectWithoutProperties(_ref8, _excluded$j);
12948
+ var displayText = getDisplayText(value, defaultValue);
12949
+ var isEmptyValue = displayText.length === 0;
12881
12950
  var _React$useState = React.useState({
12882
12951
  height: 0,
12883
12952
  width: 0
@@ -12905,7 +12974,6 @@ var TextInput = /*#__PURE__*/forwardRef(function (_ref2, ref) {
12905
12974
  isFocused: isFocused,
12906
12975
  isEmptyValue: isEmptyValue
12907
12976
  });
12908
- var shouldShowMaxLength = maxLength !== undefined && !hideCharacterCount;
12909
12977
  var theme = useTheme();
12910
12978
  var focusAnimation = useRef(new Animated.Value(0)).current;
12911
12979
  useEffect(function () {
@@ -13043,12 +13111,10 @@ var TextInput = /*#__PURE__*/forwardRef(function (_ref2, ref) {
13043
13111
  }, borderStyle]
13044
13112
  }), /*#__PURE__*/React.createElement(View, {
13045
13113
  onLayout: onPrefixLayout
13046
- }, typeof prefix === 'string' ? /*#__PURE__*/React.createElement(Icon, {
13047
- intent: state === 'disabled' ? 'disabled-text' : 'text',
13048
- testID: "input-prefix",
13049
- icon: prefix,
13050
- size: "xsmall"
13051
- }) : prefix), /*#__PURE__*/React.createElement(StyledLabelContainerInsideTextInput, {
13114
+ }, renderPrefix({
13115
+ state: state,
13116
+ prefix: prefix
13117
+ })), /*#__PURE__*/React.createElement(StyledLabelContainerInsideTextInput, {
13052
13118
  themeVariant: variant,
13053
13119
  pointerEvents: "none",
13054
13120
  style: [{
@@ -13085,28 +13151,26 @@ var TextInput = /*#__PURE__*/forwardRef(function (_ref2, ref) {
13085
13151
  testID: "input-label",
13086
13152
  themeState: state,
13087
13153
  onLayout: onLabelLayout
13088
- }, label)), /*#__PURE__*/React.createElement(StyledTextInputAndLabelContainer, null, renderInputValue ? renderInputValue(nativeInputProps) : /*#__PURE__*/React.createElement(StyledTextInput, _extends$1({}, nativeInputProps, {
13089
- themeVariant: variant,
13090
- multiline: variant === 'textarea' || nativeProps.multiline,
13091
- ref: function ref(reference) {
13092
- innerTextInput.current = reference;
13154
+ }, label)), /*#__PURE__*/React.createElement(StyledTextInputAndLabelContainer, null, renderInput({
13155
+ variant: variant,
13156
+ nativeInputProps: nativeInputProps,
13157
+ renderInputValue: renderInputValue,
13158
+ ref: function ref(rnTextInputRef) {
13159
+ innerTextInput.current = rnTextInputRef;
13093
13160
  }
13094
- }))), typeof actualSuffix === 'string' ? /*#__PURE__*/React.createElement(Icon, {
13095
- intent: state === 'disabled' ? 'disabled-text' : 'text',
13096
- testID: "input-suffix",
13097
- icon: actualSuffix,
13098
- spin: actualSuffix === 'loading',
13099
- size: "medium"
13100
- }) : suffix), /*#__PURE__*/React.createElement(StyledErrorAndHelpTextContainer, null, /*#__PURE__*/React.createElement(StyledErrorAndMaxLengthContainer, null, error ? /*#__PURE__*/React.createElement(StyledErrorContainer$2, null, /*#__PURE__*/React.createElement(Icon, {
13101
- testID: "input-error-icon",
13102
- icon: "circle-info",
13103
- size: "xsmall",
13104
- intent: "danger"
13105
- }), /*#__PURE__*/React.createElement(StyledError, {
13106
- testID: "input-error-message"
13107
- }, error)) : !!helpText && /*#__PURE__*/React.createElement(StyledHelperText, null, helpText), shouldShowMaxLength && /*#__PURE__*/React.createElement(StyledMaxLengthMessage, {
13108
- themeState: state
13109
- }, displayText.length, "/", maxLength))));
13161
+ })), renderSuffix({
13162
+ state: state,
13163
+ loading: loading,
13164
+ suffix: suffix
13165
+ })), /*#__PURE__*/React.createElement(StyledErrorAndHelpTextContainer, null, /*#__PURE__*/React.createElement(StyledErrorAndMaxLengthContainer, null, renderErrorOrHelpText({
13166
+ error: error,
13167
+ helpText: helpText
13168
+ }), renderMaxLengthMessage({
13169
+ state: state,
13170
+ currentLength: displayText.length,
13171
+ maxLength: maxLength,
13172
+ hideCharacterCount: hideCharacterCount
13173
+ }))));
13110
13174
  });
13111
13175
 
13112
13176
  var getDateValue = function getDateValue(value, minDate, maxDate) {
@@ -14791,13 +14855,30 @@ var CTAWrapper = index$9(TouchableOpacity)(function (_ref6) {
14791
14855
  };
14792
14856
  });
14793
14857
 
14794
- var ToastContext = /*#__PURE__*/createContext({});
14858
+ var fallbackToastControlContext = {
14859
+ show: function show(_) {
14860
+ return '';
14861
+ },
14862
+ hide: function hide(_) {
14863
+ // Fallback empty function
14864
+ },
14865
+ clearAll: function clearAll() {
14866
+ // Fallback empty function
14867
+ }
14868
+ };
14869
+ var ToastContext = /*#__PURE__*/createContext(fallbackToastControlContext);
14795
14870
  var ToastConfigContext = /*#__PURE__*/createContext({});
14796
14871
  var useToastConfig = function useToastConfig() {
14797
14872
  return useContext(ToastConfigContext);
14798
14873
  };
14799
14874
  var useToast = function useToast() {
14800
- return useContext(ToastContext);
14875
+ var context = useContext(ToastContext);
14876
+ if (!context) {
14877
+ // eslint-disable-next-line no-console
14878
+ console.warn('Toast was used without ToastProvider');
14879
+ return fallbackToastControlContext;
14880
+ }
14881
+ return context;
14801
14882
  };
14802
14883
 
14803
14884
  var getIntentIcon = function getIntentIcon(intent) {
@@ -14996,8 +15077,7 @@ var ToastProvider = function ToastProvider(_ref) {
14996
15077
  var position = _position === undefined ? 'bottom' : _position;
14997
15078
  useDeprecation("Toast's position prop is deprecated and will be removed in the next major release.\nPlease remove it.", _position !== undefined);
14998
15079
  var toastRef = useRef(null);
14999
- // @ts-expect-error: TODO: @tungv Fix this type error
15000
- var _useState = useState(null),
15080
+ var _useState = useState(),
15001
15081
  _useState2 = _slicedToArray(_useState, 2),
15002
15082
  refState = _useState2[0],
15003
15083
  setRefState = _useState2[1];
@@ -15013,7 +15093,7 @@ var ToastProvider = function ToastProvider(_ref) {
15013
15093
  };
15014
15094
  }, [displayType, position]);
15015
15095
  return /*#__PURE__*/React.createElement(ToastContext.Provider, {
15016
- value: refState
15096
+ value: refState || fallbackToastControlContext
15017
15097
  }, /*#__PURE__*/React.createElement(View, {
15018
15098
  style: {
15019
15099
  flex: 1
@@ -17581,18 +17661,16 @@ var ScrollableTabHeader = function ScrollableTabHeader(_ref2) {
17581
17661
  });
17582
17662
  }, 100);
17583
17663
  },
17584
- style:
17585
- // Border styles specified in contentContainerStyle don't work
17586
- // so they need to be placed here instead on Android.
17587
- Platform.OS === 'android' ? {
17664
+ style: {
17588
17665
  borderBottomColor: theme.__hd__.tabs.colors.headerBottom,
17589
17666
  borderBottomWidth: theme.__hd__.tabs.sizes.indicator
17590
- } : undefined,
17591
- contentContainerStyle: {
17592
- paddingHorizontal: theme.__hd__.tabs.space.flatListHorizontalPadding,
17667
+ },
17668
+ contentContainerStyle: _objectSpread2({
17669
+ paddingHorizontal: theme.__hd__.tabs.space.flatListHorizontalPadding
17670
+ }, Platform.OS === 'android' && {
17593
17671
  borderBottomColor: theme.__hd__.tabs.colors.headerBottom,
17594
17672
  borderBottomWidth: theme.__hd__.tabs.sizes.indicator
17595
- },
17673
+ }),
17596
17674
  renderItem: function renderItem(_ref4) {
17597
17675
  var tab = _ref4.item,
17598
17676
  index = _ref4.index;