@alfalab/core-components-typography 4.3.0 → 4.5.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.
- package/colors.css +20 -20
- package/colors.module-542eef2a.js +6 -0
- package/common.module-4306b4f6.js +6 -0
- package/component.js +0 -10
- package/cssm/component.js +0 -15
- package/cssm/hooks/index.d.ts +1 -1
- package/cssm/hooks/index.js +1 -6
- package/cssm/hooks/{useSkeleton.js → use-skeleton.js} +3 -1
- package/cssm/hooks/use-skeleton.module.css +6 -0
- package/cssm/index.js +0 -19
- package/cssm/text/component.js +1 -4
- package/cssm/text/index.js +0 -10
- package/cssm/title/common.module.css +3 -0
- package/cssm/title/component.d.ts +7 -6
- package/cssm/title/component.js +5 -7
- package/cssm/title/index.d.ts +1 -1
- package/cssm/title/index.js +1 -8
- package/cssm/title/utils.d.ts +2 -0
- package/cssm/title/utils.js +15 -0
- package/cssm/title-mobile/component.d.ts +1 -1
- package/cssm/title-mobile/component.js +1 -8
- package/cssm/title-mobile/index.js +0 -12
- package/cssm/title-responsive/component.d.ts +1 -1
- package/cssm/title-responsive/component.js +5 -8
- package/cssm/title-responsive/index.js +0 -12
- package/cssm/types.d.ts +8 -0
- package/esm/colors.css +20 -20
- package/esm/colors.module-8bcdca4a.js +4 -0
- package/esm/common.module-76facc75.js +4 -0
- package/esm/component.js +0 -10
- package/esm/hooks/index.d.ts +1 -1
- package/esm/hooks/index.js +1 -5
- package/esm/hooks/use-skeleton.css +8 -2
- package/esm/hooks/{useSkeleton.js → use-skeleton.js} +3 -2
- package/esm/index.js +0 -14
- package/esm/text/component.js +3 -5
- package/esm/text/index.css +20 -20
- package/esm/text/index.js +0 -8
- package/esm/title/common.css +8 -5
- package/esm/title/component.d.ts +7 -6
- package/esm/title/component.js +6 -7
- package/esm/title/index.css +19 -19
- package/esm/title/index.d.ts +1 -1
- package/esm/title/index.js +4 -10
- package/esm/title/utils.d.ts +2 -0
- package/esm/title/utils.js +11 -0
- package/esm/title-mobile/component.d.ts +1 -1
- package/esm/title-mobile/component.js +4 -10
- package/esm/title-mobile/index.css +11 -11
- package/esm/title-mobile/index.js +0 -10
- package/esm/title-responsive/component.d.ts +1 -1
- package/esm/title-responsive/component.js +8 -10
- package/esm/title-responsive/index.css +31 -31
- package/esm/title-responsive/index.js +0 -10
- package/esm/types.d.ts +8 -0
- package/hooks/index.d.ts +1 -1
- package/hooks/index.js +1 -5
- package/hooks/use-skeleton.css +8 -2
- package/hooks/{useSkeleton.js → use-skeleton.js} +4 -2
- package/index.js +0 -14
- package/modern/colors.css +20 -20
- package/modern/colors.module-ba6381f2.js +4 -0
- package/modern/common.module-e2076252.js +4 -0
- package/modern/component.js +0 -9
- package/modern/hooks/index.d.ts +1 -1
- package/modern/hooks/index.js +1 -4
- package/modern/hooks/use-skeleton.css +8 -2
- package/modern/hooks/{useSkeleton.js → use-skeleton.js} +3 -2
- package/modern/index.js +0 -13
- package/modern/text/component.js +3 -5
- package/modern/text/index.css +20 -20
- package/modern/text/index.js +0 -7
- package/modern/title/common.css +8 -5
- package/modern/title/component.d.ts +7 -6
- package/modern/title/component.js +5 -6
- package/modern/title/index.css +19 -19
- package/modern/title/index.d.ts +1 -1
- package/modern/title/index.js +4 -10
- package/modern/title/utils.d.ts +2 -0
- package/modern/title/utils.js +11 -0
- package/modern/title-mobile/component.d.ts +1 -1
- package/modern/title-mobile/component.js +4 -10
- package/modern/title-mobile/index.css +11 -11
- package/modern/title-mobile/index.js +0 -9
- package/modern/title-responsive/component.d.ts +1 -1
- package/modern/title-responsive/component.js +8 -10
- package/modern/title-responsive/index.css +31 -31
- package/modern/title-responsive/index.js +0 -9
- package/modern/types.d.ts +8 -0
- package/package.json +2 -1
- package/src/hooks/index.ts +1 -1
- package/src/hooks/use-skeleton.module.css +12 -0
- package/src/hooks/{useSkeleton.tsx → use-skeleton.tsx} +9 -1
- package/src/title/common.module.css +4 -0
- package/src/title/component.tsx +8 -4
- package/src/title/index.tsx +7 -2
- package/src/title/utils.ts +11 -0
- package/src/title-mobile/component.tsx +9 -2
- package/src/title-responsive/component.tsx +15 -2
- package/src/types.ts +10 -0
- package/text/component.js +3 -5
- package/text/index.css +20 -20
- package/text/index.js +0 -8
- package/title/common.css +8 -5
- package/title/component.d.ts +7 -6
- package/title/component.js +6 -7
- package/title/index.css +19 -19
- package/title/index.d.ts +1 -1
- package/title/index.js +3 -9
- package/title/utils.d.ts +2 -0
- package/title/utils.js +15 -0
- package/title-mobile/component.d.ts +1 -1
- package/title-mobile/component.js +3 -9
- package/title-mobile/index.css +11 -11
- package/title-mobile/index.js +0 -10
- package/title-responsive/component.d.ts +1 -1
- package/title-responsive/component.js +7 -9
- package/title-responsive/index.css +31 -31
- package/title-responsive/index.js +0 -10
- package/types.d.ts +8 -0
- package/colors.module-67e5bcbb.js +0 -6
- package/common.module-e30c567d.js +0 -6
- package/esm/colors.module-f70f33ad.js +0 -4
- package/esm/common.module-a6e9f838.js +0 -4
- package/modern/colors.module-95caa60d.js +0 -4
- package/modern/common.module-592df4cb.js +0 -4
- /package/cssm/hooks/{useSkeleton.d.ts → use-skeleton.d.ts} +0 -0
- /package/esm/hooks/{useSkeleton.d.ts → use-skeleton.d.ts} +0 -0
- /package/hooks/{useSkeleton.d.ts → use-skeleton.d.ts} +0 -0
- /package/modern/hooks/{useSkeleton.d.ts → use-skeleton.d.ts} +0 -0
|
@@ -20,7 +20,7 @@ type TitleProps = Omit<NativeProps, 'color'> & {
|
|
|
20
20
|
/**
|
|
21
21
|
* Толщина шрифта
|
|
22
22
|
*/
|
|
23
|
-
weight?: 'regular' | 'medium' | 'bold';
|
|
23
|
+
weight?: 'regular' | 'medium' | 'bold' | 'semibold';
|
|
24
24
|
/**
|
|
25
25
|
* Шрифт текста
|
|
26
26
|
*/
|
|
@@ -54,13 +54,14 @@ type TitleProps = Omit<NativeProps, 'color'> & {
|
|
|
54
54
|
*/
|
|
55
55
|
skeletonProps?: TextSkeletonProps;
|
|
56
56
|
};
|
|
57
|
-
type
|
|
57
|
+
type PrivateProps = {
|
|
58
58
|
styles: {
|
|
59
59
|
[key: string]: string;
|
|
60
60
|
};
|
|
61
|
+
platform: 'mobile' | 'desktop';
|
|
61
62
|
};
|
|
62
63
|
type TitleElementType = HTMLHeadingElement | HTMLDivElement;
|
|
63
|
-
declare const
|
|
64
|
+
declare const TitleBase: React.ForwardRefExoticComponent<Omit<NativeProps, "color"> & {
|
|
64
65
|
/**
|
|
65
66
|
* HTML тег
|
|
66
67
|
*/
|
|
@@ -76,7 +77,7 @@ declare const Title: React.ForwardRefExoticComponent<Omit<NativeProps, "color">
|
|
|
76
77
|
/**
|
|
77
78
|
* Толщина шрифта
|
|
78
79
|
*/
|
|
79
|
-
weight?: "bold" | "regular" | "medium" | undefined;
|
|
80
|
+
weight?: "bold" | "regular" | "medium" | "semibold" | undefined;
|
|
80
81
|
/**
|
|
81
82
|
* Шрифт текста
|
|
82
83
|
*/
|
|
@@ -109,5 +110,5 @@ declare const Title: React.ForwardRefExoticComponent<Omit<NativeProps, "color">
|
|
|
109
110
|
* Пропы для скелетона
|
|
110
111
|
*/
|
|
111
112
|
skeletonProps?: TextSkeletonProps | undefined;
|
|
112
|
-
} &
|
|
113
|
-
export { TitleProps,
|
|
113
|
+
} & PrivateProps & React.RefAttributes<TitleElementType>>;
|
|
114
|
+
export { TitleProps, TitleBase };
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
import React, { forwardRef } from 'react';
|
|
2
2
|
import mergeRefs from 'react-merge-refs';
|
|
3
3
|
import cn from 'classnames';
|
|
4
|
-
import { useSkeleton } from '../hooks/
|
|
5
|
-
import {
|
|
6
|
-
import '
|
|
7
|
-
import '@alfalab/hooks';
|
|
4
|
+
import { useSkeleton } from '../hooks/use-skeleton.js';
|
|
5
|
+
import { getDefaultWeight } from './utils.js';
|
|
6
|
+
import { c as colors } from '../colors.module-ba6381f2.js';
|
|
8
7
|
|
|
9
|
-
const
|
|
8
|
+
const TitleBase = forwardRef(({ tag: Component = 'div', view = 'medium', font = 'styrene', platform, weight = getDefaultWeight(font, platform), defaultMargins = false, color, className, dataTestId, children, rowLimit, styles, skeletonProps, showSkeleton, ...restProps }, ref) => {
|
|
10
9
|
const { renderSkeleton, textRef } = useSkeleton(showSkeleton, skeletonProps);
|
|
11
10
|
const skeleton = renderSkeleton({
|
|
12
11
|
wrapperClassName: cn(defaultMargins && styles[`margins-${view}`]),
|
|
@@ -18,4 +17,4 @@ const Title = forwardRef(({ tag: Component = 'div', view = 'medium', font = 'sty
|
|
|
18
17
|
return (React.createElement(Component, { className: cn(styles.component, className, styles[`${font}-${view}`], defaultMargins && styles[`margins-${view}`], styles[weight], color && colors[color], { [styles[`rowLimit${rowLimit}`]]: rowLimit }), "data-test-id": dataTestId, ref: mergeRefs([ref, textRef]), ...restProps }, children));
|
|
19
18
|
});
|
|
20
19
|
|
|
21
|
-
export {
|
|
20
|
+
export { TitleBase };
|
package/modern/title/index.css
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* hash:
|
|
1
|
+
/* hash: j90im */
|
|
2
2
|
:root {
|
|
3
3
|
} /* deprecated */ :root { /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */
|
|
4
4
|
} :root { /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */
|
|
@@ -20,78 +20,78 @@
|
|
|
20
20
|
--font-family-styrene: 'Styrene UI', system-ui, -apple-system, 'Segoe UI', Roboto,
|
|
21
21
|
'Helvetica Neue', Helvetica, sans-serif;
|
|
22
22
|
} :root {
|
|
23
|
-
} .typography__styrene-
|
|
23
|
+
} .typography__styrene-xlarge_1jotc {
|
|
24
24
|
font-size: 48px;
|
|
25
25
|
line-height: 64px;
|
|
26
26
|
font-weight: 500;
|
|
27
27
|
font-feature-settings: 'ss01';
|
|
28
28
|
font-family: var(--font-family-styrene);
|
|
29
|
-
} .typography__styrene-
|
|
29
|
+
} .typography__styrene-large_1jotc {
|
|
30
30
|
font-size: 40px;
|
|
31
31
|
line-height: 48px;
|
|
32
32
|
font-weight: 500;
|
|
33
33
|
font-feature-settings: 'ss01';
|
|
34
34
|
font-family: var(--font-family-styrene);
|
|
35
|
-
} .typography__styrene-
|
|
35
|
+
} .typography__styrene-medium_1jotc {
|
|
36
36
|
font-size: 32px;
|
|
37
37
|
line-height: 40px;
|
|
38
38
|
font-weight: 500;
|
|
39
39
|
font-feature-settings: 'ss01';
|
|
40
40
|
font-family: var(--font-family-styrene);
|
|
41
|
-
} .typography__styrene-
|
|
41
|
+
} .typography__styrene-small_1jotc {
|
|
42
42
|
font-size: 24px;
|
|
43
43
|
line-height: 32px;
|
|
44
44
|
font-weight: 500;
|
|
45
45
|
font-feature-settings: 'ss01';
|
|
46
46
|
font-family: var(--font-family-styrene);
|
|
47
|
-
} .typography__styrene-
|
|
47
|
+
} .typography__styrene-xsmall_1jotc {
|
|
48
48
|
font-size: 20px;
|
|
49
49
|
line-height: 24px;
|
|
50
50
|
font-weight: 500;
|
|
51
51
|
font-feature-settings: 'ss01';
|
|
52
52
|
font-family: var(--font-family-styrene);
|
|
53
|
-
} .typography__system-
|
|
53
|
+
} .typography__system-xlarge_1jotc {
|
|
54
54
|
font-size: 48px;
|
|
55
55
|
line-height: 52px;
|
|
56
56
|
font-weight: 700;
|
|
57
|
-
} .typography__system-
|
|
57
|
+
} .typography__system-large_1jotc {
|
|
58
58
|
font-size: 40px;
|
|
59
59
|
line-height: 48px;
|
|
60
60
|
font-weight: 700;
|
|
61
|
-
} .typography__system-
|
|
61
|
+
} .typography__system-medium_1jotc {
|
|
62
62
|
font-size: 30px;
|
|
63
63
|
line-height: 36px;
|
|
64
64
|
font-weight: 700;
|
|
65
|
-
} .typography__system-
|
|
65
|
+
} .typography__system-small_1jotc {
|
|
66
66
|
font-size: 22px;
|
|
67
67
|
line-height: 26px;
|
|
68
68
|
font-weight: 700;
|
|
69
|
-
} .typography__system-
|
|
69
|
+
} .typography__system-xsmall_1jotc {
|
|
70
70
|
font-size: 18px;
|
|
71
71
|
line-height: 22px;
|
|
72
72
|
font-weight: 700;
|
|
73
|
-
} .typography__margins-
|
|
73
|
+
} .typography__margins-xlarge_1jotc {
|
|
74
74
|
margin: 0 0 var(--gap-xl);
|
|
75
|
-
} .typography__margins-
|
|
75
|
+
} .typography__margins-large_1jotc {
|
|
76
76
|
margin: var(--gap-4xl) 0 var(--gap-xl);
|
|
77
|
-
} .typography__margins-
|
|
77
|
+
} .typography__margins-medium_1jotc {
|
|
78
78
|
margin: var(--gap-4xl) 0 var(--gap-xl);
|
|
79
|
-
} .typography__margins-
|
|
79
|
+
} .typography__margins-small_1jotc {
|
|
80
80
|
margin: var(--gap-3xl) 0 var(--gap-m);
|
|
81
|
-
} .typography__margins-
|
|
81
|
+
} .typography__margins-xsmall_1jotc {
|
|
82
82
|
margin: var(--gap-3xl) 0 var(--gap-m);
|
|
83
|
-
} .
|
|
83
|
+
} .typography__rowLimit1_1jotc {
|
|
84
84
|
-webkit-line-clamp: 1;
|
|
85
85
|
display: -webkit-box;
|
|
86
86
|
-webkit-box-orient: vertical;
|
|
87
87
|
overflow: hidden;
|
|
88
88
|
word-break: break-all;
|
|
89
|
-
} .
|
|
89
|
+
} .typography__rowLimit2_1jotc {
|
|
90
90
|
-webkit-line-clamp: 2;
|
|
91
91
|
display: -webkit-box;
|
|
92
92
|
-webkit-box-orient: vertical;
|
|
93
93
|
overflow: hidden;
|
|
94
|
-
} .
|
|
94
|
+
} .typography__rowLimit3_1jotc {
|
|
95
95
|
-webkit-line-clamp: 3;
|
|
96
96
|
display: -webkit-box;
|
|
97
97
|
-webkit-box-orient: vertical;
|
package/modern/title/index.d.ts
CHANGED
|
@@ -5,7 +5,7 @@ declare const Title: React.ForwardRefExoticComponent<Omit<React.HTMLAttributes<H
|
|
|
5
5
|
tag: "div" | "h1" | "h2" | "h3" | "h4" | "h5" | "h6";
|
|
6
6
|
view?: "small" | "medium" | "xlarge" | "large" | "xsmall" | undefined;
|
|
7
7
|
color?: "tertiary" | "disabled" | "accent" | "primary" | "attention" | "positive" | "secondary" | "tertiary-inverted" | "primary-inverted" | "secondary-inverted" | "link" | "negative" | "static-primary-light" | "static-secondary-light" | "static-tertiary-light" | "static-primary-dark" | "static-secondary-dark" | "static-tertiary-dark" | "static-accent" | undefined;
|
|
8
|
-
weight?: "bold" | "regular" | "medium" | undefined;
|
|
8
|
+
weight?: "bold" | "regular" | "medium" | "semibold" | undefined;
|
|
9
9
|
font?: "styrene" | "system" | undefined;
|
|
10
10
|
defaultMargins?: boolean | undefined;
|
|
11
11
|
className?: string | undefined;
|
package/modern/title/index.js
CHANGED
|
@@ -1,16 +1,10 @@
|
|
|
1
1
|
import React, { forwardRef } from 'react';
|
|
2
|
-
import {
|
|
3
|
-
import { c as commonStyles } from '../common.module-
|
|
4
|
-
import 'react-merge-refs';
|
|
5
|
-
import 'classnames';
|
|
6
|
-
import '../hooks/useSkeleton.js';
|
|
7
|
-
import '@alfalab/core-components-skeleton/modern';
|
|
8
|
-
import '@alfalab/hooks';
|
|
9
|
-
import '../colors.module-95caa60d.js';
|
|
2
|
+
import { TitleBase } from './component.js';
|
|
3
|
+
import { c as commonStyles } from '../common.module-e2076252.js';
|
|
10
4
|
|
|
11
|
-
const styles = {"styrene-xlarge":"typography__styrene-
|
|
5
|
+
const styles = {"styrene-xlarge":"typography__styrene-xlarge_1jotc","styrene-large":"typography__styrene-large_1jotc","styrene-medium":"typography__styrene-medium_1jotc","styrene-small":"typography__styrene-small_1jotc","styrene-xsmall":"typography__styrene-xsmall_1jotc","system-xlarge":"typography__system-xlarge_1jotc","system-large":"typography__system-large_1jotc","system-medium":"typography__system-medium_1jotc","system-small":"typography__system-small_1jotc","system-xsmall":"typography__system-xsmall_1jotc","margins-xlarge":"typography__margins-xlarge_1jotc","margins-large":"typography__margins-large_1jotc","margins-medium":"typography__margins-medium_1jotc","margins-small":"typography__margins-small_1jotc","margins-xsmall":"typography__margins-xsmall_1jotc","rowLimit1":"typography__rowLimit1_1jotc","rowLimit2":"typography__rowLimit2_1jotc","rowLimit3":"typography__rowLimit3_1jotc"};
|
|
12
6
|
require('./index.css')
|
|
13
7
|
|
|
14
|
-
const Title = forwardRef((props, ref) => (React.createElement(
|
|
8
|
+
const Title = forwardRef((props, ref) => (React.createElement(TitleBase, { ...props, styles: Object.assign(commonStyles, styles), ref: ref, platform: 'desktop' })));
|
|
15
9
|
|
|
16
10
|
export { Title };
|
|
@@ -6,7 +6,7 @@ declare const TitleMobile: React.ForwardRefExoticComponent<Omit<React.HTMLAttrib
|
|
|
6
6
|
tag: "div" | "h1" | "h2" | "h3" | "h4" | "h5" | "h6";
|
|
7
7
|
view?: "small" | "medium" | "xlarge" | "large" | "xsmall" | undefined;
|
|
8
8
|
color?: "tertiary" | "disabled" | "accent" | "primary" | "attention" | "positive" | "secondary" | "tertiary-inverted" | "primary-inverted" | "secondary-inverted" | "link" | "negative" | "static-primary-light" | "static-secondary-light" | "static-tertiary-light" | "static-primary-dark" | "static-secondary-dark" | "static-tertiary-dark" | "static-accent" | undefined;
|
|
9
|
-
weight?: "bold" | "regular" | "medium" | undefined;
|
|
9
|
+
weight?: "bold" | "regular" | "medium" | "semibold" | undefined;
|
|
10
10
|
font?: "styrene" | "system" | undefined;
|
|
11
11
|
defaultMargins?: boolean | undefined;
|
|
12
12
|
className?: string | undefined;
|
|
@@ -1,16 +1,10 @@
|
|
|
1
1
|
import React, { forwardRef } from 'react';
|
|
2
|
-
import {
|
|
3
|
-
import { c as commonStyles } from '../common.module-
|
|
4
|
-
import 'react-merge-refs';
|
|
5
|
-
import 'classnames';
|
|
6
|
-
import '../hooks/useSkeleton.js';
|
|
7
|
-
import '@alfalab/core-components-skeleton/modern';
|
|
8
|
-
import '@alfalab/hooks';
|
|
9
|
-
import '../colors.module-95caa60d.js';
|
|
2
|
+
import { TitleBase } from '../title/component.js';
|
|
3
|
+
import { c as commonStyles } from '../common.module-e2076252.js';
|
|
10
4
|
|
|
11
|
-
const styles = {"styrene-xlarge":"typography__styrene-
|
|
5
|
+
const styles = {"styrene-xlarge":"typography__styrene-xlarge_1hjyj","styrene-large":"typography__styrene-large_1hjyj","styrene-medium":"typography__styrene-medium_1hjyj","styrene-small":"typography__styrene-small_1hjyj","styrene-xsmall":"typography__styrene-xsmall_1hjyj","system-xlarge":"typography__system-xlarge_1hjyj","system-large":"typography__system-large_1hjyj","system-medium":"typography__system-medium_1hjyj","system-small":"typography__system-small_1hjyj","system-xsmall":"typography__system-xsmall_1hjyj"};
|
|
12
6
|
require('./index.css')
|
|
13
7
|
|
|
14
|
-
const TitleMobile = forwardRef((props, ref) => React.createElement(
|
|
8
|
+
const TitleMobile = forwardRef((props, ref) => (React.createElement(TitleBase, { ...props, styles: Object.assign(commonStyles, styles), ref: ref, platform: 'mobile' })));
|
|
15
9
|
|
|
16
10
|
export { TitleMobile };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* hash:
|
|
1
|
+
/* hash: 1ojb7 */
|
|
2
2
|
:root {
|
|
3
3
|
} /* deprecated */ :root { /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */
|
|
4
4
|
} :root { /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */
|
|
@@ -16,53 +16,53 @@
|
|
|
16
16
|
--font-family-styrene: 'Styrene UI', system-ui, -apple-system, 'Segoe UI', Roboto,
|
|
17
17
|
'Helvetica Neue', Helvetica, sans-serif;
|
|
18
18
|
} :root {
|
|
19
|
-
} .typography__styrene-
|
|
19
|
+
} .typography__styrene-xlarge_1hjyj {
|
|
20
20
|
font-size: 34px;
|
|
21
21
|
line-height: 40px;
|
|
22
22
|
font-weight: 500;
|
|
23
23
|
font-feature-settings: 'ss01';
|
|
24
24
|
font-family: var(--font-family-styrene);
|
|
25
|
-
} .typography__styrene-
|
|
25
|
+
} .typography__styrene-large_1hjyj {
|
|
26
26
|
font-size: 30px;
|
|
27
27
|
line-height: 36px;
|
|
28
28
|
font-weight: 500;
|
|
29
29
|
font-feature-settings: 'ss01';
|
|
30
30
|
font-family: var(--font-family-styrene);
|
|
31
|
-
} .typography__styrene-
|
|
31
|
+
} .typography__styrene-medium_1hjyj {
|
|
32
32
|
font-size: 26px;
|
|
33
33
|
line-height: 32px;
|
|
34
34
|
font-weight: 500;
|
|
35
35
|
font-feature-settings: 'ss01';
|
|
36
36
|
font-family: var(--font-family-styrene);
|
|
37
|
-
} .typography__styrene-
|
|
37
|
+
} .typography__styrene-small_1hjyj {
|
|
38
38
|
font-size: 20px;
|
|
39
39
|
line-height: 28px;
|
|
40
40
|
font-weight: 500;
|
|
41
41
|
font-feature-settings: 'ss01';
|
|
42
42
|
font-family: var(--font-family-styrene);
|
|
43
|
-
} .typography__styrene-
|
|
43
|
+
} .typography__styrene-xsmall_1hjyj {
|
|
44
44
|
font-size: 16px;
|
|
45
45
|
line-height: 20px;
|
|
46
46
|
font-weight: 500;
|
|
47
47
|
font-feature-settings: 'ss01';
|
|
48
48
|
font-family: var(--font-family-styrene);
|
|
49
|
-
} .typography__system-
|
|
49
|
+
} .typography__system-xlarge_1hjyj {
|
|
50
50
|
font-size: 34px;
|
|
51
51
|
line-height: 40px;
|
|
52
52
|
font-weight: 600;
|
|
53
|
-
} .typography__system-
|
|
53
|
+
} .typography__system-large_1hjyj {
|
|
54
54
|
font-size: 30px;
|
|
55
55
|
line-height: 36px;
|
|
56
56
|
font-weight: 600;
|
|
57
|
-
} .typography__system-
|
|
57
|
+
} .typography__system-medium_1hjyj {
|
|
58
58
|
font-size: 26px;
|
|
59
59
|
line-height: 32px;
|
|
60
60
|
font-weight: 600;
|
|
61
|
-
} .typography__system-
|
|
61
|
+
} .typography__system-small_1hjyj {
|
|
62
62
|
font-size: 20px;
|
|
63
63
|
line-height: 28px;
|
|
64
64
|
font-weight: 600;
|
|
65
|
-
} .typography__system-
|
|
65
|
+
} .typography__system-xsmall_1hjyj {
|
|
66
66
|
font-size: 16px;
|
|
67
67
|
line-height: 20px;
|
|
68
68
|
font-weight: 600;
|
|
@@ -1,10 +1 @@
|
|
|
1
1
|
export { TitleMobile } from './component.js';
|
|
2
|
-
import 'react';
|
|
3
|
-
import '../title/component.js';
|
|
4
|
-
import 'react-merge-refs';
|
|
5
|
-
import 'classnames';
|
|
6
|
-
import '../hooks/useSkeleton.js';
|
|
7
|
-
import '@alfalab/core-components-skeleton/modern';
|
|
8
|
-
import '@alfalab/hooks';
|
|
9
|
-
import '../colors.module-95caa60d.js';
|
|
10
|
-
import '../common.module-592df4cb.js';
|
|
@@ -4,7 +4,7 @@ declare const TitleResponsive: React.ForwardRefExoticComponent<Omit<React.HTMLAt
|
|
|
4
4
|
tag: "div" | "h1" | "h2" | "h3" | "h4" | "h5" | "h6";
|
|
5
5
|
view?: "small" | "medium" | "xlarge" | "large" | "xsmall" | undefined;
|
|
6
6
|
color?: "tertiary" | "disabled" | "accent" | "primary" | "attention" | "positive" | "secondary" | "tertiary-inverted" | "primary-inverted" | "secondary-inverted" | "link" | "negative" | "static-primary-light" | "static-secondary-light" | "static-tertiary-light" | "static-primary-dark" | "static-secondary-dark" | "static-tertiary-dark" | "static-accent" | undefined;
|
|
7
|
-
weight?: "bold" | "regular" | "medium" | undefined;
|
|
7
|
+
weight?: "bold" | "regular" | "medium" | "semibold" | undefined;
|
|
8
8
|
font?: "styrene" | "system" | undefined;
|
|
9
9
|
defaultMargins?: boolean | undefined;
|
|
10
10
|
className?: string | undefined;
|
|
@@ -1,16 +1,14 @@
|
|
|
1
1
|
import React, { forwardRef } from 'react';
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import '
|
|
5
|
-
import 'classnames';
|
|
6
|
-
import '../hooks/useSkeleton.js';
|
|
7
|
-
import '@alfalab/core-components-skeleton/modern';
|
|
8
|
-
import '@alfalab/hooks';
|
|
9
|
-
import '../colors.module-95caa60d.js';
|
|
2
|
+
import { useMatchMedia } from '@alfalab/core-components-mq/modern';
|
|
3
|
+
import { TitleBase } from '../title/component.js';
|
|
4
|
+
import { c as commonStyles } from '../common.module-e2076252.js';
|
|
10
5
|
|
|
11
|
-
const styles = {"styrene-xlarge":"typography__styrene-
|
|
6
|
+
const styles = {"styrene-xlarge":"typography__styrene-xlarge_k1jf9","styrene-large":"typography__styrene-large_k1jf9","styrene-medium":"typography__styrene-medium_k1jf9","styrene-small":"typography__styrene-small_k1jf9","styrene-xsmall":"typography__styrene-xsmall_k1jf9","system-xlarge":"typography__system-xlarge_k1jf9","system-large":"typography__system-large_k1jf9","system-medium":"typography__system-medium_k1jf9","system-small":"typography__system-small_k1jf9","system-xsmall":"typography__system-xsmall_k1jf9","margins-xlarge":"typography__margins-xlarge_k1jf9","margins-large":"typography__margins-large_k1jf9","margins-medium":"typography__margins-medium_k1jf9","margins-small":"typography__margins-small_k1jf9","margins-xsmall":"typography__margins-xsmall_k1jf9"};
|
|
12
7
|
require('./index.css')
|
|
13
8
|
|
|
14
|
-
const TitleResponsive = forwardRef((props, ref) =>
|
|
9
|
+
const TitleResponsive = forwardRef((props, ref) => {
|
|
10
|
+
const [isDesktop] = useMatchMedia('(min-width: 1024px)');
|
|
11
|
+
return (React.createElement(TitleBase, { ...props, styles: Object.assign(commonStyles, styles), ref: ref, platform: isDesktop ? 'desktop' : 'mobile' }));
|
|
12
|
+
});
|
|
15
13
|
|
|
16
14
|
export { TitleResponsive };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* hash:
|
|
1
|
+
/* hash: kl384 */
|
|
2
2
|
:root {
|
|
3
3
|
} /* deprecated */ :root { /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */
|
|
4
4
|
} :root { /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */
|
|
@@ -20,68 +20,68 @@
|
|
|
20
20
|
--font-family-styrene: 'Styrene UI', system-ui, -apple-system, 'Segoe UI', Roboto,
|
|
21
21
|
'Helvetica Neue', Helvetica, sans-serif;
|
|
22
22
|
} :root {
|
|
23
|
-
} /* TODO: поменять медиа-запросы на миксины */ .typography__styrene-
|
|
23
|
+
} /* TODO: поменять медиа-запросы на миксины */ .typography__styrene-xlarge_k1jf9 {
|
|
24
24
|
font-size: 34px;
|
|
25
25
|
line-height: 40px;
|
|
26
26
|
font-weight: 500;
|
|
27
27
|
font-feature-settings: 'ss01';
|
|
28
28
|
font-family: var(--font-family-styrene);
|
|
29
|
-
} .typography__styrene-
|
|
29
|
+
} .typography__styrene-large_k1jf9 {
|
|
30
30
|
font-size: 30px;
|
|
31
31
|
line-height: 36px;
|
|
32
32
|
font-weight: 500;
|
|
33
33
|
font-feature-settings: 'ss01';
|
|
34
34
|
font-family: var(--font-family-styrene);
|
|
35
|
-
} .typography__styrene-
|
|
35
|
+
} .typography__styrene-medium_k1jf9 {
|
|
36
36
|
font-size: 26px;
|
|
37
37
|
line-height: 32px;
|
|
38
38
|
font-weight: 500;
|
|
39
39
|
font-feature-settings: 'ss01';
|
|
40
40
|
font-family: var(--font-family-styrene);
|
|
41
|
-
} .typography__styrene-
|
|
41
|
+
} .typography__styrene-small_k1jf9 {
|
|
42
42
|
font-size: 20px;
|
|
43
43
|
line-height: 28px;
|
|
44
44
|
font-weight: 500;
|
|
45
45
|
font-feature-settings: 'ss01';
|
|
46
46
|
font-family: var(--font-family-styrene);
|
|
47
|
-
} .typography__styrene-
|
|
47
|
+
} .typography__styrene-xsmall_k1jf9 {
|
|
48
48
|
font-size: 16px;
|
|
49
49
|
line-height: 20px;
|
|
50
50
|
font-weight: 500;
|
|
51
51
|
font-feature-settings: 'ss01';
|
|
52
52
|
font-family: var(--font-family-styrene);
|
|
53
|
-
} .typography__system-
|
|
53
|
+
} .typography__system-xlarge_k1jf9 {
|
|
54
54
|
font-size: 34px;
|
|
55
55
|
line-height: 40px;
|
|
56
56
|
font-weight: 600;
|
|
57
|
-
} .typography__system-
|
|
57
|
+
} .typography__system-large_k1jf9 {
|
|
58
58
|
font-size: 30px;
|
|
59
59
|
line-height: 36px;
|
|
60
60
|
font-weight: 600;
|
|
61
|
-
} .typography__system-
|
|
61
|
+
} .typography__system-medium_k1jf9 {
|
|
62
62
|
font-size: 26px;
|
|
63
63
|
line-height: 32px;
|
|
64
64
|
font-weight: 600;
|
|
65
|
-
} .typography__system-
|
|
65
|
+
} .typography__system-small_k1jf9 {
|
|
66
66
|
font-size: 20px;
|
|
67
67
|
line-height: 28px;
|
|
68
68
|
font-weight: 600;
|
|
69
|
-
} .typography__system-
|
|
69
|
+
} .typography__system-xsmall_k1jf9 {
|
|
70
70
|
font-size: 16px;
|
|
71
71
|
line-height: 20px;
|
|
72
72
|
font-weight: 600;
|
|
73
|
-
} .typography__margins-
|
|
73
|
+
} .typography__margins-xlarge_k1jf9 {
|
|
74
74
|
margin: 0 0 var(--gap-xl);
|
|
75
|
-
} .typography__margins-
|
|
75
|
+
} .typography__margins-large_k1jf9 {
|
|
76
76
|
margin: var(--gap-3xl) 0 var(--gap-m);
|
|
77
|
-
} .typography__margins-
|
|
77
|
+
} .typography__margins-medium_k1jf9 {
|
|
78
78
|
margin: var(--gap-3xl) 0 var(--gap-m);
|
|
79
|
-
} .typography__margins-
|
|
79
|
+
} .typography__margins-small_k1jf9 {
|
|
80
80
|
margin: var(--gap-3xl) 0 var(--gap-m);
|
|
81
|
-
} .typography__margins-
|
|
81
|
+
} .typography__margins-xsmall_k1jf9 {
|
|
82
82
|
margin: var(--gap-3xl) 0 var(--gap-m);
|
|
83
83
|
} @media screen and (min-width: 1024px) {
|
|
84
|
-
.typography__styrene-
|
|
84
|
+
.typography__styrene-xlarge_k1jf9 {
|
|
85
85
|
font-size: 48px;
|
|
86
86
|
line-height: 64px;
|
|
87
87
|
font-weight: 500;
|
|
@@ -89,7 +89,7 @@
|
|
|
89
89
|
font-family: var(--font-family-styrene);
|
|
90
90
|
}
|
|
91
91
|
|
|
92
|
-
.typography__styrene-
|
|
92
|
+
.typography__styrene-large_k1jf9 {
|
|
93
93
|
font-size: 40px;
|
|
94
94
|
line-height: 48px;
|
|
95
95
|
font-weight: 500;
|
|
@@ -97,7 +97,7 @@
|
|
|
97
97
|
font-family: var(--font-family-styrene);
|
|
98
98
|
}
|
|
99
99
|
|
|
100
|
-
.typography__styrene-
|
|
100
|
+
.typography__styrene-medium_k1jf9 {
|
|
101
101
|
font-size: 32px;
|
|
102
102
|
line-height: 40px;
|
|
103
103
|
font-weight: 500;
|
|
@@ -105,7 +105,7 @@
|
|
|
105
105
|
font-family: var(--font-family-styrene);
|
|
106
106
|
}
|
|
107
107
|
|
|
108
|
-
.typography__styrene-
|
|
108
|
+
.typography__styrene-small_k1jf9 {
|
|
109
109
|
font-size: 24px;
|
|
110
110
|
line-height: 32px;
|
|
111
111
|
font-weight: 500;
|
|
@@ -113,7 +113,7 @@
|
|
|
113
113
|
font-family: var(--font-family-styrene);
|
|
114
114
|
}
|
|
115
115
|
|
|
116
|
-
.typography__styrene-
|
|
116
|
+
.typography__styrene-xsmall_k1jf9 {
|
|
117
117
|
font-size: 20px;
|
|
118
118
|
line-height: 24px;
|
|
119
119
|
font-weight: 500;
|
|
@@ -121,53 +121,53 @@
|
|
|
121
121
|
font-family: var(--font-family-styrene);
|
|
122
122
|
}
|
|
123
123
|
|
|
124
|
-
.typography__system-
|
|
124
|
+
.typography__system-xlarge_k1jf9 {
|
|
125
125
|
font-size: 48px;
|
|
126
126
|
line-height: 52px;
|
|
127
127
|
font-weight: 700;
|
|
128
128
|
}
|
|
129
129
|
|
|
130
|
-
.typography__system-
|
|
130
|
+
.typography__system-large_k1jf9 {
|
|
131
131
|
font-size: 40px;
|
|
132
132
|
line-height: 48px;
|
|
133
133
|
font-weight: 700;
|
|
134
134
|
}
|
|
135
135
|
|
|
136
|
-
.typography__system-
|
|
136
|
+
.typography__system-medium_k1jf9 {
|
|
137
137
|
font-size: 30px;
|
|
138
138
|
line-height: 36px;
|
|
139
139
|
font-weight: 700;
|
|
140
140
|
}
|
|
141
141
|
|
|
142
|
-
.typography__system-
|
|
142
|
+
.typography__system-small_k1jf9 {
|
|
143
143
|
font-size: 22px;
|
|
144
144
|
line-height: 26px;
|
|
145
145
|
font-weight: 700;
|
|
146
146
|
}
|
|
147
147
|
|
|
148
|
-
.typography__system-
|
|
148
|
+
.typography__system-xsmall_k1jf9 {
|
|
149
149
|
font-size: 18px;
|
|
150
150
|
line-height: 22px;
|
|
151
151
|
font-weight: 700;
|
|
152
152
|
}
|
|
153
153
|
|
|
154
|
-
.typography__margins-
|
|
154
|
+
.typography__margins-xlarge_k1jf9 {
|
|
155
155
|
margin: 0 0 var(--gap-xl);
|
|
156
156
|
}
|
|
157
157
|
|
|
158
|
-
.typography__margins-
|
|
158
|
+
.typography__margins-large_k1jf9 {
|
|
159
159
|
margin: var(--gap-4xl) 0 var(--gap-xl);
|
|
160
160
|
}
|
|
161
161
|
|
|
162
|
-
.typography__margins-
|
|
162
|
+
.typography__margins-medium_k1jf9 {
|
|
163
163
|
margin: var(--gap-4xl) 0 var(--gap-xl);
|
|
164
164
|
}
|
|
165
165
|
|
|
166
|
-
.typography__margins-
|
|
166
|
+
.typography__margins-small_k1jf9 {
|
|
167
167
|
margin: var(--gap-3xl) 0 var(--gap-m);
|
|
168
168
|
}
|
|
169
169
|
|
|
170
|
-
.typography__margins-
|
|
170
|
+
.typography__margins-xsmall_k1jf9 {
|
|
171
171
|
margin: var(--gap-3xl) 0 var(--gap-m);
|
|
172
172
|
}
|
|
173
173
|
}
|
|
@@ -1,10 +1 @@
|
|
|
1
1
|
export { TitleResponsive } from './component.js';
|
|
2
|
-
import 'react';
|
|
3
|
-
import '../title/component.js';
|
|
4
|
-
import 'react-merge-refs';
|
|
5
|
-
import 'classnames';
|
|
6
|
-
import '../hooks/useSkeleton.js';
|
|
7
|
-
import '@alfalab/core-components-skeleton/modern';
|
|
8
|
-
import '@alfalab/hooks';
|
|
9
|
-
import '../colors.module-95caa60d.js';
|
|
10
|
-
import '../common.module-592df4cb.js';
|
package/modern/types.d.ts
CHANGED
|
@@ -9,5 +9,13 @@ type TextSkeletonProps = {
|
|
|
9
9
|
* Ширина строки
|
|
10
10
|
*/
|
|
11
11
|
width?: WidthUnit | WidthUnit[];
|
|
12
|
+
/**
|
|
13
|
+
* Выравнивание элементов по горизонтали
|
|
14
|
+
*/
|
|
15
|
+
align?: 'left' | 'center' | 'right';
|
|
16
|
+
/**
|
|
17
|
+
* Класс для обертки скелетона
|
|
18
|
+
*/
|
|
19
|
+
wrapperClassName?: string;
|
|
12
20
|
};
|
|
13
21
|
export { TextElementType, TextSkeletonProps };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@alfalab/core-components-typography",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.5.0",
|
|
4
4
|
"description": "",
|
|
5
5
|
"keywords": [],
|
|
6
6
|
"license": "MIT",
|
|
@@ -15,6 +15,7 @@
|
|
|
15
15
|
},
|
|
16
16
|
"dependencies": {
|
|
17
17
|
"@alfalab/core-components-skeleton": "^4.2.0",
|
|
18
|
+
"@alfalab/core-components-mq": "^4.2.0",
|
|
18
19
|
"@alfalab/hooks": "^1.13.0",
|
|
19
20
|
"classnames": "^2.3.1",
|
|
20
21
|
"react-merge-refs": "^1.1.0",
|
package/src/hooks/index.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from './
|
|
1
|
+
export * from './use-skeleton';
|