@holper/react-native-holper-storybook 0.6.100 → 0.6.101
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 +1 -2
- package/lib/components/Card/index.js +8 -6
- package/lib/components/Container/index.js +2 -3
- package/lib/components/FloatingContainer/index.js +23 -19
- package/lib/components/Header/index.js +1 -2
- package/lib/components/ImageResponsive/index.js +11 -11
- package/lib/components/ImageViewer/index.js +18 -13
- package/lib/components/Notification/index.js +1 -2
- package/lib/components/Text/index.js +1 -2
- package/package.json +1 -2
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import React, { useState, useEffect } from 'react';
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
3
|
import { TouchableOpacity, ActivityIndicator } from 'react-native';
|
|
4
|
-
import { ViewPropTypes } from 'deprecated-react-native-prop-types';
|
|
5
4
|
import withPreventDoubleClick from './../PreventDoubleClick';
|
|
6
5
|
import { Colors } from '../../configs/constants';
|
|
7
6
|
import style from './style';
|
|
@@ -97,7 +96,7 @@ Button.propTypes = {
|
|
|
97
96
|
'secondary',
|
|
98
97
|
]),
|
|
99
98
|
size: PropTypes.oneOf(['tiny', 'small', 'medium', 'fit', 'icon']),
|
|
100
|
-
style:
|
|
99
|
+
style: PropTypes.any,
|
|
101
100
|
onPress: PropTypes.func,
|
|
102
101
|
debounceDelay: PropTypes.number,
|
|
103
102
|
};
|
|
@@ -1,13 +1,15 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
3
|
import { View, TouchableOpacity } from 'react-native';
|
|
4
|
-
import {ViewPropTypes} from 'deprecated-react-native-prop-types';
|
|
5
4
|
import withPreventDoubleClick from '../PreventDoubleClick';
|
|
6
5
|
import style from './style';
|
|
7
6
|
|
|
8
7
|
const TappedTouchableOpacity = withPreventDoubleClick(TouchableOpacity);
|
|
9
8
|
|
|
10
|
-
const Card = (
|
|
9
|
+
const Card = (
|
|
10
|
+
{ children, isButton, onPress, noShadow, style: customStyle },
|
|
11
|
+
...props
|
|
12
|
+
) => (
|
|
11
13
|
<>
|
|
12
14
|
{isButton ? (
|
|
13
15
|
<TappedTouchableOpacity
|
|
@@ -33,15 +35,15 @@ Card.defaultProps = {
|
|
|
33
35
|
children: null,
|
|
34
36
|
isButton: false,
|
|
35
37
|
noShadow: false,
|
|
36
|
-
onPress: () => {}
|
|
38
|
+
onPress: () => {},
|
|
37
39
|
};
|
|
38
40
|
|
|
39
41
|
Card.propTypes = {
|
|
40
|
-
style:
|
|
42
|
+
style: PropTypes.any,
|
|
41
43
|
children: PropTypes.node,
|
|
42
44
|
isButton: PropTypes.bool,
|
|
43
45
|
noShadow: PropTypes.bool,
|
|
44
|
-
onPress: PropTypes.func
|
|
46
|
+
onPress: PropTypes.func,
|
|
45
47
|
};
|
|
46
48
|
|
|
47
|
-
export default Card;
|
|
49
|
+
export default Card;
|
|
@@ -7,7 +7,6 @@ import {
|
|
|
7
7
|
ScrollView,
|
|
8
8
|
View,
|
|
9
9
|
} from 'react-native';
|
|
10
|
-
import { ViewPropTypes } from 'deprecated-react-native-prop-types';
|
|
11
10
|
import style from './style';
|
|
12
11
|
|
|
13
12
|
const Container = ({
|
|
@@ -48,8 +47,8 @@ Container.defaultProps = {
|
|
|
48
47
|
Container.propTypes = {
|
|
49
48
|
fullScreen: PropTypes.bool,
|
|
50
49
|
enableScroll: PropTypes.bool,
|
|
51
|
-
style:
|
|
52
|
-
scrollStyle:
|
|
50
|
+
style: PropTypes.any,
|
|
51
|
+
scrollStyle: PropTypes.any,
|
|
53
52
|
};
|
|
54
53
|
|
|
55
54
|
export default Container;
|
|
@@ -1,18 +1,23 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
|
-
import {
|
|
4
|
-
|
|
3
|
+
import {
|
|
4
|
+
View,
|
|
5
|
+
ScrollView,
|
|
6
|
+
RefreshControl,
|
|
7
|
+
KeyboardAvoidingView,
|
|
8
|
+
Platform,
|
|
9
|
+
} from 'react-native';
|
|
5
10
|
import style from './style';
|
|
6
11
|
|
|
7
12
|
const FloatingContainer = ({
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
13
|
+
useRefreshControl,
|
|
14
|
+
onRefresh,
|
|
15
|
+
isRefreshing,
|
|
16
|
+
children,
|
|
17
|
+
floatingComponent,
|
|
18
|
+
centered,
|
|
19
|
+
floatingContainerStyle,
|
|
20
|
+
disableScroll,
|
|
16
21
|
}) => (
|
|
17
22
|
<KeyboardAvoidingView
|
|
18
23
|
style={style.floatingContainer}
|
|
@@ -27,16 +32,15 @@ const FloatingContainer = ({
|
|
|
27
32
|
keyboardDismissMode='on-drag'
|
|
28
33
|
refreshControl={
|
|
29
34
|
useRefreshControl ? (
|
|
30
|
-
<RefreshControl
|
|
31
|
-
|
|
32
|
-
onRefresh={onRefresh}
|
|
33
|
-
/>
|
|
34
|
-
) : false
|
|
35
|
+
<RefreshControl refreshing={isRefreshing} onRefresh={onRefresh} />
|
|
36
|
+
) : null
|
|
35
37
|
}
|
|
36
38
|
>
|
|
37
39
|
{children}
|
|
38
40
|
</ScrollView>
|
|
39
|
-
<View style={[style.container, floatingContainerStyle]}>
|
|
41
|
+
<View style={[style.container, floatingContainerStyle]}>
|
|
42
|
+
{floatingComponent}
|
|
43
|
+
</View>
|
|
40
44
|
</KeyboardAvoidingView>
|
|
41
45
|
);
|
|
42
46
|
|
|
@@ -48,7 +52,7 @@ FloatingContainer.defaultProps = {
|
|
|
48
52
|
children: null,
|
|
49
53
|
floatingComponent: null,
|
|
50
54
|
disableScroll: false,
|
|
51
|
-
floatingContainerStyle: {}
|
|
55
|
+
floatingContainerStyle: {},
|
|
52
56
|
};
|
|
53
57
|
|
|
54
58
|
FloatingContainer.propTypes = {
|
|
@@ -59,7 +63,7 @@ FloatingContainer.propTypes = {
|
|
|
59
63
|
children: PropTypes.node,
|
|
60
64
|
floatingComponent: PropTypes.node,
|
|
61
65
|
disableScroll: PropTypes.bool,
|
|
62
|
-
floatingContainerStyle:
|
|
66
|
+
floatingContainerStyle: PropTypes.any,
|
|
63
67
|
};
|
|
64
68
|
|
|
65
|
-
export default FloatingContainer;
|
|
69
|
+
export default FloatingContainer;
|
|
@@ -1,7 +1,6 @@
|
|
|
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';
|
|
5
4
|
import Ionicons from 'react-native-vector-icons/Ionicons';
|
|
6
5
|
import { Colors } from '../../configs/constants';
|
|
7
6
|
import style from './style';
|
|
@@ -38,7 +37,7 @@ Header.defaultProps = {
|
|
|
38
37
|
|
|
39
38
|
Header.propTypes = {
|
|
40
39
|
inverted: PropTypes.bool,
|
|
41
|
-
logo:
|
|
40
|
+
logo: PropTypes.any.isRequired,
|
|
42
41
|
right: PropTypes.node,
|
|
43
42
|
onMenuPress: PropTypes.func,
|
|
44
43
|
};
|
|
@@ -1,39 +1,39 @@
|
|
|
1
1
|
import React, { useState } from 'react';
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
3
|
import { Image, View } from 'react-native';
|
|
4
|
-
import {ViewPropTypes, ImagePropTypes} from 'deprecated-react-native-prop-types';
|
|
5
4
|
import style from './style';
|
|
6
5
|
|
|
7
6
|
const ImageResponsive = ({ source, style: customStyle, avatar, ...props }) => {
|
|
8
7
|
const [width, setWidth] = useState(100);
|
|
9
8
|
|
|
10
9
|
return (
|
|
11
|
-
<View
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
10
|
+
<View
|
|
11
|
+
style={[
|
|
12
|
+
customStyle,
|
|
13
|
+
avatar ? { borderRadius: width / 2, overflow: 'hidden' } : {},
|
|
14
|
+
]}
|
|
15
15
|
>
|
|
16
16
|
<Image
|
|
17
17
|
style={style.responsiveImage}
|
|
18
18
|
source={source}
|
|
19
19
|
resizeMode={avatar ? 'cover' : 'contain'}
|
|
20
|
-
onLayout={({nativeEvent}) => setWidth(nativeEvent.layout.width)}
|
|
20
|
+
onLayout={({ nativeEvent }) => setWidth(nativeEvent.layout.width)}
|
|
21
21
|
{...props}
|
|
22
22
|
/>
|
|
23
23
|
</View>
|
|
24
24
|
);
|
|
25
|
-
}
|
|
25
|
+
};
|
|
26
26
|
|
|
27
27
|
ImageResponsive.defaultProps = {
|
|
28
28
|
style: {},
|
|
29
29
|
source: null,
|
|
30
|
-
avatar: false
|
|
30
|
+
avatar: false,
|
|
31
31
|
};
|
|
32
32
|
|
|
33
33
|
ImageResponsive.propTypes = {
|
|
34
|
-
style:
|
|
35
|
-
source:
|
|
36
|
-
avatar: PropTypes.bool
|
|
34
|
+
style: PropTypes.any,
|
|
35
|
+
source: PropTypes.any.isRequired,
|
|
36
|
+
avatar: PropTypes.bool,
|
|
37
37
|
};
|
|
38
38
|
|
|
39
39
|
export default ImageResponsive;
|
|
@@ -1,10 +1,16 @@
|
|
|
1
1
|
import React, { useState } from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import {
|
|
3
|
+
View,
|
|
4
|
+
Modal,
|
|
5
|
+
TouchableOpacity,
|
|
6
|
+
ActivityIndicator,
|
|
7
|
+
Image,
|
|
8
|
+
} from 'react-native';
|
|
3
9
|
import Ionicons from 'react-native-vector-icons/Ionicons';
|
|
4
|
-
import {ImagePropTypes} from 'deprecated-react-native-prop-types';
|
|
5
10
|
import ImageResponsive from '../ImageResponsive';
|
|
6
11
|
import { Colors } from '../../configs/constants';
|
|
7
12
|
import style from './style';
|
|
13
|
+
import PropTypes from 'prop-types';
|
|
8
14
|
|
|
9
15
|
const ImageViewer = ({ source, style: imageStyle, ...props }) => {
|
|
10
16
|
const [loading, setLoading] = useState(true);
|
|
@@ -13,21 +19,20 @@ const ImageViewer = ({ source, style: imageStyle, ...props }) => {
|
|
|
13
19
|
return (
|
|
14
20
|
<>
|
|
15
21
|
<TouchableOpacity onPress={() => setVisible(true)}>
|
|
16
|
-
<ImageResponsive
|
|
17
|
-
source={source}
|
|
18
|
-
style={imageStyle}
|
|
19
|
-
{...props}
|
|
20
|
-
/>
|
|
22
|
+
<ImageResponsive source={source} style={imageStyle} {...props} />
|
|
21
23
|
</TouchableOpacity>
|
|
22
24
|
|
|
23
25
|
<Modal
|
|
24
|
-
animationType=
|
|
26
|
+
animationType='slide'
|
|
25
27
|
transparent={true}
|
|
26
28
|
visible={visible}
|
|
27
29
|
onRequestClose={() => {}}
|
|
28
30
|
>
|
|
29
31
|
<View style={style.container}>
|
|
30
|
-
<TouchableOpacity
|
|
32
|
+
<TouchableOpacity
|
|
33
|
+
onPress={() => setVisible(false)}
|
|
34
|
+
style={style.closeIcon}
|
|
35
|
+
>
|
|
31
36
|
<Ionicons name='close-outline' size={24} color={Colors.darkblue} />
|
|
32
37
|
</TouchableOpacity>
|
|
33
38
|
|
|
@@ -37,7 +42,7 @@ const ImageViewer = ({ source, style: imageStyle, ...props }) => {
|
|
|
37
42
|
onLoadEnd={() => setLoading(false)}
|
|
38
43
|
/>
|
|
39
44
|
|
|
40
|
-
{
|
|
45
|
+
{loading && <ActivityIndicator style={style.activityIndicator} />}
|
|
41
46
|
</View>
|
|
42
47
|
</Modal>
|
|
43
48
|
</>
|
|
@@ -46,12 +51,12 @@ const ImageViewer = ({ source, style: imageStyle, ...props }) => {
|
|
|
46
51
|
|
|
47
52
|
ImageViewer.defaultProps = {
|
|
48
53
|
source: null,
|
|
49
|
-
style: {}
|
|
54
|
+
style: {},
|
|
50
55
|
};
|
|
51
56
|
|
|
52
57
|
ImageViewer.propTypes = {
|
|
53
|
-
source:
|
|
54
|
-
style:
|
|
58
|
+
source: PropTypes.any.isRequired,
|
|
59
|
+
style: PropTypes.any,
|
|
55
60
|
};
|
|
56
61
|
|
|
57
62
|
export default ImageViewer;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
3
|
import { TouchableOpacity, View } from 'react-native';
|
|
4
|
-
import { ImagePropTypes } from 'deprecated-react-native-prop-types';
|
|
5
4
|
import Text from '../Text';
|
|
6
5
|
import ImageResponsive from '../ImageResponsive';
|
|
7
6
|
import { Colors } from '../../configs/constants';
|
|
@@ -71,7 +70,7 @@ Notification.propTypes = {
|
|
|
71
70
|
first: PropTypes.bool,
|
|
72
71
|
active: PropTypes.bool,
|
|
73
72
|
hideAvatar: PropTypes.bool,
|
|
74
|
-
avatar:
|
|
73
|
+
avatar: PropTypes.any,
|
|
75
74
|
title: PropTypes.string,
|
|
76
75
|
description: PropTypes.string,
|
|
77
76
|
date: PropTypes.instanceOf(moment),
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
3
|
import { Text as RNText } from 'react-native';
|
|
4
|
-
import { TextPropTypes } from 'deprecated-react-native-prop-types';
|
|
5
4
|
import style from './style';
|
|
6
5
|
|
|
7
6
|
const Text = ({
|
|
@@ -69,7 +68,7 @@ Text.propTypes = {
|
|
|
69
68
|
]),
|
|
70
69
|
weight: PropTypes.oneOf(['regular', 'bold', 'semiBold']),
|
|
71
70
|
align: PropTypes.oneOf(['left', 'right', 'center', 'justify']),
|
|
72
|
-
style:
|
|
71
|
+
style: PropTypes.any,
|
|
73
72
|
children: PropTypes.node,
|
|
74
73
|
};
|
|
75
74
|
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"main": "lib/index.js",
|
|
3
3
|
"name": "@holper/react-native-holper-storybook",
|
|
4
4
|
"description": "A component library for Holper projects",
|
|
5
|
-
"version": "0.6.
|
|
5
|
+
"version": "0.6.101",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"files": [
|
|
8
8
|
"lib",
|
|
@@ -30,7 +30,6 @@
|
|
|
30
30
|
"@react-native-async-storage/async-storage": "2.1.2",
|
|
31
31
|
"@react-native-community/datetimepicker": "8.3.0",
|
|
32
32
|
"@react-native-community/slider": "4.5.6",
|
|
33
|
-
"deprecated-react-native-prop-types": "^5.0.0",
|
|
34
33
|
"expo": "^53.0.10",
|
|
35
34
|
"expo-asset": "~11.1.5",
|
|
36
35
|
"expo-camera": "~16.1.7",
|