@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,214 +1,525 @@
1
- import {SearchBar} from 'react-native-screens';
2
- import {BlackColors, WhiteColors} from './colors';
3
- import {FontSizes} from './commonSizes';
1
+ import {TextStyle} from 'react-native';
2
+ import {PrimaryColors, NaturalColors, AlertColors} from './colors';
3
+ import {CommonSizes} from './commonSizes';
4
4
  import {Fonts} from './fonts';
5
5
  import {Theme} from './types';
6
- import {TextStyle} from 'react-native';
7
-
8
- const spacing = {
9
- xs: 4,
10
- sm: 8,
11
- md: 16,
12
- lg: 24,
13
- xl: 32,
14
- };
15
-
16
- const borderRadius = {
17
- xs: 4,
18
- sm: 8,
19
- md: 12,
20
- lg: 16,
21
- xl: 24,
22
- };
6
+ import {Shadows} from './shadows';
23
7
 
24
8
  const commonTextStyles = {
9
+ // Heading styles using Almarai Bold
25
10
  header1: {
26
- fontFamily: Fonts.medium,
27
- fontSize: FontSizes.header1,
11
+ fontFamily: Fonts.bold,
12
+ fontSize: CommonSizes.font.heading1,
13
+ lineHeight: CommonSizes.lineHeight.heading1,
28
14
  },
29
15
  header2: {
30
- fontFamily: Fonts.normal,
31
- fontSize: FontSizes.header2,
16
+ fontFamily: Fonts.bold,
17
+ fontSize: CommonSizes.font.heading2,
18
+ lineHeight: CommonSizes.lineHeight.heading2,
19
+ },
20
+ header3: {
21
+ fontFamily: Fonts.bold,
22
+ fontSize: CommonSizes.font.heading3,
23
+ lineHeight: CommonSizes.lineHeight.heading3,
24
+ },
25
+ header4: {
26
+ fontFamily: Fonts.bold,
27
+ fontSize: CommonSizes.font.heading4,
28
+ lineHeight: CommonSizes.lineHeight.heading4,
29
+ },
30
+ header6: {
31
+ fontFamily: Fonts.bold,
32
+ fontSize: CommonSizes.font.heading6,
33
+ lineHeight: CommonSizes.lineHeight.heading6,
34
+ },
35
+
36
+ // Body text styles with different weights
37
+ bodyXLargeLight: {
38
+ fontFamily: Fonts.light,
39
+ fontSize: CommonSizes.font.bodyXLarge,
40
+ lineHeight: CommonSizes.lineHeight.bodyXLarge,
41
+ },
42
+ bodyXLargeRegular: {
43
+ fontFamily: Fonts.regular,
44
+ fontSize: CommonSizes.font.bodyXLarge,
45
+ lineHeight: CommonSizes.lineHeight.bodyXLarge,
46
+ },
47
+ bodyXLargeBold: {
48
+ fontFamily: Fonts.bold,
49
+ fontSize: CommonSizes.font.bodyXLarge,
50
+ lineHeight: CommonSizes.lineHeight.bodyXLarge,
51
+ },
52
+ bodyXLargeExtraBold: {
53
+ fontFamily: Fonts.extraBold,
54
+ fontSize: CommonSizes.font.bodyXLarge,
55
+ lineHeight: CommonSizes.lineHeight.bodyXLarge,
56
+ },
57
+
58
+ bodyLargeLight: {
59
+ fontFamily: Fonts.light,
60
+ fontSize: CommonSizes.font.bodyLarge,
61
+ lineHeight: CommonSizes.lineHeight.bodyLarge,
62
+ },
63
+ bodyLargeRegular: {
64
+ fontFamily: Fonts.regular,
65
+ fontSize: CommonSizes.font.bodyLarge,
66
+ lineHeight: CommonSizes.lineHeight.bodyLarge,
67
+ },
68
+ bodyLargeBold: {
69
+ fontFamily: Fonts.bold,
70
+ fontSize: CommonSizes.font.bodyLarge,
71
+ lineHeight: CommonSizes.lineHeight.bodyLarge,
72
+ },
73
+ bodyLargeExtraBold: {
74
+ fontFamily: Fonts.extraBold,
75
+ fontSize: CommonSizes.font.bodyLarge,
76
+ lineHeight: CommonSizes.lineHeight.bodyLarge,
77
+ },
78
+
79
+ bodyMediumLight: {
80
+ fontFamily: Fonts.light,
81
+ fontSize: CommonSizes.font.bodyMedium,
82
+ lineHeight: CommonSizes.lineHeight.bodyMedium,
83
+ },
84
+ bodyMediumRegular: {
85
+ fontFamily: Fonts.regular,
86
+ fontSize: CommonSizes.font.bodyMedium,
87
+ lineHeight: CommonSizes.lineHeight.bodyMedium,
88
+ },
89
+ bodyMediumBold: {
90
+ fontFamily: Fonts.bold,
91
+ fontSize: CommonSizes.font.bodyMedium,
92
+ lineHeight: CommonSizes.lineHeight.bodyMedium,
32
93
  },
94
+ bodyMediumExtraBold: {
95
+ fontFamily: Fonts.extraBold,
96
+ fontSize: CommonSizes.font.bodyMedium,
97
+ lineHeight: CommonSizes.lineHeight.bodyMedium,
98
+ },
99
+
100
+ bodySmallLight: {
101
+ fontFamily: Fonts.light,
102
+ fontSize: CommonSizes.font.bodySmall,
103
+ lineHeight: CommonSizes.lineHeight.bodySmall,
104
+ },
105
+ bodySmallRegular: {
106
+ fontFamily: Fonts.regular,
107
+ fontSize: CommonSizes.font.bodySmall,
108
+ lineHeight: CommonSizes.lineHeight.bodySmall,
109
+ },
110
+ bodySmallBold: {
111
+ fontFamily: Fonts.bold,
112
+ fontSize: CommonSizes.font.bodySmall,
113
+ lineHeight: CommonSizes.lineHeight.bodySmall,
114
+ },
115
+ bodySmallExtraBold: {
116
+ fontFamily: Fonts.extraBold,
117
+ fontSize: CommonSizes.font.bodySmall,
118
+ lineHeight: CommonSizes.lineHeight.bodySmall,
119
+ },
120
+
121
+ // Legacy styles for backward compatibility
33
122
  balanceTitle: {
34
- fontFamily: Fonts.semiBold,
35
- fontSize: FontSizes.body2,
123
+ fontFamily: Fonts.bold,
124
+ fontSize: CommonSizes.font.bodyXLarge,
36
125
  textAlign: 'center',
37
126
  },
38
127
  balanceAmount: {
39
- fontFamily: Fonts.normal,
40
- fontSize: FontSizes.header2,
128
+ fontFamily: Fonts.regular,
129
+ fontSize: CommonSizes.font.heading2,
41
130
  textAlign: 'center',
42
131
  },
43
132
  balanceLabel: {
44
133
  fontFamily: Fonts.light,
45
- fontSize: FontSizes.balanceLabel,
134
+ fontSize: CommonSizes.font.bodyXLarge,
46
135
  },
47
136
  body1: {
48
137
  fontFamily: Fonts.light,
49
- fontSize: FontSizes.body1,
138
+ fontSize: CommonSizes.font.bodyLarge,
50
139
  },
51
140
  body2: {
52
141
  fontFamily: Fonts.regular,
53
- fontSize: FontSizes.body2,
142
+ fontSize: CommonSizes.font.bodyXLarge,
54
143
  },
55
144
  button: {
56
145
  fontFamily: Fonts.regular,
57
- fontSize: FontSizes.button,
146
+ fontSize: CommonSizes.font.bodyXLarge,
58
147
  },
59
148
  cards: {
60
- fontFamily: Fonts.semiBold,
61
- fontSize: FontSizes.card,
149
+ fontFamily: Fonts.bold,
150
+ fontSize: CommonSizes.font.bodyXLarge,
62
151
  },
63
152
  SearchBar: {
64
153
  fontFamily: Fonts.light,
65
- fontSize: FontSizes.searchBar,
154
+ fontSize: CommonSizes.font.bodyXLarge,
66
155
  },
67
156
  label: {
68
157
  fontFamily: Fonts.light,
69
- fontSize: FontSizes.label,
158
+ fontSize: CommonSizes.font.bodyXLarge,
70
159
  },
71
160
  hyperlink: {
72
161
  fontFamily: Fonts.light,
73
- fontSize: FontSizes.hyperlink,
162
+ fontSize: CommonSizes.font.bodyXLarge,
74
163
  textDecorationStyle: 'solid',
75
164
  textDecorationLine: 'underline',
76
- textDecorationColor: WhiteColors.indigoBlue,
165
+ textDecorationColor: PrimaryColors.PlatinateBlue_400,
77
166
  } as TextStyle,
78
167
  navBar: {
79
- fontFamily: Fonts.normal,
80
- fontSize: FontSizes.navBar,
168
+ fontFamily: Fonts.regular,
169
+ fontSize: CommonSizes.font.bodyXLarge,
81
170
  },
82
171
  };
