dhre-ui-kit 0.0.1
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/README.md +1 -0
- package/package.json +104 -0
- package/src/App.tsx +146 -0
- package/src/assets/images/calenderDots.svg +1 -0
- package/src/assets/index.ts +2 -0
- package/src/components/autoOtpReader/AutoOtpReader.test.tsx +56 -0
- package/src/components/autoOtpReader/AutoOtpReader.tsx +79 -0
- package/src/components/autoOtpReader/index.ts +1 -0
- package/src/components/badge/Badge.styles.ts +20 -0
- package/src/components/badge/Badge.test.tsx +45 -0
- package/src/components/badge/Badge.tsx +47 -0
- package/src/components/badge/index.ts +1 -0
- package/src/components/bottomDrawer/BottomDrawer.interface.ts +12 -0
- package/src/components/bottomDrawer/BottomDrawer.styles.ts +31 -0
- package/src/components/bottomDrawer/BottomDrawer.test.tsx +19 -0
- package/src/components/bottomDrawer/BottomDrawer.tsx +43 -0
- package/src/components/bottomDrawer/index.ts +1 -0
- package/src/components/button/Button.interface.ts +18 -0
- package/src/components/button/Button.styles.ts +78 -0
- package/src/components/button/Button.test.tsx +43 -0
- package/src/components/button/Button.tsx +53 -0
- package/src/components/button/index.ts +1 -0
- package/src/components/cards/Cards.interface.ts +13 -0
- package/src/components/cards/Cards.styles.ts +59 -0
- package/src/components/cards/Cards.test.tsx +41 -0
- package/src/components/cards/Cards.tsx +69 -0
- package/src/components/cards/index.ts +1 -0
- package/src/components/checkBox/CheckBox.interface.ts +10 -0
- package/src/components/checkBox/CheckBox.styles.ts +36 -0
- package/src/components/checkBox/CheckBox.test.tsx +46 -0
- package/src/components/checkBox/CheckBox.tsx +42 -0
- package/src/components/checkBox/index.ts +1 -0
- package/src/components/customDropdown/CustomDropdown.interface.ts +15 -0
- package/src/components/customDropdown/CustomDropdown.styles.tsx +46 -0
- package/src/components/customDropdown/CustomDropdown.test.tsx +30 -0
- package/src/components/customDropdown/CustomDropdown.tsx +106 -0
- package/src/components/customDropdown/index.ts +1 -0
- package/src/components/customInputText/CustomInputText.interface.ts +20 -0
- package/src/components/customInputText/CustomInputText.styles.ts +56 -0
- package/src/components/customInputText/CustomInputText.test.tsx +37 -0
- package/src/components/customInputText/CustomInputText.tsx +120 -0
- package/src/components/customInputText/index.ts +1 -0
- package/src/components/customText/CustomText.tsx +31 -0
- package/src/components/customText/index.ts +1 -0
- package/src/components/customTooltip/CustomTooltip.interface.ts +14 -0
- package/src/components/customTooltip/CustomTooltip.styles.ts +23 -0
- package/src/components/customTooltip/CustomTooltip.test.tsx +18 -0
- package/src/components/customTooltip/CustomTooltip.tsx +46 -0
- package/src/components/customTooltip/index.ts +1 -0
- package/src/components/customTypography/CustomTypography.tsx +25 -0
- package/src/components/fileUpload/FileUpload.styles.ts +41 -0
- package/src/components/fileUpload/FileUpload.test.tsx +39 -0
- package/src/components/fileUpload/FileUpload.tsx +65 -0
- package/src/components/fileUpload/index.ts +1 -0
- package/src/components/notification/Notification.interface.ts +61 -0
- package/src/components/notification/Notification.styles.ts +33 -0
- package/src/components/notification/Notification.test.tsx +116 -0
- package/src/components/notification/Notification.tsx +156 -0
- package/src/components/pdfView/PdfView.test.tsx +10 -0
- package/src/components/pdfView/PdfView.tsx +18 -0
- package/src/components/pdfView/index.ts +1 -0
- package/src/components/popup/PopUp.interface.ts +9 -0
- package/src/components/popup/PopUp.styles.ts +52 -0
- package/src/components/popup/PopUp.test.tsx +35 -0
- package/src/components/popup/PopUp.tsx +60 -0
- package/src/components/popup/index.ts +1 -0
- package/src/components/progressBar/ProgressBar.test.tsx +78 -0
- package/src/components/progressBar/ProgressBar.tsx +93 -0
- package/src/components/progressBar/index.ts +1 -0
- package/src/components/property360View/Property360View.test.tsx +24 -0
- package/src/components/property360View/Property360View.tsx +19 -0
- package/src/components/property360View/index.ts +1 -0
- package/src/components/rating/Rating.styles.ts +13 -0
- package/src/components/rating/Rating.test.tsx +61 -0
- package/src/components/rating/Rating.tsx +96 -0
- package/src/components/rating/index.ts +1 -0
- package/src/components/tabs/Tabs.interface.ts +13 -0
- package/src/components/tabs/Tabs.styles.ts +36 -0
- package/src/components/tabs/Tabs.test.tsx +20 -0
- package/src/components/tabs/Tabs.tsx +65 -0
- package/src/components/tabs/index.ts +1 -0
- package/src/components/tags/Tags.interface.ts +12 -0
- package/src/components/tags/Tags.styles.ts +36 -0
- package/src/components/tags/Tags.test.tsx +22 -0
- package/src/components/tags/Tags.tsx +76 -0
- package/src/components/tags/index.ts +1 -0
- package/src/components/toggleButton/ToggleButton.styles.ts +40 -0
- package/src/components/toggleButton/ToggleButton.test.tsx +33 -0
- package/src/components/toggleButton/ToggleButton.tsx +78 -0
- package/src/components/toggleButton/index.ts +1 -0
- package/src/index.ts +19 -0
- package/src/theme/ThemeContext.tsx +32 -0
- package/src/theme/colors.ts +156 -0
- package/src/theme/fonts.ts +303 -0
- package/src/theme/themes.ts +20 -0
- package/src/theme/withThemeProvider.tsx +14 -0
- package/src/utils/appEnum.ts +17 -0
- package/src/utils/commonStyles.ts +17 -0
- package/src/utils/constants.ts +17 -0
- package/src/utils/deviceUtils.ts +9 -0
- package/src/utils/regex.ts +1 -0
- package/src/utils/stylehelper.ts +13 -0
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import React, {useState, useRef, useEffect} from 'react';
|
|
2
|
+
import {View, Animated, Pressable} from 'react-native';
|
|
3
|
+
import {DHRE_COLORS_ALERT, DHRE_COLORS_TEXT} from '../../theme/colors';
|
|
4
|
+
import styles from './ToggleButton.styles';
|
|
5
|
+
import CustomTypography from '../../components/customTypography/CustomTypography';
|
|
6
|
+
import {
|
|
7
|
+
ToggleButtonType,
|
|
8
|
+
TextDirectType,
|
|
9
|
+
ToggleTextType,
|
|
10
|
+
} from '../../utils/appEnum';
|
|
11
|
+
interface CustomSwitchProps {
|
|
12
|
+
onValueChange: (value: boolean) => void;
|
|
13
|
+
value: boolean;
|
|
14
|
+
type?: ToggleButtonType;
|
|
15
|
+
trackWidth?: number;
|
|
16
|
+
width?: number;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
const CustomSwitch: React.FC<CustomSwitchProps> = ({
|
|
20
|
+
onValueChange,
|
|
21
|
+
value,
|
|
22
|
+
type = ToggleButtonType.LARGE,
|
|
23
|
+
trackWidth = type !== ToggleButtonType.SMALL ? 35 : 15,
|
|
24
|
+
width = type !== ToggleButtonType.SMALL ? 60 : 40,
|
|
25
|
+
}) => {
|
|
26
|
+
const [isOn, setIsOn] = useState(value);
|
|
27
|
+
const animatedValue = useRef(
|
|
28
|
+
new Animated.Value(value ? trackWidth : 0),
|
|
29
|
+
).current;
|
|
30
|
+
|
|
31
|
+
useEffect(() => {
|
|
32
|
+
Animated.timing(animatedValue, {
|
|
33
|
+
toValue: isOn ? trackWidth : 0,
|
|
34
|
+
duration: 200,
|
|
35
|
+
useNativeDriver: true,
|
|
36
|
+
}).start();
|
|
37
|
+
}, [isOn, animatedValue, trackWidth]);
|
|
38
|
+
|
|
39
|
+
const toggleSwitch = () => {
|
|
40
|
+
setIsOn(!isOn);
|
|
41
|
+
onValueChange(!isOn);
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
const animatedStyle = {
|
|
45
|
+
transform: [{translateX: animatedValue}],
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
return (
|
|
49
|
+
<Pressable
|
|
50
|
+
onPress={toggleSwitch}
|
|
51
|
+
style={[styles.container, {width}]}
|
|
52
|
+
testID="custom-switch">
|
|
53
|
+
<View
|
|
54
|
+
style={[
|
|
55
|
+
styles.track,
|
|
56
|
+
{
|
|
57
|
+
backgroundColor: isOn
|
|
58
|
+
? DHRE_COLORS_ALERT.DH_SUCCESS_GREEN_ACCENT
|
|
59
|
+
: DHRE_COLORS_TEXT.DH_TEXTDISABLED,
|
|
60
|
+
},
|
|
61
|
+
]}>
|
|
62
|
+
<Animated.View style={[styles.thumb, animatedStyle]} />
|
|
63
|
+
{type !== ToggleButtonType.SMALL && (
|
|
64
|
+
<CustomTypography
|
|
65
|
+
variant="B3semiBold"
|
|
66
|
+
style={[
|
|
67
|
+
styles.text,
|
|
68
|
+
{textAlign: isOn ? TextDirectType.left : TextDirectType.right},
|
|
69
|
+
]}
|
|
70
|
+
text={isOn ? ToggleTextType.ON : ToggleTextType.OFF}
|
|
71
|
+
/>
|
|
72
|
+
)}
|
|
73
|
+
</View>
|
|
74
|
+
</Pressable>
|
|
75
|
+
);
|
|
76
|
+
};
|
|
77
|
+
|
|
78
|
+
export default CustomSwitch;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {default} from './ToggleButton';
|
package/src/index.ts
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export {default as CustomText} from './components/customText';
|
|
2
|
+
// export {default as AutoOtpReader} from './components/autoOtpReader'; //TODO: warn
|
|
3
|
+
export {default as Badge} from './components/badge';
|
|
4
|
+
export {default as BottomDrawer} from './components/bottomDrawer';
|
|
5
|
+
export {default as Button} from './components/button';
|
|
6
|
+
export {default as Cards} from './components/cards';
|
|
7
|
+
export {default as CheckBox} from './components/checkBox';
|
|
8
|
+
export {default as CustomDropdown} from './components/customDropdown';
|
|
9
|
+
export {default as CustomTextInput} from './components/customInputText';
|
|
10
|
+
export {default as CustomTooltip} from './components/customTooltip';
|
|
11
|
+
export {default as FileUpload} from './components/fileUpload';
|
|
12
|
+
// export {default as PdfView} from './components/pdfView'; //TODO: error
|
|
13
|
+
export {default as PopUp} from './components/popup';
|
|
14
|
+
export {default as CustomProgressBar} from './components/progressBar';
|
|
15
|
+
export {default as Property360View} from './components/property360View';
|
|
16
|
+
export {default as StarRating} from './components/rating';
|
|
17
|
+
export {default as Tabs} from './components/tabs';
|
|
18
|
+
export {default as Tags} from './components/tags';
|
|
19
|
+
export {default as ToggleButton} from './components/toggleButton';
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import React, {createContext, useContext, ReactNode} from 'react';
|
|
2
|
+
import {lightTheme, darkTheme} from './themes';
|
|
3
|
+
import {useSelector} from 'react-redux';
|
|
4
|
+
|
|
5
|
+
interface ThemeContextType {
|
|
6
|
+
theme: typeof lightTheme | typeof darkTheme;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
const ThemeContext = createContext<ThemeContextType | undefined>(undefined);
|
|
10
|
+
|
|
11
|
+
interface ThemeProviderProps {
|
|
12
|
+
children: ReactNode;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export const ThemeProvider: React.FC<ThemeProviderProps> = ({children}) => {
|
|
16
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
17
|
+
const theme = useSelector((state: any) => state.theme.theme);
|
|
18
|
+
//TODO: please comment line no 16 and uncomment 18 to run
|
|
19
|
+
// const theme = false ? darkTheme : lightTheme;
|
|
20
|
+
|
|
21
|
+
return (
|
|
22
|
+
<ThemeContext.Provider value={{theme}}>{children}</ThemeContext.Provider>
|
|
23
|
+
);
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
export const useTheme = (): ThemeContextType => {
|
|
27
|
+
const context = useContext(ThemeContext);
|
|
28
|
+
if (context === undefined) {
|
|
29
|
+
throw new Error('useTheme must be used within a ThemeProvider');
|
|
30
|
+
}
|
|
31
|
+
return context;
|
|
32
|
+
};
|
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
export const DHRE_COLORS_PRIMARY = {
|
|
2
|
+
//Black
|
|
3
|
+
DH_BLACK_25: '#C4C5C7',
|
|
4
|
+
DH_BLACK_50: '#888B8F',
|
|
5
|
+
DH_BLACK_75: '#4D5257',
|
|
6
|
+
DH_BLACK_100: '#101820',
|
|
7
|
+
|
|
8
|
+
//RED
|
|
9
|
+
DH_RED_25: '#EFCBC7',
|
|
10
|
+
DH_RED_50: '#E09890',
|
|
11
|
+
DH_RED_75: '#D3675B',
|
|
12
|
+
DH_RED_100: '#DA291C',
|
|
13
|
+
|
|
14
|
+
//GREY
|
|
15
|
+
DH_GREY_25: '#D7D9DB',
|
|
16
|
+
DH_GREY_50: '#AEB3B7',
|
|
17
|
+
DH_GREY_75: '#868D93',
|
|
18
|
+
DH_GREY_100: '#5B6770',
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
export const DHRE_COLORS_SECONDARY = {
|
|
22
|
+
//LIGHT SKY
|
|
23
|
+
DH_LIGHT_SKY_25: '#EBF6F9',
|
|
24
|
+
DH_LIGHT_SKY_50: '#D7ECF3',
|
|
25
|
+
DH_LIGHT_SKY_75: '#C3E3EC',
|
|
26
|
+
DH_LIGHT_SKY_100: '#A4DBE8',
|
|
27
|
+
|
|
28
|
+
DH_BIEGE_25: '#F0EDEB',
|
|
29
|
+
DH_BIEGE_50: '#E1DCD6',
|
|
30
|
+
DH_BIEGE_75: '#D2CBC2',
|
|
31
|
+
DH_BIEGE_100: '#C5B9AC',
|
|
32
|
+
|
|
33
|
+
DH_GREEN_DARK_0: '#F5FFF8',
|
|
34
|
+
DH_GREEN_DARK_100: '#EEFDF2',
|
|
35
|
+
DH_GREEN_DARK_200: '#E2F9E8',
|
|
36
|
+
DH_GREEN_DARK_300: '#D0F2DA',
|
|
37
|
+
DH_GREEN_DARK_400: '#B7E9C6',
|
|
38
|
+
DH_GREEN_DARK_500: '#98DDAC',
|
|
39
|
+
DH_GREEN_DARK_600: '#72CD8D',
|
|
40
|
+
DH_GREEN_DARK_700: '#4BB86C',
|
|
41
|
+
DH_GREEN_DARK_800: '#28A04C',
|
|
42
|
+
DH_GREEN_DARK_900: '#0E8732',
|
|
43
|
+
DH_GREEN_DARK: '#2F5A3C',
|
|
44
|
+
|
|
45
|
+
DH_BLUE_DARK_0: '#F5FCFF',
|
|
46
|
+
DH_BLUE_DARK_100: '#EEF8FD',
|
|
47
|
+
DH_BLUE_DARK_200: '#E2F1F9',
|
|
48
|
+
DH_BLUE_DARK_300: '#D0E7F2',
|
|
49
|
+
DH_BLUE_DARK_400: '#B7D9E9',
|
|
50
|
+
DH_BLUE_DARK_500: '#98C7DD',
|
|
51
|
+
DH_BLUE_DARK_600: '#72B0CD',
|
|
52
|
+
DH_BLUE_DARK_700: '#4B95B8',
|
|
53
|
+
DH_BLUE_DARK_800: '#4B95B8',
|
|
54
|
+
DH_BLUE_DARK_900: '#0E6187',
|
|
55
|
+
DH_BLUE_DARK: '#2C576B',
|
|
56
|
+
|
|
57
|
+
DH_BLUE_0: '#F5F9FF',
|
|
58
|
+
DH_BLUE_100: '#E2EDFE',
|
|
59
|
+
DH_BLUE_200: '#C1D9FB',
|
|
60
|
+
DH_BLUE_300: '#9BC1F6',
|
|
61
|
+
DH_BLUE_400: '#73A6ED',
|
|
62
|
+
DH_BLUE_500: '#4C8AE0',
|
|
63
|
+
DH_BLUE_600: '#276CCD',
|
|
64
|
+
DH_BLUE_700: '#1B5CB8',
|
|
65
|
+
DH_BLUE_800: '#134EA0',
|
|
66
|
+
DH_BLUE_900: '#0E4087',
|
|
67
|
+
DH_BLUE: '#4686E0',
|
|
68
|
+
};
|
|
69
|
+
|
|
70
|
+
export const DHRE_COLORS_ALERT = {
|
|
71
|
+
DH_SUCCESS_GREEN_0: '#F5FFFA',
|
|
72
|
+
DH_SUCCESS_GREEN_100: '#DFFEEE',
|
|
73
|
+
DH_SUCCESS_GREEN_200: '#99FBC7',
|
|
74
|
+
DH_SUCCESS_GREEN_300: '#72F7B0',
|
|
75
|
+
DH_SUCCESS_GREEN_400: '#53F29D',
|
|
76
|
+
DH_SUCCESS_GREEN_500: '#3CEB8D',
|
|
77
|
+
DH_SUCCESS_GREEN_600: '#2BE180',
|
|
78
|
+
DH_SUCCESS_GREEN_700: '#1FD574',
|
|
79
|
+
DH_SUCCESS_GREEN_800: '#17C669',
|
|
80
|
+
DH_SUCCESS_GREEN_900: '#12B85F',
|
|
81
|
+
DH_SUCCESS_GREEN: '#10CF68',
|
|
82
|
+
DH_SUCCESS_GREEN_ACCENT: '#00B578',
|
|
83
|
+
|
|
84
|
+
DH_INFO_BLUE_0: '#F5F9FF',
|
|
85
|
+
DH_INFO_BLUE_100: '#EDF3FD',
|
|
86
|
+
DH_INFO_BLUE_200: '#E0EAF9',
|
|
87
|
+
DH_INFO_BLUE_300: '#CDDCF2',
|
|
88
|
+
DH_INFO_BLUE_400: '#B3C8E9',
|
|
89
|
+
DH_INFO_BLUE_500: '#91AFDD',
|
|
90
|
+
DH_INFO_BLUE_600: '#6991CD',
|
|
91
|
+
DH_INFO_BLUE_700: '#3F6FB8',
|
|
92
|
+
DH_INFO_BLUE_800: '#1B50A0',
|
|
93
|
+
DH_INFO_BLUE_900: '#003687',
|
|
94
|
+
DH_INFO_BLUE: '#2B5FAC',
|
|
95
|
+
|
|
96
|
+
DH_ALERT_ORANGE_0: '#FEF6F4',
|
|
97
|
+
DH_ALERT_ORANGE_100: '#FDEDE8',
|
|
98
|
+
DH_ALERT_ORANGE_200: '#F6C6B6',
|
|
99
|
+
DH_ALERT_ORANGE_300: '#F3B39D',
|
|
100
|
+
DH_ALERT_ORANGE_400: '#EF8F6E',
|
|
101
|
+
DH_ALERT_ORANGE_500: '#ED6C43',
|
|
102
|
+
DH_ALERT_ORANGE_600: '#BC3D1D',
|
|
103
|
+
DH_ALERT_ORANGE_700: '#8D2E13',
|
|
104
|
+
DH_ALERT_ORANGE_800: '#5E1E0A',
|
|
105
|
+
DH_ALERT_ORANGE_900: '#461606',
|
|
106
|
+
DH_ALERT_ORANGE: '#FF3A00',
|
|
107
|
+
|
|
108
|
+
DH_WARNING_YELLOW_0: '#FFFBF5',
|
|
109
|
+
DH_WARNING_YELLOW_100: '#FEEFD4',
|
|
110
|
+
DH_WARNING_YELLOW_200: '#FBE1B2',
|
|
111
|
+
DH_WARNING_YELLOW_300: '#F5D18D',
|
|
112
|
+
DH_WARNING_YELLOW_400: '#ECBC62',
|
|
113
|
+
DH_WARNING_YELLOW_500: '#DDA338',
|
|
114
|
+
DH_WARNING_YELLOW_600: '#CD9327',
|
|
115
|
+
DH_WARNING_YELLOW_700: '#B8811B',
|
|
116
|
+
DH_WARNING_YELLOW_800: '#A06F13',
|
|
117
|
+
DH_WARNING_YELLOW_900: '#875D0E',
|
|
118
|
+
DH_WARNING_YELLOW: '#F4AE28',
|
|
119
|
+
};
|
|
120
|
+
|
|
121
|
+
export const DHRE_COLORS_BG = {
|
|
122
|
+
DH_LINE_GREY_0: '#FAFAFA',
|
|
123
|
+
DH_LINE_GREY_100: '#F6F6F6',
|
|
124
|
+
DH_LINE_GREY_200: '#F1F1F1',
|
|
125
|
+
DH_LINE_GREY_300: '#EDEDED',
|
|
126
|
+
DH_LINE_GREY_400: '#EDEDED',
|
|
127
|
+
DH_LINE_GREY_500: '#CCCACA',
|
|
128
|
+
DH_LINE_GREY_600: '#B4B2B2',
|
|
129
|
+
DH_LINE_GREY_700: '#959494',
|
|
130
|
+
DH_LINE_GREY_800: '#727171',
|
|
131
|
+
DH_LINE_GREY_900: '#4D4C4C',
|
|
132
|
+
DH_GREY1: '#E8E8E8',
|
|
133
|
+
|
|
134
|
+
DH_BG_GREY_0: '#F5F7FF',
|
|
135
|
+
DH_BG_GREY_100: '#F2F4FD',
|
|
136
|
+
DH_BG_GREY_200: '#EDEFF9',
|
|
137
|
+
DH_BG_GREY_300: '#E5E7F2',
|
|
138
|
+
DH_BG_GREY_400: '#D9DCE9',
|
|
139
|
+
DH_BG_GREY_500: '#CACDDD',
|
|
140
|
+
DH_BG_GREY_600: '#B7BBCD',
|
|
141
|
+
DH_BG_GREY_700: '#A0A4B8',
|
|
142
|
+
DH_BG_GREY_800: '#878BA0',
|
|
143
|
+
DH_BG_GREY_900: '#6F7387',
|
|
144
|
+
DH_BG_GREY: '#F2F3F8',
|
|
145
|
+
};
|
|
146
|
+
|
|
147
|
+
export const DHRE_COLORS_TEXT = {
|
|
148
|
+
//Black
|
|
149
|
+
DH_BLACK: '#000000',
|
|
150
|
+
DH_WHITE: '#FFFFFF',
|
|
151
|
+
DH_TEXTDARK: '#3A3B43',
|
|
152
|
+
DH_TEXTLIGHT: '#6C6C6C',
|
|
153
|
+
DH_TEXTLIGHTEST: '#A7A7A7',
|
|
154
|
+
DH_TEXTDISABLED: '#CCCCCC',
|
|
155
|
+
DH_LIGHTGREEN: '#00B578',
|
|
156
|
+
};
|
|
@@ -0,0 +1,303 @@
|
|
|
1
|
+
import {TextStyle} from 'react-native';
|
|
2
|
+
import {moderateScale, verticalScale} from '../utils/stylehelper';
|
|
3
|
+
|
|
4
|
+
const boldWeight = '700';
|
|
5
|
+
const semiboldWeight = '600';
|
|
6
|
+
const mediumWeight = '500';
|
|
7
|
+
const regularWeight = '400';
|
|
8
|
+
interface FontStyles {
|
|
9
|
+
[key: string]: TextStyle;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export const FONT_STYLES: FontStyles = {
|
|
13
|
+
// Heading Fonts
|
|
14
|
+
H1bold: {
|
|
15
|
+
fontWeight: boldWeight,
|
|
16
|
+
fontSize: moderateScale(36),
|
|
17
|
+
lineHeight: verticalScale(44),
|
|
18
|
+
} as TextStyle,
|
|
19
|
+
H1semiBold: {
|
|
20
|
+
fontWeight: semiboldWeight,
|
|
21
|
+
fontSize: moderateScale(36),
|
|
22
|
+
lineHeight: verticalScale(44),
|
|
23
|
+
} as TextStyle,
|
|
24
|
+
H1medium: {
|
|
25
|
+
fontWeight: mediumWeight,
|
|
26
|
+
fontSize: moderateScale(36),
|
|
27
|
+
lineHeight: verticalScale(44),
|
|
28
|
+
} as TextStyle,
|
|
29
|
+
H2bold: {
|
|
30
|
+
fontWeight: boldWeight,
|
|
31
|
+
fontSize: moderateScale(32),
|
|
32
|
+
lineHeight: verticalScale(40),
|
|
33
|
+
} as TextStyle,
|
|
34
|
+
H2semiBold: {
|
|
35
|
+
fontWeight: semiboldWeight,
|
|
36
|
+
fontSize: moderateScale(32),
|
|
37
|
+
lineHeight: verticalScale(40),
|
|
38
|
+
} as TextStyle,
|
|
39
|
+
H2medium: {
|
|
40
|
+
fontWeight: mediumWeight,
|
|
41
|
+
fontSize: moderateScale(32),
|
|
42
|
+
lineHeight: verticalScale(40),
|
|
43
|
+
} as TextStyle,
|
|
44
|
+
H3bold: {
|
|
45
|
+
fontWeight: boldWeight,
|
|
46
|
+
fontSize: moderateScale(28),
|
|
47
|
+
lineHeight: verticalScale(36),
|
|
48
|
+
} as TextStyle,
|
|
49
|
+
H3semiBold: {
|
|
50
|
+
fontWeight: semiboldWeight,
|
|
51
|
+
fontSize: moderateScale(28),
|
|
52
|
+
lineHeight: verticalScale(36),
|
|
53
|
+
} as TextStyle,
|
|
54
|
+
H3medium: {
|
|
55
|
+
fontWeight: mediumWeight,
|
|
56
|
+
fontSize: moderateScale(28),
|
|
57
|
+
lineHeight: verticalScale(36),
|
|
58
|
+
} as TextStyle,
|
|
59
|
+
H4bold: {
|
|
60
|
+
fontWeight: boldWeight,
|
|
61
|
+
fontSize: moderateScale(24),
|
|
62
|
+
lineHeight: verticalScale(32),
|
|
63
|
+
} as TextStyle,
|
|
64
|
+
H4semiBold: {
|
|
65
|
+
fontWeight: semiboldWeight,
|
|
66
|
+
fontSize: moderateScale(24),
|
|
67
|
+
lineHeight: verticalScale(32),
|
|
68
|
+
} as TextStyle,
|
|
69
|
+
H4medium: {
|
|
70
|
+
fontWeight: mediumWeight,
|
|
71
|
+
fontSize: moderateScale(24),
|
|
72
|
+
lineHeight: verticalScale(32),
|
|
73
|
+
} as TextStyle,
|
|
74
|
+
H5bold: {
|
|
75
|
+
fontWeight: boldWeight,
|
|
76
|
+
fontSize: moderateScale(20),
|
|
77
|
+
lineHeight: verticalScale(28),
|
|
78
|
+
} as TextStyle,
|
|
79
|
+
H5semiBold: {
|
|
80
|
+
fontWeight: semiboldWeight,
|
|
81
|
+
fontSize: moderateScale(20),
|
|
82
|
+
lineHeight: verticalScale(28),
|
|
83
|
+
} as TextStyle,
|
|
84
|
+
H5medium: {
|
|
85
|
+
fontWeight: mediumWeight,
|
|
86
|
+
fontSize: moderateScale(20),
|
|
87
|
+
lineHeight: verticalScale(28),
|
|
88
|
+
} as TextStyle,
|
|
89
|
+
H6bold: {
|
|
90
|
+
fontWeight: boldWeight,
|
|
91
|
+
fontSize: moderateScale(18),
|
|
92
|
+
lineHeight: verticalScale(24),
|
|
93
|
+
} as TextStyle,
|
|
94
|
+
H6semiBold: {
|
|
95
|
+
fontWeight: semiboldWeight,
|
|
96
|
+
fontSize: moderateScale(18),
|
|
97
|
+
lineHeight: verticalScale(24),
|
|
98
|
+
} as TextStyle,
|
|
99
|
+
H6medium: {
|
|
100
|
+
fontWeight: mediumWeight,
|
|
101
|
+
fontSize: moderateScale(18),
|
|
102
|
+
lineHeight: verticalScale(24),
|
|
103
|
+
} as TextStyle,
|
|
104
|
+
H7bold: {
|
|
105
|
+
fontWeight: boldWeight,
|
|
106
|
+
fontSize: moderateScale(16),
|
|
107
|
+
lineHeight: verticalScale(24),
|
|
108
|
+
} as TextStyle,
|
|
109
|
+
H7semiBold: {
|
|
110
|
+
fontWeight: semiboldWeight,
|
|
111
|
+
fontSize: moderateScale(16),
|
|
112
|
+
lineHeight: verticalScale(24),
|
|
113
|
+
} as TextStyle,
|
|
114
|
+
H7medium: {
|
|
115
|
+
fontWeight: mediumWeight,
|
|
116
|
+
fontSize: moderateScale(16),
|
|
117
|
+
lineHeight: verticalScale(24),
|
|
118
|
+
} as TextStyle,
|
|
119
|
+
H8bold: {
|
|
120
|
+
fontWeight: boldWeight,
|
|
121
|
+
fontSize: moderateScale(14),
|
|
122
|
+
lineHeight: verticalScale(22),
|
|
123
|
+
} as TextStyle,
|
|
124
|
+
H8semiBold: {
|
|
125
|
+
fontWeight: semiboldWeight,
|
|
126
|
+
fontSize: moderateScale(14),
|
|
127
|
+
lineHeight: verticalScale(22),
|
|
128
|
+
} as TextStyle,
|
|
129
|
+
H8medium: {
|
|
130
|
+
fontWeight: mediumWeight,
|
|
131
|
+
fontSize: moderateScale(14),
|
|
132
|
+
lineHeight: verticalScale(22),
|
|
133
|
+
} as TextStyle,
|
|
134
|
+
H9bold: {
|
|
135
|
+
fontWeight: boldWeight,
|
|
136
|
+
fontSize: moderateScale(12),
|
|
137
|
+
lineHeight: verticalScale(16),
|
|
138
|
+
} as TextStyle,
|
|
139
|
+
H9semiBold: {
|
|
140
|
+
fontWeight: semiboldWeight,
|
|
141
|
+
fontSize: moderateScale(12),
|
|
142
|
+
lineHeight: verticalScale(16),
|
|
143
|
+
} as TextStyle,
|
|
144
|
+
H9medium: {
|
|
145
|
+
fontWeight: mediumWeight,
|
|
146
|
+
fontSize: moderateScale(12),
|
|
147
|
+
lineHeight: verticalScale(16),
|
|
148
|
+
} as TextStyle,
|
|
149
|
+
|
|
150
|
+
// Paragraph Fonts
|
|
151
|
+
P1regular: {
|
|
152
|
+
fontWeight: regularWeight,
|
|
153
|
+
fontSize: moderateScale(18),
|
|
154
|
+
lineHeight: verticalScale(24),
|
|
155
|
+
} as TextStyle,
|
|
156
|
+
P1semiBold: {
|
|
157
|
+
fontWeight: semiboldWeight,
|
|
158
|
+
fontSize: moderateScale(18),
|
|
159
|
+
lineHeight: verticalScale(24),
|
|
160
|
+
} as TextStyle,
|
|
161
|
+
P1medium: {
|
|
162
|
+
fontWeight: mediumWeight,
|
|
163
|
+
fontSize: moderateScale(18),
|
|
164
|
+
lineHeight: verticalScale(24),
|
|
165
|
+
} as TextStyle,
|
|
166
|
+
P2regular: {
|
|
167
|
+
fontWeight: regularWeight,
|
|
168
|
+
fontSize: moderateScale(16),
|
|
169
|
+
lineHeight: verticalScale(24),
|
|
170
|
+
} as TextStyle,
|
|
171
|
+
P2semiBold: {
|
|
172
|
+
fontWeight: semiboldWeight,
|
|
173
|
+
fontSize: moderateScale(16),
|
|
174
|
+
lineHeight: verticalScale(24),
|
|
175
|
+
} as TextStyle,
|
|
176
|
+
P2medium: {
|
|
177
|
+
fontWeight: mediumWeight,
|
|
178
|
+
fontSize: moderateScale(16),
|
|
179
|
+
lineHeight: verticalScale(24),
|
|
180
|
+
} as TextStyle,
|
|
181
|
+
P3regular: {
|
|
182
|
+
fontWeight: regularWeight,
|
|
183
|
+
fontSize: moderateScale(14),
|
|
184
|
+
lineHeight: verticalScale(22),
|
|
185
|
+
} as TextStyle,
|
|
186
|
+
P3semiBold: {
|
|
187
|
+
fontWeight: semiboldWeight,
|
|
188
|
+
fontSize: moderateScale(14),
|
|
189
|
+
lineHeight: verticalScale(22),
|
|
190
|
+
} as TextStyle,
|
|
191
|
+
P3medium: {
|
|
192
|
+
fontWeight: mediumWeight,
|
|
193
|
+
fontSize: moderateScale(14),
|
|
194
|
+
lineHeight: verticalScale(22),
|
|
195
|
+
} as TextStyle,
|
|
196
|
+
P4regular: {
|
|
197
|
+
fontWeight: regularWeight,
|
|
198
|
+
fontSize: moderateScale(12),
|
|
199
|
+
lineHeight: verticalScale(16),
|
|
200
|
+
} as TextStyle,
|
|
201
|
+
P4semiBold: {
|
|
202
|
+
fontWeight: semiboldWeight,
|
|
203
|
+
fontSize: moderateScale(12),
|
|
204
|
+
lineHeight: verticalScale(16),
|
|
205
|
+
} as TextStyle,
|
|
206
|
+
P4medium: {
|
|
207
|
+
fontWeight: mediumWeight,
|
|
208
|
+
fontSize: moderateScale(12),
|
|
209
|
+
lineHeight: verticalScale(16),
|
|
210
|
+
} as TextStyle,
|
|
211
|
+
P5bold: {
|
|
212
|
+
fontWeight: boldWeight,
|
|
213
|
+
fontSize: moderateScale(11),
|
|
214
|
+
lineHeight: verticalScale(16),
|
|
215
|
+
} as TextStyle,
|
|
216
|
+
P5semiBold: {
|
|
217
|
+
fontWeight: semiboldWeight,
|
|
218
|
+
fontSize: moderateScale(11),
|
|
219
|
+
lineHeight: verticalScale(16),
|
|
220
|
+
} as TextStyle,
|
|
221
|
+
P5medium: {
|
|
222
|
+
fontWeight: mediumWeight,
|
|
223
|
+
fontSize: moderateScale(11),
|
|
224
|
+
lineHeight: verticalScale(16),
|
|
225
|
+
} as TextStyle,
|
|
226
|
+
|
|
227
|
+
// Button Fonts
|
|
228
|
+
B1bold: {
|
|
229
|
+
fontWeight: regularWeight,
|
|
230
|
+
fontSize: moderateScale(16),
|
|
231
|
+
lineHeight: verticalScale(20),
|
|
232
|
+
} as TextStyle,
|
|
233
|
+
B1semiBold: {
|
|
234
|
+
fontWeight: semiboldWeight,
|
|
235
|
+
fontSize: moderateScale(16),
|
|
236
|
+
lineHeight: verticalScale(20),
|
|
237
|
+
} as TextStyle,
|
|
238
|
+
B1medium: {
|
|
239
|
+
fontWeight: mediumWeight,
|
|
240
|
+
fontSize: moderateScale(16),
|
|
241
|
+
lineHeight: verticalScale(20),
|
|
242
|
+
} as TextStyle,
|
|
243
|
+
B2bold: {
|
|
244
|
+
fontWeight: regularWeight,
|
|
245
|
+
fontSize: moderateScale(14),
|
|
246
|
+
lineHeight: verticalScale(20),
|
|
247
|
+
} as TextStyle,
|
|
248
|
+
B2semiBold: {
|
|
249
|
+
fontWeight: semiboldWeight,
|
|
250
|
+
fontSize: moderateScale(14),
|
|
251
|
+
lineHeight: verticalScale(20),
|
|
252
|
+
} as TextStyle,
|
|
253
|
+
B2medium: {
|
|
254
|
+
fontWeight: mediumWeight,
|
|
255
|
+
fontSize: moderateScale(14),
|
|
256
|
+
lineHeight: verticalScale(20),
|
|
257
|
+
} as TextStyle,
|
|
258
|
+
B3bold: {
|
|
259
|
+
fontWeight: regularWeight,
|
|
260
|
+
fontSize: moderateScale(12),
|
|
261
|
+
lineHeight: verticalScale(16),
|
|
262
|
+
} as TextStyle,
|
|
263
|
+
B3semiBold: {
|
|
264
|
+
fontWeight: semiboldWeight,
|
|
265
|
+
fontSize: moderateScale(12),
|
|
266
|
+
lineHeight: verticalScale(16),
|
|
267
|
+
} as TextStyle,
|
|
268
|
+
B3medium: {
|
|
269
|
+
fontWeight: mediumWeight,
|
|
270
|
+
fontSize: moderateScale(12),
|
|
271
|
+
lineHeight: verticalScale(16),
|
|
272
|
+
} as TextStyle,
|
|
273
|
+
B4bold: {
|
|
274
|
+
fontWeight: regularWeight,
|
|
275
|
+
fontSize: moderateScale(10),
|
|
276
|
+
lineHeight: verticalScale(12),
|
|
277
|
+
} as TextStyle,
|
|
278
|
+
B4semiBold: {
|
|
279
|
+
fontWeight: semiboldWeight,
|
|
280
|
+
fontSize: moderateScale(10),
|
|
281
|
+
lineHeight: verticalScale(12),
|
|
282
|
+
} as TextStyle,
|
|
283
|
+
B4medium: {
|
|
284
|
+
fontWeight: mediumWeight,
|
|
285
|
+
fontSize: moderateScale(10),
|
|
286
|
+
lineHeight: verticalScale(12),
|
|
287
|
+
} as TextStyle,
|
|
288
|
+
B5bold: {
|
|
289
|
+
fontWeight: boldWeight,
|
|
290
|
+
fontSize: moderateScale(9),
|
|
291
|
+
lineHeight: verticalScale(12),
|
|
292
|
+
} as TextStyle,
|
|
293
|
+
B5semiBold: {
|
|
294
|
+
fontWeight: semiboldWeight,
|
|
295
|
+
fontSize: moderateScale(9),
|
|
296
|
+
lineHeight: verticalScale(12),
|
|
297
|
+
} as TextStyle,
|
|
298
|
+
B5medium: {
|
|
299
|
+
fontWeight: mediumWeight,
|
|
300
|
+
fontSize: moderateScale(9),
|
|
301
|
+
lineHeight: verticalScale(12),
|
|
302
|
+
} as TextStyle,
|
|
303
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
// themes.js
|
|
2
|
+
const lightTheme = {
|
|
3
|
+
colors: {
|
|
4
|
+
background: '#ffffff',
|
|
5
|
+
text: '#000000',
|
|
6
|
+
primary: '#6200ee',
|
|
7
|
+
secondary: '#03dac6',
|
|
8
|
+
},
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
const darkTheme = {
|
|
12
|
+
colors: {
|
|
13
|
+
background: '#000000',
|
|
14
|
+
text: '#ffffff',
|
|
15
|
+
primary: '#bb86fc',
|
|
16
|
+
secondary: '#03dac6',
|
|
17
|
+
},
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
export {lightTheme, darkTheme};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import {ThemeProvider} from './ThemeContext';
|
|
3
|
+
|
|
4
|
+
// Higher-Order Component to wrap a component with the ThemeProvider
|
|
5
|
+
export const withThemeProvider = <P extends object>(
|
|
6
|
+
Component: React.ComponentType<P>,
|
|
7
|
+
) => {
|
|
8
|
+
// eslint-disable-next-line react/display-name
|
|
9
|
+
return (props: P) => (
|
|
10
|
+
<ThemeProvider>
|
|
11
|
+
<Component {...props} />
|
|
12
|
+
</ThemeProvider>
|
|
13
|
+
);
|
|
14
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export enum ShapeType {
|
|
2
|
+
LINE = 'line',
|
|
3
|
+
CIRCLE = 'circle',
|
|
4
|
+
}
|
|
5
|
+
export enum ToggleButtonType {
|
|
6
|
+
SMALL = 'small',
|
|
7
|
+
LARGE = 'large',
|
|
8
|
+
}
|
|
9
|
+
export enum TextDirectType {
|
|
10
|
+
left = 'left',
|
|
11
|
+
right = 'right',
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export enum ToggleTextType {
|
|
15
|
+
ON = 'ON',
|
|
16
|
+
OFF = 'OFF',
|
|
17
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import {StyleSheet} from 'react-native';
|
|
2
|
+
|
|
3
|
+
const commonStyles = StyleSheet.create({
|
|
4
|
+
flexOne: {
|
|
5
|
+
flex: 1,
|
|
6
|
+
},
|
|
7
|
+
centeredContainer: {
|
|
8
|
+
justifyContent: 'center',
|
|
9
|
+
alignItems: 'center',
|
|
10
|
+
},
|
|
11
|
+
centerRow: {
|
|
12
|
+
alignItems: 'center',
|
|
13
|
+
justifyContent: 'center',
|
|
14
|
+
flexDirection: 'row',
|
|
15
|
+
},
|
|
16
|
+
});
|
|
17
|
+
export default commonStyles;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export const BUTTON_TYPES = {
|
|
2
|
+
PRIMARY: 'primary',
|
|
3
|
+
SECONDARY: 'secondary',
|
|
4
|
+
DISABLE: 'disable',
|
|
5
|
+
TERTIARY: 'tertiary',
|
|
6
|
+
FUNCTION_PRIMARY: 'functionPrimary',
|
|
7
|
+
FUNCTION_SECONDARY: 'functionSecondary',
|
|
8
|
+
FUNCTION_NOTICE: 'functionNotice',
|
|
9
|
+
PRIMARY_TEXT: 'primaryText',
|
|
10
|
+
SECONDARY_TEXT: 'secondaryText',
|
|
11
|
+
DISABLE_TEXT: 'disableText',
|
|
12
|
+
TERTIARY_TEXT: 'tertiaryText',
|
|
13
|
+
FUNCTION_PRIMARY_TEXT: 'functionPrimaryText',
|
|
14
|
+
FUNCTION_SECONDARY_TEXT: 'functionSecondaryText',
|
|
15
|
+
FUNCTION_NOTICE_TEXT: 'functionNoticeText',
|
|
16
|
+
TEXT: 'Text',
|
|
17
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export const stringLengthRegex = /(\d{6})/;
|