@alfalab/core-components-typography 6.0.2 → 6.0.3
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.d.ts +1 -1
- package/colors.module.css.js +1 -1
- package/colors.module.css.js.map +1 -1
- package/cssm/colors.d.ts +1 -1
- package/cssm/text/component.d.ts +4 -4
- package/cssm/text/component.js.map +1 -1
- package/cssm/title/component.d.ts +18 -18
- package/cssm/title/component.js.map +1 -1
- package/cssm/title/index.d.ts +13 -13
- package/cssm/title/utils.js.map +1 -1
- package/cssm/title-mobile/component.d.ts +13 -13
- package/cssm/title-responsive/component.d.ts +16 -16
- package/cssm/types.d.ts +1 -1
- package/esm/colors.css +20 -20
- package/esm/colors.d.ts +1 -1
- package/esm/colors.module.css.js +1 -1
- package/esm/colors.module.css.js.map +1 -1
- package/esm/text/component.d.ts +4 -4
- package/esm/text/component.js.map +1 -1
- package/esm/text/index.css +40 -40
- package/esm/text/index.module.css.js +1 -1
- package/esm/text/index.module.css.js.map +1 -1
- package/esm/title/common.css +5 -5
- 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 +18 -18
- package/esm/title/component.js.map +1 -1
- package/esm/title/index.css +25 -25
- package/esm/title/index.d.ts +13 -13
- package/esm/title/index.module.css.js +1 -1
- package/esm/title/index.module.css.js.map +1 -1
- package/esm/title/utils.js.map +1 -1
- package/esm/title-mobile/component.d.ts +13 -13
- package/esm/title-mobile/index.css +25 -25
- package/esm/title-mobile/index.module.css.js +1 -1
- package/esm/title-mobile/index.module.css.js.map +1 -1
- package/esm/title-responsive/component.d.ts +16 -16
- package/esm/types.d.ts +1 -1
- package/modern/colors.css +20 -20
- package/modern/colors.d.ts +1 -1
- package/modern/colors.module.css.js +1 -1
- package/modern/colors.module.css.js.map +1 -1
- package/modern/text/component.d.ts +4 -4
- package/modern/text/component.js.map +1 -1
- package/modern/text/index.css +40 -40
- package/modern/text/index.module.css.js +1 -1
- package/modern/text/index.module.css.js.map +1 -1
- package/modern/title/common.css +5 -5
- 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 +18 -18
- package/modern/title/component.js.map +1 -1
- package/modern/title/index.css +25 -25
- package/modern/title/index.d.ts +13 -13
- package/modern/title/index.module.css.js +1 -1
- package/modern/title/index.module.css.js.map +1 -1
- package/modern/title/utils.js.map +1 -1
- package/modern/title-mobile/component.d.ts +13 -13
- package/modern/title-mobile/index.css +25 -25
- package/modern/title-mobile/index.module.css.js +1 -1
- package/modern/title-mobile/index.module.css.js.map +1 -1
- package/modern/title-responsive/component.d.ts +16 -16
- package/modern/types.d.ts +1 -1
- package/moderncssm/colors.d.ts +1 -1
- package/moderncssm/text/component.d.ts +4 -4
- package/moderncssm/text/component.js.map +1 -1
- package/moderncssm/title/component.d.ts +18 -18
- package/moderncssm/title/component.js.map +1 -1
- package/moderncssm/title/index.d.ts +13 -13
- package/moderncssm/title/index.module.css +3 -3
- package/moderncssm/title/utils.js.map +1 -1
- package/moderncssm/title-mobile/component.d.ts +13 -13
- package/moderncssm/title-mobile/index.module.css +3 -3
- package/moderncssm/title-responsive/component.d.ts +16 -16
- package/moderncssm/types.d.ts +1 -1
- package/package.json +6 -6
- package/src/colors.module.css +1 -1
- package/src/text/index.module.css +1 -1
- package/src/title/common.module.css +1 -1
- package/src/title/index.module.css +1 -1
- package/src/title-mobile/index.module.css +1 -1
- package/text/component.d.ts +4 -4
- package/text/component.js.map +1 -1
- package/text/index.css +40 -40
- package/text/index.module.css.js +1 -1
- package/text/index.module.css.js.map +1 -1
- package/title/common.css +5 -5
- package/title/common.module.css.js +1 -1
- package/title/common.module.css.js.map +1 -1
- package/title/component.d.ts +18 -18
- package/title/component.js.map +1 -1
- package/title/index.css +25 -25
- package/title/index.d.ts +13 -13
- package/title/index.module.css.js +1 -1
- package/title/index.module.css.js.map +1 -1
- package/title/utils.js.map +1 -1
- package/title-mobile/component.d.ts +13 -13
- package/title-mobile/index.css +25 -25
- package/title-mobile/index.module.css.js +1 -1
- package/title-mobile/index.module.css.js.map +1 -1
- package/title-responsive/component.d.ts +16 -16
- package/types.d.ts +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","sources":["../../src/title/utils.ts"],"sourcesContent":["export function getDefaultWeight(\n font: 'styrene' | 'system' | 'alfasans',\n platform: 'mobile' | 'desktop',\n) {\n if (font === 'styrene' || font === 'alfasans') {\n return 'medium';\n }\n\n if (platform === 'desktop') {\n return 'bold';\n }\n\n return 'semibold';\n}\n"],"names":[],"mappings":"AAAgB,SAAA,gBAAgB,CAC5B,IAAuC,EACvC,QAA8B,EAAA;
|
|
1
|
+
{"version":3,"file":"utils.js","sources":["../../src/title/utils.ts"],"sourcesContent":["export function getDefaultWeight(\n font: 'styrene' | 'system' | 'alfasans',\n platform: 'mobile' | 'desktop',\n) {\n if (font === 'styrene' || font === 'alfasans') {\n return 'medium';\n }\n\n if (platform === 'desktop') {\n return 'bold';\n }\n\n return 'semibold';\n}\n"],"names":[],"mappings":"AAAgB,SAAA,gBAAgB,CAC5B,IAAuC,EACvC,QAA8B,EAAA;IAE9B,IAAI,IAAI,KAAK,SAAS,IAAI,IAAI,KAAK,UAAU,EAAE;AAC3C,QAAA,OAAO,QAAQ;;AAGnB,IAAA,IAAI,QAAQ,KAAK,SAAS,EAAE;AACxB,QAAA,OAAO,MAAM;;AAGjB,IAAA,OAAO,UAAU;AACrB;;;;"}
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
export declare const TitleMobile: React.ForwardRefExoticComponent<Omit<React.HTMLAttributes<HTMLHeadingElement>, "color"> & {
|
|
3
|
-
tag: "
|
|
4
|
-
view?: "
|
|
5
|
-
color?: "
|
|
6
|
-
weight?: "regular" | "medium" | "bold" | "semibold"
|
|
7
|
-
font?: "
|
|
3
|
+
tag: "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "div";
|
|
4
|
+
view?: "xlarge" | "large" | "medium" | "small" | "xsmall";
|
|
5
|
+
color?: import("..").Color;
|
|
6
|
+
weight?: "regular" | "medium" | "bold" | "semibold";
|
|
7
|
+
font?: "styrene" | "system" | "alfasans" | {
|
|
8
8
|
font: "alfasans";
|
|
9
9
|
systemCompat: boolean;
|
|
10
|
-
}
|
|
11
|
-
defaultMargins?: boolean
|
|
12
|
-
className?: string
|
|
13
|
-
dataTestId?: string
|
|
10
|
+
};
|
|
11
|
+
defaultMargins?: boolean;
|
|
12
|
+
className?: string;
|
|
13
|
+
dataTestId?: string;
|
|
14
14
|
children?: React.ReactNode;
|
|
15
|
-
rowLimit?: 1 | 2 | 3
|
|
16
|
-
showSkeleton?: boolean
|
|
17
|
-
skeletonProps?: import("@alfalab/core-components-skeleton").TextSkeletonProps
|
|
18
|
-
defaultMatchMediaValue?: boolean | (() => boolean)
|
|
15
|
+
rowLimit?: 1 | 2 | 3;
|
|
16
|
+
showSkeleton?: boolean;
|
|
17
|
+
skeletonProps?: import("@alfalab/core-components-skeleton").TextSkeletonProps;
|
|
18
|
+
defaultMatchMediaValue?: boolean | (() => boolean);
|
|
19
19
|
} & React.RefAttributes<HTMLDivElement | HTMLHeadingElement>>;
|
|
@@ -14,123 +14,123 @@
|
|
|
14
14
|
'Styrene UI', system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Helvetica,
|
|
15
15
|
sans-serif;
|
|
16
16
|
}
|
|
17
|
-
.
|
|
17
|
+
.typography__xlarge_1iafb {
|
|
18
18
|
font-size: 34px;
|
|
19
19
|
line-height: 40px;
|
|
20
20
|
font-weight: 600;
|
|
21
21
|
font-family: var(--font-family-system);
|
|
22
22
|
}
|
|
23
|
-
.
|
|
23
|
+
.typography__xlarge_1iafb.typography__font_1iafb {
|
|
24
24
|
font-weight: 500;
|
|
25
25
|
font-feature-settings: 'ss01';
|
|
26
26
|
font-family: var(--font-family-styrene);
|
|
27
27
|
}
|
|
28
|
-
.typography__regular-
|
|
28
|
+
.typography__regular-xlarge_1iafb {
|
|
29
29
|
font-size: 34px;
|
|
30
30
|
line-height: 40px;
|
|
31
31
|
font-weight: 400;
|
|
32
32
|
font-family: var(--font-family-system);
|
|
33
33
|
}
|
|
34
|
-
.typography__regular-
|
|
34
|
+
.typography__regular-xlarge_1iafb.typography__system_1iafb {
|
|
35
35
|
font-feature-settings: 'ss01';
|
|
36
36
|
font-family: var(--font-family-styrene);
|
|
37
37
|
}
|
|
38
|
-
.
|
|
38
|
+
.typography__large_1iafb {
|
|
39
39
|
font-size: 30px;
|
|
40
40
|
line-height: 36px;
|
|
41
41
|
font-weight: 600;
|
|
42
42
|
font-family: var(--font-family-system);
|
|
43
43
|
}
|
|
44
|
-
.
|
|
44
|
+
.typography__large_1iafb.typography__font_1iafb {
|
|
45
45
|
font-weight: 500;
|
|
46
46
|
font-feature-settings: 'ss01';
|
|
47
47
|
font-family: var(--font-family-styrene);
|
|
48
48
|
}
|
|
49
|
-
.typography__regular-
|
|
49
|
+
.typography__regular-large_1iafb {
|
|
50
50
|
font-size: 30px;
|
|
51
51
|
line-height: 36px;
|
|
52
52
|
font-weight: 400;
|
|
53
53
|
font-family: var(--font-family-system);
|
|
54
54
|
}
|
|
55
|
-
.typography__regular-
|
|
55
|
+
.typography__regular-large_1iafb.typography__system_1iafb {
|
|
56
56
|
font-feature-settings: 'ss01';
|
|
57
57
|
font-family: var(--font-family-styrene);
|
|
58
58
|
}
|
|
59
|
-
.
|
|
59
|
+
.typography__medium_1iafb {
|
|
60
60
|
font-size: 26px;
|
|
61
61
|
line-height: 32px;
|
|
62
62
|
font-weight: 600;
|
|
63
63
|
font-family: var(--font-family-system);
|
|
64
64
|
}
|
|
65
|
-
.
|
|
65
|
+
.typography__medium_1iafb.typography__font_1iafb {
|
|
66
66
|
font-weight: 500;
|
|
67
67
|
font-feature-settings: 'ss01';
|
|
68
68
|
font-family: var(--font-family-styrene);
|
|
69
69
|
}
|
|
70
|
-
.typography__regular-
|
|
70
|
+
.typography__regular-medium_1iafb {
|
|
71
71
|
font-size: 26px;
|
|
72
72
|
line-height: 32px;
|
|
73
73
|
font-weight: 400;
|
|
74
74
|
font-family: var(--font-family-system);
|
|
75
75
|
}
|
|
76
|
-
.typography__regular-
|
|
76
|
+
.typography__regular-medium_1iafb.typography__system_1iafb {
|
|
77
77
|
font-feature-settings: 'ss01';
|
|
78
78
|
font-family: var(--font-family-styrene);
|
|
79
79
|
}
|
|
80
|
-
.
|
|
80
|
+
.typography__small_1iafb {
|
|
81
81
|
font-size: 20px;
|
|
82
82
|
line-height: 28px;
|
|
83
83
|
font-weight: 600;
|
|
84
84
|
font-family: var(--font-family-system);
|
|
85
85
|
}
|
|
86
|
-
.
|
|
86
|
+
.typography__small_1iafb.typography__font_1iafb {
|
|
87
87
|
font-weight: 500;
|
|
88
88
|
font-feature-settings: 'ss01';
|
|
89
89
|
font-family: var(--font-family-styrene);
|
|
90
90
|
}
|
|
91
|
-
.typography__regular-
|
|
91
|
+
.typography__regular-small_1iafb {
|
|
92
92
|
font-size: 20px;
|
|
93
93
|
line-height: 28px;
|
|
94
94
|
font-weight: 400;
|
|
95
95
|
font-family: var(--font-family-system);
|
|
96
96
|
}
|
|
97
|
-
.typography__regular-
|
|
97
|
+
.typography__regular-small_1iafb.typography__system_1iafb {
|
|
98
98
|
font-feature-settings: 'ss01';
|
|
99
99
|
font-family: var(--font-family-styrene);
|
|
100
100
|
}
|
|
101
|
-
.
|
|
101
|
+
.typography__xsmall_1iafb {
|
|
102
102
|
font-size: 16px;
|
|
103
103
|
line-height: 20px;
|
|
104
104
|
font-weight: 600;
|
|
105
105
|
font-family: var(--font-family-system);
|
|
106
106
|
}
|
|
107
|
-
.
|
|
107
|
+
.typography__xsmall_1iafb.typography__font_1iafb {
|
|
108
108
|
font-weight: 500;
|
|
109
109
|
font-feature-settings: 'ss01';
|
|
110
110
|
font-family: var(--font-family-styrene);
|
|
111
111
|
}
|
|
112
|
-
.typography__regular-
|
|
112
|
+
.typography__regular-xsmall_1iafb {
|
|
113
113
|
font-size: 16px;
|
|
114
114
|
line-height: 20px;
|
|
115
115
|
font-weight: 400;
|
|
116
116
|
font-family: var(--font-family-system);
|
|
117
117
|
}
|
|
118
|
-
.typography__regular-
|
|
118
|
+
.typography__regular-xsmall_1iafb.typography__system_1iafb {
|
|
119
119
|
font-feature-settings: 'ss01';
|
|
120
120
|
font-family: var(--font-family-styrene);
|
|
121
121
|
}
|
|
122
|
-
.
|
|
122
|
+
.typography__component_1iafb.typography__margins-xlarge_1iafb {
|
|
123
123
|
margin: var(--gap-0) var(--gap-0) var(--gap-24);
|
|
124
124
|
}
|
|
125
|
-
.
|
|
125
|
+
.typography__component_1iafb.typography__margins-large_1iafb {
|
|
126
126
|
margin: var(--gap-40) var(--gap-0) var(--gap-16);
|
|
127
127
|
}
|
|
128
|
-
.
|
|
128
|
+
.typography__component_1iafb.typography__margins-medium_1iafb {
|
|
129
129
|
margin: var(--gap-40) var(--gap-0) var(--gap-16);
|
|
130
130
|
}
|
|
131
|
-
.
|
|
131
|
+
.typography__component_1iafb.typography__margins-small_1iafb {
|
|
132
132
|
margin: var(--gap-40) var(--gap-0) var(--gap-16);
|
|
133
133
|
}
|
|
134
|
-
.
|
|
134
|
+
.typography__component_1iafb .typography__margins-xsmall_1iafb {
|
|
135
135
|
margin: var(--gap-40) var(--gap-0) var(--gap-16);
|
|
136
136
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import './index.css';
|
|
2
2
|
|
|
3
|
-
const styles = {"xlarge":"
|
|
3
|
+
const styles = {"xlarge":"typography__xlarge_1iafb","font":"typography__font_1iafb","regular-xlarge":"typography__regular-xlarge_1iafb","system":"typography__system_1iafb","large":"typography__large_1iafb","regular-large":"typography__regular-large_1iafb","medium":"typography__medium_1iafb","regular-medium":"typography__regular-medium_1iafb","small":"typography__small_1iafb","regular-small":"typography__regular-small_1iafb","xsmall":"typography__xsmall_1iafb","regular-xsmall":"typography__regular-xsmall_1iafb","component":"typography__component_1iafb","margins-xlarge":"typography__margins-xlarge_1iafb","margins-large":"typography__margins-large_1iafb","margins-medium":"typography__margins-medium_1iafb","margins-small":"typography__margins-small_1iafb","margins-xsmall":"typography__margins-xsmall_1iafb"};
|
|
4
4
|
|
|
5
5
|
export { styles as default };
|
|
6
6
|
//# sourceMappingURL=index.module.css.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.module.css.js","sources":["../src/title-mobile/index.module.css"],"sourcesContent":["@import '@alfalab/core-components-vars/src/
|
|
1
|
+
{"version":3,"file":"index.module.css.js","sources":["../src/title-mobile/index.module.css"],"sourcesContent":["@import '@alfalab/core-components-vars/src/index.css';\n@import '../margins.module.css';\n\n@each $view in xlarge, large, medium, small, xsmall {\n .$(view) {\n @mixin headline-system-mobile_$(view);\n\n &.font {\n @subtract-mixin headline-mobile_$(view), headline-system-mobile_$(view);\n }\n }\n\n .regular-$(view) {\n @mixin promo-system-mobile_$(view);\n\n &.system {\n @subtract-mixin promo-mobile_$(view), promo-system-mobile_$(view);\n }\n }\n}\n\n.component {\n &.margins-xlarge {\n @mixin margin-large;\n }\n\n &.margins-large {\n @mixin margin-small;\n }\n\n &.margins-medium {\n @mixin margin-small;\n }\n\n &.margins-small {\n @mixin margin-small;\n }\n\n & .margins-xsmall {\n @mixin margin-small;\n }\n}\n"],"names":[],"mappings":";;AAEgB,eAAe,CAAC,QAAQ,CAAC,0BAA0B,CAAC,MAAM,CAAC,wBAAwB,CAAC,gBAAgB,CAAC,kCAAkC,CAAC,QAAQ,CAAC,0BAA0B,CAAC,OAAO,CAAC,yBAAyB,CAAC,eAAe,CAAC,iCAAiC,CAAC,QAAQ,CAAC,0BAA0B,CAAC,gBAAgB,CAAC,kCAAkC,CAAC,OAAO,CAAC,yBAAyB,CAAC,eAAe,CAAC,iCAAiC,CAAC,QAAQ,CAAC,0BAA0B,CAAC,gBAAgB,CAAC,kCAAkC,CAAC,WAAW,CAAC,6BAA6B,CAAC,gBAAgB,CAAC,kCAAkC,CAAC,eAAe,CAAC,iCAAiC,CAAC,gBAAgB,CAAC,kCAAkC,CAAC,eAAe,CAAC,iCAAiC,CAAC,gBAAgB,CAAC,kCAAkC,CAAC;;;;"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { type TitleProps } from '../title';
|
|
3
|
-
export
|
|
3
|
+
export type TitleResponsiveProps = TitleProps & {
|
|
4
4
|
/**
|
|
5
5
|
* Контрольная точка, с нее начинается desktop версия
|
|
6
6
|
* @default 1024
|
|
@@ -12,30 +12,30 @@ export declare type TitleResponsiveProps = TitleProps & {
|
|
|
12
12
|
client?: 'desktop' | 'mobile';
|
|
13
13
|
};
|
|
14
14
|
export declare const TitleResponsive: React.ForwardRefExoticComponent<Omit<React.HTMLAttributes<HTMLHeadingElement>, "color"> & {
|
|
15
|
-
tag: "
|
|
16
|
-
view?: "
|
|
17
|
-
color?: "
|
|
18
|
-
weight?: "regular" | "medium" | "bold" | "semibold"
|
|
19
|
-
font?: "
|
|
15
|
+
tag: "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "div";
|
|
16
|
+
view?: "xlarge" | "large" | "medium" | "small" | "xsmall";
|
|
17
|
+
color?: import("..").Color;
|
|
18
|
+
weight?: "regular" | "medium" | "bold" | "semibold";
|
|
19
|
+
font?: "styrene" | "system" | "alfasans" | {
|
|
20
20
|
font: "alfasans";
|
|
21
21
|
systemCompat: boolean;
|
|
22
|
-
}
|
|
23
|
-
defaultMargins?: boolean
|
|
24
|
-
className?: string
|
|
25
|
-
dataTestId?: string
|
|
22
|
+
};
|
|
23
|
+
defaultMargins?: boolean;
|
|
24
|
+
className?: string;
|
|
25
|
+
dataTestId?: string;
|
|
26
26
|
children?: React.ReactNode;
|
|
27
|
-
rowLimit?: 1 | 2 | 3
|
|
28
|
-
showSkeleton?: boolean
|
|
29
|
-
skeletonProps?: import("@alfalab/core-components-skeleton").TextSkeletonProps
|
|
30
|
-
defaultMatchMediaValue?: boolean | (() => boolean)
|
|
27
|
+
rowLimit?: 1 | 2 | 3;
|
|
28
|
+
showSkeleton?: boolean;
|
|
29
|
+
skeletonProps?: import("@alfalab/core-components-skeleton").TextSkeletonProps;
|
|
30
|
+
defaultMatchMediaValue?: boolean | (() => boolean);
|
|
31
31
|
} & {
|
|
32
32
|
/**
|
|
33
33
|
* Контрольная точка, с нее начинается desktop версия
|
|
34
34
|
* @default 1024
|
|
35
35
|
*/
|
|
36
|
-
breakpoint?: number
|
|
36
|
+
breakpoint?: number;
|
|
37
37
|
/**
|
|
38
38
|
* Версия, которая будет использоваться при серверном рендеринге
|
|
39
39
|
*/
|
|
40
|
-
client?: "
|
|
40
|
+
client?: "desktop" | "mobile";
|
|
41
41
|
} & React.RefAttributes<HTMLDivElement | HTMLHeadingElement>>;
|
package/modern/types.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export
|
|
1
|
+
export type TextElementType = HTMLParagraphElement | HTMLSpanElement | HTMLDivElement;
|
package/moderncssm/colors.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export declare const colors: readonly ["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", "static-positive"];
|
|
2
|
-
export
|
|
2
|
+
export type Color = (typeof colors)[number];
|
|
@@ -2,8 +2,8 @@ import React, { type HTMLAttributes } from 'react';
|
|
|
2
2
|
import { type TextSkeletonProps } from '@alfalab/core-components-skeleton/moderncssm';
|
|
3
3
|
import { type Color } from '../colors';
|
|
4
4
|
import { type TextElementType } from '../types';
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
type NativeProps = HTMLAttributes<HTMLSpanElement>;
|
|
6
|
+
type TextBaseProps = {
|
|
7
7
|
/**
|
|
8
8
|
* [Вариант начертания](https://core-ds.github.io/core-components/master/?path=/docs/tokens-assets-типографика--docs)
|
|
9
9
|
*/
|
|
@@ -59,10 +59,10 @@ declare type TextBaseProps = {
|
|
|
59
59
|
*/
|
|
60
60
|
font?: 'alfasans' | undefined | null;
|
|
61
61
|
};
|
|
62
|
-
|
|
62
|
+
type TextPTagProps = Omit<TextBaseProps, 'tag' | 'defaultMargins'> & {
|
|
63
63
|
tag?: 'p';
|
|
64
64
|
defaultMargins?: boolean;
|
|
65
65
|
};
|
|
66
|
-
export
|
|
66
|
+
export type TextProps = Omit<NativeProps, 'color'> & (TextBaseProps | TextPTagProps);
|
|
67
67
|
export declare const Text: React.ForwardRefExoticComponent<TextProps & React.RefAttributes<TextElementType>>;
|
|
68
68
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"component.js","sources":["../../src/text/component.tsx"],"sourcesContent":["import React, { forwardRef, type HTMLAttributes } from 'react';\nimport mergeRefs from 'react-merge-refs';\nimport cn from 'classnames';\n\nimport { type TextSkeletonProps, useSkeleton } from '@alfalab/core-components-skeleton';\n\nimport { type Color } from '../colors';\nimport { type TextElementType } from '../types';\n\nimport colors from '../colors.module.css';\nimport styles from './index.module.css';\n\ntype NativeProps = HTMLAttributes<HTMLSpanElement>;\n\ntype TextBaseProps = {\n /**\n * [Вариант начертания](https://core-ds.github.io/core-components/master/?path=/docs/tokens-assets-типографика--docs)\n */\n view?:\n | 'primary-large'\n | 'primary-medium'\n | 'primary-small'\n | 'secondary-large'\n | 'secondary-medium'\n | 'secondary-small'\n | 'component-primary'\n | 'component-secondary'\n | 'caps'\n | 'tagline';\n\n /**\n * Цвет текста\n */\n color?: Color;\n\n /**\n * Толщина шрифта\n */\n weight?: 'regular' | 'medium' | 'bold';\n\n /**\n * Делает цифры моноширинными\n */\n monospaceNumbers?: boolean;\n\n /**\n * HTML тег\n */\n tag?: 'span' | 'div';\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 * Добавляет отступы к тэгу 'p'\n */\n defaultMargins?: never;\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 * Шрифт текста\n *\n * @deprecated\n */\n font?: 'alfasans' | undefined | null;\n};\n\ntype TextPTagProps = Omit<TextBaseProps, 'tag' | 'defaultMargins'> & {\n tag?: 'p';\n defaultMargins?: boolean;\n};\n\nexport type TextProps = Omit<NativeProps, 'color'> & (TextBaseProps | TextPTagProps);\n\nexport const Text = forwardRef<TextElementType, TextProps>(\n (\n {\n view = 'primary-medium',\n tag: Component = 'span',\n weight,\n monospaceNumbers = false,\n defaultMargins = true,\n color,\n className,\n dataTestId,\n children,\n rowLimit,\n showSkeleton,\n skeletonProps,\n font,\n ...restProps\n },\n ref,\n ) => {\n const { renderSkeleton, textRef } = useSkeleton(showSkeleton, skeletonProps);\n\n const skeleton = renderSkeleton({\n wrapperClassName: cn({\n [styles.paragraphWithMargins]: Component === 'p' && defaultMargins,\n }),\n dataTestId,\n });\n\n if (skeleton) {\n return skeleton;\n }\n\n return (\n <Component\n className={cn(\n {\n [styles.paragraph]: Component === 'p' && !defaultMargins,\n [styles.paragraphWithMargins]: Component === 'p' && defaultMargins,\n [styles.monospace]: monospaceNumbers,\n [styles[`rowLimit${rowLimit}`]]: rowLimit,\n [styles.transparent]: showSkeleton,\n },\n className,\n color && colors[color],\n styles[view],\n weight && styles[weight],\n )}\n data-test-id={dataTestId}\n ref={mergeRefs([ref, textRef])}\n {...restProps}\n >\n {children}\n </Component>\n );\n },\n);\n"],"names":[],"mappings":";;;;;;;MAoGa,IAAI,GAAG,UAAU,CAC1B,CACI,EACI,IAAI,GAAG,gBAAgB,EACvB,GAAG,EAAE,SAAS,GAAG,MAAM,EACvB,MAAM,EACN,gBAAgB,GAAG,KAAK,EACxB,cAAc,GAAG,IAAI,EACrB,KAAK,EACL,SAAS,EACT,UAAU,EACV,QAAQ,EACR,QAAQ,EACR,YAAY,EACZ,aAAa,EACb,IAAI,EACJ,GAAG,SAAS,EACf,EACD,GAAG,KACH;AACA,IAAA,MAAM,EAAE,cAAc,EAAE,OAAO,EAAE,GAAG,WAAW,CAAC,YAAY,EAAE,aAAa,CAAC;IAE5E,MAAM,QAAQ,GAAG,cAAc,CAAC;QAC5B,gBAAgB,EAAE,EAAE,CAAC;YACjB,CAAC,MAAM,CAAC,oBAAoB,GAAG,SAAS,KAAK,GAAG,IAAI,cAAc;SACrE,CAAC;QACF,UAAU;AACb,KAAA,CAAC;
|
|
1
|
+
{"version":3,"file":"component.js","sources":["../../src/text/component.tsx"],"sourcesContent":["import React, { forwardRef, type HTMLAttributes } from 'react';\nimport mergeRefs from 'react-merge-refs';\nimport cn from 'classnames';\n\nimport { type TextSkeletonProps, useSkeleton } from '@alfalab/core-components-skeleton';\n\nimport { type Color } from '../colors';\nimport { type TextElementType } from '../types';\n\nimport colors from '../colors.module.css';\nimport styles from './index.module.css';\n\ntype NativeProps = HTMLAttributes<HTMLSpanElement>;\n\ntype TextBaseProps = {\n /**\n * [Вариант начертания](https://core-ds.github.io/core-components/master/?path=/docs/tokens-assets-типографика--docs)\n */\n view?:\n | 'primary-large'\n | 'primary-medium'\n | 'primary-small'\n | 'secondary-large'\n | 'secondary-medium'\n | 'secondary-small'\n | 'component-primary'\n | 'component-secondary'\n | 'caps'\n | 'tagline';\n\n /**\n * Цвет текста\n */\n color?: Color;\n\n /**\n * Толщина шрифта\n */\n weight?: 'regular' | 'medium' | 'bold';\n\n /**\n * Делает цифры моноширинными\n */\n monospaceNumbers?: boolean;\n\n /**\n * HTML тег\n */\n tag?: 'span' | 'div';\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 * Добавляет отступы к тэгу 'p'\n */\n defaultMargins?: never;\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 * Шрифт текста\n *\n * @deprecated\n */\n font?: 'alfasans' | undefined | null;\n};\n\ntype TextPTagProps = Omit<TextBaseProps, 'tag' | 'defaultMargins'> & {\n tag?: 'p';\n defaultMargins?: boolean;\n};\n\nexport type TextProps = Omit<NativeProps, 'color'> & (TextBaseProps | TextPTagProps);\n\nexport const Text = forwardRef<TextElementType, TextProps>(\n (\n {\n view = 'primary-medium',\n tag: Component = 'span',\n weight,\n monospaceNumbers = false,\n defaultMargins = true,\n color,\n className,\n dataTestId,\n children,\n rowLimit,\n showSkeleton,\n skeletonProps,\n font,\n ...restProps\n },\n ref,\n ) => {\n const { renderSkeleton, textRef } = useSkeleton(showSkeleton, skeletonProps);\n\n const skeleton = renderSkeleton({\n wrapperClassName: cn({\n [styles.paragraphWithMargins]: Component === 'p' && defaultMargins,\n }),\n dataTestId,\n });\n\n if (skeleton) {\n return skeleton;\n }\n\n return (\n <Component\n className={cn(\n {\n [styles.paragraph]: Component === 'p' && !defaultMargins,\n [styles.paragraphWithMargins]: Component === 'p' && defaultMargins,\n [styles.monospace]: monospaceNumbers,\n [styles[`rowLimit${rowLimit}`]]: rowLimit,\n [styles.transparent]: showSkeleton,\n },\n className,\n color && colors[color],\n styles[view],\n weight && styles[weight],\n )}\n data-test-id={dataTestId}\n ref={mergeRefs([ref, textRef])}\n {...restProps}\n >\n {children}\n </Component>\n );\n },\n);\n"],"names":[],"mappings":";;;;;;;MAoGa,IAAI,GAAG,UAAU,CAC1B,CACI,EACI,IAAI,GAAG,gBAAgB,EACvB,GAAG,EAAE,SAAS,GAAG,MAAM,EACvB,MAAM,EACN,gBAAgB,GAAG,KAAK,EACxB,cAAc,GAAG,IAAI,EACrB,KAAK,EACL,SAAS,EACT,UAAU,EACV,QAAQ,EACR,QAAQ,EACR,YAAY,EACZ,aAAa,EACb,IAAI,EACJ,GAAG,SAAS,EACf,EACD,GAAG,KACH;AACA,IAAA,MAAM,EAAE,cAAc,EAAE,OAAO,EAAE,GAAG,WAAW,CAAC,YAAY,EAAE,aAAa,CAAC;IAE5E,MAAM,QAAQ,GAAG,cAAc,CAAC;QAC5B,gBAAgB,EAAE,EAAE,CAAC;YACjB,CAAC,MAAM,CAAC,oBAAoB,GAAG,SAAS,KAAK,GAAG,IAAI,cAAc;SACrE,CAAC;QACF,UAAU;AACb,KAAA,CAAC;IAEF,IAAI,QAAQ,EAAE;AACV,QAAA,OAAO,QAAQ;;AAGnB,IAAA,QACI,KAAC,CAAA,aAAA,CAAA,SAAS,IACN,SAAS,EAAE,EAAE,CACT;YACI,CAAC,MAAM,CAAC,SAAS,GAAG,SAAS,KAAK,GAAG,IAAI,CAAC,cAAc;YACxD,CAAC,MAAM,CAAC,oBAAoB,GAAG,SAAS,KAAK,GAAG,IAAI,cAAc;AAClE,YAAA,CAAC,MAAM,CAAC,SAAS,GAAG,gBAAgB;YACpC,CAAC,MAAM,CAAC,CAAW,QAAA,EAAA,QAAQ,EAAE,CAAC,GAAG,QAAQ;AACzC,YAAA,CAAC,MAAM,CAAC,WAAW,GAAG,YAAY;AACrC,SAAA,EACD,SAAS,EACT,KAAK,IAAI,MAAM,CAAC,KAAK,CAAC,EACtB,MAAM,CAAC,IAAI,CAAC,EACZ,MAAM,IAAI,MAAM,CAAC,MAAM,CAAC,CAC3B,EAAA,cAAA,EACa,UAAU,EACxB,GAAG,EAAE,SAAS,CAAC,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC,EAC1B,GAAA,SAAS,IAEZ,QAAQ,CACD;AAEpB,CAAC;;;;"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import React, { type HTMLAttributes } from 'react';
|
|
2
2
|
import { type TextSkeletonProps } from '@alfalab/core-components-skeleton/moderncssm';
|
|
3
3
|
import { type Color } from '../colors';
|
|
4
|
-
|
|
5
|
-
export
|
|
4
|
+
type NativeProps = HTMLAttributes<HTMLHeadingElement>;
|
|
5
|
+
export type TitleProps = Omit<NativeProps, 'color'> & {
|
|
6
6
|
/**
|
|
7
7
|
* HTML тег
|
|
8
8
|
*/
|
|
@@ -61,51 +61,51 @@ export declare type TitleProps = Omit<NativeProps, 'color'> & {
|
|
|
61
61
|
*/
|
|
62
62
|
defaultMatchMediaValue?: boolean | (() => boolean);
|
|
63
63
|
};
|
|
64
|
-
|
|
64
|
+
type PrivateProps = {
|
|
65
65
|
styles: {
|
|
66
66
|
[key: string]: string;
|
|
67
67
|
};
|
|
68
68
|
platform: 'mobile' | 'desktop';
|
|
69
69
|
};
|
|
70
|
-
|
|
70
|
+
type TitleElementType = HTMLHeadingElement | HTMLDivElement;
|
|
71
71
|
export declare const TitleBase: React.ForwardRefExoticComponent<Omit<NativeProps, "color"> & {
|
|
72
72
|
/**
|
|
73
73
|
* HTML тег
|
|
74
74
|
*/
|
|
75
|
-
tag:
|
|
75
|
+
tag: "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "div";
|
|
76
76
|
/**
|
|
77
77
|
* [Вариант начертания](?path=/docs/guidelines-typography--page)
|
|
78
78
|
*/
|
|
79
|
-
view?: "
|
|
79
|
+
view?: "xlarge" | "large" | "medium" | "small" | "xsmall";
|
|
80
80
|
/**
|
|
81
81
|
* Цвет текста
|
|
82
82
|
*/
|
|
83
|
-
color?:
|
|
83
|
+
color?: Color;
|
|
84
84
|
/**
|
|
85
85
|
* Толщина шрифта
|
|
86
86
|
*/
|
|
87
|
-
weight?: "regular" | "medium" | "bold" | "semibold"
|
|
87
|
+
weight?: "regular" | "medium" | "bold" | "semibold";
|
|
88
88
|
/**
|
|
89
89
|
* Шрифт текста
|
|
90
90
|
*
|
|
91
91
|
* @deprecated
|
|
92
92
|
*/
|
|
93
|
-
font?: "
|
|
94
|
-
font:
|
|
93
|
+
font?: "styrene" | "system" | "alfasans" | {
|
|
94
|
+
font: "alfasans";
|
|
95
95
|
systemCompat: boolean;
|
|
96
|
-
}
|
|
96
|
+
};
|
|
97
97
|
/**
|
|
98
98
|
* Добавляет отступы
|
|
99
99
|
*/
|
|
100
|
-
defaultMargins?: boolean
|
|
100
|
+
defaultMargins?: boolean;
|
|
101
101
|
/**
|
|
102
102
|
* Css-класс для стилизации (native prop)
|
|
103
103
|
*/
|
|
104
|
-
className?: string
|
|
104
|
+
className?: string;
|
|
105
105
|
/**
|
|
106
106
|
* Id компонента для тестов
|
|
107
107
|
*/
|
|
108
|
-
dataTestId?: string
|
|
108
|
+
dataTestId?: string;
|
|
109
109
|
/**
|
|
110
110
|
* Контент (native prop)
|
|
111
111
|
*/
|
|
@@ -113,18 +113,18 @@ export declare const TitleBase: React.ForwardRefExoticComponent<Omit<NativeProps
|
|
|
113
113
|
/**
|
|
114
114
|
* Количество строк
|
|
115
115
|
*/
|
|
116
|
-
rowLimit?: 1 | 2 | 3
|
|
116
|
+
rowLimit?: 1 | 2 | 3;
|
|
117
117
|
/**
|
|
118
118
|
* Показать скелетон
|
|
119
119
|
*/
|
|
120
|
-
showSkeleton?: boolean
|
|
120
|
+
showSkeleton?: boolean;
|
|
121
121
|
/**
|
|
122
122
|
* Пропы для скелетона
|
|
123
123
|
*/
|
|
124
|
-
skeletonProps?: TextSkeletonProps
|
|
124
|
+
skeletonProps?: TextSkeletonProps;
|
|
125
125
|
/**
|
|
126
126
|
* Значение по-умолчанию для хука useMatchMedia
|
|
127
127
|
*/
|
|
128
|
-
defaultMatchMediaValue?: boolean | (() => boolean)
|
|
128
|
+
defaultMatchMediaValue?: boolean | (() => boolean);
|
|
129
129
|
} & PrivateProps & React.RefAttributes<TitleElementType>>;
|
|
130
130
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"component.js","sources":["../../src/title/component.tsx"],"sourcesContent":["import React, { forwardRef, type HTMLAttributes } from 'react';\nimport mergeRefs from 'react-merge-refs';\nimport cn from 'classnames';\n\nimport { isObject } from '@alfalab/core-components-shared';\nimport { type TextSkeletonProps, useSkeleton } from '@alfalab/core-components-skeleton';\n\nimport { type Color } from '../colors';\n\nimport { getDefaultWeight } from './utils';\n\nimport colors from '../colors.module.css';\nimport commonStyles from './common.module.css';\n\ntype NativeProps = HTMLAttributes<HTMLHeadingElement>;\n\nexport type TitleProps = Omit<NativeProps, 'color'> & {\n /**\n * HTML тег\n */\n tag: 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6' | 'div';\n\n /**\n * [Вариант начертания](?path=/docs/guidelines-typography--page)\n */\n view?: 'xlarge' | 'large' | 'medium' | 'small' | 'xsmall';\n\n /**\n * Цвет текста\n */\n color?: Color;\n\n /**\n * Толщина шрифта\n */\n weight?: 'regular' | 'medium' | 'bold' | 'semibold';\n\n /**\n * Шрифт текста\n *\n * @deprecated\n */\n font?: 'styrene' | 'system' | 'alfasans' | { font: 'alfasans'; systemCompat: boolean };\n\n /**\n * Добавляет отступы\n */\n defaultMargins?: boolean;\n\n /**\n * Css-класс для стилизации (native prop)\n */\n className?: string;\n\n /**\n * Id компонента для тестов\n */\n dataTestId?: string;\n\n /**\n * Контент (native prop)\n */\n children?: React.ReactNode;\n\n /**\n * Количество строк\n */\n rowLimit?: 1 | 2 | 3;\n\n /**\n * Показать скелетон\n */\n showSkeleton?: boolean;\n\n /**\n * Пропы для скелетона\n */\n skeletonProps?: TextSkeletonProps;\n\n /**\n * Значение по-умолчанию для хука useMatchMedia\n */\n defaultMatchMediaValue?: boolean | (() => boolean);\n};\n\ntype PrivateProps = {\n styles: {\n [key: string]: string;\n };\n platform: 'mobile' | 'desktop';\n};\n\ntype TitleElementType = HTMLHeadingElement | HTMLDivElement;\n\nexport const TitleBase = forwardRef<TitleElementType, TitleProps & PrivateProps>(\n (\n {\n tag: Component = 'div',\n view = 'medium',\n font = 'styrene',\n platform,\n weight = getDefaultWeight(isObject(font) ? font.font : font, platform),\n defaultMargins = false,\n color,\n className,\n dataTestId,\n children,\n rowLimit,\n styles,\n skeletonProps,\n showSkeleton,\n ...restProps\n },\n ref,\n ) => {\n const { renderSkeleton, textRef } = useSkeleton(showSkeleton, skeletonProps);\n\n const skeleton = renderSkeleton({\n wrapperClassName: cn(defaultMargins && styles[`margins-${view}`]),\n dataTestId,\n });\n\n if (skeleton) {\n return skeleton;\n }\n\n return (\n <Component\n className={cn(\n commonStyles.component,\n styles.component,\n className,\n styles[`${weight === 'regular' ? 'regular-' : ''}${view}`],\n defaultMargins && styles[`margins-${view}`],\n color && colors[color],\n {\n [commonStyles[`rowLimit${rowLimit}`]]: rowLimit,\n [commonStyles.transparent]: showSkeleton,\n [styles.font]:\n (isObject(font) && !font.systemCompat) || !(font === 'system'),\n },\n )}\n data-test-id={dataTestId}\n ref={mergeRefs([ref, textRef])}\n {...restProps}\n >\n {children}\n </Component>\n );\n },\n);\n"],"names":[],"mappings":";;;;;;;;;AA8FO,MAAM,SAAS,GAAG,UAAU,CAC/B,CACI,EACI,GAAG,EAAE,SAAS,GAAG,KAAK,EACtB,IAAI,GAAG,QAAQ,EACf,IAAI,GAAG,SAAS,EAChB,QAAQ,EACR,MAAM,GAAG,gBAAgB,CAAC,QAAQ,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC,IAAI,GAAG,IAAI,EAAE,QAAQ,CAAC,EACtE,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;IAE5E,MAAM,QAAQ,GAAG,cAAc,CAAC;QAC5B,gBAAgB,EAAE,EAAE,CAAC,cAAc,IAAI,MAAM,CAAC,CAAW,QAAA,EAAA,IAAI,CAAE,CAAA,CAAC,CAAC;QACjE,UAAU;AACb,KAAA,CAAC;
|
|
1
|
+
{"version":3,"file":"component.js","sources":["../../src/title/component.tsx"],"sourcesContent":["import React, { forwardRef, type HTMLAttributes } from 'react';\nimport mergeRefs from 'react-merge-refs';\nimport cn from 'classnames';\n\nimport { isObject } from '@alfalab/core-components-shared';\nimport { type TextSkeletonProps, useSkeleton } from '@alfalab/core-components-skeleton';\n\nimport { type Color } from '../colors';\n\nimport { getDefaultWeight } from './utils';\n\nimport colors from '../colors.module.css';\nimport commonStyles from './common.module.css';\n\ntype NativeProps = HTMLAttributes<HTMLHeadingElement>;\n\nexport type TitleProps = Omit<NativeProps, 'color'> & {\n /**\n * HTML тег\n */\n tag: 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6' | 'div';\n\n /**\n * [Вариант начертания](?path=/docs/guidelines-typography--page)\n */\n view?: 'xlarge' | 'large' | 'medium' | 'small' | 'xsmall';\n\n /**\n * Цвет текста\n */\n color?: Color;\n\n /**\n * Толщина шрифта\n */\n weight?: 'regular' | 'medium' | 'bold' | 'semibold';\n\n /**\n * Шрифт текста\n *\n * @deprecated\n */\n font?: 'styrene' | 'system' | 'alfasans' | { font: 'alfasans'; systemCompat: boolean };\n\n /**\n * Добавляет отступы\n */\n defaultMargins?: boolean;\n\n /**\n * Css-класс для стилизации (native prop)\n */\n className?: string;\n\n /**\n * Id компонента для тестов\n */\n dataTestId?: string;\n\n /**\n * Контент (native prop)\n */\n children?: React.ReactNode;\n\n /**\n * Количество строк\n */\n rowLimit?: 1 | 2 | 3;\n\n /**\n * Показать скелетон\n */\n showSkeleton?: boolean;\n\n /**\n * Пропы для скелетона\n */\n skeletonProps?: TextSkeletonProps;\n\n /**\n * Значение по-умолчанию для хука useMatchMedia\n */\n defaultMatchMediaValue?: boolean | (() => boolean);\n};\n\ntype PrivateProps = {\n styles: {\n [key: string]: string;\n };\n platform: 'mobile' | 'desktop';\n};\n\ntype TitleElementType = HTMLHeadingElement | HTMLDivElement;\n\nexport const TitleBase = forwardRef<TitleElementType, TitleProps & PrivateProps>(\n (\n {\n tag: Component = 'div',\n view = 'medium',\n font = 'styrene',\n platform,\n weight = getDefaultWeight(isObject(font) ? font.font : font, platform),\n defaultMargins = false,\n color,\n className,\n dataTestId,\n children,\n rowLimit,\n styles,\n skeletonProps,\n showSkeleton,\n ...restProps\n },\n ref,\n ) => {\n const { renderSkeleton, textRef } = useSkeleton(showSkeleton, skeletonProps);\n\n const skeleton = renderSkeleton({\n wrapperClassName: cn(defaultMargins && styles[`margins-${view}`]),\n dataTestId,\n });\n\n if (skeleton) {\n return skeleton;\n }\n\n return (\n <Component\n className={cn(\n commonStyles.component,\n styles.component,\n className,\n styles[`${weight === 'regular' ? 'regular-' : ''}${view}`],\n defaultMargins && styles[`margins-${view}`],\n color && colors[color],\n {\n [commonStyles[`rowLimit${rowLimit}`]]: rowLimit,\n [commonStyles.transparent]: showSkeleton,\n [styles.font]:\n (isObject(font) && !font.systemCompat) || !(font === 'system'),\n },\n )}\n data-test-id={dataTestId}\n ref={mergeRefs([ref, textRef])}\n {...restProps}\n >\n {children}\n </Component>\n );\n },\n);\n"],"names":[],"mappings":";;;;;;;;;AA8FO,MAAM,SAAS,GAAG,UAAU,CAC/B,CACI,EACI,GAAG,EAAE,SAAS,GAAG,KAAK,EACtB,IAAI,GAAG,QAAQ,EACf,IAAI,GAAG,SAAS,EAChB,QAAQ,EACR,MAAM,GAAG,gBAAgB,CAAC,QAAQ,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC,IAAI,GAAG,IAAI,EAAE,QAAQ,CAAC,EACtE,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;IAE5E,MAAM,QAAQ,GAAG,cAAc,CAAC;QAC5B,gBAAgB,EAAE,EAAE,CAAC,cAAc,IAAI,MAAM,CAAC,CAAW,QAAA,EAAA,IAAI,CAAE,CAAA,CAAC,CAAC;QACjE,UAAU;AACb,KAAA,CAAC;IAEF,IAAI,QAAQ,EAAE;AACV,QAAA,OAAO,QAAQ;;IAGnB,QACI,KAAC,CAAA,aAAA,CAAA,SAAS,EACN,EAAA,SAAS,EAAE,EAAE,CACT,YAAY,CAAC,SAAS,EACtB,MAAM,CAAC,SAAS,EAChB,SAAS,EACT,MAAM,CAAC,CAAG,EAAA,MAAM,KAAK,SAAS,GAAG,UAAU,GAAG,EAAE,CAAA,EAAG,IAAI,CAAE,CAAA,CAAC,EAC1D,cAAc,IAAI,MAAM,CAAC,CAAW,QAAA,EAAA,IAAI,CAAE,CAAA,CAAC,EAC3C,KAAK,IAAI,MAAM,CAAC,KAAK,CAAC,EACtB;YACI,CAAC,YAAY,CAAC,CAAW,QAAA,EAAA,QAAQ,EAAE,CAAC,GAAG,QAAQ;AAC/C,YAAA,CAAC,YAAY,CAAC,WAAW,GAAG,YAAY;YACxC,CAAC,MAAM,CAAC,IAAI,GACR,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,YAAY,KAAK,EAAE,IAAI,KAAK,QAAQ,CAAC;AACrE,SAAA,CACJ,kBACa,UAAU,EACxB,GAAG,EAAE,SAAS,CAAC,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC,EAC1B,GAAA,SAAS,IAEZ,QAAQ,CACD;AAEpB,CAAC;;;;"}
|
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { type TitleProps } from './component';
|
|
3
3
|
declare const Title: React.ForwardRefExoticComponent<Omit<React.HTMLAttributes<HTMLHeadingElement>, "color"> & {
|
|
4
|
-
tag: "
|
|
5
|
-
view?: "
|
|
6
|
-
color?: "
|
|
7
|
-
weight?: "regular" | "medium" | "bold" | "semibold"
|
|
8
|
-
font?: "
|
|
4
|
+
tag: "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "div";
|
|
5
|
+
view?: "xlarge" | "large" | "medium" | "small" | "xsmall";
|
|
6
|
+
color?: import("..").Color;
|
|
7
|
+
weight?: "regular" | "medium" | "bold" | "semibold";
|
|
8
|
+
font?: "styrene" | "system" | "alfasans" | {
|
|
9
9
|
font: "alfasans";
|
|
10
10
|
systemCompat: boolean;
|
|
11
|
-
}
|
|
12
|
-
defaultMargins?: boolean
|
|
13
|
-
className?: string
|
|
14
|
-
dataTestId?: string
|
|
11
|
+
};
|
|
12
|
+
defaultMargins?: boolean;
|
|
13
|
+
className?: string;
|
|
14
|
+
dataTestId?: string;
|
|
15
15
|
children?: React.ReactNode;
|
|
16
|
-
rowLimit?: 1 | 2 | 3
|
|
17
|
-
showSkeleton?: boolean
|
|
18
|
-
skeletonProps?: import("@alfalab/core-components-skeleton").TextSkeletonProps
|
|
19
|
-
defaultMatchMediaValue?: boolean | (() => boolean)
|
|
16
|
+
rowLimit?: 1 | 2 | 3;
|
|
17
|
+
showSkeleton?: boolean;
|
|
18
|
+
skeletonProps?: import("@alfalab/core-components-skeleton").TextSkeletonProps;
|
|
19
|
+
defaultMatchMediaValue?: boolean | (() => boolean);
|
|
20
20
|
} & React.RefAttributes<HTMLDivElement | HTMLHeadingElement>>;
|
|
21
21
|
export { Title };
|
|
22
22
|
export type { TitleProps };
|
|
@@ -6,21 +6,21 @@
|
|
|
6
6
|
font-family: var(--font-family-system);
|
|
7
7
|
}
|
|
8
8
|
|
|
9
|
-
.xlarge.font {
|
|
9
|
+
.xlarge.font {
|
|
10
10
|
line-height: 64px;
|
|
11
11
|
font-weight: 500;
|
|
12
12
|
font-feature-settings: 'ss01';
|
|
13
13
|
font-family: var(--font-family-styrene);
|
|
14
14
|
}
|
|
15
15
|
|
|
16
|
-
.regular-xlarge {
|
|
16
|
+
.regular-xlarge {
|
|
17
17
|
font-size: 48px;
|
|
18
18
|
line-height: 52px;
|
|
19
19
|
font-weight: 400;
|
|
20
20
|
font-family: var(--font-family-system);
|
|
21
21
|
}
|
|
22
22
|
|
|
23
|
-
.regular-xlarge.font {
|
|
23
|
+
.regular-xlarge.font {
|
|
24
24
|
line-height: 64px;
|
|
25
25
|
font-feature-settings: 'ss01';
|
|
26
26
|
font-family: var(--font-family-styrene);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","sources":["../../src/title/utils.ts"],"sourcesContent":["export function getDefaultWeight(\n font: 'styrene' | 'system' | 'alfasans',\n platform: 'mobile' | 'desktop',\n) {\n if (font === 'styrene' || font === 'alfasans') {\n return 'medium';\n }\n\n if (platform === 'desktop') {\n return 'bold';\n }\n\n return 'semibold';\n}\n"],"names":[],"mappings":"AAAgB,SAAA,gBAAgB,CAC5B,IAAuC,EACvC,QAA8B,EAAA;
|
|
1
|
+
{"version":3,"file":"utils.js","sources":["../../src/title/utils.ts"],"sourcesContent":["export function getDefaultWeight(\n font: 'styrene' | 'system' | 'alfasans',\n platform: 'mobile' | 'desktop',\n) {\n if (font === 'styrene' || font === 'alfasans') {\n return 'medium';\n }\n\n if (platform === 'desktop') {\n return 'bold';\n }\n\n return 'semibold';\n}\n"],"names":[],"mappings":"AAAgB,SAAA,gBAAgB,CAC5B,IAAuC,EACvC,QAA8B,EAAA;IAE9B,IAAI,IAAI,KAAK,SAAS,IAAI,IAAI,KAAK,UAAU,EAAE;AAC3C,QAAA,OAAO,QAAQ;;AAGnB,IAAA,IAAI,QAAQ,KAAK,SAAS,EAAE;AACxB,QAAA,OAAO,MAAM;;AAGjB,IAAA,OAAO,UAAU;AACrB;;;;"}
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
export declare const TitleMobile: React.ForwardRefExoticComponent<Omit<React.HTMLAttributes<HTMLHeadingElement>, "color"> & {
|
|
3
|
-
tag: "
|
|
4
|
-
view?: "
|
|
5
|
-
color?: "
|
|
6
|
-
weight?: "regular" | "medium" | "bold" | "semibold"
|
|
7
|
-
font?: "
|
|
3
|
+
tag: "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "div";
|
|
4
|
+
view?: "xlarge" | "large" | "medium" | "small" | "xsmall";
|
|
5
|
+
color?: import("..").Color;
|
|
6
|
+
weight?: "regular" | "medium" | "bold" | "semibold";
|
|
7
|
+
font?: "styrene" | "system" | "alfasans" | {
|
|
8
8
|
font: "alfasans";
|
|
9
9
|
systemCompat: boolean;
|
|
10
|
-
}
|
|
11
|
-
defaultMargins?: boolean
|
|
12
|
-
className?: string
|
|
13
|
-
dataTestId?: string
|
|
10
|
+
};
|
|
11
|
+
defaultMargins?: boolean;
|
|
12
|
+
className?: string;
|
|
13
|
+
dataTestId?: string;
|
|
14
14
|
children?: React.ReactNode;
|
|
15
|
-
rowLimit?: 1 | 2 | 3
|
|
16
|
-
showSkeleton?: boolean
|
|
17
|
-
skeletonProps?: import("@alfalab/core-components-skeleton").TextSkeletonProps
|
|
18
|
-
defaultMatchMediaValue?: boolean | (() => boolean)
|
|
15
|
+
rowLimit?: 1 | 2 | 3;
|
|
16
|
+
showSkeleton?: boolean;
|
|
17
|
+
skeletonProps?: import("@alfalab/core-components-skeleton").TextSkeletonProps;
|
|
18
|
+
defaultMatchMediaValue?: boolean | (() => boolean);
|
|
19
19
|
} & React.RefAttributes<HTMLDivElement | HTMLHeadingElement>>;
|
|
@@ -6,20 +6,20 @@
|
|
|
6
6
|
font-family: var(--font-family-system);
|
|
7
7
|
}
|
|
8
8
|
|
|
9
|
-
.xlarge.font {
|
|
9
|
+
.xlarge.font {
|
|
10
10
|
font-weight: 500;
|
|
11
11
|
font-feature-settings: 'ss01';
|
|
12
12
|
font-family: var(--font-family-styrene);
|
|
13
13
|
}
|
|
14
14
|
|
|
15
|
-
.regular-xlarge {
|
|
15
|
+
.regular-xlarge {
|
|
16
16
|
font-size: 34px;
|
|
17
17
|
line-height: 40px;
|
|
18
18
|
font-weight: 400;
|
|
19
19
|
font-family: var(--font-family-system);
|
|
20
20
|
}
|
|
21
21
|
|
|
22
|
-
.regular-xlarge.system {
|
|
22
|
+
.regular-xlarge.system {
|
|
23
23
|
font-feature-settings: 'ss01';
|
|
24
24
|
font-family: var(--font-family-styrene);
|
|
25
25
|
}
|