@snack-uikit/info-block 0.1.1 → 0.1.2-preview-3e9a33fa.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/README.md +1 -1
- package/dist/components/InfoBlock/InfoBlock.d.ts +1 -1
- package/dist/components/InfoBlock/InfoBlock.js +1 -1
- package/dist/components/InfoBlock/styles.module.css +16 -8
- package/package.json +2 -2
- package/src/components/InfoBlock/InfoBlock.tsx +12 -10
- package/src/components/InfoBlock/styles.module.scss +18 -8
package/README.md
CHANGED
|
@@ -13,8 +13,8 @@
|
|
|
13
13
|
### Props
|
|
14
14
|
| name | type | default value | description |
|
|
15
15
|
|------|------|---------------|-------------|
|
|
16
|
-
| description* | `string` | - | Подзаголовок |
|
|
17
16
|
| title | `string` | - | Заголовок |
|
|
17
|
+
| description | `string` | - | Подзаголовок |
|
|
18
18
|
| icon | `Pick<IconPredefinedProps, "icon" \| "decor" \| "appearance">` | - | Иконка |
|
|
19
19
|
| size | enum Size: `"s"`, `"m"`, `"l"` | - | Размер |
|
|
20
20
|
| align | enum Align: `"horizontal"`, `"vertical"` | - | Расположение элементов |
|
|
@@ -19,5 +19,5 @@ import styles from './styles.module.css';
|
|
|
19
19
|
export function InfoBlock(_a) {
|
|
20
20
|
var _b, _c;
|
|
21
21
|
var { title, description, icon, size = SIZE.S, footer, align = ALIGN.Vertical, className } = _a, rest = __rest(_a, ["title", "description", "icon", "size", "footer", "align", "className"]);
|
|
22
|
-
return (_jsxs("div", Object.assign({ className: cn(styles.infoBlock, className), "data-size": size, "data-align": align }, extractSupportProps(rest), { children: [icon && (_jsx(IconPredefined, { icon: icon.icon, appearance: (_b = icon.appearance) !== null && _b !== void 0 ? _b : 'primary', decor: (_c = icon.decor) !== null && _c !== void 0 ? _c : true, size: size, "data-test-id": TEST_IDS.icon })), _jsxs("div", { className: styles.contentLayout, children: [_jsxs("div", { className: styles.textWrap, children: [title && (_jsx(Typography, { family: 'sans', purpose: 'title', size: size, className: styles.title, "data-test-id": TEST_IDS.title, children: title })), _jsx(Typography, { family: 'sans', purpose: 'body', size: size, className: styles.description, "data-test-id": TEST_IDS.description, children: description })] }), footer && (_jsx("div", { className: styles.footer, "data-test-id": TEST_IDS.footer, children: footer }))] })] })));
|
|
22
|
+
return (_jsxs("div", Object.assign({ className: cn(styles.infoBlock, className), "data-size": size, "data-align": align }, extractSupportProps(rest), { children: [icon && (_jsx(IconPredefined, { icon: icon.icon, appearance: (_b = icon.appearance) !== null && _b !== void 0 ? _b : 'primary', decor: (_c = icon.decor) !== null && _c !== void 0 ? _c : true, size: size, "data-test-id": TEST_IDS.icon })), _jsxs("div", { className: styles.contentLayout, children: [_jsxs("div", { className: styles.textWrap, children: [title && (_jsx(Typography, { family: 'sans', purpose: 'title', size: size, className: styles.title, "data-test-id": TEST_IDS.title, children: title })), description && (_jsx(Typography, { family: 'sans', purpose: 'body', size: size, className: styles.description, "data-test-id": TEST_IDS.description, children: description }))] }), footer && (_jsx("div", { className: styles.footer, "data-test-id": TEST_IDS.footer, children: footer }))] })] })));
|
|
23
23
|
}
|
|
@@ -14,6 +14,14 @@
|
|
|
14
14
|
width:100%;
|
|
15
15
|
}
|
|
16
16
|
|
|
17
|
+
.title{
|
|
18
|
+
color:var(--sys-neutral-text-main, #333333);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
.description{
|
|
22
|
+
color:var(--sys-neutral-text-support, #565656);
|
|
23
|
+
}
|
|
24
|
+
|
|
17
25
|
.infoBlock{
|
|
18
26
|
display:flex;
|
|
19
27
|
box-sizing:border-box;
|
|
@@ -22,10 +30,18 @@
|
|
|
22
30
|
flex-direction:column;
|
|
23
31
|
align-items:center;
|
|
24
32
|
}
|
|
33
|
+
.infoBlock[data-align=vertical] .contentLayout{
|
|
34
|
+
align-items:center;
|
|
35
|
+
}
|
|
25
36
|
.infoBlock[data-align=vertical] .textWrap{
|
|
26
37
|
align-items:center;
|
|
27
38
|
}
|
|
28
39
|
.infoBlock[data-align=vertical] .footer{
|
|
40
|
+
width:auto;
|
|
41
|
+
text-align:center;
|
|
42
|
+
}
|
|
43
|
+
.infoBlock[data-align=vertical] .description,
|
|
44
|
+
.infoBlock[data-align=vertical] .title{
|
|
29
45
|
text-align:center;
|
|
30
46
|
}
|
|
31
47
|
.infoBlock[data-align=horizontal]{
|
|
@@ -58,12 +74,4 @@
|
|
|
58
74
|
}
|
|
59
75
|
.infoBlock[data-size=l] .textWrap{
|
|
60
76
|
gap:var(--space-info-block-l-container-content-layout-text-wrap-gap, 8px);
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
.title{
|
|
64
|
-
color:var(--sys-neutral-text-main, #333333);
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
.description{
|
|
68
|
-
color:var(--sys-neutral-text-support, #565656);
|
|
69
77
|
}
|
package/package.json
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"access": "public"
|
|
5
5
|
},
|
|
6
6
|
"title": "Info Block",
|
|
7
|
-
"version": "0.1.
|
|
7
|
+
"version": "0.1.2-preview-3e9a33fa.0",
|
|
8
8
|
"sideEffects": [
|
|
9
9
|
"*.css",
|
|
10
10
|
"*.woff",
|
|
@@ -38,5 +38,5 @@
|
|
|
38
38
|
"@snack-uikit/utils": "3.2.0",
|
|
39
39
|
"classnames": "2.3.2"
|
|
40
40
|
},
|
|
41
|
-
"gitHead": "
|
|
41
|
+
"gitHead": "9b4c7f1e424970a764d16e946ca24dd59d8fabc4"
|
|
42
42
|
}
|
|
@@ -14,7 +14,7 @@ export type InfoBlockProps = WithSupportProps<{
|
|
|
14
14
|
/** Заголовок */
|
|
15
15
|
title?: string;
|
|
16
16
|
/** Подзаголовок */
|
|
17
|
-
description
|
|
17
|
+
description?: string;
|
|
18
18
|
/** Иконка */
|
|
19
19
|
icon?: Pick<IconPredefinedProps, 'icon' | 'decor' | 'appearance'>;
|
|
20
20
|
/** Размер */
|
|
@@ -62,15 +62,17 @@ export function InfoBlock({
|
|
|
62
62
|
</Typography>
|
|
63
63
|
)}
|
|
64
64
|
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
65
|
+
{description && (
|
|
66
|
+
<Typography
|
|
67
|
+
family='sans'
|
|
68
|
+
purpose='body'
|
|
69
|
+
size={size}
|
|
70
|
+
className={styles.description}
|
|
71
|
+
data-test-id={TEST_IDS.description}
|
|
72
|
+
>
|
|
73
|
+
{description}
|
|
74
|
+
</Typography>
|
|
75
|
+
)}
|
|
74
76
|
</div>
|
|
75
77
|
|
|
76
78
|
{footer && (
|
|
@@ -18,6 +18,14 @@ $sizes: 's', 'm', 'l';
|
|
|
18
18
|
width: 100%;
|
|
19
19
|
}
|
|
20
20
|
|
|
21
|
+
.title {
|
|
22
|
+
color: $sys-neutral-text-main;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
.description {
|
|
26
|
+
color: $sys-neutral-text-support;
|
|
27
|
+
}
|
|
28
|
+
|
|
21
29
|
.infoBlock {
|
|
22
30
|
display: flex;
|
|
23
31
|
box-sizing: border-box;
|
|
@@ -26,11 +34,21 @@ $sizes: 's', 'm', 'l';
|
|
|
26
34
|
flex-direction: column;
|
|
27
35
|
align-items: center;
|
|
28
36
|
|
|
37
|
+
.contentLayout {
|
|
38
|
+
align-items: center;
|
|
39
|
+
}
|
|
40
|
+
|
|
29
41
|
.textWrap {
|
|
30
42
|
align-items: center;
|
|
31
43
|
}
|
|
32
44
|
|
|
33
45
|
.footer {
|
|
46
|
+
width: auto;
|
|
47
|
+
text-align: center;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
.description,
|
|
51
|
+
.title {
|
|
34
52
|
text-align: center;
|
|
35
53
|
}
|
|
36
54
|
}
|
|
@@ -54,11 +72,3 @@ $sizes: 's', 'm', 'l';
|
|
|
54
72
|
}
|
|
55
73
|
}
|
|
56
74
|
}
|
|
57
|
-
|
|
58
|
-
.title {
|
|
59
|
-
color: $sys-neutral-text-main;
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
.description {
|
|
63
|
-
color: $sys-neutral-text-support;
|
|
64
|
-
}
|