@alfalab/core-components-typography 3.0.3 → 3.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/colors.css +13 -13
- package/{colors.module-2ba58573.d.ts → colors.module-0bde6fb8.d.ts} +0 -0
- package/{colors.module-2ba58573.js → colors.module-0bde6fb8.js} +1 -1
- package/common.module-38ff9d96.js +6 -0
- package/component.js +2 -2
- package/cssm/text/component.d.ts +12 -36
- package/cssm/text/component.js +6 -2
- package/cssm/text/index.module.css +5 -1
- package/cssm/title-mobile/component.js +6 -7
- package/cssm/title-mobile/index.module.css +2 -2
- package/cssm/title-responsive/component.js +6 -7
- package/cssm/title-responsive/index.module.css +1 -1
- package/esm/colors.css +13 -13
- package/esm/{colors.module-b694324b.d.ts → colors.module-ea6aa385.d.ts} +0 -0
- package/esm/{colors.module-b694324b.js → colors.module-ea6aa385.js} +1 -1
- package/esm/common.module-3d6e256f.js +4 -0
- package/esm/component.js +2 -2
- package/esm/index.js +2 -2
- package/esm/text/component.d.ts +12 -36
- package/esm/text/component.js +8 -4
- package/esm/text/index.css +19 -15
- package/esm/text/index.js +1 -1
- package/esm/title/common.css +5 -5
- package/esm/title/component.js +1 -1
- package/esm/title/index.css +19 -19
- package/esm/title/index.js +3 -3
- package/esm/title-mobile/component.js +9 -10
- package/esm/title-mobile/index.css +16 -16
- package/esm/title-mobile/index.js +2 -2
- package/esm/title-responsive/component.js +9 -10
- package/esm/title-responsive/index.css +42 -42
- package/esm/title-responsive/index.js +2 -2
- package/index.js +2 -2
- package/modern/colors.css +13 -13
- package/modern/colors.module-37ac527a.js +4 -0
- package/modern/common.module-3d6e256f.js +4 -0
- package/modern/component.js +2 -2
- package/modern/index.js +2 -2
- package/modern/text/component.d.ts +12 -36
- package/modern/text/component.js +7 -3
- package/modern/text/index.css +19 -15
- package/modern/text/index.js +1 -1
- package/modern/title/common.css +5 -5
- package/modern/title/component.js +1 -1
- package/modern/title/index.css +19 -19
- package/modern/title/index.js +3 -3
- package/modern/title-mobile/component.js +5 -5
- package/modern/title-mobile/index.css +16 -16
- package/modern/title-mobile/index.js +2 -2
- package/modern/title-responsive/component.js +5 -5
- package/modern/title-responsive/index.css +42 -42
- package/modern/title-responsive/index.js +2 -2
- package/package.json +1 -1
- package/send-stats.js +1 -1
- package/text/component.d.ts +12 -36
- package/text/component.js +8 -4
- package/text/index.css +19 -15
- package/text/index.js +1 -1
- package/title/common.css +5 -5
- package/title/component.js +1 -1
- package/title/index.css +19 -19
- package/title/index.js +3 -3
- package/title-mobile/component.js +9 -10
- package/title-mobile/index.css +16 -16
- package/title-mobile/index.js +2 -2
- package/title-responsive/component.js +9 -10
- package/title-responsive/index.css +42 -42
- package/title-responsive/index.js +2 -2
- package/common.module-c7b5f1ff.js +0 -6
- package/esm/common.module-6a9b5b80.js +0 -4
- package/modern/colors.module-3475616e.js +0 -4
- package/modern/common.module-6a9b5b80.js +0 -4
package/colors.css
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* hash:
|
|
1
|
+
/* hash: dph77 */
|
|
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
|
-
.
|
|
25
|
+
.typography__tertiary_v989w {
|
|
26
26
|
color: var(--color-light-text-tertiary);
|
|
27
27
|
}
|
|
28
|
-
.
|
|
28
|
+
.typography__disabled_v989w {
|
|
29
29
|
color: var(--color-light-text-disabled);
|
|
30
30
|
}
|
|
31
|
-
.
|
|
31
|
+
.typography__accent_v989w {
|
|
32
32
|
color: var(--color-light-text-accent);
|
|
33
33
|
}
|
|
34
|
-
.
|
|
34
|
+
.typography__primary_v989w {
|
|
35
35
|
color: var(--color-light-text-primary);
|
|
36
36
|
}
|
|
37
|
-
.
|
|
37
|
+
.typography__attention_v989w {
|
|
38
38
|
color: var(--color-light-text-attention);
|
|
39
39
|
}
|
|
40
|
-
.
|
|
40
|
+
.typography__positive_v989w {
|
|
41
41
|
color: var(--color-light-text-positive);
|
|
42
42
|
}
|
|
43
|
-
.
|
|
43
|
+
.typography__secondary_v989w {
|
|
44
44
|
color: var(--color-light-text-secondary);
|
|
45
45
|
}
|
|
46
|
-
.typography__tertiary-
|
|
46
|
+
.typography__tertiary-inverted_v989w {
|
|
47
47
|
color: var(--color-light-text-tertiary-inverted);
|
|
48
48
|
}
|
|
49
|
-
.typography__primary-
|
|
49
|
+
.typography__primary-inverted_v989w {
|
|
50
50
|
color: var(--color-light-text-primary-inverted);
|
|
51
51
|
}
|
|
52
|
-
.typography__secondary-
|
|
52
|
+
.typography__secondary-inverted_v989w {
|
|
53
53
|
color: var(--color-light-text-secondary-inverted);
|
|
54
54
|
}
|
|
55
|
-
.
|
|
55
|
+
.typography__link_v989w {
|
|
56
56
|
color: var(--color-light-text-link);
|
|
57
57
|
}
|
|
58
|
-
.
|
|
58
|
+
.typography__negative_v989w {
|
|
59
59
|
color: var(--color-light-text-negative);
|
|
60
60
|
}
|
|
File without changes
|
|
@@ -39,7 +39,7 @@ function __rest(s, e) {
|
|
|
39
39
|
return t;
|
|
40
40
|
}
|
|
41
41
|
|
|
42
|
-
var colors = {"tertiary":"
|
|
42
|
+
var colors = {"tertiary":"typography__tertiary_v989w","disabled":"typography__disabled_v989w","accent":"typography__accent_v989w","primary":"typography__primary_v989w","attention":"typography__attention_v989w","positive":"typography__positive_v989w","secondary":"typography__secondary_v989w","tertiary-inverted":"typography__tertiary-inverted_v989w","primary-inverted":"typography__primary-inverted_v989w","secondary-inverted":"typography__secondary-inverted_v989w","link":"typography__link_v989w","negative":"typography__negative_v989w"};
|
|
43
43
|
require('./colors.css')
|
|
44
44
|
|
|
45
45
|
exports.__rest = __rest;
|
package/component.js
CHANGED
|
@@ -2,12 +2,12 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
require('./colors.module-
|
|
5
|
+
require('./colors.module-0bde6fb8.js');
|
|
6
6
|
require('react');
|
|
7
7
|
require('classnames');
|
|
8
8
|
var text_component = require('./text/component.js');
|
|
9
9
|
require('./title/component.js');
|
|
10
|
-
require('./common.module-
|
|
10
|
+
require('./common.module-38ff9d96.js');
|
|
11
11
|
var title_index = require('./title/index.js');
|
|
12
12
|
var titleMobile_component = require('./title-mobile/component.js');
|
|
13
13
|
var titleResponsive_component = require('./title-responsive/component.js');
|
package/cssm/text/component.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ import React from 'react';
|
|
|
3
3
|
import { HTMLAttributes } from "react";
|
|
4
4
|
import { Color } from "../colors";
|
|
5
5
|
type NativeProps = HTMLAttributes<HTMLSpanElement>;
|
|
6
|
-
type
|
|
6
|
+
type TextBaseProps = {
|
|
7
7
|
/**
|
|
8
8
|
* [Вариант начертания](https://alfa-laboratory.github.io/core-components/master/?path=/docs/гайдлайны-типографика--page)
|
|
9
9
|
*/
|
|
@@ -23,7 +23,7 @@ type TextProps = Omit<NativeProps, 'color'> & {
|
|
|
23
23
|
/**
|
|
24
24
|
* HTML тег
|
|
25
25
|
*/
|
|
26
|
-
tag?: '
|
|
26
|
+
tag?: 'span' | 'div';
|
|
27
27
|
/**
|
|
28
28
|
* Css-класс для стилизации (native prop)
|
|
29
29
|
*/
|
|
@@ -36,40 +36,16 @@ type TextProps = Omit<NativeProps, 'color'> & {
|
|
|
36
36
|
* Контент (native prop)
|
|
37
37
|
*/
|
|
38
38
|
children?: React.ReactNode;
|
|
39
|
-
};
|
|
40
|
-
type TextElementType = HTMLParagraphElement | HTMLSpanElement | HTMLDivElement;
|
|
41
|
-
declare const Text: React.ForwardRefExoticComponent<Omit<NativeProps, "color"> & {
|
|
42
|
-
/**
|
|
43
|
-
* [Вариант начертания](https://alfa-laboratory.github.io/core-components/master/?path=/docs/гайдлайны-типографика--page)
|
|
44
|
-
*/
|
|
45
|
-
view?: "primary-large" | "primary-medium" | "primary-small" | "secondary-large" | "secondary-medium" | "secondary-small" | "component" | "caps" | undefined;
|
|
46
|
-
/**
|
|
47
|
-
* Цвет текста
|
|
48
|
-
*/
|
|
49
|
-
color?: "tertiary" | "disabled" | "accent" | "primary" | "attention" | "positive" | "secondary" | "tertiary-inverted" | "primary-inverted" | "secondary-inverted" | "link" | "negative" | undefined;
|
|
50
|
-
/**
|
|
51
|
-
* Толщина шрифта
|
|
52
|
-
*/
|
|
53
|
-
weight?: "regular" | "medium" | "bold" | undefined;
|
|
54
|
-
/**
|
|
55
|
-
* Делает цифры моноширинными
|
|
56
|
-
*/
|
|
57
|
-
monospaceNumbers?: boolean | undefined;
|
|
58
39
|
/**
|
|
59
|
-
*
|
|
60
|
-
*/
|
|
61
|
-
tag?: "p" | "span" | "div" | undefined;
|
|
62
|
-
/**
|
|
63
|
-
* Css-класс для стилизации (native prop)
|
|
64
|
-
*/
|
|
65
|
-
className?: string | undefined;
|
|
66
|
-
/**
|
|
67
|
-
* Id компонента для тестов
|
|
40
|
+
* Добавляет отступы к тэгу 'p'
|
|
68
41
|
*/
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
}
|
|
42
|
+
defaultMargins?: never;
|
|
43
|
+
};
|
|
44
|
+
type TextPTagProps = Omit<TextBaseProps, 'tag' | 'defaultMargins'> & {
|
|
45
|
+
tag?: 'p';
|
|
46
|
+
defaultMargins?: boolean;
|
|
47
|
+
};
|
|
48
|
+
type TextProps = Omit<NativeProps, 'color'> & (TextBaseProps | TextPTagProps);
|
|
49
|
+
type TextElementType = HTMLParagraphElement | HTMLSpanElement | HTMLDivElement;
|
|
50
|
+
declare const Text: React.ForwardRefExoticComponent<TextProps & React.RefAttributes<TextElementType>>;
|
|
75
51
|
export { TextProps, Text };
|
package/cssm/text/component.js
CHANGED
|
@@ -17,8 +17,12 @@ var styles__default = /*#__PURE__*/_interopDefaultLegacy(styles);
|
|
|
17
17
|
|
|
18
18
|
var Text = React.forwardRef(function (_a, ref) {
|
|
19
19
|
var _b;
|
|
20
|
-
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, color = _a.color, className = _a.className, dataTestId = _a.dataTestId, children = _a.children, restProps = tslib_es6.__rest(_a, ["view", "tag", "weight", "monospaceNumbers", "color", "className", "dataTestId", "children"]);
|
|
21
|
-
return (React__default['default'].createElement(Component, tslib_es6.__assign({ className: cn__default['default']((_b = {},
|
|
20
|
+
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"]);
|
|
21
|
+
return (React__default['default'].createElement(Component, tslib_es6.__assign({ className: cn__default['default']((_b = {},
|
|
22
|
+
_b[styles__default['default'].paragraph] = Component === 'p' && !defaultMargins,
|
|
23
|
+
_b[styles__default['default'].paragraphWithMargins] = Component === 'p' && defaultMargins,
|
|
24
|
+
_b[styles__default['default'].monospace] = monospaceNumbers,
|
|
25
|
+
_b), className, color && colors__default['default'][color], styles__default['default'][view], weight && styles__default['default'][weight]), "data-test-id": dataTestId, ref: ref }, restProps), children));
|
|
22
26
|
});
|
|
23
27
|
|
|
24
28
|
exports.Text = Text;
|
|
@@ -13,8 +13,12 @@
|
|
|
13
13
|
--text-paragraph-margin-bottom: 0 0 var(--gap-s);
|
|
14
14
|
}
|
|
15
15
|
.paragraph {
|
|
16
|
-
margin:
|
|
16
|
+
margin: 0;
|
|
17
|
+
padding: 0;
|
|
18
|
+
}
|
|
19
|
+
.paragraphWithMargins {
|
|
17
20
|
padding: 0;
|
|
21
|
+
margin: var(--text-paragraph-margin-bottom);
|
|
18
22
|
}
|
|
19
23
|
.primary-large {
|
|
20
24
|
font-size: 18px;
|
|
@@ -16,12 +16,11 @@ var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
|
16
16
|
var commonStyles__default = /*#__PURE__*/_interopDefaultLegacy(commonStyles);
|
|
17
17
|
var styles__default = /*#__PURE__*/_interopDefaultLegacy(styles);
|
|
18
18
|
|
|
19
|
-
var TitleMobile = function (props) {
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
};
|
|
19
|
+
var TitleMobile = function (props) { return (
|
|
20
|
+
/**
|
|
21
|
+
* Если поменять Object.assign на деструктуризацию, то упадут тесты.
|
|
22
|
+
* Видимо, это особенность работы jest и css-modules.
|
|
23
|
+
*/
|
|
24
|
+
React__default['default'].createElement(title_component.Title, tslib_es6.__assign({}, props, { styles: Object.assign(commonStyles__default['default'], styles__default['default']) }))); };
|
|
26
25
|
|
|
27
26
|
exports.TitleMobile = TitleMobile;
|
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
}
|
|
41
41
|
.styrene-xsmall {
|
|
42
42
|
font-size: 16px;
|
|
43
|
-
line-height:
|
|
43
|
+
line-height: 20px;
|
|
44
44
|
font-weight: 500;
|
|
45
45
|
font-feature-settings: 'ss01';
|
|
46
46
|
font-family: var(--font-family-styrene);
|
|
@@ -67,7 +67,7 @@
|
|
|
67
67
|
}
|
|
68
68
|
.system-xsmall {
|
|
69
69
|
font-size: 16px;
|
|
70
|
-
line-height:
|
|
70
|
+
line-height: 20px;
|
|
71
71
|
font-weight: 600;
|
|
72
72
|
}
|
|
73
73
|
.bold {
|
|
@@ -16,12 +16,11 @@ var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
|
16
16
|
var commonStyles__default = /*#__PURE__*/_interopDefaultLegacy(commonStyles);
|
|
17
17
|
var styles__default = /*#__PURE__*/_interopDefaultLegacy(styles);
|
|
18
18
|
|
|
19
|
-
var TitleResponsive = function (props) {
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
};
|
|
19
|
+
var TitleResponsive = function (props) { return (
|
|
20
|
+
/**
|
|
21
|
+
* Если поменять Object.assign на деструктуризацию, то упадут тесты.
|
|
22
|
+
* Видимо, это особенность работы jest и css-modules.
|
|
23
|
+
*/
|
|
24
|
+
React__default['default'].createElement(title_component.Title, tslib_es6.__assign({}, props, { styles: Object.assign(commonStyles__default['default'], styles__default['default']) }))); };
|
|
26
25
|
|
|
27
26
|
exports.TitleResponsive = TitleResponsive;
|
package/esm/colors.css
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* hash:
|
|
1
|
+
/* hash: dph77 */
|
|
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
|
-
.
|
|
25
|
+
.typography__tertiary_v989w {
|
|
26
26
|
color: var(--color-light-text-tertiary);
|
|
27
27
|
}
|
|
28
|
-
.
|
|
28
|
+
.typography__disabled_v989w {
|
|
29
29
|
color: var(--color-light-text-disabled);
|
|
30
30
|
}
|
|
31
|
-
.
|
|
31
|
+
.typography__accent_v989w {
|
|
32
32
|
color: var(--color-light-text-accent);
|
|
33
33
|
}
|
|
34
|
-
.
|
|
34
|
+
.typography__primary_v989w {
|
|
35
35
|
color: var(--color-light-text-primary);
|
|
36
36
|
}
|
|
37
|
-
.
|
|
37
|
+
.typography__attention_v989w {
|
|
38
38
|
color: var(--color-light-text-attention);
|
|
39
39
|
}
|
|
40
|
-
.
|
|
40
|
+
.typography__positive_v989w {
|
|
41
41
|
color: var(--color-light-text-positive);
|
|
42
42
|
}
|
|
43
|
-
.
|
|
43
|
+
.typography__secondary_v989w {
|
|
44
44
|
color: var(--color-light-text-secondary);
|
|
45
45
|
}
|
|
46
|
-
.typography__tertiary-
|
|
46
|
+
.typography__tertiary-inverted_v989w {
|
|
47
47
|
color: var(--color-light-text-tertiary-inverted);
|
|
48
48
|
}
|
|
49
|
-
.typography__primary-
|
|
49
|
+
.typography__primary-inverted_v989w {
|
|
50
50
|
color: var(--color-light-text-primary-inverted);
|
|
51
51
|
}
|
|
52
|
-
.typography__secondary-
|
|
52
|
+
.typography__secondary-inverted_v989w {
|
|
53
53
|
color: var(--color-light-text-secondary-inverted);
|
|
54
54
|
}
|
|
55
|
-
.
|
|
55
|
+
.typography__link_v989w {
|
|
56
56
|
color: var(--color-light-text-link);
|
|
57
57
|
}
|
|
58
|
-
.
|
|
58
|
+
.typography__negative_v989w {
|
|
59
59
|
color: var(--color-light-text-negative);
|
|
60
60
|
}
|
|
File without changes
|
|
@@ -37,7 +37,7 @@ function __rest(s, e) {
|
|
|
37
37
|
return t;
|
|
38
38
|
}
|
|
39
39
|
|
|
40
|
-
var colors = {"tertiary":"
|
|
40
|
+
var colors = {"tertiary":"typography__tertiary_v989w","disabled":"typography__disabled_v989w","accent":"typography__accent_v989w","primary":"typography__primary_v989w","attention":"typography__attention_v989w","positive":"typography__positive_v989w","secondary":"typography__secondary_v989w","tertiary-inverted":"typography__tertiary-inverted_v989w","primary-inverted":"typography__primary-inverted_v989w","secondary-inverted":"typography__secondary-inverted_v989w","link":"typography__link_v989w","negative":"typography__negative_v989w"};
|
|
41
41
|
require('./colors.css')
|
|
42
42
|
|
|
43
43
|
export { __assign as _, __rest as a, colors as c };
|
package/esm/component.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import './colors.module-
|
|
1
|
+
import './colors.module-ea6aa385.js';
|
|
2
2
|
import 'react';
|
|
3
3
|
import 'classnames';
|
|
4
4
|
import { Text } from './text/component.js';
|
|
5
5
|
import './title/component.js';
|
|
6
|
-
import './common.module-
|
|
6
|
+
import './common.module-3d6e256f.js';
|
|
7
7
|
import { Title } from './title/index.js';
|
|
8
8
|
import { TitleMobile } from './title-mobile/component.js';
|
|
9
9
|
import { TitleResponsive } from './title-responsive/component.js';
|
package/esm/index.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import './colors.module-
|
|
1
|
+
import './colors.module-ea6aa385.js';
|
|
2
2
|
import 'react';
|
|
3
3
|
import 'classnames';
|
|
4
4
|
import './text/component.js';
|
|
5
5
|
import './title/component.js';
|
|
6
|
-
import './common.module-
|
|
6
|
+
import './common.module-3d6e256f.js';
|
|
7
7
|
import './title/index.js';
|
|
8
8
|
import './title-mobile/component.js';
|
|
9
9
|
import './title-responsive/component.js';
|
package/esm/text/component.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ import React from 'react';
|
|
|
3
3
|
import { HTMLAttributes } from "react";
|
|
4
4
|
import { Color } from "../colors";
|
|
5
5
|
type NativeProps = HTMLAttributes<HTMLSpanElement>;
|
|
6
|
-
type
|
|
6
|
+
type TextBaseProps = {
|
|
7
7
|
/**
|
|
8
8
|
* [Вариант начертания](https://alfa-laboratory.github.io/core-components/master/?path=/docs/гайдлайны-типографика--page)
|
|
9
9
|
*/
|
|
@@ -23,7 +23,7 @@ type TextProps = Omit<NativeProps, 'color'> & {
|
|
|
23
23
|
/**
|
|
24
24
|
* HTML тег
|
|
25
25
|
*/
|
|
26
|
-
tag?: '
|
|
26
|
+
tag?: 'span' | 'div';
|
|
27
27
|
/**
|
|
28
28
|
* Css-класс для стилизации (native prop)
|
|
29
29
|
*/
|
|
@@ -36,40 +36,16 @@ type TextProps = Omit<NativeProps, 'color'> & {
|
|
|
36
36
|
* Контент (native prop)
|
|
37
37
|
*/
|
|
38
38
|
children?: React.ReactNode;
|
|
39
|
-
};
|
|
40
|
-
type TextElementType = HTMLParagraphElement | HTMLSpanElement | HTMLDivElement;
|
|
41
|
-
declare const Text: React.ForwardRefExoticComponent<Omit<NativeProps, "color"> & {
|
|
42
|
-
/**
|
|
43
|
-
* [Вариант начертания](https://alfa-laboratory.github.io/core-components/master/?path=/docs/гайдлайны-типографика--page)
|
|
44
|
-
*/
|
|
45
|
-
view?: "primary-large" | "primary-medium" | "primary-small" | "secondary-large" | "secondary-medium" | "secondary-small" | "component" | "caps" | undefined;
|
|
46
|
-
/**
|
|
47
|
-
* Цвет текста
|
|
48
|
-
*/
|
|
49
|
-
color?: "tertiary" | "disabled" | "accent" | "primary" | "attention" | "positive" | "secondary" | "tertiary-inverted" | "primary-inverted" | "secondary-inverted" | "link" | "negative" | undefined;
|
|
50
|
-
/**
|
|
51
|
-
* Толщина шрифта
|
|
52
|
-
*/
|
|
53
|
-
weight?: "regular" | "medium" | "bold" | undefined;
|
|
54
|
-
/**
|
|
55
|
-
* Делает цифры моноширинными
|
|
56
|
-
*/
|
|
57
|
-
monospaceNumbers?: boolean | undefined;
|
|
58
39
|
/**
|
|
59
|
-
*
|
|
60
|
-
*/
|
|
61
|
-
tag?: "p" | "span" | "div" | undefined;
|
|
62
|
-
/**
|
|
63
|
-
* Css-класс для стилизации (native prop)
|
|
64
|
-
*/
|
|
65
|
-
className?: string | undefined;
|
|
66
|
-
/**
|
|
67
|
-
* Id компонента для тестов
|
|
40
|
+
* Добавляет отступы к тэгу 'p'
|
|
68
41
|
*/
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
}
|
|
42
|
+
defaultMargins?: never;
|
|
43
|
+
};
|
|
44
|
+
type TextPTagProps = Omit<TextBaseProps, 'tag' | 'defaultMargins'> & {
|
|
45
|
+
tag?: 'p';
|
|
46
|
+
defaultMargins?: boolean;
|
|
47
|
+
};
|
|
48
|
+
type TextProps = Omit<NativeProps, 'color'> & (TextBaseProps | TextPTagProps);
|
|
49
|
+
type TextElementType = HTMLParagraphElement | HTMLSpanElement | HTMLDivElement;
|
|
50
|
+
declare const Text: React.ForwardRefExoticComponent<TextProps & React.RefAttributes<TextElementType>>;
|
|
75
51
|
export { TextProps, Text };
|
package/esm/text/component.js
CHANGED
|
@@ -1,14 +1,18 @@
|
|
|
1
|
-
import { a as __rest, _ as __assign, c as colors } from '../colors.module-
|
|
1
|
+
import { a as __rest, _ as __assign, c as colors } from '../colors.module-ea6aa385.js';
|
|
2
2
|
import React, { forwardRef } from 'react';
|
|
3
3
|
import cn from 'classnames';
|
|
4
4
|
|
|
5
|
-
var styles = {"paragraph":"
|
|
5
|
+
var styles = {"paragraph":"typography__paragraph_8kho6","paragraphWithMargins":"typography__paragraphWithMargins_8kho6","primary-large":"typography__primary-large_8kho6","primary-medium":"typography__primary-medium_8kho6","primary-small":"typography__primary-small_8kho6","secondary-large":"typography__secondary-large_8kho6","secondary-medium":"typography__secondary-medium_8kho6","secondary-small":"typography__secondary-small_8kho6","component":"typography__component_8kho6","caps":"typography__caps_8kho6","bold":"typography__bold_8kho6","medium":"typography__medium_8kho6","regular":"typography__regular_8kho6","monospace":"typography__monospace_8kho6"};
|
|
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, color = _a.color, className = _a.className, dataTestId = _a.dataTestId, children = _a.children, restProps = __rest(_a, ["view", "tag", "weight", "monospaceNumbers", "color", "className", "dataTestId", "children"]);
|
|
11
|
-
return (React.createElement(Component, __assign({ className: cn((_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"]);
|
|
11
|
+
return (React.createElement(Component, __assign({ className: cn((_b = {},
|
|
12
|
+
_b[styles.paragraph] = Component === 'p' && !defaultMargins,
|
|
13
|
+
_b[styles.paragraphWithMargins] = Component === 'p' && defaultMargins,
|
|
14
|
+
_b[styles.monospace] = monospaceNumbers,
|
|
15
|
+
_b), className, color && colors[color], styles[view], weight && styles[weight]), "data-test-id": dataTestId, ref: ref }, restProps), children));
|
|
12
16
|
});
|
|
13
17
|
|
|
14
18
|
export { Text };
|
package/esm/text/index.css
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* hash:
|
|
1
|
+
/* hash: hxyle */
|
|
2
2
|
:root {
|
|
3
3
|
|
|
4
4
|
/* Hard */
|
|
@@ -13,62 +13,66 @@
|
|
|
13
13
|
:root {
|
|
14
14
|
--text-paragraph-margin-bottom: 0 0 var(--gap-s);
|
|
15
15
|
}
|
|
16
|
-
.
|
|
17
|
-
margin:
|
|
16
|
+
.typography__paragraph_8kho6 {
|
|
17
|
+
margin: 0;
|
|
18
|
+
padding: 0;
|
|
19
|
+
}
|
|
20
|
+
.typography__paragraphWithMargins_8kho6 {
|
|
18
21
|
padding: 0;
|
|
22
|
+
margin: var(--text-paragraph-margin-bottom);
|
|
19
23
|
}
|
|
20
|
-
.typography__primary-
|
|
24
|
+
.typography__primary-large_8kho6 {
|
|
21
25
|
font-size: 18px;
|
|
22
26
|
line-height: 24px;
|
|
23
27
|
font-weight: 400;
|
|
24
28
|
}
|
|
25
|
-
.typography__primary-
|
|
29
|
+
.typography__primary-medium_8kho6 {
|
|
26
30
|
font-size: 16px;
|
|
27
31
|
line-height: 24px;
|
|
28
32
|
font-weight: 400;
|
|
29
33
|
}
|
|
30
|
-
.typography__primary-
|
|
34
|
+
.typography__primary-small_8kho6 {
|
|
31
35
|
font-size: 14px;
|
|
32
36
|
line-height: 20px;
|
|
33
37
|
font-weight: 400;
|
|
34
38
|
}
|
|
35
|
-
.typography__secondary-
|
|
39
|
+
.typography__secondary-large_8kho6 {
|
|
36
40
|
font-size: 13px;
|
|
37
41
|
line-height: 16px;
|
|
38
42
|
font-weight: 400;
|
|
39
43
|
}
|
|
40
|
-
.typography__secondary-
|
|
44
|
+
.typography__secondary-medium_8kho6 {
|
|
41
45
|
font-size: 12px;
|
|
42
46
|
line-height: 16px;
|
|
43
47
|
font-weight: 400;
|
|
44
48
|
}
|
|
45
|
-
.typography__secondary-
|
|
49
|
+
.typography__secondary-small_8kho6 {
|
|
46
50
|
font-size: 11px;
|
|
47
51
|
line-height: 16px;
|
|
48
52
|
font-weight: 400;
|
|
49
53
|
}
|
|
50
|
-
.
|
|
54
|
+
.typography__component_8kho6 {
|
|
51
55
|
font-size: 16px;
|
|
52
56
|
line-height: 20px;
|
|
53
57
|
font-weight: 400;
|
|
54
58
|
}
|
|
55
|
-
.
|
|
59
|
+
.typography__caps_8kho6 {
|
|
56
60
|
font-size: 12px;
|
|
57
61
|
line-height: 16px;
|
|
58
62
|
font-weight: 500;
|
|
59
63
|
letter-spacing: 1.25px;
|
|
60
64
|
text-transform: uppercase;
|
|
61
65
|
}
|
|
62
|
-
.
|
|
66
|
+
.typography__bold_8kho6 {
|
|
63
67
|
font-weight: bold;
|
|
64
68
|
}
|
|
65
|
-
.
|
|
69
|
+
.typography__medium_8kho6 {
|
|
66
70
|
font-weight: 500;
|
|
67
71
|
}
|
|
68
|
-
.
|
|
72
|
+
.typography__regular_8kho6 {
|
|
69
73
|
font-weight: normal;
|
|
70
74
|
}
|
|
71
|
-
.
|
|
75
|
+
.typography__monospace_8kho6 {
|
|
72
76
|
font-feature-settings: "tnum";
|
|
73
77
|
font-variant-numeric: tabular-nums;
|
|
74
78
|
}
|
package/esm/text/index.js
CHANGED
package/esm/title/common.css
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
/* hash:
|
|
2
|
-
.
|
|
1
|
+
/* hash: 1dgyo */
|
|
2
|
+
.typography__component_8rne9 {
|
|
3
3
|
margin: 0;
|
|
4
4
|
padding: 0;
|
|
5
5
|
}
|
|
6
6
|
|
|
7
|
-
.
|
|
7
|
+
.typography__bold_8rne9 {
|
|
8
8
|
font-weight: bold;
|
|
9
9
|
}
|
|
10
10
|
|
|
11
|
-
.
|
|
11
|
+
.typography__medium_8rne9 {
|
|
12
12
|
font-weight: 500;
|
|
13
13
|
}
|
|
14
14
|
|
|
15
|
-
.
|
|
15
|
+
.typography__regular_8rne9 {
|
|
16
16
|
font-weight: normal;
|
|
17
17
|
}
|
package/esm/title/component.js
CHANGED