@alfalab/core-components-typography 6.0.12 → 6.0.13-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.
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 +40 -13
  4. package/cssm/title/component.d.ts +2 -8
  5. package/cssm/title/component.js +3 -6
  6. package/cssm/title/component.js.map +1 -1
  7. package/cssm/title/index.d.ts +1 -4
  8. package/cssm/title/index.module.css +23 -74
  9. package/cssm/title-mobile/component.d.ts +1 -4
  10. package/cssm/title-mobile/index.module.css +28 -45
  11. package/cssm/title-responsive/component.d.ts +1 -4
  12. package/esm/colors.css +20 -20
  13. package/esm/colors.module.css.js +1 -1
  14. package/esm/text/index.css +80 -53
  15. package/esm/text/index.module.css.js +1 -1
  16. package/esm/title/common.css +5 -5
  17. package/esm/title/common.module.css.js +1 -1
  18. package/esm/title/component.d.ts +2 -8
  19. package/esm/title/component.js +2 -5
  20. package/esm/title/component.js.map +1 -1
  21. package/esm/title/index.css +38 -89
  22. package/esm/title/index.d.ts +1 -4
  23. package/esm/title/index.module.css.js +1 -1
  24. package/esm/title/index.module.css.js.map +1 -1
  25. package/esm/title-mobile/component.d.ts +1 -4
  26. package/esm/title-mobile/index.css +53 -70
  27. package/esm/title-mobile/index.module.css.js +1 -1
  28. package/esm/title-responsive/component.d.ts +1 -4
  29. package/modern/colors.css +20 -20
  30. package/modern/colors.module.css.js +1 -1
  31. package/modern/text/index.css +80 -53
  32. package/modern/text/index.module.css.js +1 -1
  33. package/modern/title/common.css +5 -5
  34. package/modern/title/common.module.css.js +1 -1
  35. package/modern/title/component.d.ts +2 -8
  36. package/modern/title/component.js +1 -4
  37. package/modern/title/component.js.map +1 -1
  38. package/modern/title/index.css +38 -89
  39. package/modern/title/index.d.ts +1 -4
  40. package/modern/title/index.module.css.js +1 -1
  41. package/modern/title/index.module.css.js.map +1 -1
  42. package/modern/title-mobile/component.d.ts +1 -4
  43. package/modern/title-mobile/index.css +53 -70
  44. package/modern/title-mobile/index.module.css.js +1 -1
  45. package/modern/title-responsive/component.d.ts +1 -4
  46. package/moderncssm/text/index.module.css +37 -11
  47. package/moderncssm/title/component.d.ts +2 -8
  48. package/moderncssm/title/component.js +1 -4
  49. package/moderncssm/title/component.js.map +1 -1
  50. package/moderncssm/title/index.d.ts +1 -4
  51. package/moderncssm/title/index.module.css +20 -79
  52. package/moderncssm/title-mobile/component.d.ts +1 -4
  53. package/moderncssm/title-mobile/index.module.css +25 -40
  54. package/moderncssm/title-responsive/component.d.ts +1 -4
  55. package/package.json +6 -6
  56. package/src/title/component.tsx +3 -8
  57. package/src/title/index.module.css +0 -8
  58. package/text/index.css +80 -53
  59. package/text/index.module.css.js +1 -1
  60. package/title/common.css +5 -5
  61. package/title/common.module.css.js +1 -1
  62. package/title/component.d.ts +2 -8
  63. package/title/component.js +2 -5
  64. package/title/component.js.map +1 -1
  65. package/title/index.css +38 -89
  66. package/title/index.d.ts +1 -4
  67. package/title/index.module.css.js +1 -1
  68. package/title/index.module.css.js.map +1 -1
  69. package/title-mobile/component.d.ts +1 -4
  70. package/title-mobile/index.css +53 -70
  71. package/title-mobile/index.module.css.js +1 -1
  72. package/title-responsive/component.d.ts +1 -4
  73. package/cssm/title/utils.d.ts +0 -1
  74. package/cssm/title/utils.js +0 -16
  75. package/cssm/title/utils.js.map +0 -1
  76. package/esm/title/utils.d.ts +0 -1
  77. package/esm/title/utils.js +0 -12
  78. package/esm/title/utils.js.map +0 -1
  79. package/modern/title/utils.d.ts +0 -1
  80. package/modern/title/utils.js +0 -12
  81. package/modern/title/utils.js.map +0 -1
  82. package/moderncssm/title/utils.d.ts +0 -1
  83. package/moderncssm/title/utils.js +0 -12
  84. package/moderncssm/title/utils.js.map +0 -1
  85. package/src/title/utils.ts +0 -14
  86. package/title/utils.d.ts +0 -1
  87. package/title/utils.js +0 -16
  88. package/title/utils.js.map +0 -1
