@bigbinary/neetoui-rn 0.0.125 → 0.0.128
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/assets/fonts/SFProText-Bold.ttf +0 -0
- package/assets/fonts/SFProText-Medium.ttf +0 -0
- package/assets/fonts/SFProText-Regular.ttf +0 -0
- package/assets/fonts/SFProText-Semibold.ttf +0 -0
- package/assets/icons/apple-logo.svg +3 -0
- package/assets/icons/error.svg +4 -0
- package/assets/icons/google-logo.svg +6 -0
- package/assets/icons/info.svg +7 -0
- package/assets/icons/success.svg +3 -0
- package/assets/icons/warning.svg +5 -0
- package/lib/components/Alert.js +1 -1
- package/lib/components/Avatar.js +1 -1
- package/lib/components/Badge.js +1 -1
- package/lib/components/BottomSheet.js +1 -1
- package/lib/components/Button.js +1 -1
- package/lib/components/Carousel.js +1 -0
- package/lib/components/CheckBox.js +1 -1
- package/lib/components/Chip.js +1 -1
- package/lib/components/Input.js +1 -1
- package/lib/components/ListItem.js +1 -0
- package/lib/components/MultiSelect.js +1 -1
- package/lib/components/OnBoarding.js +1 -0
- package/lib/components/OtpInputs.js +1 -1
- package/lib/components/Popover.js +1 -1
- package/lib/components/RadioButton.js +1 -1
- package/lib/components/SearchBar.js +1 -0
- package/lib/components/SegmentPicker.js +1 -0
- package/lib/components/Select.js +1 -1
- package/lib/components/SocialButton.js +1 -0
- package/lib/components/Toast.js +1 -1
- package/lib/components/ToggleSwitch.js +1 -1
- package/lib/components/index.js +1 -1
- package/lib/config/toasterConfig.js +1 -1
- package/lib/hooks/index.js +1 -1
- package/lib/hooks/useDebounce.js +1 -0
- package/lib/theme/index.js +1 -1
- package/package.json +5 -3
- package/src/components/Alert.js +5 -5
- package/src/components/Avatar.js +1 -1
- package/src/components/Badge.js +1 -1
- package/src/components/BottomSheet.js +113 -74
- package/src/components/Button.js +152 -61
- package/src/components/Carousel.js +112 -0
- package/src/components/CheckBox.js +87 -81
- package/src/components/Chip.js +1 -1
- package/src/components/Input.js +147 -241
- package/src/components/ListItem.js +66 -0
- package/src/components/MultiSelect.js +6 -6
- package/src/components/OnBoarding.js +116 -0
- package/src/components/OtpInputs.js +1 -1
- package/src/components/Popover.js +13 -1
- package/src/components/RadioButton.js +88 -114
- package/src/components/SearchBar.js +134 -0
- package/src/components/SegmentPicker.js +210 -0
- package/src/components/Select.js +5 -5
- package/src/components/SocialButton.js +89 -0
- package/src/components/Toast.js +85 -30
- package/src/components/ToggleSwitch.js +49 -97
- package/src/components/Typography.js +2 -2
- package/src/components/index.js +6 -0
- package/src/config/toasterConfig.js +2 -2
- package/src/hooks/index.js +1 -0
- package/src/hooks/useDebounce.js +16 -0
- package/src/theme/index.js +68 -34
- package/assets/fonts/Inter-Bold.ttf +0 -0
- package/assets/fonts/Inter-Regular.ttf +0 -0
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import React, { useContext } from "react";
|
|
2
|
+
import propTypes from "@styled-system/prop-types";
|
|
3
|
+
import PropTypes from "prop-types";
|
|
4
|
+
import { ThemeContext } from "styled-components/native";
|
|
5
|
+
|
|
6
|
+
import AppleLogo from "@assets/icons/apple-logo.svg";
|
|
7
|
+
import GoogleLogo from "@assets/icons/google-logo.svg";
|
|
8
|
+
import { Container, Typography, Touchable } from "@components";
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
*
|
|
12
|
+
* Buttons are touchable elements used to interact with the screen and to trigger an action.
|
|
13
|
+
*
|
|
14
|
+
* <div class="screenshots">
|
|
15
|
+
* <img src="screenshots/button/socialButtons.png" />
|
|
16
|
+
* </div>
|
|
17
|
+
*
|
|
18
|
+
* ## Usage
|
|
19
|
+
* ```js
|
|
20
|
+
* import * as React from 'react';
|
|
21
|
+
* import { Container, SocialButton } from '@bigbinary/neetoui-rn';
|
|
22
|
+
*
|
|
23
|
+
* export default function Main() {
|
|
24
|
+
* return (
|
|
25
|
+
* <Container>
|
|
26
|
+
* <SocialButton variant="apple" my={9} />
|
|
27
|
+
* <SocialButton variant="google" />
|
|
28
|
+
* </Container>
|
|
29
|
+
* );
|
|
30
|
+
* }
|
|
31
|
+
* ```
|
|
32
|
+
*
|
|
33
|
+
*/
|
|
34
|
+
|
|
35
|
+
export const SocialButton = props => {
|
|
36
|
+
const { variant, disabled, labelStyle, ...rest } = props;
|
|
37
|
+
const theme = useContext(ThemeContext);
|
|
38
|
+
const capitalize = str => `${str.charAt(0).toUpperCase()}${str.slice(1)}`;
|
|
39
|
+
|
|
40
|
+
return (
|
|
41
|
+
<Touchable
|
|
42
|
+
rippleColor="black"
|
|
43
|
+
disabled={disabled}
|
|
44
|
+
bg="transparent"
|
|
45
|
+
height={45}
|
|
46
|
+
width="100%"
|
|
47
|
+
borderRadius={8}
|
|
48
|
+
borderWidth={1}
|
|
49
|
+
borderColor={theme.colors.border.black}
|
|
50
|
+
alignItems="center"
|
|
51
|
+
justifyContent="center"
|
|
52
|
+
{...rest}
|
|
53
|
+
>
|
|
54
|
+
<Container position="absolute" left={17}>
|
|
55
|
+
{variant === "apple" && <AppleLogo />}
|
|
56
|
+
{variant === "google" && <GoogleLogo />}
|
|
57
|
+
</Container>
|
|
58
|
+
<Typography
|
|
59
|
+
color={theme.colors.font.primary}
|
|
60
|
+
fontSize="m"
|
|
61
|
+
fontFamily={theme.fonts.sf500}
|
|
62
|
+
{...labelStyle}
|
|
63
|
+
>
|
|
64
|
+
Continue with {capitalize(variant)}
|
|
65
|
+
</Typography>
|
|
66
|
+
</Touchable>
|
|
67
|
+
);
|
|
68
|
+
};
|
|
69
|
+
|
|
70
|
+
SocialButton.propTypes = {
|
|
71
|
+
...propTypes.buttonStyle,
|
|
72
|
+
...propTypes.flexbox,
|
|
73
|
+
...propTypes.space,
|
|
74
|
+
...propTypes.border,
|
|
75
|
+
...propTypes.layout,
|
|
76
|
+
...propTypes.color,
|
|
77
|
+
/**
|
|
78
|
+
* Supported Type: 'apple' | 'google'
|
|
79
|
+
*/
|
|
80
|
+
variant: PropTypes.oneOf(["apple", "google"]),
|
|
81
|
+
/**
|
|
82
|
+
* Enable or Disable the button
|
|
83
|
+
*/
|
|
84
|
+
disabled: PropTypes.bool,
|
|
85
|
+
/**
|
|
86
|
+
* Customize label style of the button
|
|
87
|
+
*/
|
|
88
|
+
labelStyle: PropTypes.object,
|
|
89
|
+
};
|
package/src/components/Toast.js
CHANGED
|
@@ -2,7 +2,82 @@ import * as React from "react";
|
|
|
2
2
|
import PropTypes from "prop-types";
|
|
3
3
|
import T from "react-native-toast-message";
|
|
4
4
|
import { defaultToasterConfig } from "@config";
|
|
5
|
-
import {
|
|
5
|
+
import { useContext } from "react";
|
|
6
|
+
import { ThemeContext } from "styled-components/native";
|
|
7
|
+
import { useWindowDimensions } from "react-native";
|
|
8
|
+
|
|
9
|
+
import SuccessIcon from "@assets/icons/success.svg";
|
|
10
|
+
import WarningIcon from "@assets/icons/warning.svg";
|
|
11
|
+
import InfoIcon from "@assets/icons/info.svg";
|
|
12
|
+
import ErrorIcon from "@assets/icons/error.svg";
|
|
13
|
+
import { Container, Typography } from "@components";
|
|
14
|
+
|
|
15
|
+
const ToastComponent = ({ type, text1, text2 }) => {
|
|
16
|
+
const theme = useContext(ThemeContext);
|
|
17
|
+
const { width } = useWindowDimensions();
|
|
18
|
+
const Icon = () => {
|
|
19
|
+
switch (type) {
|
|
20
|
+
case "success":
|
|
21
|
+
return <SuccessIcon />;
|
|
22
|
+
case "warning":
|
|
23
|
+
return <WarningIcon />;
|
|
24
|
+
case "info":
|
|
25
|
+
return <InfoIcon />;
|
|
26
|
+
case "error":
|
|
27
|
+
return <ErrorIcon />;
|
|
28
|
+
}
|
|
29
|
+
};
|
|
30
|
+
return (
|
|
31
|
+
<Container
|
|
32
|
+
width={width - 20}
|
|
33
|
+
height={60}
|
|
34
|
+
borderRadius={16}
|
|
35
|
+
bg={theme.colors.background.secondary}
|
|
36
|
+
flexDirection="row"
|
|
37
|
+
alignItems="center"
|
|
38
|
+
px={10}
|
|
39
|
+
mx={10}
|
|
40
|
+
>
|
|
41
|
+
<Container
|
|
42
|
+
height={42}
|
|
43
|
+
width={42}
|
|
44
|
+
borderRadius={10}
|
|
45
|
+
bg={theme.colors.toast[type]}
|
|
46
|
+
alignItems="center"
|
|
47
|
+
justifyContent="center"
|
|
48
|
+
>
|
|
49
|
+
<Icon />
|
|
50
|
+
</Container>
|
|
51
|
+
|
|
52
|
+
<Container ml={10}>
|
|
53
|
+
{text1 && (
|
|
54
|
+
<Typography
|
|
55
|
+
fontFamily={theme.fonts.sf600}
|
|
56
|
+
fontSize="m"
|
|
57
|
+
fontColor={theme.colors.font.primary}
|
|
58
|
+
>
|
|
59
|
+
{text1}
|
|
60
|
+
</Typography>
|
|
61
|
+
)}
|
|
62
|
+
{text2 && (
|
|
63
|
+
<Typography
|
|
64
|
+
fontFamily={theme.fonts.sf400}
|
|
65
|
+
fontSize="xs"
|
|
66
|
+
fontColor={theme.colors.font.secondary}
|
|
67
|
+
>
|
|
68
|
+
{text2}
|
|
69
|
+
</Typography>
|
|
70
|
+
)}
|
|
71
|
+
</Container>
|
|
72
|
+
</Container>
|
|
73
|
+
);
|
|
74
|
+
};
|
|
75
|
+
|
|
76
|
+
ToastComponent.propTypes = {
|
|
77
|
+
type: PropTypes.string,
|
|
78
|
+
text1: PropTypes.string,
|
|
79
|
+
text2: PropTypes.string,
|
|
80
|
+
};
|
|
6
81
|
|
|
7
82
|
/**
|
|
8
83
|
* Toast component is a wrapper over https://github.com/calintamas/react-native-toast-message.
|
|
@@ -32,7 +107,6 @@ import { useKeyboard } from "@react-native-community/hooks";
|
|
|
32
107
|
* onPress={() => {
|
|
33
108
|
* Toast.show({
|
|
34
109
|
* type: "error",
|
|
35
|
-
* position: "bottom",
|
|
36
110
|
* text1: "Yay!",
|
|
37
111
|
* text2: "Have a nice day! 😄",
|
|
38
112
|
* });
|
|
@@ -45,43 +119,24 @@ import { useKeyboard } from "@react-native-community/hooks";
|
|
|
45
119
|
* @extends StyledSystems props /styled-system
|
|
46
120
|
*/
|
|
47
121
|
|
|
48
|
-
let globalKeyboardState;
|
|
49
|
-
// let toastOffsetValue;
|
|
50
|
-
|
|
51
122
|
export const Toast = ({ toasterConfig, ...rest }) => {
|
|
52
|
-
const
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
// Platform.OS === "ios"
|
|
59
|
-
// ? screenDimensions.height - (globalKeyboardState.keyboardHeight + 50)
|
|
60
|
-
// : screenDimensions.height - (globalKeyboardState.keyboardHeight + 130);
|
|
61
|
-
}, [keyboard]);
|
|
123
|
+
const customConfig = {
|
|
124
|
+
success: ToastComponent,
|
|
125
|
+
warning: ToastComponent,
|
|
126
|
+
info: ToastComponent,
|
|
127
|
+
error: ToastComponent,
|
|
128
|
+
};
|
|
62
129
|
|
|
63
130
|
return (
|
|
64
131
|
<T
|
|
65
132
|
{...rest}
|
|
66
|
-
config={{ ...defaultToasterConfig, ...toasterConfig }}
|
|
67
|
-
position="
|
|
133
|
+
config={{ ...defaultToasterConfig, ...customConfig, ...toasterConfig }}
|
|
134
|
+
position="top"
|
|
68
135
|
/>
|
|
69
136
|
);
|
|
70
137
|
};
|
|
71
138
|
|
|
72
|
-
Toast.show =
|
|
73
|
-
// Rendering Toasts on top whenever keyboard is active.
|
|
74
|
-
if (globalKeyboardState.keyboardShown) {
|
|
75
|
-
T.show({
|
|
76
|
-
...params,
|
|
77
|
-
position: "top",
|
|
78
|
-
// topOffset: toastOffsetValue,
|
|
79
|
-
});
|
|
80
|
-
} else {
|
|
81
|
-
T.show(params);
|
|
82
|
-
}
|
|
83
|
-
};
|
|
84
|
-
|
|
139
|
+
Toast.show = T.show;
|
|
85
140
|
Toast.hide = T.hide;
|
|
86
141
|
|
|
87
142
|
Toast.propTypes = {
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import React, { useContext } from "react";
|
|
2
|
-
import SwitchToggle from "react-native-switch-toggle";
|
|
1
|
+
import React, { useContext, useEffect, useRef } from "react";
|
|
3
2
|
import { ThemeContext } from "styled-components/native";
|
|
4
|
-
import {
|
|
3
|
+
import { Animated } from "react-native";
|
|
5
4
|
import PropTypes from "prop-types";
|
|
5
|
+
import Icon from "react-native-remix-icon";
|
|
6
6
|
|
|
7
|
-
import {
|
|
7
|
+
import { Container, Touchable } from "@components";
|
|
8
8
|
|
|
9
9
|
/**
|
|
10
|
-
* ToggleSwitch component is a simple switch toggle component
|
|
10
|
+
* ToggleSwitch component is a simple switch toggle component describes what is being switched ON/OFF.
|
|
11
11
|
*
|
|
12
12
|
* <div class="screenshots">
|
|
13
13
|
* <img src="screenshots/toggleswitch/switchstyles.png" />
|
|
@@ -26,7 +26,6 @@ import { Typography, Container } from "@components";
|
|
|
26
26
|
* <ToggleSwitch
|
|
27
27
|
* value={switchOne}
|
|
28
28
|
* setValue={() => setSwitchOne(prevValue => !prevValue)}
|
|
29
|
-
* label="Conversation assigned to my group"
|
|
30
29
|
* />
|
|
31
30
|
* </Container>
|
|
32
31
|
* );
|
|
@@ -34,75 +33,59 @@ import { Typography, Container } from "@components";
|
|
|
34
33
|
* ```
|
|
35
34
|
*/
|
|
36
35
|
|
|
37
|
-
const
|
|
38
|
-
return (
|
|
39
|
-
<Typography textStyle="subtext" {...textStyles}>
|
|
40
|
-
{label}
|
|
41
|
-
</Typography>
|
|
42
|
-
);
|
|
43
|
-
};
|
|
44
|
-
|
|
45
|
-
export const ToggleSwitch = ({
|
|
46
|
-
value,
|
|
47
|
-
onValueChange,
|
|
48
|
-
label,
|
|
49
|
-
disabled,
|
|
50
|
-
labelPosition,
|
|
51
|
-
...rest
|
|
52
|
-
}) => {
|
|
36
|
+
export const ToggleSwitch = ({ value, onValueChange, disabled }) => {
|
|
53
37
|
const theme = useContext(ThemeContext);
|
|
38
|
+
const animatedPosition = useRef(new Animated.Value(value ? 1 : 0)).current;
|
|
39
|
+
|
|
40
|
+
useEffect(() => {
|
|
41
|
+
startAnimation();
|
|
42
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
43
|
+
}, [value]);
|
|
44
|
+
|
|
45
|
+
const startAnimation = () => {
|
|
46
|
+
Animated.timing(animatedPosition, {
|
|
47
|
+
toValue: value ? 20 : 0,
|
|
48
|
+
duration: 300,
|
|
49
|
+
useNativeDriver: false,
|
|
50
|
+
}).start();
|
|
51
|
+
};
|
|
54
52
|
|
|
55
|
-
const
|
|
56
|
-
|
|
57
|
-
: theme.colors.background.white;
|
|
58
|
-
const circleColorOff = disabled
|
|
59
|
-
? theme.colors.background.menubackground
|
|
60
|
-
: theme.colors.background.white;
|
|
53
|
+
const containerBg = value ? "#5E5CE6" : "background.grey300";
|
|
54
|
+
const iconColor = value ? "#5E5CE6" : theme.colors.font.grey500;
|
|
61
55
|
|
|
62
56
|
return (
|
|
63
|
-
<
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
{
|
|
57
|
+
<Touchable
|
|
58
|
+
disabled={disabled}
|
|
59
|
+
onPress={() => onValueChange(!value)}
|
|
60
|
+
width={44}
|
|
61
|
+
height={24}
|
|
62
|
+
bg={containerBg}
|
|
63
|
+
justifyContent="center"
|
|
64
|
+
px={1}
|
|
65
|
+
borderRadius={70}
|
|
66
|
+
opacity={disabled ? 0.5 : 1}
|
|
68
67
|
>
|
|
69
|
-
{
|
|
70
|
-
<
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
</Container>
|
|
68
|
+
<Animated.View style={{ transform: [{ translateX: animatedPosition }] }}>
|
|
69
|
+
<Container
|
|
70
|
+
bg="background.white"
|
|
71
|
+
width={16}
|
|
72
|
+
height={16}
|
|
73
|
+
borderRadius={8}
|
|
74
|
+
justifyContent="center"
|
|
75
|
+
alignItems="center"
|
|
76
|
+
>
|
|
77
|
+
<Icon
|
|
78
|
+
name={`ri-${value ? "check" : "close"}-line`}
|
|
79
|
+
size={12}
|
|
80
|
+
color={iconColor}
|
|
81
|
+
/>
|
|
82
|
+
</Container>
|
|
83
|
+
</Animated.View>
|
|
84
|
+
</Touchable>
|
|
87
85
|
);
|
|
88
86
|
};
|
|
89
87
|
|
|
90
|
-
ToggleSwitch.defaultProps = {
|
|
91
|
-
labelPosition: "left",
|
|
92
|
-
wrapperStyles: {},
|
|
93
|
-
switchStyles: {},
|
|
94
|
-
textStyles: { mr: 2 },
|
|
95
|
-
};
|
|
96
|
-
|
|
97
88
|
ToggleSwitch.propTypes = {
|
|
98
|
-
/**
|
|
99
|
-
* The text to use for the floating label.
|
|
100
|
-
*/
|
|
101
|
-
label: PropTypes.string,
|
|
102
|
-
/**
|
|
103
|
-
* Prop that handles the label position.
|
|
104
|
-
*/
|
|
105
|
-
labelPosition: PropTypes.string,
|
|
106
89
|
/**
|
|
107
90
|
* Value of the switch, true means 'on', false means 'off'.
|
|
108
91
|
*/
|
|
@@ -115,35 +98,4 @@ ToggleSwitch.propTypes = {
|
|
|
115
98
|
* Disable toggling the switch.
|
|
116
99
|
*/
|
|
117
100
|
disabled: PropTypes.bool,
|
|
118
|
-
/**
|
|
119
|
-
* Prop to handle custom wrapper styles.
|
|
120
|
-
*/
|
|
121
|
-
wrapperStyles: PropTypes.object,
|
|
122
|
-
/**
|
|
123
|
-
* Prop to handle custom switch styles.
|
|
124
|
-
*/
|
|
125
|
-
switchStyles: PropTypes.object,
|
|
126
|
-
/**
|
|
127
|
-
* Prop to handle custom text styles.
|
|
128
|
-
*/
|
|
129
|
-
textStyles: PropTypes.object,
|
|
130
101
|
};
|
|
131
|
-
|
|
132
|
-
Label.propTypes = {
|
|
133
|
-
label: PropTypes.string,
|
|
134
|
-
textStyles: PropTypes.object,
|
|
135
|
-
};
|
|
136
|
-
|
|
137
|
-
const styles = StyleSheet.create({
|
|
138
|
-
containerStyle: {
|
|
139
|
-
width: 38,
|
|
140
|
-
height: 18,
|
|
141
|
-
borderRadius: 10,
|
|
142
|
-
padding: 2,
|
|
143
|
-
},
|
|
144
|
-
circleStyle: {
|
|
145
|
-
width: 14,
|
|
146
|
-
height: 14,
|
|
147
|
-
borderRadius: 7,
|
|
148
|
-
},
|
|
149
|
-
});
|
|
@@ -45,8 +45,8 @@ export const Text = styled.Text`
|
|
|
45
45
|
* </ul>
|
|
46
46
|
*
|
|
47
47
|
* <div class="screenshots">
|
|
48
|
-
* <img src="screenshots/typography/
|
|
49
|
-
* <img src="screenshots/typography/
|
|
48
|
+
* <img src="screenshots/typography/colors.png" />
|
|
49
|
+
* <img src="screenshots/typography/fontfamilies.png" />
|
|
50
50
|
* </div>
|
|
51
51
|
*
|
|
52
52
|
* <div class="screenshots">
|
package/src/components/index.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export { Button } from "./Button";
|
|
2
|
+
export { SocialButton } from "./SocialButton";
|
|
2
3
|
export { Container } from "./Container";
|
|
3
4
|
export { Typography } from "./Typography";
|
|
4
5
|
export { Input } from "./Input";
|
|
@@ -25,3 +26,8 @@ export { MultiSelect } from "./MultiSelect";
|
|
|
25
26
|
export { Divider } from "./Divider";
|
|
26
27
|
export { FlatList } from "./FlatList";
|
|
27
28
|
export { ScrollView } from "./ScrollView";
|
|
29
|
+
export { SegmentPicker } from "./SegmentPicker";
|
|
30
|
+
export { ListItem } from "./ListItem";
|
|
31
|
+
export { Carousel } from "./Carousel";
|
|
32
|
+
export { OnBoarding } from "./OnBoarding";
|
|
33
|
+
export { SearchBar } from "./SearchBar";
|
|
@@ -121,12 +121,12 @@ const styles = StyleSheet.create({
|
|
|
121
121
|
},
|
|
122
122
|
text1Style: {
|
|
123
123
|
fontSize: 15,
|
|
124
|
-
fontFamily: theme.fonts.
|
|
124
|
+
fontFamily: theme.fonts.sf700,
|
|
125
125
|
color: theme.colors.font.white,
|
|
126
126
|
},
|
|
127
127
|
text2Style: {
|
|
128
128
|
fontSize: 16,
|
|
129
|
-
fontFamily: theme.fonts.
|
|
129
|
+
fontFamily: theme.fonts.sf700,
|
|
130
130
|
color: theme.colors.font.white,
|
|
131
131
|
},
|
|
132
132
|
closeButtonStyle: {
|
package/src/hooks/index.js
CHANGED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { useState, useEffect } from "react";
|
|
2
|
+
|
|
3
|
+
export function useDebounce(value, delay) {
|
|
4
|
+
const [debouncedValue, setDebouncedValue] = useState(value);
|
|
5
|
+
|
|
6
|
+
useEffect(() => {
|
|
7
|
+
const handler = setTimeout(() => {
|
|
8
|
+
setDebouncedValue(value);
|
|
9
|
+
}, delay);
|
|
10
|
+
return () => {
|
|
11
|
+
clearTimeout(handler);
|
|
12
|
+
};
|
|
13
|
+
}, [value, delay]);
|
|
14
|
+
|
|
15
|
+
return debouncedValue;
|
|
16
|
+
}
|
package/src/theme/index.js
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
const defaultColors = {
|
|
2
2
|
white: "#ffffff",
|
|
3
3
|
black: "#000000",
|
|
4
|
-
base: "#
|
|
4
|
+
base: "#4557F8",
|
|
5
5
|
danger: "#ff6969",
|
|
6
|
-
menubackground: "#
|
|
6
|
+
menubackground: "#F6F6FA",
|
|
7
7
|
};
|
|
8
8
|
|
|
9
9
|
const toastBorderColors = {
|
|
10
|
-
success: "#
|
|
11
|
-
error: "#
|
|
12
|
-
info: "#
|
|
13
|
-
warning: "#
|
|
10
|
+
success: "#00BA88",
|
|
11
|
+
error: "#F56A58",
|
|
12
|
+
info: "#276EF1",
|
|
13
|
+
warning: "#F3CD82",
|
|
14
14
|
};
|
|
15
15
|
|
|
16
|
-
const
|
|
16
|
+
const greyVariants = {
|
|
17
17
|
grey: "#828282",
|
|
18
18
|
grey100: "#f8f9f9",
|
|
19
19
|
grey200: "#e9ebed",
|
|
@@ -21,27 +21,51 @@ const greyVarients = {
|
|
|
21
21
|
grey400: "#c2c8cc",
|
|
22
22
|
grey500: "#87929d",
|
|
23
23
|
grey600: "#68737d",
|
|
24
|
+
grey700: "#49545C",
|
|
24
25
|
grey800: "#2f3941",
|
|
25
26
|
};
|
|
26
27
|
|
|
28
|
+
const purpleVariants = {
|
|
29
|
+
purple500: "#5E5CE6",
|
|
30
|
+
purple600: "#7280FA",
|
|
31
|
+
purple700: "#4557F8",
|
|
32
|
+
purple800: "#342DF4",
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
const greenVariants = {
|
|
36
|
+
green500: "#34C759",
|
|
37
|
+
green600: "#33C8A0",
|
|
38
|
+
green700: "#00BA88",
|
|
39
|
+
green800: "#00956D",
|
|
40
|
+
};
|
|
41
|
+
|
|
27
42
|
const colors = {
|
|
28
43
|
font: {
|
|
29
|
-
primary: "#
|
|
30
|
-
secondary: "#
|
|
44
|
+
primary: "#2F3941",
|
|
45
|
+
secondary: "#49545C",
|
|
46
|
+
danger: "#D95D4E",
|
|
31
47
|
...defaultColors,
|
|
32
|
-
...
|
|
48
|
+
...greyVariants,
|
|
49
|
+
...purpleVariants,
|
|
50
|
+
...greenVariants,
|
|
33
51
|
},
|
|
34
52
|
background: {
|
|
35
53
|
parentView: "#ffffff",
|
|
36
54
|
primary: "#ffffff",
|
|
37
|
-
secondary: "#
|
|
55
|
+
secondary: "#F6F6FA",
|
|
56
|
+
danger: "#D95D4E",
|
|
38
57
|
...defaultColors,
|
|
39
|
-
...
|
|
58
|
+
...greyVariants,
|
|
59
|
+
...purpleVariants,
|
|
60
|
+
...greenVariants,
|
|
40
61
|
},
|
|
41
62
|
border: {
|
|
42
|
-
primary: "#
|
|
43
|
-
|
|
63
|
+
primary: "#E9EBED",
|
|
64
|
+
secondary: "#C2C8CC",
|
|
65
|
+
danger: "#D95D4E",
|
|
66
|
+
...greyVariants,
|
|
44
67
|
...defaultColors,
|
|
68
|
+
...purpleVariants,
|
|
45
69
|
},
|
|
46
70
|
toast: {
|
|
47
71
|
...toastBorderColors,
|
|
@@ -54,25 +78,30 @@ const baseTheme = {
|
|
|
54
78
|
// We can add below commented fonts later as follows. Also add font faces in index.web.js for the web.
|
|
55
79
|
// https://www.bigbinary.com/learn-react-native/adding-custom-fonats
|
|
56
80
|
|
|
57
|
-
//
|
|
58
|
-
//
|
|
59
|
-
//
|
|
60
|
-
//
|
|
61
|
-
//
|
|
62
|
-
// inter800: "Inter-ExtraBold",
|
|
63
|
-
// inter900: "Inter-Black",
|
|
81
|
+
// sf100: "SFProText-Thin",
|
|
82
|
+
// sf200: "SFProText-ExtraLight",
|
|
83
|
+
// sf300: "SFProText-Light",
|
|
84
|
+
// sf800: "SFProText-ExtraBold",
|
|
85
|
+
// sf900: "SFProText-Black",
|
|
64
86
|
|
|
65
|
-
|
|
66
|
-
|
|
87
|
+
sf400: "SFProText-Regular",
|
|
88
|
+
sf500: "SFProText-Medium",
|
|
89
|
+
sf600: "SFProText-Semibold",
|
|
90
|
+
sf700: "SFProText-Bold",
|
|
67
91
|
},
|
|
68
92
|
lineHeights: [24],
|
|
69
93
|
fontSizes: {
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
94
|
+
"3xs": 10,
|
|
95
|
+
"2xs": 12,
|
|
96
|
+
xs: 13,
|
|
97
|
+
s: 14,
|
|
98
|
+
m: 15,
|
|
99
|
+
l: 16,
|
|
100
|
+
xl: 17,
|
|
101
|
+
"2xl": 18,
|
|
102
|
+
"3xl": 20,
|
|
103
|
+
"4xl": 22,
|
|
104
|
+
"5xl": 30,
|
|
76
105
|
},
|
|
77
106
|
};
|
|
78
107
|
|
|
@@ -87,16 +116,21 @@ export const theme = {
|
|
|
87
116
|
},
|
|
88
117
|
header: {
|
|
89
118
|
color: baseTheme.colors.font.primary,
|
|
90
|
-
fontSize: baseTheme.fontSizes
|
|
91
|
-
fontFamily: baseTheme.fonts.
|
|
119
|
+
fontSize: baseTheme.fontSizes["3xl"],
|
|
120
|
+
fontFamily: baseTheme.fonts.sf700,
|
|
121
|
+
},
|
|
122
|
+
modalHeader: {
|
|
123
|
+
color: baseTheme.colors.font.black,
|
|
124
|
+
fontSize: baseTheme.fontSizes["xl"],
|
|
125
|
+
fontFamily: baseTheme.fonts.sf600,
|
|
92
126
|
},
|
|
93
127
|
body: {
|
|
94
|
-
color: baseTheme.colors.font.
|
|
95
|
-
fontSize: baseTheme.fontSizes.
|
|
128
|
+
color: baseTheme.colors.font.grey500,
|
|
129
|
+
fontSize: baseTheme.fontSizes.s,
|
|
96
130
|
},
|
|
97
131
|
subtext: {
|
|
98
132
|
color: baseTheme.colors.font.primary,
|
|
99
|
-
fontSize: baseTheme.fontSizes
|
|
133
|
+
fontSize: baseTheme.fontSizes["2xs"],
|
|
100
134
|
},
|
|
101
135
|
|
|
102
136
|
// buttonTextStyles
|
|
Binary file
|
|
Binary file
|