@brightlayer-ui/react-native-themes 7.0.1-alpha.3 → 7.0.1-alpha.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/README.md +3 -7
- package/dist/shared.d.ts +2 -2
- package/dist/shared.js +10 -5
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -76,16 +76,12 @@ const theme = useExtendedTheme();
|
|
|
76
76
|
</Button>
|
|
77
77
|
```
|
|
78
78
|
|
|
79
|
-
##
|
|
79
|
+
## Usage of useFontWeight hook in your project
|
|
80
80
|
|
|
81
|
-
When
|
|
82
|
-
|
|
83
|
-
The `fontFamily` property allows you to specify the font and its weight. By using the appropriate font family that supports the desired weight, you can achieve the desired fontWeight effect.
|
|
84
|
-
|
|
85
|
-
For example, if you want to set the fontWeight to "bold", you can use a font family that includes a bold variant, such as:
|
|
81
|
+
When the fontFamily of a Text element in your application needs to be modified, you can use the useFontWeight hook.For instance, to set the fontWeight to "bold", you can utilize the useFontWeight() hook as demonstrated below:
|
|
86
82
|
|
|
87
83
|
```tsx
|
|
88
|
-
<Text variant={'headlineLarge'} style={{
|
|
84
|
+
<Text variant={'headlineLarge'} style={{ ...fontStyleBold }}>
|
|
89
85
|
headlineLarge
|
|
90
86
|
</Text>
|
|
91
87
|
```
|
package/dist/shared.d.ts
CHANGED
|
@@ -54,7 +54,7 @@ export declare const fontConfig: {
|
|
|
54
54
|
};
|
|
55
55
|
titleLarge: {
|
|
56
56
|
fontFamily: string;
|
|
57
|
-
fontWeight: "
|
|
57
|
+
fontWeight: "400";
|
|
58
58
|
fontSize: number;
|
|
59
59
|
lineHeight: number;
|
|
60
60
|
};
|
|
@@ -221,7 +221,7 @@ export type ExtendedTheme = Omit<MD3Theme, 'colors'> & {
|
|
|
221
221
|
};
|
|
222
222
|
};
|
|
223
223
|
export declare const useExtendedTheme: (overrides?: $DeepPartial<ExtendedTheme>) => ExtendedTheme;
|
|
224
|
-
export type bluiFontWeight = '300' | '400' | '600' | '700' | undefined;
|
|
224
|
+
export type bluiFontWeight = '300' | '400' | '600' | '700' | '800' | undefined;
|
|
225
225
|
export type FontStyle = {
|
|
226
226
|
fontFamily: string;
|
|
227
227
|
fontWeight: bluiFontWeight;
|
package/dist/shared.js
CHANGED
|
@@ -56,7 +56,7 @@ exports.fontConfig = {
|
|
|
56
56
|
},
|
|
57
57
|
titleLarge: {
|
|
58
58
|
fontFamily: 'OpenSans-Regular',
|
|
59
|
-
fontWeight: '
|
|
59
|
+
fontWeight: '400',
|
|
60
60
|
fontSize: 22,
|
|
61
61
|
lineHeight: 28,
|
|
62
62
|
},
|
|
@@ -109,24 +109,29 @@ var useFontWeight = function (weight) {
|
|
|
109
109
|
switch (weight) {
|
|
110
110
|
case '300':
|
|
111
111
|
return {
|
|
112
|
-
fontFamily: 'OpenSans-
|
|
112
|
+
fontFamily: 'OpenSans-Light',
|
|
113
113
|
fontWeight: '300',
|
|
114
114
|
};
|
|
115
115
|
case '400':
|
|
116
116
|
return {
|
|
117
|
-
fontFamily: 'OpenSans-
|
|
117
|
+
fontFamily: 'OpenSans-Regular',
|
|
118
118
|
fontWeight: '400',
|
|
119
119
|
};
|
|
120
120
|
case '600':
|
|
121
121
|
return {
|
|
122
|
-
fontFamily: 'OpenSans-
|
|
122
|
+
fontFamily: 'OpenSans-SemiBold',
|
|
123
123
|
fontWeight: '600',
|
|
124
124
|
};
|
|
125
125
|
case '700':
|
|
126
126
|
return {
|
|
127
|
-
fontFamily: 'OpenSans-
|
|
127
|
+
fontFamily: 'OpenSans-Bold',
|
|
128
128
|
fontWeight: '700',
|
|
129
129
|
};
|
|
130
|
+
case '800':
|
|
131
|
+
return {
|
|
132
|
+
fontFamily: 'OpenSans-ExtraBold',
|
|
133
|
+
fontWeight: '800',
|
|
134
|
+
};
|
|
130
135
|
default:
|
|
131
136
|
throw new Error("Invalid font weight: ".concat(weight));
|
|
132
137
|
}
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@brightlayer-ui/react-native-themes",
|
|
3
3
|
"author": "Brightlayer UI <brightlayer-ui@eaton.com>",
|
|
4
4
|
"license": "BSD-3-Clause",
|
|
5
|
-
"version": "7.0.1-alpha.
|
|
5
|
+
"version": "7.0.1-alpha.5",
|
|
6
6
|
"description": "React Native themes for Brightlayer UI applications",
|
|
7
7
|
"main": "./dist/index.js",
|
|
8
8
|
"scripts": {
|