@snack-uikit/info-block 0.1.0 → 0.1.2-preview-3e45f5dd.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/CHANGELOG.md CHANGED
@@ -3,6 +3,15 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## 0.1.1 (2024-02-05)
7
+
8
+ ### Only dependencies have been changed
9
+ * [@snack-uikit/button@0.16.0](https://github.com/cloud-ru-tech/snack-uikit/blob/master/packages/button/CHANGELOG.md)
10
+
11
+
12
+
13
+
14
+
6
15
  # 0.1.0 (2024-01-25)
7
16
 
8
17
 
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"` | - | Расположение элементов |
@@ -7,7 +7,7 @@ export type InfoBlockProps = WithSupportProps<{
7
7
  /** Заголовок */
8
8
  title?: string;
9
9
  /** Подзаголовок */
10
- description: string;
10
+ description?: string;
11
11
  /** Иконка */
12
12
  icon?: Pick<IconPredefinedProps, 'icon' | 'decor' | 'appearance'>;
13
13
  /** Размер */
@@ -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.0",
7
+ "version": "0.1.2-preview-3e45f5dd.0",
8
8
  "sideEffects": [
9
9
  "*.css",
10
10
  "*.woff",
@@ -32,11 +32,11 @@
32
32
  "license": "Apache-2.0",
33
33
  "scripts": {},
34
34
  "dependencies": {
35
- "@snack-uikit/button": "0.15.1",
35
+ "@snack-uikit/button": "0.16.0",
36
36
  "@snack-uikit/icon-predefined": "0.4.1",
37
37
  "@snack-uikit/typography": "0.6.1",
38
38
  "@snack-uikit/utils": "3.2.0",
39
39
  "classnames": "2.3.2"
40
40
  },
41
- "gitHead": "5a36a5ee9806c9e242baf71859b4d1cde405660f"
41
+ "gitHead": "6326b8595759eed4819ad48fc4ca02ce1dabd7c3"
42
42
  }
@@ -14,7 +14,7 @@ export type InfoBlockProps = WithSupportProps<{
14
14
  /** Заголовок */
15
15
  title?: string;
16
16
  /** Подзаголовок */
17
- description: string;
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
- <Typography
66
- family='sans'
67
- purpose='body'
68
- size={size}
69
- className={styles.description}
70
- data-test-id={TEST_IDS.description}
71
- >
72
- {description}
73
- </Typography>
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
- }