@hero-design/rn 7.16.0 → 7.16.2
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 +2 -2
- package/es/index.js +176 -2444
- package/lib/index.js +449 -2717
- package/package.json +3 -4
- package/rollup.config.js +2 -0
- package/src/components/DatePicker/DatePickerIOS.tsx +2 -2
- package/src/components/List/StyledBasicListItem.tsx +2 -2
- package/src/components/Select/MultiSelect/Option.tsx +7 -10
- package/src/components/Select/MultiSelect/__tests__/__snapshots__/Option.spec.tsx.snap +39 -21
- package/src/components/Select/MultiSelect/__tests__/__snapshots__/OptionList.spec.tsx.snap +342 -203
- package/src/components/Select/MultiSelect/__tests__/__snapshots__/index.spec.tsx.snap +366 -224
- package/src/components/Select/SingleSelect/Option.tsx +2 -11
- package/src/components/Select/SingleSelect/__tests__/__snapshots__/Option.spec.tsx.snap +21 -14
- package/src/components/Select/SingleSelect/__tests__/__snapshots__/OptionList.spec.tsx.snap +252 -168
- package/src/components/Select/SingleSelect/__tests__/__snapshots__/index.spec.tsx.snap +294 -196
- package/src/components/Select/StyledSelect.tsx +2 -15
- package/src/components/Select/__tests__/StyledSelect.spec.tsx +1 -15
- package/src/components/Select/__tests__/__snapshots__/StyledSelect.spec.tsx.snap +0 -54
- package/src/components/TimePicker/TimePickerIOS.tsx +2 -2
- package/src/theme/__tests__/__snapshots__/index.spec.ts.snap +0 -2
- package/src/theme/components/select.ts +0 -2
- package/types/components/Select/StyledSelect.d.ts +2 -10
- package/types/theme/components/select.d.ts +0 -2
package/package.json
CHANGED
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hero-design/rn",
|
|
3
|
-
"version": "7.16.
|
|
3
|
+
"version": "7.16.2",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"module": "es/index.js",
|
|
7
|
-
"react-native": "src/index.ts",
|
|
8
7
|
"types": "types/index.d.ts",
|
|
9
8
|
"scripts": {
|
|
10
9
|
"lint": "eslint src --ext .js,.jsx,.ts,.tsx --ignore-path ../../.gitignore",
|
|
@@ -21,18 +20,18 @@
|
|
|
21
20
|
"dependencies": {
|
|
22
21
|
"@emotion/native": "^11.9.3",
|
|
23
22
|
"@emotion/react": "^11.9.3",
|
|
24
|
-
"@hero-design/colors": "7.16.
|
|
23
|
+
"@hero-design/colors": "7.16.2",
|
|
25
24
|
"date-fns": "^2.16.1",
|
|
26
25
|
"events": "^3.2.0",
|
|
27
26
|
"hero-editor": "^1.9.9"
|
|
28
27
|
},
|
|
29
28
|
"peerDependencies": {
|
|
29
|
+
"@react-native-community/datetimepicker": "^3.5.2",
|
|
30
30
|
"react": "17.0.2",
|
|
31
31
|
"react-native": "0.65.1",
|
|
32
32
|
"react-native-pager-view": "^5.4.25",
|
|
33
33
|
"react-native-safe-area-context": "^4.2.5",
|
|
34
34
|
"react-native-vector-icons": "^9.1.0",
|
|
35
|
-
"@react-native-community/datetimepicker": "^3.5.2",
|
|
36
35
|
"react-native-webview": "^11.15.0"
|
|
37
36
|
},
|
|
38
37
|
"devDependencies": {
|
package/rollup.config.js
CHANGED
|
@@ -23,7 +23,7 @@ const DatePickerIOS = ({
|
|
|
23
23
|
style,
|
|
24
24
|
testID,
|
|
25
25
|
}: DatePickerProps) => {
|
|
26
|
-
const [selectingDate, setSelectingDate] = useState<Date
|
|
26
|
+
const [selectingDate, setSelectingDate] = useState<Date>(value || new Date());
|
|
27
27
|
const [open, setOpen] = useState(false);
|
|
28
28
|
|
|
29
29
|
const displayValue = value ? formatDate(displayFormat, value) : '';
|
|
@@ -70,7 +70,7 @@ const DatePickerIOS = ({
|
|
|
70
70
|
<StyledPickerWrapper>
|
|
71
71
|
<DateTimePicker
|
|
72
72
|
testID="datePickerIOS"
|
|
73
|
-
value={selectingDate
|
|
73
|
+
value={selectingDate}
|
|
74
74
|
mode="date"
|
|
75
75
|
onChange={(_: any, date: Date | undefined) => {
|
|
76
76
|
if (date) {
|
|
@@ -18,8 +18,8 @@ const StyledListItemContainer = styled(TouchableHighlight)<{
|
|
|
18
18
|
alignItems: 'center',
|
|
19
19
|
flexDirection: 'row',
|
|
20
20
|
backgroundColor: themeSelected
|
|
21
|
-
? theme.__hd__.
|
|
22
|
-
: theme.__hd__.
|
|
21
|
+
? theme.__hd__.list.colors.checkedListItemContainerBackground
|
|
22
|
+
: theme.__hd__.list.colors.listItemContainerBackground,
|
|
23
23
|
padding: theme.__hd__.list.space.listItemContainerPadding,
|
|
24
24
|
opacity: themeDisabled
|
|
25
25
|
? theme.__hd__.list.opacity.disabled
|
|
@@ -1,9 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { View } from 'react-native';
|
|
3
2
|
import Icon from '../../Icon';
|
|
4
|
-
|
|
5
|
-
import Typography from '../../Typography';
|
|
6
|
-
import { OptionWrapper } from '../StyledSelect';
|
|
3
|
+
import List from '../../List';
|
|
7
4
|
|
|
8
5
|
const Option = ({
|
|
9
6
|
text,
|
|
@@ -14,12 +11,12 @@ const Option = ({
|
|
|
14
11
|
selected: boolean;
|
|
15
12
|
onPress: () => void;
|
|
16
13
|
}) => (
|
|
17
|
-
<
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
{selected
|
|
22
|
-
|
|
14
|
+
<List.BasicItem
|
|
15
|
+
selected={selected}
|
|
16
|
+
onPress={onPress}
|
|
17
|
+
title={text}
|
|
18
|
+
suffix={selected ? <Icon icon="checkmark" size="small" /> : undefined}
|
|
19
|
+
/>
|
|
23
20
|
);
|
|
24
21
|
|
|
25
22
|
export default Option;
|
|
@@ -2,10 +2,13 @@
|
|
|
2
2
|
|
|
3
3
|
exports[`Option renders correctly 1`] = `
|
|
4
4
|
<View
|
|
5
|
+
accessibilityState={
|
|
6
|
+
Object {
|
|
7
|
+
"disabled": false,
|
|
8
|
+
}
|
|
9
|
+
}
|
|
5
10
|
accessible={true}
|
|
6
|
-
collapsable={false}
|
|
7
11
|
focusable={true}
|
|
8
|
-
nativeID="animatedComponent"
|
|
9
12
|
onClick={[Function]}
|
|
10
13
|
onResponderGrant={[Function]}
|
|
11
14
|
onResponderMove={[Function]}
|
|
@@ -14,22 +17,26 @@ exports[`Option renders correctly 1`] = `
|
|
|
14
17
|
onResponderTerminationRequest={[Function]}
|
|
15
18
|
onStartShouldSetResponder={[Function]}
|
|
16
19
|
style={
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
20
|
+
Array [
|
|
21
|
+
Object {
|
|
22
|
+
"alignItems": "center",
|
|
23
|
+
"backgroundColor": "#f1e9fb",
|
|
24
|
+
"flexDirection": "row",
|
|
25
|
+
"opacity": 1,
|
|
26
|
+
"padding": 16,
|
|
27
|
+
},
|
|
28
|
+
undefined,
|
|
29
|
+
]
|
|
26
30
|
}
|
|
27
31
|
>
|
|
28
32
|
<View
|
|
29
33
|
style={
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
34
|
+
Array [
|
|
35
|
+
Object {
|
|
36
|
+
"flex": 1,
|
|
37
|
+
},
|
|
38
|
+
undefined,
|
|
39
|
+
]
|
|
33
40
|
}
|
|
34
41
|
>
|
|
35
42
|
<Text
|
|
@@ -52,19 +59,30 @@ exports[`Option renders correctly 1`] = `
|
|
|
52
59
|
testOption
|
|
53
60
|
</Text>
|
|
54
61
|
</View>
|
|
55
|
-
<
|
|
56
|
-
name="checkmark"
|
|
62
|
+
<View
|
|
57
63
|
style={
|
|
58
64
|
Array [
|
|
59
65
|
Object {
|
|
60
|
-
"
|
|
61
|
-
"fontSize": 20,
|
|
66
|
+
"marginLeft": 8,
|
|
62
67
|
},
|
|
63
68
|
undefined,
|
|
64
69
|
]
|
|
65
70
|
}
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
71
|
+
>
|
|
72
|
+
<HeroIcon
|
|
73
|
+
name="checkmark"
|
|
74
|
+
style={
|
|
75
|
+
Array [
|
|
76
|
+
Object {
|
|
77
|
+
"color": "#292a2b",
|
|
78
|
+
"fontSize": 20,
|
|
79
|
+
},
|
|
80
|
+
undefined,
|
|
81
|
+
]
|
|
82
|
+
}
|
|
83
|
+
themeIntent="text"
|
|
84
|
+
themeSize="small"
|
|
85
|
+
/>
|
|
86
|
+
</View>
|
|
69
87
|
</View>
|
|
70
88
|
`;
|