@cdek-it/react-native-ui-kit 1.0.0-beta.3 → 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 +13 -11
- package/dist/components/Button/utils/ButtonContainer.js +9 -0
- package/dist/components/Typography/Anchor.js +5 -3
- package/dist/components/Typography/Body.js +3 -1
- package/dist/components/Typography/Caption.js +4 -2
- package/dist/components/Typography/Service.js +5 -5
- package/dist/components/Typography/Subtitle.js +5 -4
- package/dist/components/Typography/Title.js +1 -1
- package/dist/theme/assets/themeDark.json +1 -1
- package/dist/theme/assets/themeLight.json +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -105,19 +105,20 @@ UI kit использует следующие виды шрифтов.
|
|
|
105
105
|
2. Создать XML-ресурс для каждого шрифта
|
|
106
106
|
|
|
107
107
|
```xml
|
|
108
|
-
<!--
|
|
108
|
+
<!-- xml_noto_sans.xml -->
|
|
109
109
|
<font-family xmlns:app="http://schemas.android.com/apk/res-auto">
|
|
110
|
-
|
|
111
|
-
|
|
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"/>
|
|
112
113
|
</font-family>
|
|
113
114
|
```
|
|
114
115
|
|
|
115
116
|
```xml
|
|
116
117
|
<!-- xml_tt_fellows.xml -->
|
|
117
118
|
<font-family xmlns:app="http://schemas.android.com/apk/res-auto">
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
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"/>
|
|
121
122
|
</font-family>
|
|
122
123
|
```
|
|
123
124
|
|
|
@@ -153,11 +154,12 @@ UI kit использует следующие виды шрифтов.
|
|
|
153
154
|
```xml
|
|
154
155
|
<key>UIAppFonts</key>
|
|
155
156
|
<array>
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
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>
|
|
161
163
|
</array>
|
|
162
164
|
```
|
|
163
165
|
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
/* eslint-disable max-lines, max-lines-per-function */
|
|
1
2
|
import { useContext } from 'react';
|
|
2
3
|
import { Pressable } from 'react-native';
|
|
3
4
|
import { StyleSheet } from 'react-native-unistyles';
|
|
@@ -160,6 +161,14 @@ const buttonContainerStyles = StyleSheet.create(({ theme, border, spacing, sizin
|
|
|
160
161
|
backgroundColor: theme.Button.Text.textButtonHoverBg,
|
|
161
162
|
},
|
|
162
163
|
},
|
|
164
|
+
{
|
|
165
|
+
variant: 'link',
|
|
166
|
+
disabled: 'true',
|
|
167
|
+
styles: {
|
|
168
|
+
borderColor: theme.Button.Brand.buttonBorderColor,
|
|
169
|
+
backgroundColor: theme.Button.Text.textButtonBg,
|
|
170
|
+
},
|
|
171
|
+
},
|
|
163
172
|
// severity container (override placeholder variant styles)
|
|
164
173
|
{
|
|
165
174
|
variant: 'basic',
|
|
@@ -49,14 +49,16 @@ const styles = StyleSheet.create(({ spacing, typography, fonts }) => ({
|
|
|
49
49
|
container: { flexDirection: 'row', alignItems: 'center' },
|
|
50
50
|
text: {
|
|
51
51
|
flexShrink: 1,
|
|
52
|
-
fontSize: typography.Size['text-
|
|
52
|
+
fontSize: typography.Size['text-sm'],
|
|
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'],
|
|
@@ -17,6 +17,8 @@ const styles = StyleSheet.create(({ theme, typography, fonts }) => ({
|
|
|
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,7 +26,7 @@ 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-sm'] },
|
|
29
|
+
base: { fontSize: typography.Size['text-sm'], lineHeight: 18 },
|
|
28
30
|
paragraph: { lineHeight: 24 },
|
|
29
31
|
paragraphBase: { lineHeight: 21 },
|
|
30
32
|
disabled: { opacity: 0.6 },
|
|
@@ -26,10 +26,12 @@ export const Caption = ({ color = 'default', disabled, style, Icon, ...other })
|
|
|
26
26
|
const CaptionTestId = { text: 'CaptionText', icon: 'CaptionIcon' };
|
|
27
27
|
const styles = StyleSheet.create(({ theme, spacing, typography, fonts }) => ({
|
|
28
28
|
text: {
|
|
29
|
-
fontSize: typography.Size['text-
|
|
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-
|
|
12
|
-
fontWeight:
|
|
11
|
+
fontSize: typography.Size['text-xs'],
|
|
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 },
|
|
@@ -17,5 +17,5 @@ const styles = StyleSheet.create(({ theme, typography, fonts }) => ({
|
|
|
17
17
|
h3: { fontSize: typography.Size['text-lg'] },
|
|
18
18
|
h4: { fontSize: typography.Size['text-base'] },
|
|
19
19
|
h5: { fontSize: typography.Size['text-sm'] },
|
|
20
|
-
h6: { fontSize: typography.Size['text-xs']
|
|
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/package.json
CHANGED