@teamnhz/rn-ui-toolkit 1.4.2 → 1.4.4
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/dist/assets/images/downArrow.png +0 -0
- package/dist/components/AppHeader/index.d.ts +17 -1
- package/dist/components/AppHeader/index.js +36 -38
- package/dist/components/Buttons/index.d.ts +10 -3
- package/dist/components/Buttons/index.js +34 -101
- package/dist/components/Input/index.d.ts +2 -0
- package/dist/components/Input/index.js +22 -11
- package/dist/components/KeyboardScroll/index.d.ts +10 -1
- package/dist/components/KeyboardScroll/index.js +9 -73
- package/dist/components/LinearGradientButton/index.d.ts +10 -3
- package/dist/components/LinearGradientButton/index.js +47 -13
- package/dist/components/Switch/index.js +0 -80
- package/dist/components/index.d.ts +4 -0
- package/dist/components/index.js +4 -0
- package/dist/styles/appConfig.d.ts +4 -0
- package/dist/styles/appConfig.js +94 -0
- package/dist/styles/colors.js +47 -0
- package/dist/styles/images.d.ts +1 -0
- package/dist/styles/images.js +3 -1
- package/dist/styles/index.js +1 -0
- package/dist/styles/typography.d.ts +57 -36
- package/dist/styles/typography.js +430 -104
- package/package.json +1 -1
|
@@ -1,43 +1,3 @@
|
|
|
1
|
-
// import React, { useState } from "react";
|
|
2
|
-
// import { View, Switch, StyleSheet } from "react-native";
|
|
3
|
-
// import { Colors } from "../../styles";
|
|
4
|
-
// // Switch component
|
|
5
|
-
// const SwitchUI = ({
|
|
6
|
-
// isEnabled,
|
|
7
|
-
// onValueChange,
|
|
8
|
-
// }: {
|
|
9
|
-
// isEnabled?: boolean;
|
|
10
|
-
// onValueChange?: (value: boolean) => void;
|
|
11
|
-
// }) => {
|
|
12
|
-
// const [internalState, setInternalState] = useState(isEnabled ?? false);
|
|
13
|
-
// const toggleSwitch = () => {
|
|
14
|
-
// setInternalState((prev) => !prev);
|
|
15
|
-
// onValueChange && onValueChange(!internalState);
|
|
16
|
-
// };
|
|
17
|
-
// const value = isEnabled ?? internalState;
|
|
18
|
-
// return (
|
|
19
|
-
// <View
|
|
20
|
-
// style={[
|
|
21
|
-
// styles.container,
|
|
22
|
-
// { borderColor: value ? Colors.primaryColor : Colors.disabledGrey },
|
|
23
|
-
// ]}
|
|
24
|
-
// >
|
|
25
|
-
// <Switch
|
|
26
|
-
// trackColor={{ false: Colors.textGrey, true: Colors.appThemeColor }}
|
|
27
|
-
// style={{ transform: [{ scaleX: 0.8 }, { scaleY: 0.8 }] }}
|
|
28
|
-
// thumbColor={value ? Colors.black : Colors.disabledGrey}
|
|
29
|
-
// onValueChange={toggleSwitch}
|
|
30
|
-
// value={value}
|
|
31
|
-
// />
|
|
32
|
-
// </View>
|
|
33
|
-
// );
|
|
34
|
-
// };
|
|
35
|
-
// const styles = StyleSheet.create({
|
|
36
|
-
// container: {
|
|
37
|
-
// flex: 1,
|
|
38
|
-
// },
|
|
39
|
-
// });
|
|
40
|
-
// export default SwitchUI;
|
|
41
1
|
import React, { useState } from "react";
|
|
42
2
|
import { View, Switch, StyleSheet, } from "react-native";
|
|
43
3
|
import { Colors } from "../../styles";
|
|
@@ -62,43 +22,3 @@ const styles = StyleSheet.create({
|
|
|
62
22
|
},
|
|
63
23
|
});
|
|
64
24
|
export default SwitchUI;
|
|
65
|
-
// import React, { useState } from "react";
|
|
66
|
-
// import { View, Switch, StyleSheet } from "react-native";
|
|
67
|
-
// import { Colors } from "../../styles";
|
|
68
|
-
// // Switch component
|
|
69
|
-
// const SwitchUI = ({
|
|
70
|
-
// isEnabled,
|
|
71
|
-
// onValueChange,
|
|
72
|
-
// }: {
|
|
73
|
-
// isEnabled?: boolean;
|
|
74
|
-
// onValueChange?: (value: boolean) => void;
|
|
75
|
-
// }) => {
|
|
76
|
-
// const [internalState, setInternalState] = useState(isEnabled ?? false);
|
|
77
|
-
// const toggleSwitch = () => {
|
|
78
|
-
// setInternalState((prev) => !prev);
|
|
79
|
-
// onValueChange && onValueChange(!internalState);
|
|
80
|
-
// };
|
|
81
|
-
// const value = isEnabled ?? internalState;
|
|
82
|
-
// return (
|
|
83
|
-
// <View
|
|
84
|
-
// style={[
|
|
85
|
-
// styles.container,
|
|
86
|
-
// { borderColor: value ? Colors.primaryColor : Colors.disabledGrey },
|
|
87
|
-
// ]}
|
|
88
|
-
// >
|
|
89
|
-
// <Switch
|
|
90
|
-
// trackColor={{ false: "grey", true: "green" }}
|
|
91
|
-
// style={{ transform: [{ scaleX: 0.8 }, { scaleY: 0.8 }] }}
|
|
92
|
-
// thumbColor={value ? Colors.primaryColor : Colors.disabledGrey}
|
|
93
|
-
// onValueChange={toggleSwitch}
|
|
94
|
-
// value={value}
|
|
95
|
-
// />
|
|
96
|
-
// </View>
|
|
97
|
-
// );
|
|
98
|
-
// };
|
|
99
|
-
// const styles = StyleSheet.create({
|
|
100
|
-
// container: {
|
|
101
|
-
// flex: 1,
|
|
102
|
-
// },
|
|
103
|
-
// });
|
|
104
|
-
// export default SwitchUI;
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
export { Colors as TheameColor } from "../styles";
|
|
2
|
+
export { setLanguage, setFontConfig, getFont } from '../styles/appConfig';
|
|
1
3
|
export { default as Buttons } from "./Buttons";
|
|
2
4
|
export { default as Container } from "./Container";
|
|
3
5
|
export { default as Dividers } from "./Dividers";
|
|
@@ -28,3 +30,5 @@ export { default as DocumentPicker } from "./DocumentPicker";
|
|
|
28
30
|
export { default as ImagePicker } from "./ImagePicker";
|
|
29
31
|
export { default as AppHeader } from "./AppHeader";
|
|
30
32
|
export { default as LinearGradientButton } from "./LinearGradientButton";
|
|
33
|
+
export { default as Typography } from '../styles/typography';
|
|
34
|
+
export { scale, verticalScale, moderateScale } from '../styles/scale';
|
package/dist/components/index.js
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
export { Colors as TheameColor } from "../styles";
|
|
2
|
+
export { setLanguage, setFontConfig, getFont } from '../styles/appConfig';
|
|
1
3
|
export { default as Buttons } from "./Buttons";
|
|
2
4
|
export { default as Container } from "./Container";
|
|
3
5
|
export { default as Dividers } from "./Dividers";
|
|
@@ -28,3 +30,5 @@ export { default as DocumentPicker } from "./DocumentPicker";
|
|
|
28
30
|
export { default as ImagePicker } from "./ImagePicker";
|
|
29
31
|
export { default as AppHeader } from "./AppHeader";
|
|
30
32
|
export { default as LinearGradientButton } from "./LinearGradientButton";
|
|
33
|
+
export { default as Typography } from '../styles/typography';
|
|
34
|
+
export { scale, verticalScale, moderateScale } from '../styles/scale';
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
// import { setColorConfig } from "./colors";
|
|
2
|
+
// import { setTypographyConfig } from "./typography";
|
|
3
|
+
// export type AppConfig = {
|
|
4
|
+
// colors?: Record<string, string>;
|
|
5
|
+
// fonts?: any;
|
|
6
|
+
// sizes?: any;
|
|
7
|
+
// lang?: any;
|
|
8
|
+
// scaleFn?: any;
|
|
9
|
+
// };
|
|
10
|
+
// export function setAppConfig(config: AppConfig) {
|
|
11
|
+
// if (config.colors) setColorConfig(config.colors);
|
|
12
|
+
// setTypographyConfig({
|
|
13
|
+
// fonts: config.fonts,
|
|
14
|
+
// sizes: config.sizes,
|
|
15
|
+
// lang: config.lang,
|
|
16
|
+
// scaleFn: config.scaleFn,
|
|
17
|
+
// });
|
|
18
|
+
// }
|
|
19
|
+
// appConfig.js
|
|
20
|
+
let appLanguage = "en"; // en | hi
|
|
21
|
+
let customFonts = {
|
|
22
|
+
en: {
|
|
23
|
+
thin: null,
|
|
24
|
+
extraLight: null,
|
|
25
|
+
light: null,
|
|
26
|
+
regular: null,
|
|
27
|
+
medium: null,
|
|
28
|
+
semiBold: null,
|
|
29
|
+
bold: null,
|
|
30
|
+
extraBold: null,
|
|
31
|
+
black: null,
|
|
32
|
+
},
|
|
33
|
+
hi: {
|
|
34
|
+
thin: null,
|
|
35
|
+
extraLight: null,
|
|
36
|
+
light: null,
|
|
37
|
+
regular: null,
|
|
38
|
+
medium: null,
|
|
39
|
+
semiBold: null,
|
|
40
|
+
bold: null,
|
|
41
|
+
extraBold: null,
|
|
42
|
+
black: null,
|
|
43
|
+
},
|
|
44
|
+
};
|
|
45
|
+
// -----------------------------------------------------
|
|
46
|
+
// DEFAULT MONTSERRAT FONTS (ALL WEIGHTS)
|
|
47
|
+
// -----------------------------------------------------
|
|
48
|
+
const DEFAULT_FONTS = {
|
|
49
|
+
en: {
|
|
50
|
+
thin: "Montserrat-Thin",
|
|
51
|
+
extraLight: "Montserrat-ExtraLight",
|
|
52
|
+
light: "Montserrat-Light",
|
|
53
|
+
regular: "Montserrat-Regular",
|
|
54
|
+
medium: "Montserrat-Medium",
|
|
55
|
+
semiBold: "Montserrat-SemiBold",
|
|
56
|
+
bold: "Montserrat-Bold",
|
|
57
|
+
extraBold: "Montserrat-ExtraBold",
|
|
58
|
+
black: "Montserrat-Black",
|
|
59
|
+
},
|
|
60
|
+
hi: {
|
|
61
|
+
thin: "Montserrat-Thin",
|
|
62
|
+
extraLight: "Montserrat-ExtraLight",
|
|
63
|
+
light: "Montserrat-Light",
|
|
64
|
+
regular: "Montserrat-Regular",
|
|
65
|
+
medium: "Montserrat-Medium",
|
|
66
|
+
semiBold: "Montserrat-SemiBold",
|
|
67
|
+
bold: "Montserrat-Bold",
|
|
68
|
+
extraBold: "Montserrat-ExtraBold",
|
|
69
|
+
black: "Montserrat-Black",
|
|
70
|
+
},
|
|
71
|
+
};
|
|
72
|
+
// -----------------------------------------------------
|
|
73
|
+
// LANGUAGE CONTROL
|
|
74
|
+
// -----------------------------------------------------
|
|
75
|
+
export const setLanguage = (lang) => {
|
|
76
|
+
appLanguage = lang === "hi" ? "hi" : "en";
|
|
77
|
+
};
|
|
78
|
+
export const getLanguage = () => appLanguage;
|
|
79
|
+
// -----------------------------------------------------
|
|
80
|
+
// SET CUSTOM FONT (USER CAN OVERRIDE)
|
|
81
|
+
// -----------------------------------------------------
|
|
82
|
+
export const setFontConfig = (lang, weights = {}) => {
|
|
83
|
+
if (!customFonts[lang])
|
|
84
|
+
return;
|
|
85
|
+
Object.keys(customFonts[lang]).forEach((k) => {
|
|
86
|
+
customFonts[lang][k] = weights[k] || null;
|
|
87
|
+
});
|
|
88
|
+
};
|
|
89
|
+
// -----------------------------------------------------
|
|
90
|
+
// GET FONT
|
|
91
|
+
// -----------------------------------------------------
|
|
92
|
+
export const getFont = (lang, weight) => {
|
|
93
|
+
return customFonts?.[lang]?.[weight] || DEFAULT_FONTS?.[lang]?.[weight];
|
|
94
|
+
};
|
package/dist/styles/colors.js
CHANGED
|
@@ -30,3 +30,50 @@ export default {
|
|
|
30
30
|
checkedColor: "#40BFFF",
|
|
31
31
|
appThemeColor: "#017F84",
|
|
32
32
|
};
|
|
33
|
+
// src/styles/colors.ts
|
|
34
|
+
// export type ColorMap = {
|
|
35
|
+
// [key: string]: string;
|
|
36
|
+
// };
|
|
37
|
+
// const DEFAULT_COLORS: ColorMap = {
|
|
38
|
+
// background: "#ffffff",
|
|
39
|
+
// white: "white",
|
|
40
|
+
// primaryColor: "#40BFFF",
|
|
41
|
+
// darkBlue: "#062845",
|
|
42
|
+
// linkColor: "#2e96f2",
|
|
43
|
+
// textColor: "#223263",
|
|
44
|
+
// textGrey: "#9098B1",
|
|
45
|
+
// textLink: "#40BFFF",
|
|
46
|
+
// textDanger: "#FB7181",
|
|
47
|
+
// disabledGrey: "#d3d3d3",
|
|
48
|
+
// dropOptionGrey: "#FAFAFA",
|
|
49
|
+
// lightGrey: "#F4F4F4",
|
|
50
|
+
// dividerColor: "#f5f5f5",
|
|
51
|
+
// dangerRed: "red",
|
|
52
|
+
// iconGrey: "#7e7e7e",
|
|
53
|
+
// mediumGrey: "#dcdcdc",
|
|
54
|
+
// black: "#000000",
|
|
55
|
+
// productDetailCardColor: "#FDFDFD",
|
|
56
|
+
// starGold: "#F0B000",
|
|
57
|
+
// verticalLineColor: "#D8D8D8",
|
|
58
|
+
// borderGrey: "#EAEAEA",
|
|
59
|
+
// brandGreyColor: "#808080",
|
|
60
|
+
// videoPlayerbackground: "#323232",
|
|
61
|
+
// visibleColor: "#9A9A9A",
|
|
62
|
+
// primaryPurple: "#E6E6FA",
|
|
63
|
+
// lightPurple: "#F3EDFD",
|
|
64
|
+
// extraLightPurple: "#f8f5fc",
|
|
65
|
+
// lightGreen: "#68c25d",
|
|
66
|
+
// checkedColor: "#40BFFF",
|
|
67
|
+
// appThemeColor: "#017F84",
|
|
68
|
+
// };
|
|
69
|
+
// // internal mutable state
|
|
70
|
+
// let _colors = { ...DEFAULT_COLORS };
|
|
71
|
+
// export function setColorConfig(colors: Partial<ColorMap>) {
|
|
72
|
+
// _colors = { ..._colors, ...colors };
|
|
73
|
+
// }
|
|
74
|
+
// export function getColors(): ColorMap {
|
|
75
|
+
// return JSON.parse(JSON.stringify(_colors));
|
|
76
|
+
// }
|
|
77
|
+
// export const Colors = new Proxy(_colors, {
|
|
78
|
+
// get: (_, prop: string) => _colors[prop],
|
|
79
|
+
// });
|
package/dist/styles/images.d.ts
CHANGED
package/dist/styles/images.js
CHANGED
|
@@ -7,6 +7,7 @@ import video_icon from '../assets/images/video_icon.png';
|
|
|
7
7
|
import cancel from '../assets/images/cancel.png';
|
|
8
8
|
import ic_calendar from '../assets/images/ic_calendar.png';
|
|
9
9
|
import ic_time from '../assets/images/ic_time.png';
|
|
10
|
+
import down_arrow from '../assets/images/downArrow.png';
|
|
10
11
|
export default {
|
|
11
12
|
GoogleIcon,
|
|
12
13
|
Eyeoff,
|
|
@@ -15,5 +16,6 @@ export default {
|
|
|
15
16
|
cancel,
|
|
16
17
|
video_icon,
|
|
17
18
|
ic_calendar,
|
|
18
|
-
ic_time
|
|
19
|
+
ic_time,
|
|
20
|
+
down_arrow
|
|
19
21
|
};
|
package/dist/styles/index.js
CHANGED
|
@@ -16,74 +16,95 @@ declare const _default: {
|
|
|
16
16
|
fontSize: number;
|
|
17
17
|
};
|
|
18
18
|
};
|
|
19
|
+
weights: {
|
|
20
|
+
thin: () => {
|
|
21
|
+
fontFamily: any;
|
|
22
|
+
};
|
|
23
|
+
extraLight: () => {
|
|
24
|
+
fontFamily: any;
|
|
25
|
+
};
|
|
26
|
+
lightU: () => {
|
|
27
|
+
fontFamily: any;
|
|
28
|
+
};
|
|
29
|
+
normalU: () => {
|
|
30
|
+
fontFamily: any;
|
|
31
|
+
};
|
|
32
|
+
mediumW: () => {
|
|
33
|
+
fontFamily: any;
|
|
34
|
+
};
|
|
35
|
+
semiBold: () => {
|
|
36
|
+
fontFamily: any;
|
|
37
|
+
};
|
|
38
|
+
boldU: () => {
|
|
39
|
+
fontFamily: any;
|
|
40
|
+
};
|
|
41
|
+
extraBold: () => {
|
|
42
|
+
fontFamily: any;
|
|
43
|
+
};
|
|
44
|
+
black: () => {
|
|
45
|
+
fontFamily: any;
|
|
46
|
+
};
|
|
47
|
+
};
|
|
19
48
|
style: {
|
|
20
49
|
header1: () => {
|
|
21
|
-
fontFamily:
|
|
50
|
+
fontFamily: any;
|
|
22
51
|
fontSize: number;
|
|
23
52
|
};
|
|
24
53
|
header2: () => {
|
|
25
|
-
fontFamily:
|
|
54
|
+
fontFamily: any;
|
|
26
55
|
fontSize: number;
|
|
27
56
|
};
|
|
28
57
|
header3: () => {
|
|
29
|
-
fontFamily:
|
|
30
|
-
fontSize: number;
|
|
31
|
-
};
|
|
32
|
-
header3Bold: () => {
|
|
33
|
-
fontFamily: string;
|
|
58
|
+
fontFamily: any;
|
|
34
59
|
fontSize: number;
|
|
35
60
|
};
|
|
36
61
|
standardU: () => {
|
|
37
|
-
fontFamily:
|
|
38
|
-
fontSize: number;
|
|
39
|
-
};
|
|
40
|
-
standardLight: () => {
|
|
41
|
-
fontFamily: string;
|
|
62
|
+
fontFamily: any;
|
|
42
63
|
fontSize: number;
|
|
43
64
|
};
|
|
44
65
|
standardBold: () => {
|
|
45
|
-
fontFamily:
|
|
66
|
+
fontFamily: any;
|
|
46
67
|
fontSize: number;
|
|
47
68
|
};
|
|
48
|
-
|
|
49
|
-
fontFamily:
|
|
50
|
-
fontSize: number;
|
|
51
|
-
};
|
|
52
|
-
subTextBold: () => {
|
|
53
|
-
fontFamily: string;
|
|
54
|
-
fontSize: number;
|
|
55
|
-
};
|
|
56
|
-
subTextLight: () => {
|
|
57
|
-
fontFamily: string;
|
|
69
|
+
standardLight: () => {
|
|
70
|
+
fontFamily: any;
|
|
58
71
|
fontSize: number;
|
|
59
72
|
};
|
|
60
73
|
smallTextU: () => {
|
|
61
|
-
fontFamily:
|
|
74
|
+
fontFamily: any;
|
|
62
75
|
fontSize: number;
|
|
63
76
|
};
|
|
64
77
|
smallTextBold: () => {
|
|
65
|
-
fontFamily:
|
|
78
|
+
fontFamily: any;
|
|
66
79
|
fontSize: number;
|
|
67
80
|
};
|
|
68
81
|
smallTextLight: () => {
|
|
69
|
-
fontFamily:
|
|
82
|
+
fontFamily: any;
|
|
70
83
|
fontSize: number;
|
|
71
84
|
};
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
fontFamily: string;
|
|
85
|
+
subTextU: () => {
|
|
86
|
+
fontFamily: any;
|
|
87
|
+
fontSize: number;
|
|
76
88
|
};
|
|
77
|
-
|
|
78
|
-
fontFamily:
|
|
89
|
+
subTextBold: () => {
|
|
90
|
+
fontFamily: any;
|
|
91
|
+
fontSize: number;
|
|
79
92
|
};
|
|
80
|
-
|
|
81
|
-
fontFamily:
|
|
93
|
+
subTextLight: () => {
|
|
94
|
+
fontFamily: any;
|
|
95
|
+
fontSize: number;
|
|
82
96
|
};
|
|
83
97
|
};
|
|
84
98
|
fonts: {
|
|
85
|
-
|
|
86
|
-
|
|
99
|
+
thin: any;
|
|
100
|
+
extraLight: any;
|
|
101
|
+
light: any;
|
|
102
|
+
regular: any;
|
|
103
|
+
medium: any;
|
|
104
|
+
semiBold: any;
|
|
105
|
+
bold: any;
|
|
106
|
+
extraBold: any;
|
|
107
|
+
black: any;
|
|
87
108
|
};
|
|
88
109
|
};
|
|
89
110
|
export default _default;
|