package/colors.css CHANGED
@@ -20,63 +20,63 @@
20
20
  --color-static-text-tertiary-dark: rgba(5, 8, 29, 0.38);
21
21
  --color-static-text-tertiary-light: rgba(233, 233, 250, 0.37);
22
22
  }
23
- .typography__tertiary_1mf30 {
23
+ .typography__tertiary_1cimi {
24
24
  color: var(--color-light-text-tertiary);
25
25
  }
26
- .typography__disabled_1mf30 {
26
+ .typography__disabled_1cimi {
27
27
  color: var(--color-light-text-quaternary);
28
28
  }
29
- .typography__accent_1mf30 {
29
+ .typography__accent_1cimi {
30
30
  color: var(--color-light-accent-primary);
31
31
  }
32
- .typography__primary_1mf30 {
32
+ .typography__primary_1cimi {
33
33
  color: var(--color-light-text-primary);
34
34
  }
35
- .typography__attention_1mf30 {
35
+ .typography__attention_1cimi {
36
36
  color: var(--color-light-text-attention);
37
37
  }
38
- .typography__positive_1mf30 {
38
+ .typography__positive_1cimi {
39
39
  color: var(--color-light-text-positive);
40
40
  }
41
- .typography__secondary_1mf30 {
41
+ .typography__secondary_1cimi {
42
42
  color: var(--color-light-text-secondary);
43
43
  }
44
- .typography__tertiary-inverted_1mf30 {
44
+ .typography__tertiary-inverted_1cimi {
45
45
  color: var(--color-light-text-tertiary-inverted);
46
46
  }
47
- .typography__primary-inverted_1mf30 {
47
+ .typography__primary-inverted_1cimi {
48
48
  color: var(--color-light-text-primary-inverted);
49
49
  }
50
- .typography__secondary-inverted_1mf30 {
50
+ .typography__secondary-inverted_1cimi {
51
51
  color: var(--color-light-text-secondary-inverted);
52
52
  }
53
- .typography__link_1mf30 {
53
+ .typography__link_1cimi {
54
54
  color: var(--color-light-text-info);
55
55
  }
56
- .typography__negative_1mf30 {
56
+ .typography__negative_1cimi {
57
57
  color: var(--color-light-text-negative);
58
58
  }
59
- .typography__static-primary-light_1mf30 {
59
+ .typography__static-primary-light_1cimi {
60
60
  color: var(--color-static-text-primary-light);
61
61
  }
62
- .typography__static-secondary-light_1mf30 {
62
+ .typography__static-secondary-light_1cimi {
63
63
  color: var(--color-static-text-secondary-light);
64
64
  }
65
- .typography__static-tertiary-light_1mf30 {
65
+ .typography__static-tertiary-light_1cimi {
66
66
  color: var(--color-static-text-tertiary-light);
67
67
  }
68
- .typography__static-primary-dark_1mf30 {
68
+ .typography__static-primary-dark_1cimi {
69
69
  color: var(--color-static-text-primary-dark);
70
70
  }
71
- .typography__static-secondary-dark_1mf30 {
71
+ .typography__static-secondary-dark_1cimi {
72
72
  color: var(--color-static-text-secondary-dark);
73
73
  }
74
- .typography__static-tertiary-dark_1mf30 {
74
+ .typography__static-tertiary-dark_1cimi {
75
75
  color: var(--color-static-text-tertiary-dark);
76
76
  }
77
- .typography__static-accent_1mf30 {
77
+ .typography__static-accent_1cimi {
78
78
  color: var(--color-static-accent-primary);
79
79
  }
80
- .typography__static-positive_1mf30 {
80
+ .typography__static-positive_1cimi {
81
81
  color: var(--color-static-text-positive);
82
82
  }
@@ -2,7 +2,7 @@
2
2
 
3
3
  require('./colors.css');
4
4
 
5
- var colors = {"tertiary":"typography__tertiary_1mf30","disabled":"typography__disabled_1mf30","accent":"typography__accent_1mf30","primary":"typography__primary_1mf30","attention":"typography__attention_1mf30","positive":"typography__positive_1mf30","secondary":"typography__secondary_1mf30","tertiary-inverted":"typography__tertiary-inverted_1mf30","primary-inverted":"typography__primary-inverted_1mf30","secondary-inverted":"typography__secondary-inverted_1mf30","link":"typography__link_1mf30","negative":"typography__negative_1mf30","static-primary-light":"typography__static-primary-light_1mf30","static-secondary-light":"typography__static-secondary-light_1mf30","static-tertiary-light":"typography__static-tertiary-light_1mf30","static-primary-dark":"typography__static-primary-dark_1mf30","static-secondary-dark":"typography__static-secondary-dark_1mf30","static-tertiary-dark":"typography__static-tertiary-dark_1mf30","static-accent":"typography__static-accent_1mf30","static-positive":"typography__static-positive_1mf30"};
5
+ var colors = {"tertiary":"typography__tertiary_1cimi","disabled":"typography__disabled_1cimi","accent":"typography__accent_1cimi","primary":"typography__primary_1cimi","attention":"typography__attention_1cimi","positive":"typography__positive_1cimi","secondary":"typography__secondary_1cimi","tertiary-inverted":"typography__tertiary-inverted_1cimi","primary-inverted":"typography__primary-inverted_1cimi","secondary-inverted":"typography__secondary-inverted_1cimi","link":"typography__link_1cimi","negative":"typography__negative_1cimi","static-primary-light":"typography__static-primary-light_1cimi","static-secondary-light":"typography__static-secondary-light_1cimi","static-tertiary-light":"typography__static-tertiary-light_1cimi","static-primary-dark":"typography__static-primary-dark_1cimi","static-secondary-dark":"typography__static-secondary-dark_1cimi","static-tertiary-dark":"typography__static-tertiary-dark_1cimi","static-accent":"typography__static-accent_1cimi","static-positive":"typography__static-positive_1cimi"};
6
6
 
7
7
  module.exports = colors;
8
8
  //# sourceMappingURL=colors.module.css.js.map
@@ -3,8 +3,9 @@
3
3
  --gap-12: 12px;
4
4
  }
5
5
  :root {
6
- --font-family-system:
7
- system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Helvetica, sans-serif;
6
+ --font-family-alfasans:
7
+ 'Alfa Interface Sans', system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue',
8
+ Helvetica, sans-serif;
8
9
  }
9
10
  .transparent {
10
11
  opacity: 0;
@@ -24,13 +25,16 @@
24
25
  font-size: 16px;
25
26
  line-height: 20px;
26
27
  font-weight: 400;
27
- font-family: var(--font-family-system);
28
+ letter-spacing: -0.24px;
29
+ font-family: var(--font-family-alfasans);
28
30
  }
29
31
  .component.bold {
30
32
  font-weight: 700;
33
+ letter-spacing: 0.43px;
31
34
  }
32
35
  .component.medium {
33
36
  font-weight: 500;
37
+ letter-spacing: -0.05px;
34
38
  }
35
39
  .caps {
36
40
  font-size: 12px;
@@ -38,7 +42,7 @@
38
42
  font-weight: 400;
39
43
  letter-spacing: 1.25px;
40
44
  text-transform: uppercase;
41
- font-family: var(--font-family-system);
45
+ font-family: var(--font-family-alfasans);
42
46
  }
43
47
  .caps.bold {
44
48
  font-weight: 700;
@@ -52,7 +56,7 @@
52
56
  font-weight: 400;
53
57
  letter-spacing: 1.25px;
54
58
  text-transform: uppercase;
55
- font-family: var(--font-family-system);
59
+ font-family: var(--font-family-alfasans);
56
60
  }
57
61
  .tagline.bold {
58
62
  font-weight: 700;
@@ -64,97 +68,120 @@
64
68
  font-size: 18px;
65
69
  line-height: 24px;
66
70
  font-weight: 400;
67
- font-family: var(--font-family-system);
71
+ letter-spacing: -0.36px;
72
+ font-family: var(--font-family-alfasans);
68
73
  }
69
74
  .primary-large.bold {
70
75
  font-weight: 700;
76
+ letter-spacing: 0.38px;
71
77
  }
72
78
  .primary-large.medium {
73
79
  font-weight: 500;
80
+ letter-spacing: -0.17px;
74
81
  }
75
82
  .primary-medium {
76
83
  font-size: 16px;
77
84
  line-height: 24px;
78
85
  font-weight: 400;
79
- font-family: var(--font-family-system);
86
+ letter-spacing: -0.24px;
87
+ font-family: var(--font-family-alfasans);
80
88
  }
81
89
  .primary-medium.bold {
82
90
  font-weight: 700;
91
+ letter-spacing: 0.43px;
83
92
  }
84
93
  .primary-medium.medium {
85
94
  font-weight: 500;
95
+ letter-spacing: -0.05px;
86
96
  }
87
97
  .primary-small {
88
98
  font-size: 14px;
89
99
  line-height: 20px;
90
100
  font-weight: 400;
91
- font-family: var(--font-family-system);
101
+ letter-spacing: -0.08px;
102
+ font-family: var(--font-family-alfasans);
92
103
  }
93
104
  .primary-small.bold {
94
105
  font-weight: 700;
106
+ letter-spacing: 0.47px;
95
107
  }
96
108
  .primary-small.medium {
97
109
  font-weight: 500;
110
+ letter-spacing: 0.07px;
98
111
  }
99
112
  .component-primary {
100
113
  font-size: 16px;
101
114
  line-height: 20px;
102
115
  font-weight: 400;
103
- font-family: var(--font-family-system);
116
+ letter-spacing: -0.24px;
117
+ font-family: var(--font-family-alfasans);
104
118
  }
105
119
  .component-primary.bold {
106
120
  font-weight: 700;
121
+ letter-spacing: 0.43px;
107
122
  }
108
123
  .component-primary.medium {
109
124
  font-weight: 500;
125
+ letter-spacing: -0.05px;
110
126
  }
111
127
  .secondary-large {
112
128
  font-size: 13px;
113
129
  line-height: 16px;
114
130
  font-weight: 400;
115
- font-family: var(--font-family-system);
131
+ font-family: var(--font-family-alfasans);
116
132
  }
117
133
  .secondary-large.bold {
118
134
  font-weight: 700;
135
+ letter-spacing: 0.54px;
119
136
  }
120
137
  .secondary-large.medium {
121
138
  font-weight: 500;
139
+ letter-spacing: 0.13px;
122
140
  }
123
141
  .secondary-medium {
124
142
  font-size: 12px;
125
143
  line-height: 16px;
126
144
  font-weight: 400;
127
- font-family: var(--font-family-system);
145
+ letter-spacing: 0.06px;
146
+ font-family: var(--font-family-alfasans);
128
147
  }
129
148
  .secondary-medium.bold {
130
149
  font-weight: 700;
150
+ letter-spacing: 0.57px;
131
151
  }
132
152
  .secondary-medium.medium {
133
153
  font-weight: 500;
154
+ letter-spacing: 0.19px;
134
155
  }
135
156
  .secondary-small {
136
157
  font-size: 11px;
137
158
  line-height: 16px;
138
159
  font-weight: 400;
139
- font-family: var(--font-family-system);
160
+ letter-spacing: 0.15px;
161
+ font-family: var(--font-family-alfasans);
140
162
  }
141
163
  .secondary-small.bold {
142
164
  font-weight: 700;
165
+ letter-spacing: 0.54px;
143
166
  }
144
167
  .secondary-small.medium {
145
168
  font-weight: 500;
169
+ letter-spacing: 0.24px;
146
170
  }
147
171
  .component-secondary {
148
172
  font-size: 14px;
149
173
  line-height: 18px;
150
174
  font-weight: 400;
151
- font-family: var(--font-family-system);
175
+ letter-spacing: -0.08px;
176
+ font-family: var(--font-family-alfasans);
152
177
  }
153
178
  .component-secondary.bold {
154
179
  font-weight: 700;
180
+ letter-spacing: 0.47px;
155
181
  }
156
182
  .component-secondary.medium {
157
183
  font-weight: 500;
184
+ letter-spacing: 0.07px;
158
185
  }
159
186
  .rowLimit1 {
160
187
  -webkit-line-clamp: 1;
@@ -22,10 +22,7 @@ export type TitleProps = Omit<NativeProps, 'color'> & {
22
22
  /**
23
23
  * Шрифт текста
24
24
  */
25
- font?: 'styrene' | 'system' | 'alfasans' | {
26
- font: 'alfasans';
27
- systemCompat: boolean;
28
- };
25
+ font?: 'styrene' | 'system';
29
26
  /**
30
27
  * Добавляет отступы
31
28
  */
@@ -86,10 +83,7 @@ export declare const TitleBase: React.ForwardRefExoticComponent<Omit<NativeProps
86
83
  /**
87
84
  * Шрифт текста
88
85
  */
89
- font?: "styrene" | "system" | "alfasans" | {
90
- font: "alfasans";
91
- systemCompat: boolean;
92
- };
86
+ font?: "styrene" | "system";
93
87
  /**
94
88
  * Добавляет отступы
95
89
  */
@@ -6,9 +6,7 @@ var tslib = require('tslib');
6
6
  var React = require('react');
7
7
  var mergeRefs = require('react-merge-refs');
8
8
  var cn = require('classnames');
9
- var cssm = require('@alfalab/core-components-shared/cssm');
10
- var cssm$1 = require('@alfalab/core-components-skeleton/cssm');
11
- var utils = require('./utils.js');
9
+ var cssm = require('@alfalab/core-components-skeleton/cssm');
12
10
  var colors = require('../colors.module.css');
13
11
  var commonStyles = require('./common.module.css');
14
12
 
@@ -22,8 +20,8 @@ var commonStyles__default = /*#__PURE__*/_interopDefaultCompat(commonStyles);
22
20
 
23
21
  var TitleBase = React.forwardRef(function (_a, ref) {
24
22
  var _b;
25
- var _c = _a.tag, Component = _c === void 0 ? 'div' : _c, _d = _a.view, view = _d === void 0 ? 'medium' : _d, _e = _a.font, font = _e === void 0 ? 'styrene' : _e, platform = _a.platform, _f = _a.weight, weight = _f === void 0 ? utils.getDefaultWeight(cssm.isObject(font) ? font.font : font, platform) : _f, _g = _a.defaultMargins, defaultMargins = _g === void 0 ? false : _g, color = _a.color, className = _a.className, dataTestId = _a.dataTestId, children = _a.children, rowLimit = _a.rowLimit, styles = _a.styles, skeletonProps = _a.skeletonProps, showSkeleton = _a.showSkeleton, restProps = tslib.__rest(_a, ["tag", "view", "font", "platform", "weight", "defaultMargins", "color", "className", "dataTestId", "children", "rowLimit", "styles", "skeletonProps", "showSkeleton"]);
26
- var _h = cssm$1.useSkeleton(showSkeleton, skeletonProps), renderSkeleton = _h.renderSkeleton, textRef = _h.textRef;
23
+ var _c = _a.tag, Component = _c === void 0 ? 'div' : _c, _d = _a.view, view = _d === void 0 ? 'medium' : _d; _a.font; _a.platform; var _e = _a.weight, weight = _e === void 0 ? 'bold' : _e, _f = _a.defaultMargins, defaultMargins = _f === void 0 ? false : _f, color = _a.color, className = _a.className, dataTestId = _a.dataTestId, children = _a.children, rowLimit = _a.rowLimit, styles = _a.styles, skeletonProps = _a.skeletonProps, showSkeleton = _a.showSkeleton, restProps = tslib.__rest(_a, ["tag", "view", "font", "platform", "weight", "defaultMargins", "color", "className", "dataTestId", "children", "rowLimit", "styles", "skeletonProps", "showSkeleton"]);
24
+ var _g = cssm.useSkeleton(showSkeleton, skeletonProps), renderSkeleton = _g.renderSkeleton, textRef = _g.textRef;
27
25
  var skeleton = renderSkeleton({
28
26
  wrapperClassName: cn__default.default(defaultMargins && styles["margins-".concat(view)]),
29
27
  dataTestId: dataTestId,
@@ -34,7 +32,6 @@ var TitleBase = React.forwardRef(function (_a, ref) {
34
32
  return (React__default.default.createElement(Component, tslib.__assign({ className: cn__default.default(commonStyles__default.default.component, styles.component, className, styles["".concat(weight === 'regular' ? 'regular-' : '').concat(view)], defaultMargins && styles["margins-".concat(view)], color && colors__default.default[color], (_b = {},
35
33
  _b[commonStyles__default.default["rowLimit".concat(rowLimit)]] = rowLimit,
36
34
  _b[commonStyles__default.default.transparent] = showSkeleton,
37
- _b[styles.font] = (cssm.isObject(font) && !font.systemCompat) || !(font === 'system'),
38
35
  _b)), "data-test-id": dataTestId, ref: mergeRefs__default.default([ref, textRef]) }, restProps), children));
39
36
  });
40
37
 
@@ -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 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":["forwardRef","getDefaultWeight","isObject","__rest","useSkeleton","cn","React","__assign","commonStyles","colors","mergeRefs"],"mappings":";;;;;;;;;;;;;;;;;;;;;;IA4Fa,SAAS,GAAGA,gBAAU,CAC/B,UACI,EAgBC,EACD,GAAG,EAAA;;AAhBC,IAAA,IAAA,WAAsB,EAAjB,SAAS,GAAG,EAAA,KAAA,MAAA,GAAA,KAAK,KAAA,EACtB,EAAA,GAAA,EAAA,CAAA,IAAe,EAAf,IAAI,mBAAG,QAAQ,GAAA,EAAA,EACf,EAAgB,GAAA,EAAA,CAAA,IAAA,EAAhB,IAAI,GAAG,EAAA,KAAA,MAAA,GAAA,SAAS,GAAA,EAAA,EAChB,QAAQ,GAAA,EAAA,CAAA,QAAA,EACR,cAAsE,EAAtE,MAAM,mBAAGC,sBAAgB,CAACC,aAAQ,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC,IAAI,GAAG,IAAI,EAAE,QAAQ,CAAC,GAAA,EAAA,EACtE,sBAAsB,EAAtB,cAAc,GAAG,EAAA,KAAA,MAAA,GAAA,KAAK,KAAA,EACtB,KAAK,WAAA,EACL,SAAS,eAAA,EACT,UAAU,GAAA,EAAA,CAAA,UAAA,EACV,QAAQ,GAAA,EAAA,CAAA,QAAA,EACR,QAAQ,GAAA,EAAA,CAAA,QAAA,EACR,MAAM,GAAA,EAAA,CAA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AAU,EACxB,GAAG,EAAEQ,0BAAS,CAAC,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC,EAC1B,EAAA,SAAS,GAEZ,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 { 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":["forwardRef","__rest","useSkeleton","cn","React","__assign","commonStyles","colors","mergeRefs"],"mappings":";;;;;;;;;;;;;;;;;;;;IAyFa,SAAS,GAAGA,gBAAU,CAC/B,UACI,EAgBC,EACD,GAAG,EAAA;;AAhBC,IAAA,IAAA,EAAsB,GAAA,EAAA,CAAA,GAAA,CAAA,CAAjB,SAAS,GAAA,EAAA,KAAA,MAAA,GAAG,KAAK,GAAA,EAAA,CACtB,CAAA,EAAA,GAAA,EAAA,CAAA,IAAe,CAAf,CAAA,IAAI,GAAG,EAAA,KAAA,MAAA,GAAA,QAAQ,GAAA,EAAA,CAAA,CACX,EAAA,CAAA,IAAA,CACJ,CAAQ,EAAA,CAAA,QAAA,CAAA,KACR,EAAe,GAAA,EAAA,CAAA,MAAA,CAAA,CAAf,MAAM,GAAA,EAAA,KAAA,MAAA,GAAG,MAAM,GAAA,EAAA,CACf,CAAA,EAAA,GAAA,EAAA,CAAA,cAAsB,CAAtB,CAAA,cAAc,GAAG,EAAA,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CAAW,QAAQ,CAAE,CAAC,IAAG,QAAQ;AAC/C,YAAA,EAAA,CAACA,6BAAY,CAAC,WAAW,CAAA,GAAG,YAAY;AAE/C,YAAA,EAAA,EAAA,EAAA,cAAA,EACa,UAAU,EACxB,GAAG,EAAEE,0BAAS,CAAC,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC,EAC1B,EAAA,SAAS,GAEZ,QAAQ,CACD;AAEpB,CAAC;;;;"}
@@ -5,10 +5,7 @@ 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" | "alfasans" | {
9
- font: "alfasans";
10
- systemCompat: boolean;
11
- };
8
+ font?: "styrene" | "system";
12
9
  defaultMargins?: boolean;
13
10
  className?: string;
14
11
  dataTestId?: string;
@@ -6,131 +6,80 @@
6
6
  --gap-48: 48px;
7
7
  }
8
8
  :root {
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;
9
+ --font-family-alfasans:
10
+ 'Alfa Interface Sans', system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue',
11
+ Helvetica, sans-serif;
14
12
  }
15
13
  .xlarge {
16
14
  font-size: 48px;
17
15
  line-height: 52px;
18
16
  font-weight: 700;
19
- font-family: var(--font-family-system);
17
+ letter-spacing: 0.1px;
18
+ font-family: var(--font-family-alfasans);
20
19
  }
21
- .xlarge.font {
22
- line-height: 64px;
23
- font-weight: 500;
24
- font-feature-settings: 'ss01';
25
- font-family: var(--font-family-styrene);
26
- }
27
20
  .regular-xlarge {
28
21
  font-size: 48px;
29
22
  line-height: 52px;
30
23
  font-weight: 400;
31
- font-family: var(--font-family-system);
24
+ letter-spacing: -2.1px;
25
+ font-family: var(--font-family-alfasans);
32
26
  }
33
- .regular-xlarge.font {
34
- line-height: 64px;
35
- font-feature-settings: 'ss01';
36
- font-family: var(--font-family-styrene);
37
- }
38
27
  .large {
39
28
  font-size: 40px;
40
29
  line-height: 48px;
41
30
  font-weight: 700;
42
- font-family: var(--font-family-system);
31
+ letter-spacing: 0.1px;
32
+ font-family: var(--font-family-alfasans);
43
33
  }
44
- .large.font {
45
- font-weight: 500;
46
- font-feature-settings: 'ss01';
47
- font-family: var(--font-family-styrene);
48
- }
49
34
  .regular-large {
50
35
  font-size: 40px;
51
36
  line-height: 48px;
52
37
  font-weight: 400;
53
- font-family: var(--font-family-system);
38
+ letter-spacing: -1.7px;
39
+ font-family: var(--font-family-alfasans);
54
40
  }
55
- .regular-large.font {
56
- font-feature-settings: 'ss01';
57
- font-family: var(--font-family-styrene);
58
- }
59
41
  .medium {
60
42
  font-size: 30px;
61
43
  line-height: 36px;
62
44
  font-weight: 700;
63
- font-family: var(--font-family-system);
45
+ letter-spacing: 0.1px;
46
+ font-family: var(--font-family-alfasans);
64
47
  }
65
- .medium.font {
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
48
  .regular-medium {
73
49
  font-size: 30px;
74
50
  line-height: 36px;
75
51
  font-weight: 400;
76
- font-family: var(--font-family-system);
52
+ letter-spacing: -1.25px;
53
+ font-family: var(--font-family-alfasans);
77
54
  }
78
- .regular-medium.font {
79
- font-size: 32px;
80
- line-height: 40px;
81
- font-feature-settings: 'ss01';
82
- font-family: var(--font-family-styrene);
83
- }
84
55
  .small {
85
56
  font-size: 22px;
86
57
  line-height: 26px;
87
58
  font-weight: 700;
88
- font-family: var(--font-family-system);
59
+ letter-spacing: 0.2px;
60
+ font-family: var(--font-family-alfasans);
89
61
  }
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
62
  .regular-small {
98
63
  font-size: 22px;
99
64
  line-height: 26px;
100
65
  font-weight: 400;
101
- font-family: var(--font-family-system);
66
+ letter-spacing: -0.8px;
67
+ font-family: var(--font-family-alfasans);
102
68
  }
103
- .regular-small.font {
104
- font-size: 24px;
105
- line-height: 32px;
106
- font-feature-settings: 'ss01';
107
- font-family: var(--font-family-styrene);
108
- }
109
69
  .xsmall {
110
70
  font-size: 18px;
111
71
  line-height: 22px;
112
72
  font-weight: 700;
113
- font-family: var(--font-family-system);
73
+ letter-spacing: 0.38px;
74
+ font-family: var(--font-family-alfasans);
114
75
  }
115
- .xsmall.font {
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
76
  .regular-xsmall {
123
77
  font-size: 18px;
124
78
  line-height: 22px;
125
79
  font-weight: 400;
126
- font-family: var(--font-family-system);
80
+ letter-spacing: -0.36px;
81
+ font-family: var(--font-family-alfasans);
127
82
  }
128
- .regular-xsmall.font {
129
- font-size: 20px;
130
- line-height: 24px;
131
- font-feature-settings: 'ss01';
132
- font-family: var(--font-family-styrene);
133
- }
134
83
  .component.margins-xlarge {
135
84
  margin: var(--gap-0) var(--gap-0) var(--gap-24);
136
85
  }
@@ -4,10 +4,7 @@ export declare const TitleMobile: React.ForwardRefExoticComponent<Omit<React.HTM
4
4
  view?: "xlarge" | "large" | "medium" | "small" | "xsmall";
5
5
  color?: import("..").Color;
6
6
  weight?: "regular" | "medium" | "bold" | "semibold";
7
- font?: "styrene" | "system" | "alfasans" | {
8
- font: "alfasans";
9
- systemCompat: boolean;
10
- };
7
+ font?: "styrene" | "system";
11
8
  defaultMargins?: boolean;
12
9
  className?: string;
13
10
  dataTestId?: string;