@teamnhz/rn-ui-toolkit 1.4.3 → 1.4.5
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.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 -23
- 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/dist/utils/permissions.d.ts +2 -0
- package/dist/utils/permissions.js +8 -10
- package/package.json +1 -1
|
@@ -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;
|