@redneckz/wildless-cms-uni-blocks 0.14.832 → 0.14.833

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 (205) hide show
  1. package/bin/migration-scripts/{0.14.828.js → 0.14.832.js} +3 -1
  2. package/bundle/blocks.schema.json +1 -1
  3. package/bundle/bundle.umd.js +17 -80
  4. package/bundle/bundle.umd.min.js +1 -1
  5. package/bundle/components/ApplicationLeadForm/ApplicationLeadForm.d.ts +0 -5
  6. package/bundle/components/ApplicationLeadForm/ApplicationLeadFormContent.d.ts +5 -0
  7. package/bundle/components/ApplicationLeadForm/useInitApplicationLead.d.ts +1 -2
  8. package/dist/components/ApplicationLeadForm/ApplicationLeadForm.d.ts +0 -5
  9. package/dist/components/ApplicationLeadForm/ApplicationLeadForm.js +5 -10
  10. package/dist/components/ApplicationLeadForm/ApplicationLeadForm.js.map +1 -1
  11. package/dist/components/ApplicationLeadForm/ApplicationLeadFormContent.d.ts +5 -0
  12. package/dist/components/ApplicationLeadForm/ApplicationLeadFormContent.js +7 -0
  13. package/dist/components/ApplicationLeadForm/ApplicationLeadFormContent.js.map +1 -1
  14. package/dist/components/ApplicationLeadForm/useInitApplicationLead.d.ts +1 -2
  15. package/dist/components/ApplicationLeadForm/useInitApplicationLead.js +4 -4
  16. package/dist/components/ApplicationLeadForm/useInitApplicationLead.js.map +1 -1
  17. package/dist/components/Blocks.js +0 -6
  18. package/dist/components/Blocks.js.map +1 -1
  19. package/dist/components/Blocks.mobile.js +0 -4
  20. package/dist/components/Blocks.mobile.js.map +1 -1
  21. package/dist/components/ProductBlock/ProductBlock.js +1 -1
  22. package/dist/components/ProductBlock/ProductBlock.js.map +1 -1
  23. package/lib/common.css +1 -1
  24. package/lib/components/ApplicationLeadForm/ApplicationLeadForm.d.ts +0 -5
  25. package/lib/components/ApplicationLeadForm/ApplicationLeadForm.js +1 -6
  26. package/lib/components/ApplicationLeadForm/ApplicationLeadForm.js.map +1 -1
  27. package/lib/components/ApplicationLeadForm/ApplicationLeadFormContent.d.ts +5 -0
  28. package/lib/components/ApplicationLeadForm/ApplicationLeadFormContent.js +6 -1
  29. package/lib/components/ApplicationLeadForm/ApplicationLeadFormContent.js.map +1 -1
  30. package/lib/components/ApplicationLeadForm/useInitApplicationLead.d.ts +1 -2
  31. package/lib/components/ApplicationLeadForm/useInitApplicationLead.js +1 -1
  32. package/lib/components/ApplicationLeadForm/useInitApplicationLead.js.map +1 -1
  33. package/lib/components/Blocks.js +0 -6
  34. package/lib/components/Blocks.js.map +1 -1
  35. package/lib/components/Blocks.mobile.js +0 -4
  36. package/lib/components/Blocks.mobile.js.map +1 -1
  37. package/lib/components/ProductBlock/ProductBlock.fixture.d.ts +0 -2
  38. package/lib/components/ProductBlock/ProductBlock.js +1 -1
  39. package/lib/components/ProductBlock/ProductBlock.js.map +1 -1
  40. package/mobile/bundle/bundle.umd.js +17 -40
  41. package/mobile/bundle/bundle.umd.min.js +1 -1
  42. package/mobile/bundle/components/ApplicationLeadForm/ApplicationLeadForm.d.ts +0 -5
  43. package/mobile/bundle/components/ApplicationLeadForm/ApplicationLeadFormContent.d.ts +5 -0
  44. package/mobile/bundle/components/ApplicationLeadForm/useInitApplicationLead.d.ts +1 -2
  45. package/mobile/dist/components/ApplicationLeadForm/ApplicationLeadForm.d.ts +0 -5
  46. package/mobile/dist/components/ApplicationLeadForm/ApplicationLeadForm.js +5 -10
  47. package/mobile/dist/components/ApplicationLeadForm/ApplicationLeadForm.js.map +1 -1
  48. package/mobile/dist/components/ApplicationLeadForm/ApplicationLeadFormContent.d.ts +5 -0
  49. package/mobile/dist/components/ApplicationLeadForm/ApplicationLeadFormContent.js +7 -0
  50. package/mobile/dist/components/ApplicationLeadForm/ApplicationLeadFormContent.js.map +1 -1
  51. package/mobile/dist/components/ApplicationLeadForm/useInitApplicationLead.d.ts +1 -2
  52. package/mobile/dist/components/ApplicationLeadForm/useInitApplicationLead.js +4 -4
  53. package/mobile/dist/components/ApplicationLeadForm/useInitApplicationLead.js.map +1 -1
  54. package/mobile/dist/components/Blocks.js +0 -4
  55. package/mobile/dist/components/Blocks.js.map +1 -1
  56. package/mobile/dist/components/ProductBlock/ProductBlock.js +1 -1
  57. package/mobile/dist/components/ProductBlock/ProductBlock.js.map +1 -1
  58. package/mobile/lib/common.css +1 -1
  59. package/mobile/lib/components/ApplicationLeadForm/ApplicationLeadForm.d.ts +0 -5
  60. package/mobile/lib/components/ApplicationLeadForm/ApplicationLeadForm.js +1 -6
  61. package/mobile/lib/components/ApplicationLeadForm/ApplicationLeadForm.js.map +1 -1
  62. package/mobile/lib/components/ApplicationLeadForm/ApplicationLeadFormContent.d.ts +5 -0
  63. package/mobile/lib/components/ApplicationLeadForm/ApplicationLeadFormContent.js +6 -1
  64. package/mobile/lib/components/ApplicationLeadForm/ApplicationLeadFormContent.js.map +1 -1
  65. package/mobile/lib/components/ApplicationLeadForm/useInitApplicationLead.d.ts +1 -2
  66. package/mobile/lib/components/ApplicationLeadForm/useInitApplicationLead.js +1 -1
  67. package/mobile/lib/components/ApplicationLeadForm/useInitApplicationLead.js.map +1 -1
  68. package/mobile/lib/components/Blocks.js +0 -4
  69. package/mobile/lib/components/Blocks.js.map +1 -1
  70. package/mobile/lib/components/ProductBlock/ProductBlock.js +1 -1
  71. package/mobile/lib/components/ProductBlock/ProductBlock.js.map +1 -1
  72. package/mobile/src/components/ApplicationLeadForm/ApplicationLeadForm.tsx +5 -7
  73. package/mobile/src/components/ApplicationLeadForm/ApplicationLeadFormContent.ts +6 -0
  74. package/mobile/src/components/ApplicationLeadForm/useInitApplicationLead.ts +1 -2
  75. package/mobile/src/components/Blocks.ts +0 -4
  76. package/mobile/src/components/ProductBlock/ProductBlock.example.json +1 -11
  77. package/mobile/src/components/ProductBlock/ProductBlock.tsx +0 -1
  78. package/package.json +1 -1
  79. package/src/components/ApplicationLeadForm/ApplicationLeadForm.tsx +5 -7
  80. package/src/components/ApplicationLeadForm/ApplicationLeadFormContent.ts +6 -0
  81. package/src/components/ApplicationLeadForm/useInitApplicationLead.ts +1 -2
  82. package/src/components/Blocks.mobile.ts +0 -4
  83. package/src/components/Blocks.ts +0 -6
  84. package/src/components/ProductBlock/ProductBlock.example.json +1 -11
  85. package/src/components/ProductBlock/ProductBlock.fixture.tsx +0 -28
  86. package/src/components/ProductBlock/ProductBlock.tsx +0 -1
  87. package/src/icons/IconName.ts +4 -4
  88. package/bundle/components/InvestmentInfo/InvestmentInfo.d.ts +0 -5
  89. package/bundle/components/InvestmentInfo/InvestmentInfoContent.d.ts +0 -43
  90. package/bundle/components/RepresentativeOfficeInfo/RepresentativeOfficeInfo.d.ts +0 -5
  91. package/bundle/components/RepresentativeOfficeInfo/RepresentativeOfficeInfoContent.d.ts +0 -18
  92. package/bundle/components/UnitBlock/UnitBlock.d.ts +0 -6
  93. package/bundle/components/UnitBlock/UnitBlockContent.d.ts +0 -6
  94. package/dist/components/InvestmentInfo/InvestmentInfo.d.ts +0 -5
  95. package/dist/components/InvestmentInfo/InvestmentInfo.js +0 -47
  96. package/dist/components/InvestmentInfo/InvestmentInfo.js.map +0 -1
  97. package/dist/components/InvestmentInfo/InvestmentInfoContent.d.ts +0 -43
  98. package/dist/components/InvestmentInfo/InvestmentInfoContent.js +0 -2
  99. package/dist/components/InvestmentInfo/InvestmentInfoContent.js.map +0 -1
  100. package/dist/components/RepresentativeOfficeInfo/RepresentativeOfficeInfo.d.ts +0 -5
  101. package/dist/components/RepresentativeOfficeInfo/RepresentativeOfficeInfo.js +0 -26
  102. package/dist/components/RepresentativeOfficeInfo/RepresentativeOfficeInfo.js.map +0 -1
  103. package/dist/components/RepresentativeOfficeInfo/RepresentativeOfficeInfoContent.d.ts +0 -18
  104. package/dist/components/RepresentativeOfficeInfo/RepresentativeOfficeInfoContent.js +0 -2
  105. package/dist/components/RepresentativeOfficeInfo/RepresentativeOfficeInfoContent.js.map +0 -1
  106. package/dist/components/UnitBlock/UnitBlock.d.ts +0 -6
  107. package/dist/components/UnitBlock/UnitBlock.js +0 -11
  108. package/dist/components/UnitBlock/UnitBlock.js.map +0 -1
  109. package/dist/components/UnitBlock/UnitBlockContent.d.ts +0 -6
  110. package/dist/components/UnitBlock/UnitBlockContent.js +0 -2
  111. package/dist/components/UnitBlock/UnitBlockContent.js.map +0 -1
  112. package/lib/components/InvestmentInfo/InvestmentInfo.d.ts +0 -5
  113. package/lib/components/InvestmentInfo/InvestmentInfo.fixture.d.ts +0 -7
  114. package/lib/components/InvestmentInfo/InvestmentInfo.js +0 -45
  115. package/lib/components/InvestmentInfo/InvestmentInfo.js.map +0 -1
  116. package/lib/components/InvestmentInfo/InvestmentInfoContent.d.ts +0 -43
  117. package/lib/components/InvestmentInfo/InvestmentInfoContent.js +0 -2
  118. package/lib/components/InvestmentInfo/InvestmentInfoContent.js.map +0 -1
  119. package/lib/components/RepresentativeOfficeInfo/RepresentativeOfficeInfo.d.ts +0 -5
  120. package/lib/components/RepresentativeOfficeInfo/RepresentativeOfficeInfo.fixture.d.ts +0 -5
  121. package/lib/components/RepresentativeOfficeInfo/RepresentativeOfficeInfo.fixture.mobile.d.ts +0 -5
  122. package/lib/components/RepresentativeOfficeInfo/RepresentativeOfficeInfo.js +0 -24
  123. package/lib/components/RepresentativeOfficeInfo/RepresentativeOfficeInfo.js.map +0 -1
  124. package/lib/components/RepresentativeOfficeInfo/RepresentativeOfficeInfoContent.d.ts +0 -18
  125. package/lib/components/RepresentativeOfficeInfo/RepresentativeOfficeInfoContent.js +0 -2
  126. package/lib/components/RepresentativeOfficeInfo/RepresentativeOfficeInfoContent.js.map +0 -1
  127. package/lib/components/UnitBlock/UnitBlock.d.ts +0 -6
  128. package/lib/components/UnitBlock/UnitBlock.fixture.d.ts +0 -6
  129. package/lib/components/UnitBlock/UnitBlock.fixture.mobile.d.ts +0 -6
  130. package/lib/components/UnitBlock/UnitBlock.js +0 -9
  131. package/lib/components/UnitBlock/UnitBlock.js.map +0 -1
  132. package/lib/components/UnitBlock/UnitBlockContent.d.ts +0 -6
  133. package/lib/components/UnitBlock/UnitBlockContent.js +0 -2
  134. package/lib/components/UnitBlock/UnitBlockContent.js.map +0 -1
  135. package/mobile/bundle/components/InvestmentInfo/InvestmentInfo.d.ts +0 -5
  136. package/mobile/bundle/components/InvestmentInfo/InvestmentInfoContent.d.ts +0 -43
  137. package/mobile/bundle/components/RepresentativeOfficeInfo/RepresentativeOfficeInfo.d.ts +0 -5
  138. package/mobile/bundle/components/RepresentativeOfficeInfo/RepresentativeOfficeInfoContent.d.ts +0 -18
  139. package/mobile/bundle/components/UnitBlock/UnitBlock.d.ts +0 -6
  140. package/mobile/bundle/components/UnitBlock/UnitBlockContent.d.ts +0 -6
  141. package/mobile/dist/components/InvestmentInfo/InvestmentInfo.d.ts +0 -5
  142. package/mobile/dist/components/InvestmentInfo/InvestmentInfo.js +0 -47
  143. package/mobile/dist/components/InvestmentInfo/InvestmentInfo.js.map +0 -1
  144. package/mobile/dist/components/InvestmentInfo/InvestmentInfoContent.d.ts +0 -43
  145. package/mobile/dist/components/InvestmentInfo/InvestmentInfoContent.js +0 -2
  146. package/mobile/dist/components/InvestmentInfo/InvestmentInfoContent.js.map +0 -1
  147. package/mobile/dist/components/RepresentativeOfficeInfo/RepresentativeOfficeInfo.d.ts +0 -5
  148. package/mobile/dist/components/RepresentativeOfficeInfo/RepresentativeOfficeInfo.js +0 -26
  149. package/mobile/dist/components/RepresentativeOfficeInfo/RepresentativeOfficeInfo.js.map +0 -1
  150. package/mobile/dist/components/RepresentativeOfficeInfo/RepresentativeOfficeInfoContent.d.ts +0 -18
  151. package/mobile/dist/components/RepresentativeOfficeInfo/RepresentativeOfficeInfoContent.js +0 -2
  152. package/mobile/dist/components/RepresentativeOfficeInfo/RepresentativeOfficeInfoContent.js.map +0 -1
  153. package/mobile/dist/components/UnitBlock/UnitBlock.d.ts +0 -6
  154. package/mobile/dist/components/UnitBlock/UnitBlock.js +0 -11
  155. package/mobile/dist/components/UnitBlock/UnitBlock.js.map +0 -1
  156. package/mobile/dist/components/UnitBlock/UnitBlockContent.d.ts +0 -6
  157. package/mobile/dist/components/UnitBlock/UnitBlockContent.js +0 -2
  158. package/mobile/dist/components/UnitBlock/UnitBlockContent.js.map +0 -1
  159. package/mobile/lib/components/InvestmentInfo/InvestmentInfo.d.ts +0 -5
  160. package/mobile/lib/components/InvestmentInfo/InvestmentInfo.js +0 -45
  161. package/mobile/lib/components/InvestmentInfo/InvestmentInfo.js.map +0 -1
  162. package/mobile/lib/components/InvestmentInfo/InvestmentInfoContent.d.ts +0 -43
  163. package/mobile/lib/components/InvestmentInfo/InvestmentInfoContent.js +0 -2
  164. package/mobile/lib/components/InvestmentInfo/InvestmentInfoContent.js.map +0 -1
  165. package/mobile/lib/components/RepresentativeOfficeInfo/RepresentativeOfficeInfo.d.ts +0 -5
  166. package/mobile/lib/components/RepresentativeOfficeInfo/RepresentativeOfficeInfo.js +0 -24
  167. package/mobile/lib/components/RepresentativeOfficeInfo/RepresentativeOfficeInfo.js.map +0 -1
  168. package/mobile/lib/components/RepresentativeOfficeInfo/RepresentativeOfficeInfoContent.d.ts +0 -18
  169. package/mobile/lib/components/RepresentativeOfficeInfo/RepresentativeOfficeInfoContent.js +0 -2
  170. package/mobile/lib/components/RepresentativeOfficeInfo/RepresentativeOfficeInfoContent.js.map +0 -1
  171. package/mobile/lib/components/UnitBlock/UnitBlock.d.ts +0 -6
  172. package/mobile/lib/components/UnitBlock/UnitBlock.js +0 -9
  173. package/mobile/lib/components/UnitBlock/UnitBlock.js.map +0 -1
  174. package/mobile/lib/components/UnitBlock/UnitBlockContent.d.ts +0 -6
  175. package/mobile/lib/components/UnitBlock/UnitBlockContent.js +0 -2
  176. package/mobile/lib/components/UnitBlock/UnitBlockContent.js.map +0 -1
  177. package/mobile/src/components/InvestmentInfo/InvestmentInfo.example.json +0 -53
  178. package/mobile/src/components/InvestmentInfo/InvestmentInfo.tsx +0 -131
  179. package/mobile/src/components/InvestmentInfo/InvestmentInfo.ui.json +0 -13
  180. package/mobile/src/components/InvestmentInfo/InvestmentInfoContent.ts +0 -51
  181. package/mobile/src/components/RepresentativeOfficeInfo/RepresentativeOfficeInfo.example.json +0 -14
  182. package/mobile/src/components/RepresentativeOfficeInfo/RepresentativeOfficeInfo.tsx +0 -94
  183. package/mobile/src/components/RepresentativeOfficeInfo/RepresentativeOfficeInfo.ui.json +0 -24
  184. package/mobile/src/components/RepresentativeOfficeInfo/RepresentativeOfficeInfoContent.ts +0 -22
  185. package/mobile/src/components/UnitBlock/UnitBlock.example.json +0 -9
  186. package/mobile/src/components/UnitBlock/UnitBlock.tsx +0 -17
  187. package/mobile/src/components/UnitBlock/UnitBlock.ui.json +0 -1
  188. package/mobile/src/components/UnitBlock/UnitBlockContent.ts +0 -7
  189. package/src/components/InvestmentInfo/InvestmentInfo.example.json +0 -53
  190. package/src/components/InvestmentInfo/InvestmentInfo.fixture.tsx +0 -109
  191. package/src/components/InvestmentInfo/InvestmentInfo.tsx +0 -131
  192. package/src/components/InvestmentInfo/InvestmentInfo.ui.json +0 -13
  193. package/src/components/InvestmentInfo/InvestmentInfoContent.ts +0 -51
  194. package/src/components/RepresentativeOfficeInfo/RepresentativeOfficeInfo.example.json +0 -14
  195. package/src/components/RepresentativeOfficeInfo/RepresentativeOfficeInfo.fixture.mobile.tsx +0 -47
  196. package/src/components/RepresentativeOfficeInfo/RepresentativeOfficeInfo.fixture.tsx +0 -47
  197. package/src/components/RepresentativeOfficeInfo/RepresentativeOfficeInfo.tsx +0 -94
  198. package/src/components/RepresentativeOfficeInfo/RepresentativeOfficeInfo.ui.json +0 -24
  199. package/src/components/RepresentativeOfficeInfo/RepresentativeOfficeInfoContent.ts +0 -22
  200. package/src/components/UnitBlock/UnitBlock.example.json +0 -9
  201. package/src/components/UnitBlock/UnitBlock.fixture.mobile.tsx +0 -27
  202. package/src/components/UnitBlock/UnitBlock.fixture.tsx +0 -27
  203. package/src/components/UnitBlock/UnitBlock.tsx +0 -17
  204. package/src/components/UnitBlock/UnitBlock.ui.json +0 -1
  205. package/src/components/UnitBlock/UnitBlockContent.ts +0 -7
