@cdek-it/react-native-ui-kit 1.0.0-beta.4 → 1.0.0-beta.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 +20 -17
- package/dist/components/Typography/Anchor.js +4 -2
- package/dist/components/Typography/Body.js +6 -4
- package/dist/components/Typography/Caption.js +3 -1
- package/dist/components/Typography/Service.js +5 -5
- package/dist/components/Typography/Subtitle.js +4 -3
- package/dist/components/Typography/Title.js +9 -9
- package/dist/theme/assets/themeDark.json +1 -1
- package/dist/theme/assets/themeLight.json +1 -1
- package/dist/theme/darkTheme.js +1 -1
- package/dist/theme/lightTheme.js +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -38,8 +38,8 @@ UI kit использует следующие виды шрифтов.
|
|
|
38
38
|
|
|
39
39
|
| Тип шрифта | Используемые начертания | Рекомендуемый шрифт | Рекомендуемый аналог |
|
|
40
40
|
| ----------- | ---------------------------------------------- | ------------------- | -------------------- |
|
|
41
|
-
| `primary` | – regular<br/>– demibold<br/>– demibold italic | TT Fellows |
|
|
42
|
-
| `secondary` | – regular<br/>– bold
|
|
41
|
+
| `primary` | – regular<br/>– demibold<br/>– demibold italic | TT Fellows | Noto Sans |
|
|
42
|
+
| `secondary` | – regular<br/>– medium<br/>– bold | Noto Sans | — |
|
|
43
43
|
|
|
44
44
|
Исходники шрифтов не поставляются вместе с пакетом, их требуется подключать
|
|
45
45
|
отдельно. После подключения шрифтов в проект, необходимо указать их в
|
|
@@ -84,10 +84,11 @@ UI kit использует следующие виды шрифтов.
|
|
|
84
84
|
],
|
|
85
85
|
},
|
|
86
86
|
{
|
|
87
|
-
fontFamily: '
|
|
87
|
+
fontFamily: 'Noto Sans',
|
|
88
88
|
fontDefinitions: [
|
|
89
|
-
{ path: './assets/
|
|
90
|
-
{ path: './assets/
|
|
89
|
+
{ path: './assets/NotoSans-Bold.ttf', weight: 700 },
|
|
90
|
+
{ path: './assets/NotoSans-Medium.ttf', weight: 500 },
|
|
91
|
+
{ path: './assets/NotoSans-Regular.ttf', weight: 400 },
|
|
91
92
|
],
|
|
92
93
|
},
|
|
93
94
|
],
|
|
@@ -104,19 +105,20 @@ UI kit использует следующие виды шрифтов.
|
|
|
104
105
|
2. Создать XML-ресурс для каждого шрифта
|
|
105
106
|
|
|
106
107
|
```xml
|
|
107
|
-
<!--
|
|
108
|
+
<!-- xml_noto_sans.xml -->
|
|
108
109
|
<font-family xmlns:app="http://schemas.android.com/apk/res-auto">
|
|
109
|
-
|
|
110
|
-
|
|
110
|
+
<font app:font="@font/noto_sans_bold" app:fontStyle="normal" app:fontWeight="700"/>
|
|
111
|
+
<font app:font="@font/noto_sans_medium" app:fontStyle="normal" app:fontWeight="500"/>
|
|
112
|
+
<font app:font="@font/noto_sans_regular" app:fontStyle="normal" app:fontWeight="400"/>
|
|
111
113
|
</font-family>
|
|
112
114
|
```
|
|
113
115
|
|
|
114
116
|
```xml
|
|
115
117
|
<!-- xml_tt_fellows.xml -->
|
|
116
118
|
<font-family xmlns:app="http://schemas.android.com/apk/res-auto">
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
119
|
+
<font app:font="@font/tt_fellows_demi_bold_italic" app:fontStyle="italic" app:fontWeight="600"/>
|
|
120
|
+
<font app:font="@font/tt_fellows_demi_bold" app:fontStyle="normal" app:fontWeight="600"/>
|
|
121
|
+
<font app:font="@font/tt_fellows_regular" app:fontStyle="normal" app:fontWeight="400"/>
|
|
120
122
|
</font-family>
|
|
121
123
|
```
|
|
122
124
|
|
|
@@ -130,7 +132,7 @@ UI kit использует следующие виды шрифтов.
|
|
|
130
132
|
|
|
131
133
|
//подключение шрифтов
|
|
132
134
|
ReactFontManager.getInstance().addCustomFont(this, "TT Fellows", R.font.xml_tt_fellows)
|
|
133
|
-
ReactFontManager.getInstance().addCustomFont(this, "
|
|
135
|
+
ReactFontManager.getInstance().addCustomFont(this, "Noto Sans", R.font.xml_noto_sans)
|
|
134
136
|
|
|
135
137
|
// остальной код...
|
|
136
138
|
}
|
|
@@ -152,11 +154,12 @@ UI kit использует следующие виды шрифтов.
|
|
|
152
154
|
```xml
|
|
153
155
|
<key>UIAppFonts</key>
|
|
154
156
|
<array>
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
157
|
+
<string>TTFellows-DemiBold.ttf</string>
|
|
158
|
+
<string>TTFellows-DemiBoldItalic.ttf</string>
|
|
159
|
+
<string>TTFellows-Regular.ttf</string>
|
|
160
|
+
<string>NotoSans-Regular.ttf</string>
|
|
161
|
+
<string>NotoSans-Medium.ttf</string>
|
|
162
|
+
<string>NotoSans-Bold.ttf</string>
|
|
160
163
|
</array>
|
|
161
164
|
```
|
|
162
165
|
|
|
@@ -53,10 +53,12 @@ const styles = StyleSheet.create(({ spacing, typography, fonts }) => ({
|
|
|
53
53
|
includeFontPadding: false,
|
|
54
54
|
verticalAlign: 'middle',
|
|
55
55
|
color: typography.Color.Service['text-info'],
|
|
56
|
-
fontFamily: fonts.
|
|
56
|
+
fontFamily: fonts.secondary,
|
|
57
|
+
lineHeight: 15,
|
|
58
|
+
letterSpacing: -0.25,
|
|
57
59
|
},
|
|
58
60
|
underlined: { textDecorationLine: 'underline' },
|
|
59
|
-
base: {
|
|
61
|
+
base: { lineHeight: 18, letterSpacing: 0 },
|
|
60
62
|
visited: { color: typography.Color.Service['text-help'] },
|
|
61
63
|
icon: {
|
|
62
64
|
width: typography.Size['text-base'],
|
|
@@ -13,10 +13,12 @@ export const Body = ({ base, color = 'default', disabled, paragraph, weight = 'r
|
|
|
13
13
|
};
|
|
14
14
|
const styles = StyleSheet.create(({ theme, typography, fonts }) => ({
|
|
15
15
|
text: {
|
|
16
|
-
fontSize: typography.Size['text-
|
|
16
|
+
fontSize: typography.Size['text-base'],
|
|
17
17
|
includeFontPadding: false,
|
|
18
18
|
verticalAlign: 'middle',
|
|
19
19
|
fontFamily: fonts.secondary,
|
|
20
|
+
lineHeight: 20,
|
|
21
|
+
letterSpacing: -0.5,
|
|
20
22
|
},
|
|
21
23
|
regular: { fontWeight: 400 },
|
|
22
24
|
medium: { fontWeight: 500 },
|
|
@@ -24,8 +26,8 @@ const styles = StyleSheet.create(({ theme, typography, fonts }) => ({
|
|
|
24
26
|
default: { color: theme.General.textColor },
|
|
25
27
|
primary: { color: theme.General.primaryColor },
|
|
26
28
|
secondary: { color: theme.General.textSecondaryColor },
|
|
27
|
-
base: { fontSize: typography.Size['text-
|
|
28
|
-
paragraph: {
|
|
29
|
-
paragraphBase: {
|
|
29
|
+
base: { fontSize: typography.Size['text-sm'], lineHeight: 18 },
|
|
30
|
+
paragraph: { lineHeight: 24 },
|
|
31
|
+
paragraphBase: { lineHeight: 21 },
|
|
30
32
|
disabled: { opacity: 0.6 },
|
|
31
33
|
}));
|
|
@@ -29,7 +29,9 @@ const styles = StyleSheet.create(({ theme, spacing, typography, fonts }) => ({
|
|
|
29
29
|
fontSize: typography.Size['text-sm'],
|
|
30
30
|
includeFontPadding: false,
|
|
31
31
|
verticalAlign: 'middle',
|
|
32
|
-
fontFamily: fonts.
|
|
32
|
+
fontFamily: fonts.secondary,
|
|
33
|
+
lineHeight: 15,
|
|
34
|
+
letterSpacing: -0.25,
|
|
33
35
|
},
|
|
34
36
|
textWithIcon: { flexShrink: 1 },
|
|
35
37
|
default: { color: theme.General.textColor },
|
|
@@ -20,7 +20,7 @@ export const Service = ({ variant = 'success', showIcon = true, base = true, Ico
|
|
|
20
20
|
iconSize: base ? styles.iconBase : styles.icon,
|
|
21
21
|
textStyles: [
|
|
22
22
|
styles.textCommon,
|
|
23
|
-
base
|
|
23
|
+
base && styles.textBase,
|
|
24
24
|
iconMap[variant]?.style || styles.info,
|
|
25
25
|
],
|
|
26
26
|
containerStyle: base ? styles.containerBase : styles.container,
|
|
@@ -55,12 +55,12 @@ const styles = StyleSheet.create(({ typography, spacing, fonts }) => ({
|
|
|
55
55
|
verticalAlign: 'middle',
|
|
56
56
|
flexShrink: 1,
|
|
57
57
|
fontWeight: 400,
|
|
58
|
-
|
|
59
|
-
textBase: {
|
|
60
|
-
fontSize: typography.Size['text-base'],
|
|
58
|
+
fontSize: typography.Size['text-sm'],
|
|
61
59
|
fontFamily: fonts.secondary,
|
|
60
|
+
lineHeight: 15,
|
|
61
|
+
letterSpacing: -0.25,
|
|
62
62
|
},
|
|
63
|
-
|
|
63
|
+
textBase: { lineHeight: 18 },
|
|
64
64
|
warning: { color: typography.Color.Service['text-warning'] },
|
|
65
65
|
success: { color: typography.Color.Service['text-success'] },
|
|
66
66
|
info: { color: typography.Color.Service['text-info'] },
|
|
@@ -8,12 +8,13 @@ import { StyleSheet } from 'react-native-unistyles';
|
|
|
8
8
|
export const Subtitle = memo(({ base = false, color = 'default', style, ...other }) => (<Text style={[styles.text, styles[color], base && styles.base, style]} testID='Subtitle' {...other}/>));
|
|
9
9
|
const styles = StyleSheet.create(({ theme, typography, fonts }) => ({
|
|
10
10
|
text: {
|
|
11
|
-
fontSize: typography.Size['text-
|
|
11
|
+
fontSize: typography.Size['text-xs'],
|
|
12
12
|
fontWeight: 700,
|
|
13
13
|
textTransform: 'uppercase',
|
|
14
|
-
fontFamily: fonts.
|
|
14
|
+
fontFamily: fonts.secondary,
|
|
15
|
+
lineHeight: 15,
|
|
15
16
|
},
|
|
16
|
-
base: { fontSize: typography.Size['text-
|
|
17
|
+
base: { lineHeight: 18, fontSize: typography.Size['text-sm'] },
|
|
17
18
|
default: { color: theme.General.textColor },
|
|
18
19
|
primary: { color: theme.General.primaryColor },
|
|
19
20
|
secondary: { color: theme.General.textSecondaryColor },
|
|
@@ -9,13 +9,13 @@ const styles = StyleSheet.create(({ theme, typography, fonts }) => ({
|
|
|
9
9
|
includeFontPadding: false,
|
|
10
10
|
verticalAlign: 'middle',
|
|
11
11
|
},
|
|
12
|
-
d1: { fontSize: typography.Size['text-
|
|
13
|
-
d2: { fontSize: typography.Size['text-
|
|
14
|
-
d3: { fontSize: typography.Size['text-
|
|
15
|
-
h1: { fontSize: typography.Size['text-
|
|
16
|
-
h2: { fontSize: typography.Size['text-
|
|
17
|
-
h3: { fontSize: typography.Size['text-
|
|
18
|
-
h4: { fontSize: typography.Size['text-
|
|
19
|
-
h5: { fontSize: typography.Size['text-
|
|
20
|
-
h6: { fontSize: typography.Size['text-
|
|
12
|
+
d1: { fontSize: typography.Size['text-5xl'] },
|
|
13
|
+
d2: { fontSize: typography.Size['text-4xl'] },
|
|
14
|
+
d3: { fontSize: typography.Size['text-3xl'] },
|
|
15
|
+
h1: { fontSize: typography.Size['text-2xl'] },
|
|
16
|
+
h2: { fontSize: typography.Size['text-xl'] },
|
|
17
|
+
h3: { fontSize: typography.Size['text-lg'] },
|
|
18
|
+
h4: { fontSize: typography.Size['text-base'] },
|
|
19
|
+
h5: { fontSize: typography.Size['text-sm'] },
|
|
20
|
+
h6: { fontSize: typography.Size['text-xs'] },
|
|
21
21
|
}));
|
|
@@ -170,7 +170,7 @@
|
|
|
170
170
|
"actionIconHoverColor": "#ffffff",
|
|
171
171
|
"actionIconHoverBorderColor": "rgba(0, 0, 0, 0.0001)",
|
|
172
172
|
"fontFamily": "TT Fellows, Roboto, Inter, Helvetica, Arial, sans-serif",
|
|
173
|
-
"fontFamilySecondary": "
|
|
173
|
+
"fontFamilySecondary": "Noto Sans, Roboto, Inter, Helvetica, Arial, sans-serif",
|
|
174
174
|
"fontWeight": "normal",
|
|
175
175
|
"disabledOpacity": "0.6",
|
|
176
176
|
"divider": "1px solid $dividerColor",
|
|
@@ -170,7 +170,7 @@
|
|
|
170
170
|
"actionIconHoverColor": "rgba(0, 0, 0, 0.8000)",
|
|
171
171
|
"actionIconHoverBorderColor": "rgba(255, 255, 255, 0.0001)",
|
|
172
172
|
"fontFamily": "TT Fellows, Roboto, Inter, Helvetica, Arial, sans-serif",
|
|
173
|
-
"fontFamilySecondary": "
|
|
173
|
+
"fontFamilySecondary": "Noto Sans, Roboto, Inter, Helvetica, Arial, sans-serif",
|
|
174
174
|
"fontWeight": "normal",
|
|
175
175
|
"disabledOpacity": "0.6",
|
|
176
176
|
"divider": "1px solid $dividerColor",
|
package/dist/theme/darkTheme.js
CHANGED
|
@@ -6,5 +6,5 @@ import { commonTheme } from './commonTheme';
|
|
|
6
6
|
export const darkTheme = {
|
|
7
7
|
theme: { ...darkThemeAssets, InputSize, ModalSize, custom: customDark },
|
|
8
8
|
...commonTheme,
|
|
9
|
-
fonts: { primary: 'TT Fellows', secondary: '
|
|
9
|
+
fonts: { primary: 'TT Fellows', secondary: 'Noto Sans' },
|
|
10
10
|
};
|
package/dist/theme/lightTheme.js
CHANGED
|
@@ -6,5 +6,5 @@ import { commonTheme } from './commonTheme';
|
|
|
6
6
|
export const lightTheme = {
|
|
7
7
|
theme: { ...lightThemeAssets, InputSize, ModalSize, custom: customLight },
|
|
8
8
|
...commonTheme,
|
|
9
|
-
fonts: { primary: 'TT Fellows', secondary: '
|
|
9
|
+
fonts: { primary: 'TT Fellows', secondary: 'Noto Sans' },
|
|
10
10
|
};
|
package/package.json
CHANGED