@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.
@@ -1,17 +1,16 @@
1
1
  export const Fonts = {
2
- // Inter Variable Font
3
- regular: 'Inter-VariableFont_opsz,wght',
4
- italic: 'Inter-Italic-VariableFont_opsz,wght',
2
+ // Almarai Font Family
3
+ light: 'Almarai-Light',
4
+ regular: 'Almarai-Regular',
5
+ bold: 'Almarai-Bold',
6
+ extraBold: 'Almarai-ExtraBold',
5
7
 
6
- // Kanit Font
7
- medium: 'Kanit-Medium',
8
-
9
- // Font weights for Inter Variable Font
10
- thin: 'Inter-Thin',
11
- light: 'Inter-Light',
12
- normal: 'Inter-Regular',
13
- semiBold: 'Inter-SemiBold',
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
+ };