83
172
 
173
+ // Light theme colors
174
+ const lightThemeColors = {
175
+ indigoBlue: PrimaryColors.PlatinateBlue_400,
176
+ mutedLavender: NaturalColors.naturalColor_100,
177
+ tintColor: PrimaryColors.PlatinateBlue_400,
178
+ mutedLavender30: NaturalColors.naturalColor_0,
179
+ balanceBackground: NaturalColors.grayScale_0,
180
+ white: NaturalColors.grayScale_0,
181
+ backgroundOpacity: 'rgba(250, 250, 250, 0.8)',
182
+ black: PrimaryColors.cetaceanBlue_700,
183
+ background: NaturalColors.grayScale_0,
184
+ surface: NaturalColors.grayScale_0,
185
+ card: NaturalColors.grayScale_0,
186
+ shadow: PrimaryColors.cetaceanBlue_700,
187
+ red: AlertColors.error_400,
188
+ strokeDeactive: NaturalColors.grayScale_50,
189
+ };
190
+
191
+ // Dark theme colors
192
+ const darkThemeColors = {
193
+ indigoBlue: PrimaryColors.PlatinateBlue_200,
194
+ mutedLavender: NaturalColors.grayScale_0,
195
+ tintColor: PrimaryColors.PlatinateBlue_200,
196
+ mutedLavender30: NaturalColors.naturalColor_700,
197
+ balanceBackground: NaturalColors.grayScale_700,
198
+ white: NaturalColors.grayScale_0,
199
+ backgroundOpacity: 'rgba(0, 5, 17, 0.8)',
200
+ black: PrimaryColors.cetaceanBlue_700,
201
+ background: NaturalColors.grayScale_700,
202
+ surface: NaturalColors.grayScale_600,
203
+ card: NaturalColors.grayScale_600,
204
+ shadow: PrimaryColors.cetaceanBlue_700,
205
+ red: AlertColors.error_300,
206
+ strokeDeactive: NaturalColors.grayScale_400,
207
+ };
208
+
84
209
  export const lightTheme: Theme = {
85
210
  mode: 'light',
86
211
  colors: {
87
- ...WhiteColors,
212
+ ...PrimaryColors,
213
+ ...NaturalColors,
214
+ ...AlertColors,
88
215
  },
89
216
  text: {
90
217
  ...commonTextStyles,
218
+ // Apply light theme colors to all text styles
91
219
  header1: {
92
220
  ...commonTextStyles.header1,
93
- color: WhiteColors.black,
221
+ color: lightThemeColors.black,
222
+ },
223
+ header2: {
224
+ ...commonTextStyles.header2,
225
+ color: lightThemeColors.black,
226
+ },
227
+ header3: {
228
+ ...commonTextStyles.header3,
229
+ color: lightThemeColors.black,
230
+ },
231
+ header4: {
232
+ ...commonTextStyles.header4,
233
+ color: lightThemeColors.black,
234
+ },
235
+ header6: {
236
+ ...commonTextStyles.header6,
237
+ color: lightThemeColors.black,
94
238
  },
239
+
240
+ // Body text styles with light theme colors
241
+ bodyXLargeLight: {
242
+ ...commonTextStyles.bodyXLargeLight,
243
+ color: lightThemeColors.black,
244
+ },
245
+ bodyXLargeRegular: {
246
+ ...commonTextStyles.bodyXLargeRegular,
247
+ color: lightThemeColors.black,
248
+ },
249
+ bodyXLargeBold: {
250
+ ...commonTextStyles.bodyXLargeBold,
251
+ color: lightThemeColors.black,
252
+ },
253
+ bodyXLargeExtraBold: {
254
+ ...commonTextStyles.bodyXLargeExtraBold,
255
+ color: lightThemeColors.black,
256
+ },
257
+
258
+ bodyLargeLight: {
259
+ ...commonTextStyles.bodyLargeLight,
260
+ color: lightThemeColors.black,
261
+ },
262
+ bodyLargeRegular: {
263
+ ...commonTextStyles.bodyLargeRegular,
264
+ color: lightThemeColors.black,
265
+ },
266
+ bodyLargeBold: {
267
+ ...commonTextStyles.bodyLargeBold,
268
+ color: lightThemeColors.black,
269
+ },
270
+ bodyLargeExtraBold: {
271
+ ...commonTextStyles.bodyLargeExtraBold,
272
+ color: lightThemeColors.black,
273
+ },
274
+
275
+ bodyMediumLight: {
276
+ ...commonTextStyles.bodyMediumLight,
277
+ color: lightThemeColors.black,
278
+ },
279
+ bodyMediumRegular: {
280
+ ...commonTextStyles.bodyMediumRegular,
281
+ color: lightThemeColors.black,
282
+ },
283
+ bodyMediumBold: {
284
+ ...commonTextStyles.bodyMediumBold,
285
+ color: lightThemeColors.black,
286
+ },
287
+ bodyMediumExtraBold: {
288
+ ...commonTextStyles.bodyMediumExtraBold,
289
+ color: lightThemeColors.black,
290
+ },
291
+
292
+ bodySmallLight: {
293
+ ...commonTextStyles.bodySmallLight,
294
+ color: lightThemeColors.black,
295
+ },
296
+ bodySmallRegular: {
297
+ ...commonTextStyles.bodySmallRegular,
298
+ color: lightThemeColors.black,
299
+ },
300
+ bodySmallBold: {
301
+ ...commonTextStyles.bodySmallBold,
302
+ color: lightThemeColors.black,
303
+ },
304
+ bodySmallExtraBold: {
305
+ ...commonTextStyles.bodySmallExtraBold,
306
+ color: lightThemeColors.black,
307
+ },
308
+
309
+ // Legacy styles
95
310
  balanceTitle: {
96
311
  ...commonTextStyles.balanceTitle,
97
- color: WhiteColors.indigoBlue,
312
+ color: lightThemeColors.indigoBlue,
98
313
  textAlign: 'center',
99
314
  },
100
315
  balanceAmount: {
101
316
  ...commonTextStyles.balanceAmount,
102
- color: WhiteColors.indigoBlue,
317
+ color: lightThemeColors.indigoBlue,
103
318
  textAlign: 'center',
104
319
  },
105
320
  balanceLabel: {
106
321
  ...commonTextStyles.balanceLabel,
107
- color: WhiteColors.indigoBlue,
108
- },
109
- header2: {
110
- ...commonTextStyles.header2,
111
- color: WhiteColors.black,
322
+ color: lightThemeColors.indigoBlue,
112
323
  },
113
324
  body1: {
114
325
  ...commonTextStyles.body1,
115
- color: WhiteColors.black,
326
+ color: lightThemeColors.black,
116
327
  },
117
328
  body2: {
118
329
  ...commonTextStyles.body2,
119
- color: WhiteColors.black,
330
+ color: lightThemeColors.black,
120
331
  },
121
332
  button: {
122
333
  ...commonTextStyles.button,
123
- color: WhiteColors.white,
334
+ color: lightThemeColors.white,
124
335
  },
125
336
  cards: {
126
337
  ...commonTextStyles.cards,
127
- color: WhiteColors.black,
338
+ color: lightThemeColors.black,
128
339
  },
129
340
  SearchBar: {
130
341
  ...commonTextStyles.SearchBar,
131
- color: WhiteColors.black,
342
+ color: lightThemeColors.black,
132
343
  },
133
344
  label: {
134
345
  ...commonTextStyles.label,
135
- color: WhiteColors.black,
346
+ color: lightThemeColors.black,
136
347
  },
137
348
  hyperlink: {
138
349
  ...commonTextStyles.hyperlink,
139
- color: WhiteColors.indigoBlue,
350
+ color: lightThemeColors.indigoBlue,
140
351
  },
141
352
  navBar: {
142
353
  ...commonTextStyles.navBar,
143
- color: WhiteColors.white,
354
+ color: lightThemeColors.white,
144
355
  },
145
356
  },
146
- spacing,
147
- borderRadius,
357
+ spacing: CommonSizes.spacing,
358
+ borderRadius: CommonSizes.borderRadius,
359
+ borderWidth: CommonSizes.borderWidth,
360
+ shadows: {
361
+ elevation1: Shadows[1],
362
+ elevation2: Shadows[2],
363
+ elevation3: Shadows[3],
364
+ elevation4: Shadows[4],
365
+ },
148
366
  };
