@cloud-ru/ds-info-block 1.0.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.
Files changed (42) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/LICENSE +201 -0
  3. package/README.md +115 -0
  4. package/dist/cjs/components/InfoBlock/InfoBlock.d.ts +21 -0
  5. package/dist/cjs/components/InfoBlock/InfoBlock.js +18 -0
  6. package/dist/cjs/components/InfoBlock/index.d.ts +1 -0
  7. package/dist/cjs/components/InfoBlock/index.js +17 -0
  8. package/dist/cjs/components/InfoBlock/styles.module.css +144 -0
  9. package/dist/cjs/components/index.d.ts +1 -0
  10. package/dist/cjs/components/index.js +17 -0
  11. package/dist/cjs/constants.d.ts +21 -0
  12. package/dist/cjs/constants.js +24 -0
  13. package/dist/cjs/index.d.ts +3 -0
  14. package/dist/cjs/index.js +19 -0
  15. package/dist/cjs/package.json +3 -0
  16. package/dist/cjs/style.css +144 -0
  17. package/dist/cjs/types.d.ts +4 -0
  18. package/dist/cjs/types.js +2 -0
  19. package/dist/esm/components/InfoBlock/InfoBlock.d.ts +21 -0
  20. package/dist/esm/components/InfoBlock/InfoBlock.js +12 -0
  21. package/dist/esm/components/InfoBlock/index.d.ts +1 -0
  22. package/dist/esm/components/InfoBlock/index.js +1 -0
  23. package/dist/esm/components/InfoBlock/styles.module.css +144 -0
  24. package/dist/esm/components/index.d.ts +1 -0
  25. package/dist/esm/components/index.js +1 -0
  26. package/dist/esm/constants.d.ts +21 -0
  27. package/dist/esm/constants.js +21 -0
  28. package/dist/esm/index.d.ts +3 -0
  29. package/dist/esm/index.js +3 -0
  30. package/dist/esm/style.css +144 -0
  31. package/dist/esm/types.d.ts +4 -0
  32. package/dist/esm/types.js +1 -0
  33. package/dist/tsconfig.cjs.tsbuildinfo +1 -0
  34. package/dist/tsconfig.esm.tsbuildinfo +1 -0
  35. package/package.json +43 -0
  36. package/src/components/InfoBlock/InfoBlock.tsx +81 -0
  37. package/src/components/InfoBlock/index.ts +1 -0
  38. package/src/components/InfoBlock/styles.module.scss +109 -0
  39. package/src/components/index.ts +1 -0
  40. package/src/constants.ts +24 -0
  41. package/src/index.ts +3 -0
  42. package/src/types.ts +6 -0
@@ -0,0 +1,109 @@
1
+ @use '@cloud-ru/ds-figma-variables/build/scss/styles/styles.module' as base;
2
+ @use '@cloud-ru/ds-figma-variables/build/scss/components/infoBlock.module' as infoBlock;
3
+
4
+ $sizes: 's', 'm', 'l';
5
+
6
+ .contentLayout {
7
+ display: flex;
8
+ flex-direction: column;
9
+ }
10
+
11
+ .textWrap {
12
+ display: flex;
13
+ flex-direction: column;
14
+ }
15
+
16
+ .footer {
17
+ position: relative;
18
+ box-sizing: border-box;
19
+ width: 100%;
20
+ }
21
+
22
+ .title {
23
+ color: base.$sn-theme-color-available-version-textMain;
24
+ }
25
+
26
+ .description {
27
+ color: base.$sn-theme-color-available-version-textSecondary;
28
+ }
29
+
30
+ .infoBlock {
31
+ display: flex;
32
+ box-sizing: border-box;
33
+
34
+ @each $size in $sizes {
35
+ &[data-size='#{$size}'] {
36
+ @include base.composite-var(infoBlock.$infoBlock, 'anatomy', 'size', $size, 'container');
37
+ }
38
+ }
39
+
40
+ // Центрирования по горизонтали в Figma нет: корень там фрейм фиксированной ширины,
41
+ // а место блока в потоке определяет родитель.
42
+ &[data-align='vertical'] {
43
+ flex-direction: column;
44
+ align-items: center;
45
+
46
+ .contentLayout {
47
+ align-items: center;
48
+ }
49
+
50
+ .textWrap {
51
+ align-items: center;
52
+ }
53
+
54
+ .footer {
55
+ width: auto;
56
+ text-align: center;
57
+ }
58
+
59
+ .description,
60
+ .title {
61
+ text-align: center;
62
+ }
63
+ }
64
+
65
+ &[data-align='horizontal'] {
66
+ flex-direction: row;
67
+ align-items: flex-start;
68
+
69
+ .contentLayout {
70
+ flex: 1 0 0;
71
+ align-items: flex-start;
72
+ min-width: 0;
73
+ }
74
+
75
+ .textWrap {
76
+ align-items: flex-start;
77
+ }
78
+
79
+ .footer {
80
+ display: flex;
81
+ justify-content: flex-start;
82
+ }
83
+
84
+ .description,
85
+ .title {
86
+ text-align: left;
87
+ }
88
+ }
89
+
90
+ @each $size in $sizes {
91
+ &[data-size='#{$size}'] {
92
+ .contentLayout {
93
+ @include base.composite-var(infoBlock.$infoBlock, 'anatomy', 'size', $size, 'container', 'content');
94
+ }
95
+
96
+ .textWrap {
97
+ @include base.composite-var(infoBlock.$infoBlock, 'anatomy', 'size', $size, 'container', 'content', 'text');
98
+ }
99
+
100
+ .title {
101
+ @include base.composite-var(base.$base-styles, 'sn', 'regular', 'title', $size);
102
+ }
103
+
104
+ .description {
105
+ @include base.composite-var(base.$base-styles, 'sn', 'regular', 'body', $size);
106
+ }
107
+ }
108
+ }
109
+ }
@@ -0,0 +1 @@
1
+ export * from './InfoBlock';
@@ -0,0 +1,24 @@
1
+ export const SIZE = {
2
+ S: 's',
3
+ M: 'm',
4
+ L: 'l',
5
+ } as const;
6
+
7
+ export const ALIGN = {
8
+ Vertical: 'vertical',
9
+ Horizontal: 'horizontal',
10
+ } as const;
11
+
12
+ export const TEST_IDS = {
13
+ root: 'info-block',
14
+ icon: 'info-block__icon',
15
+ title: 'info-block__title',
16
+ content: 'info-block__content',
17
+ footer: 'info-block__footer',
18
+ };
19
+
20
+ export const SIZE_TO_ICON_SIZE = {
21
+ s: 'm' as const,
22
+ m: 'l' as const,
23
+ l: '5xl' as const,
24
+ };
package/src/index.ts ADDED
@@ -0,0 +1,3 @@
1
+ export * from './components';
2
+ export * from './constants';
3
+ export * from './types';
package/src/types.ts ADDED
@@ -0,0 +1,6 @@
1
+ import { ValueOf } from '@cloud-ru/ds-utils';
2
+
3
+ import { ALIGN, SIZE } from './constants';
4
+
5
+ export type Size = ValueOf<typeof SIZE>;
6
+ export type Align = ValueOf<typeof ALIGN>;