@alfalab/core-components-typography 3.0.8 → 3.1.0

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 (73) hide show
  1. package/colors.css +13 -13
  2. package/{colors.module-0b2b700f.d.ts → colors.module-bc993287.d.ts} +0 -0
  3. package/{colors.module-0b2b700f.js → colors.module-bc993287.js} +1 -1
  4. package/common.module-0a9ad0fb.js +6 -0
  5. package/component.js +2 -2
  6. package/cssm/text/component.d.ts +5 -1
  7. package/cssm/text/component.js +2 -1
  8. package/cssm/text/index.module.css +19 -0
  9. package/cssm/title/component.d.ts +10 -2
  10. package/cssm/title/component.js +3 -2
  11. package/cssm/title/index.module.css +19 -0
  12. package/esm/colors.css +13 -13
  13. package/esm/{colors.module-3225ad5e.d.ts → colors.module-42065957.d.ts} +0 -0
  14. package/esm/{colors.module-3225ad5e.js → colors.module-42065957.js} +1 -1
  15. package/esm/common.module-cc423fc9.js +4 -0
  16. package/esm/component.js +2 -2
  17. package/esm/index.js +2 -2
  18. package/esm/text/component.d.ts +5 -1
  19. package/esm/text/component.js +4 -3
  20. package/esm/text/index.css +34 -15
  21. package/esm/text/index.js +1 -1
  22. package/esm/title/common.css +5 -5
  23. package/esm/title/component.d.ts +10 -2
  24. package/esm/title/component.js +4 -3
  25. package/esm/title/index.css +35 -16
  26. package/esm/title/index.js +3 -3
  27. package/esm/title-mobile/component.js +3 -3
  28. package/esm/title-mobile/index.css +11 -11
  29. package/esm/title-mobile/index.js +2 -2
  30. package/esm/title-responsive/component.js +3 -3
  31. package/esm/title-responsive/index.css +41 -41
  32. package/esm/title-responsive/index.js +2 -2
  33. package/index.js +2 -2
  34. package/modern/colors.css +13 -13
  35. package/modern/colors.module-cbb33ea7.js +4 -0
  36. package/modern/common.module-13ae7781.js +4 -0
  37. package/modern/component.js +2 -2
  38. package/modern/index.js +2 -2
  39. package/modern/text/component.d.ts +5 -1
  40. package/modern/text/component.js +4 -3
  41. package/modern/text/index.css +34 -15
  42. package/modern/text/index.js +1 -1
  43. package/modern/title/common.css +5 -5
  44. package/modern/title/component.d.ts +10 -2
  45. package/modern/title/component.js +2 -2
  46. package/modern/title/index.css +35 -16
  47. package/modern/title/index.js +3 -3
  48. package/modern/title-mobile/component.js +3 -3
  49. package/modern/title-mobile/index.css +11 -11
  50. package/modern/title-mobile/index.js +2 -2
  51. package/modern/title-responsive/component.js +3 -3
  52. package/modern/title-responsive/index.css +41 -41
  53. package/modern/title-responsive/index.js +2 -2
  54. package/package.json +1 -1
  55. package/text/component.d.ts +5 -1
  56. package/text/component.js +4 -3
  57. package/text/index.css +34 -15
  58. package/text/index.js +1 -1
  59. package/title/common.css +5 -5
  60. package/title/component.d.ts +10 -2
  61. package/title/component.js +4 -3
  62. package/title/index.css +35 -16
  63. package/title/index.js +3 -3
  64. package/title-mobile/component.js +3 -3
  65. package/title-mobile/index.css +11 -11
  66. package/title-mobile/index.js +2 -2
  67. package/title-responsive/component.js +3 -3
  68. package/title-responsive/index.css +41 -41
  69. package/title-responsive/index.js +2 -2
  70. package/common.module-8d29fea6.js +0 -6
  71. package/esm/common.module-88c2056e.js +0 -4
  72. package/modern/colors.module-748605fe.js +0 -4
  73. package/modern/common.module-8ec5ed89.js +0 -4
package/colors.css CHANGED
@@ -1,4 +1,4 @@
1
- /* hash: 1fg47 */
1
+ /* hash: i62g2 */
2
2
  :root {
3
3
  --color-light-text-accent: #ef3124;
4
4
  --color-light-text-attention: #de6a00;
@@ -22,39 +22,39 @@
22
22
  /* Hard up */
23
23
  }
24
24
  /* colors */