@@ -1,131 +0,0 @@
1
- import { JSX } from '@redneckz/uni-jsx';
2
- import { BlockWrapper } from '../../ui-kit/BlockWrapper';
3
- import { RichText } from '../../ui-kit/RichText/RichText';
4
- import { Text } from '../../ui-kit/Text/Text';
5
- import { type UniBlockProps } from '../../UniBlock/UniBlockProps';
6
- import { joinList } from '../../utils/joinList';
7
- import {
8
- type InvestmentCell,
9
- type InvestmentCellColor,
10
- type InvestmentCellSize,
11
- type InvestmentColumn,
12
- type InvestmentInfoContent,
13
- type InvestmentZeroColumn,
14
- } from './InvestmentInfoContent';
15
-
16
- const investmentCellColorMap: Record<InvestmentCellColor, string> = {
17
- yellow: 'bg-yellow',
18
- green: 'bg-green',
19
- 'green-light': 'bg-green-light',
20
- 'green-dark': 'bg-green-dark',
21
- };
22
-
23
- const investmentCellSizeMap: Record<InvestmentCellSize, string> = {
24
- XS: 'h-10',
25
- S: 'h-16',
26
- M: 'h-24',
27
- L: 'h-32',
28
- XL: 'h-52',
29
- };
30
-
31
- export interface InvestmentInfoProps extends InvestmentInfoContent, UniBlockProps {}
32
-
33
- export const InvestmentInfo = JSX<InvestmentInfoProps>((props) => {
34
- const {
35
- className = '',
36
- __html,
37
- isDotted,
38
- investmentZeroColumn,
39
- investmentColumns,
40
- ...rest
41
- } = props;
42
- const columns = investmentColumns ? [...investmentColumns] : [];
43
- if (investmentZeroColumn) {
44
- columns.unshift(investmentZeroColumn);
45
- }
46
-
47
- return (
48
- <BlockWrapper className={className} defaultPadding="p-4xl" {...rest}>
49
- <div className="container text-m font-light space-y-4xl">
50
- {columns?.length ? (
51
- <div>
52
- <div className="flex items-end relative pl-3xl pr-lg text-white">
53
- {joinList(<div className="w-px h-4 bg-gray" />)(columns.map(renderInvestmentColumn))}
54
- <div className="absolute right-3xl w-px h-4 bg-gray" />
55
- </div>
56
- <div className="border-t border-gray -mt-xs mx-3xl" />
57
- <div className="flex justify-between text-primary-text mt-s -mx-5xl">
58
- {columns.map(renderInvestmentColumnTitle)}
59
- </div>
60
- </div>
61
- ) : null}
62
- {__html ? (
63
- <div className="max-w-2xl font-light text-base">
64
- <RichText __html={__html} isDotted={isDotted} itemSize="list-s" />
65
- </div>
66
- ) : null}
67
- </div>
68
- </BlockWrapper>
69
- );
70
- });
71
-
72
- const renderInvestmentColumn = (
73
- column: InvestmentColumn | InvestmentZeroColumn,
74
- i: number,
75
- arr: Array<InvestmentColumn>,
76
- ) => {
77
- const isSecondColumn = i === 1;
78
- const isLastColumn = i === arr.length - 1;
79
- const reversedCells = column.cells?.reverse() || [];
80
-
81
- return (
82
- <div
83
- key={`column_${i}`}
84
- className={`${getColumnClasses(isSecondColumn, isLastColumn, column.cells)}`}
85
- >
86
- {reversedCells.length ? (
87
- <div
88
- className={`w-full ${
89
- isLastColumn ? 'border-4 border-green-more-dark p-1.5 min-w-72' : ''
90
- }`}
91
- >
92
- {reversedCells.map(renderInvestmentCell)}
93
- </div>
94
- ) : null}
95
- </div>
96
- );
97
- };
98
-
99
- const getColumnClasses = (
100
- isSecondColumn: boolean,
101
- isLastColumn: boolean,
102
- cells: InvestmentCell[] = [],
103
- ): string =>
104
- [
105
- cells.length ? 'flex-1' : 'flex-0',
106
- cells.length && !isSecondColumn && !isLastColumn ? 'pl-s' : '',
107
- cells.length && !isLastColumn ? 'pr-s pb-3xl' : 'pb-xl',
108
- ].join(' ');
109
-
110
- const renderInvestmentCell = (cell: InvestmentCell, i: number) => {
111
- const cellSize = cell.cellSize || 'XS';
112
- const cellColor = cell.cellColor || 'green';
113
-
114
- return cell.text ? (
115
- <div
116
- key={`cell_${i}`}
117
- className={`flex-1 flex items-center justify-center relative py-xs ${
118
- investmentCellSizeMap[cellSize]
119
- } ${investmentCellColorMap[cellColor]} ${cellSize === 'XS' ? 'px-s' : 'px-5xl'}`}
120
- >
121
- <Text align="text-center">{cell.text}</Text>
122
- </div>
123
- ) : null;
124
- };
125
-
126
- const renderInvestmentColumnTitle = (column: InvestmentColumn | InvestmentZeroColumn, i: number) =>
127
- column?.title ? (
128
- <div key={`title_${i}`} className="flex-1 max-w-44 text-center px-xs last:pr-4xl last:max-w-52">
129
- {column.title}
130
- </div>
131
- ) : null;
@@ -1,13 +0,0 @@
1
- {
2
- "content": {
3
- "__html": {
4
- "ui:widget": "html"
5
- }
6
- },
7
- "style": {
8
- "ui:options": {
9
- "minCols": 12,
10
- "maxCols": 12
11
- }
12
- }
13
- }
@@ -1,51 +0,0 @@
1
- import { type BulletsProps } from '../../model/Bullets';
2
- import { type TextProps, type TitleProps } from '../../model/HeadlineType';
3
- import { type RichTextProps } from '../../ui-kit/RichText/RichTextProps';
4
- import { type UniBlockContent } from '../../UniBlock/UniBlockProps';
5
-
6
- /**
7
- * @title Цвет
8
- * @enumNames ["Оранжевый", "Светло-зеленый", "Зеленый", "Тёмно-зеленый"]
9
- */
10
- export type InvestmentCellColor = 'yellow' | 'green-light' | 'green' | 'green-dark';
11
-
12
- /**
13
- * @title Высота
14
- */
15
- export type InvestmentCellSize = 'XL' | 'L' | 'M' | 'S' | 'XS';
16
-
17
- /**
18
- * @title Ячейка
19
- */
20
- export type InvestmentCell = TextProps & {
21
- cellColor?: InvestmentCellColor;
22
- cellSize?: InvestmentCellSize;
23
- };
24
-
25
- /**
26
- * @title Элемент данных 1
27
- */
28
- export type InvestmentZeroColumn = TitleProps & {
29
- /** @hidden */
30
- cells?: InvestmentCell[];
31
- };
32
-
33
- /**
34
- * @title Элемент данных
35
- */
36
- export type InvestmentColumn = TitleProps & {
37
- /** @title Ячейки */
38
- cells?: InvestmentCell[];
39
- };
40
-
41
- /**
42
- * @title Блок инвестиций
43
- */
44
- export type InvestmentInfoContent = UniBlockContent &
45
- RichTextProps &
46
- BulletsProps & {
47
- /** @title Элемент данных 1 */
48
- investmentZeroColumn?: InvestmentZeroColumn;
49
- /** @title Остальные элементы данных */
50
- investmentColumns?: InvestmentColumn[];
51
- };
@@ -1,14 +0,0 @@
1
- {
2
- "content": {
3
- "version": "primary",
4
- "padding": "",
5
- "title": "Заголовок",
6
- "description": "Описание",
7
- "__html": "<p>Описание</p>",
8
- "richVersion": "",
9
- "button": {
10
- "text": "Информация о регионе",
11
- "version": "link"
12
- }
13
- }
14
- }
@@ -1,94 +0,0 @@
1
- import { JSX } from '@redneckz/uni-jsx';
2
- import { type IconName } from '../../icons/IconName';
3
- import { BlockWrapper } from '../../ui-kit/BlockWrapper';
4
- import { Heading } from '../../ui-kit/Heading/Heading';
5
- import { Icon } from '../../ui-kit/Icon/Icon';
6
- import { Img } from '../../ui-kit/Img/Img';
7
- import { renderButtonsSection } from '../../ui-kit/LinkButton/renderButtonsSection';
8
- import { RichText } from '../../ui-kit/RichText/RichText';
9
- import { type RichTextProps } from '../../ui-kit/RichText/RichTextProps';
10
- import { Text } from '../../ui-kit/Text/Text';
11
- import { type TextColor } from '../../ui-kit/Text/TextProps';
12
- import { type UniBlockProps } from '../../UniBlock/UniBlockProps';
13
- import { isIcon } from '../../utils/isIcon';
14
- import { style } from '../../utils/style';
15
- import { type RepresentativeOfficeInfoContent } from './RepresentativeOfficeInfoContent';
16
-
17
- export interface RepresentativeOfficeInfoProps
18
- extends RepresentativeOfficeInfoContent,
19
- UniBlockProps {}
20
-
21
- export const RepresentativeOfficeInfo = JSX<RepresentativeOfficeInfoProps>(
22
- ({
23
- address,
24
- email,
25
- telephone,
26
- button,
27
- className = '',
28
- __html,
29
- richVersion,
30
- icon,
31
- title,
32
- version = 'primary',
33
- ...rest
34
- }) => (
35
- <BlockWrapper
36
- className={style('box-border text-left space-y-s', className)}
37
- version={version}
38
- {...rest}
39
- >
40
- <div className="w-full flex justify-between flex-row-reverse">
41
- {isIcon(icon) ? (
42
- <div className={'w-10 h-7 sm:w-24 sm:h-16'}>
43
- <Img image={icon} />
44
- </div>
45
- ) : null}
46
- {title ? <Heading headingType="h3" as="h3" title={title} /> : null}
47
- </div>
48
- <div className="w-full space-y-m">
49
- {__html ? renderDescriptionBlock({ __html, richVersion }) : null}
50
- {renderBlock({
51
- label: 'Адрес',
52
- data: address,
53
- iconName: 'GeolocationIcon',
54
- })}
55
- {renderBlock({ label: 'Телефон(факс)', data: telephone, iconName: 'PhoneIcon' })}
56
- {renderBlock({
57
- label: 'E-mail',
58
- data: email,
59
- iconName: 'MailIcon',
60
- dataColor: 'text-primary-main',
61
- })}
62
- {button?.text ? renderButtonsSection([button]) : null}
63
- </div>
64
- </BlockWrapper>
65
- ),
66
- );
67
-
68
- const renderDescriptionBlock = (props: RichTextProps) => (
69
- <div className="border-b border-main-divider pb-lg">
70
- <RichText {...props} itemSize="list-s" />
71
- </div>
72
- );
73
-
74
- interface renderBlockProps {
75
- label?: string;
76
- data?: string;
77
- iconName?: IconName;
78
- dataColor?: TextColor;
79
- }
80
-
81
- const renderBlock = ({ label, data, iconName, dataColor = '' }: renderBlockProps) =>
82
- data ? (
83
- <div className="flex gap-s">
84
- <Icon iconVersion="black" name={iconName} width="24" height="24" />
85
- <div className="flex flex-col gap-2xs">
86
- <Text size="text-m" font="font-light" color="text-secondary-text">
87
- {label}
88
- </Text>
89
- <Text size="text-xl" color={dataColor}>
90
- {data}
91
- </Text>
92
- </div>
93
- </div>
94
- ) : null;
@@ -1,24 +0,0 @@
1
- {
2
- "content": {
3
- "__html": {
4
- "ui:widget": "html"
5
- },
6
- "button": {
7
- "href": {
8
- "ui:field": "attachmentHref"
9
- },
10
- "icon": {
11
- "ui:field": "icon"
12
- },
13
- "iconRight": {
14
- "ui:field": "icon"
15
- }
16
- }
17
- },
18
- "style": {
19
- "ui:options": {
20
- "minCols": 6,
21
- "maxCols": 6
22
- }
23
- }
24
- }
@@ -1,22 +0,0 @@
1
- import { type TitleProps } from '../../model/HeadlineType';
2
- import { type IconProps } from '../../model/Picture';
3
- import { type LinkButtonContent } from '../../ui-kit/LinkButton/LinkButtonContent';
4
- import { type RichTextProps } from '../../ui-kit/RichText/RichTextProps';
5
- import { type UniBlockContent } from '../../UniBlock/UniBlockProps';
6
-
7
- /**
8
- * @title Блок с информацией о представительстве
9
- */
10
- export type RepresentativeOfficeInfoContent = UniBlockContent &
11
- TitleProps &
12
- RichTextProps &
13
- IconProps & {
14
- /** @title Адрес */
15
- address?: string;
16
- /** @title Телефон (факс) */
17
- telephone?: string;
18
- /** @title E-mail */
19
- email?: string;
20
- /** @title Кнопка */
21
- button?: LinkButtonContent;
22
- };
@@ -1,9 +0,0 @@
1
- {
2
- "content": {
3
- "version": "primary",
4
- "padding": "",
5
- "prefix": "префикс",
6
- "unit": 1,
7
- "suffix": "суффикс"
8
- }
9
- }
@@ -1,17 +0,0 @@
1
- import { JSX } from '@redneckz/uni-jsx';
2
- import { BlockWrapper } from '../../ui-kit/BlockWrapper';
3
- import { Unit } from '../../ui-kit/Unit/Unit';
4
- import { type UniBlockProps } from '../../UniBlock/UniBlockProps';
5
- import { type UnitBlockContent } from './UnitBlockContent';
6
-
7
- interface UnitBlockProps extends UnitBlockContent, UniBlockProps {}
8
-
9
- export const UnitBlock = JSX<UnitBlockProps>((props) => {
10
- const { prefix, unit, suffix, ...rest } = props;
11
-
12
- return (
13
- <BlockWrapper defaultPadding="p-0" {...rest}>
14
- <Unit prefix={prefix} unit={unit} suffix={suffix} />
15
- </BlockWrapper>
16
- );
17
- });
@@ -1,7 +0,0 @@
1
- import { type UnitProps } from '../../ui-kit/Unit/UnitProps';
2
- import { type UniBlockContent } from '../../UniBlock/UniBlockProps';
3
-
4
- /**
5
- * @title Показатель
6
- */
7
- export type UnitBlockContent = UniBlockContent & UnitProps;
@@ -1,53 +0,0 @@
1
- {
2
- "content": {
3
- "version": "primary",
4
- "padding": "",
5
- "__html": "<ul><li>Пункт 1</li><li>Пункт 2</li><li>Пункт 3</li></ul>",
6
- "isDotted": true,
7
- "investmentZeroColumn": {
8
- "title": "Название 1"
9
- },
10
- "investmentColumns": [
11
- {
12
- "title": "Название 2",
13
- "cells": [
14
- {
15
- "text": "Ячейка 2-1",
16
- "cellColor": "green-dark",
17
- "cellSize": "S"
18
- }
19
- ]
20
- },
21
- {
22
- "title": "Название 3",
23
- "cells": [
24
- {
25
- "text": "Ячейка 3-1",
26
- "cellColor": "green-dark",
27
- "cellSize": "S"
28
- }
29
- ]
30
- },
31
- {
32
- "title": "Название 4",
33
- "cells": [
34
- {
35
- "text": "Ячейка 4-1",
36
- "cellColor": "green-dark",
37
- "cellSize": "L"
38
- }
39
- ]
40
- },
41
- {
42
- "title": "Название 5",
43
- "cells": [
44
- {
45
- "text": "Ячейка 5-1",
46
- "cellColor": "green-dark",
47
- "cellSize": "XL"
48
- }
49
- ]
50
- }
51
- ]
52
- }
53
- }
@@ -1,109 +0,0 @@
1
- import '../../setup-fixture';
2
-
3
- import { InvestmentInfo } from './InvestmentInfo';
4
- import { type InvestmentInfoContent } from './InvestmentInfoContent';
5
-
6
- export const INVESTMENT_INFO: InvestmentInfoContent = {
7
- __html: `
8
- <ul>
9
- <li>Пример с ежегодным взносом 400 000 ₽</li>
10
- <li>Срок использования ИИС вы определяете сами. Но для получения налоговых вычетов он должен быть открыт не менее 3 лет</li>
11
- <li>Вы можете возвращать до 52 000 ₽ каждый год</li>
12
- </ul>
13
- `,
14
- investmentZeroColumn: {
15
- title: 'Открытие ИИС',
16
- },
17
- investmentColumns: [
18
- {
19
- title: '1 января года, следующего за годом открытия ИИС',
20
- cells: [
21
- {
22
- text: 'Потенциальный доход инвестиций',
23
- cellColor: 'green-light',
24
- },
25
- {
26
- text: 'Первый взнос 400 000 ₽',
27
- cellColor: 'green-dark',
28
- cellSize: 'S',
29
- },
30
- ],
31
- },
32
- {
33
- title: '1 января второго года после открытия ИИС',
34
- cells: [
35
- {
36
- text: 'Налоговый вычет за 1 год 52 000 ₽',
37
- cellColor: 'yellow',
38
- },
39
- {
40
- text: 'Потенциальный доход инвестиций за 2 года',
41
- cellColor: 'green-light',
42
- cellSize: 'S',
43
- },
44
- {
45
- text: 'Второй взнос 400 000 ₽',
46
- cellColor: 'green',
47
- cellSize: 'S',
48
- },
49
- {
50
- text: 'Первый взнос 400 000 ₽',
51
- cellColor: 'green-dark',
52
- cellSize: 'S',
53
- },
54
- ],
55
- },
56
- {
57
- title: '1 января третьего года после открытия ИИС',
58
- cells: [
59
- {
60
- text: 'Налоговый вычет за 2 год 52 000 ₽',
61
- cellColor: 'yellow',
62
- },
63
- {
64
- text: 'Потенциальный доход инвестиций за 3 года',
65
- cellColor: 'green-light',
66
- cellSize: 'M',
67
- },
68
- {
69
- text: 'Третий взнос — 0 ₽',
70
- cellColor: 'green',
71
- cellSize: 'S',
72
- },
73
- {
74
- text: 'Первый и второй взносы 800 000 ₽',
75
- cellColor: 'green-dark',
76
- cellSize: 'L',
77
- },
78
- ],
79
- },
80
- {
81
- title: 'Возможный вывод средств, закрытие ИИС',
82
- cells: [
83
- {
84
- text: 'Налоговый вычет за 3 года 156 000 ₽',
85
- cellColor: 'yellow',
86
- cellSize: 'S',
87
- },
88
- {
89
- text: 'Потенциальный доход инвестиций за 3 года',
90
- cellColor: 'green-light',
91
- cellSize: 'M',
92
- },
93
- {
94
- text: 'Сумма инвестиций за 3 года 1 200 000 ₽',
95
- cellColor: 'green-dark',
96
- cellSize: 'XL',
97
- },
98
- ],
99
- },
100
- ],
101
- };
102
-
103
- export default {
104
- default: (
105
- <div className="container grid grid-cols-12">
106
- <InvestmentInfo className="col-span-12" {...INVESTMENT_INFO} />
107
- </div>
108
- ),
109
- };
@@ -1,131 +0,0 @@
1
- import { JSX } from '@redneckz/uni-jsx';
2
- import { BlockWrapper } from '../../ui-kit/BlockWrapper';
3
- import { RichText } from '../../ui-kit/RichText/RichText';
4
- import { Text } from '../../ui-kit/Text/Text';
5
- import { type UniBlockProps } from '../../UniBlock/UniBlockProps';
6
- import { joinList } from '../../utils/joinList';
7
- import {
8
- type InvestmentCell,
9
- type InvestmentCellColor,
10
- type InvestmentCellSize,
11
- type InvestmentColumn,
12
- type InvestmentInfoContent,
13
- type InvestmentZeroColumn,
14
- } from './InvestmentInfoContent';
15
-
16
- const investmentCellColorMap: Record<InvestmentCellColor, string> = {
17
- yellow: 'bg-yellow',
18
- green: 'bg-green',
19
- 'green-light': 'bg-green-light',
20
- 'green-dark': 'bg-green-dark',
21
- };
22
-
23
- const investmentCellSizeMap: Record<InvestmentCellSize, string> = {
24
- XS: 'h-10',
25
- S: 'h-16',
26
- M: 'h-24',
27
- L: 'h-32',
28
- XL: 'h-52',
29
- };
30
-
31
- export interface InvestmentInfoProps extends InvestmentInfoContent, UniBlockProps {}
32
-
33
- export const InvestmentInfo = JSX<InvestmentInfoProps>((props) => {
34
- const {
35
- className = '',
36
- __html,
37
- isDotted,
38
- investmentZeroColumn,
39
- investmentColumns,
40
- ...rest
41
- } = props;
42
- const columns = investmentColumns ? [...investmentColumns] : [];
43
- if (investmentZeroColumn) {
44
- columns.unshift(investmentZeroColumn);
45
- }
46
-
47
- return (
48
- <BlockWrapper className={className} defaultPadding="p-4xl" {...rest}>
49
- <div className="container text-m font-light space-y-4xl">
50
- {columns?.length ? (
51
- <div>
52
- <div className="flex items-end relative pl-3xl pr-lg text-white">
53
- {joinList(<div className="w-px h-4 bg-gray" />)(columns.map(renderInvestmentColumn))}
54
- <div className="absolute right-3xl w-px h-4 bg-gray" />
55
- </div>
56
- <div className="border-t border-gray -mt-xs mx-3xl" />
57
- <div className="flex justify-between text-primary-text mt-s -mx-5xl">
58
- {columns.map(renderInvestmentColumnTitle)}
59
- </div>
60
- </div>
61
- ) : null}
62
- {__html ? (
63
- <div className="max-w-2xl font-light text-base">
64
- <RichText __html={__html} isDotted={isDotted} itemSize="list-s" />
65
- </div>
66
- ) : null}
67
- </div>
68
- </BlockWrapper>
69
- );
70
- });
71
-
72
- const renderInvestmentColumn = (
73
- column: InvestmentColumn | InvestmentZeroColumn,
74
- i: number,
75
- arr: Array<InvestmentColumn>,
76
- ) => {
77
- const isSecondColumn = i === 1;
78
- const isLastColumn = i === arr.length - 1;
79
- const reversedCells = column.cells?.reverse() || [];
80
-
81
- return (
82
- <div
83
- key={`column_${i}`}
84
- className={`${getColumnClasses(isSecondColumn, isLastColumn, column.cells)}`}
85
- >
86
- {reversedCells.length ? (
87
- <div
88
- className={`w-full ${
89
- isLastColumn ? 'border-4 border-green-more-dark p-1.5 min-w-72' : ''
90
- }`}
91
- >
92
- {reversedCells.map(renderInvestmentCell)}
93
- </div>
94
- ) : null}
95
- </div>
96
- );
97
- };
98
-
99
- const getColumnClasses = (
100
- isSecondColumn: boolean,
101
- isLastColumn: boolean,
102
- cells: InvestmentCell[] = [],
103
- ): string =>
104
- [
105
- cells.length ? 'flex-1' : 'flex-0',
106
- cells.length && !isSecondColumn && !isLastColumn ? 'pl-s' : '',
107
- cells.length && !isLastColumn ? 'pr-s pb-3xl' : 'pb-xl',
108
- ].join(' ');
109
-
110
- const renderInvestmentCell = (cell: InvestmentCell, i: number) => {
111
- const cellSize = cell.cellSize || 'XS';
112
- const cellColor = cell.cellColor || 'green';
113
-
114
- return cell.text ? (
115
- <div
116
- key={`cell_${i}`}
117
- className={`flex-1 flex items-center justify-center relative py-xs ${
118
- investmentCellSizeMap[cellSize]
119
- } ${investmentCellColorMap[cellColor]} ${cellSize === 'XS' ? 'px-s' : 'px-5xl'}`}
120
- >
121
- <Text align="text-center">{cell.text}</Text>
122
- </div>
123
- ) : null;
124
- };
125
-
126
- const renderInvestmentColumnTitle = (column: InvestmentColumn | InvestmentZeroColumn, i: number) =>
127
- column?.title ? (
128
- <div key={`title_${i}`} className="flex-1 max-w-44 text-center px-xs last:pr-4xl last:max-w-52">
129
- {column.title}
130
- </div>
131
- ) : null;