@alfalab/core-components-typography 6.0.13-alfasans → 6.0.13

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.
Files changed (88) hide show
  1. package/colors.css +20 -20
  2. package/colors.module.css.js +1 -1
  3. package/cssm/text/index.module.css +13 -40
  4. package/cssm/title/component.d.ts +8 -2
  5. package/cssm/title/component.js +6 -3
  6. package/cssm/title/component.js.map +1 -1
  7. package/cssm/title/index.d.ts +4 -1
  8. package/cssm/title/index.module.css +74 -23
  9. package/cssm/title/utils.d.ts +1 -0
  10. package/cssm/title/utils.js +16 -0
  11. package/cssm/title/utils.js.map +1 -0
  12. package/cssm/title-mobile/component.d.ts +4 -1
  13. package/cssm/title-mobile/index.module.css +45 -28
  14. package/cssm/title-responsive/component.d.ts +4 -1
  15. package/esm/colors.css +20 -20
  16. package/esm/colors.module.css.js +1 -1
  17. package/esm/text/index.css +53 -80
  18. package/esm/text/index.module.css.js +1 -1
  19. package/esm/title/common.css +5 -5
  20. package/esm/title/common.module.css.js +1 -1
  21. package/esm/title/component.d.ts +8 -2
  22. package/esm/title/component.js +5 -2
  23. package/esm/title/component.js.map +1 -1
  24. package/esm/title/index.css +89 -38
  25. package/esm/title/index.d.ts +4 -1
  26. package/esm/title/index.module.css.js +1 -1
  27. package/esm/title/index.module.css.js.map +1 -1
  28. package/esm/title/utils.d.ts +1 -0
  29. package/esm/title/utils.js +12 -0
  30. package/esm/title/utils.js.map +1 -0
  31. package/esm/title-mobile/component.d.ts +4 -1
  32. package/esm/title-mobile/index.css +70 -53
  33. package/esm/title-mobile/index.module.css.js +1 -1
  34. package/esm/title-responsive/component.d.ts +4 -1
  35. package/modern/colors.css +20 -20
  36. package/modern/colors.module.css.js +1 -1
  37. package/modern/text/index.css +53 -80
  38. package/modern/text/index.module.css.js +1 -1
  39. package/modern/title/common.css +5 -5
  40. package/modern/title/common.module.css.js +1 -1
  41. package/modern/title/component.d.ts +8 -2
  42. package/modern/title/component.js +4 -1
  43. package/modern/title/component.js.map +1 -1
  44. package/modern/title/index.css +89 -38
  45. package/modern/title/index.d.ts +4 -1
  46. package/modern/title/index.module.css.js +1 -1
  47. package/modern/title/index.module.css.js.map +1 -1
  48. package/modern/title/utils.d.ts +1 -0
  49. package/modern/title/utils.js +12 -0
  50. package/modern/title/utils.js.map +1 -0
  51. package/modern/title-mobile/component.d.ts +4 -1
  52. package/modern/title-mobile/index.css +70 -53
  53. package/modern/title-mobile/index.module.css.js +1 -1
  54. package/modern/title-responsive/component.d.ts +4 -1
  55. package/moderncssm/text/index.module.css +11 -37
  56. package/moderncssm/title/component.d.ts +8 -2
  57. package/moderncssm/title/component.js +4 -1
  58. package/moderncssm/title/component.js.map +1 -1
  59. package/moderncssm/title/index.d.ts +4 -1
  60. package/moderncssm/title/index.module.css +79 -20
  61. package/moderncssm/title/utils.d.ts +1 -0
  62. package/moderncssm/title/utils.js +12 -0
  63. package/moderncssm/title/utils.js.map +1 -0
  64. package/moderncssm/title-mobile/component.d.ts +4 -1
  65. package/moderncssm/title-mobile/index.module.css +40 -25
  66. package/moderncssm/title-responsive/component.d.ts +4 -1
  67. package/package.json +6 -6
  68. package/src/title/component.tsx +8 -3
  69. package/src/title/index.module.css +8 -0
  70. package/src/title/utils.ts +14 -0
  71. package/text/index.css +53 -80
  72. package/text/index.module.css.js +1 -1
  73. package/title/common.css +5 -5
  74. package/title/common.module.css.js +1 -1
  75. package/title/component.d.ts +8 -2
  76. package/title/component.js +5 -2
  77. package/title/component.js.map +1 -1
  78. package/title/index.css +89 -38
  79. package/title/index.d.ts +4 -1
  80. package/title/index.module.css.js +1 -1
  81. package/title/index.module.css.js.map +1 -1
  82. package/title/utils.d.ts +1 -0
  83. package/title/utils.js +16 -0
  84. package/title/utils.js.map +1 -0
  85. package/title-mobile/component.d.ts +4 -1
  86. package/title-mobile/index.css +70 -53
  87. package/title-mobile/index.module.css.js +1 -1
  88. package/title-responsive/component.d.ts +4 -1
