@alfalab/core-components-typography 6.0.9-alfasans → 6.0.10
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.module.css.js +1 -1
- package/cssm/text/index.module.css +14 -42
- package/cssm/title/component.d.ts +8 -2
- package/cssm/title/component.js +6 -3
- package/cssm/title/component.js.map +1 -1
- package/cssm/title/index.d.ts +4 -1
- package/cssm/title/index.module.css +78 -31
- package/cssm/title/utils.d.ts +1 -0
- package/cssm/title/utils.js +16 -0
- package/cssm/title/utils.js.map +1 -0
- package/cssm/title-mobile/component.d.ts +4 -1
- package/cssm/title-mobile/index.module.css +48 -34
- package/cssm/title-responsive/component.d.ts +4 -1
- package/esm/colors.css +20 -20
- package/esm/colors.module.css.js +1 -1
- package/esm/text/index.css +54 -82
- package/esm/text/index.module.css.js +1 -1
- package/esm/title/common.css +5 -5
- package/esm/title/common.module.css.js +1 -1
- package/esm/title/component.d.ts +8 -2
- package/esm/title/component.js +5 -2
- package/esm/title/component.js.map +1 -1
- package/esm/title/index.css +93 -46
- package/esm/title/index.d.ts +4 -1
- package/esm/title/index.module.css.js +1 -1
- package/esm/title/index.module.css.js.map +1 -1
- package/esm/title/utils.d.ts +1 -0
- package/esm/title/utils.js +12 -0
- package/esm/title/utils.js.map +1 -0
- package/esm/title-mobile/component.d.ts +4 -1
- package/esm/title-mobile/index.css +73 -59
- package/esm/title-mobile/index.module.css.js +1 -1
- package/esm/title-responsive/component.d.ts +4 -1
- package/modern/colors.css +20 -20
- package/modern/colors.module.css.js +1 -1
- package/modern/text/index.css +54 -82
- package/modern/text/index.module.css.js +1 -1
- package/modern/title/common.css +5 -5
- package/modern/title/common.module.css.js +1 -1
- package/modern/title/component.d.ts +8 -2
- package/modern/title/component.js +4 -1
- package/modern/title/component.js.map +1 -1
- package/modern/title/index.css +93 -46
- package/modern/title/index.d.ts +4 -1
- package/modern/title/index.module.css.js +1 -1
- package/modern/title/index.module.css.js.map +1 -1
- package/modern/title/utils.d.ts +1 -0
- package/modern/title/utils.js +12 -0
- package/modern/title/utils.js.map +1 -0
- package/modern/title-mobile/component.d.ts +4 -1
- package/modern/title-mobile/index.css +73 -59
- package/modern/title-mobile/index.module.css.js +1 -1
- package/modern/title-responsive/component.d.ts +4 -1
- package/moderncssm/text/index.module.css +11 -37
- package/moderncssm/title/component.d.ts +8 -2
- package/moderncssm/title/component.js +4 -1
- package/moderncssm/title/component.js.map +1 -1
- package/moderncssm/title/index.d.ts +4 -1
- package/moderncssm/title/index.module.css +79 -20
- package/moderncssm/title/utils.d.ts +1 -0
- package/moderncssm/title/utils.js +12 -0
- package/moderncssm/title/utils.js.map +1 -0
- package/moderncssm/title-mobile/component.d.ts +4 -1
- package/moderncssm/title-mobile/index.module.css +40 -25
- package/moderncssm/title-responsive/component.d.ts +4 -1
- package/package.json +6 -6
- package/src/title/component.tsx +8 -3
- package/src/title/index.module.css +8 -0
- package/src/title/utils.ts +14 -0
- package/text/index.css +54 -82
- package/text/index.module.css.js +1 -1
- package/title/common.css +5 -5
- package/title/common.module.css.js +1 -1
- package/title/component.d.ts +8 -2
- package/title/component.js +5 -2
- package/title/component.js.map +1 -1
- package/title/index.css +93 -46
- package/title/index.d.ts +4 -1
- package/title/index.module.css.js +1 -1
- package/title/index.module.css.js.map +1 -1
- package/title/utils.d.ts +1 -0
- package/title/utils.js +16 -0
- package/title/utils.js.map +1 -0
- package/title-mobile/component.d.ts +4 -1
- package/title-mobile/index.css +73 -59
- package/title-mobile/index.module.css.js +1 -1
- package/title-responsive/component.d.ts +4 -1
package/modern/text/index.css
CHANGED
|
@@ -1,209 +1,181 @@
|
|
|
1
1
|
:root {
|
|
2
|
-
--gap-s: 12px;
|
|
3
2
|
--gap-0: 0px;
|
|
4
|
-
--gap-12:
|
|
3
|
+
--gap-12: 12px;
|
|
5
4
|
}
|
|
6
5
|
:root {
|
|
7
|
-
--font-family-
|
|
8
|
-
|
|
9
|
-
Helvetica, sans-serif;
|
|
6
|
+
--font-family-system:
|
|
7
|
+
system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Helvetica, sans-serif;
|
|
10
8
|
}
|
|
11
|
-
.
|
|
9
|
+
.typography__transparent_15zcn {
|
|
12
10
|
opacity: 0;
|
|
13
11
|
}
|
|
14
12
|
:root {
|
|
15
13
|
--text-paragraph-margin-bottom: var(--gap-0) var(--gap-0) var(--gap-12);
|
|
16
14
|
}
|
|
17
|
-
.
|
|
15
|
+
.typography__paragraph_15zcn {
|
|
18
16
|
margin: var(--gap-0);
|
|
19
17
|
padding: var(--gap-0);
|
|
20
18
|
}
|
|
21
|
-
.
|
|
19
|
+
.typography__paragraphWithMargins_15zcn {
|
|
22
20
|
padding: var(--gap-0);
|
|
23
21
|
margin: var(--text-paragraph-margin-bottom);
|
|
24
22
|
}
|
|
25
|
-
.
|
|
23
|
+
.typography__component_15zcn {
|
|
26
24
|
font-size: 16px;
|
|
27
25
|
line-height: 20px;
|
|
28
26
|
font-weight: 400;
|
|
29
|
-
|
|
30
|
-
font-family: var(--font-family-alfasans);
|
|
27
|
+
font-family: var(--font-family-system);
|
|
31
28
|
}
|
|
32
|
-
.
|
|
29
|
+
.typography__component_15zcn.typography__bold_15zcn {
|
|
33
30
|
font-weight: 700;
|
|
34
|
-
letter-spacing: 0.43px;
|
|
35
31
|
}
|
|
36
|
-
.
|
|
32
|
+
.typography__component_15zcn.typography__medium_15zcn {
|
|
37
33
|
font-weight: 500;
|
|
38
|
-
letter-spacing: -0.05px;
|
|
39
34
|
}
|
|
40
|
-
.
|
|
35
|
+
.typography__caps_15zcn {
|
|
41
36
|
font-size: 12px;
|
|
42
37
|
line-height: 16px;
|
|
43
38
|
font-weight: 400;
|
|
44
39
|
letter-spacing: 1.25px;
|
|
45
40
|
text-transform: uppercase;
|
|
46
|
-
font-family: var(--font-family-
|
|
41
|
+
font-family: var(--font-family-system);
|
|
47
42
|
}
|
|
48
|
-
.
|
|
43
|
+
.typography__caps_15zcn.typography__bold_15zcn {
|
|
49
44
|
font-weight: 700;
|
|
50
45
|
}
|
|
51
|
-
.
|
|
46
|
+
.typography__caps_15zcn.typography__medium_15zcn {
|
|
52
47
|
font-weight: 500;
|
|
53
48
|
}
|
|
54
|
-
.
|
|
49
|
+
.typography__tagline_15zcn {
|
|
55
50
|
font-size: 12px;
|
|
56
51
|
line-height: 16px;
|
|
57
52
|
font-weight: 400;
|
|
58
53
|
letter-spacing: 1.25px;
|
|
59
54
|
text-transform: uppercase;
|
|
60
|
-
font-family: var(--font-family-
|
|
55
|
+
font-family: var(--font-family-system);
|
|
61
56
|
}
|
|
62
|
-
.
|
|
57
|
+
.typography__tagline_15zcn.typography__bold_15zcn {
|
|
63
58
|
font-weight: 700;
|
|
64
59
|
}
|
|
65
|
-
.
|
|
60
|
+
.typography__tagline_15zcn.typography__medium_15zcn {
|
|
66
61
|
font-weight: 500;
|
|
67
62
|
}
|
|
68
|
-
.typography__primary-
|
|
63
|
+
.typography__primary-large_15zcn {
|
|
69
64
|
font-size: 18px;
|
|
70
65
|
line-height: 24px;
|
|
71
66
|
font-weight: 400;
|
|
72
|
-
|
|
73
|
-
font-family: var(--font-family-alfasans);
|
|
67
|
+
font-family: var(--font-family-system);
|
|
74
68
|
}
|
|
75
|
-
.typography__primary-
|
|
69
|
+
.typography__primary-large_15zcn.typography__bold_15zcn {
|
|
76
70
|
font-weight: 700;
|
|
77
|
-
letter-spacing: 0.38px;
|
|
78
71
|
}
|
|
79
|
-
.typography__primary-
|
|
72
|
+
.typography__primary-large_15zcn.typography__medium_15zcn {
|
|
80
73
|
font-weight: 500;
|
|
81
|
-
letter-spacing: -0.17px;
|
|
82
74
|
}
|
|
83
|
-
.typography__primary-
|
|
75
|
+
.typography__primary-medium_15zcn {
|
|
84
76
|
font-size: 16px;
|
|
85
77
|
line-height: 24px;
|
|
86
78
|
font-weight: 400;
|
|
87
|
-
|
|
88
|
-
font-family: var(--font-family-alfasans);
|
|
79
|
+
font-family: var(--font-family-system);
|
|
89
80
|
}
|
|
90
|
-
.typography__primary-
|
|
81
|
+
.typography__primary-medium_15zcn.typography__bold_15zcn {
|
|
91
82
|
font-weight: 700;
|
|
92
|
-
letter-spacing: 0.43px;
|
|
93
83
|
}
|
|
94
|
-
.typography__primary-
|
|
84
|
+
.typography__primary-medium_15zcn.typography__medium_15zcn {
|
|
95
85
|
font-weight: 500;
|
|
96
|
-
letter-spacing: -0.05px;
|
|
97
86
|
}
|
|
98
|
-
.typography__primary-
|
|
87
|
+
.typography__primary-small_15zcn {
|
|
99
88
|
font-size: 14px;
|
|
100
89
|
line-height: 20px;
|
|
101
90
|
font-weight: 400;
|
|
102
|
-
|
|
103
|
-
font-family: var(--font-family-alfasans);
|
|
91
|
+
font-family: var(--font-family-system);
|
|
104
92
|
}
|
|
105
|
-
.typography__primary-
|
|
93
|
+
.typography__primary-small_15zcn.typography__bold_15zcn {
|
|
106
94
|
font-weight: 700;
|
|
107
|
-
letter-spacing: 0.47px;
|
|
108
95
|
}
|
|
109
|
-
.typography__primary-
|
|
96
|
+
.typography__primary-small_15zcn.typography__medium_15zcn {
|
|
110
97
|
font-weight: 500;
|
|
111
|
-
letter-spacing: 0.07px;
|
|
112
98
|
}
|
|
113
|
-
.typography__component-
|
|
99
|
+
.typography__component-primary_15zcn {
|
|
114
100
|
font-size: 16px;
|
|
115
101
|
line-height: 20px;
|
|
116
102
|
font-weight: 400;
|
|
117
|
-
|
|
118
|
-
font-family: var(--font-family-alfasans);
|
|
103
|
+
font-family: var(--font-family-system);
|
|
119
104
|
}
|
|
120
|
-
.typography__component-
|
|
105
|
+
.typography__component-primary_15zcn.typography__bold_15zcn {
|
|
121
106
|
font-weight: 700;
|
|
122
|
-
letter-spacing: 0.43px;
|
|
123
107
|
}
|
|
124
|
-
.typography__component-
|
|
108
|
+
.typography__component-primary_15zcn.typography__medium_15zcn {
|
|
125
109
|
font-weight: 500;
|
|
126
|
-
letter-spacing: -0.05px;
|
|
127
110
|
}
|
|
128
|
-
.typography__secondary-
|
|
111
|
+
.typography__secondary-large_15zcn {
|
|
129
112
|
font-size: 13px;
|
|
130
113
|
line-height: 16px;
|
|
131
114
|
font-weight: 400;
|
|
132
|
-
font-family: var(--font-family-
|
|
115
|
+
font-family: var(--font-family-system);
|
|
133
116
|
}
|
|
134
|
-
.typography__secondary-
|
|
117
|
+
.typography__secondary-large_15zcn.typography__bold_15zcn {
|
|
135
118
|
font-weight: 700;
|
|
136
|
-
letter-spacing: 0.54px;
|
|
137
119
|
}
|
|
138
|
-
.typography__secondary-
|
|
120
|
+
.typography__secondary-large_15zcn.typography__medium_15zcn {
|
|
139
121
|
font-weight: 500;
|
|
140
|
-
letter-spacing: 0.13px;
|
|
141
122
|
}
|
|
142
|
-
.typography__secondary-
|
|
123
|
+
.typography__secondary-medium_15zcn {
|
|
143
124
|
font-size: 12px;
|
|
144
125
|
line-height: 16px;
|
|
145
126
|
font-weight: 400;
|
|
146
|
-
|
|
147
|
-
font-family: var(--font-family-alfasans);
|
|
127
|
+
font-family: var(--font-family-system);
|
|
148
128
|
}
|
|
149
|
-
.typography__secondary-
|
|
129
|
+
.typography__secondary-medium_15zcn.typography__bold_15zcn {
|
|
150
130
|
font-weight: 700;
|
|
151
|
-
letter-spacing: 0.57px;
|
|
152
131
|
}
|
|
153
|
-
.typography__secondary-
|
|
132
|
+
.typography__secondary-medium_15zcn.typography__medium_15zcn {
|
|
154
133
|
font-weight: 500;
|
|
155
|
-
letter-spacing: 0.19px;
|
|
156
134
|
}
|
|
157
|
-
.typography__secondary-
|
|
135
|
+
.typography__secondary-small_15zcn {
|
|
158
136
|
font-size: 11px;
|
|
159
137
|
line-height: 16px;
|
|
160
138
|
font-weight: 400;
|
|
161
|
-
|
|
162
|
-
font-family: var(--font-family-alfasans);
|
|
139
|
+
font-family: var(--font-family-system);
|
|
163
140
|
}
|
|
164
|
-
.typography__secondary-
|
|
141
|
+
.typography__secondary-small_15zcn.typography__bold_15zcn {
|
|
165
142
|
font-weight: 700;
|
|
166
|
-
letter-spacing: 0.54px;
|
|
167
143
|
}
|
|
168
|
-
.typography__secondary-
|
|
144
|
+
.typography__secondary-small_15zcn.typography__medium_15zcn {
|
|
169
145
|
font-weight: 500;
|
|
170
|
-
letter-spacing: 0.24px;
|
|
171
146
|
}
|
|
172
|
-
.typography__component-
|
|
147
|
+
.typography__component-secondary_15zcn {
|
|
173
148
|
font-size: 14px;
|
|
174
149
|
line-height: 18px;
|
|
175
150
|
font-weight: 400;
|
|
176
|
-
|
|
177
|
-
font-family: var(--font-family-alfasans);
|
|
151
|
+
font-family: var(--font-family-system);
|
|
178
152
|
}
|
|
179
|
-
.typography__component-
|
|
153
|
+
.typography__component-secondary_15zcn.typography__bold_15zcn {
|
|
180
154
|
font-weight: 700;
|
|
181
|
-
letter-spacing: 0.47px;
|
|
182
155
|
}
|
|
183
|
-
.typography__component-
|
|
156
|
+
.typography__component-secondary_15zcn.typography__medium_15zcn {
|
|
184
157
|
font-weight: 500;
|
|
185
|
-
letter-spacing: 0.07px;
|
|
186
158
|
}
|
|
187
|
-
.
|
|
159
|
+
.typography__rowLimit1_15zcn {
|
|
188
160
|
-webkit-line-clamp: 1;
|
|
189
161
|
display: -webkit-box;
|
|
190
162
|
-webkit-box-orient: vertical;
|
|
191
163
|
overflow: hidden;
|
|
192
164
|
word-break: break-all;
|
|
193
165
|
}
|
|
194
|
-
.
|
|
166
|
+
.typography__rowLimit2_15zcn {
|
|
195
167
|
-webkit-line-clamp: 2;
|
|
196
168
|
display: -webkit-box;
|
|
197
169
|
-webkit-box-orient: vertical;
|
|
198
170
|
overflow: hidden;
|
|
199
171
|
}
|
|
200
|
-
.
|
|
172
|
+
.typography__rowLimit3_15zcn {
|
|
201
173
|
-webkit-line-clamp: 3;
|
|
202
174
|
display: -webkit-box;
|
|
203
175
|
-webkit-box-orient: vertical;
|
|
204
176
|
overflow: hidden;
|
|
205
177
|
}
|
|
206
|
-
.
|
|
178
|
+
.typography__monospace_15zcn {
|
|
207
179
|
font-feature-settings: "tnum";
|
|
208
180
|
font-variant-numeric: tabular-nums;
|
|
209
181
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import './index.css';
|
|
2
2
|
|
|
3
|
-
const styles = {"transparent":"
|
|
3
|
+
const styles = {"transparent":"typography__transparent_15zcn","paragraph":"typography__paragraph_15zcn","paragraphWithMargins":"typography__paragraphWithMargins_15zcn","component":"typography__component_15zcn","bold":"typography__bold_15zcn","medium":"typography__medium_15zcn","caps":"typography__caps_15zcn","tagline":"typography__tagline_15zcn","primary-large":"typography__primary-large_15zcn","primary-medium":"typography__primary-medium_15zcn","primary-small":"typography__primary-small_15zcn","component-primary":"typography__component-primary_15zcn","secondary-large":"typography__secondary-large_15zcn","secondary-medium":"typography__secondary-medium_15zcn","secondary-small":"typography__secondary-small_15zcn","component-secondary":"typography__component-secondary_15zcn","rowLimit1":"typography__rowLimit1_15zcn","rowLimit2":"typography__rowLimit2_15zcn","rowLimit3":"typography__rowLimit3_15zcn","monospace":"typography__monospace_15zcn"};
|
|
4
4
|
|
|
5
5
|
export { styles as default };
|
|
6
6
|
//# sourceMappingURL=index.module.css.js.map
|
package/modern/title/common.css
CHANGED
|
@@ -1,27 +1,27 @@
|
|
|
1
1
|
:root {
|
|
2
2
|
--gap-0: 0px;
|
|
3
3
|
}
|
|
4
|
-
.
|
|
4
|
+
.typography__transparent_gne53 {
|
|
5
5
|
opacity: 0;
|
|
6
6
|
}
|
|
7
|
-
.
|
|
7
|
+
.typography__component_gne53 {
|
|
8
8
|
margin: var(--gap-0);
|
|
9
9
|
padding: var(--gap-0);
|
|
10
10
|
}
|
|
11
|
-
.
|
|
11
|
+
.typography__rowLimit1_gne53 {
|
|
12
12
|
-webkit-line-clamp: 1;
|
|
13
13
|
display: -webkit-box;
|
|
14
14
|
-webkit-box-orient: vertical;
|
|
15
15
|
overflow: hidden;
|
|
16
16
|
word-break: break-all;
|
|
17
17
|
}
|
|
18
|
-
.
|
|
18
|
+
.typography__rowLimit2_gne53 {
|
|
19
19
|
-webkit-line-clamp: 2;
|
|
20
20
|
display: -webkit-box;
|
|
21
21
|
-webkit-box-orient: vertical;
|
|
22
22
|
overflow: hidden;
|
|
23
23
|
}
|
|
24
|
-
.
|
|
24
|
+
.typography__rowLimit3_gne53 {
|
|
25
25
|
-webkit-line-clamp: 3;
|
|
26
26
|
display: -webkit-box;
|
|
27
27
|
-webkit-box-orient: vertical;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import './common.css';
|
|
2
2
|
|
|
3
|
-
const commonStyles = {"transparent":"
|
|
3
|
+
const commonStyles = {"transparent":"typography__transparent_gne53","component":"typography__component_gne53","rowLimit1":"typography__rowLimit1_gne53","rowLimit2":"typography__rowLimit2_gne53","rowLimit3":"typography__rowLimit3_gne53"};
|
|
4
4
|
|
|
5
5
|
export { commonStyles as default };
|
|
6
6
|
//# sourceMappingURL=common.module.css.js.map
|
|
@@ -22,7 +22,10 @@ export type TitleProps = Omit<NativeProps, 'color'> & {
|
|
|
22
22
|
/**
|
|
23
23
|
* Шрифт текста
|
|
24
24
|
*/
|
|
25
|
-
font?: 'styrene' | 'system'
|
|
25
|
+
font?: 'styrene' | 'system' | 'alfasans' | {
|
|
26
|
+
font: 'alfasans';
|
|
27
|
+
systemCompat: boolean;
|
|
28
|
+
};
|
|
26
29
|
/**
|
|
27
30
|
* Добавляет отступы
|
|
28
31
|
*/
|
|
@@ -83,7 +86,10 @@ export declare const TitleBase: React.ForwardRefExoticComponent<Omit<NativeProps
|
|
|
83
86
|
/**
|
|
84
87
|
* Шрифт текста
|
|
85
88
|
*/
|
|
86
|
-
font?: "styrene" | "system"
|
|
89
|
+
font?: "styrene" | "system" | "alfasans" | {
|
|
90
|
+
font: "alfasans";
|
|
91
|
+
systemCompat: boolean;
|
|
92
|
+
};
|
|
87
93
|
/**
|
|
88
94
|
* Добавляет отступы
|
|
89
95
|
*/
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import React, { forwardRef } from 'react';
|
|
2
2
|
import mergeRefs from 'react-merge-refs';
|
|
3
3
|
import cn from 'classnames';
|
|
4
|
+
import { isObject } from '@alfalab/core-components-shared/modern';
|
|
4
5
|
import { useSkeleton } from '@alfalab/core-components-skeleton/modern';
|
|
6
|
+
import { getDefaultWeight } from './utils.js';
|
|
5
7
|
import colors from '../colors.module.css.js';
|
|
6
8
|
import commonStyles from './common.module.css.js';
|
|
7
9
|
|
|
8
|
-
const TitleBase = forwardRef(({ tag: Component = 'div', view = 'medium', font, platform, weight =
|
|
10
|
+
const TitleBase = forwardRef(({ tag: Component = 'div', view = 'medium', font = 'styrene', platform, weight = getDefaultWeight(isObject(font) ? font.font : font, platform), defaultMargins = false, color, className, dataTestId, children, rowLimit, styles, skeletonProps, showSkeleton, ...restProps }, ref) => {
|
|
9
11
|
const { renderSkeleton, textRef } = useSkeleton(showSkeleton, skeletonProps);
|
|
10
12
|
const skeleton = renderSkeleton({
|
|
11
13
|
wrapperClassName: cn(defaultMargins && styles[`margins-${view}`]),
|
|
@@ -17,6 +19,7 @@ const TitleBase = forwardRef(({ tag: Component = 'div', view = 'medium', font, p
|
|
|
17
19
|
return (React.createElement(Component, { className: cn(commonStyles.component, styles.component, className, styles[`${weight === 'regular' ? 'regular-' : ''}${view}`], defaultMargins && styles[`margins-${view}`], color && colors[color], {
|
|
18
20
|
[commonStyles[`rowLimit${rowLimit}`]]: rowLimit,
|
|
19
21
|
[commonStyles.transparent]: showSkeleton,
|
|
22
|
+
[styles.font]: (isObject(font) && !font.systemCompat) || !(font === 'system'),
|
|
20
23
|
}), "data-test-id": dataTestId, ref: mergeRefs([ref, textRef]), ...restProps }, children));
|
|
21
24
|
});
|
|
22
25
|
|
|
@@ -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 { type TextSkeletonProps, useSkeleton } from '@alfalab/core-components-skeleton';\n\nimport { type Color } from '../colors';\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 font?: 'styrene' | 'system';\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,\n platform,\n weight =
|
|
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 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":";;;;;;;;;AA4FO,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;;;;"}
|
package/modern/title/index.css
CHANGED
|
@@ -1,101 +1,148 @@
|
|
|
1
1
|
:root {
|
|
2
|
-
--gap-m: 16px;
|
|
3
|
-
--gap-xl: 24px;
|
|
4
|
-
--gap-3xl: 40px;
|
|
5
|
-
--gap-4xl: 48px;
|
|
6
2
|
--gap-0: 0px;
|
|
7
|
-
--gap-16:
|
|
8
|
-
--gap-24:
|
|
9
|
-
--gap-40:
|
|
10
|
-
--gap-48:
|
|
3
|
+
--gap-16: 16px;
|
|
4
|
+
--gap-24: 24px;
|
|
5
|
+
--gap-40: 40px;
|
|
6
|
+
--gap-48: 48px;
|
|
11
7
|
}
|
|
12
8
|
:root {
|
|
13
|
-
--font-family-
|
|
14
|
-
|
|
15
|
-
|
|
9
|
+
--font-family-system:
|
|
10
|
+
system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Helvetica, sans-serif;
|
|
11
|
+
--font-family-styrene:
|
|
12
|
+
'Styrene UI', system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Helvetica,
|
|
13
|
+
sans-serif;
|
|
16
14
|
}
|
|
17
|
-
.
|
|
15
|
+
.typography__xlarge_1aft9 {
|
|
18
16
|
font-size: 48px;
|
|
19
17
|
line-height: 52px;
|
|
20
18
|
font-weight: 700;
|
|
21
|
-
|
|
22
|
-
font-family: var(--font-family-alfasans);
|
|
19
|
+
font-family: var(--font-family-system);
|
|
23
20
|
}
|
|
24
|
-
.
|
|
21
|
+
.typography__xlarge_1aft9.typography__font_1aft9 {
|
|
22
|
+
line-height: 64px;
|
|
23
|
+
font-weight: 500;
|
|
24
|
+
font-feature-settings: 'ss01';
|
|
25
|
+
font-family: var(--font-family-styrene);
|
|
26
|
+
}
|
|
27
|
+
.typography__regular-xlarge_1aft9 {
|
|
25
28
|
font-size: 48px;
|
|
26
29
|
line-height: 52px;
|
|
27
30
|
font-weight: 400;
|
|
28
|
-
|
|
29
|
-
font-family: var(--font-family-alfasans);
|
|
31
|
+
font-family: var(--font-family-system);
|
|
30
32
|
}
|
|
31
|
-
.
|
|
33
|
+
.typography__regular-xlarge_1aft9.typography__font_1aft9 {
|
|
34
|
+
line-height: 64px;
|
|
35
|
+
font-feature-settings: 'ss01';
|
|
36
|
+
font-family: var(--font-family-styrene);
|
|
37
|
+
}
|
|
38
|
+
.typography__large_1aft9 {
|
|
32
39
|
font-size: 40px;
|
|
33
40
|
line-height: 48px;
|
|
34
41
|
font-weight: 700;
|
|
35
|
-
|
|
36
|
-
font-family: var(--font-family-alfasans);
|
|
42
|
+
font-family: var(--font-family-system);
|
|
37
43
|
}
|
|
38
|
-
.
|
|
44
|
+
.typography__large_1aft9.typography__font_1aft9 {
|
|
45
|
+
font-weight: 500;
|
|
46
|
+
font-feature-settings: 'ss01';
|
|
47
|
+
font-family: var(--font-family-styrene);
|
|
48
|
+
}
|
|
49
|
+
.typography__regular-large_1aft9 {
|
|
39
50
|
font-size: 40px;
|
|
40
51
|
line-height: 48px;
|
|
41
52
|
font-weight: 400;
|
|
42
|
-
|
|
43
|
-
font-family: var(--font-family-alfasans);
|
|
53
|
+
font-family: var(--font-family-system);
|
|
44
54
|
}
|
|
45
|
-
.
|
|
55
|
+
.typography__regular-large_1aft9.typography__font_1aft9 {
|
|
56
|
+
font-feature-settings: 'ss01';
|
|
57
|
+
font-family: var(--font-family-styrene);
|
|
58
|
+
}
|
|
59
|
+
.typography__medium_1aft9 {
|
|
46
60
|
font-size: 30px;
|
|
47
61
|
line-height: 36px;
|
|
48
62
|
font-weight: 700;
|
|
49
|
-
|
|
50
|
-
font-family: var(--font-family-alfasans);
|
|
63
|
+
font-family: var(--font-family-system);
|
|
51
64
|
}
|
|
52
|
-
.
|
|
65
|
+
.typography__medium_1aft9.typography__font_1aft9 {
|
|
66
|
+
font-size: 32px;
|
|
67
|
+
line-height: 40px;
|
|
68
|
+
font-weight: 500;
|
|
69
|
+
font-feature-settings: 'ss01';
|
|
70
|
+
font-family: var(--font-family-styrene);
|
|
71
|
+
}
|
|
72
|
+
.typography__regular-medium_1aft9 {
|
|
53
73
|
font-size: 30px;
|
|
54
74
|
line-height: 36px;
|
|
55
75
|
font-weight: 400;
|
|
56
|
-
|
|
57
|
-
font-family: var(--font-family-alfasans);
|
|
76
|
+
font-family: var(--font-family-system);
|
|
58
77
|
}
|
|
59
|
-
.
|
|
78
|
+
.typography__regular-medium_1aft9.typography__font_1aft9 {
|
|
79
|
+
font-size: 32px;
|
|
80
|
+
line-height: 40px;
|
|
81
|
+
font-feature-settings: 'ss01';
|
|
82
|
+
font-family: var(--font-family-styrene);
|
|
83
|
+
}
|
|
84
|
+
.typography__small_1aft9 {
|
|
60
85
|
font-size: 22px;
|
|
61
86
|
line-height: 26px;
|
|
62
87
|
font-weight: 700;
|
|
63
|
-
|
|
64
|
-
font-family: var(--font-family-alfasans);
|
|
88
|
+
font-family: var(--font-family-system);
|
|
65
89
|
}
|
|
66
|
-
.
|
|
90
|
+
.typography__small_1aft9.typography__font_1aft9 {
|
|
91
|
+
font-size: 24px;
|
|
92
|
+
line-height: 32px;
|
|
93
|
+
font-weight: 500;
|
|
94
|
+
font-feature-settings: 'ss01';
|
|
95
|
+
font-family: var(--font-family-styrene);
|
|
96
|
+
}
|
|
97
|
+
.typography__regular-small_1aft9 {
|
|
67
98
|
font-size: 22px;
|
|
68
99
|
line-height: 26px;
|
|
69
100
|
font-weight: 400;
|
|
70
|
-
|
|
71
|
-
font-family: var(--font-family-alfasans);
|
|
101
|
+
font-family: var(--font-family-system);
|
|
72
102
|
}
|
|
73
|
-
.
|
|
103
|
+
.typography__regular-small_1aft9.typography__font_1aft9 {
|
|
104
|
+
font-size: 24px;
|
|
105
|
+
line-height: 32px;
|
|
106
|
+
font-feature-settings: 'ss01';
|
|
107
|
+
font-family: var(--font-family-styrene);
|
|
108
|
+
}
|
|
109
|
+
.typography__xsmall_1aft9 {
|
|
74
110
|
font-size: 18px;
|
|
75
111
|
line-height: 22px;
|
|
76
112
|
font-weight: 700;
|
|
77
|
-
|
|
78
|
-
font-family: var(--font-family-alfasans);
|
|
113
|
+
font-family: var(--font-family-system);
|
|
79
114
|
}
|
|
80
|
-
.
|
|
115
|
+
.typography__xsmall_1aft9.typography__font_1aft9 {
|
|
116
|
+
font-size: 20px;
|
|
117
|
+
line-height: 24px;
|
|
118
|
+
font-weight: 500;
|
|
119
|
+
font-feature-settings: 'ss01';
|
|
120
|
+
font-family: var(--font-family-styrene);
|
|
121
|
+
}
|
|
122
|
+
.typography__regular-xsmall_1aft9 {
|
|
81
123
|
font-size: 18px;
|
|
82
124
|
line-height: 22px;
|
|
83
125
|
font-weight: 400;
|
|
84
|
-
|
|
85
|
-
font-family: var(--font-family-alfasans);
|
|
126
|
+
font-family: var(--font-family-system);
|
|
86
127
|
}
|
|
87
|
-
.
|
|
128
|
+
.typography__regular-xsmall_1aft9.typography__font_1aft9 {
|
|
129
|
+
font-size: 20px;
|
|
130
|
+
line-height: 24px;
|
|
131
|
+
font-feature-settings: 'ss01';
|
|
132
|
+
font-family: var(--font-family-styrene);
|
|
133
|
+
}
|
|
134
|
+
.typography__component_1aft9.typography__margins-xlarge_1aft9 {
|
|
88
135
|
margin: var(--gap-0) var(--gap-0) var(--gap-24);
|
|
89
136
|
}
|
|
90
|
-
.
|
|
137
|
+
.typography__component_1aft9.typography__margins-large_1aft9 {
|
|
91
138
|
margin: var(--gap-48) var(--gap-0) var(--gap-24);
|
|
92
139
|
}
|
|
93
|
-
.
|
|
140
|
+
.typography__component_1aft9.typography__margins-medium_1aft9 {
|
|
94
141
|
margin: var(--gap-48) var(--gap-0) var(--gap-24);
|
|
95
142
|
}
|
|
96
|
-
.
|
|
143
|
+
.typography__component_1aft9.typography__margins-small_1aft9 {
|
|
97
144
|
margin: var(--gap-40) var(--gap-0) var(--gap-16);
|
|
98
145
|
}
|
|
99
|
-
.
|
|
146
|
+
.typography__component_1aft9.typography__margins-xsmall_1aft9 {
|
|
100
147
|
margin: var(--gap-40) var(--gap-0) var(--gap-16);
|
|
101
148
|
}
|
package/modern/title/index.d.ts
CHANGED
|
@@ -5,7 +5,10 @@ declare const Title: React.ForwardRefExoticComponent<Omit<React.HTMLAttributes<H
|
|
|
5
5
|
view?: "xlarge" | "large" | "medium" | "small" | "xsmall";
|
|
6
6
|
color?: import("..").Color;
|
|
7
7
|
weight?: "regular" | "medium" | "bold" | "semibold";
|
|
8
|
-
font?: "styrene" | "system"
|
|
8
|
+
font?: "styrene" | "system" | "alfasans" | {
|
|
9
|
+
font: "alfasans";
|
|
10
|
+
systemCompat: boolean;
|
|
11
|
+
};
|
|
9
12
|
defaultMargins?: boolean;
|
|
10
13
|
className?: string;
|
|
11
14
|
dataTestId?: string;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import './index.css';
|
|
2
2
|
|
|
3
|
-
const styles = {"xlarge":"
|
|
3
|
+
const styles = {"xlarge":"typography__xlarge_1aft9","font":"typography__font_1aft9","regular-xlarge":"typography__regular-xlarge_1aft9","large":"typography__large_1aft9","regular-large":"typography__regular-large_1aft9","medium":"typography__medium_1aft9","regular-medium":"typography__regular-medium_1aft9","small":"typography__small_1aft9","regular-small":"typography__regular-small_1aft9","xsmall":"typography__xsmall_1aft9","regular-xsmall":"typography__regular-xsmall_1aft9","component":"typography__component_1aft9","margins-xlarge":"typography__margins-xlarge_1aft9","margins-large":"typography__margins-large_1aft9","margins-medium":"typography__margins-medium_1aft9","margins-small":"typography__margins-small_1aft9","margins-xsmall":"typography__margins-xsmall_1aft9"};
|
|
4
4
|
|
|
5
5
|
export { styles as default };
|
|
6
6
|
//# sourceMappingURL=index.module.css.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.module.css.js","sources":["../src/title/index.module.css"],"sourcesContent":["@import '@alfalab/core-components-vars/src/index.css';\n@import '../margins.module.css';\n\n@each $view in xlarge, large, medium, small, xsmall {\n .$(view) {\n @mixin headline-system_$(view);\n }\n\n .regular-$(view) {\n @mixin promo-system_$(view);\n }\n}\n\n.component {\n &.margins-xlarge {\n @mixin margin-large;\n }\n\n &.margins-large {\n @mixin margin-medium;\n }\n\n &.margins-medium {\n @mixin margin-medium;\n }\n\n &.margins-small {\n @mixin margin-small;\n }\n\n &.margins-xsmall {\n @mixin margin-small;\n }\n}\n"],"names":[],"mappings":";;AAEgB,eAAe,CAAC,QAAQ,CAAC,0BAA0B,CAAC,gBAAgB,CAAC,kCAAkC,CAAC,OAAO,CAAC,yBAAyB,CAAC,eAAe,CAAC,iCAAiC,CAAC,QAAQ,CAAC,0BAA0B,CAAC,gBAAgB,CAAC,kCAAkC,CAAC,OAAO,CAAC,yBAAyB,CAAC,eAAe,CAAC,iCAAiC,CAAC,QAAQ,CAAC,0BAA0B,CAAC,gBAAgB,CAAC,kCAAkC,CAAC,WAAW,CAAC,6BAA6B,CAAC,gBAAgB,CAAC,kCAAkC,CAAC,eAAe,CAAC,iCAAiC,CAAC,gBAAgB,CAAC,kCAAkC,CAAC,eAAe,CAAC,iCAAiC,CAAC,gBAAgB,CAAC,kCAAkC,CAAC;;;;"}
|
|
1
|
+
{"version":3,"file":"index.module.css.js","sources":["../src/title/index.module.css"],"sourcesContent":["@import '@alfalab/core-components-vars/src/index.css';\n@import '../margins.module.css';\n\n@each $view in xlarge, large, medium, small, xsmall {\n .$(view) {\n @mixin headline-system_$(view);\n\n &.font {\n @subtract-mixin headline_$(view), headline-system_$(view);\n }\n }\n\n .regular-$(view) {\n @mixin promo-system_$(view);\n\n &.font {\n @subtract-mixin promo_$(view), promo-system_$(view);\n }\n }\n}\n\n.component {\n &.margins-xlarge {\n @mixin margin-large;\n }\n\n &.margins-large {\n @mixin margin-medium;\n }\n\n &.margins-medium {\n @mixin margin-medium;\n }\n\n &.margins-small {\n @mixin margin-small;\n }\n\n &.margins-xsmall {\n @mixin margin-small;\n }\n}\n"],"names":[],"mappings":";;AAEgB,eAAe,CAAC,QAAQ,CAAC,0BAA0B,CAAC,MAAM,CAAC,wBAAwB,CAAC,gBAAgB,CAAC,kCAAkC,CAAC,OAAO,CAAC,yBAAyB,CAAC,eAAe,CAAC,iCAAiC,CAAC,QAAQ,CAAC,0BAA0B,CAAC,gBAAgB,CAAC,kCAAkC,CAAC,OAAO,CAAC,yBAAyB,CAAC,eAAe,CAAC,iCAAiC,CAAC,QAAQ,CAAC,0BAA0B,CAAC,gBAAgB,CAAC,kCAAkC,CAAC,WAAW,CAAC,6BAA6B,CAAC,gBAAgB,CAAC,kCAAkC,CAAC,eAAe,CAAC,iCAAiC,CAAC,gBAAgB,CAAC,kCAAkC,CAAC,eAAe,CAAC,iCAAiC,CAAC,gBAAgB,CAAC,kCAAkC,CAAC;;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function getDefaultWeight(font: 'styrene' | 'system' | 'alfasans', platform: 'mobile' | 'desktop'): "medium" | "bold" | "semibold";
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
function getDefaultWeight(font, platform) {
|
|
2
|
+
if (font === 'styrene' || font === 'alfasans') {
|
|
3
|
+
return 'medium';
|
|
4
|
+
}
|
|
5
|
+
if (platform === 'desktop') {
|
|
6
|
+
return 'bold';
|
|
7
|
+
}
|
|
8
|
+
return 'semibold';
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export { getDefaultWeight };
|
|
12
|
+
//# sourceMappingURL=utils.js.map
|
|
@@ -0,0 +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;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;;;;"}
|