@holper/react-native-holper-storybook 0.6.58 → 0.6.60
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/lib/components/Button/index.js +0 -1
- package/lib/components/Button/style.js +6 -11
- package/lib/components/ConfirmationModal/index.js +6 -3
- package/lib/components/Footer/index.js +25 -20
- package/lib/components/Footer/style.js +8 -8
- package/lib/components/Header/index.js +9 -9
- package/lib/components/Header/style.js +7 -7
- package/lib/components/Text/index.js +5 -4
- package/lib/components/Text/style.js +3 -0
- package/lib/configs/constants.js +1 -0
- package/package.json +1 -1
|
@@ -22,9 +22,9 @@ export default {
|
|
|
22
22
|
},
|
|
23
23
|
// Variants
|
|
24
24
|
primary: {
|
|
25
|
-
borderColor: Colors.
|
|
26
|
-
backgroundColor: Colors.
|
|
27
|
-
shadowColor: Colors.
|
|
25
|
+
borderColor: Colors.darkgray,
|
|
26
|
+
backgroundColor: Colors.darkgray,
|
|
27
|
+
shadowColor: Colors.darkgray,
|
|
28
28
|
},
|
|
29
29
|
secondary: {
|
|
30
30
|
borderColor: Colors.lightblue,
|
|
@@ -47,20 +47,15 @@ export default {
|
|
|
47
47
|
shadowColor: Colors.brightblue,
|
|
48
48
|
},
|
|
49
49
|
inverted: {
|
|
50
|
-
borderColor: Colors.
|
|
51
|
-
backgroundColor: Colors.
|
|
52
|
-
shadowColor: Colors.
|
|
50
|
+
borderColor: Colors.violet,
|
|
51
|
+
backgroundColor: Colors.violet,
|
|
52
|
+
shadowColor: Colors.violet,
|
|
53
53
|
},
|
|
54
54
|
error: {
|
|
55
55
|
borderColor: Colors.red,
|
|
56
56
|
backgroundColor: Colors.red,
|
|
57
57
|
shadowColor: Colors.red,
|
|
58
58
|
},
|
|
59
|
-
highlight: {
|
|
60
|
-
borderColor: Colors.violet,
|
|
61
|
-
backgroundColor: Colors.violet,
|
|
62
|
-
shadowColor: Colors.violet,
|
|
63
|
-
},
|
|
64
59
|
// Bordered
|
|
65
60
|
bordered: {
|
|
66
61
|
shadowColor: Colors.transparent,
|
|
@@ -27,6 +27,7 @@ const ConfirmationModal = ({
|
|
|
27
27
|
alertMode,
|
|
28
28
|
infoMode,
|
|
29
29
|
inverted,
|
|
30
|
+
isPrime,
|
|
30
31
|
children,
|
|
31
32
|
}) => (
|
|
32
33
|
<Modal
|
|
@@ -83,7 +84,7 @@ const ConfirmationModal = ({
|
|
|
83
84
|
variant={inverted ? 'inverted' : 'primary'}
|
|
84
85
|
onPress={onConfirm}
|
|
85
86
|
>
|
|
86
|
-
<Text size='large' color='white'>
|
|
87
|
+
<Text size='large' color={isPrime ? 'gold' : 'white'}>
|
|
87
88
|
{confirmText}
|
|
88
89
|
</Text>
|
|
89
90
|
</Button>
|
|
@@ -93,7 +94,7 @@ const ConfirmationModal = ({
|
|
|
93
94
|
<Button
|
|
94
95
|
size='small'
|
|
95
96
|
bordered
|
|
96
|
-
variant='inverted'
|
|
97
|
+
variant={inverted ? 'inverted' : 'primary'}
|
|
97
98
|
onPress={onCancel}
|
|
98
99
|
>
|
|
99
100
|
<Text size='large'>{cancelText}</Text>
|
|
@@ -104,7 +105,7 @@ const ConfirmationModal = ({
|
|
|
104
105
|
size={onCancel ? 'small' : 'fit'}
|
|
105
106
|
onPress={onConfirm}
|
|
106
107
|
>
|
|
107
|
-
<Text size='large' color='white'>
|
|
108
|
+
<Text size='large' color={isPrime ? 'gold' : 'white'}>
|
|
108
109
|
{confirmText}
|
|
109
110
|
</Text>
|
|
110
111
|
</Button>
|
|
@@ -131,6 +132,7 @@ ConfirmationModal.defaultProps = {
|
|
|
131
132
|
closeButton: false,
|
|
132
133
|
infoMode: false,
|
|
133
134
|
inverted: false,
|
|
135
|
+
isPrime: false,
|
|
134
136
|
children: null,
|
|
135
137
|
};
|
|
136
138
|
|
|
@@ -146,6 +148,7 @@ ConfirmationModal.propTypes = {
|
|
|
146
148
|
closeButton: PropTypes.bool,
|
|
147
149
|
infoMode: PropTypes.bool,
|
|
148
150
|
inverted: PropTypes.bool,
|
|
151
|
+
isPrime: PropTypes.bool,
|
|
149
152
|
children: PropTypes.node,
|
|
150
153
|
};
|
|
151
154
|
|
|
@@ -6,8 +6,8 @@ import { Colors } from '../../configs/constants';
|
|
|
6
6
|
import Text from '../Text';
|
|
7
7
|
import style from './style';
|
|
8
8
|
|
|
9
|
-
const Footer = ({ inverted, tabs }) => {
|
|
10
|
-
const renderTab = () =>
|
|
9
|
+
const Footer = ({ inverted, tabs, isPrime }) => {
|
|
10
|
+
const renderTab = () =>
|
|
11
11
|
tabs.map((tab, index) => (
|
|
12
12
|
<TouchableOpacity
|
|
13
13
|
key={`tab-${index}`}
|
|
@@ -17,24 +17,25 @@ const Footer = ({ inverted, tabs }) => {
|
|
|
17
17
|
<Ionicons
|
|
18
18
|
name={tab.icon}
|
|
19
19
|
size={20}
|
|
20
|
-
color={
|
|
20
|
+
color={isPrime ? Colors.gold : Colors.white}
|
|
21
21
|
/>
|
|
22
|
-
<Text color={
|
|
23
|
-
|
|
22
|
+
<Text color={isPrime ? 'gold' : 'white'} size='small'>
|
|
23
|
+
{tab.text}
|
|
24
|
+
</Text>
|
|
25
|
+
{tab.badge && tab.badge > 0 && (
|
|
24
26
|
<View style={style.badge}>
|
|
25
|
-
<Text color='white' size='tiny' weight='semiBold' align='center'>
|
|
27
|
+
<Text color='white' size='tiny' weight='semiBold' align='center'>
|
|
28
|
+
{tab.badge > 9 ? '+9' : tab.badge}
|
|
29
|
+
</Text>
|
|
26
30
|
</View>
|
|
27
31
|
)}
|
|
28
32
|
</TouchableOpacity>
|
|
29
|
-
))
|
|
30
|
-
);
|
|
33
|
+
));
|
|
31
34
|
|
|
32
35
|
return (
|
|
33
36
|
<View
|
|
34
|
-
style={[
|
|
35
|
-
|
|
36
|
-
style[inverted ? 'inverted' : 'default']
|
|
37
|
-
]}>
|
|
37
|
+
style={[style.footerContainer, style[inverted ? 'inverted' : 'default']]}
|
|
38
|
+
>
|
|
38
39
|
{renderTab()}
|
|
39
40
|
</View>
|
|
40
41
|
);
|
|
@@ -42,17 +43,21 @@ const Footer = ({ inverted, tabs }) => {
|
|
|
42
43
|
|
|
43
44
|
Footer.defaultProps = {
|
|
44
45
|
inverted: false,
|
|
45
|
-
|
|
46
|
+
isPrime: false,
|
|
47
|
+
tabs: [],
|
|
46
48
|
};
|
|
47
49
|
|
|
48
50
|
Footer.propTypes = {
|
|
49
51
|
inverted: PropTypes.bool,
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
52
|
+
isPrime: PropTypes.bool,
|
|
53
|
+
tabs: PropTypes.arrayOf(
|
|
54
|
+
PropTypes.shape({
|
|
55
|
+
onPress: PropTypes.func,
|
|
56
|
+
text: PropTypes.string,
|
|
57
|
+
icon: PropTypes.string,
|
|
58
|
+
badge: PropTypes.number,
|
|
59
|
+
})
|
|
60
|
+
),
|
|
56
61
|
};
|
|
57
62
|
|
|
58
|
-
export default Footer;
|
|
63
|
+
export default Footer;
|
|
@@ -11,20 +11,20 @@ export default {
|
|
|
11
11
|
paddingHorizontal: 15,
|
|
12
12
|
flexDirection: 'row',
|
|
13
13
|
justifyContent: 'space-around',
|
|
14
|
-
alignItems: 'center'
|
|
14
|
+
alignItems: 'center',
|
|
15
15
|
},
|
|
16
16
|
default: {
|
|
17
|
-
backgroundColor: Colors.
|
|
18
|
-
borderTopColor: Colors.
|
|
19
|
-
borderTopWidth: 1
|
|
17
|
+
backgroundColor: Colors.darkgray,
|
|
18
|
+
borderTopColor: Colors.darkblue,
|
|
19
|
+
borderTopWidth: 1,
|
|
20
20
|
},
|
|
21
21
|
inverted: {
|
|
22
|
-
backgroundColor: Colors.
|
|
22
|
+
backgroundColor: Colors.violet,
|
|
23
23
|
},
|
|
24
24
|
tab: {
|
|
25
25
|
flexDirection: 'column',
|
|
26
26
|
justifyContent: 'center',
|
|
27
|
-
alignItems: 'center'
|
|
27
|
+
alignItems: 'center',
|
|
28
28
|
},
|
|
29
29
|
badge: {
|
|
30
30
|
position: 'absolute',
|
|
@@ -34,6 +34,6 @@ export default {
|
|
|
34
34
|
height: 18,
|
|
35
35
|
width: 18,
|
|
36
36
|
borderRadius: 9,
|
|
37
|
-
justifyContent: 'center'
|
|
38
|
-
}
|
|
37
|
+
justifyContent: 'center',
|
|
38
|
+
},
|
|
39
39
|
};
|
|
@@ -1,22 +1,20 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
3
|
import { View, TouchableOpacity, Image } from 'react-native';
|
|
4
|
-
import {ImagePropTypes} from 'deprecated-react-native-prop-types';
|
|
4
|
+
import { ImagePropTypes } from 'deprecated-react-native-prop-types';
|
|
5
5
|
import Ionicons from 'react-native-vector-icons/Ionicons';
|
|
6
6
|
import { Colors } from '../../configs/constants';
|
|
7
7
|
import style from './style';
|
|
8
8
|
|
|
9
|
-
const Header = ({ inverted, logo, right, onMenuPress }) => (
|
|
9
|
+
const Header = ({ inverted, logo, right, onMenuPress, isPrime }) => (
|
|
10
10
|
<View
|
|
11
|
-
style={[
|
|
12
|
-
|
|
13
|
-
style[inverted ? 'inverted' : 'default']
|
|
14
|
-
]}>
|
|
11
|
+
style={[style.headerContainer, style[inverted ? 'inverted' : 'default']]}
|
|
12
|
+
>
|
|
15
13
|
<TouchableOpacity onPress={onMenuPress}>
|
|
16
14
|
<Ionicons
|
|
17
15
|
name='menu-outline'
|
|
18
16
|
size={30}
|
|
19
|
-
color={
|
|
17
|
+
color={isPrime ? Colors.gold : Colors.white}
|
|
20
18
|
/>
|
|
21
19
|
</TouchableOpacity>
|
|
22
20
|
<View style={style.imageContainer}>
|
|
@@ -33,16 +31,18 @@ const Header = ({ inverted, logo, right, onMenuPress }) => (
|
|
|
33
31
|
|
|
34
32
|
Header.defaultProps = {
|
|
35
33
|
inverted: false,
|
|
34
|
+
isPrime: false,
|
|
36
35
|
logo: null,
|
|
37
36
|
right: null,
|
|
38
|
-
onMenuPress: () => {}
|
|
37
|
+
onMenuPress: () => {},
|
|
39
38
|
};
|
|
40
39
|
|
|
41
40
|
Header.propTypes = {
|
|
42
41
|
inverted: PropTypes.bool,
|
|
42
|
+
isPrime: PropTypes.bool,
|
|
43
43
|
logo: ImagePropTypes.source.isRequired,
|
|
44
44
|
right: PropTypes.node,
|
|
45
|
-
onMenuPress: PropTypes.func
|
|
45
|
+
onMenuPress: PropTypes.func,
|
|
46
46
|
};
|
|
47
47
|
|
|
48
48
|
export default Header;
|
|
@@ -11,23 +11,23 @@ export default {
|
|
|
11
11
|
paddingHorizontal: 15,
|
|
12
12
|
flexDirection: 'row',
|
|
13
13
|
justifyContent: 'space-between',
|
|
14
|
-
alignItems: 'center'
|
|
14
|
+
alignItems: 'center',
|
|
15
15
|
},
|
|
16
16
|
default: {
|
|
17
|
-
backgroundColor: Colors.
|
|
18
|
-
borderBottomColor: Colors.
|
|
19
|
-
borderBottomWidth: 1
|
|
17
|
+
backgroundColor: Colors.darkgray,
|
|
18
|
+
borderBottomColor: Colors.darkblue,
|
|
19
|
+
borderBottomWidth: 1,
|
|
20
20
|
},
|
|
21
21
|
inverted: {
|
|
22
|
-
backgroundColor: Colors.
|
|
22
|
+
backgroundColor: Colors.violet,
|
|
23
23
|
},
|
|
24
24
|
imageContainer: {
|
|
25
25
|
height: 40,
|
|
26
|
-
flex: 1
|
|
26
|
+
flex: 1,
|
|
27
27
|
},
|
|
28
28
|
imageResponsive: {
|
|
29
29
|
height: undefined,
|
|
30
30
|
width: undefined,
|
|
31
|
-
flex: 1
|
|
31
|
+
flex: 1,
|
|
32
32
|
},
|
|
33
33
|
};
|
|
@@ -42,15 +42,16 @@ Text.defaultProps = {
|
|
|
42
42
|
|
|
43
43
|
Text.propTypes = {
|
|
44
44
|
color: PropTypes.oneOf([
|
|
45
|
+
'brightblue',
|
|
45
46
|
'dark',
|
|
47
|
+
'gold',
|
|
48
|
+
'green',
|
|
46
49
|
'light',
|
|
47
50
|
'lighter',
|
|
48
|
-
'white',
|
|
49
|
-
'green',
|
|
50
51
|
'red',
|
|
51
|
-
'yellow',
|
|
52
52
|
'violet',
|
|
53
|
-
'
|
|
53
|
+
'white',
|
|
54
|
+
'yellow',
|
|
54
55
|
]),
|
|
55
56
|
variant: PropTypes.oneOf(['default', 'lowercase', 'uppercase']),
|
|
56
57
|
size: PropTypes.oneOf([
|
package/lib/configs/constants.js
CHANGED