@redneckz/wildless-cms-uni-blocks 0.6.50 → 0.7.1

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 (188) hide show
  1. package/bundle/blocks.schema.json +1 -1
  2. package/bundle/bundle.umd.js +71 -19
  3. package/bundle/bundle.umd.min.js +1 -1
  4. package/bundle/components/CarouselTariffsCard/CarouselTariffsCard.d.ts +1 -1
  5. package/bundle/components/CarouselTariffsCard/CarouselTariffsCardContent.d.ts +1 -1
  6. package/bundle/components/LinkDocs/LinkDocsContent.d.ts +4 -0
  7. package/bundle/components/SwipeListControlBlock/SwipeListControlBlock.d.ts +6 -0
  8. package/bundle/components/SwipeListControlBlock/SwipeListControlBlockContent.d.ts +5 -0
  9. package/bundle/ui-kit/SwipeListControl/SwipeListContainer.d.ts +2 -1
  10. package/bundle/ui-kit/SwipeListControl/SwipeListControlDots.d.ts +2 -0
  11. package/bundle/ui-kit/SwipeListControl/SwipeListControlProps.d.ts +7 -0
  12. package/bundle/utils/style.d.ts +1 -0
  13. package/dist/components/Blocks.js +2 -0
  14. package/dist/components/Blocks.js.map +1 -1
  15. package/dist/components/CarouselCard/CarouselCard.js +2 -2
  16. package/dist/components/CarouselCard/CarouselCard.js.map +1 -1
  17. package/dist/components/CarouselProgramsCard/CarouselProgramsCard.js +1 -1
  18. package/dist/components/CarouselProgramsCard/CarouselProgramsCard.js.map +1 -1
  19. package/dist/components/CarouselTariffsCard/CarouselTariffsCard.d.ts +1 -1
  20. package/dist/components/CarouselTariffsCard/CarouselTariffsCard.js +12 -9
  21. package/dist/components/CarouselTariffsCard/CarouselTariffsCard.js.map +1 -1
  22. package/dist/components/CarouselTariffsCard/CarouselTariffsCardContent.d.ts +1 -1
  23. package/dist/components/LinkDocs/LinkDocsContent.d.ts +4 -0
  24. package/dist/components/SwipeListControlBlock/SwipeListControlBlock.d.ts +6 -0
  25. package/dist/components/SwipeListControlBlock/SwipeListControlBlock.js +14 -0
  26. package/dist/components/SwipeListControlBlock/SwipeListControlBlock.js.map +1 -0
  27. package/dist/components/SwipeListControlBlock/SwipeListControlBlockContent.d.ts +5 -0
  28. package/dist/components/SwipeListControlBlock/SwipeListControlBlockContent.js +2 -0
  29. package/dist/components/SwipeListControlBlock/SwipeListControlBlockContent.js.map +1 -0
  30. package/dist/ui-kit/BlockWrapper.js +1 -1
  31. package/dist/ui-kit/BlockWrapper.js.map +1 -1
  32. package/dist/ui-kit/SwipeListControl/SwipeListContainer.d.ts +2 -1
  33. package/dist/ui-kit/SwipeListControl/SwipeListContainer.js +8 -5
  34. package/dist/ui-kit/SwipeListControl/SwipeListContainer.js.map +1 -1
  35. package/dist/ui-kit/SwipeListControl/SwipeListControl.js +3 -2
  36. package/dist/ui-kit/SwipeListControl/SwipeListControl.js.map +1 -1
  37. package/dist/ui-kit/SwipeListControl/SwipeListControlDots.d.ts +2 -0
  38. package/dist/ui-kit/SwipeListControl/SwipeListControlDots.js +12 -3
  39. package/dist/ui-kit/SwipeListControl/SwipeListControlDots.js.map +1 -1
  40. package/dist/ui-kit/SwipeListControl/SwipeListControlProps.d.ts +7 -0
  41. package/dist/utils/style.d.ts +1 -0
  42. package/dist/utils/style.js +5 -0
  43. package/dist/utils/style.js.map +1 -0
  44. package/lib/common.css +1 -1
  45. package/lib/components/Blocks.js +2 -0
  46. package/lib/components/Blocks.js.map +1 -1
  47. package/lib/components/CarouselCard/CarouselCard.js +2 -2
  48. package/lib/components/CarouselCard/CarouselCard.js.map +1 -1
  49. package/lib/components/CarouselProgramsCard/CarouselProgramsCard.js +1 -1
  50. package/lib/components/CarouselProgramsCard/CarouselProgramsCard.js.map +1 -1
  51. package/lib/components/CarouselTariffsCard/CarouselTariffsCard.d.ts +1 -1
  52. package/lib/components/CarouselTariffsCard/CarouselTariffsCard.js +12 -9
  53. package/lib/components/CarouselTariffsCard/CarouselTariffsCard.js.map +1 -1
  54. package/lib/components/CarouselTariffsCard/CarouselTariffsCardContent.d.ts +1 -1
  55. package/lib/components/LinkDocs/LinkDocsContent.d.ts +4 -0
  56. package/lib/components/SwipeListControlBlock/SwipeListControlBlock.d.ts +6 -0
  57. package/lib/components/SwipeListControlBlock/SwipeListControlBlock.fixture.d.ts +5 -0
  58. package/lib/components/SwipeListControlBlock/SwipeListControlBlock.js +12 -0
  59. package/lib/components/SwipeListControlBlock/SwipeListControlBlock.js.map +1 -0
  60. package/lib/components/SwipeListControlBlock/SwipeListControlBlockContent.d.ts +5 -0
  61. package/lib/components/SwipeListControlBlock/SwipeListControlBlockContent.js +2 -0
  62. package/lib/components/SwipeListControlBlock/SwipeListControlBlockContent.js.map +1 -0
  63. package/lib/ui-kit/BlockWrapper.js +1 -1
  64. package/lib/ui-kit/BlockWrapper.js.map +1 -1
  65. package/lib/ui-kit/SwipeListControl/SwipeListContainer.d.ts +2 -1
  66. package/lib/ui-kit/SwipeListControl/SwipeListContainer.js +8 -5
  67. package/lib/ui-kit/SwipeListControl/SwipeListContainer.js.map +1 -1
  68. package/lib/ui-kit/SwipeListControl/SwipeListControl.fixture.mobile.d.ts +1 -0
  69. package/lib/ui-kit/SwipeListControl/SwipeListControl.js +3 -2
  70. package/lib/ui-kit/SwipeListControl/SwipeListControl.js.map +1 -1
  71. package/lib/ui-kit/SwipeListControl/SwipeListControlDots.d.ts +2 -0
  72. package/lib/ui-kit/SwipeListControl/SwipeListControlDots.js +12 -3
  73. package/lib/ui-kit/SwipeListControl/SwipeListControlDots.js.map +1 -1
  74. package/lib/ui-kit/SwipeListControl/SwipeListControlProps.d.ts +7 -0
  75. package/lib/utils/style.d.ts +1 -0
  76. package/lib/utils/style.js +2 -0
  77. package/lib/utils/style.js.map +1 -0
  78. package/mobile/bundle/bundle.umd.js +25 -12
  79. package/mobile/bundle/bundle.umd.min.js +1 -1
  80. package/mobile/bundle/components/CarouselTariffsCard/CarouselTariffsCard.d.ts +1 -1
  81. package/mobile/bundle/components/CarouselTariffsCard/CarouselTariffsCardContent.d.ts +1 -1
  82. package/mobile/bundle/components/LinkDocs/LinkDocsContent.d.ts +4 -0
  83. package/mobile/bundle/components/SwipeListControlBlock/SwipeListControlBlock.d.ts +6 -0
  84. package/mobile/bundle/components/SwipeListControlBlock/SwipeListControlBlockContent.d.ts +5 -0
  85. package/mobile/bundle/ui-kit/SwipeListControl/SwipeListContainer.d.ts +2 -1
  86. package/mobile/bundle/ui-kit/SwipeListControl/SwipeListControlDots.d.ts +2 -0
  87. package/mobile/bundle/ui-kit/SwipeListControl/SwipeListControlProps.d.ts +7 -0
  88. package/mobile/bundle/utils/style.d.ts +1 -0
  89. package/mobile/dist/components/CarouselCard/CarouselCard.js +2 -2
  90. package/mobile/dist/components/CarouselCard/CarouselCard.js.map +1 -1
  91. package/mobile/dist/components/CarouselProgramsCard/CarouselProgramsCard.js +1 -1
  92. package/mobile/dist/components/CarouselProgramsCard/CarouselProgramsCard.js.map +1 -1
  93. package/mobile/dist/components/CarouselTariffsCard/CarouselTariffsCard.d.ts +1 -1
  94. package/mobile/dist/components/CarouselTariffsCard/CarouselTariffsCard.js +12 -9
  95. package/mobile/dist/components/CarouselTariffsCard/CarouselTariffsCard.js.map +1 -1
  96. package/mobile/dist/components/CarouselTariffsCard/CarouselTariffsCardContent.d.ts +1 -1
  97. package/mobile/dist/components/LinkDocs/LinkDocsContent.d.ts +4 -0
  98. package/mobile/dist/components/SwipeListControlBlock/SwipeListControlBlock.d.ts +6 -0
  99. package/mobile/dist/components/SwipeListControlBlock/SwipeListControlBlock.js +14 -0
  100. package/mobile/dist/components/SwipeListControlBlock/SwipeListControlBlock.js.map +1 -0
  101. package/mobile/dist/components/SwipeListControlBlock/SwipeListControlBlockContent.d.ts +5 -0
  102. package/mobile/dist/components/SwipeListControlBlock/SwipeListControlBlockContent.js +2 -0
  103. package/mobile/dist/components/SwipeListControlBlock/SwipeListControlBlockContent.js.map +1 -0
  104. package/mobile/dist/ui-kit/BlockWrapper.js +1 -1
  105. package/mobile/dist/ui-kit/BlockWrapper.js.map +1 -1
  106. package/mobile/dist/ui-kit/SwipeListControl/SwipeListContainer.d.ts +2 -1
  107. package/mobile/dist/ui-kit/SwipeListControl/SwipeListContainer.js +8 -5
  108. package/mobile/dist/ui-kit/SwipeListControl/SwipeListContainer.js.map +1 -1
  109. package/mobile/dist/ui-kit/SwipeListControl/SwipeListControl.js +3 -2
  110. package/mobile/dist/ui-kit/SwipeListControl/SwipeListControl.js.map +1 -1
  111. package/mobile/dist/ui-kit/SwipeListControl/SwipeListControlDots.d.ts +2 -0
  112. package/mobile/dist/ui-kit/SwipeListControl/SwipeListControlDots.js +12 -3
  113. package/mobile/dist/ui-kit/SwipeListControl/SwipeListControlDots.js.map +1 -1
  114. package/mobile/dist/ui-kit/SwipeListControl/SwipeListControlProps.d.ts +7 -0
  115. package/mobile/dist/utils/style.d.ts +1 -0
  116. package/mobile/dist/utils/style.js +5 -0
  117. package/mobile/dist/utils/style.js.map +1 -0
  118. package/mobile/lib/components/CarouselCard/CarouselCard.js +2 -2
  119. package/mobile/lib/components/CarouselCard/CarouselCard.js.map +1 -1
  120. package/mobile/lib/components/CarouselProgramsCard/CarouselProgramsCard.js +1 -1
  121. package/mobile/lib/components/CarouselProgramsCard/CarouselProgramsCard.js.map +1 -1
  122. package/mobile/lib/components/CarouselTariffsCard/CarouselTariffsCard.d.ts +1 -1
  123. package/mobile/lib/components/CarouselTariffsCard/CarouselTariffsCard.js +12 -9
  124. package/mobile/lib/components/CarouselTariffsCard/CarouselTariffsCard.js.map +1 -1
  125. package/mobile/lib/components/CarouselTariffsCard/CarouselTariffsCardContent.d.ts +1 -1
  126. package/mobile/lib/components/LinkDocs/LinkDocsContent.d.ts +4 -0
  127. package/mobile/lib/components/SwipeListControlBlock/SwipeListControlBlock.d.ts +6 -0
  128. package/mobile/lib/components/SwipeListControlBlock/SwipeListControlBlock.js +12 -0
  129. package/mobile/lib/components/SwipeListControlBlock/SwipeListControlBlock.js.map +1 -0
  130. package/mobile/lib/components/SwipeListControlBlock/SwipeListControlBlockContent.d.ts +5 -0
  131. package/mobile/lib/components/SwipeListControlBlock/SwipeListControlBlockContent.js +2 -0
  132. package/mobile/lib/components/SwipeListControlBlock/SwipeListControlBlockContent.js.map +1 -0
  133. package/mobile/lib/ui-kit/BlockWrapper.js +1 -1
  134. package/mobile/lib/ui-kit/BlockWrapper.js.map +1 -1
  135. package/mobile/lib/ui-kit/SwipeListControl/SwipeListContainer.d.ts +2 -1
  136. package/mobile/lib/ui-kit/SwipeListControl/SwipeListContainer.js +8 -5
  137. package/mobile/lib/ui-kit/SwipeListControl/SwipeListContainer.js.map +1 -1
  138. package/mobile/lib/ui-kit/SwipeListControl/SwipeListControl.js +3 -2
  139. package/mobile/lib/ui-kit/SwipeListControl/SwipeListControl.js.map +1 -1
  140. package/mobile/lib/ui-kit/SwipeListControl/SwipeListControlDots.d.ts +2 -0
  141. package/mobile/lib/ui-kit/SwipeListControl/SwipeListControlDots.js +12 -3
  142. package/mobile/lib/ui-kit/SwipeListControl/SwipeListControlDots.js.map +1 -1
  143. package/mobile/lib/ui-kit/SwipeListControl/SwipeListControlProps.d.ts +7 -0
  144. package/mobile/lib/utils/style.d.ts +1 -0
  145. package/mobile/lib/utils/style.js +2 -0
  146. package/mobile/lib/utils/style.js.map +1 -0
  147. package/mobile/src/common.css +11 -0
  148. package/mobile/src/components/Carousel/Carousel.ui.json +8 -0
  149. package/mobile/src/components/CarouselCard/CarouselCard.tsx +11 -5
  150. package/mobile/src/components/CarouselProgramsCard/CarouselProgramsCard.tsx +1 -1
  151. package/mobile/src/components/CarouselTariffsCard/CarouselTariffsCard.example.json +11 -3
  152. package/mobile/src/components/CarouselTariffsCard/CarouselTariffsCard.tsx +29 -17
  153. package/mobile/src/components/CarouselTariffsCard/CarouselTariffsCardContent.ts +1 -1
  154. package/mobile/src/components/LinkDocs/LinkDocsContent.ts +4 -0
  155. package/mobile/src/components/SwipeListControlBlock/SwipeListControlBlock.example.json +18 -0
  156. package/mobile/src/components/SwipeListControlBlock/SwipeListControlBlock.tsx +23 -0
  157. package/mobile/src/components/SwipeListControlBlock/SwipeListControlBlock.ui.json +1 -0
  158. package/mobile/src/components/SwipeListControlBlock/SwipeListControlBlockContent.ts +6 -0
  159. package/mobile/src/ui-kit/BlockWrapper.tsx +1 -1
  160. package/mobile/src/ui-kit/SwipeListControl/SwipeListContainer.tsx +19 -10
  161. package/mobile/src/ui-kit/SwipeListControl/SwipeListControl.tsx +6 -2
  162. package/mobile/src/ui-kit/SwipeListControl/SwipeListControlDots.tsx +20 -4
  163. package/mobile/src/ui-kit/SwipeListControl/SwipeListControlProps.ts +8 -0
  164. package/mobile/src/utils/style.ts +2 -0
  165. package/package.json +2 -2
  166. package/src/common.css +11 -0
  167. package/src/components/Blocks.ts +2 -0
  168. package/src/components/Carousel/Carousel.ui.json +8 -0
  169. package/src/components/CarouselCard/CarouselCard.tsx +11 -5
  170. package/src/components/CarouselProgramsCard/CarouselProgramsCard.tsx +1 -1
  171. package/src/components/CarouselTariffsCard/CarouselTariffsCard.example.json +11 -3
  172. package/src/components/CarouselTariffsCard/CarouselTariffsCard.fixture.tsx +3 -3
  173. package/src/components/CarouselTariffsCard/CarouselTariffsCard.tsx +29 -17
  174. package/src/components/CarouselTariffsCard/CarouselTariffsCardContent.ts +1 -1
  175. package/src/components/LinkDocs/LinkDocsContent.ts +4 -0
  176. package/src/components/SwipeListControlBlock/SwipeListControlBlock.example.json +18 -0
  177. package/src/components/SwipeListControlBlock/SwipeListControlBlock.fixture.tsx +27 -0
  178. package/src/components/SwipeListControlBlock/SwipeListControlBlock.tsx +23 -0
  179. package/src/components/SwipeListControlBlock/SwipeListControlBlock.ui.json +1 -0
  180. package/src/components/SwipeListControlBlock/SwipeListControlBlockContent.ts +6 -0
  181. package/src/icons/IconName.ts +333 -6
  182. package/src/ui-kit/BlockWrapper.tsx +1 -1
  183. package/src/ui-kit/SwipeListControl/SwipeListContainer.tsx +19 -10
  184. package/src/ui-kit/SwipeListControl/SwipeListControl.fixture.mobile.tsx +6 -1
  185. package/src/ui-kit/SwipeListControl/SwipeListControl.tsx +6 -2
  186. package/src/ui-kit/SwipeListControl/SwipeListControlDots.tsx +20 -4
  187. package/src/ui-kit/SwipeListControl/SwipeListControlProps.ts +8 -0
  188. package/src/utils/style.ts +2 -0
