@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/package.json CHANGED
@@ -1,10 +1,9 @@
1
1
  {
2
2
  "name": "@hero-design/rn",
3
- "version": "7.16.0",
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.0",
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
@@ -29,6 +29,8 @@ export default {
29
29
  'react-native-safe-area-context',
30
30
  '@react-native-community/datetimepicker',
31
31
  'react-native-webview',
32
+ 'react-native-pager-view',
33
+ 'react-native-vector-icons',
32
34
  ],
33
35
  plugins: [
34
36
  replace({
@@ -23,7 +23,7 @@ const DatePickerIOS = ({
23
23
  style,
24
24
  testID,
25
25
  }: DatePickerProps) => {
26
- const [selectingDate, setSelectingDate] = useState<Date | undefined>(value);
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 || new Date()}
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__.select.colors.checkedOption
22
- : theme.__hd__.select.colors.option,
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
- <OptionWrapper themeSelected={selected} onPress={onPress}>
18
- <View style={{ flex: 1 }}>
19
- <Typography.Text fontSize="large">{text}</Typography.Text>
20
- </View>
21
- {selected && <Icon icon="checkmark" size="small" />}
22
- </OptionWrapper>
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
- Object {
18
- "alignItems": "center",
19
- "backgroundColor": "#f1e9fb",
20
- "borderRadius": 4,
21
- "flexDirection": "row",
22
- "justifyContent": "space-between",
23
- "opacity": 1,
24
- "padding": 16,
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
- Object {
31
- "flex": 1,
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
- <HeroIcon
56
- name="checkmark"
62
+ <View
57
63
  style={
58
64
  Array [
59
65
  Object {
60
- "color": "#292a2b",
61
- "fontSize": 20,
66
+ "marginLeft": 8,
62
67
  },
63
68
  undefined,
64
69
  ]
65
70
  }
66
- themeIntent="text"
67
- themeSize="small"
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
  `;