@alfalab/core-components-pure-cell 4.3.1 → 4.4.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 (203) hide show
  1. package/{component-3c8d07e1.js → component-1d246a90.js} +10 -10
  2. package/{esm/component-c49f24a8.d.ts → component-5a229016.d.ts} +1 -1
  3. package/component.js +2 -2
  4. package/components/addon/component.js +3 -3
  5. package/components/addon/index.css +10 -10
  6. package/components/addon/index.js +1 -1
  7. package/components/amount/component.js +4 -4
  8. package/components/amount/index.css +2 -2
  9. package/components/amount/index.js +1 -1
  10. package/components/amount-title/component.js +4 -4
  11. package/components/amount-title/index.css +3 -3
  12. package/components/amount-title/index.js +1 -1
  13. package/components/category/component.js +5 -5
  14. package/components/category/index.css +5 -5
  15. package/components/category/index.js +1 -1
  16. package/components/content/component.js +2 -2
  17. package/components/content/index.css +3 -3
  18. package/components/content/index.d.ts +1 -1
  19. package/components/content/index.js +2 -2
  20. package/components/footer/component.js +3 -3
  21. package/components/footer/index.css +4 -4
  22. package/components/footer/index.js +1 -1
  23. package/components/footer-button/component.js +3 -3
  24. package/components/footer-button/index.css +2 -2
  25. package/components/footer-button/index.js +1 -1
  26. package/components/footer-text/component.js +2 -2
  27. package/components/footer-text/index.js +1 -1
  28. package/components/graphics/component.js +3 -3
  29. package/components/graphics/index.css +5 -5
  30. package/components/graphics/index.js +1 -1
  31. package/components/main/component.js +2 -2
  32. package/components/main/index.css +4 -4
  33. package/components/main/index.d.ts +1 -1
  34. package/components/main/index.js +2 -2
  35. package/components/text/component.js +2 -2
  36. package/components/text/index.css +7 -7
  37. package/components/text/index.d.ts +1 -1
  38. package/components/text/index.js +2 -2
  39. package/{modern/component-c49f24a8.d.ts → cssm/component-5a229016.d.ts} +1 -1
  40. package/cssm/{component-4aff9f21.js → component-ef4953bf.js} +6 -6
  41. package/cssm/component.js +2 -2
  42. package/cssm/components/addon/component.js +2 -2
  43. package/cssm/components/addon/index.js +1 -1
  44. package/cssm/components/amount/component.js +3 -3
  45. package/cssm/components/amount/index.js +1 -1
  46. package/cssm/components/amount-title/component.js +3 -3
  47. package/cssm/components/amount-title/index.js +1 -1
  48. package/cssm/components/category/component.js +4 -4
  49. package/cssm/components/category/index.js +1 -1
  50. package/cssm/components/content/component.js +2 -2
  51. package/cssm/components/content/index.d.ts +1 -1
  52. package/cssm/components/content/index.js +2 -2
  53. package/cssm/components/footer/component.js +2 -2
  54. package/cssm/components/footer/index.js +1 -1
  55. package/cssm/components/footer-button/component.js +2 -2
  56. package/cssm/components/footer-button/index.js +1 -1
  57. package/cssm/components/footer-text/component.js +2 -2
  58. package/cssm/components/footer-text/index.js +1 -1
  59. package/cssm/components/graphics/component.js +2 -2
  60. package/cssm/components/graphics/index.js +1 -1
  61. package/cssm/components/main/component.js +2 -2
  62. package/cssm/components/main/index.d.ts +1 -1
  63. package/cssm/components/main/index.js +2 -2
  64. package/cssm/components/text/component.js +2 -2
  65. package/cssm/components/text/index.d.ts +1 -1
  66. package/cssm/components/text/index.js +2 -2
  67. package/cssm/index.d.ts +1 -1
  68. package/cssm/index.js +2 -2
  69. package/{component-c49f24a8.d.ts → esm/component-5a229016.d.ts} +1 -1
  70. package/esm/{component-45299cd1.js → component-bdd266d4.js} +6 -6
  71. package/esm/component.js +2 -2
  72. package/esm/components/addon/component.js +2 -2
  73. package/esm/components/addon/index.css +10 -10
  74. package/esm/components/addon/index.js +1 -1
  75. package/esm/components/amount/component.js +2 -2
  76. package/esm/components/amount/index.css +2 -2
  77. package/esm/components/amount/index.js +1 -1
  78. package/esm/components/amount-title/component.js +2 -2
  79. package/esm/components/amount-title/index.css +3 -3
  80. package/esm/components/amount-title/index.js +1 -1
  81. package/esm/components/category/component.js +2 -2
  82. package/esm/components/category/index.css +5 -5
  83. package/esm/components/category/index.js +1 -1
  84. package/esm/components/content/component.js +2 -2
  85. package/esm/components/content/index.css +3 -3
  86. package/esm/components/content/index.d.ts +1 -1
  87. package/esm/components/content/index.js +2 -2
  88. package/esm/components/footer/component.js +2 -2
  89. package/esm/components/footer/index.css +4 -4
  90. package/esm/components/footer/index.js +1 -1
  91. package/esm/components/footer-button/component.js +2 -2
  92. package/esm/components/footer-button/index.css +2 -2
  93. package/esm/components/footer-button/index.js +1 -1
  94. package/esm/components/footer-text/component.js +1 -1
  95. package/esm/components/footer-text/index.js +1 -1
  96. package/esm/components/graphics/component.js +2 -2
  97. package/esm/components/graphics/index.css +5 -5
  98. package/esm/components/graphics/index.js +1 -1
  99. package/esm/components/main/component.js +2 -2
  100. package/esm/components/main/index.css +4 -4
  101. package/esm/components/main/index.d.ts +1 -1
  102. package/esm/components/main/index.js +2 -2
  103. package/esm/components/text/component.js +2 -2
  104. package/esm/components/text/index.css +7 -7
  105. package/esm/components/text/index.d.ts +1 -1
  106. package/esm/components/text/index.js +2 -2
  107. package/esm/index.css +21 -21
  108. package/esm/index.d.ts +1 -1
  109. package/esm/index.js +2 -2
  110. package/index.css +21 -21
  111. package/index.d.ts +1 -1
  112. package/index.js +2 -2
  113. package/{cssm/component-c49f24a8.d.ts → modern/component-5a229016.d.ts} +1 -1
  114. package/modern/{component-6e5f347e.js → component-b811b670.js} +6 -6
  115. package/modern/component.js +2 -2
  116. package/modern/components/addon/component.js +2 -2
  117. package/modern/components/addon/index.css +10 -10
  118. package/modern/components/addon/index.js +1 -1
  119. package/modern/components/amount/component.js +2 -2
  120. package/modern/components/amount/index.css +2 -2
  121. package/modern/components/amount/index.js +1 -1
  122. package/modern/components/amount-title/component.js +2 -2
  123. package/modern/components/amount-title/index.css +3 -3
  124. package/modern/components/amount-title/index.js +1 -1
  125. package/modern/components/category/component.js +2 -2
  126. package/modern/components/category/index.css +5 -5
  127. package/modern/components/category/index.js +1 -1
  128. package/modern/components/content/component.js +2 -2
  129. package/modern/components/content/index.css +3 -3
  130. package/modern/components/content/index.d.ts +1 -1
  131. package/modern/components/content/index.js +2 -2
  132. package/modern/components/footer/component.js +2 -2
  133. package/modern/components/footer/index.css +4 -4
  134. package/modern/components/footer/index.js +1 -1
  135. package/modern/components/footer-button/component.js +2 -2
  136. package/modern/components/footer-button/index.css +2 -2
  137. package/modern/components/footer-button/index.js +1 -1
  138. package/modern/components/footer-text/component.js +1 -1
  139. package/modern/components/footer-text/index.js +1 -1
  140. package/modern/components/graphics/component.js +2 -2
  141. package/modern/components/graphics/index.css +5 -5
  142. package/modern/components/graphics/index.js +1 -1
  143. package/modern/components/main/component.js +2 -2
  144. package/modern/components/main/index.css +4 -4
  145. package/modern/components/main/index.d.ts +1 -1
  146. package/modern/components/main/index.js +2 -2
  147. package/modern/components/text/component.js +2 -2
  148. package/modern/components/text/index.css +7 -7
  149. package/modern/components/text/index.d.ts +1 -1
  150. package/modern/components/text/index.js +2 -2
  151. package/modern/index.css +21 -21
  152. package/modern/index.d.ts +1 -1
  153. package/modern/index.js +2 -2
  154. package/package.json +6 -5
  155. package/src/component.tsx +186 -0
  156. package/src/components/addon/component.tsx +44 -0
  157. package/src/components/addon/index.module.css +39 -0
  158. package/src/components/addon/index.ts +1 -0
  159. package/src/components/amount/component.tsx +56 -0
  160. package/src/components/amount/index.module.css +6 -0
  161. package/src/components/amount/index.ts +1 -0
  162. package/src/components/amount-title/component.tsx +42 -0
  163. package/src/components/amount-title/index.module.css +9 -0
  164. package/src/components/amount-title/index.ts +1 -0
  165. package/src/components/category/component.tsx +65 -0
  166. package/src/components/category/index.module.css +26 -0
  167. package/src/components/category/index.ts +1 -0
  168. package/src/components/content/component.tsx +34 -0
  169. package/src/components/content/index.module.css +12 -0
  170. package/src/components/content/index.ts +1 -0
  171. package/src/components/footer/component.tsx +34 -0
  172. package/src/components/footer/index.module.css +15 -0
  173. package/src/components/footer/index.ts +1 -0
  174. package/src/components/footer-button/component.tsx +17 -0
  175. package/src/components/footer-button/index.module.css +5 -0
  176. package/src/components/footer-button/index.ts +1 -0
  177. package/src/components/footer-text/component.tsx +31 -0
  178. package/src/components/footer-text/index.ts +1 -0
  179. package/src/components/graphics/component.tsx +34 -0
  180. package/src/components/graphics/index.module.css +18 -0
  181. package/src/components/graphics/index.ts +1 -0
  182. package/src/components/main/component.tsx +51 -0
  183. package/src/components/main/index.module.css +23 -0
  184. package/src/components/main/index.ts +1 -0
  185. package/src/components/text/component.tsx +100 -0
  186. package/src/components/text/index.module.css +34 -0
  187. package/src/components/text/index.ts +1 -0
  188. package/src/components/types.ts +27 -0
  189. package/src/components/typesProps.ts +56 -0
  190. package/src/index.module.css +94 -0
  191. package/src/index.ts +1 -0
  192. package/cssm/getDataTestId-5c876d98.d.ts +0 -2
  193. package/cssm/getDataTestId-5c876d98.js +0 -8
  194. package/esm/getDataTestId-642eb788.d.ts +0 -2
  195. package/esm/getDataTestId-642eb788.js +0 -6
  196. package/getDataTestId-916a6a71.d.ts +0 -2
  197. package/getDataTestId-916a6a71.js +0 -8
  198. package/modern/getDataTestId-d1e65cf0.d.ts +0 -2
  199. package/modern/getDataTestId-d1e65cf0.js +0 -6
  200. /package/{component-3c8d07e1.d.ts → component-1d246a90.d.ts} +0 -0
  201. /package/cssm/{component-4aff9f21.d.ts → component-ef4953bf.d.ts} +0 -0
  202. /package/esm/{component-45299cd1.d.ts → component-bdd266d4.d.ts} +0 -0
  203. /package/modern/{component-6e5f347e.d.ts → component-b811b670.d.ts} +0 -0
