@brightlayer-ui/react-native-themes 7.0.1-alpha.2 → 7.0.1-alpha.4

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/dist/index.d.ts CHANGED
@@ -7,4 +7,4 @@ This code is licensed under the BSD-3 license found in the LICENSE file in the r
7
7
  **/
8
8
  export { MD3BluiLightTheme as blue } from './blueTheme';
9
9
  export { MD3BluiDarkTheme as blueDark } from './blueDarkTheme';
10
- export { ExtendedTheme, useExtendedTheme } from './shared';
10
+ export { ExtendedTheme, useExtendedTheme, useFontWeight } from './shared';
package/dist/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.useExtendedTheme = exports.blueDark = exports.blue = void 0;
3
+ exports.useFontWeight = exports.useExtendedTheme = exports.blueDark = exports.blue = void 0;
4
4
  /**
5
5
  Copyright (c) 2021-present, Eaton
6
6
 
@@ -14,3 +14,4 @@ var blueDarkTheme_1 = require("./blueDarkTheme");
14
14
  Object.defineProperty(exports, "blueDark", { enumerable: true, get: function () { return blueDarkTheme_1.MD3BluiDarkTheme; } });
15
15
  var shared_1 = require("./shared");
16
16
  Object.defineProperty(exports, "useExtendedTheme", { enumerable: true, get: function () { return shared_1.useExtendedTheme; } });
17
+ Object.defineProperty(exports, "useFontWeight", { enumerable: true, get: function () { return shared_1.useFontWeight; } });
package/dist/shared.d.ts CHANGED
@@ -3,82 +3,97 @@ import { $DeepPartial } from '@callstack/react-theme-provider';
3
3
  export declare const fontConfig: {
4
4
  displaySmall: {
5
5
  fontFamily: string;
6
+ fontWeight: "400";
6
7
  fontSize: number;
7
8
  lineHeight: number;
8
9
  };
9
10
  displayMedium: {
10
11
  fontFamily: string;
12
+ fontWeight: "400";
11
13
  fontSize: number;
12
14
  lineHeight: number;
13
15
  };
14
16
  displayLarge: {
15
17
  fontFamily: string;
18
+ fontWeight: "400";
16
19
  fontSize: number;
17
20
  lineHeight: number;
18
21
  letterSpacing: number;
19
22
  };
20
23
  headlineSmall: {
21
24
  fontFamily: string;
25
+ fontWeight: "400";
22
26
  fontSize: number;
23
27
  lineHeight: number;
24
28
  };
25
29
  headlineMedium: {
26
30
  fontFamily: string;
31
+ fontWeight: "400";
27
32
  fontSize: number;
28
33
  lineHeight: number;
29
34
  };
30
35
  headlineLarge: {
31
36
  fontFamily: string;
37
+ fontWeight: "400";
32
38
  fontSize: number;
33
39
  lineHeight: number;
34
40
  };
35
41
  titleSmall: {
36
42
  fontFamily: string;
43
+ fontWeight: "600";
37
44
  fontSize: number;
38
45
  lineHeight: number;
39
46
  letterSpacing: number;
40
47
  };
41
48
  titleMedium: {
42
49
  fontFamily: string;
50
+ fontWeight: "600";
43
51
  fontSize: number;
44
52
  lineHeight: number;
45
53
  letterSpacing: number;
46
54
  };
47
55
  titleLarge: {
48
56
  fontFamily: string;
57
+ fontWeight: "600";
49
58
  fontSize: number;
50
59
  lineHeight: number;
51
60
  };
52
61
  labelSmall: {
53
62
  fontFamily: string;
63
+ fontWeight: "600";
54
64
  fontSize: number;
55
65
  lineHeight: number;
56
66
  letterSpacing: number;
57
67
  };
58
68
  labelMedium: {
59
69
  fontFamily: string;
70
+ fontWeight: "600";
60
71
  fontSize: number;
61
72
  lineHeight: number;
62
73
  letterSpacing: number;
63
74
  };
64
75
  labelLarge: {
65
76
  fontFamily: string;
77
+ fontWeight: "600";
66
78
  fontSize: number;
67
79
  lineHeight: number;
68
80
  letterSpacing: number;
69
81
  };
70
82
  bodySmall: {
71
83
  fontFamily: string;
84
+ fontWeight: "400";
72
85
  fontSize: number;
73
86
  lineHeight: number;
74
87
  };
75
88
  bodyMedium: {
76
89
  fontFamily: string;
90
+ fontWeight: "400";
77
91
  fontSize: number;
78
92
  lineHeight: number;
79
93
  };
80
94
  bodyLarge: {
81
95
  fontFamily: string;
96
+ fontWeight: "400";
82
97
  fontSize: number;
83
98
  lineHeight: number;
84
99
  letterSpacing: number;
@@ -206,3 +221,9 @@ export type ExtendedTheme = Omit<MD3Theme, 'colors'> & {
206
221
  };
207
222
  };
208
223
  export declare const useExtendedTheme: (overrides?: $DeepPartial<ExtendedTheme>) => ExtendedTheme;
224
+ export type bluiFontWeight = '300' | '400' | '600' | '700' | '800' | undefined;
225
+ export type FontStyle = {
226
+ fontFamily: string;
227
+ fontWeight: bluiFontWeight;
228
+ };
229
+ export declare const useFontWeight: (weight: bluiFontWeight) => FontStyle;
package/dist/shared.js CHANGED
@@ -1,86 +1,101 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.useExtendedTheme = exports.fontConfig = void 0;
3
+ exports.useFontWeight = exports.useExtendedTheme = exports.fontConfig = void 0;
4
4
  var react_native_paper_1 = require("react-native-paper");
5
5
  exports.fontConfig = {
6
6
  displaySmall: {
7
7
  fontFamily: 'OpenSans-Regular',
8
+ fontWeight: '400',
8
9
  fontSize: 36,
9
10
  lineHeight: 48,
10
11
  },
11
12
  displayMedium: {
12
13
  fontFamily: 'OpenSans-Regular',
14
+ fontWeight: '400',
13
15
  fontSize: 45,
14
16
  lineHeight: 56,
15
17
  },
16
18
  displayLarge: {
17
19
  fontFamily: 'OpenSans-Regular',
20
+ fontWeight: '400',
18
21
  fontSize: 57,
19
22
  lineHeight: 72,
20
23
  letterSpacing: -0.25,
21
24
  },
22
25
  headlineSmall: {
23
26
  fontFamily: 'OpenSans-Regular',
27
+ fontWeight: '400',
24
28
  fontSize: 24,
25
29
  lineHeight: 32,
26
30
  },
27
31
  headlineMedium: {
28
32
  fontFamily: 'OpenSans-Regular',
33
+ fontWeight: '400',
29
34
  fontSize: 28,
30
35
  lineHeight: 36,
31
36
  },
32
37
  headlineLarge: {
33
38
  fontFamily: 'OpenSans-Regular',
39
+ fontWeight: '400',
34
40
  fontSize: 32,
35
41
  lineHeight: 40,
36
42
  },
37
43
  titleSmall: {
38
44
  fontFamily: 'OpenSans-SemiBold',
45
+ fontWeight: '600',
39
46
  fontSize: 14,
40
47
  lineHeight: 20,
41
48
  letterSpacing: 0.1,
42
49
  },
43
50
  titleMedium: {
44
51
  fontFamily: 'OpenSans-SemiBold',
52
+ fontWeight: '600',
45
53
  fontSize: 16,
46
54
  lineHeight: 24,
47
55
  letterSpacing: 0.15,
48
56
  },
49
57
  titleLarge: {
50
58
  fontFamily: 'OpenSans-Regular',
59
+ fontWeight: '600',
51
60
  fontSize: 22,
52
61
  lineHeight: 28,
53
62
  },
54
63
  labelSmall: {
55
64
  fontFamily: 'OpenSans-SemiBold',
65
+ fontWeight: '600',
56
66
  fontSize: 11,
57
67
  lineHeight: 16,
58
68
  letterSpacing: 0.5,
59
69
  },
60
70
  labelMedium: {
61
71
  fontFamily: 'OpenSans-SemiBold',
72
+ fontWeight: '600',
62
73
  fontSize: 12,
63
74
  lineHeight: 16,
64
75
  letterSpacing: 0.2,
65
76
  },
66
77
  labelLarge: {
67
78
  fontFamily: 'OpenSans-SemiBold',
79
+ fontWeight: '600',
68
80
  fontSize: 14,
69
81
  lineHeight: 20,
70
82
  letterSpacing: 0.1,
71
83
  },
72
84
  bodySmall: {
73
85
  fontFamily: 'OpenSans-Regular',
86
+ fontWeight: '400',
74
87
  fontSize: 12,
75
88
  lineHeight: 16,
76
89
  },
77
90
  bodyMedium: {
78
91
  fontFamily: 'OpenSans-Regular',
92
+ fontWeight: '400',
79
93
  fontSize: 14,
80
94
  lineHeight: 20,
81
95
  },
82
96
  bodyLarge: {
83
97
  fontFamily: 'OpenSans-Regular',
98
+ fontWeight: '400',
84
99
  fontSize: 16,
85
100
  lineHeight: 24,
86
101
  letterSpacing: 0.15,
@@ -90,3 +105,35 @@ var useExtendedTheme = function (overrides) {
90
105
  return (0, react_native_paper_1.useTheme)(overrides);
91
106
  };
92
107
  exports.useExtendedTheme = useExtendedTheme;
108
+ var useFontWeight = function (weight) {
109
+ switch (weight) {
110
+ case '300':
111
+ return {
112
+ fontFamily: 'OpenSans-Light',
113
+ fontWeight: '300',
114
+ };
115
+ case '400':
116
+ return {
117
+ fontFamily: 'OpenSans-Regular',
118
+ fontWeight: '400',
119
+ };
120
+ case '600':
121
+ return {
122
+ fontFamily: 'OpenSans-SemiBold',
123
+ fontWeight: '600',
124
+ };
125
+ case '700':
126
+ return {
127
+ fontFamily: 'OpenSans-Bold',
128
+ fontWeight: '700',
129
+ };
130
+ case '800':
131
+ return {
132
+ fontFamily: 'OpenSans-ExtraBold',
133
+ fontWeight: '800',
134
+ };
135
+ default:
136
+ throw new Error("Invalid font weight: ".concat(weight));
137
+ }
138
+ };
139
+ exports.useFontWeight = useFontWeight;
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.2",
5
+ "version": "7.0.1-alpha.4",
6
6
  "description": "React Native themes for Brightlayer UI applications",
7
7
  "main": "./dist/index.js",
8
8
  "scripts": {