@@ -5,112 +5,129 @@
5
5
  --gap-40: 40px;
6
6
  }
7
7
  :root {
8
- --font-family-alfasans:
9
- 'Alfa Interface Sans', system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue',
10
- Helvetica, sans-serif;
8
+ --font-family-system:
9
+ system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Helvetica, sans-serif;
10
+ --font-family-styrene:
11
+ 'Styrene UI', system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Helvetica,
12
+ sans-serif;
11
13
  }
12
- .typography__xlarge_1jwjr {
14
+ .typography__xlarge_6rtoj {
13
15
  font-size: 34px;
14
16
  line-height: 40px;
15
- font-weight: 500;
16
- letter-spacing: -0.32px;
17
- font-family: var(--font-family-alfasans);
17
+ font-weight: 600;
18
+ font-family: var(--font-family-system);
18
19
  }
19
- .typography__xlarge_1jwjr.typography__font_1jwjr {
20
+ .typography__xlarge_6rtoj.typography__font_6rtoj {
21
+ font-weight: 500;
22
+ font-feature-settings: 'ss01';
23
+ font-family: var(--font-family-styrene);
20
24
  }
21
- .typography__regular-xlarge_1jwjr {
25
+ .typography__regular-xlarge_6rtoj {
22
26
  font-size: 34px;
23
27
  line-height: 40px;
24
28
  font-weight: 400;
25
- letter-spacing: -1.36px;
26
- font-family: var(--font-family-alfasans);
29
+ font-family: var(--font-family-system);
27
30
  }
28
- .typography__regular-xlarge_1jwjr.typography__system_1jwjr {
31
+ .typography__regular-xlarge_6rtoj.typography__system_6rtoj {
32
+ font-feature-settings: 'ss01';
33
+ font-family: var(--font-family-styrene);
29
34
  }
30
- .typography__large_1jwjr {
35
+ .typography__large_6rtoj {
31
36
  font-size: 30px;
32
37
  line-height: 36px;
33
- font-weight: 500;
34
- letter-spacing: -0.25px;
35
- font-family: var(--font-family-alfasans);
38
+ font-weight: 600;
39
+ font-family: var(--font-family-system);
36
40
  }
37
- .typography__large_1jwjr.typography__font_1jwjr {
41
+ .typography__large_6rtoj.typography__font_6rtoj {
42
+ font-weight: 500;
43
+ font-feature-settings: 'ss01';
44
+ font-family: var(--font-family-styrene);
38
45
  }
39
- .typography__regular-large_1jwjr {
46
+ .typography__regular-large_6rtoj {
40
47
  font-size: 30px;
41
48
  line-height: 36px;
42
49
  font-weight: 400;
43
- letter-spacing: -1.25px;
44
- font-family: var(--font-family-alfasans);
50
+ font-family: var(--font-family-system);
45
51
  }
46
- .typography__regular-large_1jwjr.typography__system_1jwjr {
52
+ .typography__regular-large_6rtoj.typography__system_6rtoj {
53
+ font-feature-settings: 'ss01';
54
+ font-family: var(--font-family-styrene);
47
55
  }
48
- .typography__medium_1jwjr {
56
+ .typography__medium_6rtoj {
49
57
  font-size: 26px;
50
58
  line-height: 32px;
51
- font-weight: 500;
52
- letter-spacing: -0.25px;
53
- font-family: var(--font-family-alfasans);
59
+ font-weight: 600;
60
+ font-family: var(--font-family-system);
54
61
  }
55
- .typography__medium_1jwjr.typography__font_1jwjr {
62
+ .typography__medium_6rtoj.typography__font_6rtoj {
63
+ font-weight: 500;
64
+ font-feature-settings: 'ss01';
65
+ font-family: var(--font-family-styrene);
56
66
  }
57
- .typography__regular-medium_1jwjr {
67
+ .typography__regular-medium_6rtoj {
58
68
  font-size: 26px;
59
69
  line-height: 32px;
60
70
  font-weight: 400;
61
- letter-spacing: -1px;
62
- font-family: var(--font-family-alfasans);
71
+ font-family: var(--font-family-system);
63
72
  }
64
- .typography__regular-medium_1jwjr.typography__system_1jwjr {
73
+ .typography__regular-medium_6rtoj.typography__system_6rtoj {
74
+ font-feature-settings: 'ss01';
75
+ font-family: var(--font-family-styrene);
65
76
  }
66
- .typography__small_1jwjr {
77
+ .typography__small_6rtoj {
67
78
  font-size: 20px;
68
79
  line-height: 28px;
69
- font-weight: 500;
70
- letter-spacing: -0.15px;
71
- font-family: var(--font-family-alfasans);
80
+ font-weight: 600;
81
+ font-family: var(--font-family-system);
72
82
  }
73
- .typography__small_1jwjr.typography__font_1jwjr {
83
+ .typography__small_6rtoj.typography__font_6rtoj {
84
+ font-weight: 500;
85
+ font-feature-settings: 'ss01';
86
+ font-family: var(--font-family-styrene);
74
87
  }
75
- .typography__regular-small_1jwjr {
88
+ .typography__regular-small_6rtoj {
76
89
  font-size: 20px;
77
90
  line-height: 28px;
78
91
  font-weight: 400;
79
- letter-spacing: -0.68px;
80
- font-family: var(--font-family-alfasans);
92
+ font-family: var(--font-family-system);
81
93
  }
82
- .typography__regular-small_1jwjr.typography__system_1jwjr {
94
+ .typography__regular-small_6rtoj.typography__system_6rtoj {
95
+ font-feature-settings: 'ss01';
96
+ font-family: var(--font-family-styrene);
83
97
  }
84
- .typography__xsmall_1jwjr {
98
+ .typography__xsmall_6rtoj {
85
99
  font-size: 16px;
86
100
  line-height: 20px;
87
- font-weight: 500;
88
- letter-spacing: 0.17px;
89
- font-family: var(--font-family-alfasans);
101
+ font-weight: 600;
102
+ font-family: var(--font-family-system);
90
103
  }
91
- .typography__xsmall_1jwjr.typography__font_1jwjr {
104
+ .typography__xsmall_6rtoj.typography__font_6rtoj {
105
+ font-weight: 500;
106
+ font-feature-settings: 'ss01';
107
+ font-family: var(--font-family-styrene);
92
108
  }
93
- .typography__regular-xsmall_1jwjr {
109
+ .typography__regular-xsmall_6rtoj {
94
110
  font-size: 16px;
95
111
  line-height: 20px;
96
112
  font-weight: 400;
97
- letter-spacing: -0.24px;
98
- font-family: var(--font-family-alfasans);
113
+ font-family: var(--font-family-system);
99
114
  }
100
- .typography__regular-xsmall_1jwjr.typography__system_1jwjr {
115
+ .typography__regular-xsmall_6rtoj.typography__system_6rtoj {
116
+ font-feature-settings: 'ss01';
117
+ font-family: var(--font-family-styrene);
101
118
  }
102
- .typography__component_1jwjr.typography__margins-xlarge_1jwjr {
119
+ .typography__component_6rtoj.typography__margins-xlarge_6rtoj {
103
120
  margin: var(--gap-0) var(--gap-0) var(--gap-24);
104
121
  }
105
- .typography__component_1jwjr.typography__margins-large_1jwjr {
122
+ .typography__component_6rtoj.typography__margins-large_6rtoj {
106
123
  margin: var(--gap-40) var(--gap-0) var(--gap-16);
107
124
  }
108
- .typography__component_1jwjr.typography__margins-medium_1jwjr {
125
+ .typography__component_6rtoj.typography__margins-medium_6rtoj {
109
126
  margin: var(--gap-40) var(--gap-0) var(--gap-16);
110
127
  }
111
- .typography__component_1jwjr.typography__margins-small_1jwjr {
128
+ .typography__component_6rtoj.typography__margins-small_6rtoj {
112
129
  margin: var(--gap-40) var(--gap-0) var(--gap-16);
113
130
  }
114
- .typography__component_1jwjr .typography__margins-xsmall_1jwjr {
131
+ .typography__component_6rtoj .typography__margins-xsmall_6rtoj {
115
132
  margin: var(--gap-40) var(--gap-0) var(--gap-16);
116
133
  }
@@ -1,6 +1,6 @@
1
1
  import './index.css';
2
2
 
3
- const styles = {"xlarge":"typography__xlarge_1jwjr","font":"typography__font_1jwjr","regular-xlarge":"typography__regular-xlarge_1jwjr","system":"typography__system_1jwjr","large":"typography__large_1jwjr","regular-large":"typography__regular-large_1jwjr","medium":"typography__medium_1jwjr","regular-medium":"typography__regular-medium_1jwjr","small":"typography__small_1jwjr","regular-small":"typography__regular-small_1jwjr","xsmall":"typography__xsmall_1jwjr","regular-xsmall":"typography__regular-xsmall_1jwjr","component":"typography__component_1jwjr","margins-xlarge":"typography__margins-xlarge_1jwjr","margins-large":"typography__margins-large_1jwjr","margins-medium":"typography__margins-medium_1jwjr","margins-small":"typography__margins-small_1jwjr","margins-xsmall":"typography__margins-xsmall_1jwjr"};
3
+ const styles = {"xlarge":"typography__xlarge_6rtoj","font":"typography__font_6rtoj","regular-xlarge":"typography__regular-xlarge_6rtoj","system":"typography__system_6rtoj","large":"typography__large_6rtoj","regular-large":"typography__regular-large_6rtoj","medium":"typography__medium_6rtoj","regular-medium":"typography__regular-medium_6rtoj","small":"typography__small_6rtoj","regular-small":"typography__regular-small_6rtoj","xsmall":"typography__xsmall_6rtoj","regular-xsmall":"typography__regular-xsmall_6rtoj","component":"typography__component_6rtoj","margins-xlarge":"typography__margins-xlarge_6rtoj","margins-large":"typography__margins-large_6rtoj","margins-medium":"typography__margins-medium_6rtoj","margins-small":"typography__margins-small_6rtoj","margins-xsmall":"typography__margins-xsmall_6rtoj"};
4
4
 
5
5
  export { styles as default };
6
6
  //# sourceMappingURL=index.module.css.js.map
@@ -16,7 +16,10 @@ export declare const TitleResponsive: React.ForwardRefExoticComponent<Omit<React
16
16
  view?: "xlarge" | "large" | "medium" | "small" | "xsmall";
17
17
  color?: import("..").Color;
18
18
  weight?: "regular" | "medium" | "bold" | "semibold";
19
- font?: "styrene" | "system";
19
+ font?: "styrene" | "system" | "alfasans" | {
20
+ font: "alfasans";
21
+ systemCompat: boolean;
22
+ };
20
23
  defaultMargins?: boolean;
21
24
  className?: string;
22
25
  dataTestId?: string;
@@ -20,18 +20,15 @@
20
20
  font-size: 16px;
21
21
  line-height: 20px;
22
22
  font-weight: 400;
23
- letter-spacing: -0.24px;
24
- font-family: var(--font-family-alfasans);
23
+ font-family: var(--font-family-system);
25
24
  }
26
25
 
27
26
  .component.bold {
28
27
  font-weight: 700;
29
- letter-spacing: 0.43px;
30
28
  }
31
29
 
32
30
  .component.medium {
33
31
  font-weight: 500;
34
- letter-spacing: -0.05px;
35
32
  }
36
33
 
37
34
  .caps {
@@ -40,7 +37,7 @@
40
37
  font-weight: 400;
41
38
  letter-spacing: 1.25px;
42
39
  text-transform: uppercase;
43
- font-family: var(--font-family-alfasans);
40
+ font-family: var(--font-family-system);
44
41
  }
45
42
 
46
43
  .caps.bold {
@@ -57,7 +54,7 @@
57
54
  font-weight: 400;
58
55
  letter-spacing: 1.25px;
59
56
  text-transform: uppercase;
60
- font-family: var(--font-family-alfasans);
57
+ font-family: var(--font-family-system);
61
58
  }
62
59
 
63
60
  .tagline.bold {
@@ -72,143 +69,120 @@
72
69
  font-size: 18px;
73
70
  line-height: 24px;
74
71
  font-weight: 400;
75
- letter-spacing: -0.36px;
76
- font-family: var(--font-family-alfasans);
72
+ font-family: var(--font-family-system);
77
73
  }
78
74
 
79
75
  .primary-large.bold {
80
76
  font-weight: 700;
81
- letter-spacing: 0.38px;
82
77
  }
83
78
 
84
79
  .primary-large.medium {
85
80
  font-weight: 500;
86
- letter-spacing: -0.17px;
87
81
  }
88
82
 
89
83
  .primary-medium {
90
84
  font-size: 16px;
91
85
  line-height: 24px;
92
86
  font-weight: 400;
93
- letter-spacing: -0.24px;
94
- font-family: var(--font-family-alfasans);
87
+ font-family: var(--font-family-system);
95
88
  }
96
89
 
97
90
  .primary-medium.bold {
98
91
  font-weight: 700;
99
- letter-spacing: 0.43px;
100
92
  }
101
93
 
102
94
  .primary-medium.medium {
103
95
  font-weight: 500;
104
- letter-spacing: -0.05px;
105
96
  }
106
97
 
107
98
  .primary-small {
108
99
  font-size: 14px;
109
100
  line-height: 20px;
110
101
  font-weight: 400;
111
- letter-spacing: -0.08px;
112
- font-family: var(--font-family-alfasans);
102
+ font-family: var(--font-family-system);
113
103
  }
114
104
 
115
105
  .primary-small.bold {
116
106
  font-weight: 700;
117
- letter-spacing: 0.47px;
118
107
  }
119
108
 
120
109
  .primary-small.medium {
121
110
  font-weight: 500;
122
- letter-spacing: 0.07px;
123
111
  }
124
112
 
125
113
  .component-primary {
126
114
  font-size: 16px;
127
115
  line-height: 20px;
128
116
  font-weight: 400;
129
- letter-spacing: -0.24px;
130
- font-family: var(--font-family-alfasans);
117
+ font-family: var(--font-family-system);
131
118
  }
132
119
 
133
120
  .component-primary.bold {
134
121
  font-weight: 700;
135
- letter-spacing: 0.43px;
136
122
  }
137
123
 
138
124
  .component-primary.medium {
139
125
  font-weight: 500;
140
- letter-spacing: -0.05px;
141
126
  }
142
127
 
143
128
  .secondary-large {
144
129
  font-size: 13px;
145
130
  line-height: 16px;
146
131
  font-weight: 400;
147
- font-family: var(--font-family-alfasans);
132
+ font-family: var(--font-family-system);
148
133
  }
149
134
 
150
135
  .secondary-large.bold {
151
136
  font-weight: 700;
152
- letter-spacing: 0.54px;
153
137
  }
154
138
 
155
139
  .secondary-large.medium {
156
140
  font-weight: 500;
157
- letter-spacing: 0.13px;
158
141
  }
159
142
 
160
143
  .secondary-medium {
161
144
  font-size: 12px;
162
145
  line-height: 16px;
163
146
  font-weight: 400;
164
- letter-spacing: 0.06px;
165
- font-family: var(--font-family-alfasans);
147
+ font-family: var(--font-family-system);
166
148
  }
167
149
 
168
150
  .secondary-medium.bold {
169
151
  font-weight: 700;
170
- letter-spacing: 0.57px;
171
152
  }
172
153
 
173
154
  .secondary-medium.medium {
174
155
  font-weight: 500;
175
- letter-spacing: 0.19px;
176
156
  }
177
157
 
178
158
  .secondary-small {
179
159
  font-size: 11px;
180
160
  line-height: 16px;
181
161
  font-weight: 400;
182
- letter-spacing: 0.15px;
183
- font-family: var(--font-family-alfasans);
162
+ font-family: var(--font-family-system);
184
163
  }
185
164
 
186
165
  .secondary-small.bold {
187
166
  font-weight: 700;
188
- letter-spacing: 0.54px;
189
167
  }
190
168
 
191
169
  .secondary-small.medium {
192
170
  font-weight: 500;
193
- letter-spacing: 0.24px;
194
171
  }
195
172
 
196
173
  .component-secondary {
197
174
  font-size: 14px;
198
175
  line-height: 18px;
199
176
  font-weight: 400;
200
- letter-spacing: -0.08px;
201
- font-family: var(--font-family-alfasans);
177
+ font-family: var(--font-family-system);
202
178
  }
203
179
 
204
180
  .component-secondary.bold {
205
181
  font-weight: 700;
206
- letter-spacing: 0.47px;
207
182
  }
208
183
 
209
184
  .component-secondary.medium {
210
185
  font-weight: 500;
211
- letter-spacing: 0.07px;
212
186
  }
213
187
 
214
188
  .rowLimit1 {
@@ -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/moderncssm';
4
5
  import { useSkeleton } from '@alfalab/core-components-skeleton/moderncssm';
6
+ import { getDefaultWeight } from './utils.js';
5
7
  import colors from '../colors.module.css';
6
8
  import commonStyles from './common.module.css';
7
9
 
8
- const TitleBase = forwardRef(({ tag: Component = 'div', view = 'medium', font, platform, weight = 'bold', defaultMargins = false, color, className, dataTestId, children, rowLimit, styles, skeletonProps, showSkeleton, ...restProps }, ref) => {
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 = 'bold',\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 },\n )}\n data-test-id={dataTestId}\n ref={mergeRefs([ref, textRef])}\n {...restProps}\n >\n {children}\n </Component>\n );\n },\n);\n"],"names":[],"mappings":";;;;;;;AAyFa,MAAA,SAAS,GAAG,UAAU,CAC/B,CACI,EACI,GAAG,EAAE,SAAS,GAAG,KAAK,EACtB,IAAI,GAAG,QAAQ,EACf,IAAI,EACJ,QAAQ,EACR,MAAM,GAAG,MAAM,EACf,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;AAC3C,SAAA,CACJ,kBACa,UAAU,EACxB,GAAG,EAAE,SAAS,CAAC,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC,EAC1B,GAAA,SAAS,IAEZ,QAAQ,CACD;AAEpB,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 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;;;;"}
@@ -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;
@@ -3,82 +3,141 @@
3
3
  font-size: 48px;
4
4
  line-height: 52px;
5
5
  font-weight: 700;
6
- letter-spacing: 0.1px;
7
- font-family: var(--font-family-alfasans);
6
+ font-family: var(--font-family-system);
8
7
  }
9
8
 
9
+ .xlarge.font {
10
+ line-height: 64px;
11
+ font-weight: 500;
12
+ font-feature-settings: 'ss01';
13
+ font-family: var(--font-family-styrene);
14
+ }
15
+
10
16
  .regular-xlarge {
11
17
  font-size: 48px;
12
18
  line-height: 52px;
13
19
  font-weight: 400;
14
- letter-spacing: -2.1px;
15
- font-family: var(--font-family-alfasans);
20
+ font-family: var(--font-family-system);
16
21
  }
17
22
 
23
+ .regular-xlarge.font {
24
+ line-height: 64px;
25
+ font-feature-settings: 'ss01';
26
+ font-family: var(--font-family-styrene);
27
+ }
28
+
18
29
  .large {
19
30
  font-size: 40px;
20
31
  line-height: 48px;
21
32
  font-weight: 700;
22
- letter-spacing: 0.1px;
23
- font-family: var(--font-family-alfasans);
33
+ font-family: var(--font-family-system);
24
34
  }
25
35
 
36
+ .large.font {
37
+ font-weight: 500;
38
+ font-feature-settings: 'ss01';
39
+ font-family: var(--font-family-styrene);
40
+ }
41
+
26
42
  .regular-large {
27
43
  font-size: 40px;
28
44
  line-height: 48px;
29
45
  font-weight: 400;
30
- letter-spacing: -1.7px;
31
- font-family: var(--font-family-alfasans);
46
+ font-family: var(--font-family-system);
32
47
  }
33
48
 
49
+ .regular-large.font {
50
+ font-feature-settings: 'ss01';
51
+ font-family: var(--font-family-styrene);
52
+ }
53
+
34
54
  .medium {
35
55
  font-size: 30px;
36
56
  line-height: 36px;
37
57
  font-weight: 700;
38
- letter-spacing: 0.1px;
39
- font-family: var(--font-family-alfasans);
58
+ font-family: var(--font-family-system);
40
59
  }
41
60
 
61
+ .medium.font {
62
+ font-size: 32px;
63
+ line-height: 40px;
64
+ font-weight: 500;
65
+ font-feature-settings: 'ss01';
66
+ font-family: var(--font-family-styrene);
67
+ }
68
+
42
69
  .regular-medium {
43
70
  font-size: 30px;
44
71
  line-height: 36px;
45
72
  font-weight: 400;
46
- letter-spacing: -1.25px;
47
- font-family: var(--font-family-alfasans);
73
+ font-family: var(--font-family-system);
48
74
  }
49
75
 
76
+ .regular-medium.font {
77
+ font-size: 32px;
78
+ line-height: 40px;
79
+ font-feature-settings: 'ss01';
80
+ font-family: var(--font-family-styrene);
81
+ }
82
+
50
83
  .small {
51
84
  font-size: 22px;
52
85
  line-height: 26px;
53
86
  font-weight: 700;
54
- letter-spacing: 0.2px;
55
- font-family: var(--font-family-alfasans);
87
+ font-family: var(--font-family-system);
56
88
  }
57
89
 
90
+ .small.font {
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
+
58
98
  .regular-small {
59
99
  font-size: 22px;
60
100
  line-height: 26px;
61
101
  font-weight: 400;
62
- letter-spacing: -0.8px;
63
- font-family: var(--font-family-alfasans);
102
+ font-family: var(--font-family-system);
64
103
  }
65
104
 
105
+ .regular-small.font {
106
+ font-size: 24px;
107
+ line-height: 32px;
108
+ font-feature-settings: 'ss01';
109
+ font-family: var(--font-family-styrene);
110
+ }
111
+
66
112
  .xsmall {
67
113
  font-size: 18px;
68
114
  line-height: 22px;
69
115
  font-weight: 700;
70
- letter-spacing: 0.38px;
71
- font-family: var(--font-family-alfasans);
116
+ font-family: var(--font-family-system);
72
117
  }
73
118
 
119
+ .xsmall.font {
120
+ font-size: 20px;
121
+ line-height: 24px;
122
+ font-weight: 500;
123
+ font-feature-settings: 'ss01';
124
+ font-family: var(--font-family-styrene);
125
+ }
126
+
74
127
  .regular-xsmall {
75
128
  font-size: 18px;
76
129
  line-height: 22px;
77
130
  font-weight: 400;
78
- letter-spacing: -0.36px;
79
- font-family: var(--font-family-alfasans);
131
+ font-family: var(--font-family-system);
80
132
  }
81
133
 
134
+ .regular-xsmall.font {
135
+ font-size: 20px;
136
+ line-height: 24px;
137
+ font-feature-settings: 'ss01';
138
+ font-family: var(--font-family-styrene);
139
+ }
140
+
82
141
  .component.margins-xlarge {
83
142
  margin: var(--gap-0) var(--gap-0) var(--gap-24);
84
143
  }
@@ -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;;;;"}