@@ -50,6 +50,7 @@ import { RichTextBlock } from './RichTextBlock/RichTextBlock';
50
50
  import { RollupItem } from './RollupItem/RollupItem';
51
51
  import { SafeDepositRental } from './SafeDepositRental/SafeDepositRental';
52
52
  import { StepsBlock } from './StepsBlock/StepsBlock';
53
+ import { SwipeListControlBlock } from './SwipeListControlBlock/SwipeListControlBlock';
53
54
  import { Tabs } from './Tabs/Tabs';
54
55
  import { TariffsTable } from './TariffsTable/TariffsTable';
55
56
  import { TextBlock } from './TextBlock/TextBlock';
@@ -109,6 +110,7 @@ export const Blocks: BlocksRegistry = {
109
110
  RollupItem,
110
111
  SafeDepositRental,
111
112
  StepsBlock,
113
+ SwipeListControlBlock,
112
114
  Tabs,
113
115
  TariffsTable,
114
116
  TextBlock,
@@ -0,0 +1,8 @@
1
+ {
2
+ "content": {},
3
+ "style": {
4
+ "ui:options": {
5
+ "minCols": 12
6
+ }
7
+ }
8
+ }
@@ -10,20 +10,26 @@ export interface CarouselCardProps extends CarouselCardContent, UniBlockProps {}
10
10
  const BLOCK_CLASSES = 'absolute border border-solid border-gray w-full h-full';
11
11
 
12
12
  const CARD_WIDTH_MAP: Record<CarouselCardVersion, string> = {
13
- normal: 'min-w-[1007px]',
13
+ normal: 'min-w-[970px]',
14
14
  mini: 'min-w-[355px]',
15
15
  };
16
16
 
17
17
  export const CarouselCard = JSX<CarouselCardProps>(
18
18
  ({ className = '', button, description, title, version = 'normal' }) => (
19
- <section className={`flex pb-9 pl-12 ${CARD_WIDTH_MAP[version]} ${className}`}>
19
+ <section className={`flex pb-9 pl-12 border-box ${CARD_WIDTH_MAP[version]} ${className}`}>
20
20
  <div className="relative w-full">
21
21
  <div className={`${BLOCK_CLASSES} z-10 top-9 right-12 bg-green-dark`} />
22
22
  <div className={`${BLOCK_CLASSES} z-10 top-6 right-8 bg-green`} />
23
23
  <div className={`${BLOCK_CLASSES} z-10 top-3 right-4 bg-green-light`} />
24
- <div className="relative bg-white z-10 py-6 px-10 border border-solid border-green-light">
25
- <Headline className="!p-0" title={title} description={description} headlineVersion="M" />
26
- {button ? <div className="mt-6">{renderButton({ button })}</div> : null}
24
+ <div className="relative bg-white z-10 p-10 border border-solid border-green-light">
25
+ <Headline
26
+ className="!p-0"
27
+ title={title}
28
+ description={description}
29
+ headlineVersion="L"
30
+ align="text-left"
31
+ />
32
+ {button ? <div className="mt-14">{renderButton({ button })}</div> : null}
27
33
  </div>
28
34
  </div>
29
35
  </section>
@@ -16,7 +16,7 @@ export const CarouselProgramsCard = JSX<CarouselTariffsCardProps>(
16
16
  className={`font-sans border border-gray flex min-w-[536px] ${VersionStyleMap[version]} ${className}`}
17
17
  {...rest}
18
18
  >
19
- <div className="w-[200px] min-w-[200px] self-end">
19
+ <div className="w-[200px] min-w-[200px] self-center">
20
20
  {icon?.icon ? <Img image={getIconWithVersion(icon)} asSVG /> : null}
21
21
  {icon?.src ? <Img image={icon} /> : null}
22
22
  </div>
@@ -1,13 +1,21 @@
1
1
  {
2
- "title": "Заголовок",
2
+ "title": "Заголовок карточки",
3
3
  "button": {
4
4
  "href": "",
5
5
  "text": "Кнопка",
6
6
  "target": "_self",
7
- "version": "primary"
7
+ "version": "secondary"
8
+ },
9
+ "icon": {
10
+ "icon": "",
11
+ "format": "webp",
12
+ "size": {
13
+ "width": 267,
14
+ "height": 73
15
+ }
8
16
  },
9
17
  "isHighlighting": false,
10
- "rows": [
18
+ "cardCells": [
11
19
  {
12
20
  "title": "Ячейка 1-1",
13
21
  "description": "Описание 1-1"
@@ -27,7 +27,7 @@ const buttonSecondary: ButtonProps = {
27
27
  version: 'secondary',
28
28
  };
29
29
 
30
- const rows = [
30
+ const cardCells = [
31
31
  { title: 'Открытие расчетного счета', description: 'Бесплатно' },
32
32
  { title: 'Внутрибанковские платежи', description: '0 ₽' },
33
33
  { title: 'Внешние платежи, до 10 шт.', description: '0 ₽' },
@@ -43,14 +43,14 @@ export const TARIFFS_CARD: CarouselTariffsCardContent = {
43
43
  title: 'Расчётный эконом',
44
44
  icon: imageMonth,
45
45
  button: buttonSecondary,
46
- rows,
46
+ cardCells,
47
47
  };
48
48
 
49
49
  export const TARIFFS_CARD_HIT: CarouselTariffsCardContent = {
50
50
  icon: imageMonth,
51
51
  title: 'Расчётный эконом',
52
52
  button,
53
- rows,
53
+ cardCells,
54
54
  isHighlighting: true,
55
55
  };
56
56
 
@@ -1,49 +1,52 @@
1
1
  import { JSX } from '@redneckz/uni-jsx';
2
- import type { HeadlineCommonProps } from '../../model/HeadlineType';
3
- import type { UniBlockProps } from '../../model/JSXBlock';
4
- import { VNode } from '../../model/VNode';
5
2
  import { BlockWrapper } from '../../ui-kit/BlockWrapper';
6
3
  import { Button } from '../../ui-kit/Button/Button';
7
4
  import { Foldable } from '../../ui-kit/Foldable/Foldable';
8
5
  import { FoldablePartProps } from '../../ui-kit/Foldable/FoldablePartProps';
9
6
  import { FoldableSection } from '../../ui-kit/Foldable/FoldableSection';
7
+ import { getIconWithVersion } from '../../utils/getIconWithVersion';
10
8
  import { Heading } from '../../ui-kit/Heading/Heading';
11
9
  import { Icon } from '../../ui-kit/Icon/Icon';
12
10
  import { Img } from '../../ui-kit/Img/Img';
11
+ import { Paragraph } from '../../ui-kit/Paragraph/Paragraph';
13
12
  import type { CarouselTariffsCardContent } from './CarouselTariffsCardContent';
13
+ import type { HeadlineCommonProps } from '../../model/HeadlineType';
14
+ import type { Picture } from '../../model/Picture';
15
+ import type { UniBlockProps } from '../../model/JSXBlock';
16
+ import type { VNode } from '../../model/VNode';
14
17
 
15
18
  export interface CarouselTariffsCardProps extends CarouselTariffsCardContent, UniBlockProps {}
16
19
 
17
- const VISIBLE_ROWS_COUNT = 1;
20
+ const VISIBLE_CELLS_COUNT = 1;
18
21
 
19
22
  export const CarouselTariffsCard = JSX<CarouselTariffsCardProps>(
20
- ({ className = '', title, icon, isHighlighting, button, rows = [], ...rest }) => {
21
- const rowsNode = rows.map(renderCardInfo);
22
- const visibleRows = rowsNode.slice(0, VISIBLE_ROWS_COUNT);
23
- const hiddenRows = rowsNode.slice(VISIBLE_ROWS_COUNT);
23
+ ({ className = '', title, icon, isHighlighting, button, cardCells = [], ...rest }) => {
24
+ const cellsNode = cardCells.map(renderCardInfo);
25
+ const visibleCells = cellsNode.slice(0, VISIBLE_CELLS_COUNT);
26
+ const hiddenCells = cellsNode.slice(VISIBLE_CELLS_COUNT);
24
27
 
25
28
  return (
26
29
  <BlockWrapper
27
- className={`font-sans relative bg-white border border-gray min-w-[322px] p-8
30
+ className={`font-sans relative bg-white border border-gray min-w-[322px] p-8 flex flex-col
28
31
  ${getHitStyle(isHighlighting)}
29
32
  ${className}`}
30
33
  {...rest}
31
34
  >
32
35
  {isHighlighting ? renderHitIcon() : null}
33
- {icon?.src ? <Img image={icon} /> : null}
36
+ {renderIconBlock(icon)}
34
37
  {title ? (
35
38
  <Heading className="text-primary-text text-center pt-2" headingType="h5" title={title} />
36
39
  ) : null}
37
40
  {button ? <Button className="w-full mt-4" {...button} /> : null}
38
- {rows.length ? (
41
+ {cardCells.length ? (
39
42
  <Foldable
40
43
  renderFoldableSection={({ isUnfolded }) => (
41
44
  <div>
42
- {visibleRows}
43
- <FoldableSection isUnfolded={isUnfolded}>{hiddenRows}</FoldableSection>
45
+ {visibleCells}
46
+ <FoldableSection isUnfolded={isUnfolded}>{hiddenCells}</FoldableSection>
44
47
  </div>
45
48
  )}
46
- renderFoldButton={rows.length > 1 ? renderFoldButton : null}
49
+ renderFoldButton={cardCells.length > 1 ? renderFoldButton : null}
47
50
  />
48
51
  ) : null}
49
52
  </BlockWrapper>
@@ -51,8 +54,15 @@ export const CarouselTariffsCard = JSX<CarouselTariffsCardProps>(
51
54
  },
52
55
  );
53
56
 
57
+ const renderIconBlock = (icon?: Picture) => (
58
+ <div className="w-[267px] min-w-[267px] self-center">
59
+ {icon?.src ? <Img image={icon} /> : null}
60
+ {icon?.icon ? <Img image={getIconWithVersion(icon)} asSVG /> : null}
61
+ </div>
62
+ );
63
+
54
64
  const getHitStyle = (isHighlighting?: boolean): string =>
55
- isHighlighting ? 'mt-9 pt-[70px]' : 'mt-[70px] pt-9';
65
+ isHighlighting ? 'mt-9 pt-[70px]' : 'mt-[70px] pt-7';
56
66
 
57
67
  const renderFoldButton = ({ isUnfolded, onToggle }: FoldablePartProps): VNode => (
58
68
  <button
@@ -82,8 +92,10 @@ const renderCardInfo = (cell: HeadlineCommonProps, i: number): VNode => (
82
92
  );
83
93
 
84
94
  const renderHitIcon = (): VNode => (
85
- <div className="absolute -top-7 -right-4 h-[60px] w-[60px] bg-white flex flex-col items-center justify-center shadow-[0_4px_25px_rgba(0,0,0,0.07)]">
95
+ <div className="absolute -top-7 -right-4 h-[60px] w-[60px] bg-white flex flex-col items-center justify-center rounded-md shadow-[0_4px_25px_rgba(0,0,0,0.07)]">
86
96
  <Icon iconVersion="black" name="HeartIcon" width="23" height="22" asSVG />
87
- <div className="text-center">Хит</div>
97
+ <Paragraph size="text-s" font="font-normal" align="text-center" color="text-primary-text">
98
+ ХИТ
99
+ </Paragraph>
88
100
  </div>
89
101
  );
@@ -12,5 +12,5 @@ export type CarouselTariffsCardContent = TitleProps & {
12
12
  /** @title Кнопка */
13
13
  button?: ButtonProps;
14
14
  /** @title Ячейка */
15
- rows?: HeadlineCommonProps[];
15
+ cardCells?: HeadlineCommonProps[];
16
16
  };
@@ -43,5 +43,9 @@ export type LinkDocsContent = HeadlineCommonProps & {
43
43
  orientation?: ListOrientation; // TODO: мобильный проп
44
44
  /** @title Рамка элементов (моб.) */ // TODO: мобильный проп
45
45
  hasBorder?: boolean;
46
+ /**
47
+ * @title Выравнивание
48
+ * @default text-center
49
+ */
46
50
  align?: TextAlign;
47
51
  };
@@ -0,0 +1,18 @@
1
+ {
2
+ "content": {
3
+ "listType": "vertical-list"
4
+ },
5
+ "style": ["col-span-12", "h-96"],
6
+ "type": "SwipeListControlBlock",
7
+ "blocks": [
8
+ {
9
+ "type": "Headline",
10
+ "content": {
11
+ "title": "Заголовок блока",
12
+ "description": "Описание блока",
13
+ "headlineVersion": "M"
14
+ },
15
+ "style": ["col-span-12"]
16
+ }
17
+ ]
18
+ }
@@ -0,0 +1,27 @@
1
+ import type { BlockRendererOptions } from '../../BlockRenderer/BlockRendererOptions';
2
+ import { Blocks } from '../Blocks';
3
+ import { PRODUCT_TILE } from '../ProductTile/ProductTile.fixture';
4
+ import { SwipeListControlBlock } from './SwipeListControlBlock';
5
+
6
+ const options = {
7
+ blocksRegistry: Blocks,
8
+ } as BlockRendererOptions;
9
+
10
+ export default {
11
+ default: (
12
+ <div className="container grid grid-cols-12">
13
+ <SwipeListControlBlock
14
+ className="col-span-12 h-96"
15
+ block={{
16
+ type: 'SwipeListControlBlock',
17
+ blocks: [
18
+ { type: 'ProductTile', content: PRODUCT_TILE },
19
+ { type: 'ProductTile', content: PRODUCT_TILE },
20
+ ],
21
+ }}
22
+ listType="vertical-list"
23
+ options={options}
24
+ />
25
+ </div>
26
+ ),
27
+ };
@@ -0,0 +1,23 @@
1
+ import { JSX } from '@redneckz/uni-jsx';
2
+ import { renderChildren } from '../../BlockRenderer/renderChildren';
3
+ import type { JSXBlock, UniBlockProps } from '../../model/JSXBlock';
4
+ import { BlockWrapper } from '../../ui-kit/BlockWrapper';
5
+ import { SwipeListControl } from '../../ui-kit/SwipeListControl/SwipeListControl';
6
+ import type { SwipeListControlBlockContent } from './SwipeListControlBlockContent';
7
+
8
+ interface SwipeListControlBlockProps extends SwipeListControlBlockContent, UniBlockProps {}
9
+
10
+ export const SwipeListControlBlock: JSXBlock<SwipeListControlBlockProps> =
11
+ JSX<SwipeListControlBlockProps>(({ gap, listType, padding, showDots, options, ...rest }) => {
12
+ return (
13
+ <BlockWrapper {...rest}>
14
+ <SwipeListControl gap={gap} listType={listType} padding={padding} showDots={showDots}>
15
+ {renderChildren({ ...rest, options })}
16
+ </SwipeListControl>
17
+ </BlockWrapper>
18
+ );
19
+ });
20
+
21
+ SwipeListControlBlock.childrenTypes = {
22
+ exclude: ['SwipeListControlBlock'],
23
+ };
@@ -0,0 +1,6 @@
1
+ import type { SwipeListControlProps } from '../../ui-kit/SwipeListControl/SwipeListControlProps';
2
+
3
+ /**
4
+ * @title Swipe-контроллер
5
+ */
6
+ export type SwipeListControlBlockContent = SwipeListControlProps;