@fadyshawky/react-native-magic 2.0.0 → 2.0.2
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 -1
- package/template/App.tsx +4 -7
- package/template/src/common/components/PrimaryButton.tsx +23 -23
- package/template/src/common/components/PrimaryTextInput.tsx +195 -129
- package/template/src/common/components/RadioIcon.tsx +4 -4
- package/template/src/common/components/Stepper.tsx +153 -0
- package/template/src/common/validations/errorValidations.ts +2 -3
- package/template/src/core/theme/colors.ts +94 -72
- package/template/src/core/theme/commonConsts.ts +1 -1
- package/template/src/core/theme/commonSizes.ts +117 -60
- package/template/src/core/theme/commonStyles.ts +22 -22
- package/template/src/core/theme/fonts.ts +13 -14
- package/template/src/core/theme/shadows.ts +135 -0
- package/template/src/core/theme/themes.ts +386 -75
- package/template/src/core/theme/types.ts +201 -15
- package/template/src/navigation/AuthStack.tsx +0 -8
- package/template/src/navigation/MainNavigation.tsx +1 -2
- package/template/src/screens/Login/Login.tsx +3 -17
- package/template/install-dev.sh +0 -1
- package/template/install.sh +0 -1
|
@@ -1,17 +1,16 @@
|
|
|
1
1
|
export const Fonts = {
|
|
2
|
-
//
|
|
3
|
-
|
|
4
|
-
|
|
2
|
+
// Almarai Font Family
|
|
3
|
+
light: 'Almarai-Light',
|
|
4
|
+
regular: 'Almarai-Regular',
|
|
5
|
+
bold: 'Almarai-Bold',
|
|
6
|
+
extraBold: 'Almarai-ExtraBold',
|
|
5
7
|
|
|
6
|
-
//
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
bold: 'Inter-Bold',
|
|
15
|
-
extraBold: 'Inter-ExtraBold',
|
|
16
|
-
black: 'Inter-Black',
|
|
8
|
+
// Legacy support - keeping these for backward compatibility
|
|
9
|
+
// but they now map to Almarai equivalents
|
|
10
|
+
thin: 'Almarai-Light',
|
|
11
|
+
normal: 'Almarai-Regular',
|
|
12
|
+
medium: 'Almarai-Regular',
|
|
13
|
+
semiBold: 'Almarai-Bold',
|
|
14
|
+
black: 'Almarai-ExtraBold',
|
|
15
|
+
italic: 'Almarai-Regular', // Almarai doesn't have italic variant
|
|
17
16
|
};
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
export interface ShadowConfig {
|
|
2
|
+
shadowColor: string;
|
|
3
|
+
shadowOffset: {
|
|
4
|
+
width: number;
|
|
5
|
+
height: number;
|
|
6
|
+
};
|
|
7
|
+
shadowOpacity: number;
|
|
8
|
+
shadowRadius: number;
|
|
9
|
+
elevation?: number; // For Android
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export interface ElevationShadow {
|
|
13
|
+
primary: ShadowConfig;
|
|
14
|
+
secondary: ShadowConfig;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export const Shadows: Record<number, ElevationShadow> = {
|
|
18
|
+
1: {
|
|
19
|
+
primary: {
|
|
20
|
+
shadowColor: '#000000',
|
|
21
|
+
shadowOffset: {
|
|
22
|
+
width: 0,
|
|
23
|
+
height: 1,
|
|
24
|
+
},
|
|
25
|
+
shadowOpacity: 0.02, // 2%
|
|
26
|
+
shadowRadius: 1,
|
|
27
|
+
elevation: 1,
|
|
28
|
+
},
|
|
29
|
+
secondary: {
|
|
30
|
+
shadowColor: '#000000',
|
|
31
|
+
shadowOffset: {
|
|
32
|
+
width: 0,
|
|
33
|
+
height: 2,
|
|
34
|
+
},
|
|
35
|
+
shadowOpacity: 0.04, // 4%
|
|
36
|
+
shadowRadius: 4,
|
|
37
|
+
elevation: 1,
|
|
38
|
+
},
|
|
39
|
+
},
|
|
40
|
+
2: {
|
|
41
|
+
primary: {
|
|
42
|
+
shadowColor: '#000000',
|
|
43
|
+
shadowOffset: {
|
|
44
|
+
width: 0,
|
|
45
|
+
height: 1,
|
|
46
|
+
},
|
|
47
|
+
shadowOpacity: 0.04, // 4%
|
|
48
|
+
shadowRadius: 4,
|
|
49
|
+
elevation: 2,
|
|
50
|
+
},
|
|
51
|
+
secondary: {
|
|
52
|
+
shadowColor: '#000000',
|
|
53
|
+
shadowOffset: {
|
|
54
|
+
width: 0,
|
|
55
|
+
height: 4,
|
|
56
|
+
},
|
|
57
|
+
shadowOpacity: 0.08, // 8%
|
|
58
|
+
shadowRadius: 10,
|
|
59
|
+
elevation: 2,
|
|
60
|
+
},
|
|
61
|
+
},
|
|
62
|
+
3: {
|
|
63
|
+
primary: {
|
|
64
|
+
shadowColor: '#000000',
|
|
65
|
+
shadowOffset: {
|
|
66
|
+
width: 0,
|
|
67
|
+
height: 2,
|
|
68
|
+
},
|
|
69
|
+
shadowOpacity: 0.04, // 4%
|
|
70
|
+
shadowRadius: 20,
|
|
71
|
+
elevation: 3,
|
|
72
|
+
},
|
|
73
|
+
secondary: {
|
|
74
|
+
shadowColor: '#000000',
|
|
75
|
+
shadowOffset: {
|
|
76
|
+
width: 0,
|
|
77
|
+
height: 8,
|
|
78
|
+
},
|
|
79
|
+
shadowOpacity: 0.08, // 8%
|
|
80
|
+
shadowRadius: 32,
|
|
81
|
+
elevation: 3,
|
|
82
|
+
},
|
|
83
|
+
},
|
|
84
|
+
4: {
|
|
85
|
+
primary: {
|
|
86
|
+
shadowColor: '#000000',
|
|
87
|
+
shadowOffset: {
|
|
88
|
+
width: 0,
|
|
89
|
+
height: 8,
|
|
90
|
+
},
|
|
91
|
+
shadowOpacity: 0.06, // 6%
|
|
92
|
+
shadowRadius: 20,
|
|
93
|
+
elevation: 4,
|
|
94
|
+
},
|
|
95
|
+
secondary: {
|
|
96
|
+
shadowColor: '#000000',
|
|
97
|
+
shadowOffset: {
|
|
98
|
+
width: 0,
|
|
99
|
+
height: 24,
|
|
100
|
+
},
|
|
101
|
+
shadowOpacity: 0.12, // 12%
|
|
102
|
+
shadowRadius: 60,
|
|
103
|
+
elevation: 4,
|
|
104
|
+
},
|
|
105
|
+
},
|
|
106
|
+
};
|
|
107
|
+
|
|
108
|
+
// Helper function to get shadow styles for a specific elevation
|
|
109
|
+
export const getShadowStyle = (
|
|
110
|
+
elevation: number,
|
|
111
|
+
useSecondary = false,
|
|
112
|
+
): ShadowConfig => {
|
|
113
|
+
const shadow = Shadows[elevation];
|
|
114
|
+
if (!shadow) {
|
|
115
|
+
throw new Error(
|
|
116
|
+
`Elevation ${elevation} is not defined. Available elevations: ${Object.keys(
|
|
117
|
+
Shadows,
|
|
118
|
+
).join(', ')}`,
|
|
119
|
+
);
|
|
120
|
+
}
|
|
121
|
+
return useSecondary ? shadow.secondary : shadow.primary;
|
|
122
|
+
};
|
|
123
|
+
|
|
124
|
+
// Helper function to get both primary and secondary shadows for an elevation
|
|
125
|
+
export const getElevationShadows = (elevation: number): ElevationShadow => {
|
|
126
|
+
const shadow = Shadows[elevation];
|
|
127
|
+
if (!shadow) {
|
|
128
|
+
throw new Error(
|
|
129
|
+
`Elevation ${elevation} is not defined. Available elevations: ${Object.keys(
|
|
130
|
+
Shadows,
|
|
131
|
+
).join(', ')}`,
|
|
132
|
+
);
|
|
133
|
+
}
|
|
134
|
+
return shadow;
|
|
135
|
+
};
|