react-native-ui-lib 8.0.1-snapshot.7483 → 8.0.1-snapshot.7487

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-ui-lib",
3
- "version": "8.0.1-snapshot.7483",
3
+ "version": "8.0.1-snapshot.7487",
4
4
  "main": "src/index.js",
5
5
  "types": "src/index.d.ts",
6
6
  "author": "Ethan Sharabi <ethan.shar@gmail.com>",
@@ -11,92 +11,95 @@ export const WEIGHT_TYPES = {
11
11
  BLACK: '900'
12
12
  };
13
13
 
14
+ // Check if platform supports full range of font weights
15
+ const supportsFullFontWeights = Constants.isIOS || Constants.isAndroid && Number(Platform.Version) >= 28;
16
+
14
17
  // text10
15
18
  const text10 = {
16
19
  fontSize: 64,
17
- fontWeight: Constants.isIOS ? WEIGHT_TYPES.THIN : undefined,
20
+ fontWeight: supportsFullFontWeights ? WEIGHT_TYPES.THIN : undefined,
18
21
  lineHeight: 76,
19
- fontFamily: 'System'
22
+ fontFamily: Constants.isIOS ? 'System' : undefined
20
23
  };
21
24
 
22
25
  // text20
23
26
  const text20 = {
24
27
  fontSize: 48,
25
- fontWeight: Constants.isIOS ? WEIGHT_TYPES.REGULAR : undefined,
28
+ fontWeight: supportsFullFontWeights ? WEIGHT_TYPES.REGULAR : undefined,
26
29
  lineHeight: Constants.isIOS ? 60 : 62,
27
- fontFamily: 'System'
30
+ fontFamily: Constants.isIOS ? 'System' : undefined
28
31
  };
29
32
 
30
33
  // text30
31
34
  const text30 = {
32
35
  fontSize: 36,
33
- fontWeight: Constants.isIOS ? WEIGHT_TYPES.REGULAR : undefined,
36
+ fontWeight: supportsFullFontWeights ? WEIGHT_TYPES.REGULAR : undefined,
34
37
  lineHeight: Constants.isIOS ? 43 : 46,
35
- fontFamily: 'System'
38
+ fontFamily: Constants.isIOS ? 'System' : undefined
36
39
  };
37
40
 
38
41
  // text40
39
42
  const text40 = {
40
43
  fontSize: 28,
41
- fontWeight: Constants.isIOS ? WEIGHT_TYPES.HEAVY : 'bold',
44
+ fontWeight: supportsFullFontWeights ? WEIGHT_TYPES.HEAVY : 'bold',
42
45
  lineHeight: 32,
43
- fontFamily: 'System'
46
+ fontFamily: Constants.isIOS ? 'System' : undefined
44
47
  };
45
48
 
46
49
  // text50
47
50
  const text50 = {
48
51
  fontSize: 24,
49
- fontWeight: Constants.isIOS ? WEIGHT_TYPES.HEAVY : 'bold',
52
+ fontWeight: supportsFullFontWeights ? WEIGHT_TYPES.HEAVY : 'bold',
50
53
  lineHeight: 28,
51
- fontFamily: 'System'
54
+ fontFamily: Constants.isIOS ? 'System' : undefined
52
55
  };
53
56
 
54
57
  // text60
55
58
  const text60 = {
56
59
  fontSize: 20,
57
- fontWeight: Constants.isIOS ? WEIGHT_TYPES.HEAVY : 'bold',
60
+ fontWeight: supportsFullFontWeights ? WEIGHT_TYPES.HEAVY : 'bold',
58
61
  lineHeight: 24,
59
- fontFamily: 'System'
62
+ fontFamily: Constants.isIOS ? 'System' : undefined
60
63
  };
61
64
 
62
65
  // text65
63
66
  const text65 = {
64
67
  fontSize: 18,
65
- fontWeight: Constants.isIOS ? WEIGHT_TYPES.MEDIUM : undefined,
68
+ fontWeight: supportsFullFontWeights ? WEIGHT_TYPES.MEDIUM : undefined,
66
69
  lineHeight: 24,
67
- fontFamily: 'System'
70
+ fontFamily: Constants.isIOS ? 'System' : undefined
68
71
  };
69
72
 
70
73
  // text70
71
74
  const text70 = {
72
75
  fontSize: 16,
73
- fontWeight: Constants.isIOS ? WEIGHT_TYPES.REGULAR : undefined,
76
+ fontWeight: supportsFullFontWeights ? WEIGHT_TYPES.REGULAR : undefined,
74
77
  lineHeight: 24,
75
- fontFamily: 'System'
78
+ fontFamily: Constants.isIOS ? 'System' : undefined
76
79
  };
77
80
 
78
81
  // text80
79
82
  const text80 = {
80
83
  fontSize: 14,
81
- fontWeight: Constants.isIOS ? WEIGHT_TYPES.REGULAR : undefined,
84
+ fontWeight: supportsFullFontWeights ? WEIGHT_TYPES.REGULAR : undefined,
82
85
  lineHeight: 20,
83
- fontFamily: 'System'
86
+ fontFamily: Constants.isIOS ? 'System' : undefined
84
87
  };
85
88
 
86
89
  // text90
87
90
  const text90 = {
88
91
  fontSize: 12,
89
- fontWeight: Constants.isIOS ? WEIGHT_TYPES.BOLD : 'bold',
92
+ fontWeight: supportsFullFontWeights ? WEIGHT_TYPES.BOLD : 'bold',
90
93
  lineHeight: 16,
91
- fontFamily: 'System'
94
+ fontFamily: Constants.isIOS ? 'System' : undefined
92
95
  };
93
96
 
94
97
  // text100
95
98
  const text100 = {
96
99
  fontSize: 10,
97
- fontWeight: Constants.isIOS ? WEIGHT_TYPES.BOLD : 'bold',
100
+ fontWeight: supportsFullFontWeights ? WEIGHT_TYPES.BOLD : 'bold',
98
101
  lineHeight: 16,
99
- fontFamily: 'System'
102
+ fontFamily: Constants.isIOS ? 'System' : undefined
100
103
  };
101
104
  const Typography = {
102
105
  text10,
@@ -127,7 +130,7 @@ _forEach(keys, key => {
127
130
  const fontWeightKey = `${fontKey}${weightValue}`;
128
131
  Typography[fontWeightKey] = {
129
132
  ...Typography[fontKey],
130
- fontWeight: Constants.isIOS ? WEIGHT_TYPES[weightKey] : ['BO', 'H', 'BL'].includes(weightValue) ? 'bold' : undefined
133
+ fontWeight: supportsFullFontWeights ? WEIGHT_TYPES[weightKey] : ['BO', 'H', 'BL'].includes(weightValue) ? 'bold' : undefined
131
134
  };
132
135
  });
133
136
  });