@hero-design/rn 8.25.0 → 8.25.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.turbo/turbo-build.log +9 -9
- package/es/index.js +45 -36
- package/lib/index.js +44 -35
- package/package.json +5 -5
- package/src/components/Collapse/index.tsx +11 -10
- package/src/components/DatePicker/__tests__/__snapshots__/DatePicker.spec.tsx.snap +21 -15
- package/src/components/DatePicker/__tests__/__snapshots__/DatePickerAndroid.spec.tsx.snap +7 -5
- package/src/components/DatePicker/__tests__/__snapshots__/DatePickerCalendar.spec.tsx.snap +7 -5
- package/src/components/DatePicker/__tests__/__snapshots__/DatePickerIOS.spec.tsx.snap +7 -5
- package/src/components/Select/MultiSelect/__tests__/__snapshots__/index.spec.tsx.snap +28 -20
- package/src/components/Select/SingleSelect/__tests__/__snapshots__/index.spec.tsx.snap +28 -20
- package/src/components/TextInput/StyledTextInput.tsx +4 -0
- package/src/components/TextInput/__tests__/__snapshots__/StyledTextInput.spec.tsx.snap +21 -1
- package/src/components/TextInput/__tests__/__snapshots__/index.spec.tsx.snap +112 -78
- package/src/components/TextInput/index.tsx +1 -4
- package/src/components/TimePicker/__tests__/__snapshots__/TimePickerAndroid.spec.tsx.snap +14 -10
- package/src/components/TimePicker/__tests__/__snapshots__/TimePickerIOS.spec.tsx.snap +14 -10
- package/src/theme/__tests__/__snapshots__/index.spec.ts.snap +5 -1
- package/src/theme/components/textInput.ts +16 -2
- package/types/components/Collapse/index.d.ts +1 -1
- package/types/theme/components/textInput.d.ts +4 -0
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
[
|
|
2
|
-
[
|
|
3
|
-
[
|
|
4
|
-
[
|
|
5
|
-
[
|
|
6
|
-
[
|
|
7
|
-
[
|
|
8
|
-
[
|
|
9
|
-
[
|
|
1
|
+
[34m@hero-design/rn:build[0m: cache hit, replaying output [2m8b413e97d24bd32c[0m
|
|
2
|
+
[34m@hero-design/rn:build: [0m$ yarn build:js && yarn build:types
|
|
3
|
+
[34m@hero-design/rn:build: [0m$ rollup -c
|
|
4
|
+
[34m@hero-design/rn:build: [0m[36m
|
|
5
|
+
[34m@hero-design/rn:build: [0m[1msrc/index.ts[22m → [1mlib/index.js, es/index.js[22m...[39m
|
|
6
|
+
[34m@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
|
+
[34m@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
|
+
[34m@hero-design/rn:build: [0m[32mcreated [1mlib/index.js, es/index.js[22m in [1m37.5s[22m[39m
|
|
9
|
+
[34m@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,
|
|
2
|
+
import { Platform, Dimensions, StyleSheet as StyleSheet$1, Animated, View, UIManager, LayoutAnimation, TouchableOpacity, Text as Text$1, Easing, Image as Image$1, TouchableWithoutFeedback, Pressable, SafeAreaView, KeyboardAvoidingView, TouchableHighlight, ScrollView, Modal, FlatList, useWindowDimensions, TextInput as TextInput$1, PanResponder, InteractionManager, Keyboard, SectionList, RefreshControl as RefreshControl$1 } from 'react-native';
|
|
3
3
|
import React, { useContext, createContext, createElement, useMemo, forwardRef, useEffect, useCallback, useRef, useState, isValidElement, useLayoutEffect, useImperativeHandle } from 'react';
|
|
4
4
|
import { createIconSet } from 'react-native-vector-icons';
|
|
5
5
|
import { useSafeAreaInsets } from 'react-native-safe-area-context';
|
|
@@ -1071,7 +1071,9 @@ var palette$b = {
|
|
|
1071
1071
|
yellow: yellow$1.base,
|
|
1072
1072
|
yellowDark15: yellow$1.darken15,
|
|
1073
1073
|
yellowDark75: yellow$1.darken75,
|
|
1074
|
+
yellowLight45: yellow$1.lighten45,
|
|
1074
1075
|
yellowLight60: yellow$1.lighten60,
|
|
1076
|
+
yellowLight75: yellow$1.lighten75,
|
|
1075
1077
|
yellowLight90: yellow$1.lighten90
|
|
1076
1078
|
};
|
|
1077
1079
|
var mauve$4 = colorScales.mauve,
|
|
@@ -2929,7 +2931,7 @@ var getTextInputTheme = function getTextInputTheme(theme) {
|
|
|
2929
2931
|
var space = {
|
|
2930
2932
|
containerPadding: theme.space.medium,
|
|
2931
2933
|
labelLeft: theme.space.medium,
|
|
2932
|
-
labelTop: theme.lineHeights.small / -
|
|
2934
|
+
labelTop: theme.lineHeights.small / -4,
|
|
2933
2935
|
labelPaddingBottom: theme.space.small,
|
|
2934
2936
|
labelHorizontalPadding: theme.space.xsmall,
|
|
2935
2937
|
inputHorizontalMargin: theme.space.small,
|
|
@@ -2948,7 +2950,8 @@ var getTextInputTheme = function getTextInputTheme(theme) {
|
|
|
2948
2950
|
labelInsideTextInput: theme.fontSizes.large,
|
|
2949
2951
|
error: theme.fontSizes.small,
|
|
2950
2952
|
maxLength: theme.fontSizes.small,
|
|
2951
|
-
asteriskLabel: theme.fontSizes.large
|
|
2953
|
+
asteriskLabel: theme.fontSizes.large,
|
|
2954
|
+
topLabel: theme.fontSizes.small
|
|
2952
2955
|
};
|
|
2953
2956
|
var borderWidths = {
|
|
2954
2957
|
container: {
|
|
@@ -2964,6 +2967,9 @@ var getTextInputTheme = function getTextInputTheme(theme) {
|
|
|
2964
2967
|
textareaHeight: theme.sizes['15xlarge'],
|
|
2965
2968
|
textInputMaxHeight: theme.sizes['15xlarge']
|
|
2966
2969
|
};
|
|
2970
|
+
var lineHeights = {
|
|
2971
|
+
topLabel: theme.lineHeights.large / 2
|
|
2972
|
+
};
|
|
2967
2973
|
return {
|
|
2968
2974
|
colors: colors,
|
|
2969
2975
|
space: space,
|
|
@@ -2971,7 +2977,8 @@ var getTextInputTheme = function getTextInputTheme(theme) {
|
|
|
2971
2977
|
fontSizes: fontSizes,
|
|
2972
2978
|
borderWidths: borderWidths,
|
|
2973
2979
|
radii: radii,
|
|
2974
|
-
sizes: sizes
|
|
2980
|
+
sizes: sizes,
|
|
2981
|
+
lineHeights: lineHeights
|
|
2975
2982
|
};
|
|
2976
2983
|
};
|
|
2977
2984
|
|
|
@@ -6027,26 +6034,6 @@ var index$a = components.reduce(function (acc, comp) {
|
|
|
6027
6034
|
});
|
|
6028
6035
|
}, styled);
|
|
6029
6036
|
|
|
6030
|
-
var StyledWrapper$c = index$a(Animated.View)({
|
|
6031
|
-
margin: 0,
|
|
6032
|
-
padding: 0,
|
|
6033
|
-
overflow: 'hidden'
|
|
6034
|
-
});
|
|
6035
|
-
/**
|
|
6036
|
-
* Height need to be high enough to cover most scenario
|
|
6037
|
-
* This container's purpose is only to help get correct children height and returns it
|
|
6038
|
-
* to use with Animated.timing
|
|
6039
|
-
*/
|
|
6040
|
-
var StyledHiddenWrapper = index$a(View)(function () {
|
|
6041
|
-
return {
|
|
6042
|
-
height: Dimensions.get('window').height
|
|
6043
|
-
};
|
|
6044
|
-
});
|
|
6045
|
-
var StyledChildWrapper = index$a(View)({
|
|
6046
|
-
margin: 0,
|
|
6047
|
-
padding: 0
|
|
6048
|
-
});
|
|
6049
|
-
|
|
6050
6037
|
// Get previous state value
|
|
6051
6038
|
var usePrevious = function usePrevious(value) {
|
|
6052
6039
|
var ref = React.useRef();
|
|
@@ -6072,13 +6059,37 @@ var useDeprecation = function useDeprecation(message) {
|
|
|
6072
6059
|
}, [message, cond]);
|
|
6073
6060
|
};
|
|
6074
6061
|
|
|
6062
|
+
var StyledWrapper$c = index$a(Animated.View)({
|
|
6063
|
+
margin: 0,
|
|
6064
|
+
padding: 0,
|
|
6065
|
+
overflow: 'hidden'
|
|
6066
|
+
});
|
|
6067
|
+
/**
|
|
6068
|
+
* Height need to be high enough to cover most scenario
|
|
6069
|
+
* This container's purpose is only to help get correct children height and returns it
|
|
6070
|
+
* to use with Animated.timing
|
|
6071
|
+
*/
|
|
6072
|
+
var StyledHiddenWrapper = index$a(View)(function () {
|
|
6073
|
+
return {
|
|
6074
|
+
height: Dimensions.get('window').height
|
|
6075
|
+
};
|
|
6076
|
+
});
|
|
6077
|
+
var StyledChildWrapper = index$a(View)({
|
|
6078
|
+
margin: 0,
|
|
6079
|
+
padding: 0
|
|
6080
|
+
});
|
|
6081
|
+
|
|
6082
|
+
if (Platform.OS === 'android') {
|
|
6083
|
+
if (UIManager.setLayoutAnimationEnabledExperimental) {
|
|
6084
|
+
UIManager.setLayoutAnimationEnabledExperimental(true);
|
|
6085
|
+
}
|
|
6086
|
+
}
|
|
6075
6087
|
var Collapse = function Collapse(_ref) {
|
|
6076
6088
|
var _ref$open = _ref.open,
|
|
6077
6089
|
open = _ref$open === void 0 ? false : _ref$open,
|
|
6078
6090
|
children = _ref.children,
|
|
6079
6091
|
testID = _ref.testID,
|
|
6080
6092
|
style = _ref.style;
|
|
6081
|
-
var collapseAnim = React.useRef(new Animated.Value(0)).current;
|
|
6082
6093
|
var _React$useState = React.useState(0),
|
|
6083
6094
|
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
6084
6095
|
contentHeight = _React$useState2[0],
|
|
@@ -6086,11 +6097,7 @@ var Collapse = function Collapse(_ref) {
|
|
|
6086
6097
|
var previousOpenState = usePrevious(open);
|
|
6087
6098
|
useEffect(function () {
|
|
6088
6099
|
if (open !== previousOpenState && previousOpenState !== undefined || open) {
|
|
6089
|
-
|
|
6090
|
-
toValue: open ? contentHeight : 0,
|
|
6091
|
-
easing: Easing.inOut(Easing.cubic),
|
|
6092
|
-
useNativeDriver: false
|
|
6093
|
-
}).start();
|
|
6100
|
+
LayoutAnimation.configureNext(LayoutAnimation.Presets.easeInEaseOut);
|
|
6094
6101
|
}
|
|
6095
6102
|
}, [open, previousOpenState, contentHeight]);
|
|
6096
6103
|
var fetchMaxHeight = useCallback(function (_ref2) {
|
|
@@ -6099,7 +6106,7 @@ var Collapse = function Collapse(_ref) {
|
|
|
6099
6106
|
}, []);
|
|
6100
6107
|
return /*#__PURE__*/React.createElement(StyledWrapper$c, {
|
|
6101
6108
|
style: {
|
|
6102
|
-
height:
|
|
6109
|
+
height: open ? contentHeight : 0
|
|
6103
6110
|
},
|
|
6104
6111
|
testID: testID
|
|
6105
6112
|
}, /*#__PURE__*/React.createElement(StyledHiddenWrapper, null, /*#__PURE__*/React.createElement(StyledChildWrapper, {
|
|
@@ -11663,14 +11670,18 @@ var StyledLabel = index$a(Typography.Text)(function (_ref3) {
|
|
|
11663
11670
|
var theme = _ref3.theme,
|
|
11664
11671
|
themeState = _ref3.themeState;
|
|
11665
11672
|
return {
|
|
11666
|
-
color: theme.__hd__.textInput.colors.labels[themeState]
|
|
11673
|
+
color: theme.__hd__.textInput.colors.labels[themeState],
|
|
11674
|
+
fontSize: theme.__hd__.textInput.fontSizes.topLabel,
|
|
11675
|
+
lineHeight: theme.__hd__.textInput.lineHeights.topLabel
|
|
11667
11676
|
};
|
|
11668
11677
|
});
|
|
11669
11678
|
var StyledAsteriskLabel = index$a(Typography.Text)(function (_ref4) {
|
|
11670
11679
|
var theme = _ref4.theme,
|
|
11671
11680
|
themeState = _ref4.themeState;
|
|
11672
11681
|
return {
|
|
11673
|
-
color: theme.__hd__.textInput.colors.asterisks[themeState]
|
|
11682
|
+
color: theme.__hd__.textInput.colors.asterisks[themeState],
|
|
11683
|
+
fontSize: theme.__hd__.textInput.fontSizes.topLabel,
|
|
11684
|
+
lineHeight: theme.__hd__.textInput.lineHeights.topLabel
|
|
11674
11685
|
};
|
|
11675
11686
|
});
|
|
11676
11687
|
var StyledLabelContainerInsideTextInput = index$a(View)(function (_ref5) {
|
|
@@ -11978,12 +11989,10 @@ var TextInput = /*#__PURE__*/forwardRef(function (_ref2, ref) {
|
|
|
11978
11989
|
backgroundColor: backgroundColor
|
|
11979
11990
|
}
|
|
11980
11991
|
}, required && /*#__PURE__*/React.createElement(StyledAsteriskLabel, {
|
|
11981
|
-
themeState: state
|
|
11982
|
-
fontSize: "small"
|
|
11992
|
+
themeState: state
|
|
11983
11993
|
}, "*"), !!label && /*#__PURE__*/React.createElement(StyledLabel, {
|
|
11984
11994
|
nativeID: accessibilityLabelledBy,
|
|
11985
11995
|
testID: "input-label",
|
|
11986
|
-
fontSize: "small",
|
|
11987
11996
|
themeState: state,
|
|
11988
11997
|
style: {
|
|
11989
11998
|
backgroundColor: backgroundColor
|
package/lib/index.js
CHANGED
|
@@ -1101,7 +1101,9 @@ var palette$b = {
|
|
|
1101
1101
|
yellow: yellow$1.base,
|
|
1102
1102
|
yellowDark15: yellow$1.darken15,
|
|
1103
1103
|
yellowDark75: yellow$1.darken75,
|
|
1104
|
+
yellowLight45: yellow$1.lighten45,
|
|
1104
1105
|
yellowLight60: yellow$1.lighten60,
|
|
1106
|
+
yellowLight75: yellow$1.lighten75,
|
|
1105
1107
|
yellowLight90: yellow$1.lighten90
|
|
1106
1108
|
};
|
|
1107
1109
|
var mauve$4 = colorScales.mauve,
|
|
@@ -2959,7 +2961,7 @@ var getTextInputTheme = function getTextInputTheme(theme) {
|
|
|
2959
2961
|
var space = {
|
|
2960
2962
|
containerPadding: theme.space.medium,
|
|
2961
2963
|
labelLeft: theme.space.medium,
|
|
2962
|
-
labelTop: theme.lineHeights.small / -
|
|
2964
|
+
labelTop: theme.lineHeights.small / -4,
|
|
2963
2965
|
labelPaddingBottom: theme.space.small,
|
|
2964
2966
|
labelHorizontalPadding: theme.space.xsmall,
|
|
2965
2967
|
inputHorizontalMargin: theme.space.small,
|
|
@@ -2978,7 +2980,8 @@ var getTextInputTheme = function getTextInputTheme(theme) {
|
|
|
2978
2980
|
labelInsideTextInput: theme.fontSizes.large,
|
|
2979
2981
|
error: theme.fontSizes.small,
|
|
2980
2982
|
maxLength: theme.fontSizes.small,
|
|
2981
|
-
asteriskLabel: theme.fontSizes.large
|
|
2983
|
+
asteriskLabel: theme.fontSizes.large,
|
|
2984
|
+
topLabel: theme.fontSizes.small
|
|
2982
2985
|
};
|
|
2983
2986
|
var borderWidths = {
|
|
2984
2987
|
container: {
|
|
@@ -2994,6 +2997,9 @@ var getTextInputTheme = function getTextInputTheme(theme) {
|
|
|
2994
2997
|
textareaHeight: theme.sizes['15xlarge'],
|
|
2995
2998
|
textInputMaxHeight: theme.sizes['15xlarge']
|
|
2996
2999
|
};
|
|
3000
|
+
var lineHeights = {
|
|
3001
|
+
topLabel: theme.lineHeights.large / 2
|
|
3002
|
+
};
|
|
2997
3003
|
return {
|
|
2998
3004
|
colors: colors,
|
|
2999
3005
|
space: space,
|
|
@@ -3001,7 +3007,8 @@ var getTextInputTheme = function getTextInputTheme(theme) {
|
|
|
3001
3007
|
fontSizes: fontSizes,
|
|
3002
3008
|
borderWidths: borderWidths,
|
|
3003
3009
|
radii: radii,
|
|
3004
|
-
sizes: sizes
|
|
3010
|
+
sizes: sizes,
|
|
3011
|
+
lineHeights: lineHeights
|
|
3005
3012
|
};
|
|
3006
3013
|
};
|
|
3007
3014
|
|
|
@@ -6057,26 +6064,6 @@ var index$a = components.reduce(function (acc, comp) {
|
|
|
6057
6064
|
});
|
|
6058
6065
|
}, styled);
|
|
6059
6066
|
|
|
6060
|
-
var StyledWrapper$c = index$a(reactNative.Animated.View)({
|
|
6061
|
-
margin: 0,
|
|
6062
|
-
padding: 0,
|
|
6063
|
-
overflow: 'hidden'
|
|
6064
|
-
});
|
|
6065
|
-
/**
|
|
6066
|
-
* Height need to be high enough to cover most scenario
|
|
6067
|
-
* This container's purpose is only to help get correct children height and returns it
|
|
6068
|
-
* to use with Animated.timing
|
|
6069
|
-
*/
|
|
6070
|
-
var StyledHiddenWrapper = index$a(reactNative.View)(function () {
|
|
6071
|
-
return {
|
|
6072
|
-
height: reactNative.Dimensions.get('window').height
|
|
6073
|
-
};
|
|
6074
|
-
});
|
|
6075
|
-
var StyledChildWrapper = index$a(reactNative.View)({
|
|
6076
|
-
margin: 0,
|
|
6077
|
-
padding: 0
|
|
6078
|
-
});
|
|
6079
|
-
|
|
6080
6067
|
// Get previous state value
|
|
6081
6068
|
var usePrevious = function usePrevious(value) {
|
|
6082
6069
|
var ref = React__default["default"].useRef();
|
|
@@ -6102,13 +6089,37 @@ var useDeprecation = function useDeprecation(message) {
|
|
|
6102
6089
|
}, [message, cond]);
|
|
6103
6090
|
};
|
|
6104
6091
|
|
|
6092
|
+
var StyledWrapper$c = index$a(reactNative.Animated.View)({
|
|
6093
|
+
margin: 0,
|
|
6094
|
+
padding: 0,
|
|
6095
|
+
overflow: 'hidden'
|
|
6096
|
+
});
|
|
6097
|
+
/**
|
|
6098
|
+
* Height need to be high enough to cover most scenario
|
|
6099
|
+
* This container's purpose is only to help get correct children height and returns it
|
|
6100
|
+
* to use with Animated.timing
|
|
6101
|
+
*/
|
|
6102
|
+
var StyledHiddenWrapper = index$a(reactNative.View)(function () {
|
|
6103
|
+
return {
|
|
6104
|
+
height: reactNative.Dimensions.get('window').height
|
|
6105
|
+
};
|
|
6106
|
+
});
|
|
6107
|
+
var StyledChildWrapper = index$a(reactNative.View)({
|
|
6108
|
+
margin: 0,
|
|
6109
|
+
padding: 0
|
|
6110
|
+
});
|
|
6111
|
+
|
|
6112
|
+
if (reactNative.Platform.OS === 'android') {
|
|
6113
|
+
if (reactNative.UIManager.setLayoutAnimationEnabledExperimental) {
|
|
6114
|
+
reactNative.UIManager.setLayoutAnimationEnabledExperimental(true);
|
|
6115
|
+
}
|
|
6116
|
+
}
|
|
6105
6117
|
var Collapse = function Collapse(_ref) {
|
|
6106
6118
|
var _ref$open = _ref.open,
|
|
6107
6119
|
open = _ref$open === void 0 ? false : _ref$open,
|
|
6108
6120
|
children = _ref.children,
|
|
6109
6121
|
testID = _ref.testID,
|
|
6110
6122
|
style = _ref.style;
|
|
6111
|
-
var collapseAnim = React__default["default"].useRef(new reactNative.Animated.Value(0)).current;
|
|
6112
6123
|
var _React$useState = React__default["default"].useState(0),
|
|
6113
6124
|
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
6114
6125
|
contentHeight = _React$useState2[0],
|
|
@@ -6116,11 +6127,7 @@ var Collapse = function Collapse(_ref) {
|
|
|
6116
6127
|
var previousOpenState = usePrevious(open);
|
|
6117
6128
|
React.useEffect(function () {
|
|
6118
6129
|
if (open !== previousOpenState && previousOpenState !== undefined || open) {
|
|
6119
|
-
reactNative.
|
|
6120
|
-
toValue: open ? contentHeight : 0,
|
|
6121
|
-
easing: reactNative.Easing.inOut(reactNative.Easing.cubic),
|
|
6122
|
-
useNativeDriver: false
|
|
6123
|
-
}).start();
|
|
6130
|
+
reactNative.LayoutAnimation.configureNext(reactNative.LayoutAnimation.Presets.easeInEaseOut);
|
|
6124
6131
|
}
|
|
6125
6132
|
}, [open, previousOpenState, contentHeight]);
|
|
6126
6133
|
var fetchMaxHeight = React.useCallback(function (_ref2) {
|
|
@@ -6129,7 +6136,7 @@ var Collapse = function Collapse(_ref) {
|
|
|
6129
6136
|
}, []);
|
|
6130
6137
|
return /*#__PURE__*/React__default["default"].createElement(StyledWrapper$c, {
|
|
6131
6138
|
style: {
|
|
6132
|
-
height:
|
|
6139
|
+
height: open ? contentHeight : 0
|
|
6133
6140
|
},
|
|
6134
6141
|
testID: testID
|
|
6135
6142
|
}, /*#__PURE__*/React__default["default"].createElement(StyledHiddenWrapper, null, /*#__PURE__*/React__default["default"].createElement(StyledChildWrapper, {
|
|
@@ -11693,14 +11700,18 @@ var StyledLabel = index$a(Typography.Text)(function (_ref3) {
|
|
|
11693
11700
|
var theme = _ref3.theme,
|
|
11694
11701
|
themeState = _ref3.themeState;
|
|
11695
11702
|
return {
|
|
11696
|
-
color: theme.__hd__.textInput.colors.labels[themeState]
|
|
11703
|
+
color: theme.__hd__.textInput.colors.labels[themeState],
|
|
11704
|
+
fontSize: theme.__hd__.textInput.fontSizes.topLabel,
|
|
11705
|
+
lineHeight: theme.__hd__.textInput.lineHeights.topLabel
|
|
11697
11706
|
};
|
|
11698
11707
|
});
|
|
11699
11708
|
var StyledAsteriskLabel = index$a(Typography.Text)(function (_ref4) {
|
|
11700
11709
|
var theme = _ref4.theme,
|
|
11701
11710
|
themeState = _ref4.themeState;
|
|
11702
11711
|
return {
|
|
11703
|
-
color: theme.__hd__.textInput.colors.asterisks[themeState]
|
|
11712
|
+
color: theme.__hd__.textInput.colors.asterisks[themeState],
|
|
11713
|
+
fontSize: theme.__hd__.textInput.fontSizes.topLabel,
|
|
11714
|
+
lineHeight: theme.__hd__.textInput.lineHeights.topLabel
|
|
11704
11715
|
};
|
|
11705
11716
|
});
|
|
11706
11717
|
var StyledLabelContainerInsideTextInput = index$a(reactNative.View)(function (_ref5) {
|
|
@@ -12008,12 +12019,10 @@ var TextInput = /*#__PURE__*/React.forwardRef(function (_ref2, ref) {
|
|
|
12008
12019
|
backgroundColor: backgroundColor
|
|
12009
12020
|
}
|
|
12010
12021
|
}, required && /*#__PURE__*/React__default["default"].createElement(StyledAsteriskLabel, {
|
|
12011
|
-
themeState: state
|
|
12012
|
-
fontSize: "small"
|
|
12022
|
+
themeState: state
|
|
12013
12023
|
}, "*"), !!label && /*#__PURE__*/React__default["default"].createElement(StyledLabel, {
|
|
12014
12024
|
nativeID: accessibilityLabelledBy,
|
|
12015
12025
|
testID: "input-label",
|
|
12016
|
-
fontSize: "small",
|
|
12017
12026
|
themeState: state,
|
|
12018
12027
|
style: {
|
|
12019
12028
|
backgroundColor: backgroundColor
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hero-design/rn",
|
|
3
|
-
"version": "8.25.
|
|
3
|
+
"version": "8.25.1",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"module": "es/index.js",
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
"dependencies": {
|
|
22
22
|
"@emotion/native": "^11.9.3",
|
|
23
23
|
"@emotion/react": "^11.9.3",
|
|
24
|
-
"@hero-design/colors": "8.25.
|
|
24
|
+
"@hero-design/colors": "8.25.1",
|
|
25
25
|
"date-fns": "^2.16.1",
|
|
26
26
|
"events": "^3.2.0",
|
|
27
27
|
"hero-editor": "^1.9.21"
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
"@babel/preset-typescript": "^7.17.12",
|
|
46
46
|
"@babel/runtime": "^7.18.9",
|
|
47
47
|
"@emotion/jest": "^11.9.3",
|
|
48
|
-
"@hero-design/eslint-plugin": "8.25.
|
|
48
|
+
"@hero-design/eslint-plugin": "8.25.1",
|
|
49
49
|
"@react-native-community/datetimepicker": "^3.5.2",
|
|
50
50
|
"@react-native-community/slider": "4.1.12",
|
|
51
51
|
"@rollup/plugin-babel": "^5.3.1",
|
|
@@ -61,9 +61,9 @@
|
|
|
61
61
|
"@types/react-native": "^0.67.7",
|
|
62
62
|
"@types/react-native-vector-icons": "^6.4.10",
|
|
63
63
|
"babel-plugin-inline-import": "^3.0.0",
|
|
64
|
-
"eslint-config-hd": "8.25.
|
|
64
|
+
"eslint-config-hd": "8.25.1",
|
|
65
65
|
"jest": "^27.3.1",
|
|
66
|
-
"prettier-config-hd": "8.25.
|
|
66
|
+
"prettier-config-hd": "8.25.1",
|
|
67
67
|
"react": "18.0.0",
|
|
68
68
|
"react-native": "0.69.7",
|
|
69
69
|
"react-native-gesture-handler": "~2.1.0",
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
2
|
import React, { useCallback, useEffect } from 'react';
|
|
3
3
|
import type { StyleProp, ViewProps, ViewStyle } from 'react-native';
|
|
4
|
-
import
|
|
4
|
+
import { LayoutAnimation, Platform, UIManager } from 'react-native';
|
|
5
|
+
import { usePrevious } from '../../utils/hooks';
|
|
5
6
|
import {
|
|
6
7
|
StyledChildWrapper,
|
|
7
8
|
StyledHiddenWrapper,
|
|
8
9
|
StyledWrapper,
|
|
9
10
|
} from './StyledCollapse';
|
|
10
|
-
import { usePrevious } from '../../utils/hooks';
|
|
11
11
|
|
|
12
12
|
export interface CollapseProps extends ViewProps {
|
|
13
13
|
/*
|
|
@@ -28,8 +28,13 @@ export interface CollapseProps extends ViewProps {
|
|
|
28
28
|
testID?: string;
|
|
29
29
|
}
|
|
30
30
|
|
|
31
|
+
if (Platform.OS === 'android') {
|
|
32
|
+
if (UIManager.setLayoutAnimationEnabledExperimental) {
|
|
33
|
+
UIManager.setLayoutAnimationEnabledExperimental(true);
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
|
|
31
37
|
const Collapse = ({ open = false, children, testID, style }: CollapseProps) => {
|
|
32
|
-
const collapseAnim = React.useRef(new Animated.Value(0)).current;
|
|
33
38
|
const [contentHeight, setContentHeight] = React.useState<number>(0);
|
|
34
39
|
|
|
35
40
|
const previousOpenState = usePrevious(open);
|
|
@@ -39,11 +44,7 @@ const Collapse = ({ open = false, children, testID, style }: CollapseProps) => {
|
|
|
39
44
|
(open !== previousOpenState && previousOpenState !== undefined) ||
|
|
40
45
|
open
|
|
41
46
|
) {
|
|
42
|
-
|
|
43
|
-
toValue: open ? contentHeight : 0,
|
|
44
|
-
easing: Easing.inOut(Easing.cubic),
|
|
45
|
-
useNativeDriver: false,
|
|
46
|
-
}).start();
|
|
47
|
+
LayoutAnimation.configureNext(LayoutAnimation.Presets.easeInEaseOut);
|
|
47
48
|
}
|
|
48
49
|
}, [open, previousOpenState, contentHeight]);
|
|
49
50
|
|
|
@@ -54,7 +55,7 @@ const Collapse = ({ open = false, children, testID, style }: CollapseProps) => {
|
|
|
54
55
|
return (
|
|
55
56
|
<StyledWrapper
|
|
56
57
|
style={{
|
|
57
|
-
height:
|
|
58
|
+
height: open ? contentHeight : 0,
|
|
58
59
|
}}
|
|
59
60
|
testID={testID}
|
|
60
61
|
>
|
|
@@ -88,7 +88,7 @@ exports[`DatePicker renders DatePickerAndroid when OS is android 1`] = `
|
|
|
88
88
|
"left": 16,
|
|
89
89
|
"paddingHorizontal": 4,
|
|
90
90
|
"position": "absolute",
|
|
91
|
-
"top": -
|
|
91
|
+
"top": -5,
|
|
92
92
|
"zIndex": 1,
|
|
93
93
|
},
|
|
94
94
|
Object {
|
|
@@ -105,13 +105,15 @@ exports[`DatePicker renders DatePickerAndroid when OS is android 1`] = `
|
|
|
105
105
|
Object {
|
|
106
106
|
"color": "#001f23",
|
|
107
107
|
"fontFamily": "BeVietnamPro-Regular",
|
|
108
|
-
"fontSize":
|
|
109
|
-
"letterSpacing": 0.
|
|
110
|
-
"lineHeight":
|
|
108
|
+
"fontSize": 14,
|
|
109
|
+
"letterSpacing": 0.42,
|
|
110
|
+
"lineHeight": 22,
|
|
111
111
|
},
|
|
112
112
|
Array [
|
|
113
113
|
Object {
|
|
114
114
|
"color": "#001f23",
|
|
115
|
+
"fontSize": 12,
|
|
116
|
+
"lineHeight": 12,
|
|
115
117
|
},
|
|
116
118
|
Object {
|
|
117
119
|
"backgroundColor": "#ffffff",
|
|
@@ -120,7 +122,7 @@ exports[`DatePicker renders DatePickerAndroid when OS is android 1`] = `
|
|
|
120
122
|
]
|
|
121
123
|
}
|
|
122
124
|
testID="input-label"
|
|
123
|
-
themeFontSize="
|
|
125
|
+
themeFontSize="medium"
|
|
124
126
|
themeFontWeight="regular"
|
|
125
127
|
themeIntent="body"
|
|
126
128
|
themeState="filled"
|
|
@@ -311,7 +313,7 @@ exports[`DatePicker renders DatePickerIOS when OS is iOS 1`] = `
|
|
|
311
313
|
"left": 16,
|
|
312
314
|
"paddingHorizontal": 4,
|
|
313
315
|
"position": "absolute",
|
|
314
|
-
"top": -
|
|
316
|
+
"top": -5,
|
|
315
317
|
"zIndex": 1,
|
|
316
318
|
},
|
|
317
319
|
Object {
|
|
@@ -328,13 +330,15 @@ exports[`DatePicker renders DatePickerIOS when OS is iOS 1`] = `
|
|
|
328
330
|
Object {
|
|
329
331
|
"color": "#001f23",
|
|
330
332
|
"fontFamily": "BeVietnamPro-Regular",
|
|
331
|
-
"fontSize":
|
|
332
|
-
"letterSpacing": 0.
|
|
333
|
-
"lineHeight":
|
|
333
|
+
"fontSize": 14,
|
|
334
|
+
"letterSpacing": 0.42,
|
|
335
|
+
"lineHeight": 22,
|
|
334
336
|
},
|
|
335
337
|
Array [
|
|
336
338
|
Object {
|
|
337
339
|
"color": "#001f23",
|
|
340
|
+
"fontSize": 12,
|
|
341
|
+
"lineHeight": 12,
|
|
338
342
|
},
|
|
339
343
|
Object {
|
|
340
344
|
"backgroundColor": "#ffffff",
|
|
@@ -343,7 +347,7 @@ exports[`DatePicker renders DatePickerIOS when OS is iOS 1`] = `
|
|
|
343
347
|
]
|
|
344
348
|
}
|
|
345
349
|
testID="input-label"
|
|
346
|
-
themeFontSize="
|
|
350
|
+
themeFontSize="medium"
|
|
347
351
|
themeFontWeight="regular"
|
|
348
352
|
themeIntent="body"
|
|
349
353
|
themeState="filled"
|
|
@@ -540,7 +544,7 @@ exports[`DatePicker renders variant Calendar 1`] = `
|
|
|
540
544
|
"left": 16,
|
|
541
545
|
"paddingHorizontal": 4,
|
|
542
546
|
"position": "absolute",
|
|
543
|
-
"top": -
|
|
547
|
+
"top": -5,
|
|
544
548
|
"zIndex": 1,
|
|
545
549
|
},
|
|
546
550
|
Object {
|
|
@@ -557,13 +561,15 @@ exports[`DatePicker renders variant Calendar 1`] = `
|
|
|
557
561
|
Object {
|
|
558
562
|
"color": "#001f23",
|
|
559
563
|
"fontFamily": "BeVietnamPro-Regular",
|
|
560
|
-
"fontSize":
|
|
561
|
-
"letterSpacing": 0.
|
|
562
|
-
"lineHeight":
|
|
564
|
+
"fontSize": 14,
|
|
565
|
+
"letterSpacing": 0.42,
|
|
566
|
+
"lineHeight": 22,
|
|
563
567
|
},
|
|
564
568
|
Array [
|
|
565
569
|
Object {
|
|
566
570
|
"color": "#001f23",
|
|
571
|
+
"fontSize": 12,
|
|
572
|
+
"lineHeight": 12,
|
|
567
573
|
},
|
|
568
574
|
Object {
|
|
569
575
|
"backgroundColor": "#ffffff",
|
|
@@ -572,7 +578,7 @@ exports[`DatePicker renders variant Calendar 1`] = `
|
|
|
572
578
|
]
|
|
573
579
|
}
|
|
574
580
|
testID="input-label"
|
|
575
|
-
themeFontSize="
|
|
581
|
+
themeFontSize="medium"
|
|
576
582
|
themeFontWeight="regular"
|
|
577
583
|
themeIntent="body"
|
|
578
584
|
themeState="filled"
|
|
@@ -88,7 +88,7 @@ exports[`DatePickerAndroid renders correctly 1`] = `
|
|
|
88
88
|
"left": 16,
|
|
89
89
|
"paddingHorizontal": 4,
|
|
90
90
|
"position": "absolute",
|
|
91
|
-
"top": -
|
|
91
|
+
"top": -5,
|
|
92
92
|
"zIndex": 1,
|
|
93
93
|
},
|
|
94
94
|
Object {
|
|
@@ -105,13 +105,15 @@ exports[`DatePickerAndroid renders correctly 1`] = `
|
|
|
105
105
|
Object {
|
|
106
106
|
"color": "#001f23",
|
|
107
107
|
"fontFamily": "BeVietnamPro-Regular",
|
|
108
|
-
"fontSize":
|
|
109
|
-
"letterSpacing": 0.
|
|
110
|
-
"lineHeight":
|
|
108
|
+
"fontSize": 14,
|
|
109
|
+
"letterSpacing": 0.42,
|
|
110
|
+
"lineHeight": 22,
|
|
111
111
|
},
|
|
112
112
|
Array [
|
|
113
113
|
Object {
|
|
114
114
|
"color": "#001f23",
|
|
115
|
+
"fontSize": 12,
|
|
116
|
+
"lineHeight": 12,
|
|
115
117
|
},
|
|
116
118
|
Object {
|
|
117
119
|
"backgroundColor": "#ffffff",
|
|
@@ -120,7 +122,7 @@ exports[`DatePickerAndroid renders correctly 1`] = `
|
|
|
120
122
|
]
|
|
121
123
|
}
|
|
122
124
|
testID="input-label"
|
|
123
|
-
themeFontSize="
|
|
125
|
+
themeFontSize="medium"
|
|
124
126
|
themeFontWeight="regular"
|
|
125
127
|
themeIntent="body"
|
|
126
128
|
themeState="filled"
|
|
@@ -88,7 +88,7 @@ exports[`DatePickerCalendar renders correctly 1`] = `
|
|
|
88
88
|
"left": 16,
|
|
89
89
|
"paddingHorizontal": 4,
|
|
90
90
|
"position": "absolute",
|
|
91
|
-
"top": -
|
|
91
|
+
"top": -5,
|
|
92
92
|
"zIndex": 1,
|
|
93
93
|
},
|
|
94
94
|
Object {
|
|
@@ -105,13 +105,15 @@ exports[`DatePickerCalendar renders correctly 1`] = `
|
|
|
105
105
|
Object {
|
|
106
106
|
"color": "#001f23",
|
|
107
107
|
"fontFamily": "BeVietnamPro-Regular",
|
|
108
|
-
"fontSize":
|
|
109
|
-
"letterSpacing": 0.
|
|
110
|
-
"lineHeight":
|
|
108
|
+
"fontSize": 14,
|
|
109
|
+
"letterSpacing": 0.42,
|
|
110
|
+
"lineHeight": 22,
|
|
111
111
|
},
|
|
112
112
|
Array [
|
|
113
113
|
Object {
|
|
114
114
|
"color": "#001f23",
|
|
115
|
+
"fontSize": 12,
|
|
116
|
+
"lineHeight": 12,
|
|
115
117
|
},
|
|
116
118
|
Object {
|
|
117
119
|
"backgroundColor": "#ffffff",
|
|
@@ -120,7 +122,7 @@ exports[`DatePickerCalendar renders correctly 1`] = `
|
|
|
120
122
|
]
|
|
121
123
|
}
|
|
122
124
|
testID="input-label"
|
|
123
|
-
themeFontSize="
|
|
125
|
+
themeFontSize="medium"
|
|
124
126
|
themeFontWeight="regular"
|
|
125
127
|
themeIntent="body"
|
|
126
128
|
themeState="filled"
|
|
@@ -88,7 +88,7 @@ exports[`DatePickerIOS renders correctly 1`] = `
|
|
|
88
88
|
"left": 16,
|
|
89
89
|
"paddingHorizontal": 4,
|
|
90
90
|
"position": "absolute",
|
|
91
|
-
"top": -
|
|
91
|
+
"top": -5,
|
|
92
92
|
"zIndex": 1,
|
|
93
93
|
},
|
|
94
94
|
Object {
|
|
@@ -105,13 +105,15 @@ exports[`DatePickerIOS renders correctly 1`] = `
|
|
|
105
105
|
Object {
|
|
106
106
|
"color": "#001f23",
|
|
107
107
|
"fontFamily": "BeVietnamPro-Regular",
|
|
108
|
-
"fontSize":
|
|
109
|
-
"letterSpacing": 0.
|
|
110
|
-
"lineHeight":
|
|
108
|
+
"fontSize": 14,
|
|
109
|
+
"letterSpacing": 0.42,
|
|
110
|
+
"lineHeight": 22,
|
|
111
111
|
},
|
|
112
112
|
Array [
|
|
113
113
|
Object {
|
|
114
114
|
"color": "#001f23",
|
|
115
|
+
"fontSize": 12,
|
|
116
|
+
"lineHeight": 12,
|
|
115
117
|
},
|
|
116
118
|
Object {
|
|
117
119
|
"backgroundColor": "#ffffff",
|
|
@@ -120,7 +122,7 @@ exports[`DatePickerIOS renders correctly 1`] = `
|
|
|
120
122
|
]
|
|
121
123
|
}
|
|
122
124
|
testID="input-label"
|
|
123
|
-
themeFontSize="
|
|
125
|
+
themeFontSize="medium"
|
|
124
126
|
themeFontWeight="regular"
|
|
125
127
|
themeIntent="body"
|
|
126
128
|
themeState="filled"
|