@hero-design/rn-work-uikit 1.9.4 → 1.9.5
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.
- package/CHANGELOG.md +9 -0
- package/assets/fonts/hero-icons-mobile.ttf +0 -0
- package/lib/index.js +127 -145
- package/package.json +5 -5
- package/src/components/RichTextEditor/MentionList.tsx +2 -1
- package/src/components/TextInput/__tests__/FloatingLabel.spec.tsx +13 -16
- package/src/components/TextInput/__tests__/PrefixComponent.spec.tsx +1 -1
- package/src/components/TextInput/__tests__/SuffixComponent.spec.tsx +2 -2
- package/src/components/TextInput/__tests__/index.spec.tsx +2 -2
- package/src/theme/__tests__/__snapshots__/index.spec.ts.snap +1 -1
- package/testUtils/renderWithTheme.tsx +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
# @hero-design/rn-work-uikit
|
|
2
2
|
|
|
3
|
+
## 1.9.5
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#4546](https://github.com/Thinkei/hero-design/pull/4546) [`3d952f2800d556206f58098b021b856b0557eb76`](https://github.com/Thinkei/hero-design/commit/3d952f2800d556206f58098b021b856b0557eb76) Thanks [@ttkien](https://github.com/ttkien)! - [Tabs] update Tab highlights animated logic
|
|
8
|
+
|
|
9
|
+
- Updated dependencies [[`3d952f2800d556206f58098b021b856b0557eb76`](https://github.com/Thinkei/hero-design/commit/3d952f2800d556206f58098b021b856b0557eb76), [`3dd028bcd49e00d13c9112e18103659e75c1bc95`](https://github.com/Thinkei/hero-design/commit/3dd028bcd49e00d13c9112e18103659e75c1bc95)]:
|
|
10
|
+
- @hero-design/rn@8.113.1
|
|
11
|
+
|
|
3
12
|
## 1.9.4
|
|
4
13
|
|
|
5
14
|
### Patch Changes
|
|
Binary file
|
package/lib/index.js
CHANGED
|
@@ -3735,13 +3735,13 @@ var StyledDivider = index$c(reactNative.View)(function (_ref) {
|
|
|
3735
3735
|
}, horizontalMargin), verticalMargin);
|
|
3736
3736
|
});
|
|
3737
3737
|
|
|
3738
|
-
var _excluded$
|
|
3738
|
+
var _excluded$Q = ["marginHorizontal", "marginVertical", "style", "testID"];
|
|
3739
3739
|
var Divider = function Divider(_ref) {
|
|
3740
3740
|
var marginHorizontal = _ref.marginHorizontal,
|
|
3741
3741
|
marginVertical = _ref.marginVertical,
|
|
3742
3742
|
style = _ref.style,
|
|
3743
3743
|
testID = _ref.testID,
|
|
3744
|
-
nativeProps = _objectWithoutProperties(_ref, _excluded$
|
|
3744
|
+
nativeProps = _objectWithoutProperties(_ref, _excluded$Q);
|
|
3745
3745
|
return /*#__PURE__*/React__namespace.default.createElement(StyledDivider, _extends$1({}, nativeProps, {
|
|
3746
3746
|
themeMarginHorizontal: marginHorizontal,
|
|
3747
3747
|
themeMarginVertical: marginVertical,
|
|
@@ -6025,7 +6025,7 @@ var getBottomNavigationTheme = function getBottomNavigationTheme(theme) {
|
|
|
6025
6025
|
wrapper: theme.shadows.medium
|
|
6026
6026
|
};
|
|
6027
6027
|
var space = {
|
|
6028
|
-
titleMarginTop: theme.space.
|
|
6028
|
+
titleMarginTop: theme.space.xxsmall
|
|
6029
6029
|
};
|
|
6030
6030
|
return {
|
|
6031
6031
|
colors: colors,
|
|
@@ -8080,7 +8080,7 @@ var StyledLoadingDot = index$c(reactNative.View)(function (_ref) {
|
|
|
8080
8080
|
}, themeStyling());
|
|
8081
8081
|
});
|
|
8082
8082
|
|
|
8083
|
-
var _excluded$
|
|
8083
|
+
var _excluded$P = ["count", "size", "testID", "themeVariant"];
|
|
8084
8084
|
var AnimatedLoadingIndicatorWrapper = reactNative.Animated.createAnimatedComponent(StyledLoadingIndicatorWrapper);
|
|
8085
8085
|
var AnimatedLoadingDot = reactNative.Animated.createAnimatedComponent(StyledLoadingDot);
|
|
8086
8086
|
var renderDotComponent = function renderDotComponent(_ref) {
|
|
@@ -8112,7 +8112,7 @@ var LoadingIndicator = function LoadingIndicator(_ref2) {
|
|
|
8112
8112
|
size = _ref2$size === void 0 ? 12 : _ref2$size,
|
|
8113
8113
|
testID = _ref2.testID,
|
|
8114
8114
|
themeVariant = _ref2.themeVariant,
|
|
8115
|
-
nativeProps = _objectWithoutProperties(_ref2, _excluded$
|
|
8115
|
+
nativeProps = _objectWithoutProperties(_ref2, _excluded$P);
|
|
8116
8116
|
var progressAnimation = React.useRef(new reactNative.Animated.Value(0));
|
|
8117
8117
|
React.useEffect(function () {
|
|
8118
8118
|
var animation = reactNative.Animated.loop(reactNative.Animated.timing(progressAnimation.current, {
|
|
@@ -8739,10 +8739,10 @@ var StyledHeroIcon = index$c(HeroIcon)(function (_ref) {
|
|
|
8739
8739
|
};
|
|
8740
8740
|
});
|
|
8741
8741
|
|
|
8742
|
-
var _excluded$
|
|
8742
|
+
var _excluded$O = ["style"];
|
|
8743
8743
|
var AnimatedIcon = function AnimatedIcon(_ref) {
|
|
8744
8744
|
var style = _ref.style,
|
|
8745
|
-
otherProps = _objectWithoutProperties(_ref, _excluded$
|
|
8745
|
+
otherProps = _objectWithoutProperties(_ref, _excluded$O);
|
|
8746
8746
|
var rotateAnimation = React.useRef(new reactNative.Animated.Value(0));
|
|
8747
8747
|
React.useEffect(function () {
|
|
8748
8748
|
var animation = reactNative.Animated.loop(reactNative.Animated.timing(rotateAnimation.current, {
|
|
@@ -8842,7 +8842,7 @@ var StyledText$4 = index$c(reactNative.Text)(function (_ref) {
|
|
|
8842
8842
|
});
|
|
8843
8843
|
});
|
|
8844
8844
|
|
|
8845
|
-
var _excluded$
|
|
8845
|
+
var _excluded$N = ["children", "fontSize", "fontWeight", "intent", "typeface", "allowFontScaling"];
|
|
8846
8846
|
/**
|
|
8847
8847
|
* @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.
|
|
8848
8848
|
*/
|
|
@@ -8858,7 +8858,7 @@ var Text = function Text(_ref) {
|
|
|
8858
8858
|
typeface = _ref$typeface === void 0 ? 'neutral' : _ref$typeface,
|
|
8859
8859
|
_ref$allowFontScaling = _ref.allowFontScaling,
|
|
8860
8860
|
allowFontScaling = _ref$allowFontScaling === void 0 ? false : _ref$allowFontScaling,
|
|
8861
|
-
nativeProps = _objectWithoutProperties(_ref, _excluded$
|
|
8861
|
+
nativeProps = _objectWithoutProperties(_ref, _excluded$N);
|
|
8862
8862
|
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.');
|
|
8863
8863
|
return /*#__PURE__*/React__namespace.default.createElement(StyledText$4, _extends$1({}, nativeProps, {
|
|
8864
8864
|
themeFontSize: fontSize,
|
|
@@ -8891,7 +8891,7 @@ var StyledCaption = index$c(reactNative.Text)(function (_ref) {
|
|
|
8891
8891
|
};
|
|
8892
8892
|
});
|
|
8893
8893
|
|
|
8894
|
-
var _excluded$
|
|
8894
|
+
var _excluded$M = ["children", "fontWeight", "intent", "allowFontScaling", "fontStyle"];
|
|
8895
8895
|
var Caption = function Caption(_ref) {
|
|
8896
8896
|
var children = _ref.children,
|
|
8897
8897
|
_ref$fontWeight = _ref.fontWeight,
|
|
@@ -8902,7 +8902,7 @@ var Caption = function Caption(_ref) {
|
|
|
8902
8902
|
allowFontScaling = _ref$allowFontScaling === void 0 ? false : _ref$allowFontScaling,
|
|
8903
8903
|
_ref$fontStyle = _ref.fontStyle,
|
|
8904
8904
|
fontStyle = _ref$fontStyle === void 0 ? 'normal' : _ref$fontStyle,
|
|
8905
|
-
nativeProps = _objectWithoutProperties(_ref, _excluded$
|
|
8905
|
+
nativeProps = _objectWithoutProperties(_ref, _excluded$M);
|
|
8906
8906
|
return /*#__PURE__*/React__namespace.default.createElement(StyledCaption, _extends$1({}, nativeProps, {
|
|
8907
8907
|
themeFontWeight: fontWeight,
|
|
8908
8908
|
themeIntent: intent,
|
|
@@ -8927,7 +8927,7 @@ var StyledLabel$2 = index$c(reactNative.Text)(function (_ref) {
|
|
|
8927
8927
|
};
|
|
8928
8928
|
});
|
|
8929
8929
|
|
|
8930
|
-
var _excluded$
|
|
8930
|
+
var _excluded$L = ["children", "intent", "allowFontScaling", "fontStyle"];
|
|
8931
8931
|
var Label = function Label(_ref) {
|
|
8932
8932
|
var children = _ref.children,
|
|
8933
8933
|
_ref$intent = _ref.intent,
|
|
@@ -8936,7 +8936,7 @@ var Label = function Label(_ref) {
|
|
|
8936
8936
|
allowFontScaling = _ref$allowFontScaling === void 0 ? false : _ref$allowFontScaling,
|
|
8937
8937
|
_ref$fontStyle = _ref.fontStyle,
|
|
8938
8938
|
fontStyle = _ref$fontStyle === void 0 ? 'normal' : _ref$fontStyle,
|
|
8939
|
-
nativeProps = _objectWithoutProperties(_ref, _excluded$
|
|
8939
|
+
nativeProps = _objectWithoutProperties(_ref, _excluded$L);
|
|
8940
8940
|
return /*#__PURE__*/React__namespace.default.createElement(StyledLabel$2, _extends$1({}, nativeProps, {
|
|
8941
8941
|
themeIntent: intent,
|
|
8942
8942
|
themeIsItalic: fontStyle === 'italic',
|
|
@@ -8959,7 +8959,7 @@ var StyledTitle$1 = index$c(reactNative.Text)(function (_ref) {
|
|
|
8959
8959
|
};
|
|
8960
8960
|
});
|
|
8961
8961
|
|
|
8962
|
-
var _excluded$
|
|
8962
|
+
var _excluded$K = ["children", "intent", "allowFontScaling", "level", "typeface", "fontStyle"];
|
|
8963
8963
|
var Title = function Title(_ref) {
|
|
8964
8964
|
var children = _ref.children,
|
|
8965
8965
|
_ref$intent = _ref.intent,
|
|
@@ -8972,7 +8972,7 @@ var Title = function Title(_ref) {
|
|
|
8972
8972
|
typeface = _ref$typeface === void 0 ? 'neutral' : _ref$typeface,
|
|
8973
8973
|
_ref$fontStyle = _ref.fontStyle,
|
|
8974
8974
|
fontStyle = _ref$fontStyle === void 0 ? 'normal' : _ref$fontStyle,
|
|
8975
|
-
nativeProps = _objectWithoutProperties(_ref, _excluded$
|
|
8975
|
+
nativeProps = _objectWithoutProperties(_ref, _excluded$K);
|
|
8976
8976
|
return /*#__PURE__*/React__namespace.default.createElement(StyledTitle$1, _extends$1({}, nativeProps, {
|
|
8977
8977
|
themeLevel: level,
|
|
8978
8978
|
themeTypeface: typeface,
|
|
@@ -9011,7 +9011,7 @@ var StyledBody$2 = index$c(reactNative.Text)(function (_ref) {
|
|
|
9011
9011
|
};
|
|
9012
9012
|
});
|
|
9013
9013
|
|
|
9014
|
-
var _excluded$
|
|
9014
|
+
var _excluded$J = ["children", "intent", "allowFontScaling", "typeface", "variant", "fontStyle"];
|
|
9015
9015
|
var Body = function Body(_ref) {
|
|
9016
9016
|
var children = _ref.children,
|
|
9017
9017
|
_ref$intent = _ref.intent,
|
|
@@ -9024,7 +9024,7 @@ var Body = function Body(_ref) {
|
|
|
9024
9024
|
variant = _ref$variant === void 0 ? 'regular' : _ref$variant,
|
|
9025
9025
|
_ref$fontStyle = _ref.fontStyle,
|
|
9026
9026
|
fontStyle = _ref$fontStyle === void 0 ? 'normal' : _ref$fontStyle,
|
|
9027
|
-
nativeProps = _objectWithoutProperties(_ref, _excluded$
|
|
9027
|
+
nativeProps = _objectWithoutProperties(_ref, _excluded$J);
|
|
9028
9028
|
return /*#__PURE__*/React__namespace.default.createElement(StyledBody$2, _extends$1({}, nativeProps, {
|
|
9029
9029
|
themeTypeface: typeface,
|
|
9030
9030
|
themeIntent: intent,
|
|
@@ -9647,11 +9647,11 @@ var Header = function Header(_ref) {
|
|
|
9647
9647
|
}))) : null), showDivider ? /*#__PURE__*/React__namespace.default.createElement(Divider, null) : null);
|
|
9648
9648
|
};
|
|
9649
9649
|
|
|
9650
|
-
var _excluded$
|
|
9650
|
+
var _excluded$I = ["scrollEventThrottle"];
|
|
9651
9651
|
var BottomSheetScrollView = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
9652
9652
|
var _ref$scrollEventThrot = _ref.scrollEventThrottle,
|
|
9653
9653
|
scrollEventThrottle = _ref$scrollEventThrot === void 0 ? 100 : _ref$scrollEventThrot,
|
|
9654
|
-
props = _objectWithoutProperties(_ref, _excluded$
|
|
9654
|
+
props = _objectWithoutProperties(_ref, _excluded$I);
|
|
9655
9655
|
var _useContext = React.useContext(BottomSheetContext),
|
|
9656
9656
|
setInternalShowDivider = _useContext.setInternalShowDivider;
|
|
9657
9657
|
var onScrollBeginDrag = React.useCallback(function (e) {
|
|
@@ -9984,7 +9984,7 @@ var borderWidths = {
|
|
|
9984
9984
|
var config = _objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2({}, colors), space), radii), borderWidths);
|
|
9985
9985
|
var flexPropsKey = ['alignContent', 'alignItems', 'alignSelf', 'display', 'flex', 'flexBasis', 'flexDirection', 'flexGrow', 'flexShrink', 'flexWrap', 'justifyContent'];
|
|
9986
9986
|
|
|
9987
|
-
var _excluded$
|
|
9987
|
+
var _excluded$H = ["theme"];
|
|
9988
9988
|
var getThemeValue = function getThemeValue(theme, key, props) {
|
|
9989
9989
|
var propConfig = config[key];
|
|
9990
9990
|
var propValue = props[key];
|
|
@@ -10011,18 +10011,18 @@ var mapStylePropToThemeValue = function mapStylePropToThemeValue(theme, props) {
|
|
|
10011
10011
|
var configKeys = Object.keys(config);
|
|
10012
10012
|
var StyledBox = index$c(reactNative.View)(function (_ref5) {
|
|
10013
10013
|
var theme = _ref5.theme,
|
|
10014
|
-
otherProps = _objectWithoutProperties(_ref5, _excluded$
|
|
10014
|
+
otherProps = _objectWithoutProperties(_ref5, _excluded$H);
|
|
10015
10015
|
var styleProps = pick(configKeys, otherProps);
|
|
10016
10016
|
var flexProps = pick(_toConsumableArray(flexPropsKey), otherProps);
|
|
10017
10017
|
return _objectSpread2(_objectSpread2({}, mapStylePropToThemeValue(theme, styleProps)), flexProps);
|
|
10018
10018
|
});
|
|
10019
10019
|
|
|
10020
|
-
var _excluded$
|
|
10020
|
+
var _excluded$G = ["children", "style", "testID"];
|
|
10021
10021
|
var Box = function Box(_ref) {
|
|
10022
10022
|
var children = _ref.children,
|
|
10023
10023
|
style = _ref.style,
|
|
10024
10024
|
testID = _ref.testID,
|
|
10025
|
-
otherProps = _objectWithoutProperties(_ref, _excluded$
|
|
10025
|
+
otherProps = _objectWithoutProperties(_ref, _excluded$G);
|
|
10026
10026
|
return /*#__PURE__*/React__namespace.default.createElement(StyledBox, _extends$1({}, otherProps, {
|
|
10027
10027
|
style: style,
|
|
10028
10028
|
testID: testID
|
|
@@ -10160,7 +10160,7 @@ var StyledErrorAndMaxLengthContainer = index$c(reactNative.View)(function (_ref1
|
|
|
10160
10160
|
};
|
|
10161
10161
|
});
|
|
10162
10162
|
|
|
10163
|
-
var _excluded$
|
|
10163
|
+
var _excluded$F = ["label", "prefix", "suffix", "style", "textStyle", "testID", "accessibilityLabelledBy", "error", "required", "editable", "disabled", "loading", "maxLength", "hideCharacterCount", "helpText", "value", "defaultValue", "renderInputValue", "allowFontScaling", "variant"];
|
|
10164
10164
|
var getState$4 = function getState(_ref) {
|
|
10165
10165
|
var disabled = _ref.disabled,
|
|
10166
10166
|
error = _ref.error,
|
|
@@ -10280,7 +10280,7 @@ var TextInput$1 = /*#__PURE__*/React.forwardRef(function (_ref8, ref) {
|
|
|
10280
10280
|
allowFontScaling = _ref8$allowFontScalin === void 0 ? false : _ref8$allowFontScalin,
|
|
10281
10281
|
_ref8$variant = _ref8.variant,
|
|
10282
10282
|
variant = _ref8$variant === void 0 ? 'text' : _ref8$variant,
|
|
10283
|
-
nativeProps = _objectWithoutProperties(_ref8, _excluded$
|
|
10283
|
+
nativeProps = _objectWithoutProperties(_ref8, _excluded$F);
|
|
10284
10284
|
var displayText = getDisplayText(value, defaultValue);
|
|
10285
10285
|
var isEmptyValue = displayText.length === 0;
|
|
10286
10286
|
var _React$useState = React__namespace.default.useState({
|
|
@@ -10758,14 +10758,14 @@ var AnimatedSpinner = function AnimatedSpinner(_ref) {
|
|
|
10758
10758
|
}, dotProps))));
|
|
10759
10759
|
};
|
|
10760
10760
|
|
|
10761
|
-
var _excluded$
|
|
10761
|
+
var _excluded$E = ["testID", "size", "intent"];
|
|
10762
10762
|
var Spinner = function Spinner(_ref) {
|
|
10763
10763
|
var testID = _ref.testID,
|
|
10764
10764
|
_ref$size = _ref.size,
|
|
10765
10765
|
size = _ref$size === void 0 ? 'medium' : _ref$size,
|
|
10766
10766
|
_ref$intent = _ref.intent,
|
|
10767
10767
|
intent = _ref$intent === void 0 ? 'primary' : _ref$intent,
|
|
10768
|
-
nativeProps = _objectWithoutProperties(_ref, _excluded$
|
|
10768
|
+
nativeProps = _objectWithoutProperties(_ref, _excluded$E);
|
|
10769
10769
|
return /*#__PURE__*/React__namespace.default.createElement(StyledView$2, nativeProps, /*#__PURE__*/React__namespace.default.createElement(StyledSpinnerContainer, {
|
|
10770
10770
|
testID: testID
|
|
10771
10771
|
}, /*#__PURE__*/React__namespace.default.createElement(AnimatedSpinner, {
|
|
@@ -10774,7 +10774,7 @@ var Spinner = function Spinner(_ref) {
|
|
|
10774
10774
|
})));
|
|
10775
10775
|
};
|
|
10776
10776
|
|
|
10777
|
-
var _excluded$
|
|
10777
|
+
var _excluded$D = ["keyExtractor", "loading", "onEndReached", "onQueryChange", "sections", "renderItem", "sectionListRef"];
|
|
10778
10778
|
var BaseOptionList = function BaseOptionList(_ref) {
|
|
10779
10779
|
var keyExtractor = _ref.keyExtractor,
|
|
10780
10780
|
loading = _ref.loading,
|
|
@@ -10783,7 +10783,7 @@ var BaseOptionList = function BaseOptionList(_ref) {
|
|
|
10783
10783
|
sections = _ref.sections,
|
|
10784
10784
|
renderItem = _ref.renderItem,
|
|
10785
10785
|
sectionListRef = _ref.sectionListRef,
|
|
10786
|
-
rest = _objectWithoutProperties(_ref, _excluded$
|
|
10786
|
+
rest = _objectWithoutProperties(_ref, _excluded$D);
|
|
10787
10787
|
var theme = useTheme$1();
|
|
10788
10788
|
var _useState = React.useState(false),
|
|
10789
10789
|
_useState2 = _slicedToArray(_useState, 2),
|
|
@@ -11050,7 +11050,7 @@ var isOptionSelected = function isOptionSelected(value, option) {
|
|
|
11050
11050
|
});
|
|
11051
11051
|
};
|
|
11052
11052
|
|
|
11053
|
-
var _excluded$
|
|
11053
|
+
var _excluded$C = ["keyExtractor", "loading", "onEndReached", "onPress", "onQueryChange", "sections", "renderOption", "value", "sectionListRef"];
|
|
11054
11054
|
var OptionList$1 = function OptionList(_ref) {
|
|
11055
11055
|
var keyExtractor = _ref.keyExtractor,
|
|
11056
11056
|
loading = _ref.loading,
|
|
@@ -11061,7 +11061,7 @@ var OptionList$1 = function OptionList(_ref) {
|
|
|
11061
11061
|
renderOption = _ref.renderOption,
|
|
11062
11062
|
value = _ref.value,
|
|
11063
11063
|
sectionListRef = _ref.sectionListRef,
|
|
11064
|
-
rest = _objectWithoutProperties(_ref, _excluded$
|
|
11064
|
+
rest = _objectWithoutProperties(_ref, _excluded$C);
|
|
11065
11065
|
var renderItem = function renderItem(info) {
|
|
11066
11066
|
var item = info.item;
|
|
11067
11067
|
var selected = isOptionSelected(value, item);
|
|
@@ -11096,7 +11096,7 @@ var OptionList$1 = function OptionList(_ref) {
|
|
|
11096
11096
|
}, rest));
|
|
11097
11097
|
};
|
|
11098
11098
|
|
|
11099
|
-
var _excluded$
|
|
11099
|
+
var _excluded$B = ["footerLabel", "label", "loading", "inputProps", "onConfirm", "onDismiss", "onEndReached", "onQueryChange", "options", "renderOption", "renderSelectedValue", "query", "error", "editable", "disabled", "required", "style", "testID", "value", "supportedOrientations", "bottomSheetConfig", "groupStyleEnabled"];
|
|
11100
11100
|
|
|
11101
11101
|
// Add an internal prop type for TextInputComponent, not exported
|
|
11102
11102
|
|
|
@@ -11129,7 +11129,7 @@ function MultiSelect$1(_ref) {
|
|
|
11129
11129
|
bottomSheetConfig = _ref$bottomSheetConfi === void 0 ? {} : _ref$bottomSheetConfi,
|
|
11130
11130
|
_ref$groupStyleEnable = _ref.groupStyleEnabled,
|
|
11131
11131
|
groupStyleEnabled = _ref$groupStyleEnable === void 0 ? false : _ref$groupStyleEnable,
|
|
11132
|
-
rest = _objectWithoutProperties(_ref, _excluded$
|
|
11132
|
+
rest = _objectWithoutProperties(_ref, _excluded$B);
|
|
11133
11133
|
var _useKeyboard = useKeyboard(),
|
|
11134
11134
|
isKeyboardVisible = _useKeyboard.isKeyboardVisible,
|
|
11135
11135
|
keyboardHeight = _useKeyboard.keyboardHeight;
|
|
@@ -11269,7 +11269,7 @@ var StyledOptionList = index$c(BaseOptionList)(function (_ref) {
|
|
|
11269
11269
|
};
|
|
11270
11270
|
});
|
|
11271
11271
|
|
|
11272
|
-
var _excluded$
|
|
11272
|
+
var _excluded$A = ["keyExtractor", "loading", "onEndReached", "onPress", "onQueryChange", "sections", "renderOption", "value", "sectionListRef"];
|
|
11273
11273
|
var OptionList = function OptionList(_ref) {
|
|
11274
11274
|
var keyExtractor = _ref.keyExtractor,
|
|
11275
11275
|
loading = _ref.loading,
|
|
@@ -11280,7 +11280,7 @@ var OptionList = function OptionList(_ref) {
|
|
|
11280
11280
|
renderOption = _ref.renderOption,
|
|
11281
11281
|
value = _ref.value,
|
|
11282
11282
|
sectionListRef = _ref.sectionListRef,
|
|
11283
|
-
rest = _objectWithoutProperties(_ref, _excluded$
|
|
11283
|
+
rest = _objectWithoutProperties(_ref, _excluded$A);
|
|
11284
11284
|
var renderItem = function renderItem(info) {
|
|
11285
11285
|
var item = info.item;
|
|
11286
11286
|
var selected = _deepCompareValue(item.value, value);
|
|
@@ -11316,7 +11316,7 @@ var OptionList = function OptionList(_ref) {
|
|
|
11316
11316
|
}, rest));
|
|
11317
11317
|
};
|
|
11318
11318
|
|
|
11319
|
-
var _excluded$
|
|
11319
|
+
var _excluded$z = ["label", "loading", "inputProps", "onConfirm", "onDismiss", "onEndReached", "onQueryChange", "options", "renderOption", "renderSelectedValue", "query", "error", "editable", "disabled", "required", "style", "testID", "value", "supportedOrientations", "bottomSheetConfig", "groupStyleEnabled"];
|
|
11320
11320
|
|
|
11321
11321
|
// Add an internal prop type for TextInputComponent, not exported
|
|
11322
11322
|
|
|
@@ -11349,7 +11349,7 @@ var SingleSelect$1 = function SingleSelect(_ref) {
|
|
|
11349
11349
|
bottomSheetConfig = _ref$bottomSheetConfi === void 0 ? {} : _ref$bottomSheetConfi,
|
|
11350
11350
|
_ref$groupStyleEnable = _ref.groupStyleEnabled,
|
|
11351
11351
|
groupStyleEnabled = _ref$groupStyleEnable === void 0 ? false : _ref$groupStyleEnable,
|
|
11352
|
-
rest = _objectWithoutProperties(_ref, _excluded$
|
|
11352
|
+
rest = _objectWithoutProperties(_ref, _excluded$z);
|
|
11353
11353
|
var _useKeyboard = useKeyboard(),
|
|
11354
11354
|
isKeyboardVisible = _useKeyboard.isKeyboardVisible,
|
|
11355
11355
|
keyboardHeight = _useKeyboard.keyboardHeight;
|
|
@@ -14988,13 +14988,13 @@ var DatePickerIOS = function DatePickerIOS(_ref) {
|
|
|
14988
14988
|
}));
|
|
14989
14989
|
};
|
|
14990
14990
|
|
|
14991
|
-
var _excluded$
|
|
14991
|
+
var _excluded$y = ["variant", "TextInputComponent"];
|
|
14992
14992
|
var DatePicker$1 = function DatePicker(_ref) {
|
|
14993
14993
|
var _ref$variant = _ref.variant,
|
|
14994
14994
|
variant = _ref$variant === void 0 ? 'default' : _ref$variant,
|
|
14995
14995
|
_ref$TextInputCompone = _ref.TextInputComponent,
|
|
14996
14996
|
TextInputComponent = _ref$TextInputCompone === void 0 ? TextInput$1 : _ref$TextInputCompone,
|
|
14997
|
-
props = _objectWithoutProperties(_ref, _excluded$
|
|
14997
|
+
props = _objectWithoutProperties(_ref, _excluded$y);
|
|
14998
14998
|
if (variant === 'calendar') {
|
|
14999
14999
|
return /*#__PURE__*/React__namespace.default.createElement(DatePickerCalendar, _extends$1({}, props, {
|
|
15000
15000
|
TextInputComponent: TextInputComponent
|
|
@@ -15352,7 +15352,7 @@ var AccordionItem = function AccordionItem(_ref) {
|
|
|
15352
15352
|
}, content));
|
|
15353
15353
|
};
|
|
15354
15354
|
|
|
15355
|
-
var _excluded$
|
|
15355
|
+
var _excluded$x = ["key"];
|
|
15356
15356
|
var Accordion = function Accordion(_ref) {
|
|
15357
15357
|
var items = _ref.items,
|
|
15358
15358
|
activeItemKey = _ref.activeItemKey,
|
|
@@ -15375,7 +15375,7 @@ var Accordion = function Accordion(_ref) {
|
|
|
15375
15375
|
accessible: accessible
|
|
15376
15376
|
}, items.map(function (_ref2, index) {
|
|
15377
15377
|
var key = _ref2.key,
|
|
15378
|
-
props = _objectWithoutProperties(_ref2, _excluded$
|
|
15378
|
+
props = _objectWithoutProperties(_ref2, _excluded$x);
|
|
15379
15379
|
var open = _activeItemKey === key;
|
|
15380
15380
|
return /*#__PURE__*/React__namespace.default.createElement(React__namespace.default.Fragment, {
|
|
15381
15381
|
key: key
|
|
@@ -16300,7 +16300,7 @@ var StyledIcon$4 = index$c(Icon)(function (_ref6) {
|
|
|
16300
16300
|
};
|
|
16301
16301
|
});
|
|
16302
16302
|
|
|
16303
|
-
var _excluded$
|
|
16303
|
+
var _excluded$w = ["children", "visible", "intent", "style", "testID"];
|
|
16304
16304
|
var Status$1 = function Status(_ref) {
|
|
16305
16305
|
var children = _ref.children,
|
|
16306
16306
|
_ref$visible = _ref.visible,
|
|
@@ -16309,7 +16309,7 @@ var Status$1 = function Status(_ref) {
|
|
|
16309
16309
|
intent = _ref$intent === void 0 ? 'danger' : _ref$intent,
|
|
16310
16310
|
style = _ref.style,
|
|
16311
16311
|
testID = _ref.testID,
|
|
16312
|
-
nativeProps = _objectWithoutProperties(_ref, _excluded$
|
|
16312
|
+
nativeProps = _objectWithoutProperties(_ref, _excluded$w);
|
|
16313
16313
|
var _React$useRef = React__namespace.default.useRef(new reactNative.Animated.Value(visible ? 1 : 0)),
|
|
16314
16314
|
opacity = _React$useRef.current;
|
|
16315
16315
|
var isFirstRendering = React__namespace.default.useRef(true);
|
|
@@ -16345,7 +16345,7 @@ var Status$1 = function Status(_ref) {
|
|
|
16345
16345
|
|
|
16346
16346
|
var DEFAULT_MAX_NUMBER = 99;
|
|
16347
16347
|
|
|
16348
|
-
var _excluded$
|
|
16348
|
+
var _excluded$v = ["children", "visible", "style", "max", "testID", "content"];
|
|
16349
16349
|
var Status = function Status(_ref) {
|
|
16350
16350
|
var children = _ref.children,
|
|
16351
16351
|
_ref$visible = _ref.visible,
|
|
@@ -16355,7 +16355,7 @@ var Status = function Status(_ref) {
|
|
|
16355
16355
|
max = _ref$max === void 0 ? DEFAULT_MAX_NUMBER : _ref$max,
|
|
16356
16356
|
testID = _ref.testID,
|
|
16357
16357
|
originalContent = _ref.content,
|
|
16358
|
-
nativeProps = _objectWithoutProperties(_ref, _excluded$
|
|
16358
|
+
nativeProps = _objectWithoutProperties(_ref, _excluded$v);
|
|
16359
16359
|
var content = React.useMemo(function () {
|
|
16360
16360
|
return originalContent > max ? "".concat(max, "+") : String(originalContent);
|
|
16361
16361
|
}, [originalContent, max]);
|
|
@@ -16367,7 +16367,7 @@ var Status = function Status(_ref) {
|
|
|
16367
16367
|
}, /*#__PURE__*/React__namespace.default.createElement(StyledCountText, null, content)));
|
|
16368
16368
|
};
|
|
16369
16369
|
|
|
16370
|
-
var _excluded$
|
|
16370
|
+
var _excluded$u = ["content", "visible", "max", "intent", "style", "testID", "size", "variant", "icon"];
|
|
16371
16371
|
var getPaddingState = function getPaddingState(content) {
|
|
16372
16372
|
return content.length > 1 ? 'wideContent' : 'narrowContent';
|
|
16373
16373
|
};
|
|
@@ -16386,7 +16386,7 @@ var Badge = function Badge(_ref) {
|
|
|
16386
16386
|
_ref$variant = _ref.variant,
|
|
16387
16387
|
variant = _ref$variant === void 0 ? 'filled' : _ref$variant,
|
|
16388
16388
|
icon = _ref.icon,
|
|
16389
|
-
nativeProps = _objectWithoutProperties(_ref, _excluded$
|
|
16389
|
+
nativeProps = _objectWithoutProperties(_ref, _excluded$u);
|
|
16390
16390
|
var _React$useRef = React__namespace.default.useRef(new reactNative.Animated.Value(visible ? 1 : 0)),
|
|
16391
16391
|
opacity = _React$useRef.current;
|
|
16392
16392
|
var isFirstRendering = React__namespace.default.useRef(true);
|
|
@@ -16478,14 +16478,14 @@ var BottomBarItem = index$c(reactNative.View)({
|
|
|
16478
16478
|
flex: 1,
|
|
16479
16479
|
alignItems: 'center'
|
|
16480
16480
|
});
|
|
16481
|
-
var StyledBottomBarText = index$c(Typography.
|
|
16481
|
+
var StyledBottomBarText = index$c(Typography.Label)(function (_ref3) {
|
|
16482
16482
|
var theme = _ref3.theme;
|
|
16483
16483
|
return {
|
|
16484
16484
|
marginTop: theme.__hd__.bottomNavigation.space.titleMarginTop
|
|
16485
16485
|
};
|
|
16486
16486
|
});
|
|
16487
16487
|
|
|
16488
|
-
var _excluded$
|
|
16488
|
+
var _excluded$t = ["onTabPress", "renderActiveTabOnly", "selectedTabKey", "tabs"];
|
|
16489
16489
|
var getInactiveIcon = function getInactiveIcon(icon) {
|
|
16490
16490
|
var inactiveIcon = "".concat(icon, "-outlined");
|
|
16491
16491
|
return isHeroIcon(inactiveIcon) ? inactiveIcon : icon;
|
|
@@ -16496,7 +16496,7 @@ var BottomNavigation = function BottomNavigation(_ref) {
|
|
|
16496
16496
|
renderActiveTabOnly = _ref$renderActiveTabO === void 0 ? false : _ref$renderActiveTabO,
|
|
16497
16497
|
selectedTabKey = _ref.selectedTabKey,
|
|
16498
16498
|
tabs = _ref.tabs,
|
|
16499
|
-
nativeProps = _objectWithoutProperties(_ref, _excluded$
|
|
16499
|
+
nativeProps = _objectWithoutProperties(_ref, _excluded$t);
|
|
16500
16500
|
var insets = reactNativeSafeAreaContext.useSafeAreaInsets();
|
|
16501
16501
|
|
|
16502
16502
|
/**
|
|
@@ -16554,11 +16554,10 @@ var BottomNavigation = function BottomNavigation(_ref) {
|
|
|
16554
16554
|
testID: testID
|
|
16555
16555
|
}, /*#__PURE__*/React__namespace.default.createElement(BottomBarItem, null, /*#__PURE__*/React__namespace.default.createElement(Icon, {
|
|
16556
16556
|
icon: active ? icon : inactiveIcon,
|
|
16557
|
-
intent: active ? 'primary' : '
|
|
16557
|
+
intent: active ? 'primary' : 'muted',
|
|
16558
16558
|
testID: "hero-icon-".concat(icon)
|
|
16559
16559
|
}), !!title && /*#__PURE__*/React__namespace.default.createElement(StyledBottomBarText, {
|
|
16560
|
-
|
|
16561
|
-
intent: active ? 'primary' : 'body',
|
|
16560
|
+
intent: active ? 'primary' : 'muted',
|
|
16562
16561
|
numberOfLines: 1
|
|
16563
16562
|
}, title)));
|
|
16564
16563
|
}))));
|
|
@@ -16590,12 +16589,12 @@ var Indicator = index$c(reactNative.View)(function (_ref3) {
|
|
|
16590
16589
|
};
|
|
16591
16590
|
});
|
|
16592
16591
|
|
|
16593
|
-
var _excluded$
|
|
16592
|
+
var _excluded$s = ["intent", "children"];
|
|
16594
16593
|
var DataCard = function DataCard(_ref) {
|
|
16595
16594
|
var _ref$intent = _ref.intent,
|
|
16596
16595
|
intent = _ref$intent === void 0 ? 'info' : _ref$intent,
|
|
16597
16596
|
children = _ref.children,
|
|
16598
|
-
nativeProps = _objectWithoutProperties(_ref, _excluded$
|
|
16597
|
+
nativeProps = _objectWithoutProperties(_ref, _excluded$s);
|
|
16599
16598
|
return /*#__PURE__*/React__namespace.default.createElement(StyledDataCard, nativeProps, /*#__PURE__*/React__namespace.default.createElement(Indicator, {
|
|
16600
16599
|
themeIntent: intent,
|
|
16601
16600
|
testID: "data-card-indicator"
|
|
@@ -16614,13 +16613,13 @@ var StyledCard$1 = index$c(reactNative.View)(function (_ref) {
|
|
|
16614
16613
|
});
|
|
16615
16614
|
});
|
|
16616
16615
|
|
|
16617
|
-
var _excluded$
|
|
16616
|
+
var _excluded$r = ["intent", "children", "variant"];
|
|
16618
16617
|
var Card = function Card(_ref) {
|
|
16619
16618
|
var intent = _ref.intent,
|
|
16620
16619
|
children = _ref.children,
|
|
16621
16620
|
_ref$variant = _ref.variant,
|
|
16622
16621
|
variant = _ref$variant === void 0 ? 'basic' : _ref$variant,
|
|
16623
|
-
nativeProps = _objectWithoutProperties(_ref, _excluded$
|
|
16622
|
+
nativeProps = _objectWithoutProperties(_ref, _excluded$r);
|
|
16624
16623
|
return /*#__PURE__*/React__namespace.default.createElement(StyledCard$1, _extends$1({}, nativeProps, {
|
|
16625
16624
|
themeIntent: intent,
|
|
16626
16625
|
themeVariant: variant
|
|
@@ -16889,7 +16888,7 @@ var CardCarousel = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
|
16889
16888
|
});
|
|
16890
16889
|
CardCarousel.displayName = 'CardCarousel';
|
|
16891
16890
|
|
|
16892
|
-
var _excluded$
|
|
16891
|
+
var _excluded$q = ["rounded", "size", "testID", "style"];
|
|
16893
16892
|
/**
|
|
16894
16893
|
* @deprecated Image component will soon be deprecated. Please use `Image` from `react-native` instead.
|
|
16895
16894
|
*/
|
|
@@ -16900,7 +16899,7 @@ var Image = function Image(_ref) {
|
|
|
16900
16899
|
size = _ref$size === void 0 ? '6xlarge' : _ref$size,
|
|
16901
16900
|
testID = _ref.testID,
|
|
16902
16901
|
style = _ref.style,
|
|
16903
|
-
imageNativeProps = _objectWithoutProperties(_ref, _excluded$
|
|
16902
|
+
imageNativeProps = _objectWithoutProperties(_ref, _excluded$q);
|
|
16904
16903
|
useDeprecation('Image component will soon be deprecated. Please use `Image` from `react-native` instead.');
|
|
16905
16904
|
var theme = useTheme();
|
|
16906
16905
|
var imageSize = theme.__hd__.image.sizes[size];
|
|
@@ -17035,7 +17034,7 @@ var CarouselItem = function CarouselItem(_ref) {
|
|
|
17035
17034
|
}, heading), !!body && /*#__PURE__*/React__namespace.default.createElement(Typography.Body, null, body)));
|
|
17036
17035
|
};
|
|
17037
17036
|
|
|
17038
|
-
var _excluded$
|
|
17037
|
+
var _excluded$p = ["items", "onItemIndexChange", "renderActions", "selectedItemIndex", "style", "shouldShowPagination", "testID", "pageControlPosition"];
|
|
17039
17038
|
function useStateFromProp(initialValue) {
|
|
17040
17039
|
var _useState = React.useState(initialValue),
|
|
17041
17040
|
_useState2 = _slicedToArray(_useState, 2),
|
|
@@ -17062,7 +17061,7 @@ var Carousel = function Carousel(_ref) {
|
|
|
17062
17061
|
testID = _ref.testID,
|
|
17063
17062
|
_ref$pageControlPosit = _ref.pageControlPosition,
|
|
17064
17063
|
pageControlPosition = _ref$pageControlPosit === void 0 ? 'top' : _ref$pageControlPosit,
|
|
17065
|
-
nativeProps = _objectWithoutProperties(_ref, _excluded$
|
|
17064
|
+
nativeProps = _objectWithoutProperties(_ref, _excluded$p);
|
|
17066
17065
|
useDeprecation("shouldShowPagination prop has been deprecated", shouldShowPagination !== noop$1);
|
|
17067
17066
|
useDeprecation("The use of 'pageControlPosition == bottom' has been deprecated", pageControlPosition === 'bottom');
|
|
17068
17067
|
var theme = useTheme();
|
|
@@ -22202,7 +22201,7 @@ var StyledChipIcon = index$c(Icon)(function (_ref2) {
|
|
|
22202
22201
|
};
|
|
22203
22202
|
});
|
|
22204
22203
|
|
|
22205
|
-
var _excluded$
|
|
22204
|
+
var _excluded$o = ["label", "variant", "selected", "icon", "onPress", "showSelectedIcon", "accessible"];
|
|
22206
22205
|
|
|
22207
22206
|
/**
|
|
22208
22207
|
* @deprecated Use 'selection' | 'filter' | 'compact' | 'compact-outlined' instead.
|
|
@@ -22241,7 +22240,7 @@ var Chip = function Chip(_ref) {
|
|
|
22241
22240
|
_ref$showSelectedIcon = _ref.showSelectedIcon,
|
|
22242
22241
|
showSelectedIcon = _ref$showSelectedIcon === void 0 ? true : _ref$showSelectedIcon,
|
|
22243
22242
|
accessible = _ref.accessible,
|
|
22244
|
-
otherProps = _objectWithoutProperties(_ref, _excluded$
|
|
22243
|
+
otherProps = _objectWithoutProperties(_ref, _excluded$o);
|
|
22245
22244
|
useDeprecation('Chip variant `outlined` and `filled` are deprecated.', variant === 'outlined' || variant === 'filled');
|
|
22246
22245
|
var renamedVariant = getChipVariant(variant);
|
|
22247
22246
|
var shouldShowSelectedIcon = (renamedVariant === 'selection' || renamedVariant === 'compact-outlined') && selected && showSelectedIcon;
|
|
@@ -24308,15 +24307,16 @@ var Portal$1 = Object.assign(Portal, {
|
|
|
24308
24307
|
Host: PortalHost
|
|
24309
24308
|
});
|
|
24310
24309
|
|
|
24311
|
-
var _excluded$o = ["visible"];
|
|
24312
24310
|
var DEFAULT_BACKDROP_OPACITY = 0.4;
|
|
24313
24311
|
var DEFAULT_ANIMATION_CONFIG = {
|
|
24314
24312
|
easing: reactNative.Easing.inOut(reactNative.Easing.cubic),
|
|
24315
24313
|
useNativeDriver: reactNative.Platform.OS !== 'web',
|
|
24316
24314
|
duration: 400
|
|
24317
24315
|
};
|
|
24318
|
-
var Modal =
|
|
24316
|
+
var Modal = function Modal(_ref) {
|
|
24319
24317
|
var children = _ref.children,
|
|
24318
|
+
_ref$visible = _ref.visible,
|
|
24319
|
+
visible = _ref$visible === void 0 ? true : _ref$visible,
|
|
24320
24320
|
onShow = _ref.onShow,
|
|
24321
24321
|
onRequestClose = _ref.onRequestClose,
|
|
24322
24322
|
testID = _ref.testID,
|
|
@@ -24328,59 +24328,60 @@ var Modal = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
|
24328
24328
|
var theme = useTheme();
|
|
24329
24329
|
var animatedBackdropValue = React.useRef(new reactNative.Animated.Value(0)).current;
|
|
24330
24330
|
var animatedModalValue = React.useRef(new reactNative.Animated.Value(0)).current;
|
|
24331
|
+
var _useState = React.useState(visible),
|
|
24332
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
24333
|
+
mounted = _useState2[0],
|
|
24334
|
+
setMounted = _useState2[1];
|
|
24335
|
+
var previousVisible = React.useRef(false);
|
|
24331
24336
|
|
|
24332
|
-
//
|
|
24333
|
-
|
|
24334
|
-
|
|
24335
|
-
|
|
24336
|
-
|
|
24337
|
-
|
|
24338
|
-
|
|
24339
|
-
|
|
24340
|
-
|
|
24341
|
-
|
|
24342
|
-
|
|
24343
|
-
|
|
24344
|
-
|
|
24345
|
-
|
|
24346
|
-
|
|
24347
|
-
}, DEFAULT_ANIMATION_CONFIG)).start(callback);
|
|
24348
|
-
} else {
|
|
24349
|
-
callback === null || callback === void 0 || callback();
|
|
24350
|
-
}
|
|
24351
|
-
}, [animationType, onShow, transparent]);
|
|
24352
|
-
var backdropOpacityAnimation = animatedBackdropValue.interpolate({
|
|
24353
|
-
inputRange: [0, 1],
|
|
24354
|
-
outputRange: [0, DEFAULT_BACKDROP_OPACITY]
|
|
24355
|
-
});
|
|
24356
|
-
var modalAnimation = animatedModalValue.interpolate({
|
|
24357
|
-
inputRange: [0, 1],
|
|
24358
|
-
outputRange: animationType === 'slide' ? [reactNative.Dimensions.get('window').height, 0] : [0, 1]
|
|
24359
|
-
});
|
|
24360
|
-
React.useImperativeHandle(ref, function () {
|
|
24361
|
-
return {
|
|
24362
|
-
show: function show() {
|
|
24363
|
-
animateBackdropAndContent({
|
|
24364
|
-
toValue: 1,
|
|
24365
|
-
callback: onShow
|
|
24337
|
+
// Animate in/out based on visible prop
|
|
24338
|
+
React.useEffect(function () {
|
|
24339
|
+
if (visible && !previousVisible.current) {
|
|
24340
|
+
// Show animation
|
|
24341
|
+
setMounted(true);
|
|
24342
|
+
if (animationType !== 'none') {
|
|
24343
|
+
if (!transparent) {
|
|
24344
|
+
reactNative.Animated.timing(animatedBackdropValue, _objectSpread2({
|
|
24345
|
+
toValue: 1
|
|
24346
|
+
}, DEFAULT_ANIMATION_CONFIG)).start();
|
|
24347
|
+
}
|
|
24348
|
+
reactNative.Animated.timing(animatedModalValue, _objectSpread2({
|
|
24349
|
+
toValue: 1
|
|
24350
|
+
}, DEFAULT_ANIMATION_CONFIG)).start(function () {
|
|
24351
|
+
onShow === null || onShow === void 0 || onShow();
|
|
24366
24352
|
});
|
|
24367
|
-
}
|
|
24368
|
-
|
|
24369
|
-
|
|
24370
|
-
|
|
24371
|
-
|
|
24372
|
-
|
|
24373
|
-
|
|
24374
|
-
|
|
24375
|
-
|
|
24353
|
+
} else {
|
|
24354
|
+
onShow === null || onShow === void 0 || onShow();
|
|
24355
|
+
}
|
|
24356
|
+
} else if (!visible && previousVisible.current) {
|
|
24357
|
+
// Hide animation
|
|
24358
|
+
if (animationType !== 'none') {
|
|
24359
|
+
if (!transparent) {
|
|
24360
|
+
reactNative.Animated.timing(animatedBackdropValue, _objectSpread2({
|
|
24361
|
+
toValue: 0
|
|
24362
|
+
}, DEFAULT_ANIMATION_CONFIG)).start();
|
|
24363
|
+
}
|
|
24364
|
+
reactNative.Animated.timing(animatedModalValue, _objectSpread2({
|
|
24365
|
+
toValue: 0
|
|
24366
|
+
}, DEFAULT_ANIMATION_CONFIG)).start(function () {
|
|
24367
|
+
setMounted(false);
|
|
24368
|
+
if (reactNative.Platform.OS === 'ios') {
|
|
24369
|
+
onDismiss === null || onDismiss === void 0 || onDismiss();
|
|
24376
24370
|
}
|
|
24377
24371
|
});
|
|
24372
|
+
} else {
|
|
24373
|
+
setMounted(false);
|
|
24374
|
+
if (reactNative.Platform.OS === 'ios') {
|
|
24375
|
+
onDismiss === null || onDismiss === void 0 || onDismiss();
|
|
24376
|
+
}
|
|
24378
24377
|
}
|
|
24379
|
-
}
|
|
24380
|
-
|
|
24378
|
+
}
|
|
24379
|
+
previousVisible.current = visible;
|
|
24380
|
+
}, [visible, animationType, transparent, onShow, onDismiss]);
|
|
24381
24381
|
|
|
24382
24382
|
// Back button handler
|
|
24383
24383
|
React.useEffect(function () {
|
|
24384
|
+
if (!visible) return;
|
|
24384
24385
|
var backHandler = reactNative.BackHandler.addEventListener('hardwareBackPress', function () {
|
|
24385
24386
|
onRequestClose === null || onRequestClose === void 0 || onRequestClose();
|
|
24386
24387
|
return true;
|
|
@@ -24388,7 +24389,18 @@ var Modal = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
|
24388
24389
|
return function () {
|
|
24389
24390
|
return backHandler.remove();
|
|
24390
24391
|
};
|
|
24391
|
-
}, [onRequestClose]);
|
|
24392
|
+
}, [visible, onRequestClose]);
|
|
24393
|
+
var backdropOpacityAnimation = animatedBackdropValue.interpolate({
|
|
24394
|
+
inputRange: [0, 1],
|
|
24395
|
+
outputRange: [0, DEFAULT_BACKDROP_OPACITY]
|
|
24396
|
+
});
|
|
24397
|
+
var modalAnimation = animatedModalValue.interpolate({
|
|
24398
|
+
inputRange: [0, 1],
|
|
24399
|
+
outputRange: animationType === 'slide' ? [reactNative.Dimensions.get('window').height, 0] : [0, 1]
|
|
24400
|
+
});
|
|
24401
|
+
if (!visible && !mounted) {
|
|
24402
|
+
return null;
|
|
24403
|
+
}
|
|
24392
24404
|
return /*#__PURE__*/React__namespace.default.createElement(Portal$1, null, /*#__PURE__*/React__namespace.default.createElement(reactNative.Animated.View, {
|
|
24393
24405
|
style: _objectSpread2(_objectSpread2({}, reactNative.StyleSheet.absoluteFillObject), {}, {
|
|
24394
24406
|
backgroundColor: transparent ? 'transparent' : theme.colors.overlayGlobalSurface,
|
|
@@ -24403,39 +24415,9 @@ var Modal = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
|
24403
24415
|
}]
|
|
24404
24416
|
})
|
|
24405
24417
|
}, children));
|
|
24406
|
-
});
|
|
24407
|
-
var ModalWrapper = function ModalWrapper(_ref3) {
|
|
24408
|
-
var _ref3$visible = _ref3.visible,
|
|
24409
|
-
visible = _ref3$visible === void 0 ? true : _ref3$visible,
|
|
24410
|
-
props = _objectWithoutProperties(_ref3, _excluded$o);
|
|
24411
|
-
var modalRef = React.useRef(null);
|
|
24412
|
-
var _useState = React.useState(visible),
|
|
24413
|
-
_useState2 = _slicedToArray(_useState, 2),
|
|
24414
|
-
internalVisible = _useState2[0],
|
|
24415
|
-
setInternalVisible = _useState2[1];
|
|
24416
|
-
React.useEffect(function () {
|
|
24417
|
-
if (visible) {
|
|
24418
|
-
setInternalVisible(true);
|
|
24419
|
-
} else {
|
|
24420
|
-
var _modalRef$current;
|
|
24421
|
-
// Wait for animation to finish before hiding the modal
|
|
24422
|
-
(_modalRef$current = modalRef.current) === null || _modalRef$current === void 0 || _modalRef$current.hide(function () {
|
|
24423
|
-
return setInternalVisible(false);
|
|
24424
|
-
});
|
|
24425
|
-
}
|
|
24426
|
-
}, [visible]);
|
|
24427
|
-
React.useEffect(function () {
|
|
24428
|
-
if (internalVisible) {
|
|
24429
|
-
var _modalRef$current2;
|
|
24430
|
-
(_modalRef$current2 = modalRef.current) === null || _modalRef$current2 === void 0 || _modalRef$current2.show();
|
|
24431
|
-
}
|
|
24432
|
-
}, [internalVisible]);
|
|
24433
|
-
return internalVisible ? /*#__PURE__*/React__namespace.default.createElement(Modal, _extends$1({
|
|
24434
|
-
ref: modalRef
|
|
24435
|
-
}, props)) : null;
|
|
24436
24418
|
};
|
|
24437
24419
|
|
|
24438
|
-
var StyledErrorModal = index$c(
|
|
24420
|
+
var StyledErrorModal = index$c(Modal)({
|
|
24439
24421
|
height: '100%',
|
|
24440
24422
|
width: '100%'
|
|
24441
24423
|
});
|
|
@@ -27092,7 +27074,7 @@ var StyledSuccessButtonSecondary = index$c(CompoundButton)(function (_ref10) {
|
|
|
27092
27074
|
marginTop: theme.__hd__.success.space.button.secondaryCTAMarginTop
|
|
27093
27075
|
};
|
|
27094
27076
|
});
|
|
27095
|
-
var StyledSuccessModal = index$c(
|
|
27077
|
+
var StyledSuccessModal = index$c(Modal)({
|
|
27096
27078
|
height: '100%',
|
|
27097
27079
|
width: '100%'
|
|
27098
27080
|
});
|
|
@@ -27840,10 +27822,10 @@ var ScrollableTabHeader = function ScrollableTabHeader(_ref2) {
|
|
|
27840
27822
|
badge = tab.badge;
|
|
27841
27823
|
var active = selectedIndex === index;
|
|
27842
27824
|
var activeAnimated = tabsAnims[index];
|
|
27843
|
-
var outlineScale =
|
|
27825
|
+
var outlineScale = activeAnimated.interpolate({
|
|
27844
27826
|
inputRange: [0, 1],
|
|
27845
27827
|
outputRange: [0.5, 1]
|
|
27846
|
-
})
|
|
27828
|
+
});
|
|
27847
27829
|
var inactiveItem = originalInactiveItem !== null && originalInactiveItem !== void 0 ? originalInactiveItem : activeItem;
|
|
27848
27830
|
var tabItem = getTabItem$1({
|
|
27849
27831
|
item: active ? activeItem : inactiveItem,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hero-design/rn-work-uikit",
|
|
3
|
-
"version": "1.9.
|
|
3
|
+
"version": "1.9.5",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"module": "es/index.js",
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
"type-check": "tsc --noEmit",
|
|
12
12
|
"test": "jest --runInBand",
|
|
13
13
|
"test:watch": "jest --runInBand --watch",
|
|
14
|
-
"test:ci": "jest --c=jest-ci.config.js --i --logHeapUsage --coverage
|
|
14
|
+
"test:ci": "jest --c=jest-ci.config.js --i --logHeapUsage --coverage",
|
|
15
15
|
"build:js": "rollup -c",
|
|
16
16
|
"build:types": "rollup -c rollup.config.mjs --configPlugin dts",
|
|
17
17
|
"build": "yarn build:js && yarn build:types",
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
"dependencies": {
|
|
23
23
|
"@emotion/native": "^11.9.3",
|
|
24
24
|
"@emotion/react": "^11.9.3",
|
|
25
|
-
"@hero-design/rn": "^8.113.
|
|
25
|
+
"@hero-design/rn": "^8.113.1",
|
|
26
26
|
"hero-editor": "^1.17.0"
|
|
27
27
|
},
|
|
28
28
|
"peerDependencies": {
|
|
@@ -66,7 +66,7 @@
|
|
|
66
66
|
"@rollup/plugin-replace": "^6.0.1",
|
|
67
67
|
"@rollup/plugin-typescript": "^12.1.1",
|
|
68
68
|
"@testing-library/jest-native": "^5.4.2",
|
|
69
|
-
"@testing-library/react-native": "^
|
|
69
|
+
"@testing-library/react-native": "^13.0.0",
|
|
70
70
|
"@types/jest": "^29.5.3",
|
|
71
71
|
"@types/react": "^18.2.0",
|
|
72
72
|
"@types/react-native-vector-icons": "^6.4.10",
|
|
@@ -91,7 +91,7 @@
|
|
|
91
91
|
"react-native-svg": "15.8.0",
|
|
92
92
|
"react-native-vector-icons": "^9.1.0",
|
|
93
93
|
"react-native-webview": "^13.16.0",
|
|
94
|
-
"react-test-renderer": "18.
|
|
94
|
+
"react-test-renderer": "18.3.1",
|
|
95
95
|
"rollup": "^4.24.3",
|
|
96
96
|
"rollup-plugin-copy": "^3.5.0",
|
|
97
97
|
"rollup-plugin-delete": "^3.0.1",
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { ReactElement } from 'react';
|
|
1
2
|
import React, { useCallback, useEffect, useState } from 'react';
|
|
2
3
|
import { View } from 'react-native';
|
|
3
4
|
import { useTheme } from '../../theme';
|
|
@@ -26,7 +27,7 @@ export interface MentionListProps<TMetaData = unknown> {
|
|
|
26
27
|
name: string,
|
|
27
28
|
options?: OnSelectOptionsType<TMetaData>
|
|
28
29
|
) => void
|
|
29
|
-
) =>
|
|
30
|
+
) => ReactElement;
|
|
30
31
|
}
|
|
31
32
|
|
|
32
33
|
const MentionList = <TMetaData,>({
|
|
@@ -5,15 +5,15 @@ import FloatingLabel from '../FloatingLabel';
|
|
|
5
5
|
describe('FloatingLabel', () => {
|
|
6
6
|
describe('label text display based on required prop', () => {
|
|
7
7
|
it.each`
|
|
8
|
-
required |
|
|
9
|
-
${true} | ${'Email'}
|
|
10
|
-
${false} | ${'Phone'}
|
|
8
|
+
required | label | expectedText
|
|
9
|
+
${true} | ${'Email'} | ${'Email'}
|
|
10
|
+
${false} | ${'Phone'} | ${'Phone (Optional)'}
|
|
11
11
|
`(
|
|
12
12
|
'should display "$expectedText" with "$optionalText" when required is $required',
|
|
13
|
-
({ required, expectedText,
|
|
14
|
-
const { getByTestId
|
|
13
|
+
({ required, expectedText, label }) => {
|
|
14
|
+
const { getByTestId } = renderWithTheme(
|
|
15
15
|
<FloatingLabel
|
|
16
|
-
label={
|
|
16
|
+
label={label}
|
|
17
17
|
variant="text"
|
|
18
18
|
state="default"
|
|
19
19
|
isFocused={false}
|
|
@@ -23,11 +23,8 @@ describe('FloatingLabel', () => {
|
|
|
23
23
|
);
|
|
24
24
|
|
|
25
25
|
const labelComponent = getByTestId('input-label');
|
|
26
|
-
expect(labelComponent).toHaveTextContent(expectedText);
|
|
27
26
|
|
|
28
|
-
|
|
29
|
-
expect(queryByText(optionalText)).toBeVisible();
|
|
30
|
-
}
|
|
27
|
+
expect(labelComponent).toHaveTextContent(expectedText);
|
|
31
28
|
}
|
|
32
29
|
);
|
|
33
30
|
});
|
|
@@ -67,9 +64,9 @@ describe('FloatingLabel', () => {
|
|
|
67
64
|
|
|
68
65
|
describe('variant-specific positioning', () => {
|
|
69
66
|
it.each`
|
|
70
|
-
variant | required | expectedText
|
|
71
|
-
${'textarea'} | ${false} | ${'Description'} | ${'multiline input with optional label'}
|
|
72
|
-
${'textarea'} | ${true} | ${'Description'}
|
|
67
|
+
variant | required | expectedText | description
|
|
68
|
+
${'textarea'} | ${false} | ${'Description (Optional)'} | ${'multiline input with optional label'}
|
|
69
|
+
${'textarea'} | ${true} | ${'Description'} | ${'multiline input with required label'}
|
|
73
70
|
`(
|
|
74
71
|
'should position label appropriately for $variant ($description)',
|
|
75
72
|
({ variant, required, expectedText }) => {
|
|
@@ -93,9 +90,9 @@ describe('FloatingLabel', () => {
|
|
|
93
90
|
|
|
94
91
|
describe('when user encounters different input states', () => {
|
|
95
92
|
it.each`
|
|
96
|
-
state | required | expectedText
|
|
97
|
-
${'error'} | ${true} | ${'Email'}
|
|
98
|
-
${'disabled'} | ${false} | ${'Disabled Field'} | ${'non-interactive optional field'}
|
|
93
|
+
state | required | expectedText | description
|
|
94
|
+
${'error'} | ${true} | ${'Email'} | ${'validation error with required field'}
|
|
95
|
+
${'disabled'} | ${false} | ${'Disabled Field (Optional)'} | ${'non-interactive optional field'}
|
|
99
96
|
`(
|
|
100
97
|
'should display appropriate styling for $state state ($description)',
|
|
101
98
|
({ state, required, expectedText }) => {
|
|
@@ -7,7 +7,7 @@ describe('PrefixComponent', () => {
|
|
|
7
7
|
const wrapper = renderWithTheme(
|
|
8
8
|
<PrefixComponent prefix="dollar-sign" state="default" />
|
|
9
9
|
);
|
|
10
|
-
expect(wrapper.
|
|
10
|
+
expect(wrapper.getByLabelText('Prefix icon: dollar-sign')).toBeDefined();
|
|
11
11
|
// Optionally, keep testID fallback
|
|
12
12
|
expect(wrapper.getByTestId('input-prefix')).toBeDefined();
|
|
13
13
|
});
|
|
@@ -8,13 +8,13 @@ describe('SuffixComponent', () => {
|
|
|
8
8
|
<SuffixComponent loading suffix="dollar-sign" state="default" />
|
|
9
9
|
);
|
|
10
10
|
|
|
11
|
-
expect(wrapper.
|
|
11
|
+
expect(wrapper.getByLabelText('Suffix icon: loading')).toBeDefined();
|
|
12
12
|
});
|
|
13
13
|
|
|
14
14
|
it('renders suffix icon', () => {
|
|
15
15
|
const wrapper = renderWithTheme(
|
|
16
16
|
<SuffixComponent loading={false} suffix="dollar-sign" state="default" />
|
|
17
17
|
);
|
|
18
|
-
expect(wrapper.
|
|
18
|
+
expect(wrapper.getByLabelText('Suffix icon: dollar-sign')).toBeDefined();
|
|
19
19
|
});
|
|
20
20
|
});
|
|
@@ -34,7 +34,7 @@ describe('TextInput', () => {
|
|
|
34
34
|
|
|
35
35
|
// User should see the label text
|
|
36
36
|
const inputLabel = getByTestId('input-label');
|
|
37
|
-
expect(inputLabel).toHaveTextContent('Amount (AUD)');
|
|
37
|
+
expect(inputLabel).toHaveTextContent('Amount (AUD) (Optional)');
|
|
38
38
|
|
|
39
39
|
// User should be able to identify the prefix icon through accessibility
|
|
40
40
|
const prefixIcon = getByTestId('input-prefix-icon');
|
|
@@ -223,7 +223,7 @@ describe('TextInput', () => {
|
|
|
223
223
|
const suffixContainer = getByTestId('input-suffix');
|
|
224
224
|
expect(suffixContainer).toBeTruthy();
|
|
225
225
|
|
|
226
|
-
const loadingIcon = within(suffixContainer).
|
|
226
|
+
const loadingIcon = within(suffixContainer).getByLabelText(
|
|
227
227
|
'Suffix icon: loading'
|
|
228
228
|
);
|
|
229
229
|
expect(loadingIcon).toBeTruthy();
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import React from 'react';
|
|
1
|
+
import React, { ReactElement } from 'react';
|
|
2
2
|
import { render } from '@testing-library/react-native'; // eslint-disable-line import/no-extraneous-dependencies
|
|
3
3
|
import type { RenderOptions } from '@testing-library/react-native';
|
|
4
4
|
import { getTheme, ThemeProvider } from '../src';
|
|
5
5
|
|
|
6
6
|
const theme = getTheme();
|
|
7
7
|
|
|
8
|
-
const renderWithTheme = (ui:
|
|
8
|
+
const renderWithTheme = (ui: ReactElement, options?: RenderOptions) => {
|
|
9
9
|
return render(<ThemeProvider theme={theme}>{ui}</ThemeProvider>, options);
|
|
10
10
|
};
|
|
11
11
|
|