@alfalab/core-components-typography 6.0.2 → 6.0.3-alfasans
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/colors.css +20 -20
- package/colors.d.ts +1 -1
- package/colors.module.css.js +1 -1
- package/colors.module.css.js.map +1 -1
- package/cssm/colors.d.ts +1 -1
- package/cssm/text/component.d.ts +4 -4
- package/cssm/text/component.js.map +1 -1
- package/cssm/text/index.module.css +40 -13
- package/cssm/title/component.d.ts +18 -18
- package/cssm/title/component.js.map +1 -1
- package/cssm/title/index.d.ts +13 -13
- package/cssm/title/index.module.css +29 -40
- package/cssm/title/utils.js.map +1 -1
- package/cssm/title-mobile/component.d.ts +13 -13
- package/cssm/title-mobile/index.module.css +28 -45
- package/cssm/title-responsive/component.d.ts +16 -16
- package/cssm/types.d.ts +1 -1
- package/esm/colors.css +20 -20
- package/esm/colors.d.ts +1 -1
- package/esm/colors.module.css.js +1 -1
- package/esm/colors.module.css.js.map +1 -1
- package/esm/text/component.d.ts +4 -4
- package/esm/text/component.js.map +1 -1
- package/esm/text/index.css +80 -53
- package/esm/text/index.module.css.js +1 -1
- package/esm/text/index.module.css.js.map +1 -1
- package/esm/title/common.css +5 -5
- package/esm/title/common.module.css.js +1 -1
- package/esm/title/common.module.css.js.map +1 -1
- package/esm/title/component.d.ts +18 -18
- package/esm/title/component.js.map +1 -1
- package/esm/title/index.css +54 -65
- package/esm/title/index.d.ts +13 -13
- package/esm/title/index.module.css.js +1 -1
- package/esm/title/index.module.css.js.map +1 -1
- package/esm/title/utils.js.map +1 -1
- package/esm/title-mobile/component.d.ts +13 -13
- package/esm/title-mobile/index.css +53 -70
- package/esm/title-mobile/index.module.css.js +1 -1
- package/esm/title-mobile/index.module.css.js.map +1 -1
- package/esm/title-responsive/component.d.ts +16 -16
- package/esm/types.d.ts +1 -1
- package/modern/colors.css +20 -20
- package/modern/colors.d.ts +1 -1
- package/modern/colors.module.css.js +1 -1
- package/modern/colors.module.css.js.map +1 -1
- package/modern/text/component.d.ts +4 -4
- package/modern/text/component.js.map +1 -1
- package/modern/text/index.css +80 -53
- package/modern/text/index.module.css.js +1 -1
- package/modern/text/index.module.css.js.map +1 -1
- package/modern/title/common.css +5 -5
- package/modern/title/common.module.css.js +1 -1
- package/modern/title/common.module.css.js.map +1 -1
- package/modern/title/component.d.ts +18 -18
- package/modern/title/component.js.map +1 -1
- package/modern/title/index.css +54 -65
- package/modern/title/index.d.ts +13 -13
- package/modern/title/index.module.css.js +1 -1
- package/modern/title/index.module.css.js.map +1 -1
- package/modern/title/utils.js.map +1 -1
- package/modern/title-mobile/component.d.ts +13 -13
- package/modern/title-mobile/index.css +53 -70
- package/modern/title-mobile/index.module.css.js +1 -1
- package/modern/title-mobile/index.module.css.js.map +1 -1
- package/modern/title-responsive/component.d.ts +16 -16
- package/modern/types.d.ts +1 -1
- package/moderncssm/colors.d.ts +1 -1
- package/moderncssm/text/component.d.ts +4 -4
- package/moderncssm/text/component.js.map +1 -1
- package/moderncssm/text/index.module.css +37 -11
- package/moderncssm/title/component.d.ts +18 -18
- package/moderncssm/title/component.js.map +1 -1
- package/moderncssm/title/index.d.ts +13 -13
- package/moderncssm/title/index.module.css +29 -38
- package/moderncssm/title/utils.js.map +1 -1
- package/moderncssm/title-mobile/component.d.ts +13 -13
- package/moderncssm/title-mobile/index.module.css +28 -43
- package/moderncssm/title-responsive/component.d.ts +16 -16
- package/moderncssm/types.d.ts +1 -1
- package/package.json +6 -6
- package/src/colors.module.css +1 -1
- package/src/text/index.module.css +1 -1
- package/src/title/common.module.css +1 -1
- package/src/title/index.module.css +1 -1
- package/src/title-mobile/index.module.css +1 -1
- package/text/component.d.ts +4 -4
- package/text/component.js.map +1 -1
- package/text/index.css +80 -53
- package/text/index.module.css.js +1 -1
- package/text/index.module.css.js.map +1 -1
- package/title/common.css +5 -5
- package/title/common.module.css.js +1 -1
- package/title/common.module.css.js.map +1 -1
- package/title/component.d.ts +18 -18
- package/title/component.js.map +1 -1
- package/title/index.css +54 -65
- package/title/index.d.ts +13 -13
- package/title/index.module.css.js +1 -1
- package/title/index.module.css.js.map +1 -1
- package/title/utils.js.map +1 -1
- package/title-mobile/component.d.ts +13 -13
- package/title-mobile/index.css +53 -70
- package/title-mobile/index.module.css.js +1 -1
- package/title-mobile/index.module.css.js.map +1 -1
- package/title-responsive/component.d.ts +16 -16
- package/types.d.ts +1 -1
|
@@ -20,15 +20,18 @@
|
|
|
20
20
|
font-size: 16px;
|
|
21
21
|
line-height: 20px;
|
|
22
22
|
font-weight: 400;
|
|
23
|
-
|
|
23
|
+
letter-spacing: -0.24px;
|
|
24
|
+
font-family: var(--font-family-alfasans);
|
|
24
25
|
}
|
|
25
26
|
|
|
26
27
|
.component.bold {
|
|
27
28
|
font-weight: 700;
|
|
29
|
+
letter-spacing: 0.43px;
|
|
28
30
|
}
|
|
29
31
|
|
|
30
32
|
.component.medium {
|
|
31
33
|
font-weight: 500;
|
|
34
|
+
letter-spacing: -0.05px;
|
|
32
35
|
}
|
|
33
36
|
|
|
34
37
|
.caps {
|
|
@@ -37,7 +40,7 @@
|
|
|
37
40
|
font-weight: 400;
|
|
38
41
|
letter-spacing: 1.25px;
|
|
39
42
|
text-transform: uppercase;
|
|
40
|
-
font-family: var(--font-family-
|
|
43
|
+
font-family: var(--font-family-alfasans);
|
|
41
44
|
}
|
|
42
45
|
|
|
43
46
|
.caps.bold {
|
|
@@ -54,7 +57,7 @@
|
|
|
54
57
|
font-weight: 400;
|
|
55
58
|
letter-spacing: 1.25px;
|
|
56
59
|
text-transform: uppercase;
|
|
57
|
-
font-family: var(--font-family-
|
|
60
|
+
font-family: var(--font-family-alfasans);
|
|
58
61
|
}
|
|
59
62
|
|
|
60
63
|
.tagline.bold {
|
|
@@ -69,120 +72,143 @@
|
|
|
69
72
|
font-size: 18px;
|
|
70
73
|
line-height: 24px;
|
|
71
74
|
font-weight: 400;
|
|
72
|
-
|
|
75
|
+
letter-spacing: -0.36px;
|
|
76
|
+
font-family: var(--font-family-alfasans);
|
|
73
77
|
}
|
|
74
78
|
|
|
75
79
|
.primary-large.bold {
|
|
76
80
|
font-weight: 700;
|
|
81
|
+
letter-spacing: 0.38px;
|
|
77
82
|
}
|
|
78
83
|
|
|
79
84
|
.primary-large.medium {
|
|
80
85
|
font-weight: 500;
|
|
86
|
+
letter-spacing: -0.17px;
|
|
81
87
|
}
|
|
82
88
|
|
|
83
89
|
.primary-medium {
|
|
84
90
|
font-size: 16px;
|
|
85
91
|
line-height: 24px;
|
|
86
92
|
font-weight: 400;
|
|
87
|
-
|
|
93
|
+
letter-spacing: -0.24px;
|
|
94
|
+
font-family: var(--font-family-alfasans);
|
|
88
95
|
}
|
|
89
96
|
|
|
90
97
|
.primary-medium.bold {
|
|
91
98
|
font-weight: 700;
|
|
99
|
+
letter-spacing: 0.43px;
|
|
92
100
|
}
|
|
93
101
|
|
|
94
102
|
.primary-medium.medium {
|
|
95
103
|
font-weight: 500;
|
|
104
|
+
letter-spacing: -0.05px;
|
|
96
105
|
}
|
|
97
106
|
|
|
98
107
|
.primary-small {
|
|
99
108
|
font-size: 14px;
|
|
100
109
|
line-height: 20px;
|
|
101
110
|
font-weight: 400;
|
|
102
|
-
|
|
111
|
+
letter-spacing: -0.08px;
|
|
112
|
+
font-family: var(--font-family-alfasans);
|
|
103
113
|
}
|
|
104
114
|
|
|
105
115
|
.primary-small.bold {
|
|
106
116
|
font-weight: 700;
|
|
117
|
+
letter-spacing: 0.47px;
|
|
107
118
|
}
|
|
108
119
|
|
|
109
120
|
.primary-small.medium {
|
|
110
121
|
font-weight: 500;
|
|
122
|
+
letter-spacing: 0.07px;
|
|
111
123
|
}
|
|
112
124
|
|
|
113
125
|
.component-primary {
|
|
114
126
|
font-size: 16px;
|
|
115
127
|
line-height: 20px;
|
|
116
128
|
font-weight: 400;
|
|
117
|
-
|
|
129
|
+
letter-spacing: -0.24px;
|
|
130
|
+
font-family: var(--font-family-alfasans);
|
|
118
131
|
}
|
|
119
132
|
|
|
120
133
|
.component-primary.bold {
|
|
121
134
|
font-weight: 700;
|
|
135
|
+
letter-spacing: 0.43px;
|
|
122
136
|
}
|
|
123
137
|
|
|
124
138
|
.component-primary.medium {
|
|
125
139
|
font-weight: 500;
|
|
140
|
+
letter-spacing: -0.05px;
|
|
126
141
|
}
|
|
127
142
|
|
|
128
143
|
.secondary-large {
|
|
129
144
|
font-size: 13px;
|
|
130
145
|
line-height: 16px;
|
|
131
146
|
font-weight: 400;
|
|
132
|
-
font-family: var(--font-family-
|
|
147
|
+
font-family: var(--font-family-alfasans);
|
|
133
148
|
}
|
|
134
149
|
|
|
135
150
|
.secondary-large.bold {
|
|
136
151
|
font-weight: 700;
|
|
152
|
+
letter-spacing: 0.54px;
|
|
137
153
|
}
|
|
138
154
|
|
|
139
155
|
.secondary-large.medium {
|
|
140
156
|
font-weight: 500;
|
|
157
|
+
letter-spacing: 0.13px;
|
|
141
158
|
}
|
|
142
159
|
|
|
143
160
|
.secondary-medium {
|
|
144
161
|
font-size: 12px;
|
|
145
162
|
line-height: 16px;
|
|
146
163
|
font-weight: 400;
|
|
147
|
-
|
|
164
|
+
letter-spacing: 0.06px;
|
|
165
|
+
font-family: var(--font-family-alfasans);
|
|
148
166
|
}
|
|
149
167
|
|
|
150
168
|
.secondary-medium.bold {
|
|
151
169
|
font-weight: 700;
|
|
170
|
+
letter-spacing: 0.57px;
|
|
152
171
|
}
|
|
153
172
|
|
|
154
173
|
.secondary-medium.medium {
|
|
155
174
|
font-weight: 500;
|
|
175
|
+
letter-spacing: 0.19px;
|
|
156
176
|
}
|
|
157
177
|
|
|
158
178
|
.secondary-small {
|
|
159
179
|
font-size: 11px;
|
|
160
180
|
line-height: 16px;
|
|
161
181
|
font-weight: 400;
|
|
162
|
-
|
|
182
|
+
letter-spacing: 0.15px;
|
|
183
|
+
font-family: var(--font-family-alfasans);
|
|
163
184
|
}
|
|
164
185
|
|
|
165
186
|
.secondary-small.bold {
|
|
166
187
|
font-weight: 700;
|
|
188
|
+
letter-spacing: 0.54px;
|
|
167
189
|
}
|
|
168
190
|
|
|
169
191
|
.secondary-small.medium {
|
|
170
192
|
font-weight: 500;
|
|
193
|
+
letter-spacing: 0.24px;
|
|
171
194
|
}
|
|
172
195
|
|
|
173
196
|
.component-secondary {
|
|
174
197
|
font-size: 14px;
|
|
175
198
|
line-height: 18px;
|
|
176
199
|
font-weight: 400;
|
|
177
|
-
|
|
200
|
+
letter-spacing: -0.08px;
|
|
201
|
+
font-family: var(--font-family-alfasans);
|
|
178
202
|
}
|
|
179
203
|
|
|
180
204
|
.component-secondary.bold {
|
|
181
205
|
font-weight: 700;
|
|
206
|
+
letter-spacing: 0.47px;
|
|
182
207
|
}
|
|
183
208
|
|
|
184
209
|
.component-secondary.medium {
|
|
185
210
|
font-weight: 500;
|
|
211
|
+
letter-spacing: 0.07px;
|
|
186
212
|
}
|
|
187
213
|
|
|
188
214
|
.rowLimit1 {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import React, { type HTMLAttributes } from 'react';
|
|
2
2
|
import { type TextSkeletonProps } from '@alfalab/core-components-skeleton/moderncssm';
|
|
3
3
|
import { type Color } from '../colors';
|
|
4
|
-
|
|
5
|
-
export
|
|
4
|
+
type NativeProps = HTMLAttributes<HTMLHeadingElement>;
|
|
5
|
+
export type TitleProps = Omit<NativeProps, 'color'> & {
|
|
6
6
|
/**
|
|
7
7
|
* HTML тег
|
|
8
8
|
*/
|
|
@@ -61,51 +61,51 @@ export declare type TitleProps = Omit<NativeProps, 'color'> & {
|
|
|
61
61
|
*/
|
|
62
62
|
defaultMatchMediaValue?: boolean | (() => boolean);
|
|
63
63
|
};
|
|
64
|
-
|
|
64
|
+
type PrivateProps = {
|
|
65
65
|
styles: {
|
|
66
66
|
[key: string]: string;
|
|
67
67
|
};
|
|
68
68
|
platform: 'mobile' | 'desktop';
|
|
69
69
|
};
|
|
70
|
-
|
|
70
|
+
type TitleElementType = HTMLHeadingElement | HTMLDivElement;
|
|
71
71
|
export declare const TitleBase: React.ForwardRefExoticComponent<Omit<NativeProps, "color"> & {
|
|
72
72
|
/**
|
|
73
73
|
* HTML тег
|
|
74
74
|
*/
|
|
75
|
-
tag:
|
|
75
|
+
tag: "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "div";
|
|
76
76
|
/**
|
|
77
77
|
* [Вариант начертания](?path=/docs/guidelines-typography--page)
|
|
78
78
|
*/
|
|
79
|
-
view?: "
|
|
79
|
+
view?: "xlarge" | "large" | "medium" | "small" | "xsmall";
|
|
80
80
|
/**
|
|
81
81
|
* Цвет текста
|
|
82
82
|
*/
|
|
83
|
-
color?:
|
|
83
|
+
color?: Color;
|
|
84
84
|
/**
|
|
85
85
|
* Толщина шрифта
|
|
86
86
|
*/
|
|
87
|
-
weight?: "regular" | "medium" | "bold" | "semibold"
|
|
87
|
+
weight?: "regular" | "medium" | "bold" | "semibold";
|
|
88
88
|
/**
|
|
89
89
|
* Шрифт текста
|
|
90
90
|
*
|
|
91
91
|
* @deprecated
|
|
92
92
|
*/
|
|
93
|
-
font?: "
|
|
94
|
-
font:
|
|
93
|
+
font?: "styrene" | "system" | "alfasans" | {
|
|
94
|
+
font: "alfasans";
|
|
95
95
|
systemCompat: boolean;
|
|
96
|
-
}
|
|
96
|
+
};
|
|
97
97
|
/**
|
|
98
98
|
* Добавляет отступы
|
|
99
99
|
*/
|
|
100
|
-
defaultMargins?: boolean
|
|
100
|
+
defaultMargins?: boolean;
|
|
101
101
|
/**
|
|
102
102
|
* Css-класс для стилизации (native prop)
|
|
103
103
|
*/
|
|
104
|
-
className?: string
|
|
104
|
+
className?: string;
|
|
105
105
|
/**
|
|
106
106
|
* Id компонента для тестов
|
|
107
107
|
*/
|
|
108
|
-
dataTestId?: string
|
|
108
|
+
dataTestId?: string;
|
|
109
109
|
/**
|
|
110
110
|
* Контент (native prop)
|
|
111
111
|
*/
|
|
@@ -113,18 +113,18 @@ export declare const TitleBase: React.ForwardRefExoticComponent<Omit<NativeProps
|
|
|
113
113
|
/**
|
|
114
114
|
* Количество строк
|
|
115
115
|
*/
|
|
116
|
-
rowLimit?: 1 | 2 | 3
|
|
116
|
+
rowLimit?: 1 | 2 | 3;
|
|
117
117
|
/**
|
|
118
118
|
* Показать скелетон
|
|
119
119
|
*/
|
|
120
|
-
showSkeleton?: boolean
|
|
120
|
+
showSkeleton?: boolean;
|
|
121
121
|
/**
|
|
122
122
|
* Пропы для скелетона
|
|
123
123
|
*/
|
|
124
|
-
skeletonProps?: TextSkeletonProps
|
|
124
|
+
skeletonProps?: TextSkeletonProps;
|
|
125
125
|
/**
|
|
126
126
|
* Значение по-умолчанию для хука useMatchMedia
|
|
127
127
|
*/
|
|
128
|
-
defaultMatchMediaValue?: boolean | (() => boolean)
|
|
128
|
+
defaultMatchMediaValue?: boolean | (() => boolean);
|
|
129
129
|
} & PrivateProps & React.RefAttributes<TitleElementType>>;
|
|
130
130
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"component.js","sources":["../../src/title/component.tsx"],"sourcesContent":["import React, { forwardRef, type HTMLAttributes } from 'react';\nimport mergeRefs from 'react-merge-refs';\nimport cn from 'classnames';\n\nimport { isObject } from '@alfalab/core-components-shared';\nimport { type TextSkeletonProps, useSkeleton } from '@alfalab/core-components-skeleton';\n\nimport { type Color } from '../colors';\n\nimport { getDefaultWeight } from './utils';\n\nimport colors from '../colors.module.css';\nimport commonStyles from './common.module.css';\n\ntype NativeProps = HTMLAttributes<HTMLHeadingElement>;\n\nexport type TitleProps = Omit<NativeProps, 'color'> & {\n /**\n * HTML тег\n */\n tag: 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6' | 'div';\n\n /**\n * [Вариант начертания](?path=/docs/guidelines-typography--page)\n */\n view?: 'xlarge' | 'large' | 'medium' | 'small' | 'xsmall';\n\n /**\n * Цвет текста\n */\n color?: Color;\n\n /**\n * Толщина шрифта\n */\n weight?: 'regular' | 'medium' | 'bold' | 'semibold';\n\n /**\n * Шрифт текста\n *\n * @deprecated\n */\n font?: 'styrene' | 'system' | 'alfasans' | { font: 'alfasans'; systemCompat: boolean };\n\n /**\n * Добавляет отступы\n */\n defaultMargins?: boolean;\n\n /**\n * Css-класс для стилизации (native prop)\n */\n className?: string;\n\n /**\n * Id компонента для тестов\n */\n dataTestId?: string;\n\n /**\n * Контент (native prop)\n */\n children?: React.ReactNode;\n\n /**\n * Количество строк\n */\n rowLimit?: 1 | 2 | 3;\n\n /**\n * Показать скелетон\n */\n showSkeleton?: boolean;\n\n /**\n * Пропы для скелетона\n */\n skeletonProps?: TextSkeletonProps;\n\n /**\n * Значение по-умолчанию для хука useMatchMedia\n */\n defaultMatchMediaValue?: boolean | (() => boolean);\n};\n\ntype PrivateProps = {\n styles: {\n [key: string]: string;\n };\n platform: 'mobile' | 'desktop';\n};\n\ntype TitleElementType = HTMLHeadingElement | HTMLDivElement;\n\nexport const TitleBase = forwardRef<TitleElementType, TitleProps & PrivateProps>(\n (\n {\n tag: Component = 'div',\n view = 'medium',\n font = 'styrene',\n platform,\n weight = getDefaultWeight(isObject(font) ? font.font : font, platform),\n defaultMargins = false,\n color,\n className,\n dataTestId,\n children,\n rowLimit,\n styles,\n skeletonProps,\n showSkeleton,\n ...restProps\n },\n ref,\n ) => {\n const { renderSkeleton, textRef } = useSkeleton(showSkeleton, skeletonProps);\n\n const skeleton = renderSkeleton({\n wrapperClassName: cn(defaultMargins && styles[`margins-${view}`]),\n dataTestId,\n });\n\n if (skeleton) {\n return skeleton;\n }\n\n return (\n <Component\n className={cn(\n commonStyles.component,\n styles.component,\n className,\n styles[`${weight === 'regular' ? 'regular-' : ''}${view}`],\n defaultMargins && styles[`margins-${view}`],\n color && colors[color],\n {\n [commonStyles[`rowLimit${rowLimit}`]]: rowLimit,\n [commonStyles.transparent]: showSkeleton,\n [styles.font]:\n (isObject(font) && !font.systemCompat) || !(font === 'system'),\n },\n )}\n data-test-id={dataTestId}\n ref={mergeRefs([ref, textRef])}\n {...restProps}\n >\n {children}\n </Component>\n );\n },\n);\n"],"names":[],"mappings":";;;;;;;;;AA8FO,MAAM,SAAS,GAAG,UAAU,CAC/B,CACI,EACI,GAAG,EAAE,SAAS,GAAG,KAAK,EACtB,IAAI,GAAG,QAAQ,EACf,IAAI,GAAG,SAAS,EAChB,QAAQ,EACR,MAAM,GAAG,gBAAgB,CAAC,QAAQ,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC,IAAI,GAAG,IAAI,EAAE,QAAQ,CAAC,EACtE,cAAc,GAAG,KAAK,EACtB,KAAK,EACL,SAAS,EACT,UAAU,EACV,QAAQ,EACR,QAAQ,EACR,MAAM,EACN,aAAa,EACb,YAAY,EACZ,GAAG,SAAS,EACf,EACD,GAAG,KACH;AACA,IAAA,MAAM,EAAE,cAAc,EAAE,OAAO,EAAE,GAAG,WAAW,CAAC,YAAY,EAAE,aAAa,CAAC;IAE5E,MAAM,QAAQ,GAAG,cAAc,CAAC;QAC5B,gBAAgB,EAAE,EAAE,CAAC,cAAc,IAAI,MAAM,CAAC,CAAW,QAAA,EAAA,IAAI,CAAE,CAAA,CAAC,CAAC;QACjE,UAAU;AACb,KAAA,CAAC;
|
|
1
|
+
{"version":3,"file":"component.js","sources":["../../src/title/component.tsx"],"sourcesContent":["import React, { forwardRef, type HTMLAttributes } from 'react';\nimport mergeRefs from 'react-merge-refs';\nimport cn from 'classnames';\n\nimport { isObject } from '@alfalab/core-components-shared';\nimport { type TextSkeletonProps, useSkeleton } from '@alfalab/core-components-skeleton';\n\nimport { type Color } from '../colors';\n\nimport { getDefaultWeight } from './utils';\n\nimport colors from '../colors.module.css';\nimport commonStyles from './common.module.css';\n\ntype NativeProps = HTMLAttributes<HTMLHeadingElement>;\n\nexport type TitleProps = Omit<NativeProps, 'color'> & {\n /**\n * HTML тег\n */\n tag: 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6' | 'div';\n\n /**\n * [Вариант начертания](?path=/docs/guidelines-typography--page)\n */\n view?: 'xlarge' | 'large' | 'medium' | 'small' | 'xsmall';\n\n /**\n * Цвет текста\n */\n color?: Color;\n\n /**\n * Толщина шрифта\n */\n weight?: 'regular' | 'medium' | 'bold' | 'semibold';\n\n /**\n * Шрифт текста\n *\n * @deprecated\n */\n font?: 'styrene' | 'system' | 'alfasans' | { font: 'alfasans'; systemCompat: boolean };\n\n /**\n * Добавляет отступы\n */\n defaultMargins?: boolean;\n\n /**\n * Css-класс для стилизации (native prop)\n */\n className?: string;\n\n /**\n * Id компонента для тестов\n */\n dataTestId?: string;\n\n /**\n * Контент (native prop)\n */\n children?: React.ReactNode;\n\n /**\n * Количество строк\n */\n rowLimit?: 1 | 2 | 3;\n\n /**\n * Показать скелетон\n */\n showSkeleton?: boolean;\n\n /**\n * Пропы для скелетона\n */\n skeletonProps?: TextSkeletonProps;\n\n /**\n * Значение по-умолчанию для хука useMatchMedia\n */\n defaultMatchMediaValue?: boolean | (() => boolean);\n};\n\ntype PrivateProps = {\n styles: {\n [key: string]: string;\n };\n platform: 'mobile' | 'desktop';\n};\n\ntype TitleElementType = HTMLHeadingElement | HTMLDivElement;\n\nexport const TitleBase = forwardRef<TitleElementType, TitleProps & PrivateProps>(\n (\n {\n tag: Component = 'div',\n view = 'medium',\n font = 'styrene',\n platform,\n weight = getDefaultWeight(isObject(font) ? font.font : font, platform),\n defaultMargins = false,\n color,\n className,\n dataTestId,\n children,\n rowLimit,\n styles,\n skeletonProps,\n showSkeleton,\n ...restProps\n },\n ref,\n ) => {\n const { renderSkeleton, textRef } = useSkeleton(showSkeleton, skeletonProps);\n\n const skeleton = renderSkeleton({\n wrapperClassName: cn(defaultMargins && styles[`margins-${view}`]),\n dataTestId,\n });\n\n if (skeleton) {\n return skeleton;\n }\n\n return (\n <Component\n className={cn(\n commonStyles.component,\n styles.component,\n className,\n styles[`${weight === 'regular' ? 'regular-' : ''}${view}`],\n defaultMargins && styles[`margins-${view}`],\n color && colors[color],\n {\n [commonStyles[`rowLimit${rowLimit}`]]: rowLimit,\n [commonStyles.transparent]: showSkeleton,\n [styles.font]:\n (isObject(font) && !font.systemCompat) || !(font === 'system'),\n },\n )}\n data-test-id={dataTestId}\n ref={mergeRefs([ref, textRef])}\n {...restProps}\n >\n {children}\n </Component>\n );\n },\n);\n"],"names":[],"mappings":";;;;;;;;;AA8FO,MAAM,SAAS,GAAG,UAAU,CAC/B,CACI,EACI,GAAG,EAAE,SAAS,GAAG,KAAK,EACtB,IAAI,GAAG,QAAQ,EACf,IAAI,GAAG,SAAS,EAChB,QAAQ,EACR,MAAM,GAAG,gBAAgB,CAAC,QAAQ,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC,IAAI,GAAG,IAAI,EAAE,QAAQ,CAAC,EACtE,cAAc,GAAG,KAAK,EACtB,KAAK,EACL,SAAS,EACT,UAAU,EACV,QAAQ,EACR,QAAQ,EACR,MAAM,EACN,aAAa,EACb,YAAY,EACZ,GAAG,SAAS,EACf,EACD,GAAG,KACH;AACA,IAAA,MAAM,EAAE,cAAc,EAAE,OAAO,EAAE,GAAG,WAAW,CAAC,YAAY,EAAE,aAAa,CAAC;IAE5E,MAAM,QAAQ,GAAG,cAAc,CAAC;QAC5B,gBAAgB,EAAE,EAAE,CAAC,cAAc,IAAI,MAAM,CAAC,CAAW,QAAA,EAAA,IAAI,CAAE,CAAA,CAAC,CAAC;QACjE,UAAU;AACb,KAAA,CAAC;IAEF,IAAI,QAAQ,EAAE;AACV,QAAA,OAAO,QAAQ;;IAGnB,QACI,KAAC,CAAA,aAAA,CAAA,SAAS,EACN,EAAA,SAAS,EAAE,EAAE,CACT,YAAY,CAAC,SAAS,EACtB,MAAM,CAAC,SAAS,EAChB,SAAS,EACT,MAAM,CAAC,CAAG,EAAA,MAAM,KAAK,SAAS,GAAG,UAAU,GAAG,EAAE,CAAA,EAAG,IAAI,CAAE,CAAA,CAAC,EAC1D,cAAc,IAAI,MAAM,CAAC,CAAW,QAAA,EAAA,IAAI,CAAE,CAAA,CAAC,EAC3C,KAAK,IAAI,MAAM,CAAC,KAAK,CAAC,EACtB;YACI,CAAC,YAAY,CAAC,CAAW,QAAA,EAAA,QAAQ,EAAE,CAAC,GAAG,QAAQ;AAC/C,YAAA,CAAC,YAAY,CAAC,WAAW,GAAG,YAAY;YACxC,CAAC,MAAM,CAAC,IAAI,GACR,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,YAAY,KAAK,EAAE,IAAI,KAAK,QAAQ,CAAC;AACrE,SAAA,CACJ,kBACa,UAAU,EACxB,GAAG,EAAE,SAAS,CAAC,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC,EAC1B,GAAA,SAAS,IAEZ,QAAQ,CACD;AAEpB,CAAC;;;;"}
|
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { type TitleProps } from './component';
|
|
3
3
|
declare const Title: React.ForwardRefExoticComponent<Omit<React.HTMLAttributes<HTMLHeadingElement>, "color"> & {
|
|
4
|
-
tag: "
|
|
5
|
-
view?: "
|
|
6
|
-
color?: "
|
|
7
|
-
weight?: "regular" | "medium" | "bold" | "semibold"
|
|
8
|
-
font?: "
|
|
4
|
+
tag: "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "div";
|
|
5
|
+
view?: "xlarge" | "large" | "medium" | "small" | "xsmall";
|
|
6
|
+
color?: import("..").Color;
|
|
7
|
+
weight?: "regular" | "medium" | "bold" | "semibold";
|
|
8
|
+
font?: "styrene" | "system" | "alfasans" | {
|
|
9
9
|
font: "alfasans";
|
|
10
10
|
systemCompat: boolean;
|
|
11
|
-
}
|
|
12
|
-
defaultMargins?: boolean
|
|
13
|
-
className?: string
|
|
14
|
-
dataTestId?: string
|
|
11
|
+
};
|
|
12
|
+
defaultMargins?: boolean;
|
|
13
|
+
className?: string;
|
|
14
|
+
dataTestId?: string;
|
|
15
15
|
children?: React.ReactNode;
|
|
16
|
-
rowLimit?: 1 | 2 | 3
|
|
17
|
-
showSkeleton?: boolean
|
|
18
|
-
skeletonProps?: import("@alfalab/core-components-skeleton").TextSkeletonProps
|
|
19
|
-
defaultMatchMediaValue?: boolean | (() => boolean)
|
|
16
|
+
rowLimit?: 1 | 2 | 3;
|
|
17
|
+
showSkeleton?: boolean;
|
|
18
|
+
skeletonProps?: import("@alfalab/core-components-skeleton").TextSkeletonProps;
|
|
19
|
+
defaultMatchMediaValue?: boolean | (() => boolean);
|
|
20
20
|
} & React.RefAttributes<HTMLDivElement | HTMLHeadingElement>>;
|
|
21
21
|
export { Title };
|
|
22
22
|
export type { TitleProps };
|
|
@@ -3,139 +3,130 @@
|
|
|
3
3
|
font-size: 48px;
|
|
4
4
|
line-height: 52px;
|
|
5
5
|
font-weight: 700;
|
|
6
|
-
|
|
6
|
+
letter-spacing: 0.1px;
|
|
7
|
+
font-family: var(--font-family-alfasans);
|
|
7
8
|
}
|
|
8
9
|
|
|
9
|
-
.xlarge.font {
|
|
10
|
+
.xlarge.font {
|
|
10
11
|
line-height: 64px;
|
|
11
|
-
font-weight: 500;
|
|
12
|
-
font-feature-settings: 'ss01';
|
|
13
|
-
font-family: var(--font-family-styrene);
|
|
14
12
|
}
|
|
15
13
|
|
|
16
|
-
.regular-xlarge {
|
|
14
|
+
.regular-xlarge {
|
|
17
15
|
font-size: 48px;
|
|
18
16
|
line-height: 52px;
|
|
19
17
|
font-weight: 400;
|
|
20
|
-
|
|
18
|
+
letter-spacing: -2.1px;
|
|
19
|
+
font-family: var(--font-family-alfasans);
|
|
21
20
|
}
|
|
22
21
|
|
|
23
|
-
.regular-xlarge.font {
|
|
22
|
+
.regular-xlarge.font {
|
|
24
23
|
line-height: 64px;
|
|
25
|
-
font-feature-settings: 'ss01';
|
|
26
|
-
font-family: var(--font-family-styrene);
|
|
27
24
|
}
|
|
28
25
|
|
|
29
26
|
.large {
|
|
30
27
|
font-size: 40px;
|
|
31
28
|
line-height: 48px;
|
|
32
29
|
font-weight: 700;
|
|
33
|
-
|
|
30
|
+
letter-spacing: 0.1px;
|
|
31
|
+
font-family: var(--font-family-alfasans);
|
|
34
32
|
}
|
|
35
33
|
|
|
36
34
|
.large.font {
|
|
37
|
-
font-weight: 500;
|
|
38
|
-
font-feature-settings: 'ss01';
|
|
39
|
-
font-family: var(--font-family-styrene);
|
|
40
35
|
}
|
|
41
36
|
|
|
42
37
|
.regular-large {
|
|
43
38
|
font-size: 40px;
|
|
44
39
|
line-height: 48px;
|
|
45
40
|
font-weight: 400;
|
|
46
|
-
|
|
41
|
+
letter-spacing: -1.7px;
|
|
42
|
+
font-family: var(--font-family-alfasans);
|
|
47
43
|
}
|
|
48
44
|
|
|
49
45
|
.regular-large.font {
|
|
50
|
-
font-feature-settings: 'ss01';
|
|
51
|
-
font-family: var(--font-family-styrene);
|
|
52
46
|
}
|
|
53
47
|
|
|
54
48
|
.medium {
|
|
55
49
|
font-size: 30px;
|
|
56
50
|
line-height: 36px;
|
|
57
51
|
font-weight: 700;
|
|
58
|
-
|
|
52
|
+
letter-spacing: 0.1px;
|
|
53
|
+
font-family: var(--font-family-alfasans);
|
|
59
54
|
}
|
|
60
55
|
|
|
61
56
|
.medium.font {
|
|
62
57
|
font-size: 32px;
|
|
63
58
|
line-height: 40px;
|
|
64
|
-
|
|
65
|
-
font-feature-settings: 'ss01';
|
|
66
|
-
font-family: var(--font-family-styrene);
|
|
59
|
+
letter-spacing: 0.3px;
|
|
67
60
|
}
|
|
68
61
|
|
|
69
62
|
.regular-medium {
|
|
70
63
|
font-size: 30px;
|
|
71
64
|
line-height: 36px;
|
|
72
65
|
font-weight: 400;
|
|
73
|
-
|
|
66
|
+
letter-spacing: -1.25px;
|
|
67
|
+
font-family: var(--font-family-alfasans);
|
|
74
68
|
}
|
|
75
69
|
|
|
76
70
|
.regular-medium.font {
|
|
77
71
|
font-size: 32px;
|
|
78
72
|
line-height: 40px;
|
|
79
|
-
|
|
80
|
-
font-family: var(--font-family-styrene);
|
|
73
|
+
letter-spacing: -1.36px;
|
|
81
74
|
}
|
|
82
75
|
|
|
83
76
|
.small {
|
|
84
77
|
font-size: 22px;
|
|
85
78
|
line-height: 26px;
|
|
86
79
|
font-weight: 700;
|
|
87
|
-
|
|
80
|
+
letter-spacing: 0.2px;
|
|
81
|
+
font-family: var(--font-family-alfasans);
|
|
88
82
|
}
|
|
89
83
|
|
|
90
84
|
.small.font {
|
|
91
85
|
font-size: 24px;
|
|
92
86
|
line-height: 32px;
|
|
93
|
-
|
|
94
|
-
font-feature-settings: 'ss01';
|
|
95
|
-
font-family: var(--font-family-styrene);
|
|
87
|
+
letter-spacing: 0.39px;
|
|
96
88
|
}
|
|
97
89
|
|
|
98
90
|
.regular-small {
|
|
99
91
|
font-size: 22px;
|
|
100
92
|
line-height: 26px;
|
|
101
93
|
font-weight: 400;
|
|
102
|
-
|
|
94
|
+
letter-spacing: -0.8px;
|
|
95
|
+
font-family: var(--font-family-alfasans);
|
|
103
96
|
}
|
|
104
97
|
|
|
105
98
|
.regular-small.font {
|
|
106
99
|
font-size: 24px;
|
|
107
100
|
line-height: 32px;
|
|
108
|
-
|
|
109
|
-
font-family: var(--font-family-styrene);
|
|
101
|
+
letter-spacing: -0.9px;
|
|
110
102
|
}
|
|
111
103
|
|
|
112
104
|
.xsmall {
|
|
113
105
|
font-size: 18px;
|
|
114
106
|
line-height: 22px;
|
|
115
107
|
font-weight: 700;
|
|
116
|
-
|
|
108
|
+
letter-spacing: 0.38px;
|
|
109
|
+
font-family: var(--font-family-alfasans);
|
|
117
110
|
}
|
|
118
111
|
|
|
119
112
|
.xsmall.font {
|
|
120
113
|
font-size: 20px;
|
|
121
114
|
line-height: 24px;
|
|
122
|
-
|
|
123
|
-
font-feature-settings: 'ss01';
|
|
124
|
-
font-family: var(--font-family-styrene);
|
|
115
|
+
letter-spacing: 0.33px;
|
|
125
116
|
}
|
|
126
117
|
|
|
127
118
|
.regular-xsmall {
|
|
128
119
|
font-size: 18px;
|
|
129
120
|
line-height: 22px;
|
|
130
121
|
font-weight: 400;
|
|
131
|
-
|
|
122
|
+
letter-spacing: -0.36px;
|
|
123
|
+
font-family: var(--font-family-alfasans);
|
|
132
124
|
}
|
|
133
125
|
|
|
134
126
|
.regular-xsmall.font {
|
|
135
127
|
font-size: 20px;
|
|
136
128
|
line-height: 24px;
|
|
137
|
-
|
|
138
|
-
font-family: var(--font-family-styrene);
|
|
129
|
+
letter-spacing: -0.68px;
|
|
139
130
|
}
|
|
140
131
|
|
|
141
132
|
.component.margins-xlarge {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","sources":["../../src/title/utils.ts"],"sourcesContent":["export function getDefaultWeight(\n font: 'styrene' | 'system' | 'alfasans',\n platform: 'mobile' | 'desktop',\n) {\n if (font === 'styrene' || font === 'alfasans') {\n return 'medium';\n }\n\n if (platform === 'desktop') {\n return 'bold';\n }\n\n return 'semibold';\n}\n"],"names":[],"mappings":"AAAgB,SAAA,gBAAgB,CAC5B,IAAuC,EACvC,QAA8B,EAAA;
|
|
1
|
+
{"version":3,"file":"utils.js","sources":["../../src/title/utils.ts"],"sourcesContent":["export function getDefaultWeight(\n font: 'styrene' | 'system' | 'alfasans',\n platform: 'mobile' | 'desktop',\n) {\n if (font === 'styrene' || font === 'alfasans') {\n return 'medium';\n }\n\n if (platform === 'desktop') {\n return 'bold';\n }\n\n return 'semibold';\n}\n"],"names":[],"mappings":"AAAgB,SAAA,gBAAgB,CAC5B,IAAuC,EACvC,QAA8B,EAAA;IAE9B,IAAI,IAAI,KAAK,SAAS,IAAI,IAAI,KAAK,UAAU,EAAE;AAC3C,QAAA,OAAO,QAAQ;;AAGnB,IAAA,IAAI,QAAQ,KAAK,SAAS,EAAE;AACxB,QAAA,OAAO,MAAM;;AAGjB,IAAA,OAAO,UAAU;AACrB;;;;"}
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
export declare const TitleMobile: React.ForwardRefExoticComponent<Omit<React.HTMLAttributes<HTMLHeadingElement>, "color"> & {
|
|
3
|
-
tag: "
|
|
4
|
-
view?: "
|
|
5
|
-
color?: "
|
|
6
|
-
weight?: "regular" | "medium" | "bold" | "semibold"
|
|
7
|
-
font?: "
|
|
3
|
+
tag: "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "div";
|
|
4
|
+
view?: "xlarge" | "large" | "medium" | "small" | "xsmall";
|
|
5
|
+
color?: import("..").Color;
|
|
6
|
+
weight?: "regular" | "medium" | "bold" | "semibold";
|
|
7
|
+
font?: "styrene" | "system" | "alfasans" | {
|
|
8
8
|
font: "alfasans";
|
|
9
9
|
systemCompat: boolean;
|
|
10
|
-
}
|
|
11
|
-
defaultMargins?: boolean
|
|
12
|
-
className?: string
|
|
13
|
-
dataTestId?: string
|
|
10
|
+
};
|
|
11
|
+
defaultMargins?: boolean;
|
|
12
|
+
className?: string;
|
|
13
|
+
dataTestId?: string;
|
|
14
14
|
children?: React.ReactNode;
|
|
15
|
-
rowLimit?: 1 | 2 | 3
|
|
16
|
-
showSkeleton?: boolean
|
|
17
|
-
skeletonProps?: import("@alfalab/core-components-skeleton").TextSkeletonProps
|
|
18
|
-
defaultMatchMediaValue?: boolean | (() => boolean)
|
|
15
|
+
rowLimit?: 1 | 2 | 3;
|
|
16
|
+
showSkeleton?: boolean;
|
|
17
|
+
skeletonProps?: import("@alfalab/core-components-skeleton").TextSkeletonProps;
|
|
18
|
+
defaultMatchMediaValue?: boolean | (() => boolean);
|
|
19
19
|
} & React.RefAttributes<HTMLDivElement | HTMLHeadingElement>>;
|