@@ -0,0 +1,39 @@
1
+ @import '@alfalab/core-components-themes/src/default.css';
2
+
3
+ .component {
4
+ display: flex;
5
+ flex-direction: column;
6
+ align-items: flex-end;
7
+
8
+ & > * {
9
+ justify-content: flex-end;
10
+ }
11
+
12
+ &.none {
13
+ padding-left: 0;
14
+ }
15
+
16
+ &.default {
17
+ padding-left: var(--gap-m);
18
+ }
19
+
20
+ &.addonPadding {
21
+ padding-left: var(--gap-m);
22
+ }
23
+
24
+ &.auto {
25
+ align-self: auto;
26
+ }
27
+
28
+ &.top {
29
+ align-self: flex-start;
30
+ }
31
+
32
+ &.center {
33
+ align-self: center;
34
+ }
35
+
36
+ &.bottom {
37
+ align-self: flex-end;
38
+ }
39
+ }
@@ -0,0 +1 @@
1
+ export * from './component';
@@ -0,0 +1,56 @@
1
+ import React from 'react';
2
+ import cn from 'classnames';
3
+
4
+ import { Amount as CoreAmount } from '@alfalab/core-components-amount';
5
+ import { getDataTestId } from '@alfalab/core-components-shared';
6
+ import { Color, Typography } from '@alfalab/core-components-typography';
7
+
8
+ import { AmountProps as AmountType } from '../typesProps';
9
+
10
+ import styles from './index.module.css';
11
+
12
+ type Props = {
13
+ /**
14
+ * Начертание шрифта денежного значения
15
+ */
16
+ weight?: 'bold' | 'normal';
17
+
18
+ /**
19
+ * Размер денежного значения
20
+ */
21
+ textView?: 'component' | 'primary-small';
22
+
23
+ /**
24
+ * Цвет денежного значения
25
+ */
26
+ color?: Color;
27
+
28
+ /**
29
+ * Идентификатор для систем автоматизированного тестирования
30
+ */
31
+ dataTestId?: string;
32
+ } & AmountType;
33
+
34
+ export const Amount: React.FC<Props> = ({
35
+ weight = 'normal',
36
+ textView = 'component',
37
+ color = 'primary',
38
+ minority,
39
+ minorUnits = 100,
40
+ dataTestId,
41
+ ...restProps
42
+ }) => (
43
+ <Typography.Text
44
+ view={textView}
45
+ dataTestId={getDataTestId(dataTestId, 'amount-text')}
46
+ className={cn(styles.component)}
47
+ color={color}
48
+ >
49
+ <CoreAmount
50
+ minority={minority || minorUnits}
51
+ bold={weight === 'bold' ? 'full' : 'none'}
52
+ dataTestId={getDataTestId(dataTestId, 'amount')}
53
+ {...restProps}
54
+ />
55
+ </Typography.Text>
56
+ );
@@ -0,0 +1,6 @@
1
+ @import '@alfalab/core-components-themes/src/default.css';
2
+
3
+ .component {
4
+ padding: var(--gap-3xs) 0;
5
+ display: flex;
6
+ }
@@ -0,0 +1 @@
1
+ export * from './component';
@@ -0,0 +1,42 @@
1
+ import React from 'react';
2
+ import cn from 'classnames';
3
+
4
+ import { Amount as CoreAmount } from '@alfalab/core-components-amount';
5
+ import { getDataTestId } from '@alfalab/core-components-shared';
6
+ import { Color, Typography } from '@alfalab/core-components-typography';
7
+
8
+ import { AmountProps as AmountType } from '../typesProps';
9
+
10
+ import styles from './index.module.css';
11
+
12
+ type Props = {
13
+ /**
14
+ * Цвет денежного значения
15
+ */
16
+ color?: Color;
17
+ } & AmountType;
18
+
19
+ export const AmountTitle: React.FC<Props> = ({
20
+ minority,
21
+ minorUnits = 100,
22
+ className,
23
+ color = 'primary',
24
+ dataTestId,
25
+ ...restProps
26
+ }) => (
27
+ <Typography.Title
28
+ tag='h4'
29
+ view='small'
30
+ dataTestId={getDataTestId(dataTestId, 'amount-title')}
31
+ className={styles.component}
32
+ color={color}
33
+ >
34
+ <CoreAmount
35
+ minority={minority || minorUnits}
36
+ className={cn(styles.weight, className)}
37
+ dataTestId={getDataTestId(dataTestId, 'core-amount-title')}
38
+ {...restProps}
39
+ bold='none'
40
+ />
41
+ </Typography.Title>
42
+ );
@@ -0,0 +1,9 @@
1
+ @import '@alfalab/core-components-themes/src/default.css';
2
+
3
+ .component {
4
+ display: flex;
5
+ }
6
+
7
+ .weight {
8
+ font-weight: inherit;
9
+ }
@@ -0,0 +1 @@
1
+ export * from './component';
@@ -0,0 +1,65 @@
1
+ import React, { ReactNode } from 'react';
2
+
3
+ import { getDataTestId } from '@alfalab/core-components-shared';
4
+ import { Typography } from '@alfalab/core-components-typography';
5
+
6
+ import styles from './index.module.css';
7
+
8
+ type Props = {
9
+ /**
10
+ * Наименование категории
11
+ */
12
+ categoryName: string;
13
+
14
+ /**
15
+ * Процент категории
16
+ */
17
+ categoryPercent?: number;
18
+
19
+ /**
20
+ * Слот справа
21
+ */
22
+ rightAddons?: ReactNode;
23
+
24
+ /**
25
+ * Идентификатор для систем автоматизированного тестирования
26
+ */
27
+ dataTestId?: string;
28
+ };
29
+
30
+ export const Category: React.FC<Props> = ({
31
+ categoryName,
32
+ categoryPercent,
33
+ rightAddons,
34
+ dataTestId,
35
+ }) => (
36
+ <div className={styles.component} data-test-id='cell-pure-category'>
37
+ <Typography.Text
38
+ view='primary-small'
39
+ color='secondary'
40
+ dataTestId={getDataTestId(dataTestId, 'category-name')}
41
+ className={styles.categoryName}
42
+ >
43
+ {categoryName}
44
+ </Typography.Text>
45
+ {categoryPercent !== undefined && (
46
+ <Typography.Text
47
+ tag='div'
48
+ view='primary-small'
49
+ color='secondary'
50
+ className={styles.categoryPercent}
51
+ dataTestId={getDataTestId(dataTestId, 'category-percent')}
52
+ >
53
+ {categoryPercent}%
54
+ </Typography.Text>
55
+ )}
56
+ {rightAddons !== undefined && (
57
+ <div
58
+ className={styles.rightAddon}
59
+ data-test-id={getDataTestId(dataTestId, 'category-right-addon')}
60
+ >
61
+ {rightAddons}
62
+ </div>
63
+ )}
64
+ </div>
65
+ );
@@ -0,0 +1,26 @@
1
+ @import '@alfalab/core-components-themes/src/default.css';
2
+
3
+ .component {
4
+ display: flex;
5
+ overflow: hidden;
6
+ padding: var(--gap-3xs) 0;
7
+ }
8
+
9
+ .categoryName {
10
+ display: -webkit-box;
11
+ -webkit-line-clamp: 1;
12
+ -webkit-box-orient: vertical;
13
+ overflow: hidden;
14
+ word-break: break-all;
15
+ }
16
+
17
+ .categoryPercent {
18
+ padding: 0 var(--gap-xs);
19
+ background-color: var(--color-light-bg-secondary);
20
+ border-radius: var(--border-radius-xl);
21
+ margin-left: var(--gap-2xs);
22
+ }
23
+
24
+ .rightAddon {
25
+ margin-left: var(--gap-2xs);
26
+ }
@@ -0,0 +1 @@
1
+ export * from './component';
@@ -0,0 +1,34 @@
1
+ import React, { useContext } from 'react';
2
+ import cn from 'classnames';
3
+
4
+ import { getDataTestId } from '@alfalab/core-components-shared';
5
+
6
+ import { PureCellContext } from '../../component';
7
+ import { ContentElement } from '../types';
8
+
9
+ import styles from './index.module.css';
10
+
11
+ type Props = {
12
+ /**
13
+ * Компоненты
14
+ */
15
+ children: ContentElement;
16
+
17
+ /**
18
+ * Идентификатор для систем автоматизированного тестирования
19
+ */
20
+ dataTestId?: string;
21
+ };
22
+
23
+ export const Content: React.FC<Props> = ({ children, dataTestId }) => {
24
+ const { direction } = useContext(PureCellContext);
25
+
26
+ return (
27
+ <section
28
+ className={cn(styles.component, { [styles.horizontal]: direction === 'horizontal' })}
29
+ data-test-id={getDataTestId(dataTestId, 'content')}
30
+ >
31
+ {children}
32
+ </section>
33
+ );
34
+ };
@@ -0,0 +1,12 @@
1
+ @import '@alfalab/core-components-themes/src/default.css';
2
+
3
+ .component {
4
+ flex-basis: 100%;
5
+ display: grid;
6
+ grid-template-columns: 1fr auto;
7
+
8
+ &.horizontal {
9
+ /* for button */
10
+ align-self: stretch;
11
+ }
12
+ }
@@ -0,0 +1 @@
1
+ export * from './component';
@@ -0,0 +1,34 @@
1
+ import React from 'react';
2
+ import cn from 'classnames';
3
+
4
+ import { getDataTestId } from '@alfalab/core-components-shared';
5
+
6
+ import { FooterElement } from '../types';
7
+
8
+ import styles from './index.module.css';
9
+
10
+ type Props = {
11
+ /**
12
+ * Компоненты
13
+ */
14
+ children: FooterElement;
15
+
16
+ /**
17
+ * Вертикальные отступы
18
+ */
19
+ footerPadding?: 'default' | 'none';
20
+
21
+ /**
22
+ * Идентификатор для систем автоматизированного тестирования
23
+ */
24
+ dataTestId?: string;
25
+ };
26
+
27
+ export const Footer: React.FC<Props> = ({ children, footerPadding = 'default', dataTestId }) => (
28
+ <footer
29
+ className={cn(styles.component, styles[footerPadding])}
30
+ data-test-id={getDataTestId(dataTestId, 'footer')}
31
+ >
32
+ {children}
33
+ </footer>
34
+ );
@@ -0,0 +1,15 @@
1
+ @import '@alfalab/core-components-themes/src/default.css';
2
+
3
+ .component {
4
+ grid-column: 1/3;
5
+ display: grid;
6
+ grid-row-gap: var(--gap-xs);
7
+
8
+ &.none {
9
+ margin-top: 0;
10
+ }
11
+
12
+ &.default {
13
+ margin-top: var(--gap-xs);
14
+ }
15
+ }
@@ -0,0 +1 @@
1
+ export * from './component';
@@ -0,0 +1,17 @@
1
+ import React from 'react';
2
+
3
+ import { Button, ButtonProps } from '@alfalab/core-components-button';
4
+ import { getDataTestId } from '@alfalab/core-components-shared';
5
+
6
+ import styles from './index.module.css';
7
+
8
+ export const FooterButton: React.FC<ButtonProps> = ({ children, dataTestId, ...props }) => (
9
+ <Button
10
+ {...props}
11
+ size='xxs'
12
+ dataTestId={getDataTestId(dataTestId, 'button')}
13
+ className={styles.component}
14
+ >
15
+ {children}
16
+ </Button>
17
+ );
@@ -0,0 +1,5 @@
1
+ @import '@alfalab/core-components-themes/src/default.css';
2
+
3
+ .component {
4
+ justify-self: start;
5
+ }
@@ -0,0 +1 @@
1
+ export * from './component';
@@ -0,0 +1,31 @@
1
+ import React, { ReactNode } from 'react';
2
+
3
+ import { getDataTestId } from '@alfalab/core-components-shared';
4
+ import { Color, Typography } from '@alfalab/core-components-typography';
5
+
6
+ export type Props = {
7
+ /**
8
+ * Цвет текста
9
+ */
10
+ color?: Color;
11
+
12
+ /**
13
+ * Идентификатор для систем автоматизированного тестирования
14
+ */
15
+ dataTestId?: string;
16
+
17
+ /**
18
+ * Дочерние элементы.
19
+ */
20
+ children?: ReactNode;
21
+ };
22
+
23
+ export const FooterText: React.FC<Props> = ({ children, color = 'secondary', dataTestId }) => (
24
+ <Typography.Text
25
+ view='primary-small'
26
+ color={color}
27
+ data-test-id={getDataTestId(dataTestId, 'footer-title')}
28
+ >
29
+ {children}
30
+ </Typography.Text>
31
+ );
@@ -0,0 +1 @@
1
+ export * from './component';
@@ -0,0 +1,34 @@
1
+ import React from 'react';
2
+ import cn from 'classnames';
3
+
4
+ import { getDataTestId } from '@alfalab/core-components-shared';
5
+
6
+ import { GraphicsElement } from '../types';
7
+
8
+ import styles from './index.module.css';
9
+
10
+ export type Props = {
11
+ /**
12
+ * Компоненты
13
+ */
14
+ children: GraphicsElement;
15
+
16
+ /**
17
+ * Идентификатор для систем автоматизированного тестирования
18
+ */
19
+ dataTestId?: string;
20
+
21
+ /**
22
+ * Вертикальное выравнивание
23
+ */
24
+ verticalAlign?: 'top' | 'center' | 'bottom';
25
+ };
26
+
27
+ export const Graphics: React.FC<Props> = ({ children, dataTestId, verticalAlign = 'top' }) => (
28
+ <section
29
+ className={cn(styles.component, styles[verticalAlign])}
30
+ data-test-id={getDataTestId(dataTestId, 'graphics')}
31
+ >
32
+ {children}
33
+ </section>
34
+ );
@@ -0,0 +1,18 @@
1
+ @import '@alfalab/core-components-themes/src/default.css';
2
+
3
+ .component {
4
+ display: inline-flex;
5
+ flex-basis: auto;
6
+ }
7
+
8
+ .top {
9
+ align-self: flex-start;
10
+ }
11
+
12
+ .center {
13
+ align-self: center;
14
+ }
15
+
16
+ .bottom {
17
+ align-self: flex-end;
18
+ }
@@ -0,0 +1 @@
1
+ export * from './component';
@@ -0,0 +1,51 @@
1
+ import React, { useContext } from 'react';
2
+ import cn from 'classnames';
3
+
4
+ import { getDataTestId } from '@alfalab/core-components-shared';
5
+
6
+ import { PureCellContext } from '../../component';
7
+ import { MainElement } from '../types';
8
+
9
+ import styles from './index.module.css';
10
+
11
+ type Props = {
12
+ /**
13
+ * Компоненты
14
+ */
15
+ children: MainElement;
16
+
17
+ /**
18
+ * Позволяет изменить расположение блоков внутри main
19
+ */
20
+ isReverse?: boolean;
21
+
22
+ /**
23
+ * Дополнительный класс
24
+ */
25
+ className?: string;
26
+
27
+ /**
28
+ * Идентификатор для систем автоматизированного тестирования
29
+ */
30
+ dataTestId?: string;
31
+ };
32
+
33
+ export const Main: React.FC<Props> = ({ children, isReverse, className, dataTestId }) => {
34
+ const { direction = 'horizontal' } = useContext(PureCellContext);
35
+
36
+ return (
37
+ <div
38
+ className={cn(
39
+ styles.component,
40
+ styles[direction],
41
+ {
42
+ [styles.reverse]: isReverse,
43
+ },
44
+ className,
45
+ )}
46
+ data-test-id={getDataTestId(dataTestId, 'main')}
47
+ >
48
+ {children}
49
+ </div>
50
+ );
51
+ };
@@ -0,0 +1,23 @@
1
+ @import '@alfalab/core-components-themes/src/default.css';
2
+
3
+ .component {
4
+ display: flex;
5
+ flex-direction: column;
6
+ align-self: center;
7
+
8
+ /* can use /r/n */
9
+ white-space: pre-line;
10
+
11
+ &.vertical {
12
+ grid-row-gap: var(--gap-3xs);
13
+ justify-content: center;
14
+ align-items: center;
15
+
16
+ /* for button */
17
+ text-align: center;
18
+ }
19
+
20
+ &.reverse {
21
+ flex-direction: column-reverse;
22
+ }
23
+ }
@@ -0,0 +1 @@
1
+ export * from './component';
@@ -0,0 +1,100 @@
1
+ import React, { ReactNode, useContext } from 'react';
2
+ import cn from 'classnames';
3
+
4
+ import { getDataTestId } from '@alfalab/core-components-shared';
5
+ import { Color, Typography } from '@alfalab/core-components-typography';
6
+
7
+ import { PureCellContext } from '../../component';
8
+
9
+ import styles from './index.module.css';
10
+
11
+ type Props = {
12
+ /**
13
+ * Контент
14
+ */
15
+ children?: ReactNode;
16
+
17
+ /**
18
+ * Количество строк
19
+ */
20
+ rowLimit?: 1 | 2;
21
+
22
+ /**
23
+ * Размер текста
24
+ */
25
+ view: 'primary-large' | 'primary-medium' | 'primary-small' | 'component';
26
+
27
+ /**
28
+ * Толщина title
29
+ */
30
+ titleWeight?: 'regular' | 'bold';
31
+
32
+ /**
33
+ * Цвет title
34
+ */
35
+ titleColor: Color;
36
+
37
+ /**
38
+ * Value ячейки
39
+ */
40
+ value?: ReactNode;
41
+
42
+ /**
43
+ * Цвет value
44
+ */
45
+ valueColor?: Color;
46
+
47
+ /**
48
+ * Идентификатор для систем автоматизированного тестирования
49
+ */
50
+ dataTestId?: string;
51
+ };
52
+
53
+ export const Text: React.FC<Props> = ({
54
+ children,
55
+ value,
56
+ rowLimit,
57
+ view = 'component',
58
+ titleWeight,
59
+ titleColor,
60
+ valueColor,
61
+ dataTestId,
62
+ }) => {
63
+ const { direction = 'horizontal' } = useContext(PureCellContext);
64
+ const className = rowLimit && styles[`rowLimit${rowLimit}`];
65
+
66
+ return (
67
+ <div
68
+ className={cn(styles.component, {
69
+ [styles.vertical]: direction !== 'horizontal',
70
+ })}
71
+ >
72
+ <div className={styles.title}>
73
+ <Typography.Text
74
+ view={view}
75
+ weight={titleWeight}
76
+ tag='div'
77
+ color={titleColor}
78
+ className={className}
79
+ data-test-id={getDataTestId(dataTestId, 'text_content')}
80
+ >
81
+ {children}
82
+ </Typography.Text>
83
+ </div>
84
+
85
+ {value && (
86
+ <div className={styles.value}>
87
+ <Typography.Text
88
+ view={view}
89
+ tag='div'
90
+ color={valueColor}
91
+ className={className}
92
+ data-test-id={getDataTestId(dataTestId, 'text_value')}
93
+ >
94
+ {value}
95
+ </Typography.Text>
96
+ </div>
97
+ )}
98
+ </div>
99
+ );
100
+ };