@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
package/text/component.js
CHANGED
|
@@ -20,22 +20,24 @@ var Text = React.forwardRef(function (_a, ref) {
|
|
|
20
20
|
var _b, _c;
|
|
21
21
|
var _d = _a.view, view = _d === void 0 ? 'primary-medium' : _d, _e = _a.tag, Component = _e === void 0 ? 'span' : _e, weight = _a.weight, _f = _a.monospaceNumbers, monospaceNumbers = _f === void 0 ? false : _f, _g = _a.defaultMargins, defaultMargins = _g === void 0 ? true : _g, color = _a.color, className = _a.className, dataTestId = _a.dataTestId, children = _a.children, rowLimit = _a.rowLimit, showSkeleton = _a.showSkeleton, skeletonProps = _a.skeletonProps; _a.font; var restProps = tslib.__rest(_a, ["view", "tag", "weight", "monospaceNumbers", "defaultMargins", "color", "className", "dataTestId", "children", "rowLimit", "showSkeleton", "skeletonProps", "font"]);
|
|
22
22
|
var _h = coreComponentsSkeleton.useSkeleton(showSkeleton, skeletonProps), renderSkeleton = _h.renderSkeleton, textRef = _h.textRef;
|
|
23
|
-
var
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
23
|
+
var Root = showSkeleton ? 'div' : React.Fragment;
|
|
24
|
+
var rootProps = showSkeleton
|
|
25
|
+
? { className: cn__default.default(index_module.root, className) }
|
|
26
|
+
: {};
|
|
27
|
+
return (React__default.default.createElement(Root, tslib.__assign({}, rootProps),
|
|
28
|
+
React__default.default.createElement(Component, tslib.__assign({ className: cn__default.default((_b = {},
|
|
29
|
+
_b[index_module.paragraph] = Component === 'p' && !defaultMargins,
|
|
30
|
+
_b[index_module.paragraphWithMargins] = Component === 'p' && defaultMargins,
|
|
31
|
+
_b[index_module.monospace] = monospaceNumbers,
|
|
32
|
+
_b[index_module["rowLimit".concat(rowLimit)]] = rowLimit,
|
|
33
|
+
_b[index_module.transparent] = showSkeleton,
|
|
34
|
+
_b), !showSkeleton && className, color && colors_module[color], index_module[view], weight && index_module[weight]), "data-test-id": dataTestId, ref: mergeRefs__default.default([ref, textRef]) }, restProps), children),
|
|
35
|
+
showSkeleton && (React__default.default.createElement("div", { className: index_module.skeleton }, renderSkeleton({
|
|
36
|
+
wrapperClassName: cn__default.default((_c = {},
|
|
37
|
+
_c[index_module.paragraphWithMargins] = Component === 'p' && defaultMargins,
|
|
38
|
+
_c)),
|
|
39
|
+
dataTestId: dataTestId,
|
|
40
|
+
})))));
|
|
39
41
|
});
|
|
40
42
|
|
|
41
43
|
exports.Text = Text;
|
package/text/component.js.map
CHANGED
|
@@ -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
|
|
1
|
+
{"version":3,"file":"component.js","sources":["../src/text/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';\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 const Root = showSkeleton ? 'div' : Fragment;\n const rootProps: ComponentProps<typeof Root> = showSkeleton\n ? { className: cn(styles.root, className) }\n : {};\n\n return (\n <Root {...rootProps}>\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 !showSkeleton && 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 {showSkeleton && (\n <div className={styles.skeleton}>\n {renderSkeleton({\n wrapperClassName: cn({\n [styles.paragraphWithMargins]: Component === 'p' && defaultMargins,\n }),\n dataTestId,\n })}\n </div>\n )}\n </Root>\n );\n },\n);\n"],"names":["forwardRef","__rest","useSkeleton","Fragment","cn","styles","React","__assign","colors","mergeRefs"],"mappings":";;;;;;;;;;;;;;;;;;IAoGa,IAAI,GAAGA,gBAAU,CAC1B,UACI,EAeC,EACD,GAAG,EAAA;;IAfC,IAAA,EAAA,GAAA,EAAA,CAAA,IAAuB,CAAvB,CAAA,IAAI,GAAG,EAAA,KAAA,MAAA,GAAA,gBAAgB,GAAA,EAAA,CAAA,CACvB,EAAuB,GAAA,EAAA,CAAA,GAAA,CAAA,CAAlB,SAAS,GAAA,EAAA,KAAA,MAAA,GAAG,MAAM,GAAA,EAAA,CACvB,CAAA,MAAM,GAAA,EAAA,CAAA,MAAA,CAAA,CACN,EAAwB,GAAA,EAAA,CAAA,gBAAA,CAAA,CAAxB,gBAAgB,GAAA,EAAA,KAAA,MAAA,GAAG,KAAK,GAAA,EAAA,CACxB,CAAA,EAAA,GAAA,EAAA,CAAA,cAAqB,CAArB,CAAA,cAAc,GAAG,EAAA,KAAA,MAAA,GAAA,IAAI,KAAA,CACrB,CAAA,KAAK,GAAA,EAAA,CAAA,KAAA,CAAA,CACL,SAAS,GAAA,EAAA,CAAA,SAAA,CACT,CAAA,UAAU,GAAA,EAAA,CAAA,UAAA,CAAA,CACV,QAAQ,GAAA,EAAA,CAAA,QAAA,CACR,CAAA,QAAQ,GAAA,EAAA,CAAA,QAAA,CAAA,CACR,Y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AA,CAAC,YAAY,IAAI,SAAS,EAC1B,KAAK,IAAIG,aAAM,CAAC,KAAK,CAAC,EACtBH,YAAM,CAAC,IAAI,CAAC,EACZ,MAAM,IAAIA,YAAM,CAAC,MAAM,CAAC,CAC3B,EACa,cAAA,EAAA,UAAU,EACxB,GAAG,EAAEI,0BAAS,CAAC,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC,IAC1B,SAAS,CAAA,EAEZ,QAAQ,CACD;QACX,YAAY,KACTH,sBAAA,CAAA,aAAA,CAAA,KAAA,EAAA,EAAK,SAAS,EAAED,YAAM,CAAC,QAAQ,EAC1B,EAAA,cAAc,CAAC;AACZ,YAAA,gBAAgB,EAAED,mBAAE,EAAA,EAAA,GAAA,EAAA;gBAChB,EAAC,CAAAC,YAAM,CAAC,oBAAoB,CAAA,GAAG,SAAS,KAAK,GAAG,IAAI,cAAc;AACpE,gBAAA,EAAA,EAAA;AACF,YAAA,UAAU,EAAA,UAAA;AACb,SAAA,CAAC,CACA,CACT,CACE;AAEf,CAAC;;;;"}
|
package/text/index.css
CHANGED
|
@@ -3,179 +3,213 @@
|
|
|
3
3
|
--gap-12: 12px;
|
|
4
4
|
}
|
|
5
5
|
:root {
|
|
6
|
-
--font-family-
|
|
7
|
-
system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue',
|
|
6
|
+
--font-family-alfasans:
|
|
7
|
+
'Alfa Interface Sans', system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue',
|
|
8
|
+
Helvetica, sans-serif;
|
|
8
9
|
}
|
|
9
|
-
.
|
|
10
|
-
|
|
10
|
+
.typography__transparent_v2xbs {
|
|
11
|
+
visibility: hidden;
|
|
12
|
+
}
|
|
13
|
+
.typography__skeleton_v2xbs {
|
|
14
|
+
position: absolute;
|
|
15
|
+
inset: 0;
|
|
16
|
+
}
|
|
17
|
+
.typography__root_v2xbs {
|
|
18
|
+
position: relative;
|
|
11
19
|
}
|
|
12
20
|
:root {
|
|
13
21
|
--text-paragraph-margin-bottom: var(--gap-0) var(--gap-0) var(--gap-12);
|
|
14
22
|
}
|
|
15
|
-
.
|
|
23
|
+
.typography__paragraph_v2xbs {
|
|
16
24
|
margin: var(--gap-0);
|
|
17
25
|
padding: var(--gap-0);
|
|
18
26
|
}
|
|
19
|
-
.
|
|
27
|
+
.typography__paragraphWithMargins_v2xbs {
|
|
20
28
|
padding: var(--gap-0);
|
|
21
29
|
margin: var(--text-paragraph-margin-bottom);
|
|
22
30
|
}
|
|
23
|
-
.
|
|
31
|
+
.typography__component_v2xbs {
|
|
24
32
|
font-size: 16px;
|
|
25
33
|
line-height: 20px;
|
|
26
34
|
font-weight: 400;
|
|
27
|
-
|
|
35
|
+
letter-spacing: -0.24px;
|
|
36
|
+
font-family: var(--font-family-alfasans);
|
|
28
37
|
}
|
|
29
|
-
.
|
|
38
|
+
.typography__component_v2xbs.typography__bold_v2xbs {
|
|
30
39
|
font-weight: 700;
|
|
40
|
+
letter-spacing: 0.43px;
|
|
31
41
|
}
|
|
32
|
-
.
|
|
42
|
+
.typography__component_v2xbs.typography__medium_v2xbs {
|
|
33
43
|
font-weight: 500;
|
|
44
|
+
letter-spacing: -0.05px;
|
|
34
45
|
}
|
|
35
|
-
.
|
|
46
|
+
.typography__caps_v2xbs {
|
|
36
47
|
font-size: 12px;
|
|
37
48
|
line-height: 16px;
|
|
38
49
|
font-weight: 400;
|
|
39
50
|
letter-spacing: 1.25px;
|
|
40
51
|
text-transform: uppercase;
|
|
41
|
-
font-family: var(--font-family-
|
|
52
|
+
font-family: var(--font-family-alfasans);
|
|
42
53
|
}
|
|
43
|
-
.
|
|
54
|
+
.typography__caps_v2xbs.typography__bold_v2xbs {
|
|
44
55
|
font-weight: 700;
|
|
45
56
|
}
|
|
46
|
-
.
|
|
57
|
+
.typography__caps_v2xbs.typography__medium_v2xbs {
|
|
47
58
|
font-weight: 500;
|
|
48
59
|
}
|
|
49
|
-
.
|
|
60
|
+
.typography__tagline_v2xbs {
|
|
50
61
|
font-size: 12px;
|
|
51
62
|
line-height: 16px;
|
|
52
63
|
font-weight: 400;
|
|
53
64
|
letter-spacing: 1.25px;
|
|
54
65
|
text-transform: uppercase;
|
|
55
|
-
font-family: var(--font-family-
|
|
66
|
+
font-family: var(--font-family-alfasans);
|
|
56
67
|
}
|
|
57
|
-
.
|
|
68
|
+
.typography__tagline_v2xbs.typography__bold_v2xbs {
|
|
58
69
|
font-weight: 700;
|
|
59
70
|
}
|
|
60
|
-
.
|
|
71
|
+
.typography__tagline_v2xbs.typography__medium_v2xbs {
|
|
61
72
|
font-weight: 500;
|
|
62
73
|
}
|
|
63
|
-
.typography__primary-
|
|
74
|
+
.typography__primary-large_v2xbs {
|
|
64
75
|
font-size: 18px;
|
|
65
76
|
line-height: 24px;
|
|
66
77
|
font-weight: 400;
|
|
67
|
-
|
|
78
|
+
letter-spacing: -0.36px;
|
|
79
|
+
font-family: var(--font-family-alfasans);
|
|
68
80
|
}
|
|
69
|
-
.typography__primary-
|
|
81
|
+
.typography__primary-large_v2xbs.typography__bold_v2xbs {
|
|
70
82
|
font-weight: 700;
|
|
83
|
+
letter-spacing: 0.38px;
|
|
71
84
|
}
|
|
72
|
-
.typography__primary-
|
|
85
|
+
.typography__primary-large_v2xbs.typography__medium_v2xbs {
|
|
73
86
|
font-weight: 500;
|
|
87
|
+
letter-spacing: -0.17px;
|
|
74
88
|
}
|
|
75
|
-
.typography__primary-
|
|
89
|
+
.typography__primary-medium_v2xbs {
|
|
76
90
|
font-size: 16px;
|
|
77
91
|
line-height: 24px;
|
|
78
92
|
font-weight: 400;
|
|
79
|
-
|
|
93
|
+
letter-spacing: -0.24px;
|
|
94
|
+
font-family: var(--font-family-alfasans);
|
|
80
95
|
}
|
|
81
|
-
.typography__primary-
|
|
96
|
+
.typography__primary-medium_v2xbs.typography__bold_v2xbs {
|
|
82
97
|
font-weight: 700;
|
|
98
|
+
letter-spacing: 0.43px;
|
|
83
99
|
}
|
|
84
|
-
.typography__primary-
|
|
100
|
+
.typography__primary-medium_v2xbs.typography__medium_v2xbs {
|
|
85
101
|
font-weight: 500;
|
|
102
|
+
letter-spacing: -0.05px;
|
|
86
103
|
}
|
|
87
|
-
.typography__primary-
|
|
104
|
+
.typography__primary-small_v2xbs {
|
|
88
105
|
font-size: 14px;
|
|
89
106
|
line-height: 20px;
|
|
90
107
|
font-weight: 400;
|
|
91
|
-
|
|
108
|
+
letter-spacing: -0.08px;
|
|
109
|
+
font-family: var(--font-family-alfasans);
|
|
92
110
|
}
|
|
93
|
-
.typography__primary-
|
|
111
|
+
.typography__primary-small_v2xbs.typography__bold_v2xbs {
|
|
94
112
|
font-weight: 700;
|
|
113
|
+
letter-spacing: 0.47px;
|
|
95
114
|
}
|
|
96
|
-
.typography__primary-
|
|
115
|
+
.typography__primary-small_v2xbs.typography__medium_v2xbs {
|
|
97
116
|
font-weight: 500;
|
|
117
|
+
letter-spacing: 0.07px;
|
|
98
118
|
}
|
|
99
|
-
.typography__component-
|
|
119
|
+
.typography__component-primary_v2xbs {
|
|
100
120
|
font-size: 16px;
|
|
101
121
|
line-height: 20px;
|
|
102
122
|
font-weight: 400;
|
|
103
|
-
|
|
123
|
+
letter-spacing: -0.24px;
|
|
124
|
+
font-family: var(--font-family-alfasans);
|
|
104
125
|
}
|
|
105
|
-
.typography__component-
|
|
126
|
+
.typography__component-primary_v2xbs.typography__bold_v2xbs {
|
|
106
127
|
font-weight: 700;
|
|
128
|
+
letter-spacing: 0.43px;
|
|
107
129
|
}
|
|
108
|
-
.typography__component-
|
|
130
|
+
.typography__component-primary_v2xbs.typography__medium_v2xbs {
|
|
109
131
|
font-weight: 500;
|
|
132
|
+
letter-spacing: -0.05px;
|
|
110
133
|
}
|
|
111
|
-
.typography__secondary-
|
|
134
|
+
.typography__secondary-large_v2xbs {
|
|
112
135
|
font-size: 13px;
|
|
113
136
|
line-height: 16px;
|
|
114
137
|
font-weight: 400;
|
|
115
|
-
font-family: var(--font-family-
|
|
138
|
+
font-family: var(--font-family-alfasans);
|
|
116
139
|
}
|
|
117
|
-
.typography__secondary-
|
|
140
|
+
.typography__secondary-large_v2xbs.typography__bold_v2xbs {
|
|
118
141
|
font-weight: 700;
|
|
142
|
+
letter-spacing: 0.54px;
|
|
119
143
|
}
|
|
120
|
-
.typography__secondary-
|
|
144
|
+
.typography__secondary-large_v2xbs.typography__medium_v2xbs {
|
|
121
145
|
font-weight: 500;
|
|
146
|
+
letter-spacing: 0.13px;
|
|
122
147
|
}
|
|
123
|
-
.typography__secondary-
|
|
148
|
+
.typography__secondary-medium_v2xbs {
|
|
124
149
|
font-size: 12px;
|
|
125
150
|
line-height: 16px;
|
|
126
151
|
font-weight: 400;
|
|
127
|
-
|
|
152
|
+
letter-spacing: 0.06px;
|
|
153
|
+
font-family: var(--font-family-alfasans);
|
|
128
154
|
}
|
|
129
|
-
.typography__secondary-
|
|
155
|
+
.typography__secondary-medium_v2xbs.typography__bold_v2xbs {
|
|
130
156
|
font-weight: 700;
|
|
157
|
+
letter-spacing: 0.57px;
|
|
131
158
|
}
|
|
132
|
-
.typography__secondary-
|
|
159
|
+
.typography__secondary-medium_v2xbs.typography__medium_v2xbs {
|
|
133
160
|
font-weight: 500;
|
|
161
|
+
letter-spacing: 0.19px;
|
|
134
162
|
}
|
|
135
|
-
.typography__secondary-
|
|
163
|
+
.typography__secondary-small_v2xbs {
|
|
136
164
|
font-size: 11px;
|
|
137
165
|
line-height: 16px;
|
|
138
166
|
font-weight: 400;
|
|
139
|
-
|
|
167
|
+
letter-spacing: 0.15px;
|
|
168
|
+
font-family: var(--font-family-alfasans);
|
|
140
169
|
}
|
|
141
|
-
.typography__secondary-
|
|
170
|
+
.typography__secondary-small_v2xbs.typography__bold_v2xbs {
|
|
142
171
|
font-weight: 700;
|
|
172
|
+
letter-spacing: 0.54px;
|
|
143
173
|
}
|
|
144
|
-
.typography__secondary-
|
|
174
|
+
.typography__secondary-small_v2xbs.typography__medium_v2xbs {
|
|
145
175
|
font-weight: 500;
|
|
176
|
+
letter-spacing: 0.24px;
|
|
146
177
|
}
|
|
147
|
-
.typography__component-
|
|
178
|
+
.typography__component-secondary_v2xbs {
|
|
148
179
|
font-size: 14px;
|
|
149
180
|
line-height: 18px;
|
|
150
181
|
font-weight: 400;
|
|
151
|
-
|
|
182
|
+
letter-spacing: -0.08px;
|
|
183
|
+
font-family: var(--font-family-alfasans);
|
|
152
184
|
}
|
|
153
|
-
.typography__component-
|
|
185
|
+
.typography__component-secondary_v2xbs.typography__bold_v2xbs {
|
|
154
186
|
font-weight: 700;
|
|
187
|
+
letter-spacing: 0.47px;
|
|
155
188
|
}
|
|
156
|
-
.typography__component-
|
|
189
|
+
.typography__component-secondary_v2xbs.typography__medium_v2xbs {
|
|
157
190
|
font-weight: 500;
|
|
191
|
+
letter-spacing: 0.07px;
|
|
158
192
|
}
|
|
159
|
-
.
|
|
193
|
+
.typography__rowLimit1_v2xbs {
|
|
160
194
|
-webkit-line-clamp: 1;
|
|
161
195
|
display: -webkit-box;
|
|
162
196
|
-webkit-box-orient: vertical;
|
|
163
197
|
overflow: hidden;
|
|
164
198
|
word-break: break-all;
|
|
165
199
|
}
|
|
166
|
-
.
|
|
200
|
+
.typography__rowLimit2_v2xbs {
|
|
167
201
|
-webkit-line-clamp: 2;
|
|
168
202
|
display: -webkit-box;
|
|
169
203
|
-webkit-box-orient: vertical;
|
|
170
204
|
overflow: hidden;
|
|
171
205
|
}
|
|
172
|
-
.
|
|
206
|
+
.typography__rowLimit3_v2xbs {
|
|
173
207
|
-webkit-line-clamp: 3;
|
|
174
208
|
display: -webkit-box;
|
|
175
209
|
-webkit-box-orient: vertical;
|
|
176
210
|
overflow: hidden;
|
|
177
211
|
}
|
|
178
|
-
.
|
|
212
|
+
.typography__monospace_v2xbs {
|
|
179
213
|
font-feature-settings: "tnum";
|
|
180
214
|
font-variant-numeric: tabular-nums;
|
|
181
215
|
}
|
package/text/index.module.css.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
require('./index.css');
|
|
4
4
|
|
|
5
|
-
var styles = {"transparent":"
|
|
5
|
+
var styles = {"transparent":"typography__transparent_v2xbs","skeleton":"typography__skeleton_v2xbs","root":"typography__root_v2xbs","paragraph":"typography__paragraph_v2xbs","paragraphWithMargins":"typography__paragraphWithMargins_v2xbs","component":"typography__component_v2xbs","bold":"typography__bold_v2xbs","medium":"typography__medium_v2xbs","caps":"typography__caps_v2xbs","tagline":"typography__tagline_v2xbs","primary-large":"typography__primary-large_v2xbs","primary-medium":"typography__primary-medium_v2xbs","primary-small":"typography__primary-small_v2xbs","component-primary":"typography__component-primary_v2xbs","secondary-large":"typography__secondary-large_v2xbs","secondary-medium":"typography__secondary-medium_v2xbs","secondary-small":"typography__secondary-small_v2xbs","component-secondary":"typography__component-secondary_v2xbs","rowLimit1":"typography__rowLimit1_v2xbs","rowLimit2":"typography__rowLimit2_v2xbs","rowLimit3":"typography__rowLimit3_v2xbs","monospace":"typography__monospace_v2xbs"};
|
|
6
6
|
|
|
7
7
|
module.exports = styles;
|
|
8
8
|
//# sourceMappingURL=index.module.css.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.module.css.js","sources":["../src/text/index.module.css"],"sourcesContent":["@import '@alfalab/core-components-vars/src/index.css';\n@import '../common.module.css';\n\n:root {\n --text-paragraph-margin-bottom: var(--gap-0) var(--gap-0) var(--gap-12);\n}\n\n.paragraph {\n margin: var(--gap-0);\n padding: var(--gap-0);\n}\n\n.paragraphWithMargins {\n padding: var(--gap-0);\n margin: var(--text-paragraph-margin-bottom);\n}\n\n@each $view in component, caps, tagline {\n .$(view) {\n @mixin paragraph_$(view);\n }\n\n .$(view).bold {\n @subtract-mixin accent_$(view), paragraph_$(view);\n }\n\n .$(view).medium {\n @subtract-mixin action_$(view), paragraph_$(view);\n }\n}\n\n@each $kind in primary, secondary {\n @each $size in large, medium, small {\n .$(kind)-$(size) {\n /* prettier-ignore */\n @mixin paragraph_$(kind)_$(size);\n }\n\n .$(kind)-$(size).bold {\n @subtract-mixin accent_$(kind)_$(size), paragraph_$(kind)_$(size);\n }\n\n .$(kind)-$(size).medium {\n @subtract-mixin action_$(kind)_$(size), paragraph_$(kind)_$(size);\n }\n }\n\n .component-$(kind) {\n @mixin paragraph_component_$(kind);\n\n &.bold {\n @subtract-mixin accent_component_$(kind), paragraph_component_$(kind);\n }\n\n &.medium {\n @subtract-mixin action_component_$(kind), paragraph_component_$(kind);\n }\n }\n}\n\n.rowLimit1 {\n @mixin row_limit 1;\n word-break: break-all;\n}\n\n.rowLimit2 {\n @mixin row_limit 2;\n}\n\n.rowLimit3 {\n @mixin row_limit 3;\n}\n\n.monospace {\n font-variant-numeric: tabular-nums;\n}\n"],"names":[],"mappings":";;;;AAEgB,aAAe,CAAC,aAAa,CAAC,+BAA+B,CAAC,WAAW,CAAC,6BAA6B,CAAC,sBAAsB,CAAC,wCAAwC,CAAC,WAAW,CAAC,6BAA6B,CAAC,MAAM,CAAC,wBAAwB,CAAC,QAAQ,CAAC,0BAA0B,CAAC,MAAM,CAAC,wBAAwB,CAAC,SAAS,CAAC,2BAA2B,CAAC,eAAe,CAAC,iCAAiC,CAAC,gBAAgB,CAAC,kCAAkC,CAAC,eAAe,CAAC,iCAAiC,CAAC,mBAAmB,CAAC,qCAAqC,CAAC,iBAAiB,CAAC,mCAAmC,CAAC,kBAAkB,CAAC,oCAAoC,CAAC,iBAAiB,CAAC,mCAAmC,CAAC,qBAAqB,CAAC,uCAAuC,CAAC,WAAW,CAAC,6BAA6B,CAAC,WAAW,CAAC,6BAA6B,CAAC,WAAW,CAAC,6BAA6B,CAAC,WAAW,CAAC,6BAA6B,CAAC;;;;"}
|
|
1
|
+
{"version":3,"file":"index.module.css.js","sources":["../src/text/index.module.css"],"sourcesContent":["@import '@alfalab/core-components-vars/src/index.css';\n@import '../common.module.css';\n\n:root {\n --text-paragraph-margin-bottom: var(--gap-0) var(--gap-0) var(--gap-12);\n}\n\n.paragraph {\n margin: var(--gap-0);\n padding: var(--gap-0);\n}\n\n.paragraphWithMargins {\n padding: var(--gap-0);\n margin: var(--text-paragraph-margin-bottom);\n}\n\n@each $view in component, caps, tagline {\n .$(view) {\n @mixin paragraph_$(view);\n }\n\n .$(view).bold {\n @subtract-mixin accent_$(view), paragraph_$(view);\n }\n\n .$(view).medium {\n @subtract-mixin action_$(view), paragraph_$(view);\n }\n}\n\n@each $kind in primary, secondary {\n @each $size in large, medium, small {\n .$(kind)-$(size) {\n /* prettier-ignore */\n @mixin paragraph_$(kind)_$(size);\n }\n\n .$(kind)-$(size).bold {\n @subtract-mixin accent_$(kind)_$(size), paragraph_$(kind)_$(size);\n }\n\n .$(kind)-$(size).medium {\n @subtract-mixin action_$(kind)_$(size), paragraph_$(kind)_$(size);\n }\n }\n\n .component-$(kind) {\n @mixin paragraph_component_$(kind);\n\n &.bold {\n @subtract-mixin accent_component_$(kind), paragraph_component_$(kind);\n }\n\n &.medium {\n @subtract-mixin action_component_$(kind), paragraph_component_$(kind);\n }\n }\n}\n\n.rowLimit1 {\n @mixin row_limit 1;\n word-break: break-all;\n}\n\n.rowLimit2 {\n @mixin row_limit 2;\n}\n\n.rowLimit3 {\n @mixin row_limit 3;\n}\n\n.monospace {\n font-variant-numeric: tabular-nums;\n}\n"],"names":[],"mappings":";;;;AAEgB,aAAe,CAAC,aAAa,CAAC,+BAA+B,CAAC,UAAU,CAAC,4BAA4B,CAAC,MAAM,CAAC,wBAAwB,CAAC,WAAW,CAAC,6BAA6B,CAAC,sBAAsB,CAAC,wCAAwC,CAAC,WAAW,CAAC,6BAA6B,CAAC,MAAM,CAAC,wBAAwB,CAAC,QAAQ,CAAC,0BAA0B,CAAC,MAAM,CAAC,wBAAwB,CAAC,SAAS,CAAC,2BAA2B,CAAC,eAAe,CAAC,iCAAiC,CAAC,gBAAgB,CAAC,kCAAkC,CAAC,eAAe,CAAC,iCAAiC,CAAC,mBAAmB,CAAC,qCAAqC,CAAC,iBAAiB,CAAC,mCAAmC,CAAC,kBAAkB,CAAC,oCAAoC,CAAC,iBAAiB,CAAC,mCAAmC,CAAC,qBAAqB,CAAC,uCAAuC,CAAC,WAAW,CAAC,6BAA6B,CAAC,WAAW,CAAC,6BAA6B,CAAC,WAAW,CAAC,6BAA6B,CAAC,WAAW,CAAC,6BAA6B,CAAC;;;;"}
|
package/title/common.css
CHANGED
|
@@ -1,27 +1,34 @@
|
|
|
1
1
|
:root {
|
|
2
2
|
--gap-0: 0px;
|
|
3
3
|
}
|
|
4
|
-
.
|
|
5
|
-
|
|
4
|
+
.typography__transparent_lpbzh {
|
|
5
|
+
visibility: hidden;
|
|
6
6
|
}
|
|
7
|
-
.
|
|
7
|
+
.typography__skeleton_lpbzh {
|
|
8
|
+
position: absolute;
|
|
9
|
+
inset: 0;
|
|
10
|
+
}
|
|
11
|
+
.typography__root_lpbzh {
|
|
12
|
+
position: relative;
|
|
13
|
+
}
|
|
14
|
+
.typography__component_lpbzh {
|
|
8
15
|
margin: var(--gap-0);
|
|
9
16
|
padding: var(--gap-0);
|
|
10
17
|
}
|
|
11
|
-
.
|
|
18
|
+
.typography__rowLimit1_lpbzh {
|
|
12
19
|
-webkit-line-clamp: 1;
|
|
13
20
|
display: -webkit-box;
|
|
14
21
|
-webkit-box-orient: vertical;
|
|
15
22
|
overflow: hidden;
|
|
16
23
|
word-break: break-all;
|
|
17
24
|
}
|
|
18
|
-
.
|
|
25
|
+
.typography__rowLimit2_lpbzh {
|
|
19
26
|
-webkit-line-clamp: 2;
|
|
20
27
|
display: -webkit-box;
|
|
21
28
|
-webkit-box-orient: vertical;
|
|
22
29
|
overflow: hidden;
|
|
23
30
|
}
|
|
24
|
-
.
|
|
31
|
+
.typography__rowLimit3_lpbzh {
|
|
25
32
|
-webkit-line-clamp: 3;
|
|
26
33
|
display: -webkit-box;
|
|
27
34
|
-webkit-box-orient: vertical;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
require('./common.css');
|
|
4
4
|
|
|
5
|
-
var commonStyles = {"transparent":"
|
|
5
|
+
var commonStyles = {"transparent":"typography__transparent_lpbzh","skeleton":"typography__skeleton_lpbzh","root":"typography__root_lpbzh","component":"typography__component_lpbzh","rowLimit1":"typography__rowLimit1_lpbzh","rowLimit2":"typography__rowLimit2_lpbzh","rowLimit3":"typography__rowLimit3_lpbzh"};
|
|
6
6
|
|
|
7
7
|
module.exports = commonStyles;
|
|
8
8
|
//# sourceMappingURL=common.module.css.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"common.module.css.js","sources":["../src/title/common.module.css"],"sourcesContent":["@import '@alfalab/core-components-vars/src/index.css';\n@import '../common.module.css';\n\n.component {\n margin: var(--gap-0);\n padding: var(--gap-0);\n}\n\n.rowLimit1 {\n @mixin row_limit 1;\n word-break: break-all;\n}\n\n.rowLimit2 {\n @mixin row_limit 2;\n}\n\n.rowLimit3 {\n @mixin row_limit 3;\n}\n"],"names":[],"mappings":";;;;AAEgB,mBAAe,CAAC,aAAa,CAAC,+BAA+B,CAAC,WAAW,CAAC,6BAA6B,CAAC,WAAW,CAAC,6BAA6B,CAAC,WAAW,CAAC,6BAA6B,CAAC,WAAW,CAAC,6BAA6B,CAAC;;;;"}
|
|
1
|
+
{"version":3,"file":"common.module.css.js","sources":["../src/title/common.module.css"],"sourcesContent":["@import '@alfalab/core-components-vars/src/index.css';\n@import '../common.module.css';\n\n.component {\n margin: var(--gap-0);\n padding: var(--gap-0);\n}\n\n.rowLimit1 {\n @mixin row_limit 1;\n word-break: break-all;\n}\n\n.rowLimit2 {\n @mixin row_limit 2;\n}\n\n.rowLimit3 {\n @mixin row_limit 3;\n}\n"],"names":[],"mappings":";;;;AAEgB,mBAAe,CAAC,aAAa,CAAC,+BAA+B,CAAC,UAAU,CAAC,4BAA4B,CAAC,MAAM,CAAC,wBAAwB,CAAC,WAAW,CAAC,6BAA6B,CAAC,WAAW,CAAC,6BAA6B,CAAC,WAAW,CAAC,6BAA6B,CAAC,WAAW,CAAC,6BAA6B,CAAC;;;;"}
|
package/title/component.d.ts
CHANGED
|
@@ -22,10 +22,7 @@ export type TitleProps = Omit<NativeProps, 'color'> & {
|
|
|
22
22
|
/**
|
|
23
23
|
* Шрифт текста
|
|
24
24
|
*/
|
|
25
|
-
font?: 'styrene' | 'system'
|
|
26
|
-
font: 'alfasans';
|
|
27
|
-
systemCompat: boolean;
|
|
28
|
-
};
|
|
25
|
+
font?: 'styrene' | 'system';
|
|
29
26
|
/**
|
|
30
27
|
* Добавляет отступы
|
|
31
28
|
*/
|
|
@@ -86,10 +83,7 @@ export declare const TitleBase: React.ForwardRefExoticComponent<Omit<NativeProps
|
|
|
86
83
|
/**
|
|
87
84
|
* Шрифт текста
|
|
88
85
|
*/
|
|
89
|
-
font?: "styrene" | "system"
|
|
90
|
-
font: "alfasans";
|
|
91
|
-
systemCompat: boolean;
|
|
92
|
-
};
|
|
86
|
+
font?: "styrene" | "system";
|
|
93
87
|
/**
|
|
94
88
|
* Добавляет отступы
|
|
95
89
|
*/
|
package/title/component.js
CHANGED
|
@@ -6,9 +6,7 @@ var tslib = require('tslib');
|
|
|
6
6
|
var React = require('react');
|
|
7
7
|
var mergeRefs = require('react-merge-refs');
|
|
8
8
|
var cn = require('classnames');
|
|
9
|
-
var coreComponentsShared = require('@alfalab/core-components-shared');
|
|
10
9
|
var coreComponentsSkeleton = require('@alfalab/core-components-skeleton');
|
|
11
|
-
var utils = require('./utils.js');
|
|
12
10
|
var colors_module = require('../colors.module.css.js');
|
|
13
11
|
var common_module = require('./common.module.css.js');
|
|
14
12
|
|
|
@@ -20,20 +18,21 @@ var cn__default = /*#__PURE__*/_interopDefaultCompat(cn);
|
|
|
20
18
|
|
|
21
19
|
var TitleBase = React.forwardRef(function (_a, ref) {
|
|
22
20
|
var _b;
|
|
23
|
-
var _c = _a.tag, Component = _c === void 0 ? 'div' : _c, _d = _a.view, view = _d === void 0 ? 'medium' : _d
|
|
24
|
-
var
|
|
25
|
-
var
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
21
|
+
var _c = _a.tag, Component = _c === void 0 ? 'div' : _c, _d = _a.view, view = _d === void 0 ? 'medium' : _d; _a.font; _a.platform; var _e = _a.weight, weight = _e === void 0 ? 'bold' : _e, _f = _a.defaultMargins, defaultMargins = _f === void 0 ? false : _f, color = _a.color, className = _a.className, dataTestId = _a.dataTestId, children = _a.children, rowLimit = _a.rowLimit, styles = _a.styles, skeletonProps = _a.skeletonProps, showSkeleton = _a.showSkeleton, restProps = tslib.__rest(_a, ["tag", "view", "font", "platform", "weight", "defaultMargins", "color", "className", "dataTestId", "children", "rowLimit", "styles", "skeletonProps", "showSkeleton"]);
|
|
22
|
+
var _g = coreComponentsSkeleton.useSkeleton(showSkeleton, skeletonProps), renderSkeleton = _g.renderSkeleton, textRef = _g.textRef;
|
|
23
|
+
var Root = showSkeleton ? 'div' : React.Fragment;
|
|
24
|
+
var rootProps = showSkeleton
|
|
25
|
+
? { className: cn__default.default(common_module.root, className) }
|
|
26
|
+
: {};
|
|
27
|
+
return (React__default.default.createElement(Root, tslib.__assign({}, rootProps),
|
|
28
|
+
React__default.default.createElement(Component, tslib.__assign({ className: cn__default.default(common_module.component, styles.component, !showSkeleton && className, styles["".concat(weight === 'regular' ? 'regular-' : '').concat(view)], defaultMargins && styles["margins-".concat(view)], color && colors_module[color], (_b = {},
|
|
29
|
+
_b[common_module["rowLimit".concat(rowLimit)]] = rowLimit,
|
|
30
|
+
_b[common_module.transparent] = showSkeleton,
|
|
31
|
+
_b)), "data-test-id": dataTestId, ref: mergeRefs__default.default([ref, textRef]) }, restProps), children),
|
|
32
|
+
showSkeleton && (React__default.default.createElement("div", { className: common_module.skeleton }, renderSkeleton({
|
|
33
|
+
wrapperClassName: cn__default.default(defaultMargins && styles["margins-".concat(view)]),
|
|
34
|
+
dataTestId: dataTestId,
|
|
35
|
+
})))));
|
|
37
36
|
});
|
|
38
37
|
|
|
39
38
|
exports.TitleBase = TitleBase;
|
package/title/component.js.map
CHANGED
|
@@ -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":["forwardRef","__rest","useSkeleton","Fragment","cn","commonStyles","React","__assign","colors","mergeRefs"],"mappings":";;;;;;;;;;;;;;;;;;IAyFa,SAAS,GAAGA,gBAAU,CAC/B,UACI,EAgBC,EACD,GAAG,EAAA;;AAhBC,IAAA,IAAA,EAAsB,GAAA,EAAA,CAAA,GAAA,CAAA,CAAjB,SAAS,GAAA,EAAA,KAAA,MAAA,GAAG,KAAK,GAAA,EAAA,CACtB,CAAA,EAAA,GAAA,EAAA,CAAA,IAAe,CAAf,CAAA,IAAI,GAAG,EAAA,KA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