@alfalab/core-components-typography 6.0.13 → 6.0.14-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.
- package/colors.css +20 -20
- package/colors.module.css.js +1 -1
- package/cssm/text/component.js +18 -16
- package/cssm/text/component.js.map +1 -1
- package/cssm/text/index.module.css +48 -14
- package/cssm/title/common.module.css +8 -1
- package/cssm/title/component.d.ts +2 -8
- package/cssm/title/component.js +16 -17
- package/cssm/title/component.js.map +1 -1
- package/cssm/title/index.d.ts +1 -4
- package/cssm/title/index.module.css +23 -74
- package/cssm/title-mobile/component.d.ts +1 -4
- package/cssm/title-mobile/index.module.css +28 -45
- package/cssm/title-responsive/component.d.ts +1 -4
- package/esm/colors.css +20 -20
- package/esm/colors.module.css.js +1 -1
- package/esm/text/component.js +19 -17
- package/esm/text/component.js.map +1 -1
- package/esm/text/index.css +88 -54
- package/esm/text/index.module.css.js +1 -1
- package/esm/text/index.module.css.js.map +1 -1
- package/esm/title/common.css +13 -6
- package/esm/title/common.module.css.js +1 -1
- package/esm/title/common.module.css.js.map +1 -1
- package/esm/title/component.d.ts +2 -8
- package/esm/title/component.js +16 -17
- package/esm/title/component.js.map +1 -1
- package/esm/title/index.css +38 -89
- package/esm/title/index.d.ts +1 -4
- package/esm/title/index.module.css.js +1 -1
- package/esm/title/index.module.css.js.map +1 -1
- package/esm/title-mobile/component.d.ts +1 -4
- package/esm/title-mobile/index.css +53 -70
- package/esm/title-mobile/index.module.css.js +1 -1
- package/esm/title-responsive/component.d.ts +1 -4
- package/modern/colors.css +20 -20
- package/modern/colors.module.css.js +1 -1
- package/modern/text/component.js +19 -17
- package/modern/text/component.js.map +1 -1
- package/modern/text/index.css +88 -54
- package/modern/text/index.module.css.js +1 -1
- package/modern/text/index.module.css.js.map +1 -1
- package/modern/title/common.css +13 -6
- package/modern/title/common.module.css.js +1 -1
- package/modern/title/common.module.css.js.map +1 -1
- package/modern/title/component.d.ts +2 -8
- package/modern/title/component.js +15 -16
- package/modern/title/component.js.map +1 -1
- package/modern/title/index.css +38 -89
- package/modern/title/index.d.ts +1 -4
- package/modern/title/index.module.css.js +1 -1
- package/modern/title/index.module.css.js.map +1 -1
- package/modern/title-mobile/component.d.ts +1 -4
- package/modern/title-mobile/index.css +53 -70
- package/modern/title-mobile/index.module.css.js +1 -1
- package/modern/title-responsive/component.d.ts +1 -4
- package/moderncssm/text/component.js +19 -17
- package/moderncssm/text/component.js.map +1 -1
- package/moderncssm/text/index.module.css +47 -12
- package/moderncssm/title/common.module.css +10 -1
- package/moderncssm/title/component.d.ts +2 -8
- package/moderncssm/title/component.js +15 -16
- package/moderncssm/title/component.js.map +1 -1
- package/moderncssm/title/index.d.ts +1 -4
- package/moderncssm/title/index.module.css +20 -79
- package/moderncssm/title-mobile/component.d.ts +1 -4
- package/moderncssm/title-mobile/index.module.css +25 -40
- package/moderncssm/title-responsive/component.d.ts +1 -4
- package/package.json +6 -6
- package/src/common.module.css +10 -1
- package/src/text/component.tsx +36 -31
- package/src/title/component.tsx +36 -36
- package/src/title/index.module.css +0 -8
- package/text/component.js +18 -16
- package/text/component.js.map +1 -1
- package/text/index.css +88 -54
- package/text/index.module.css.js +1 -1
- package/text/index.module.css.js.map +1 -1
- package/title/common.css +13 -6
- package/title/common.module.css.js +1 -1
- package/title/common.module.css.js.map +1 -1
- package/title/component.d.ts +2 -8
- package/title/component.js +15 -16
- package/title/component.js.map +1 -1
- package/title/index.css +38 -89
- package/title/index.d.ts +1 -4
- package/title/index.module.css.js +1 -1
- package/title/index.module.css.js.map +1 -1
- package/title-mobile/component.d.ts +1 -4
- package/title-mobile/index.css +53 -70
- package/title-mobile/index.module.css.js +1 -1
- package/title-responsive/component.d.ts +1 -4
- package/cssm/title/utils.d.ts +0 -1
- package/cssm/title/utils.js +0 -16
- package/cssm/title/utils.js.map +0 -1
- package/esm/title/utils.d.ts +0 -1
- package/esm/title/utils.js +0 -12
- package/esm/title/utils.js.map +0 -1
- package/modern/title/utils.d.ts +0 -1
- package/modern/title/utils.js +0 -12
- package/modern/title/utils.js.map +0 -1
- package/moderncssm/title/utils.d.ts +0 -1
- package/moderncssm/title/utils.js +0 -12
- package/moderncssm/title/utils.js.map +0 -1
- package/src/title/utils.ts +0 -14
- package/title/utils.d.ts +0 -1
- package/title/utils.js +0 -16
- package/title/utils.js.map +0 -1
|
@@ -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 {
|
|
1
|
+
{"version":3,"file":"component.js","sources":["../../src/title/component.tsx"],"sourcesContent":["import React, { type ComponentProps, forwardRef, Fragment, 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 const Root = showSkeleton ? 'div' : Fragment;\n const rootProps: ComponentProps<typeof Root> = showSkeleton\n ? { className: cn(commonStyles.root, className) }\n : {};\n\n return (\n <Root {...rootProps}>\n <Component\n className={cn(\n commonStyles.component,\n styles.component,\n !showSkeleton && 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 {showSkeleton && (\n <div className={commonStyles.skeleton}>\n {renderSkeleton({\n wrapperClassName: cn(defaultMargins && styles[`margins-${view}`]),\n dataTestId,\n })}\n </div>\n )}\n </Root>\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;IAC5E,MAAM,IAAI,GAAG,YAAY,GAAG,KAAK,GAAG,QAAQ;IAC5C,MAAM,SAAS,GAAgC;AAC3C,UAAE,EAAE,SAAS,EAAE,EAAE,CAAC,YAAY,CAAC,IAAI,EAAE,SAAS,CAAC;UAC7C,EAAE;AAER,IAAA,QACI,KAAA,CAAA,aAAA,CAAC,IAAI,EAAA,EAAA,GAAK,SAAS,EAAA;QACf,KAAC,CAAA,aAAA,CAAA,SAAS,EACN,EAAA,SAAS,EAAE,EAAE,CACT,YAAY,CAAC,SAAS,EACtB,MAAM,CAAC,SAAS,EAChB,CAAC,YAAY,IAAI,SAAS,EAC1B,MAAM,CAAC,CAAA,EAAG,MAAM,KAAK,SAAS,GAAG,UAAU,GAAG,EAAE,GAAG,IAAI,CAAA,CAAE,CAAC,EAC1D,cAAc,IAAI,MAAM,CAAC,CAAA,QAAA,EAAW,IAAI,CAAA,CAAE,CAAC,EAC3C,KAAK,IAAI,MAAM,CAAC,KAAK,CAAC,EACtB;gBACI,CAAC,YAAY,CAAC,CAAW,QAAA,EAAA,QAAQ,EAAE,CAAC,GAAG,QAAQ;AAC/C,gBAAA,CAAC,YAAY,CAAC,WAAW,GAAG,YAAY;AAC3C,aAAA,CACJ,kBACa,UAAU,EACxB,GAAG,EAAE,SAAS,CAAC,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC,KAC1B,SAAS,EAAA,EAEZ,QAAQ,CACD;QACX,YAAY,KACT,KAAA,CAAA,aAAA,CAAA,KAAA,EAAA,EAAK,SAAS,EAAE,YAAY,CAAC,QAAQ,EAChC,EAAA,cAAc,CAAC;YACZ,gBAAgB,EAAE,EAAE,CAAC,cAAc,IAAI,MAAM,CAAC,CAAW,QAAA,EAAA,IAAI,CAAE,CAAA,CAAC,CAAC;YACjE,UAAU;AACb,SAAA,CAAC,CACA,CACT,CACE;AAEf,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"
|
|
9
|
-
font: "alfasans";
|
|
10
|
-
systemCompat: boolean;
|
|
11
|
-
};
|
|
8
|
+
font?: "styrene" | "system";
|
|
12
9
|
defaultMargins?: boolean;
|
|
13
10
|
className?: string;
|
|
14
11
|
dataTestId?: string;
|
|
@@ -3,141 +3,82 @@
|
|
|
3
3
|
font-size: 48px;
|
|
4
4
|
line-height: 52px;
|
|
5
5
|
font-weight: 700;
|
|
6
|
-
|
|
6
|
+
letter-spacing: 0.1px;
|
|
7
|
+
font-family: var(--font-family-alfasans);
|
|
7
8
|
}
|
|
8
9
|
|
|
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
|
-
|
|
16
10
|
.regular-xlarge {
|
|
17
11
|
font-size: 48px;
|
|
18
12
|
line-height: 52px;
|
|
19
13
|
font-weight: 400;
|
|
20
|
-
|
|
14
|
+
letter-spacing: -2.1px;
|
|
15
|
+
font-family: var(--font-family-alfasans);
|
|
21
16
|
}
|
|
22
17
|
|
|
23
|
-
.regular-xlarge.font {
|
|
24
|
-
line-height: 64px;
|
|
25
|
-
font-feature-settings: 'ss01';
|
|
26
|
-
font-family: var(--font-family-styrene);
|
|
27
|
-
}
|
|
28
|
-
|
|
29
18
|
.large {
|
|
30
19
|
font-size: 40px;
|
|
31
20
|
line-height: 48px;
|
|
32
21
|
font-weight: 700;
|
|
33
|
-
|
|
22
|
+
letter-spacing: 0.1px;
|
|
23
|
+
font-family: var(--font-family-alfasans);
|
|
34
24
|
}
|
|
35
25
|
|
|
36
|
-
.large.font {
|
|
37
|
-
font-weight: 500;
|
|
38
|
-
font-feature-settings: 'ss01';
|
|
39
|
-
font-family: var(--font-family-styrene);
|
|
40
|
-
}
|
|
41
|
-
|
|
42
26
|
.regular-large {
|
|
43
27
|
font-size: 40px;
|
|
44
28
|
line-height: 48px;
|
|
45
29
|
font-weight: 400;
|
|
46
|
-
|
|
30
|
+
letter-spacing: -1.7px;
|
|
31
|
+
font-family: var(--font-family-alfasans);
|
|
47
32
|
}
|
|
48
33
|
|
|
49
|
-
.regular-large.font {
|
|
50
|
-
font-feature-settings: 'ss01';
|
|
51
|
-
font-family: var(--font-family-styrene);
|
|
52
|
-
}
|
|
53
|
-
|
|
54
34
|
.medium {
|
|
55
35
|
font-size: 30px;
|
|
56
36
|
line-height: 36px;
|
|
57
37
|
font-weight: 700;
|
|
58
|
-
|
|
38
|
+
letter-spacing: 0.1px;
|
|
39
|
+
font-family: var(--font-family-alfasans);
|
|
59
40
|
}
|
|
60
41
|
|
|
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
|
-
|
|
69
42
|
.regular-medium {
|
|
70
43
|
font-size: 30px;
|
|
71
44
|
line-height: 36px;
|
|
72
45
|
font-weight: 400;
|
|
73
|
-
|
|
46
|
+
letter-spacing: -1.25px;
|
|
47
|
+
font-family: var(--font-family-alfasans);
|
|
74
48
|
}
|
|
75
49
|
|
|
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
|
-
|
|
83
50
|
.small {
|
|
84
51
|
font-size: 22px;
|
|
85
52
|
line-height: 26px;
|
|
86
53
|
font-weight: 700;
|
|
87
|
-
|
|
54
|
+
letter-spacing: 0.2px;
|
|
55
|
+
font-family: var(--font-family-alfasans);
|
|
88
56
|
}
|
|
89
57
|
|
|
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
|
-
|
|
98
58
|
.regular-small {
|
|
99
59
|
font-size: 22px;
|
|
100
60
|
line-height: 26px;
|
|
101
61
|
font-weight: 400;
|
|
102
|
-
|
|
62
|
+
letter-spacing: -0.8px;
|
|
63
|
+
font-family: var(--font-family-alfasans);
|
|
103
64
|
}
|
|
104
65
|
|
|
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
|
-
|
|
112
66
|
.xsmall {
|
|
113
67
|
font-size: 18px;
|
|
114
68
|
line-height: 22px;
|
|
115
69
|
font-weight: 700;
|
|
116
|
-
|
|
70
|
+
letter-spacing: 0.38px;
|
|
71
|
+
font-family: var(--font-family-alfasans);
|
|
117
72
|
}
|
|
118
73
|
|
|
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
|
-
|
|
127
74
|
.regular-xsmall {
|
|
128
75
|
font-size: 18px;
|
|
129
76
|
line-height: 22px;
|
|
130
77
|
font-weight: 400;
|
|
131
|
-
|
|
78
|
+
letter-spacing: -0.36px;
|
|
79
|
+
font-family: var(--font-family-alfasans);
|
|
132
80
|
}
|
|
133
81
|
|
|
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
|
-
|
|
141
82
|
.component.margins-xlarge {
|
|
142
83
|
margin: var(--gap-0) var(--gap-0) var(--gap-24);
|
|
143
84
|
}
|
|
@@ -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"
|
|
8
|
-
font: "alfasans";
|
|
9
|
-
systemCompat: boolean;
|
|
10
|
-
};
|
|
7
|
+
font?: "styrene" | "system";
|
|
11
8
|
defaultMargins?: boolean;
|
|
12
9
|
className?: string;
|
|
13
10
|
dataTestId?: string;
|
|
@@ -2,126 +2,111 @@
|
|
|
2
2
|
.xlarge {
|
|
3
3
|
font-size: 34px;
|
|
4
4
|
line-height: 40px;
|
|
5
|
-
font-weight:
|
|
6
|
-
|
|
5
|
+
font-weight: 500;
|
|
6
|
+
letter-spacing: -0.32px;
|
|
7
|
+
font-family: var(--font-family-alfasans);
|
|
7
8
|
}
|
|
8
9
|
|
|
9
10
|
.xlarge.font {
|
|
10
|
-
font-weight: 500;
|
|
11
|
-
font-feature-settings: 'ss01';
|
|
12
|
-
font-family: var(--font-family-styrene);
|
|
13
11
|
}
|
|
14
12
|
|
|
15
13
|
.regular-xlarge {
|
|
16
14
|
font-size: 34px;
|
|
17
15
|
line-height: 40px;
|
|
18
16
|
font-weight: 400;
|
|
19
|
-
|
|
17
|
+
letter-spacing: -1.36px;
|
|
18
|
+
font-family: var(--font-family-alfasans);
|
|
20
19
|
}
|
|
21
20
|
|
|
22
21
|
.regular-xlarge.system {
|
|
23
|
-
font-feature-settings: 'ss01';
|
|
24
|
-
font-family: var(--font-family-styrene);
|
|
25
22
|
}
|
|
26
23
|
|
|
27
24
|
.large {
|
|
28
25
|
font-size: 30px;
|
|
29
26
|
line-height: 36px;
|
|
30
|
-
font-weight:
|
|
31
|
-
|
|
27
|
+
font-weight: 500;
|
|
28
|
+
letter-spacing: -0.25px;
|
|
29
|
+
font-family: var(--font-family-alfasans);
|
|
32
30
|
}
|
|
33
31
|
|
|
34
32
|
.large.font {
|
|
35
|
-
font-weight: 500;
|
|
36
|
-
font-feature-settings: 'ss01';
|
|
37
|
-
font-family: var(--font-family-styrene);
|
|
38
33
|
}
|
|
39
34
|
|
|
40
35
|
.regular-large {
|
|
41
36
|
font-size: 30px;
|
|
42
37
|
line-height: 36px;
|
|
43
38
|
font-weight: 400;
|
|
44
|
-
|
|
39
|
+
letter-spacing: -1.25px;
|
|
40
|
+
font-family: var(--font-family-alfasans);
|
|
45
41
|
}
|
|
46
42
|
|
|
47
43
|
.regular-large.system {
|
|
48
|
-
font-feature-settings: 'ss01';
|
|
49
|
-
font-family: var(--font-family-styrene);
|
|
50
44
|
}
|
|
51
45
|
|
|
52
46
|
.medium {
|
|
53
47
|
font-size: 26px;
|
|
54
48
|
line-height: 32px;
|
|
55
|
-
font-weight:
|
|
56
|
-
|
|
49
|
+
font-weight: 500;
|
|
50
|
+
letter-spacing: -0.25px;
|
|
51
|
+
font-family: var(--font-family-alfasans);
|
|
57
52
|
}
|
|
58
53
|
|
|
59
54
|
.medium.font {
|
|
60
|
-
font-weight: 500;
|
|
61
|
-
font-feature-settings: 'ss01';
|
|
62
|
-
font-family: var(--font-family-styrene);
|
|
63
55
|
}
|
|
64
56
|
|
|
65
57
|
.regular-medium {
|
|
66
58
|
font-size: 26px;
|
|
67
59
|
line-height: 32px;
|
|
68
60
|
font-weight: 400;
|
|
69
|
-
|
|
61
|
+
letter-spacing: -1px;
|
|
62
|
+
font-family: var(--font-family-alfasans);
|
|
70
63
|
}
|
|
71
64
|
|
|
72
65
|
.regular-medium.system {
|
|
73
|
-
font-feature-settings: 'ss01';
|
|
74
|
-
font-family: var(--font-family-styrene);
|
|
75
66
|
}
|
|
76
67
|
|
|
77
68
|
.small {
|
|
78
69
|
font-size: 20px;
|
|
79
70
|
line-height: 28px;
|
|
80
|
-
font-weight:
|
|
81
|
-
|
|
71
|
+
font-weight: 500;
|
|
72
|
+
letter-spacing: -0.15px;
|
|
73
|
+
font-family: var(--font-family-alfasans);
|
|
82
74
|
}
|
|
83
75
|
|
|
84
76
|
.small.font {
|
|
85
|
-
font-weight: 500;
|
|
86
|
-
font-feature-settings: 'ss01';
|
|
87
|
-
font-family: var(--font-family-styrene);
|
|
88
77
|
}
|
|
89
78
|
|
|
90
79
|
.regular-small {
|
|
91
80
|
font-size: 20px;
|
|
92
81
|
line-height: 28px;
|
|
93
82
|
font-weight: 400;
|
|
94
|
-
|
|
83
|
+
letter-spacing: -0.68px;
|
|
84
|
+
font-family: var(--font-family-alfasans);
|
|
95
85
|
}
|
|
96
86
|
|
|
97
87
|
.regular-small.system {
|
|
98
|
-
font-feature-settings: 'ss01';
|
|
99
|
-
font-family: var(--font-family-styrene);
|
|
100
88
|
}
|
|
101
89
|
|
|
102
90
|
.xsmall {
|
|
103
91
|
font-size: 16px;
|
|
104
92
|
line-height: 20px;
|
|
105
|
-
font-weight:
|
|
106
|
-
|
|
93
|
+
font-weight: 500;
|
|
94
|
+
letter-spacing: 0.17px;
|
|
95
|
+
font-family: var(--font-family-alfasans);
|
|
107
96
|
}
|
|
108
97
|
|
|
109
98
|
.xsmall.font {
|
|
110
|
-
font-weight: 500;
|
|
111
|
-
font-feature-settings: 'ss01';
|
|
112
|
-
font-family: var(--font-family-styrene);
|
|
113
99
|
}
|
|
114
100
|
|
|
115
101
|
.regular-xsmall {
|
|
116
102
|
font-size: 16px;
|
|
117
103
|
line-height: 20px;
|
|
118
104
|
font-weight: 400;
|
|
119
|
-
|
|
105
|
+
letter-spacing: -0.24px;
|
|
106
|
+
font-family: var(--font-family-alfasans);
|
|
120
107
|
}
|
|
121
108
|
|
|
122
109
|
.regular-xsmall.system {
|
|
123
|
-
font-feature-settings: 'ss01';
|
|
124
|
-
font-family: var(--font-family-styrene);
|
|
125
110
|
}
|
|
126
111
|
|
|
127
112
|
.component.margins-xlarge {
|
|
@@ -16,10 +16,7 @@ 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"
|
|
20
|
-
font: "alfasans";
|
|
21
|
-
systemCompat: boolean;
|
|
22
|
-
};
|
|
19
|
+
font?: "styrene" | "system";
|
|
23
20
|
defaultMargins?: boolean;
|
|
24
21
|
className?: string;
|
|
25
22
|
dataTestId?: string;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@alfalab/core-components-typography",
|
|
3
|
-
"version": "6.0.
|
|
3
|
+
"version": "6.0.14-alfasans",
|
|
4
4
|
"description": "",
|
|
5
5
|
"keywords": [],
|
|
6
6
|
"license": "MIT",
|
|
@@ -13,9 +13,9 @@
|
|
|
13
13
|
"build": "rollup -c ../../tools/rollup/rollup.config.mjs --silent"
|
|
14
14
|
},
|
|
15
15
|
"dependencies": {
|
|
16
|
-
"@alfalab/core-components-mq": "
|
|
17
|
-
"@alfalab/core-components-shared": "
|
|
18
|
-
"@alfalab/core-components-skeleton": "
|
|
16
|
+
"@alfalab/core-components-mq": "6.0.10-alfasans",
|
|
17
|
+
"@alfalab/core-components-shared": "2.4.0-alfasans",
|
|
18
|
+
"@alfalab/core-components-skeleton": "7.0.6-alfasans",
|
|
19
19
|
"classnames": "^2.5.1",
|
|
20
20
|
"react-merge-refs": "^1.1.0",
|
|
21
21
|
"tslib": "^2.4.0"
|
|
@@ -28,6 +28,6 @@
|
|
|
28
28
|
"access": "public",
|
|
29
29
|
"directory": "dist"
|
|
30
30
|
},
|
|
31
|
-
"themesVersion": "15.2.1",
|
|
32
|
-
"varsVersion": "11.
|
|
31
|
+
"themesVersion": "15.2.1-alfasans",
|
|
32
|
+
"varsVersion": "11.5.0-alfasans"
|
|
33
33
|
}
|
package/src/common.module.css
CHANGED
package/src/text/component.tsx
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React, { forwardRef, type HTMLAttributes } from 'react';
|
|
1
|
+
import React, { type ComponentProps, forwardRef, Fragment, type HTMLAttributes } from 'react';
|
|
2
2
|
import mergeRefs from 'react-merge-refs';
|
|
3
3
|
import cn from 'classnames';
|
|
4
4
|
|
|
@@ -119,39 +119,44 @@ export const Text = forwardRef<TextElementType, TextProps>(
|
|
|
119
119
|
ref,
|
|
120
120
|
) => {
|
|
121
121
|
const { renderSkeleton, textRef } = useSkeleton(showSkeleton, skeletonProps);
|
|
122
|
-
|
|
123
|
-
const
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
}),
|
|
127
|
-
dataTestId,
|
|
128
|
-
});
|
|
129
|
-
|
|
130
|
-
if (skeleton) {
|
|
131
|
-
return skeleton;
|
|
132
|
-
}
|
|
122
|
+
const Root = showSkeleton ? 'div' : Fragment;
|
|
123
|
+
const rootProps: ComponentProps<typeof Root> = showSkeleton
|
|
124
|
+
? { className: cn(styles.root, className) }
|
|
125
|
+
: {};
|
|
133
126
|
|
|
134
127
|
return (
|
|
135
|
-
<
|
|
136
|
-
|
|
137
|
-
{
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
128
|
+
<Root {...rootProps}>
|
|
129
|
+
<Component
|
|
130
|
+
className={cn(
|
|
131
|
+
{
|
|
132
|
+
[styles.paragraph]: Component === 'p' && !defaultMargins,
|
|
133
|
+
[styles.paragraphWithMargins]: Component === 'p' && defaultMargins,
|
|
134
|
+
[styles.monospace]: monospaceNumbers,
|
|
135
|
+
[styles[`rowLimit${rowLimit}`]]: rowLimit,
|
|
136
|
+
[styles.transparent]: showSkeleton,
|
|
137
|
+
},
|
|
138
|
+
!showSkeleton && className,
|
|
139
|
+
color && colors[color],
|
|
140
|
+
styles[view],
|
|
141
|
+
weight && styles[weight],
|
|
142
|
+
)}
|
|
143
|
+
data-test-id={dataTestId}
|
|
144
|
+
ref={mergeRefs([ref, textRef])}
|
|
145
|
+
{...restProps}
|
|
146
|
+
>
|
|
147
|
+
{children}
|
|
148
|
+
</Component>
|
|
149
|
+
{showSkeleton && (
|
|
150
|
+
<div className={styles.skeleton}>
|
|
151
|
+
{renderSkeleton({
|
|
152
|
+
wrapperClassName: cn({
|
|
153
|
+
[styles.paragraphWithMargins]: Component === 'p' && defaultMargins,
|
|
154
|
+
}),
|
|
155
|
+
dataTestId,
|
|
156
|
+
})}
|
|
157
|
+
</div>
|
|
148
158
|
)}
|
|
149
|
-
|
|
150
|
-
ref={mergeRefs([ref, textRef])}
|
|
151
|
-
{...restProps}
|
|
152
|
-
>
|
|
153
|
-
{children}
|
|
154
|
-
</Component>
|
|
159
|
+
</Root>
|
|
155
160
|
);
|
|
156
161
|
},
|
|
157
162
|
);
|
package/src/title/component.tsx
CHANGED
|
@@ -1,14 +1,11 @@
|
|
|
1
|
-
import React, { forwardRef, type HTMLAttributes } from 'react';
|
|
1
|
+
import React, { type ComponentProps, forwardRef, Fragment, type HTMLAttributes } from 'react';
|
|
2
2
|
import mergeRefs from 'react-merge-refs';
|
|
3
3
|
import cn from 'classnames';
|
|
4
4
|
|
|
5
|
-
import { isObject } from '@alfalab/core-components-shared';
|
|
6
5
|
import { type TextSkeletonProps, useSkeleton } from '@alfalab/core-components-skeleton';
|
|
7
6
|
|
|
8
7
|
import { type Color } from '../colors';
|
|
9
8
|
|
|
10
|
-
import { getDefaultWeight } from './utils';
|
|
11
|
-
|
|
12
9
|
import colors from '../colors.module.css';
|
|
13
10
|
import commonStyles from './common.module.css';
|
|
14
11
|
|
|
@@ -38,7 +35,7 @@ export type TitleProps = Omit<NativeProps, 'color'> & {
|
|
|
38
35
|
/**
|
|
39
36
|
* Шрифт текста
|
|
40
37
|
*/
|
|
41
|
-
font?: 'styrene' | 'system'
|
|
38
|
+
font?: 'styrene' | 'system';
|
|
42
39
|
|
|
43
40
|
/**
|
|
44
41
|
* Добавляет отступы
|
|
@@ -95,9 +92,9 @@ export const TitleBase = forwardRef<TitleElementType, TitleProps & PrivateProps>
|
|
|
95
92
|
{
|
|
96
93
|
tag: Component = 'div',
|
|
97
94
|
view = 'medium',
|
|
98
|
-
font
|
|
95
|
+
font,
|
|
99
96
|
platform,
|
|
100
|
-
weight =
|
|
97
|
+
weight = 'bold',
|
|
101
98
|
defaultMargins = false,
|
|
102
99
|
color,
|
|
103
100
|
className,
|
|
@@ -112,38 +109,41 @@ export const TitleBase = forwardRef<TitleElementType, TitleProps & PrivateProps>
|
|
|
112
109
|
ref,
|
|
113
110
|
) => {
|
|
114
111
|
const { renderSkeleton, textRef } = useSkeleton(showSkeleton, skeletonProps);
|
|
115
|
-
|
|
116
|
-
const
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
});
|
|
120
|
-
|
|
121
|
-
if (skeleton) {
|
|
122
|
-
return skeleton;
|
|
123
|
-
}
|
|
112
|
+
const Root = showSkeleton ? 'div' : Fragment;
|
|
113
|
+
const rootProps: ComponentProps<typeof Root> = showSkeleton
|
|
114
|
+
? { className: cn(commonStyles.root, className) }
|
|
115
|
+
: {};
|
|
124
116
|
|
|
125
117
|
return (
|
|
126
|
-
<
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
}
|
|
118
|
+
<Root {...rootProps}>
|
|
119
|
+
<Component
|
|
120
|
+
className={cn(
|
|
121
|
+
commonStyles.component,
|
|
122
|
+
styles.component,
|
|
123
|
+
!showSkeleton && className,
|
|
124
|
+
styles[`${weight === 'regular' ? 'regular-' : ''}${view}`],
|
|
125
|
+
defaultMargins && styles[`margins-${view}`],
|
|
126
|
+
color && colors[color],
|
|
127
|
+
{
|
|
128
|
+
[commonStyles[`rowLimit${rowLimit}`]]: rowLimit,
|
|
129
|
+
[commonStyles.transparent]: showSkeleton,
|
|
130
|
+
},
|
|
131
|
+
)}
|
|
132
|
+
data-test-id={dataTestId}
|
|
133
|
+
ref={mergeRefs([ref, textRef])}
|
|
134
|
+
{...restProps}
|
|
135
|
+
>
|
|
136
|
+
{children}
|
|
137
|
+
</Component>
|
|
138
|
+
{showSkeleton && (
|
|
139
|
+
<div className={commonStyles.skeleton}>
|
|
140
|
+
{renderSkeleton({
|
|
141
|
+
wrapperClassName: cn(defaultMargins && styles[`margins-${view}`]),
|
|
142
|
+
dataTestId,
|
|
143
|
+
})}
|
|
144
|
+
</div>
|
|
140
145
|
)}
|
|
141
|
-
|
|
142
|
-
ref={mergeRefs([ref, textRef])}
|
|
143
|
-
{...restProps}
|
|
144
|
-
>
|
|
145
|
-
{children}
|
|
146
|
-
</Component>
|
|
146
|
+
</Root>
|
|
147
147
|
);
|
|
148
148
|
},
|
|
149
149
|
);
|
|
@@ -4,18 +4,10 @@
|
|
|
4
4
|
@each $view in xlarge, large, medium, small, xsmall {
|
|
5
5
|
.$(view) {
|
|
6
6
|
@mixin headline-system_$(view);
|
|
7
|
-
|
|
8
|
-
&.font {
|
|
9
|
-
@subtract-mixin headline_$(view), headline-system_$(view);
|
|
10
|
-
}
|
|
11
7
|
}
|
|
12
8
|
|
|
13
9
|
.regular-$(view) {
|
|
14
10
|
@mixin promo-system_$(view);
|
|
15
|
-
|
|
16
|
-
&.font {
|
|
17
|
-
@subtract-mixin promo_$(view), promo-system_$(view);
|
|
18
|
-
}
|
|
19
11
|
}
|
|
20
12
|
}
|
|
21
13
|
|