25
- .typography__tertiary_1lljz {
25
+ .typography__tertiary_5mg9e {
26
26
  color: var(--color-light-text-tertiary);
27
27
  }
28
- .typography__disabled_1lljz {
28
+ .typography__disabled_5mg9e {
29
29
  color: var(--color-light-text-disabled);
30
30
  }
31
- .typography__accent_1lljz {
31
+ .typography__accent_5mg9e {
32
32
  color: var(--color-light-text-accent);
33
33
  }
34
- .typography__primary_1lljz {
34
+ .typography__primary_5mg9e {
35
35
  color: var(--color-light-text-primary);
36
36
  }
37
- .typography__attention_1lljz {
37
+ .typography__attention_5mg9e {
38
38
  color: var(--color-light-text-attention);
39
39
  }
40
- .typography__positive_1lljz {
40
+ .typography__positive_5mg9e {
41
41
  color: var(--color-light-text-positive);
42
42
  }
43
- .typography__secondary_1lljz {
43
+ .typography__secondary_5mg9e {
44
44
  color: var(--color-light-text-secondary);
45
45
  }
46
- .typography__tertiary-inverted_1lljz {
46
+ .typography__tertiary-inverted_5mg9e {
47
47
  color: var(--color-light-text-tertiary-inverted);
48
48
  }
49
- .typography__primary-inverted_1lljz {
49
+ .typography__primary-inverted_5mg9e {
50
50
  color: var(--color-light-text-primary-inverted);
51
51
  }
52
- .typography__secondary-inverted_1lljz {
52
+ .typography__secondary-inverted_5mg9e {
53
53
  color: var(--color-light-text-secondary-inverted);
54
54
  }
55
- .typography__link_1lljz {
55
+ .typography__link_5mg9e {
56
56
  color: var(--color-light-text-link);
57
57
  }
58
- .typography__negative_1lljz {
58
+ .typography__negative_5mg9e {
59
59
  color: var(--color-light-text-negative);
60
60
  }
@@ -39,7 +39,7 @@ function __rest(s, e) {
39
39
  return t;
40
40
  }
41
41
 
42
- var colors = {"tertiary":"typography__tertiary_1lljz","disabled":"typography__disabled_1lljz","accent":"typography__accent_1lljz","primary":"typography__primary_1lljz","attention":"typography__attention_1lljz","positive":"typography__positive_1lljz","secondary":"typography__secondary_1lljz","tertiary-inverted":"typography__tertiary-inverted_1lljz","primary-inverted":"typography__primary-inverted_1lljz","secondary-inverted":"typography__secondary-inverted_1lljz","link":"typography__link_1lljz","negative":"typography__negative_1lljz"};
42
+ var colors = {"tertiary":"typography__tertiary_5mg9e","disabled":"typography__disabled_5mg9e","accent":"typography__accent_5mg9e","primary":"typography__primary_5mg9e","attention":"typography__attention_5mg9e","positive":"typography__positive_5mg9e","secondary":"typography__secondary_5mg9e","tertiary-inverted":"typography__tertiary-inverted_5mg9e","primary-inverted":"typography__primary-inverted_5mg9e","secondary-inverted":"typography__secondary-inverted_5mg9e","link":"typography__link_5mg9e","negative":"typography__negative_5mg9e"};
43
43
  require('./colors.css')
44
44
 
45
45
  exports.__rest = __rest;
@@ -0,0 +1,6 @@
1
+ 'use strict';
2
+
3
+ var commonStyles = {"component":"typography__component_1c381","bold":"typography__bold_1c381","medium":"typography__medium_1c381","regular":"typography__regular_1c381"};
4
+ require('./title/common.css')
5
+
6
+ exports.commonStyles = commonStyles;
package/component.js CHANGED
@@ -4,11 +4,11 @@ var text_component = require('./text/component.js');
4
4
  var title_index = require('./title/index.js');
5
5
  var titleMobile_component = require('./title-mobile/component.js');
6
6
  var titleResponsive_component = require('./title-responsive/component.js');
7
- require('./colors.module-0b2b700f.js');
7
+ require('./colors.module-bc993287.js');
8
8
  require('react');
9
9
  require('classnames');
10
10
  require('./title/component.js');
11
- require('./common.module-8d29fea6.js');
11
+ require('./common.module-0a9ad0fb.js');
12
12
 
13
13
  var Typography = {
14
14
  Title: title_index.Title,
@@ -6,7 +6,7 @@ import { TextElementType } from "../types";
6
6
  type NativeProps = HTMLAttributes<HTMLSpanElement>;
7
7
  type TextBaseProps = {
8
8
  /**
9
- * [Вариант начертания](https://core-ds.github.io/core-components/master/?path=/docs/инструкции-типографика--page)
9
+ * [Вариант начертания](https://core-ds.github.io/core-components/master/?path=/docs/guidelines-typography--page)
10
10
  */
11
11
  view?: 'primary-large' | 'primary-medium' | 'primary-small' | 'secondary-large' | 'secondary-medium' | 'secondary-small' | 'component' | 'caps';
12
12
  /**
@@ -41,6 +41,10 @@ type TextBaseProps = {
41
41
  * Добавляет отступы к тэгу 'p'
42
42
  */
43
43
  defaultMargins?: never;
44
+ /**
45
+ * Количество строк (не поддерживает IE)
46
+ */
47
+ rowLimit?: 1 | 2 | 3;
44
48
  };
45
49
  type TextPTagProps = Omit<TextBaseProps, 'tag' | 'defaultMargins'> & {
46
50
  tag?: 'p';
@@ -15,11 +15,12 @@ var styles__default = /*#__PURE__*/_interopDefaultCompat(styles);
15
15
 
16
16
  var Text = React.forwardRef(function (_a, ref) {
17
17
  var _b;
18
- var _c = _a.view, view = _c === void 0 ? 'primary-medium' : _c, _d = _a.tag, Component = _d === void 0 ? 'span' : _d, weight = _a.weight, _e = _a.monospaceNumbers, monospaceNumbers = _e === void 0 ? false : _e, _f = _a.defaultMargins, defaultMargins = _f === void 0 ? true : _f, color = _a.color, className = _a.className, dataTestId = _a.dataTestId, children = _a.children, restProps = tslib_es6.__rest(_a, ["view", "tag", "weight", "monospaceNumbers", "defaultMargins", "color", "className", "dataTestId", "children"]);
18
+ var _c = _a.view, view = _c === void 0 ? 'primary-medium' : _c, _d = _a.tag, Component = _d === void 0 ? 'span' : _d, weight = _a.weight, _e = _a.monospaceNumbers, monospaceNumbers = _e === void 0 ? false : _e, _f = _a.defaultMargins, defaultMargins = _f === void 0 ? true : _f, color = _a.color, className = _a.className, dataTestId = _a.dataTestId, children = _a.children, rowLimit = _a.rowLimit, restProps = tslib_es6.__rest(_a, ["view", "tag", "weight", "monospaceNumbers", "defaultMargins", "color", "className", "dataTestId", "children", "rowLimit"]);
19
19
  return (React__default.default.createElement(Component, tslib_es6.__assign({ className: cn__default.default((_b = {},
20
20
  _b[styles__default.default.paragraph] = Component === 'p' && !defaultMargins,
21
21
  _b[styles__default.default.paragraphWithMargins] = Component === 'p' && defaultMargins,
22
22
  _b[styles__default.default.monospace] = monospaceNumbers,
23
+ _b[styles__default.default["rowLimit".concat(rowLimit)]] = rowLimit,
23
24
  _b), className, color && colors__default.default[color], styles__default.default[view], weight && styles__default.default[weight]), "data-test-id": dataTestId, ref: ref }, restProps), children));
24
25
  });
25
26
 
@@ -75,3 +75,22 @@
75
75
  font-feature-settings: "tnum";
76
76
  font-variant-numeric: tabular-nums;
77
77
  }
78
+ .rowLimit1 {
79
+ -webkit-line-clamp: 1;
80
+ display: -webkit-box;
81
+ -webkit-box-orient: vertical;
82
+ overflow: hidden;
83
+ word-break: break-all;
84
+ }
85
+ .rowLimit2 {
86
+ -webkit-line-clamp: 2;
87
+ display: -webkit-box;
88
+ -webkit-box-orient: vertical;
89
+ overflow: hidden;
90
+ }
91
+ .rowLimit3 {
92
+ -webkit-line-clamp: 3;
93
+ display: -webkit-box;
94
+ -webkit-box-orient: vertical;
95
+ overflow: hidden;
96
+ }
@@ -9,7 +9,7 @@ type TitleProps = Omit<NativeProps, 'color'> & {
9
9
  */
10
10
  tag: 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6' | 'div';
11
11
  /**
12
- * [Вариант начертания](https://core-ds.github.io/core-components/master/?path=/docs/инструкции-типографика--page)
12
+ * [Вариант начертания](https://core-ds.github.io/core-components/master/?path=/docs/guidelines-typography--page)
13
13
  */
14
14
  view?: 'xlarge' | 'large' | 'medium' | 'small' | 'xsmall';
15
15
  /**
@@ -40,6 +40,10 @@ type TitleProps = Omit<NativeProps, 'color'> & {
40
40
  * Контент (native prop)
41
41
  */
42
42
  children?: React.ReactNode;
43
+ /**
44
+ * Количество строк (не поддерживает IE)
45
+ */
46
+ rowLimit?: 1 | 2 | 3;
43
47
  };
44
48
  type Styles = {
45
49
  styles: {
@@ -53,7 +57,7 @@ declare const Title: React.ForwardRefExoticComponent<Omit<NativeProps, "color">
53
57
  */
54
58
  tag: 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6' | 'div';
55
59
  /**
56
- * [Вариант начертания](https://core-ds.github.io/core-components/master/?path=/docs/инструкции-типографика--page)
60
+ * [Вариант начертания](https://core-ds.github.io/core-components/master/?path=/docs/guidelines-typography--page)
57
61
  */
58
62
  view?: "medium" | "xlarge" | "large" | "small" | "xsmall" | undefined;
59
63
  /**
@@ -84,5 +88,9 @@ declare const Title: React.ForwardRefExoticComponent<Omit<NativeProps, "color">
84
88
  * Контент (native prop)
85
89
  */
86
90
  children?: React.ReactNode;
91
+ /**
92
+ * Количество строк (не поддерживает IE)
93
+ */
94
+ rowLimit?: 1 | 2 | 3 | undefined;
87
95
  } & Styles & React.RefAttributes<TitleElementType>>;
88
96
  export { TitleProps, Title };
@@ -12,8 +12,9 @@ var cn__default = /*#__PURE__*/_interopDefaultCompat(cn);
12
12
  var colors__default = /*#__PURE__*/_interopDefaultCompat(colors);
13
13
 
14
14
  var Title = React.forwardRef(function (_a, ref) {
15
- var _b = _a.tag, Component = _b === void 0 ? 'div' : _b, _c = _a.view, view = _c === void 0 ? 'medium' : _c, _d = _a.font, font = _d === void 0 ? 'styrene' : _d, _e = _a.weight, weight = _e === void 0 ? font === 'styrene' ? 'medium' : 'bold' : _e, _f = _a.defaultMargins, defaultMargins = _f === void 0 ? false : _f, color = _a.color, className = _a.className, dataTestId = _a.dataTestId, children = _a.children, styles = _a.styles, restProps = tslib_es6.__rest(_a, ["tag", "view", "font", "weight", "defaultMargins", "color", "className", "dataTestId", "children", "styles"]);
16
- return (React__default.default.createElement(Component, tslib_es6.__assign({ className: cn__default.default(styles.component, className, styles["".concat(font, "-").concat(view)], defaultMargins && styles["margins-".concat(view)], styles[weight], color && colors__default.default[color]), "data-test-id": dataTestId, ref: ref }, restProps), children));
15
+ var _b;
16
+ 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, _f = _a.weight, weight = _f === void 0 ? font === 'styrene' ? 'medium' : 'bold' : _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, restProps = tslib_es6.__rest(_a, ["tag", "view", "font", "weight", "defaultMargins", "color", "className", "dataTestId", "children", "rowLimit", "styles"]);
17
+ return (React__default.default.createElement(Component, tslib_es6.__assign({ className: cn__default.default(styles.component, className, styles["".concat(font, "-").concat(view)], defaultMargins && styles["margins-".concat(view)], styles[weight], color && colors__default.default[color], (_b = {}, _b[styles["rowLimit".concat(rowLimit)]] = rowLimit, _b)), "data-test-id": dataTestId, ref: ref }, restProps), children));
17
18
  });
18
19
 
19
20
  exports.Title = Title;
@@ -91,3 +91,22 @@
91
91
  .margins-xsmall {
92
92
  margin: var(--gap-3xl) 0 var(--gap-m);
93
93
  }
94
+ .rowLimit1 {
95
+ -webkit-line-clamp: 1;
96
+ display: -webkit-box;
97
+ -webkit-box-orient: vertical;
98
+ overflow: hidden;
99
+ word-break: break-all;
100
+ }
101
+ .rowLimit2 {
102
+ -webkit-line-clamp: 2;
103
+ display: -webkit-box;
104
+ -webkit-box-orient: vertical;
105
+ overflow: hidden;
106
+ }
107
+ .rowLimit3 {
108
+ -webkit-line-clamp: 3;
109
+ display: -webkit-box;
110
+ -webkit-box-orient: vertical;
111
+ overflow: hidden;
112
+ }
package/esm/colors.css CHANGED
@@ -1,4 +1,4 @@
1
- /* hash: 1fg47 */
1
+ /* hash: i62g2 */
2
2
  :root {
3
3
  --color-light-text-accent: #ef3124;
4
4
  --color-light-text-attention: #de6a00;
@@ -22,39 +22,39 @@
22
22
  /* Hard up */
23
23
  }
24
24
  /* colors */
25
- .typography__tertiary_1lljz {
25
+ .typography__tertiary_5mg9e {
26
26
  color: var(--color-light-text-tertiary);
27
27
  }
28
- .typography__disabled_1lljz {
28
+ .typography__disabled_5mg9e {
29
29
  color: var(--color-light-text-disabled);
30
30
  }
31
- .typography__accent_1lljz {
31
+ .typography__accent_5mg9e {
32
32
  color: var(--color-light-text-accent);
33
33
  }
34
- .typography__primary_1lljz {
34
+ .typography__primary_5mg9e {
35
35
  color: var(--color-light-text-primary);
36
36
  }
37
- .typography__attention_1lljz {
37
+ .typography__attention_5mg9e {
38
38
  color: var(--color-light-text-attention);
39
39
  }
40
- .typography__positive_1lljz {
40
+ .typography__positive_5mg9e {
41
41
  color: var(--color-light-text-positive);
42
42
  }
43
- .typography__secondary_1lljz {
43
+ .typography__secondary_5mg9e {
44
44
  color: var(--color-light-text-secondary);
45
45
  }
46
- .typography__tertiary-inverted_1lljz {
46
+ .typography__tertiary-inverted_5mg9e {
47
47
  color: var(--color-light-text-tertiary-inverted);
48
48
  }
49
- .typography__primary-inverted_1lljz {
49
+ .typography__primary-inverted_5mg9e {
50
50
  color: var(--color-light-text-primary-inverted);
51
51
  }
52
- .typography__secondary-inverted_1lljz {
52
+ .typography__secondary-inverted_5mg9e {
53
53
  color: var(--color-light-text-secondary-inverted);
54
54
  }
55
- .typography__link_1lljz {
55
+ .typography__link_5mg9e {
56
56
  color: var(--color-light-text-link);
57
57
  }
58
- .typography__negative_1lljz {
58
+ .typography__negative_5mg9e {
59
59
  color: var(--color-light-text-negative);
60
60
  }
@@ -37,7 +37,7 @@ function __rest(s, e) {
37
37
  return t;
38
38
  }
39
39
 
40
- var colors = {"tertiary":"typography__tertiary_1lljz","disabled":"typography__disabled_1lljz","accent":"typography__accent_1lljz","primary":"typography__primary_1lljz","attention":"typography__attention_1lljz","positive":"typography__positive_1lljz","secondary":"typography__secondary_1lljz","tertiary-inverted":"typography__tertiary-inverted_1lljz","primary-inverted":"typography__primary-inverted_1lljz","secondary-inverted":"typography__secondary-inverted_1lljz","link":"typography__link_1lljz","negative":"typography__negative_1lljz"};
40
+ var colors = {"tertiary":"typography__tertiary_5mg9e","disabled":"typography__disabled_5mg9e","accent":"typography__accent_5mg9e","primary":"typography__primary_5mg9e","attention":"typography__attention_5mg9e","positive":"typography__positive_5mg9e","secondary":"typography__secondary_5mg9e","tertiary-inverted":"typography__tertiary-inverted_5mg9e","primary-inverted":"typography__primary-inverted_5mg9e","secondary-inverted":"typography__secondary-inverted_5mg9e","link":"typography__link_5mg9e","negative":"typography__negative_5mg9e"};
41
41
  require('./colors.css')
42
42
 
43
43
  export { __rest as _, __assign as a, colors as c };
@@ -0,0 +1,4 @@
1
+ var commonStyles = {"component":"typography__component_1c381","bold":"typography__bold_1c381","medium":"typography__medium_1c381","regular":"typography__regular_1c381"};
2
+ require('./title/common.css')
3
+
4
+ export { commonStyles as c };
package/esm/component.js CHANGED
@@ -2,11 +2,11 @@ import { Text } from './text/component.js';
2
2
  import { Title } from './title/index.js';
3
3
  import { TitleMobile } from './title-mobile/component.js';
4
4
  import { TitleResponsive } from './title-responsive/component.js';
5
- import './colors.module-3225ad5e.js';
5
+ import './colors.module-42065957.js';
6
6
  import 'react';
7
7
  import 'classnames';
8
8
  import './title/component.js';
9
- import './common.module-88c2056e.js';
9
+ import './common.module-cc423fc9.js';
10
10
 
11
11
  var Typography = {
12
12
  Title: Title,
package/esm/index.js CHANGED
@@ -1,11 +1,11 @@
1
1
  export { Typography } from './component.js';
2
2
  export { typographyPresets } from './presets.js';
3
3
  import './text/component.js';
4
- import './colors.module-3225ad5e.js';
4
+ import './colors.module-42065957.js';
5
5
  import 'react';
6
6
  import 'classnames';
7
7
  import './title/index.js';
8
8
  import './title/component.js';
9
- import './common.module-88c2056e.js';
9
+ import './common.module-cc423fc9.js';
10
10
  import './title-mobile/component.js';
11
11
  import './title-responsive/component.js';
@@ -6,7 +6,7 @@ import { TextElementType } from "../types";
6
6
  type NativeProps = HTMLAttributes<HTMLSpanElement>;
7
7
  type TextBaseProps = {
8
8
  /**
9
- * [Вариант начертания](https://core-ds.github.io/core-components/master/?path=/docs/инструкции-типографика--page)
9
+ * [Вариант начертания](https://core-ds.github.io/core-components/master/?path=/docs/guidelines-typography--page)
10
10
  */
11
11
  view?: 'primary-large' | 'primary-medium' | 'primary-small' | 'secondary-large' | 'secondary-medium' | 'secondary-small' | 'component' | 'caps';
12
12
  /**
@@ -41,6 +41,10 @@ type TextBaseProps = {
41
41
  * Добавляет отступы к тэгу 'p'
42
42
  */
43
43
  defaultMargins?: never;
44
+ /**
45
+ * Количество строк (не поддерживает IE)
46
+ */
47
+ rowLimit?: 1 | 2 | 3;
44
48
  };
45
49
  type TextPTagProps = Omit<TextBaseProps, 'tag' | 'defaultMargins'> & {
46
50
  tag?: 'p';
@@ -1,17 +1,18 @@
1
- import { _ as __rest, a as __assign, c as colors } from '../colors.module-3225ad5e.js';
1
+ import { _ as __rest, a as __assign, c as colors } from '../colors.module-42065957.js';
2
2
  import React, { forwardRef } from 'react';
3
3
  import cn from 'classnames';
4
4
 
5
- var styles = {"paragraph":"typography__paragraph_1tplp","paragraphWithMargins":"typography__paragraphWithMargins_1tplp","primary-large":"typography__primary-large_1tplp","primary-medium":"typography__primary-medium_1tplp","primary-small":"typography__primary-small_1tplp","secondary-large":"typography__secondary-large_1tplp","secondary-medium":"typography__secondary-medium_1tplp","secondary-small":"typography__secondary-small_1tplp","component":"typography__component_1tplp","caps":"typography__caps_1tplp","bold":"typography__bold_1tplp","medium":"typography__medium_1tplp","regular":"typography__regular_1tplp","monospace":"typography__monospace_1tplp"};
5
+ var styles = {"paragraph":"typography__paragraph_9xfoj","paragraphWithMargins":"typography__paragraphWithMargins_9xfoj","primary-large":"typography__primary-large_9xfoj","primary-medium":"typography__primary-medium_9xfoj","primary-small":"typography__primary-small_9xfoj","secondary-large":"typography__secondary-large_9xfoj","secondary-medium":"typography__secondary-medium_9xfoj","secondary-small":"typography__secondary-small_9xfoj","component":"typography__component_9xfoj","caps":"typography__caps_9xfoj","bold":"typography__bold_9xfoj","medium":"typography__medium_9xfoj","regular":"typography__regular_9xfoj","monospace":"typography__monospace_9xfoj","rowLimit1":"typography__rowLimit1_9xfoj","rowLimit2":"typography__rowLimit2_9xfoj","rowLimit3":"typography__rowLimit3_9xfoj"};
6
6
  require('./index.css')
7
7
 
8
8
  var Text = forwardRef(function (_a, ref) {
9
9
  var _b;
10
- var _c = _a.view, view = _c === void 0 ? 'primary-medium' : _c, _d = _a.tag, Component = _d === void 0 ? 'span' : _d, weight = _a.weight, _e = _a.monospaceNumbers, monospaceNumbers = _e === void 0 ? false : _e, _f = _a.defaultMargins, defaultMargins = _f === void 0 ? true : _f, color = _a.color, className = _a.className, dataTestId = _a.dataTestId, children = _a.children, restProps = __rest(_a, ["view", "tag", "weight", "monospaceNumbers", "defaultMargins", "color", "className", "dataTestId", "children"]);
10
+ var _c = _a.view, view = _c === void 0 ? 'primary-medium' : _c, _d = _a.tag, Component = _d === void 0 ? 'span' : _d, weight = _a.weight, _e = _a.monospaceNumbers, monospaceNumbers = _e === void 0 ? false : _e, _f = _a.defaultMargins, defaultMargins = _f === void 0 ? true : _f, color = _a.color, className = _a.className, dataTestId = _a.dataTestId, children = _a.children, rowLimit = _a.rowLimit, restProps = __rest(_a, ["view", "tag", "weight", "monospaceNumbers", "defaultMargins", "color", "className", "dataTestId", "children", "rowLimit"]);
11
11
  return (React.createElement(Component, __assign({ className: cn((_b = {},
12
12
  _b[styles.paragraph] = Component === 'p' && !defaultMargins,
13
13
  _b[styles.paragraphWithMargins] = Component === 'p' && defaultMargins,
14
14
  _b[styles.monospace] = monospaceNumbers,
15
+ _b[styles["rowLimit".concat(rowLimit)]] = rowLimit,
15
16
  _b), className, color && colors[color], styles[view], weight && styles[weight]), "data-test-id": dataTestId, ref: ref }, restProps), children));
16
17
  });
17
18
 
@@ -1,4 +1,4 @@
1
- /* hash: 155x3 */
1
+ /* hash: meju9 */
2
2
  :root {
3
3
 
4
4
  /* Hard */
@@ -13,66 +13,85 @@
13
13
  :root {
14
14
  --text-paragraph-margin-bottom: 0 0 var(--gap-s);
15
15
  }
16
- .typography__paragraph_1tplp {
16
+ .typography__paragraph_9xfoj {
17
17
  margin: 0;
18
18
  padding: 0;
19
19
  }
20
- .typography__paragraphWithMargins_1tplp {
20
+ .typography__paragraphWithMargins_9xfoj {
21
21
  padding: 0;
22
22
  margin: var(--text-paragraph-margin-bottom);
23
23
  }
24
- .typography__primary-large_1tplp {
24
+ .typography__primary-large_9xfoj {
25
25
  font-size: 18px;
26
26
  line-height: 24px;
27
27
  font-weight: 400;
28
28
  }
29
- .typography__primary-medium_1tplp {
29
+ .typography__primary-medium_9xfoj {
30
30
  font-size: 16px;
31
31
  line-height: 24px;
32
32
  font-weight: 400;
33
33
  }
34
- .typography__primary-small_1tplp {
34
+ .typography__primary-small_9xfoj {
35
35
  font-size: 14px;
36
36
  line-height: 20px;
37
37
  font-weight: 400;
38
38
  }
39
- .typography__secondary-large_1tplp {
39
+ .typography__secondary-large_9xfoj {
40
40
  font-size: 13px;
41
41
  line-height: 16px;
42
42
  font-weight: 400;
43
43
  }
44
- .typography__secondary-medium_1tplp {
44
+ .typography__secondary-medium_9xfoj {
45
45
  font-size: 12px;
46
46
  line-height: 16px;
47
47
  font-weight: 400;
48
48
  }
49
- .typography__secondary-small_1tplp {
49
+ .typography__secondary-small_9xfoj {
50
50
  font-size: 11px;
51
51
  line-height: 16px;
52
52
  font-weight: 400;
53
53
  }
54
- .typography__component_1tplp {
54
+ .typography__component_9xfoj {
55
55
  font-size: 16px;
56
56
  line-height: 20px;
57
57
  font-weight: 400;
58
58
  }
59
- .typography__caps_1tplp {
59
+ .typography__caps_9xfoj {
60
60
  font-size: 12px;
61
61
  line-height: 16px;
62
62
  font-weight: 500;
63
63
  letter-spacing: 1.25px;
64
64
  text-transform: uppercase;
65
65
  }
66
- .typography__bold_1tplp {
66
+ .typography__bold_9xfoj {
67
67
  font-weight: bold;
68
68
  }
69
- .typography__medium_1tplp {
69
+ .typography__medium_9xfoj {
70
70
  font-weight: 500;
71
71
  }
72
- .typography__regular_1tplp {
72
+ .typography__regular_9xfoj {
73
73
  font-weight: normal;
74
74
  }
75
- .typography__monospace_1tplp {
75
+ .typography__monospace_9xfoj {
76
76
  font-feature-settings: "tnum";
77
77
  font-variant-numeric: tabular-nums;
78
78
  }
79
+ .typography__rowLimit1_9xfoj {
80
+ -webkit-line-clamp: 1;
81
+ display: -webkit-box;
82
+ -webkit-box-orient: vertical;
83
+ overflow: hidden;
84
+ word-break: break-all;
85
+ }
86
+ .typography__rowLimit2_9xfoj {
87
+ -webkit-line-clamp: 2;
88
+ display: -webkit-box;
89
+ -webkit-box-orient: vertical;
90
+ overflow: hidden;
91
+ }
92
+ .typography__rowLimit3_9xfoj {
93
+ -webkit-line-clamp: 3;
94
+ display: -webkit-box;
95
+ -webkit-box-orient: vertical;
96
+ overflow: hidden;
97
+ }
package/esm/text/index.js CHANGED
@@ -1,4 +1,4 @@
1
1
  export { Text } from './component.js';
2
- import '../colors.module-3225ad5e.js';
2
+ import '../colors.module-42065957.js';
3
3
  import 'react';
4
4
  import 'classnames';
@@ -1,14 +1,14 @@
1
- /* hash: 1e1i4 */
2
- .typography__component_1tml6 {
1
+ /* hash: 190df */
2
+ .typography__component_1c381 {
3
3
  margin: 0;
4
4
  padding: 0
5
5
  }
6
- .typography__component_1tml6.typography__bold_1tml6 {
6
+ .typography__component_1c381.typography__bold_1c381 {
7
7
  font-weight: bold;
8
8
  }
9
- .typography__component_1tml6.typography__medium_1tml6 {
9
+ .typography__component_1c381.typography__medium_1c381 {
10
10
  font-weight: 500;
11
11
  }
12
- .typography__component_1tml6.typography__regular_1tml6 {
12
+ .typography__component_1c381.typography__regular_1c381 {
13
13
  font-weight: normal;
14
14
  }
@@ -9,7 +9,7 @@ type TitleProps = Omit<NativeProps, 'color'> & {
9
9
  */
10
10
  tag: 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6' | 'div';
11
11
  /**
12
- * [Вариант начертания](https://core-ds.github.io/core-components/master/?path=/docs/инструкции-типографика--page)
12
+ * [Вариант начертания](https://core-ds.github.io/core-components/master/?path=/docs/guidelines-typography--page)
13
13
  */
14
14
  view?: 'xlarge' | 'large' | 'medium' | 'small' | 'xsmall';
15
15
  /**
@@ -40,6 +40,10 @@ type TitleProps = Omit<NativeProps, 'color'> & {
40
40
  * Контент (native prop)
41
41
  */
42
42
  children?: React.ReactNode;
43
+ /**
44
+ * Количество строк (не поддерживает IE)
45
+ */
46
+ rowLimit?: 1 | 2 | 3;
43
47
  };
44
48
  type Styles = {
45
49
  styles: {
@@ -53,7 +57,7 @@ declare const Title: React.ForwardRefExoticComponent<Omit<NativeProps, "color">
53
57
  */
54
58
  tag: 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6' | 'div';
55
59
  /**
56
- * [Вариант начертания](https://core-ds.github.io/core-components/master/?path=/docs/инструкции-типографика--page)
60
+ * [Вариант начертания](https://core-ds.github.io/core-components/master/?path=/docs/guidelines-typography--page)
57
61
  */
58
62
  view?: "medium" | "xlarge" | "large" | "small" | "xsmall" | undefined;
59
63
  /**
@@ -84,5 +88,9 @@ declare const Title: React.ForwardRefExoticComponent<Omit<NativeProps, "color">
84
88
  * Контент (native prop)
85
89
  */
86
90
  children?: React.ReactNode;
91
+ /**
92
+ * Количество строк (не поддерживает IE)
93
+ */
94
+ rowLimit?: 1 | 2 | 3 | undefined;
87
95
  } & Styles & React.RefAttributes<TitleElementType>>;
88
96
  export { TitleProps, Title };
@@ -1,10 +1,11 @@
1
- import { _ as __rest, a as __assign, c as colors } from '../colors.module-3225ad5e.js';
1
+ import { _ as __rest, a as __assign, c as colors } from '../colors.module-42065957.js';
2
2
  import React, { forwardRef } from 'react';
3
3
  import cn from 'classnames';
4
4
 
5
5
  var Title = forwardRef(function (_a, ref) {
6
- var _b = _a.tag, Component = _b === void 0 ? 'div' : _b, _c = _a.view, view = _c === void 0 ? 'medium' : _c, _d = _a.font, font = _d === void 0 ? 'styrene' : _d, _e = _a.weight, weight = _e === void 0 ? font === 'styrene' ? 'medium' : 'bold' : _e, _f = _a.defaultMargins, defaultMargins = _f === void 0 ? false : _f, color = _a.color, className = _a.className, dataTestId = _a.dataTestId, children = _a.children, styles = _a.styles, restProps = __rest(_a, ["tag", "view", "font", "weight", "defaultMargins", "color", "className", "dataTestId", "children", "styles"]);
7
- return (React.createElement(Component, __assign({ className: cn(styles.component, className, styles["".concat(font, "-").concat(view)], defaultMargins && styles["margins-".concat(view)], styles[weight], color && colors[color]), "data-test-id": dataTestId, ref: ref }, restProps), children));
6
+ var _b;
7
+ 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, _f = _a.weight, weight = _f === void 0 ? font === 'styrene' ? 'medium' : 'bold' : _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, restProps = __rest(_a, ["tag", "view", "font", "weight", "defaultMargins", "color", "className", "dataTestId", "children", "rowLimit", "styles"]);
8
+ return (React.createElement(Component, __assign({ className: cn(styles.component, className, styles["".concat(font, "-").concat(view)], defaultMargins && styles["margins-".concat(view)], styles[weight], color && colors[color], (_b = {}, _b[styles["rowLimit".concat(rowLimit)]] = rowLimit, _b)), "data-test-id": dataTestId, ref: ref }, restProps), children));
8
9
  });
9
10
 
10
11
  export { Title };