149
367
 
150
368
  export const darkTheme: Theme = {
151
369
  mode: 'dark',
152
370
  colors: {
153
- ...BlackColors,
371
+ ...PrimaryColors,
372
+ ...NaturalColors,
373
+ ...AlertColors,
154
374
  },
155
375
  text: {
156
376
  ...commonTextStyles,
377
+ // Apply dark theme colors to all text styles
157
378
  header1: {
158
379
  ...commonTextStyles.header1,
159
- color: BlackColors.mutedLavender,
380
+ color: darkThemeColors.mutedLavender,
160
381
  },
161
382
  header2: {
162
383
  ...commonTextStyles.header2,
163
- color: BlackColors.mutedLavender,
384
+ color: darkThemeColors.mutedLavender,
164
385
  },
386
+ header3: {
387
+ ...commonTextStyles.header3,
388
+ color: darkThemeColors.mutedLavender,
389
+ },
390
+ header4: {
391
+ ...commonTextStyles.header4,
392
+ color: darkThemeColors.mutedLavender,
393
+ },
394
+ header6: {
395
+ ...commonTextStyles.header6,
396
+ color: darkThemeColors.mutedLavender,
397
+ },
398
+
399
+ // Body text styles with dark theme colors
400
+ bodyXLargeLight: {
401
+ ...commonTextStyles.bodyXLargeLight,
402
+ color: darkThemeColors.mutedLavender,
403
+ },
404
+ bodyXLargeRegular: {
405
+ ...commonTextStyles.bodyXLargeRegular,
406
+ color: darkThemeColors.mutedLavender,
407
+ },
408
+ bodyXLargeBold: {
409
+ ...commonTextStyles.bodyXLargeBold,
410
+ color: darkThemeColors.mutedLavender,
411
+ },
412
+ bodyXLargeExtraBold: {
413
+ ...commonTextStyles.bodyXLargeExtraBold,
414
+ color: darkThemeColors.mutedLavender,
415
+ },
416
+
417
+ bodyLargeLight: {
418
+ ...commonTextStyles.bodyLargeLight,
419
+ color: darkThemeColors.mutedLavender,
420
+ },
421
+ bodyLargeRegular: {
422
+ ...commonTextStyles.bodyLargeRegular,
423
+ color: darkThemeColors.mutedLavender,
424
+ },
425
+ bodyLargeBold: {
426
+ ...commonTextStyles.bodyLargeBold,
427
+ color: darkThemeColors.mutedLavender,
428
+ },
429
+ bodyLargeExtraBold: {
430
+ ...commonTextStyles.bodyLargeExtraBold,
431
+ color: darkThemeColors.mutedLavender,
432
+ },
433
+
434
+ bodyMediumLight: {
435
+ ...commonTextStyles.bodyMediumLight,
436
+ color: darkThemeColors.mutedLavender,
437
+ },
438
+ bodyMediumRegular: {
439
+ ...commonTextStyles.bodyMediumRegular,
440
+ color: darkThemeColors.mutedLavender,
441
+ },
442
+ bodyMediumBold: {
443
+ ...commonTextStyles.bodyMediumBold,
444
+ color: darkThemeColors.mutedLavender,
445
+ },
446
+ bodyMediumExtraBold: {
447
+ ...commonTextStyles.bodyMediumExtraBold,
448
+ color: darkThemeColors.mutedLavender,
449
+ },
450
+
451
+ bodySmallLight: {
452
+ ...commonTextStyles.bodySmallLight,
453
+ color: darkThemeColors.mutedLavender,
454
+ },
455
+ bodySmallRegular: {
456
+ ...commonTextStyles.bodySmallRegular,
457
+ color: darkThemeColors.mutedLavender,
458
+ },
459
+ bodySmallBold: {
460
+ ...commonTextStyles.bodySmallBold,
461
+ color: darkThemeColors.mutedLavender,
462
+ },
463
+ bodySmallExtraBold: {
464
+ ...commonTextStyles.bodySmallExtraBold,
465
+ color: darkThemeColors.mutedLavender,
466
+ },
467
+
468
+ // Legacy styles
165
469
  balanceTitle: {
166
470
  ...commonTextStyles.balanceTitle,
167
- color: BlackColors.mutedLavender,
471
+ color: darkThemeColors.mutedLavender,
168
472
  textAlign: 'center',
169
473
  },
170
474
  balanceAmount: {
171
475
  ...commonTextStyles.balanceAmount,
172
- color: BlackColors.mutedLavender,
476
+ color: darkThemeColors.mutedLavender,
173
477
  textAlign: 'center',
174
478
  },
175
479
  balanceLabel: {
176
480
  ...commonTextStyles.balanceLabel,
177
- color: BlackColors.mutedLavender,
481
+ color: darkThemeColors.mutedLavender,
178
482
  },
179
483
  body1: {
180
484
  ...commonTextStyles.body1,
181
- color: BlackColors.mutedLavender,
485
+ color: darkThemeColors.mutedLavender,
182
486
  },
183
487
  body2: {
184
488
  ...commonTextStyles.body2,
185
- color: BlackColors.mutedLavender,
489
+ color: darkThemeColors.mutedLavender,
186
490
  },
187
491
  button: {
188
492
  ...commonTextStyles.button,
189
- color: BlackColors.white,
493
+ color: darkThemeColors.white,
190
494
  },
191
495
  cards: {
192
496
  ...commonTextStyles.cards,
193
- color: BlackColors.white,
497
+ color: darkThemeColors.white,
194
498
  },
195
499
  SearchBar: {
196
500
  ...commonTextStyles.SearchBar,
197
- color: BlackColors.mutedLavender,
501
+ color: darkThemeColors.mutedLavender,
198
502
  },
199
503
  label: {
200
504
  ...commonTextStyles.label,
201
- color: BlackColors.black,
505
+ color: darkThemeColors.black,
202
506
  },
203
507
  hyperlink: {
204
508
  ...commonTextStyles.hyperlink,
205
- color: BlackColors.mutedLavender,
509
+ color: darkThemeColors.mutedLavender,
206
510
  },
207
511
  navBar: {
208
512
  ...commonTextStyles.navBar,
209
- color: BlackColors.white,
513
+ color: darkThemeColors.white,
210
514
  },
211
515
  },
212
- spacing,
213
- borderRadius,
516
+ spacing: CommonSizes.spacing,
517
+ borderRadius: CommonSizes.borderRadius,
518
+ borderWidth: CommonSizes.borderWidth,
519
+ shadows: {
520
+ elevation1: Shadows[1],
521
+ elevation2: Shadows[2],
522
+ elevation3: Shadows[3],
523
+ elevation4: Shadows[4],
524
+ },
214
525
  };