@bigbinary/neetoui-rn 0.0.269 → 0.0.270
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 +1 -2
- package/src/components/Accordion.jsx +0 -266
- package/src/components/ActionIcon.jsx +0 -76
- package/src/components/Alert.jsx +0 -262
- package/src/components/AnimatedImage.jsx +0 -140
- package/src/components/Avatar.jsx +0 -144
- package/src/components/Badge.jsx +0 -97
- package/src/components/BottomSheet.jsx +0 -487
- package/src/components/BottomTabBar.jsx +0 -232
- package/src/components/Button.jsx +0 -275
- package/src/components/ButtonGroup.jsx +0 -120
- package/src/components/Calendar.jsx +0 -128
- package/src/components/Card.jsx +0 -90
- package/src/components/Carousel.jsx +0 -116
- package/src/components/ChatInput/AttachmentsView.jsx +0 -51
- package/src/components/ChatInput/Badge.jsx +0 -24
- package/src/components/ChatInput/ChatInput.jsx +0 -564
- package/src/components/ChatInput/EmailFields.jsx +0 -122
- package/src/components/ChatInput/IconButton.jsx +0 -34
- package/src/components/ChatInput/MentionsInputWrapper.jsx +0 -155
- package/src/components/CheckBox.jsx +0 -150
- package/src/components/Chip.jsx +0 -180
- package/src/components/Container.jsx +0 -31
- package/src/components/Divider.jsx +0 -79
- package/src/components/FAB.jsx +0 -113
- package/src/components/FlashList.jsx +0 -189
- package/src/components/FlatList.js +0 -10
- package/src/components/Input.jsx +0 -357
- package/src/components/InputEmailChip.jsx +0 -246
- package/src/components/LineLoader.jsx +0 -46
- package/src/components/ListItem.jsx +0 -68
- package/src/components/Loader.jsx +0 -122
- package/src/components/MultiSelect.jsx +0 -631
- package/src/components/NotificationIcon.jsx +0 -38
- package/src/components/NotificationPreferenceList.jsx +0 -208
- package/src/components/OnBoarding.jsx +0 -134
- package/src/components/OrganizationItem.jsx +0 -110
- package/src/components/OtpInputs.jsx +0 -194
- package/src/components/ParentView.jsx +0 -139
- package/src/components/Popover.jsx +0 -221
- package/src/components/RadioButton.jsx +0 -155
- package/src/components/RichTextEditor.jsx +0 -163
- package/src/components/Ripple.jsx +0 -281
- package/src/components/ScrollView.js +0 -14
- package/src/components/SearchBar.jsx +0 -207
- package/src/components/SegmentedTopBar/Indicator.jsx +0 -77
- package/src/components/SegmentedTopBar/Tab.jsx +0 -37
- package/src/components/SegmentedTopBar/index.jsx +0 -128
- package/src/components/SocialButton.jsx +0 -106
- package/src/components/Toast.jsx +0 -195
- package/src/components/ToggleSwitch.jsx +0 -112
- package/src/components/TopBar.jsx +0 -147
- package/src/components/Touchable.jsx +0 -133
- package/src/components/TouchableWithoutFeedback.jsx +0 -51
- package/src/components/Typography.jsx +0 -93
- package/src/components/index.js +0 -45
- package/src/config/index.js +0 -1
- package/src/config/toasterConfig.jsx +0 -142
- package/src/contexts/index.js +0 -3
- package/src/hooks/index.js +0 -3
- package/src/hooks/useDebounce.js +0 -17
- package/src/hooks/useKeyboard.js +0 -33
- package/src/hooks/useRefreshByUser.js +0 -20
- package/src/index.js +0 -2
- package/src/theme/index.js +0 -181
- package/src/utils/utils.js +0 -56
|
@@ -1,140 +0,0 @@
|
|
|
1
|
-
import React, { useState } from "react";
|
|
2
|
-
|
|
3
|
-
import PropTypes from "prop-types";
|
|
4
|
-
import RNFImage from "react-native-fast-image";
|
|
5
|
-
import Animated, {
|
|
6
|
-
Easing,
|
|
7
|
-
useAnimatedStyle,
|
|
8
|
-
useSharedValue,
|
|
9
|
-
withTiming,
|
|
10
|
-
} from "react-native-reanimated";
|
|
11
|
-
import { moderateScale } from "react-native-size-matters";
|
|
12
|
-
import styled from "styled-components/native";
|
|
13
|
-
import { flexbox, space, border, color, layout } from "styled-system";
|
|
14
|
-
|
|
15
|
-
import ImagePlaceholder from "@assets/images/image-placeholder.svg";
|
|
16
|
-
import { Container, Loader } from "@components";
|
|
17
|
-
|
|
18
|
-
import { theme } from "../theme";
|
|
19
|
-
|
|
20
|
-
const StyledImage = styled(RNFImage)`
|
|
21
|
-
${flexbox}
|
|
22
|
-
${space}
|
|
23
|
-
${border}
|
|
24
|
-
${color}
|
|
25
|
-
${layout}
|
|
26
|
-
`;
|
|
27
|
-
|
|
28
|
-
/**
|
|
29
|
-
* AnimatedImage can be used to display a placeholder before image is loaded with animation.
|
|
30
|
-
*
|
|
31
|
-
* <div class="screenshots">
|
|
32
|
-
* <img src="screenshots/avatar/images.png" />
|
|
33
|
-
* <img src="screenshots/avatar/texts.png" />
|
|
34
|
-
* </div>
|
|
35
|
-
*
|
|
36
|
-
* ## Usage
|
|
37
|
-
* ```js
|
|
38
|
-
* import * as React from 'react';
|
|
39
|
-
* import { Typography, Avatar } from '@bigbinary/neetoui-rn';
|
|
40
|
-
*
|
|
41
|
-
* export default function Main() {
|
|
42
|
-
* return (
|
|
43
|
-
* <Container>
|
|
44
|
-
* <AnimatedImage
|
|
45
|
-
* imageHeight={moderateScale(139)}
|
|
46
|
-
* imageWidth={moderateScale(255)}
|
|
47
|
-
* imageUrl="https://picsum.photos/255/139"
|
|
48
|
-
* />
|
|
49
|
-
* </Container>
|
|
50
|
-
* );
|
|
51
|
-
* }
|
|
52
|
-
* ```
|
|
53
|
-
*/
|
|
54
|
-
|
|
55
|
-
const borderRadius = moderateScale(10);
|
|
56
|
-
export const AnimatedImage = ({
|
|
57
|
-
imageHeight = 139,
|
|
58
|
-
imageWidth = 255,
|
|
59
|
-
imageUrl,
|
|
60
|
-
...rest
|
|
61
|
-
}) => {
|
|
62
|
-
const opacity = useSharedValue(0);
|
|
63
|
-
const [isImageLoaded, setIsImageLoaded] = useState(false);
|
|
64
|
-
|
|
65
|
-
const profileImageStyle = useAnimatedStyle(() => ({
|
|
66
|
-
opacity: withTiming(opacity.value, {
|
|
67
|
-
duration: 300,
|
|
68
|
-
easing: Easing.bezier(0.25, 0.1, 0.25, 1),
|
|
69
|
-
}),
|
|
70
|
-
height: imageHeight,
|
|
71
|
-
width: imageWidth,
|
|
72
|
-
alignSelf: "center",
|
|
73
|
-
borderRadius,
|
|
74
|
-
}));
|
|
75
|
-
|
|
76
|
-
return (
|
|
77
|
-
<Container
|
|
78
|
-
alignItems="center"
|
|
79
|
-
borderRadius={moderateScale(10)}
|
|
80
|
-
justifyContent="center"
|
|
81
|
-
overflow="hidden"
|
|
82
|
-
>
|
|
83
|
-
<Animated.View style={profileImageStyle}>
|
|
84
|
-
<StyledImage
|
|
85
|
-
height={imageHeight}
|
|
86
|
-
width={imageWidth}
|
|
87
|
-
source={{
|
|
88
|
-
uri: imageUrl,
|
|
89
|
-
headers: {
|
|
90
|
-
Accept: "*/*",
|
|
91
|
-
"Content-Type": "application/json",
|
|
92
|
-
Pragma: "no-cache",
|
|
93
|
-
},
|
|
94
|
-
}}
|
|
95
|
-
onLoad={() => {
|
|
96
|
-
setIsImageLoaded(true);
|
|
97
|
-
opacity.value = 1;
|
|
98
|
-
}}
|
|
99
|
-
onLoadStart={() => {
|
|
100
|
-
setIsImageLoaded(false);
|
|
101
|
-
opacity.value = 0;
|
|
102
|
-
}}
|
|
103
|
-
{...rest}
|
|
104
|
-
/>
|
|
105
|
-
</Animated.View>
|
|
106
|
-
{!isImageLoaded && (
|
|
107
|
-
<Container position="absolute">
|
|
108
|
-
<ImagePlaceholder />
|
|
109
|
-
<Container
|
|
110
|
-
bottom={moderateScale(15)}
|
|
111
|
-
position="absolute"
|
|
112
|
-
right={moderateScale(15)}
|
|
113
|
-
>
|
|
114
|
-
<Loader color={theme.colors.font.grey600} />
|
|
115
|
-
</Container>
|
|
116
|
-
</Container>
|
|
117
|
-
)}
|
|
118
|
-
</Container>
|
|
119
|
-
);
|
|
120
|
-
};
|
|
121
|
-
|
|
122
|
-
AnimatedImage.defaultProps = {
|
|
123
|
-
alignItems: "center",
|
|
124
|
-
justifyContent: "center",
|
|
125
|
-
};
|
|
126
|
-
|
|
127
|
-
AnimatedImage.propTypes = {
|
|
128
|
-
/**
|
|
129
|
-
* Height for image.
|
|
130
|
-
*/
|
|
131
|
-
imageHeight: PropTypes.number | PropTypes.string,
|
|
132
|
-
/**
|
|
133
|
-
* Width for image.
|
|
134
|
-
*/
|
|
135
|
-
imageWidth: PropTypes.number,
|
|
136
|
-
/**
|
|
137
|
-
* Url to display the Image. It accepts a standard React Native Image source prop Or a function that returns an Image.
|
|
138
|
-
*/
|
|
139
|
-
imageUrl: PropTypes.string,
|
|
140
|
-
};
|
|
@@ -1,144 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import { StyleSheet } from "react-native";
|
|
3
|
-
|
|
4
|
-
import PropTypes from "prop-types";
|
|
5
|
-
import Animated, {
|
|
6
|
-
Easing,
|
|
7
|
-
useAnimatedStyle,
|
|
8
|
-
useSharedValue,
|
|
9
|
-
withTiming,
|
|
10
|
-
} from "react-native-reanimated";
|
|
11
|
-
import { moderateScale } from "react-native-size-matters";
|
|
12
|
-
|
|
13
|
-
import { Typography, Container } from "@components";
|
|
14
|
-
|
|
15
|
-
/**
|
|
16
|
-
* Avatars can be used to represent people in a graphical way.
|
|
17
|
-
*
|
|
18
|
-
* <div class="screenshots">
|
|
19
|
-
* <img src="screenshots/avatar/images.png" />
|
|
20
|
-
* <img src="screenshots/avatar/texts.png" />
|
|
21
|
-
* </div>
|
|
22
|
-
*
|
|
23
|
-
* ## Usage
|
|
24
|
-
* ```js
|
|
25
|
-
* import * as React from 'react';
|
|
26
|
-
* import { Typography, Avatar } from '@bigbinary/neetoui-rn';
|
|
27
|
-
*
|
|
28
|
-
* export default function Main() {
|
|
29
|
-
* return (
|
|
30
|
-
* <Container>
|
|
31
|
-
* <Avatar
|
|
32
|
-
* variant={"medium"}
|
|
33
|
-
* name="Oliver Smith"
|
|
34
|
-
* imageUrl="https://www.himalmag.com/wp-content/uploads/2019/07/sample-profile-picture.png"
|
|
35
|
-
* />
|
|
36
|
-
* </Container>
|
|
37
|
-
* );
|
|
38
|
-
* }
|
|
39
|
-
* ```
|
|
40
|
-
*/
|
|
41
|
-
|
|
42
|
-
export const Avatar = ({
|
|
43
|
-
name,
|
|
44
|
-
variant = "medium",
|
|
45
|
-
bgColor = "background.lightBlue100",
|
|
46
|
-
fontColor = "font.darkBlue100",
|
|
47
|
-
imageUrl,
|
|
48
|
-
...rest
|
|
49
|
-
}) => {
|
|
50
|
-
const opacity = useSharedValue(0);
|
|
51
|
-
const acronym = name
|
|
52
|
-
?.split(/\s/)
|
|
53
|
-
.reduce((response, word) => (response += word.slice(0, 1)), "")
|
|
54
|
-
.slice(0, 2);
|
|
55
|
-
|
|
56
|
-
const getSizes = () => {
|
|
57
|
-
switch (variant) {
|
|
58
|
-
case "extra-small":
|
|
59
|
-
return [moderateScale(24), moderateScale(8)];
|
|
60
|
-
case "small":
|
|
61
|
-
return [moderateScale(36), moderateScale(12)];
|
|
62
|
-
case "medium":
|
|
63
|
-
return [moderateScale(48), moderateScale(14)];
|
|
64
|
-
default:
|
|
65
|
-
return [moderateScale(48), moderateScale(14)];
|
|
66
|
-
}
|
|
67
|
-
};
|
|
68
|
-
|
|
69
|
-
const [avatarSize, avatarFontSize] = getSizes();
|
|
70
|
-
|
|
71
|
-
const profileImageStyle = useAnimatedStyle(() => ({
|
|
72
|
-
opacity: withTiming(opacity.value, {
|
|
73
|
-
duration: 300,
|
|
74
|
-
easing: Easing.bezier(0.25, 0.1, 0.25, 1),
|
|
75
|
-
}),
|
|
76
|
-
height: avatarSize,
|
|
77
|
-
width: avatarSize,
|
|
78
|
-
alignSelf: "center",
|
|
79
|
-
borderRadius: avatarSize / 2,
|
|
80
|
-
}));
|
|
81
|
-
|
|
82
|
-
return (
|
|
83
|
-
<Container
|
|
84
|
-
bg={bgColor}
|
|
85
|
-
borderRadius={avatarSize / 2}
|
|
86
|
-
height={avatarSize}
|
|
87
|
-
width={avatarSize}
|
|
88
|
-
{...rest}
|
|
89
|
-
flexDirection="row"
|
|
90
|
-
>
|
|
91
|
-
<Container style={styles.acronym}>
|
|
92
|
-
<Typography
|
|
93
|
-
color={fontColor}
|
|
94
|
-
fontFamily="sf400"
|
|
95
|
-
fontSize={avatarFontSize}
|
|
96
|
-
>
|
|
97
|
-
{acronym.toUpperCase()}
|
|
98
|
-
</Typography>
|
|
99
|
-
</Container>
|
|
100
|
-
<Animated.Image
|
|
101
|
-
source={{ uri: imageUrl }}
|
|
102
|
-
style={profileImageStyle}
|
|
103
|
-
onLoad={() => (opacity.value = 1)}
|
|
104
|
-
{...rest}
|
|
105
|
-
/>
|
|
106
|
-
</Container>
|
|
107
|
-
);
|
|
108
|
-
};
|
|
109
|
-
|
|
110
|
-
const styles = StyleSheet.create({
|
|
111
|
-
acronym: {
|
|
112
|
-
position: "absolute",
|
|
113
|
-
justifyContent: "center",
|
|
114
|
-
alignItems: "center",
|
|
115
|
-
},
|
|
116
|
-
});
|
|
117
|
-
|
|
118
|
-
Avatar.defaultProps = {
|
|
119
|
-
alignItems: "center",
|
|
120
|
-
justifyContent: "center",
|
|
121
|
-
};
|
|
122
|
-
|
|
123
|
-
Avatar.propTypes = {
|
|
124
|
-
/**
|
|
125
|
-
* Name to obtain user initials to show as the text in the Avatar.
|
|
126
|
-
*/
|
|
127
|
-
name: PropTypes.string,
|
|
128
|
-
/**
|
|
129
|
-
* variant of the avatar: `medium` or `small`
|
|
130
|
-
*/
|
|
131
|
-
variant: PropTypes.oneOf(["medium", "small", "extra-small"]),
|
|
132
|
-
/**
|
|
133
|
-
* Custom color for the avatar.
|
|
134
|
-
*/
|
|
135
|
-
bgColor: PropTypes.string,
|
|
136
|
-
/**
|
|
137
|
-
* Custom color for the text.
|
|
138
|
-
*/
|
|
139
|
-
fontColor: PropTypes.string,
|
|
140
|
-
/**
|
|
141
|
-
* Image to display for the Avatar. It accepts a standard React Native Image source prop Or a function that returns an Image.
|
|
142
|
-
*/
|
|
143
|
-
imageUrl: PropTypes.string,
|
|
144
|
-
};
|
package/src/components/Badge.jsx
DELETED
|
@@ -1,97 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
|
|
3
|
-
import PropTypes from "prop-types";
|
|
4
|
-
import { moderateScale } from "react-native-size-matters";
|
|
5
|
-
|
|
6
|
-
import { Typography, Container } from "@components";
|
|
7
|
-
|
|
8
|
-
/**
|
|
9
|
-
*
|
|
10
|
-
* This component supports below props categories from [styled-system ](/styled-system).
|
|
11
|
-
* <ul>
|
|
12
|
-
* <li>flexbox</li>
|
|
13
|
-
* <li>space</li>
|
|
14
|
-
* <li>border</li>
|
|
15
|
-
* <li>color</li>
|
|
16
|
-
* <li>layout</li>
|
|
17
|
-
* </ul>
|
|
18
|
-
*
|
|
19
|
-
* <div class="screenshots">
|
|
20
|
-
* <img src="screenshots/badge/badges.png" />
|
|
21
|
-
* </div>
|
|
22
|
-
*
|
|
23
|
-
* ## Usage
|
|
24
|
-
* ```js
|
|
25
|
-
* import * as React from 'react';
|
|
26
|
-
* import { Badge, Container } from '@bigbinary/neetoui-rn';
|
|
27
|
-
*
|
|
28
|
-
* export default function Main() {
|
|
29
|
-
* return (
|
|
30
|
-
* <Container>
|
|
31
|
-
* <Badge
|
|
32
|
-
* content="test"
|
|
33
|
-
* size={moderateScale(32)}
|
|
34
|
-
* fontSize="12px"
|
|
35
|
-
* badgeColor="background.secondary"
|
|
36
|
-
* color="font.secondary"
|
|
37
|
-
* />
|
|
38
|
-
* </Container>
|
|
39
|
-
* );
|
|
40
|
-
* }
|
|
41
|
-
* ```
|
|
42
|
-
*
|
|
43
|
-
*/
|
|
44
|
-
|
|
45
|
-
export const Badge = ({
|
|
46
|
-
badgeColor = "background.base",
|
|
47
|
-
content,
|
|
48
|
-
size = moderateScale(21),
|
|
49
|
-
fontSize = "xs",
|
|
50
|
-
fontFamily = "sf400",
|
|
51
|
-
color = "font.white",
|
|
52
|
-
...rest
|
|
53
|
-
}) =>
|
|
54
|
-
size > 0 && (
|
|
55
|
-
<Container
|
|
56
|
-
alignItems="center"
|
|
57
|
-
bg={badgeColor}
|
|
58
|
-
borderRadius={moderateScale(15)}
|
|
59
|
-
justifyContent="center"
|
|
60
|
-
px={moderateScale(6)}
|
|
61
|
-
py={moderateScale(1)}
|
|
62
|
-
{...rest}
|
|
63
|
-
>
|
|
64
|
-
{!!content && (
|
|
65
|
-
<Typography color={color} fontFamily={fontFamily} fontSize={fontSize}>
|
|
66
|
-
{content}
|
|
67
|
-
</Typography>
|
|
68
|
-
)}
|
|
69
|
-
</Container>
|
|
70
|
-
);
|
|
71
|
-
|
|
72
|
-
Badge.propTypes = {
|
|
73
|
-
/**
|
|
74
|
-
* Custom badge content color.
|
|
75
|
-
*/
|
|
76
|
-
color: PropTypes.string,
|
|
77
|
-
/**
|
|
78
|
-
* Custom badge background color.
|
|
79
|
-
*/
|
|
80
|
-
badgeColor: PropTypes.string,
|
|
81
|
-
/**
|
|
82
|
-
* To change content of the badge
|
|
83
|
-
*/
|
|
84
|
-
content: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
|
|
85
|
-
/**
|
|
86
|
-
* Custom badge size.
|
|
87
|
-
*/
|
|
88
|
-
size: PropTypes.number,
|
|
89
|
-
/**
|
|
90
|
-
* Custom font-size for badge content.
|
|
91
|
-
*/
|
|
92
|
-
fontSize: PropTypes.string,
|
|
93
|
-
/**
|
|
94
|
-
* Custom font-family for badge content.
|
|
95
|
-
*/
|
|
96
|
-
fontFamily: PropTypes.string,
|
|
97
|
-
};
|