@hero-design/rn 8.2.1 → 8.2.3
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/.turbo/turbo-build.log +9 -9
- package/es/index.js +165 -52
- package/lib/index.js +163 -50
- package/package.json +5 -5
- package/src/components/BottomSheet/BottomSheetContext.ts +11 -0
- package/src/components/BottomSheet/ScrollView.tsx +57 -0
- package/src/components/BottomSheet/__tests__/__snapshots__/index.spec.tsx.snap +9 -24
- package/src/components/BottomSheet/__tests__/index.spec.tsx +17 -0
- package/src/components/BottomSheet/index.tsx +21 -8
- package/src/components/Box/StyledBox.tsx +8 -6
- package/src/components/Card/StyledCard.tsx +1 -1
- package/src/components/Card/__tests__/__snapshots__/index.spec.tsx.snap +74 -0
- package/src/components/Card/__tests__/index.spec.tsx +2 -0
- package/src/components/Card/index.tsx +1 -1
- package/src/components/DatePicker/__tests__/__snapshots__/DatePickerIOS.spec.tsx.snap +0 -24
- package/src/components/Icon/index.tsx +28 -2
- package/src/components/Select/MultiSelect/__tests__/__snapshots__/index.spec.tsx.snap +0 -72
- package/src/components/Select/SingleSelect/__tests__/__snapshots__/index.spec.tsx.snap +0 -36
- package/src/components/TextInput/__tests__/__snapshots__/index.spec.tsx.snap +160 -0
- package/src/components/TextInput/__tests__/index.spec.tsx +50 -3
- package/src/components/TextInput/index.tsx +65 -30
- package/src/components/TimePicker/__tests__/__snapshots__/TimePickerIOS.spec.tsx.snap +0 -24
- package/src/components/Toolbar/ToolbarGroup.tsx +20 -14
- package/src/components/Toolbar/ToolbarItem.tsx +9 -1
- package/src/components/Toolbar/__tests__/__snapshots__/ToolbarGroup.spec.tsx.snap +12 -0
- package/src/components/Toolbar/__tests__/__snapshots__/ToolbarItem.spec.tsx.snap +6 -0
- package/src/types.ts +4 -1
- package/src/utils/__tests__/helpers.spec.ts +22 -4
- package/src/utils/helpers.ts +10 -9
- package/types/components/BottomNavigation/StyledBottomNavigation.d.ts +1 -1
- package/types/components/BottomSheet/BottomSheetContext.d.ts +5 -0
- package/types/components/BottomSheet/ScrollView.d.ts +3 -0
- package/types/components/BottomSheet/index.d.ts +5 -3
- package/types/components/Box/StyledBox.d.ts +2 -2
- package/types/components/Button/StyledButton.d.ts +1 -1
- package/types/components/Button/UtilityButton/StyledUtilityButton.d.ts +1 -1
- package/types/components/Card/StyledCard.d.ts +1 -1
- package/types/components/Card/index.d.ts +1 -1
- package/types/components/Checkbox/StyledCheckbox.d.ts +1 -1
- package/types/components/ContentNavigator/StyledContentNavigator.d.ts +1 -1
- package/types/components/FAB/ActionGroup/StyledActionItem.d.ts +1 -1
- package/types/components/Icon/index.d.ts +3 -3
- package/types/components/TextInput/StyledTextInput.d.ts +7 -7
- package/types/components/TextInput/index.d.ts +25 -3
- package/types/components/Toolbar/ToolbarItem.d.ts +6 -1
- package/types/types.d.ts +3 -2
- package/types/utils/helpers.d.ts +2 -2
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
[
|
|
2
|
-
[
|
|
3
|
-
[
|
|
4
|
-
[
|
|
5
|
-
[
|
|
6
|
-
[
|
|
7
|
-
[
|
|
8
|
-
[
|
|
9
|
-
[
|
|
1
|
+
[35m@hero-design/rn:build[0m: cache hit, replaying output [2me72791422bc29fc3[0m
|
|
2
|
+
[35m@hero-design/rn:build: [0m$ yarn build:js && yarn build:types
|
|
3
|
+
[35m@hero-design/rn:build: [0m$ rollup -c
|
|
4
|
+
[35m@hero-design/rn:build: [0m[36m
|
|
5
|
+
[35m@hero-design/rn:build: [0m[1msrc/index.ts[22m → [1mlib/index.js, es/index.js[22m...[39m
|
|
6
|
+
[35m@hero-design/rn:build: [0m[1m[33m(!) 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`.[39m[22m
|
|
7
|
+
[35m@hero-design/rn:build: [0m[1m[33m(!) Plugin node-resolve: preferring built-in module 'events' over local alternative at '/root/hero-design/node_modules/events/events.js', pass 'preferBuiltins: false' to disable this behavior or 'preferBuiltins: true' to disable this warning[39m[22m
|
|
8
|
+
[35m@hero-design/rn:build: [0m[32mcreated [1mlib/index.js, es/index.js[22m in [1m32.4s[22m[39m
|
|
9
|
+
[35m@hero-design/rn:build: [0m$ tsc --noEmit false --emitDeclarationOnly --project tsconfig.prod.json
|
package/es/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as reactNative from 'react-native';
|
|
2
|
-
import { Platform, Dimensions, StyleSheet as StyleSheet$1, Animated, View, Easing, TouchableOpacity, Text as Text$1, Image as Image$1, TouchableWithoutFeedback, Pressable, SafeAreaView, KeyboardAvoidingView, Modal, TextInput as TextInput$
|
|
2
|
+
import { Platform, Dimensions, StyleSheet as StyleSheet$1, Animated, View, Easing, TouchableOpacity, Text as Text$1, Image as Image$1, TouchableWithoutFeedback, Pressable, SafeAreaView, KeyboardAvoidingView, ScrollView, Modal, TextInput as TextInput$2, PanResponder, TouchableHighlight, InteractionManager, useWindowDimensions, Keyboard, SectionList, FlatList, LayoutAnimation, RefreshControl as RefreshControl$1 } from 'react-native';
|
|
3
3
|
import React, { useContext, createContext, createElement, useMemo, forwardRef, useEffect, useCallback, useRef, useState, useLayoutEffect, useImperativeHandle } from 'react';
|
|
4
4
|
import { createIconSet } from 'react-native-vector-icons';
|
|
5
5
|
import { useSafeAreaInsets } from 'react-native-safe-area-context';
|
|
@@ -5701,7 +5701,7 @@ var StyledText$3 = index$a(Text$1)(function (_ref) {
|
|
|
5701
5701
|
});
|
|
5702
5702
|
});
|
|
5703
5703
|
|
|
5704
|
-
var _excluded$
|
|
5704
|
+
var _excluded$k = ["children", "fontSize", "fontWeight", "intent", "typeface"];
|
|
5705
5705
|
var Text = function Text(_ref) {
|
|
5706
5706
|
var children = _ref.children,
|
|
5707
5707
|
_ref$fontSize = _ref.fontSize,
|
|
@@ -5712,7 +5712,7 @@ var Text = function Text(_ref) {
|
|
|
5712
5712
|
intent = _ref$intent === void 0 ? 'body' : _ref$intent,
|
|
5713
5713
|
_ref$typeface = _ref.typeface,
|
|
5714
5714
|
typeface = _ref$typeface === void 0 ? 'neutral' : _ref$typeface,
|
|
5715
|
-
nativeProps = _objectWithoutProperties(_ref, _excluded$
|
|
5715
|
+
nativeProps = _objectWithoutProperties(_ref, _excluded$k);
|
|
5716
5716
|
return /*#__PURE__*/React.createElement(StyledText$3, _extends$1({}, nativeProps, {
|
|
5717
5717
|
themeFontSize: fontSize,
|
|
5718
5718
|
themeFontWeight: fontWeight,
|
|
@@ -6191,10 +6191,10 @@ var StyledHeroIcon = index$a(HeroIcon)(function (_ref) {
|
|
|
6191
6191
|
};
|
|
6192
6192
|
});
|
|
6193
6193
|
|
|
6194
|
-
var _excluded$
|
|
6194
|
+
var _excluded$j = ["style"];
|
|
6195
6195
|
var AnimatedIcon = function AnimatedIcon(_ref) {
|
|
6196
6196
|
var style = _ref.style,
|
|
6197
|
-
otherProps = _objectWithoutProperties(_ref, _excluded$
|
|
6197
|
+
otherProps = _objectWithoutProperties(_ref, _excluded$j);
|
|
6198
6198
|
var rotateAnimation = useRef(new Animated.Value(0));
|
|
6199
6199
|
useEffect(function () {
|
|
6200
6200
|
var animation = Animated.loop(Animated.timing(rotateAnimation.current, {
|
|
@@ -6230,21 +6230,45 @@ var Icon = function Icon(_ref) {
|
|
|
6230
6230
|
intent = _ref$intent === void 0 ? 'text' : _ref$intent,
|
|
6231
6231
|
testID = _ref.testID,
|
|
6232
6232
|
_ref$spin = _ref.spin,
|
|
6233
|
-
spin = _ref$spin === void 0 ? false : _ref$spin
|
|
6233
|
+
spin = _ref$spin === void 0 ? false : _ref$spin,
|
|
6234
|
+
accessibilityLabel = _ref.accessibilityLabel,
|
|
6235
|
+
accessibilityHint = _ref.accessibilityHint,
|
|
6236
|
+
accessibilityRole = _ref.accessibilityRole,
|
|
6237
|
+
accessibilityState = _ref.accessibilityState,
|
|
6238
|
+
accessibilityValue = _ref.accessibilityValue,
|
|
6239
|
+
accessibilityLiveRegion = _ref.accessibilityLiveRegion,
|
|
6240
|
+
accessibilityElementsHidden = _ref.accessibilityElementsHidden,
|
|
6241
|
+
accessible = _ref.accessible,
|
|
6242
|
+
accessibilityIgnoresInvertColors = _ref.accessibilityIgnoresInvertColors,
|
|
6243
|
+
accessibilityViewIsModal = _ref.accessibilityViewIsModal,
|
|
6244
|
+
accessibilityActions = _ref.accessibilityActions;
|
|
6234
6245
|
useDeprecation("".concat(icon, " icon is deprecated and will be removed in the next major release, please use ").concat(icon.replace('carat', 'caret'), " instead."), icon.startsWith('carat'));
|
|
6235
|
-
|
|
6246
|
+
var accessibilityProps = {
|
|
6247
|
+
accessibilityLabel: accessibilityLabel,
|
|
6248
|
+
accessibilityHint: accessibilityHint,
|
|
6249
|
+
accessibilityRole: accessibilityRole,
|
|
6250
|
+
accessibilityState: accessibilityState,
|
|
6251
|
+
accessibilityValue: accessibilityValue,
|
|
6252
|
+
accessibilityLiveRegion: accessibilityLiveRegion,
|
|
6253
|
+
accessibilityElementsHidden: accessibilityElementsHidden,
|
|
6254
|
+
accessible: accessible,
|
|
6255
|
+
accessibilityIgnoresInvertColors: accessibilityIgnoresInvertColors,
|
|
6256
|
+
accessibilityViewIsModal: accessibilityViewIsModal,
|
|
6257
|
+
accessibilityActions: accessibilityActions
|
|
6258
|
+
};
|
|
6259
|
+
return spin ? /*#__PURE__*/React.createElement(AnimatedIcon, _extends$1({
|
|
6236
6260
|
name: icon,
|
|
6237
6261
|
themeIntent: intent,
|
|
6238
6262
|
themeSize: size,
|
|
6239
6263
|
style: style,
|
|
6240
6264
|
testID: testID
|
|
6241
|
-
}) : /*#__PURE__*/React.createElement(StyledHeroIcon, {
|
|
6265
|
+
}, accessibilityProps)) : /*#__PURE__*/React.createElement(StyledHeroIcon, _extends$1({
|
|
6242
6266
|
name: icon,
|
|
6243
6267
|
themeIntent: intent,
|
|
6244
6268
|
themeSize: size,
|
|
6245
6269
|
style: style,
|
|
6246
6270
|
testID: testID
|
|
6247
|
-
});
|
|
6271
|
+
}, accessibilityProps));
|
|
6248
6272
|
};
|
|
6249
6273
|
Icon.List = IconList;
|
|
6250
6274
|
|
|
@@ -6276,7 +6300,7 @@ var AccordionItem = function AccordionItem(_ref) {
|
|
|
6276
6300
|
}, content));
|
|
6277
6301
|
};
|
|
6278
6302
|
|
|
6279
|
-
var _excluded$
|
|
6303
|
+
var _excluded$i = ["key"];
|
|
6280
6304
|
var Accordion = function Accordion(_ref) {
|
|
6281
6305
|
var items = _ref.items,
|
|
6282
6306
|
activeItemKey = _ref.activeItemKey,
|
|
@@ -6297,7 +6321,7 @@ var Accordion = function Accordion(_ref) {
|
|
|
6297
6321
|
testID: testID
|
|
6298
6322
|
}, items.map(function (_ref2, index) {
|
|
6299
6323
|
var key = _ref2.key,
|
|
6300
|
-
props = _objectWithoutProperties(_ref2, _excluded$
|
|
6324
|
+
props = _objectWithoutProperties(_ref2, _excluded$i);
|
|
6301
6325
|
var open = _activeItemKey === key;
|
|
6302
6326
|
return /*#__PURE__*/React.createElement(React.Fragment, {
|
|
6303
6327
|
key: key
|
|
@@ -6679,7 +6703,7 @@ var StyledStatus = index$a(Animated.View)(function (_ref3) {
|
|
|
6679
6703
|
};
|
|
6680
6704
|
});
|
|
6681
6705
|
|
|
6682
|
-
var _excluded$
|
|
6706
|
+
var _excluded$h = ["children", "visible", "intent", "style", "testID"];
|
|
6683
6707
|
var Status = function Status(_ref) {
|
|
6684
6708
|
var children = _ref.children,
|
|
6685
6709
|
_ref$visible = _ref.visible,
|
|
@@ -6688,7 +6712,7 @@ var Status = function Status(_ref) {
|
|
|
6688
6712
|
intent = _ref$intent === void 0 ? 'danger' : _ref$intent,
|
|
6689
6713
|
style = _ref.style,
|
|
6690
6714
|
testID = _ref.testID,
|
|
6691
|
-
nativeProps = _objectWithoutProperties(_ref, _excluded$
|
|
6715
|
+
nativeProps = _objectWithoutProperties(_ref, _excluded$h);
|
|
6692
6716
|
var _React$useRef = React.useRef(new Animated.Value(visible ? 1 : 0)),
|
|
6693
6717
|
opacity = _React$useRef.current;
|
|
6694
6718
|
var isFirstRendering = React.useRef(true);
|
|
@@ -6721,7 +6745,7 @@ var Status = function Status(_ref) {
|
|
|
6721
6745
|
}));
|
|
6722
6746
|
};
|
|
6723
6747
|
|
|
6724
|
-
var _excluded$
|
|
6748
|
+
var _excluded$g = ["content", "visible", "max", "intent", "style", "testID"];
|
|
6725
6749
|
var DEFAULT_MAX_NUMBER = 99;
|
|
6726
6750
|
var getPaddingState = function getPaddingState(content) {
|
|
6727
6751
|
return content.length > 1 ? 'wideContent' : 'narrowContent';
|
|
@@ -6736,7 +6760,7 @@ var Badge = function Badge(_ref) {
|
|
|
6736
6760
|
intent = _ref$intent === void 0 ? 'danger' : _ref$intent,
|
|
6737
6761
|
style = _ref.style,
|
|
6738
6762
|
testID = _ref.testID,
|
|
6739
|
-
nativeProps = _objectWithoutProperties(_ref, _excluded$
|
|
6763
|
+
nativeProps = _objectWithoutProperties(_ref, _excluded$g);
|
|
6740
6764
|
var _React$useRef = React.useRef(new Animated.Value(visible ? 1 : 0)),
|
|
6741
6765
|
opacity = _React$useRef.current;
|
|
6742
6766
|
var isFirstRendering = React.useRef(true);
|
|
@@ -6825,22 +6849,22 @@ var StyledBottomBarText = index$a(Typography.Text)(function (_ref3) {
|
|
|
6825
6849
|
|
|
6826
6850
|
var isIOS = Platform.OS === 'ios';
|
|
6827
6851
|
var isAndroid = Platform.OS === 'android';
|
|
6828
|
-
|
|
6852
|
+
function pick(keys, obj) {
|
|
6829
6853
|
return keys.filter(function (key) {
|
|
6830
|
-
return key in
|
|
6854
|
+
return key in obj;
|
|
6831
6855
|
}).reduce(function (result, cur) {
|
|
6832
|
-
return _objectSpread2(_objectSpread2({}, result), {}, _defineProperty({}, cur,
|
|
6856
|
+
return _objectSpread2(_objectSpread2({}, result), {}, _defineProperty({}, cur, obj[cur]));
|
|
6833
6857
|
}, {});
|
|
6834
|
-
}
|
|
6835
|
-
|
|
6836
|
-
var result =
|
|
6858
|
+
}
|
|
6859
|
+
function omit(keys, obj) {
|
|
6860
|
+
var result = obj;
|
|
6837
6861
|
keys.forEach(function (key) {
|
|
6838
6862
|
delete result[key];
|
|
6839
6863
|
});
|
|
6840
6864
|
return result;
|
|
6841
|
-
}
|
|
6865
|
+
}
|
|
6842
6866
|
|
|
6843
|
-
var _excluded$
|
|
6867
|
+
var _excluded$f = ["onTabPress", "renderActiveTabOnly", "selectedTabKey", "tabs"];
|
|
6844
6868
|
var getInactiveIcon = function getInactiveIcon(icon) {
|
|
6845
6869
|
var inactiveIcon = "".concat(icon, "-outlined");
|
|
6846
6870
|
return isHeroIcon(inactiveIcon) ? inactiveIcon : icon;
|
|
@@ -6851,7 +6875,7 @@ var BottomNavigation = function BottomNavigation(_ref) {
|
|
|
6851
6875
|
renderActiveTabOnly = _ref$renderActiveTabO === void 0 ? false : _ref$renderActiveTabO,
|
|
6852
6876
|
selectedTabKey = _ref.selectedTabKey,
|
|
6853
6877
|
tabs = _ref.tabs,
|
|
6854
|
-
nativeProps = _objectWithoutProperties(_ref, _excluded$
|
|
6878
|
+
nativeProps = _objectWithoutProperties(_ref, _excluded$f);
|
|
6855
6879
|
var insets = useSafeAreaInsets();
|
|
6856
6880
|
/**
|
|
6857
6881
|
* List of loaded tabs, tabs will be loaded when navigated to.
|
|
@@ -6919,6 +6943,8 @@ var BottomNavigation = function BottomNavigation(_ref) {
|
|
|
6919
6943
|
}))));
|
|
6920
6944
|
};
|
|
6921
6945
|
|
|
6946
|
+
var BottomSheetContext = /*#__PURE__*/createContext({});
|
|
6947
|
+
|
|
6922
6948
|
var StyledDivider = index$a(View)(function (_ref) {
|
|
6923
6949
|
var themeMarginHorizontal = _ref.themeMarginHorizontal,
|
|
6924
6950
|
themeMarginVertical = _ref.themeMarginVertical,
|
|
@@ -6936,13 +6962,13 @@ var StyledDivider = index$a(View)(function (_ref) {
|
|
|
6936
6962
|
}, horizontalMargin), verticalMargin);
|
|
6937
6963
|
});
|
|
6938
6964
|
|
|
6939
|
-
var _excluded$
|
|
6965
|
+
var _excluded$e = ["marginHorizontal", "marginVertical", "style", "testID"];
|
|
6940
6966
|
var Divider = function Divider(_ref) {
|
|
6941
6967
|
var marginHorizontal = _ref.marginHorizontal,
|
|
6942
6968
|
marginVertical = _ref.marginVertical,
|
|
6943
6969
|
style = _ref.style,
|
|
6944
6970
|
testID = _ref.testID,
|
|
6945
|
-
nativeProps = _objectWithoutProperties(_ref, _excluded$
|
|
6971
|
+
nativeProps = _objectWithoutProperties(_ref, _excluded$e);
|
|
6946
6972
|
return /*#__PURE__*/React.createElement(StyledDivider, _extends$1({}, nativeProps, {
|
|
6947
6973
|
themeMarginHorizontal: marginHorizontal,
|
|
6948
6974
|
themeMarginVertical: marginVertical,
|
|
@@ -7072,7 +7098,7 @@ var StyledLoadingDot = index$a(View)(function (_ref2) {
|
|
|
7072
7098
|
}, themeStyling());
|
|
7073
7099
|
});
|
|
7074
7100
|
|
|
7075
|
-
var _excluded$
|
|
7101
|
+
var _excluded$d = ["count", "size", "testID", "themeVariant"];
|
|
7076
7102
|
var AnimatedLoadingIndicatorWrapper = Animated.createAnimatedComponent(StyledLoadingIndicatorWrapper);
|
|
7077
7103
|
var AnimatedLoadingDot = Animated.createAnimatedComponent(StyledLoadingDot);
|
|
7078
7104
|
var renderDotComponent = function renderDotComponent(_ref) {
|
|
@@ -7104,7 +7130,7 @@ var LoadingIndicator = function LoadingIndicator(_ref2) {
|
|
|
7104
7130
|
size = _ref2$size === void 0 ? 12 : _ref2$size,
|
|
7105
7131
|
testID = _ref2.testID,
|
|
7106
7132
|
themeVariant = _ref2.themeVariant,
|
|
7107
|
-
nativeProps = _objectWithoutProperties(_ref2, _excluded$
|
|
7133
|
+
nativeProps = _objectWithoutProperties(_ref2, _excluded$d);
|
|
7108
7134
|
var progressAnimation = useRef(new Animated.Value(0));
|
|
7109
7135
|
useEffect(function () {
|
|
7110
7136
|
var animation = Animated.loop(Animated.timing(progressAnimation.current, {
|
|
@@ -7500,6 +7526,36 @@ var Header = function Header(_ref) {
|
|
|
7500
7526
|
})) : null), showDivider ? /*#__PURE__*/React.createElement(Divider, null) : null);
|
|
7501
7527
|
};
|
|
7502
7528
|
|
|
7529
|
+
var _excluded$c = ["scrollEventThrottle"];
|
|
7530
|
+
var BottomSheetScrollView = function BottomSheetScrollView(_ref) {
|
|
7531
|
+
var _ref$scrollEventThrot = _ref.scrollEventThrottle,
|
|
7532
|
+
scrollEventThrottle = _ref$scrollEventThrot === void 0 ? 100 : _ref$scrollEventThrot,
|
|
7533
|
+
props = _objectWithoutProperties(_ref, _excluded$c);
|
|
7534
|
+
var _useContext = useContext(BottomSheetContext),
|
|
7535
|
+
setInternalShowDivider = _useContext.setInternalShowDivider;
|
|
7536
|
+
var onScrollBeginDrag = useCallback(function (e) {
|
|
7537
|
+
var _props$onScrollBeginD;
|
|
7538
|
+
setInternalShowDivider(true);
|
|
7539
|
+
props === null || props === void 0 ? void 0 : (_props$onScrollBeginD = props.onScrollBeginDrag) === null || _props$onScrollBeginD === void 0 ? void 0 : _props$onScrollBeginD.call(props, e);
|
|
7540
|
+
}, []);
|
|
7541
|
+
var onMomentumScrollBegin = useCallback(function (e) {
|
|
7542
|
+
var _props$onMomentumScro;
|
|
7543
|
+
setInternalShowDivider(true);
|
|
7544
|
+
props === null || props === void 0 ? void 0 : (_props$onMomentumScro = props.onMomentumScrollEnd) === null || _props$onMomentumScro === void 0 ? void 0 : _props$onMomentumScro.call(props, e);
|
|
7545
|
+
}, []);
|
|
7546
|
+
var onMomentumScrollEnd = useCallback(function (e) {
|
|
7547
|
+
var _props$onMomentumScro2;
|
|
7548
|
+
setInternalShowDivider(false);
|
|
7549
|
+
props === null || props === void 0 ? void 0 : (_props$onMomentumScro2 = props.onMomentumScrollEnd) === null || _props$onMomentumScro2 === void 0 ? void 0 : _props$onMomentumScro2.call(props, e);
|
|
7550
|
+
}, []);
|
|
7551
|
+
return /*#__PURE__*/React.createElement(ScrollView, _extends$1({}, props, {
|
|
7552
|
+
onScrollBeginDrag: onScrollBeginDrag,
|
|
7553
|
+
onMomentumScrollBegin: onMomentumScrollBegin,
|
|
7554
|
+
onMomentumScrollEnd: onMomentumScrollEnd,
|
|
7555
|
+
scrollEventThrottle: scrollEventThrottle
|
|
7556
|
+
}));
|
|
7557
|
+
};
|
|
7558
|
+
|
|
7503
7559
|
var BottomSheet = function BottomSheet(_ref) {
|
|
7504
7560
|
var open = _ref.open,
|
|
7505
7561
|
header = _ref.header,
|
|
@@ -7514,7 +7570,7 @@ var BottomSheet = function BottomSheet(_ref) {
|
|
|
7514
7570
|
_ref$hasBackdrop = _ref.hasBackdrop,
|
|
7515
7571
|
hasBackdrop = _ref$hasBackdrop === void 0 ? true : _ref$hasBackdrop,
|
|
7516
7572
|
_ref$showDivider = _ref.showDivider,
|
|
7517
|
-
showDivider = _ref$showDivider === void 0 ?
|
|
7573
|
+
showDivider = _ref$showDivider === void 0 ? false : _ref$showDivider,
|
|
7518
7574
|
style = _ref.style,
|
|
7519
7575
|
testID = _ref.testID,
|
|
7520
7576
|
_ref$keyboardAvoiding = _ref.keyboardAvoidingViewProps,
|
|
@@ -7527,6 +7583,10 @@ var BottomSheet = function BottomSheet(_ref) {
|
|
|
7527
7583
|
visible = _useState2[0],
|
|
7528
7584
|
setVisibility = _useState2[1];
|
|
7529
7585
|
var animatedValue = useRef(new Animated.Value(open ? 0 : 1));
|
|
7586
|
+
var _useState3 = useState(showDivider),
|
|
7587
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
7588
|
+
internalShowDivider = _useState4[0],
|
|
7589
|
+
setInternalShowDivider = _useState4[1];
|
|
7530
7590
|
useEffect(function () {
|
|
7531
7591
|
// Show the modal before the open animation start
|
|
7532
7592
|
if (open && !visible) {
|
|
@@ -7567,6 +7627,11 @@ var BottomSheet = function BottomSheet(_ref) {
|
|
|
7567
7627
|
inputRange: [0, 1],
|
|
7568
7628
|
outputRange: [0, 0.48]
|
|
7569
7629
|
}) : 0;
|
|
7630
|
+
var BottomSheetContextValue = useMemo(function () {
|
|
7631
|
+
return {
|
|
7632
|
+
setInternalShowDivider: setInternalShowDivider
|
|
7633
|
+
};
|
|
7634
|
+
}, [setInternalShowDivider]);
|
|
7570
7635
|
return /*#__PURE__*/React.createElement(Modal, {
|
|
7571
7636
|
visible: visible,
|
|
7572
7637
|
onRequestClose: onRequestClose,
|
|
@@ -7592,13 +7657,18 @@ var BottomSheet = function BottomSheet(_ref) {
|
|
|
7592
7657
|
}]
|
|
7593
7658
|
}, header !== undefined ? /*#__PURE__*/React.createElement(Header, {
|
|
7594
7659
|
content: header,
|
|
7595
|
-
showDivider:
|
|
7660
|
+
showDivider: internalShowDivider,
|
|
7596
7661
|
onRequestClose: onRequestClose,
|
|
7597
7662
|
showCloseButton: showCloseButton
|
|
7598
|
-
}) : null,
|
|
7663
|
+
}) : null, /*#__PURE__*/React.createElement(BottomSheetContext.Provider, {
|
|
7664
|
+
value: BottomSheetContextValue
|
|
7665
|
+
}, children), footer ? /*#__PURE__*/React.createElement(Footer$1, {
|
|
7599
7666
|
showDivider: showDivider
|
|
7600
7667
|
}, footer) : null))));
|
|
7601
7668
|
};
|
|
7669
|
+
var BottomSheet$1 = Object.assign(BottomSheet, {
|
|
7670
|
+
ScrollView: BottomSheetScrollView
|
|
7671
|
+
});
|
|
7602
7672
|
|
|
7603
7673
|
var colors = {
|
|
7604
7674
|
backgroundColor: {
|
|
@@ -10604,7 +10674,7 @@ var StyledHelperText = index$a(Typography.Text)(function (_ref10) {
|
|
|
10604
10674
|
fontSize: theme.__hd__.textInput.fontSizes.error
|
|
10605
10675
|
};
|
|
10606
10676
|
});
|
|
10607
|
-
var StyledTextInput = index$a(TextInput$
|
|
10677
|
+
var StyledTextInput = index$a(TextInput$2)(function (_ref11) {
|
|
10608
10678
|
var theme = _ref11.theme;
|
|
10609
10679
|
return {
|
|
10610
10680
|
textAlignVertical: 'center',
|
|
@@ -10681,7 +10751,7 @@ var getVariant$1 = function getVariant(_ref) {
|
|
|
10681
10751
|
// Fix issue: Placeholder is not shown on iOS when multiline is true
|
|
10682
10752
|
// https://github.com/callstack/react-native-paper/pull/3331
|
|
10683
10753
|
var EMPTY_PLACEHOLDER_VALUE = ' ';
|
|
10684
|
-
var TextInput = function TextInput(_ref2) {
|
|
10754
|
+
var TextInput = function TextInput(_ref2, ref) {
|
|
10685
10755
|
var _ref3;
|
|
10686
10756
|
var label = _ref2.label,
|
|
10687
10757
|
prefix = _ref2.prefix,
|
|
@@ -10721,6 +10791,35 @@ var TextInput = function TextInput(_ref2) {
|
|
|
10721
10791
|
});
|
|
10722
10792
|
var shouldShowMaxLength = maxLength !== undefined;
|
|
10723
10793
|
var theme = useTheme();
|
|
10794
|
+
var innerTextInput = React.useRef();
|
|
10795
|
+
React.useImperativeHandle(ref, function () {
|
|
10796
|
+
return {
|
|
10797
|
+
// we don't expose this method, it's for testing https://medium.com/developer-rants/how-to-test-useref-without-mocking-useref-699165f4994e
|
|
10798
|
+
getNativeTextInputRef: function getNativeTextInputRef() {
|
|
10799
|
+
return innerTextInput.current;
|
|
10800
|
+
},
|
|
10801
|
+
focus: function focus() {
|
|
10802
|
+
var _innerTextInput$curre;
|
|
10803
|
+
(_innerTextInput$curre = innerTextInput.current) === null || _innerTextInput$curre === void 0 ? void 0 : _innerTextInput$curre.focus();
|
|
10804
|
+
},
|
|
10805
|
+
clear: function clear() {
|
|
10806
|
+
var _innerTextInput$curre2;
|
|
10807
|
+
return (_innerTextInput$curre2 = innerTextInput.current) === null || _innerTextInput$curre2 === void 0 ? void 0 : _innerTextInput$curre2.clear();
|
|
10808
|
+
},
|
|
10809
|
+
setNativeProps: function setNativeProps(args) {
|
|
10810
|
+
var _innerTextInput$curre3;
|
|
10811
|
+
return (_innerTextInput$curre3 = innerTextInput.current) === null || _innerTextInput$curre3 === void 0 ? void 0 : _innerTextInput$curre3.setNativeProps(args);
|
|
10812
|
+
},
|
|
10813
|
+
isFocused: function isFocused() {
|
|
10814
|
+
var _innerTextInput$curre4;
|
|
10815
|
+
return ((_innerTextInput$curre4 = innerTextInput.current) === null || _innerTextInput$curre4 === void 0 ? void 0 : _innerTextInput$curre4.isFocused()) || false;
|
|
10816
|
+
},
|
|
10817
|
+
blur: function blur() {
|
|
10818
|
+
var _innerTextInput$curre5;
|
|
10819
|
+
return (_innerTextInput$curre5 = innerTextInput.current) === null || _innerTextInput$curre5 === void 0 ? void 0 : _innerTextInput$curre5.blur();
|
|
10820
|
+
}
|
|
10821
|
+
};
|
|
10822
|
+
}, [innerTextInput]);
|
|
10724
10823
|
var _useMemo = useMemo(function () {
|
|
10725
10824
|
if (!textStyle) {
|
|
10726
10825
|
return {};
|
|
@@ -10800,7 +10899,11 @@ var TextInput = function TextInput(_ref2) {
|
|
|
10800
10899
|
testID: "input-label",
|
|
10801
10900
|
fontSize: "medium",
|
|
10802
10901
|
themeVariant: variant
|
|
10803
|
-
}, label)), renderInputValue ? renderInputValue(nativeInputProps) : /*#__PURE__*/React.createElement(StyledTextInput,
|
|
10902
|
+
}, label)), renderInputValue ? renderInputValue(nativeInputProps) : /*#__PURE__*/React.createElement(StyledTextInput, _extends$1({}, nativeInputProps, {
|
|
10903
|
+
ref: function ref(reference) {
|
|
10904
|
+
innerTextInput.current = reference;
|
|
10905
|
+
}
|
|
10906
|
+
}))), typeof actualSuffix === 'string' ? /*#__PURE__*/React.createElement(Icon, {
|
|
10804
10907
|
intent: variant === 'disabled' ? 'disabled-text' : 'text',
|
|
10805
10908
|
testID: "input-suffix",
|
|
10806
10909
|
icon: actualSuffix,
|
|
@@ -10818,6 +10921,7 @@ var TextInput = function TextInput(_ref2) {
|
|
|
10818
10921
|
fontSize: "small"
|
|
10819
10922
|
}, displayText.length, "/", maxLength)), !!helpText && /*#__PURE__*/React.createElement(StyledHelperText, null, helpText)));
|
|
10820
10923
|
};
|
|
10924
|
+
var TextInput$1 = /*#__PURE__*/React.forwardRef(TextInput);
|
|
10821
10925
|
|
|
10822
10926
|
var DatePickerAndroid = function DatePickerAndroid(_ref) {
|
|
10823
10927
|
var value = _ref.value,
|
|
@@ -10849,7 +10953,7 @@ var DatePickerAndroid = function DatePickerAndroid(_ref) {
|
|
|
10849
10953
|
}, /*#__PURE__*/React.createElement(View, {
|
|
10850
10954
|
pointerEvents: "none",
|
|
10851
10955
|
testID: "datePickerInputAndroid"
|
|
10852
|
-
}, /*#__PURE__*/React.createElement(TextInput, {
|
|
10956
|
+
}, /*#__PURE__*/React.createElement(TextInput$1, {
|
|
10853
10957
|
label: label,
|
|
10854
10958
|
value: displayValue,
|
|
10855
10959
|
suffix: "calendar-dates-outlined",
|
|
@@ -10917,7 +11021,7 @@ var DatePickerIOS = function DatePickerIOS(_ref) {
|
|
|
10917
11021
|
}, /*#__PURE__*/React.createElement(View, {
|
|
10918
11022
|
pointerEvents: "none",
|
|
10919
11023
|
testID: "datePickerInputIOS"
|
|
10920
|
-
}, /*#__PURE__*/React.createElement(TextInput, {
|
|
11024
|
+
}, /*#__PURE__*/React.createElement(TextInput$1, {
|
|
10921
11025
|
label: label,
|
|
10922
11026
|
value: displayValue,
|
|
10923
11027
|
suffix: "calendar-dates-outlined",
|
|
@@ -10928,7 +11032,7 @@ var DatePickerIOS = function DatePickerIOS(_ref) {
|
|
|
10928
11032
|
helpText: helpText,
|
|
10929
11033
|
testID: testID,
|
|
10930
11034
|
style: style
|
|
10931
|
-
})), /*#__PURE__*/React.createElement(BottomSheet, {
|
|
11035
|
+
})), /*#__PURE__*/React.createElement(BottomSheet$1, {
|
|
10932
11036
|
open: open,
|
|
10933
11037
|
onRequestClose: function onRequestClose() {
|
|
10934
11038
|
return setOpen(false);
|
|
@@ -11871,7 +11975,7 @@ var StyledFilledMask = index$a(View)(function (_ref5) {
|
|
|
11871
11975
|
backgroundColor: theme.__hd__.pinInput.colors[themeState]
|
|
11872
11976
|
};
|
|
11873
11977
|
});
|
|
11874
|
-
var StyledHiddenInput = index$a(TextInput$
|
|
11978
|
+
var StyledHiddenInput = index$a(TextInput$2)(function (_ref6) {
|
|
11875
11979
|
var themePinLength = _ref6.themePinLength,
|
|
11876
11980
|
theme = _ref6.theme;
|
|
11877
11981
|
var cellWidth = theme.__hd__.pinInput.sizes.cellWidth;
|
|
@@ -12983,7 +13087,7 @@ function MultiSelect(_ref) {
|
|
|
12983
13087
|
}
|
|
12984
13088
|
}, /*#__PURE__*/React.createElement(View, {
|
|
12985
13089
|
pointerEvents: "none"
|
|
12986
|
-
}, /*#__PURE__*/React.createElement(TextInput, _extends$1({}, inputProps, {
|
|
13090
|
+
}, /*#__PURE__*/React.createElement(TextInput$1, _extends$1({}, inputProps, {
|
|
12987
13091
|
label: label,
|
|
12988
13092
|
value: displayedValue,
|
|
12989
13093
|
suffix: "arrow-down",
|
|
@@ -12998,7 +13102,7 @@ function MultiSelect(_ref) {
|
|
|
12998
13102
|
renderInputValue: renderSelectedValue !== undefined ? function (props) {
|
|
12999
13103
|
return renderSelectedValue(value, props);
|
|
13000
13104
|
} : undefined
|
|
13001
|
-
}))))), /*#__PURE__*/React.createElement(BottomSheet, {
|
|
13105
|
+
}))))), /*#__PURE__*/React.createElement(BottomSheet$1, {
|
|
13002
13106
|
open: open,
|
|
13003
13107
|
onRequestClose: function onRequestClose() {
|
|
13004
13108
|
return setOpen(false);
|
|
@@ -13031,7 +13135,7 @@ function MultiSelect(_ref) {
|
|
|
13031
13135
|
(_sectionListRef$curre = sectionListRef.current) === null || _sectionListRef$curre === void 0 ? void 0 : _sectionListRef$curre.scrollToLocation(scrollParams);
|
|
13032
13136
|
}
|
|
13033
13137
|
}
|
|
13034
|
-
}, onQueryChange && /*#__PURE__*/React.createElement(StyledSearchBar, null, /*#__PURE__*/React.createElement(TextInput, {
|
|
13138
|
+
}, onQueryChange && /*#__PURE__*/React.createElement(StyledSearchBar, null, /*#__PURE__*/React.createElement(TextInput$1, {
|
|
13035
13139
|
editable: true,
|
|
13036
13140
|
placeholder: "Search",
|
|
13037
13141
|
suffix: "search-outlined",
|
|
@@ -13159,7 +13263,7 @@ var SingleSelect = function SingleSelect(_ref) {
|
|
|
13159
13263
|
}
|
|
13160
13264
|
}, /*#__PURE__*/React.createElement(View, {
|
|
13161
13265
|
pointerEvents: "none"
|
|
13162
|
-
}, /*#__PURE__*/React.createElement(TextInput, _extends$1({}, inputProps, {
|
|
13266
|
+
}, /*#__PURE__*/React.createElement(TextInput$1, _extends$1({}, inputProps, {
|
|
13163
13267
|
label: label,
|
|
13164
13268
|
value: displayedValue,
|
|
13165
13269
|
suffix: "arrow-down",
|
|
@@ -13174,7 +13278,7 @@ var SingleSelect = function SingleSelect(_ref) {
|
|
|
13174
13278
|
renderInputValue: renderSelectedValue !== undefined ? function (props) {
|
|
13175
13279
|
return renderSelectedValue(value, props);
|
|
13176
13280
|
} : undefined
|
|
13177
|
-
}))))), /*#__PURE__*/React.createElement(BottomSheet, {
|
|
13281
|
+
}))))), /*#__PURE__*/React.createElement(BottomSheet$1, {
|
|
13178
13282
|
open: open,
|
|
13179
13283
|
onRequestClose: function onRequestClose() {
|
|
13180
13284
|
return setOpen(false);
|
|
@@ -13191,7 +13295,7 @@ var SingleSelect = function SingleSelect(_ref) {
|
|
|
13191
13295
|
(_sectionListRef$curre = sectionListRef.current) === null || _sectionListRef$curre === void 0 ? void 0 : _sectionListRef$curre.scrollToLocation(scrollParams);
|
|
13192
13296
|
}
|
|
13193
13297
|
}
|
|
13194
|
-
}, onQueryChange && /*#__PURE__*/React.createElement(StyledSearchBar, null, /*#__PURE__*/React.createElement(TextInput, {
|
|
13298
|
+
}, onQueryChange && /*#__PURE__*/React.createElement(StyledSearchBar, null, /*#__PURE__*/React.createElement(TextInput$1, {
|
|
13195
13299
|
editable: true,
|
|
13196
13300
|
placeholder: "Search",
|
|
13197
13301
|
suffix: "search-outlined",
|
|
@@ -13932,7 +14036,7 @@ var TimePickerAndroid = function TimePickerAndroid(_ref) {
|
|
|
13932
14036
|
}, /*#__PURE__*/React.createElement(View, {
|
|
13933
14037
|
pointerEvents: "none",
|
|
13934
14038
|
testID: "timePickerInputAndroid"
|
|
13935
|
-
}, /*#__PURE__*/React.createElement(TextInput, {
|
|
14039
|
+
}, /*#__PURE__*/React.createElement(TextInput$1, {
|
|
13936
14040
|
label: label,
|
|
13937
14041
|
value: displayValue,
|
|
13938
14042
|
suffix: showSuffix ? 'clock-3' : undefined,
|
|
@@ -14000,7 +14104,7 @@ var TimePickerIOS = function TimePickerIOS(_ref) {
|
|
|
14000
14104
|
}, /*#__PURE__*/React.createElement(View, {
|
|
14001
14105
|
pointerEvents: "none",
|
|
14002
14106
|
testID: "timePickerInputIOS"
|
|
14003
|
-
}, /*#__PURE__*/React.createElement(TextInput, {
|
|
14107
|
+
}, /*#__PURE__*/React.createElement(TextInput$1, {
|
|
14004
14108
|
label: label,
|
|
14005
14109
|
value: displayValue,
|
|
14006
14110
|
suffix: showSuffix ? 'clock-3' : undefined,
|
|
@@ -14011,7 +14115,7 @@ var TimePickerIOS = function TimePickerIOS(_ref) {
|
|
|
14011
14115
|
helpText: helpText,
|
|
14012
14116
|
testID: testID,
|
|
14013
14117
|
style: style
|
|
14014
|
-
})), /*#__PURE__*/React.createElement(BottomSheet, {
|
|
14118
|
+
})), /*#__PURE__*/React.createElement(BottomSheet$1, {
|
|
14015
14119
|
open: open,
|
|
14016
14120
|
onRequestClose: function onRequestClose() {
|
|
14017
14121
|
return setOpen(false);
|
|
@@ -14400,10 +14504,12 @@ var ToolbarItem = function ToolbarItem(_ref) {
|
|
|
14400
14504
|
_ref$intent = _ref.intent,
|
|
14401
14505
|
intent = _ref$intent === void 0 ? 'primary' : _ref$intent,
|
|
14402
14506
|
_ref$disabled = _ref.disabled,
|
|
14403
|
-
disabled = _ref$disabled === void 0 ? false : _ref$disabled
|
|
14507
|
+
disabled = _ref$disabled === void 0 ? false : _ref$disabled,
|
|
14508
|
+
style = _ref.style;
|
|
14404
14509
|
return /*#__PURE__*/React.createElement(ToolbarItemWrapper, {
|
|
14405
14510
|
onPress: onPress,
|
|
14406
|
-
disabled: disabled
|
|
14511
|
+
disabled: disabled,
|
|
14512
|
+
style: style
|
|
14407
14513
|
}, icon ? /*#__PURE__*/React.createElement(Icon, {
|
|
14408
14514
|
icon: icon,
|
|
14409
14515
|
size: label ? 'medium' : 'large',
|
|
@@ -14412,7 +14518,8 @@ var ToolbarItem = function ToolbarItem(_ref) {
|
|
|
14412
14518
|
}) : null, label ? /*#__PURE__*/React.createElement(Typography.Text, {
|
|
14413
14519
|
fontSize: icon ? 'small' : 'large',
|
|
14414
14520
|
fontWeight: "semi-bold",
|
|
14415
|
-
intent: disabled ? 'subdued' : intent
|
|
14521
|
+
intent: disabled ? 'subdued' : intent,
|
|
14522
|
+
maxFontSizeMultiplier: 2
|
|
14416
14523
|
}, label) : null);
|
|
14417
14524
|
};
|
|
14418
14525
|
|
|
@@ -14421,6 +14528,9 @@ var ToolbarGroup = function ToolbarGroup(_ref) {
|
|
|
14421
14528
|
align = _ref$align === void 0 ? 'right' : _ref$align,
|
|
14422
14529
|
_ref$items = _ref.items,
|
|
14423
14530
|
items = _ref$items === void 0 ? [] : _ref$items;
|
|
14531
|
+
// set maxWidth prevents overflow of items
|
|
14532
|
+
// issue: https://github.com/Thinkei/hero-design/issues/1619
|
|
14533
|
+
var maxWidth = items.length > 0 ? "".concat(100 / items.length, "%") : undefined;
|
|
14424
14534
|
return /*#__PURE__*/React.createElement(ToolbarGroupWrapper, {
|
|
14425
14535
|
align: align
|
|
14426
14536
|
}, items.map(function (_ref2) {
|
|
@@ -14435,7 +14545,10 @@ var ToolbarGroup = function ToolbarGroup(_ref) {
|
|
|
14435
14545
|
icon: icon,
|
|
14436
14546
|
intent: intent,
|
|
14437
14547
|
onPress: onPress,
|
|
14438
|
-
disabled: disabled
|
|
14548
|
+
disabled: disabled,
|
|
14549
|
+
style: {
|
|
14550
|
+
maxWidth: maxWidth
|
|
14551
|
+
}
|
|
14439
14552
|
});
|
|
14440
14553
|
}));
|
|
14441
14554
|
};
|
|
@@ -30834,4 +30947,4 @@ var index = Object.assign(RichTextEditor$1, {
|
|
|
30834
30947
|
Toolbar: EditorToolbar
|
|
30835
30948
|
});
|
|
30836
30949
|
|
|
30837
|
-
export { Accordion, Alert, Attachment, index$9 as Avatar, Badge$1 as Badge, BottomNavigation, BottomSheet, Box, CompoundButton as Button, Calendar, index$8 as Card, Checkbox, Collapse, ContentNavigator, DatePicker, Divider, index$7 as Drawer, Empty, index$6 as FAB, Icon, Image, List, PinInput, Progress, CompoundRadio as Radio, RefreshControl, index as RichTextEditor, SectionHeading, index$4 as Select, Slider, Spinner, index$5 as Swipeable, index$3 as Switch, index$2 as Tabs, Tag, TextInput, ThemeProvider, ThemeSwitcher, TimePicker, Toast, index$1 as Toolbar, Typography, eBensSystemPalette, getTheme$1 as getTheme, jobsSystemPalette, scale, swagSystemPalette, defaultTheme as theme, useAvatarColors, useTheme, walletSystemPalette, workSystemPalette };
|
|
30950
|
+
export { Accordion, Alert, Attachment, index$9 as Avatar, Badge$1 as Badge, BottomNavigation, BottomSheet$1 as BottomSheet, Box, CompoundButton as Button, Calendar, index$8 as Card, Checkbox, Collapse, ContentNavigator, DatePicker, Divider, index$7 as Drawer, Empty, index$6 as FAB, Icon, Image, List, PinInput, Progress, CompoundRadio as Radio, RefreshControl, index as RichTextEditor, SectionHeading, index$4 as Select, Slider, Spinner, index$5 as Swipeable, index$3 as Switch, index$2 as Tabs, Tag, TextInput$1 as TextInput, ThemeProvider, ThemeSwitcher, TimePicker, Toast, index$1 as Toolbar, Typography, eBensSystemPalette, getTheme$1 as getTheme, jobsSystemPalette, scale, swagSystemPalette, defaultTheme as theme, useAvatarColors, useTheme, walletSystemPalette, workSystemPalette };
|