@redneckz/wildless-cms-uni-blocks 0.2.88 → 0.2.92

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 (155) hide show
  1. package/bundle/blocks.schema.json +1 -1
  2. package/bundle/bundle.umd.js +63 -26
  3. package/bundle/bundle.umd.min.js +1 -1
  4. package/dist/components/BaseTile/BaseTile.js +1 -3
  5. package/dist/components/BaseTile/BaseTile.js.map +1 -1
  6. package/dist/components/BlockContent.d.ts +2 -1
  7. package/dist/components/Blocks.d.ts +1 -0
  8. package/dist/components/Blocks.js +2 -0
  9. package/dist/components/Blocks.js.map +1 -1
  10. package/dist/components/ComparisonTable/ComparisonTable.js +3 -6
  11. package/dist/components/ComparisonTable/ComparisonTable.js.map +1 -1
  12. package/dist/components/ComparisonTable/ComparisonTableContent.d.ts +0 -20
  13. package/dist/components/ComparisonTable/TableCarouselContainer.d.ts +3 -0
  14. package/dist/components/ComparisonTable/TableCarouselContainer.js +5 -2
  15. package/dist/components/ComparisonTable/TableCarouselContainer.js.map +1 -1
  16. package/dist/components/ComparisonTable/TableRow.js +1 -1
  17. package/dist/components/ComparisonTable/TableRow.js.map +1 -1
  18. package/dist/components/MobileAppTile/MobileAppTileContent.d.ts +1 -3
  19. package/dist/components/PictureText/PictureText.js +1 -1
  20. package/dist/components/PictureText/PictureText.js.map +1 -1
  21. package/dist/components/PictureText/PictureTextContent.d.ts +1 -1
  22. package/dist/components/TariffsTable/TariffsTable.d.ts +5 -0
  23. package/dist/components/TariffsTable/TariffsTable.js +20 -0
  24. package/dist/components/TariffsTable/TariffsTable.js.map +1 -0
  25. package/dist/components/TariffsTable/TariffsTableCell.d.ts +6 -0
  26. package/dist/components/TariffsTable/TariffsTableCell.js +18 -0
  27. package/dist/components/TariffsTable/TariffsTableCell.js.map +1 -0
  28. package/dist/components/TariffsTable/TariffsTableContent.d.ts +55 -0
  29. package/dist/components/TariffsTable/TariffsTableContent.js +2 -0
  30. package/dist/components/TariffsTable/TariffsTableContent.js.map +1 -0
  31. package/dist/components/TariffsTable/TariffsTableRow.d.ts +8 -0
  32. package/dist/components/TariffsTable/TariffsTableRow.js +13 -0
  33. package/dist/components/TariffsTable/TariffsTableRow.js.map +1 -0
  34. package/dist/components/TariffsTable/constants.d.ts +4 -0
  35. package/dist/components/TariffsTable/constants.js +7 -0
  36. package/dist/components/TariffsTable/constants.js.map +1 -0
  37. package/dist/components/TextBlock/TextBlock.d.ts +1 -1
  38. package/dist/components/TextBlock/TextBlock.js +1 -1
  39. package/dist/components/TextBlock/TextBlock.js.map +1 -1
  40. package/dist/hooks/useComparisonTableScroll.d.ts +7 -0
  41. package/dist/hooks/useComparisonTableScroll.js +12 -0
  42. package/dist/hooks/useComparisonTableScroll.js.map +1 -0
  43. package/dist/model/TableVersion.d.ts +1 -0
  44. package/dist/model/TableVersion.js +2 -0
  45. package/dist/model/TableVersion.js.map +1 -0
  46. package/dist/ui-kit/BlockItem/BlockItem.d.ts +1 -9
  47. package/dist/ui-kit/BlockItem/BlockItem.js +5 -5
  48. package/dist/ui-kit/BlockItem/BlockItem.js.map +1 -1
  49. package/dist/ui-kit/BlockItem/BlockItemProps.d.ts +20 -0
  50. package/dist/ui-kit/BlockItem/BlockItemProps.js +2 -0
  51. package/dist/ui-kit/BlockItem/BlockItemProps.js.map +1 -0
  52. package/dist/ui-kit/Button/ButtonProps.d.ts +2 -1
  53. package/dist/ui-kit/Icon/IconProps.d.ts +58 -26
  54. package/dist/ui-kit/Icon/IconProps.js +39 -23
  55. package/dist/ui-kit/Icon/IconProps.js.map +1 -1
  56. package/lib/common.css +1 -1
  57. package/lib/components/BaseTile/BaseTile.js +1 -3
  58. package/lib/components/BaseTile/BaseTile.js.map +1 -1
  59. package/lib/components/BlockContent.d.ts +2 -1
  60. package/lib/components/Blocks.d.ts +1 -0
  61. package/lib/components/Blocks.js +2 -0
  62. package/lib/components/Blocks.js.map +1 -1
  63. package/lib/components/ComparisonTable/ComparisonTable.js +4 -7
  64. package/lib/components/ComparisonTable/ComparisonTable.js.map +1 -1
  65. package/lib/components/ComparisonTable/ComparisonTableContent.d.ts +0 -20
  66. package/lib/components/ComparisonTable/TableCarouselContainer.d.ts +3 -0
  67. package/lib/components/ComparisonTable/TableCarouselContainer.js +5 -2
  68. package/lib/components/ComparisonTable/TableCarouselContainer.js.map +1 -1
  69. package/lib/components/ComparisonTable/TableRow.js +2 -2
  70. package/lib/components/ComparisonTable/TableRow.js.map +1 -1
  71. package/lib/components/MobileAppTile/MobileAppTileContent.d.ts +1 -3
  72. package/lib/components/PictureText/PictureText.js +1 -1
  73. package/lib/components/PictureText/PictureText.js.map +1 -1
  74. package/lib/components/PictureText/PictureTextContent.d.ts +1 -1
  75. package/lib/components/TariffsTable/TariffsTable.d.ts +5 -0
  76. package/lib/components/TariffsTable/TariffsTable.fixture.d.ts +7 -0
  77. package/lib/components/TariffsTable/TariffsTable.js +18 -0
  78. package/lib/components/TariffsTable/TariffsTable.js.map +1 -0
  79. package/lib/components/TariffsTable/TariffsTableCell.d.ts +6 -0
  80. package/lib/components/TariffsTable/TariffsTableCell.js +16 -0
  81. package/lib/components/TariffsTable/TariffsTableCell.js.map +1 -0
  82. package/lib/components/TariffsTable/TariffsTableContent.d.ts +55 -0
  83. package/lib/components/TariffsTable/TariffsTableContent.js +2 -0
  84. package/lib/components/TariffsTable/TariffsTableContent.js.map +1 -0
  85. package/lib/components/TariffsTable/TariffsTableRow.d.ts +8 -0
  86. package/lib/components/TariffsTable/TariffsTableRow.js +11 -0
  87. package/lib/components/TariffsTable/TariffsTableRow.js.map +1 -0
  88. package/lib/components/TariffsTable/constants.d.ts +4 -0
  89. package/lib/components/TariffsTable/constants.js +5 -0
  90. package/lib/components/TariffsTable/constants.js.map +1 -0
  91. package/lib/components/TextBlock/TextBlock.d.ts +1 -1
  92. package/lib/components/TextBlock/TextBlock.js +1 -1
  93. package/lib/components/TextBlock/TextBlock.js.map +1 -1
  94. package/lib/hooks/useComparisonTableScroll.d.ts +7 -0
  95. package/lib/hooks/useComparisonTableScroll.js +9 -0
  96. package/lib/hooks/useComparisonTableScroll.js.map +1 -0
  97. package/lib/model/TableVersion.d.ts +1 -0
  98. package/lib/model/TableVersion.js +2 -0
  99. package/lib/model/TableVersion.js.map +1 -0
  100. package/lib/ui-kit/BlockItem/BlockItem.d.ts +1 -9
  101. package/lib/ui-kit/BlockItem/BlockItem.fixture.d.ts +6 -1
  102. package/lib/ui-kit/BlockItem/BlockItem.js +5 -5
  103. package/lib/ui-kit/BlockItem/BlockItem.js.map +1 -1
  104. package/lib/ui-kit/BlockItem/BlockItemProps.d.ts +20 -0
  105. package/lib/ui-kit/BlockItem/BlockItemProps.js +2 -0
  106. package/lib/ui-kit/BlockItem/BlockItemProps.js.map +1 -0
  107. package/lib/ui-kit/Button/ButtonProps.d.ts +2 -1
  108. package/lib/ui-kit/Icon/IconProps.d.ts +58 -26
  109. package/lib/ui-kit/Icon/IconProps.js +39 -23
  110. package/lib/ui-kit/Icon/IconProps.js.map +1 -1
  111. package/package.json +1 -1
  112. package/src/Icons/CalendarCircleIcon.svg +14 -0
  113. package/src/Icons/CardIcon.svg +11 -0
  114. package/src/Icons/CardPosIcon.svg +12 -0
  115. package/src/Icons/CardTickIcon.svg +13 -0
  116. package/src/Icons/EmptyWalletChangeIcon.svg +21 -0
  117. package/src/Icons/JCBIcon.svg +42 -0
  118. package/src/Icons/MastercardIcon.svg +6 -0
  119. package/src/Icons/MinusIcon.svg +1 -0
  120. package/src/Icons/MirIcon.svg +13 -0
  121. package/src/Icons/MoneyIcon.svg +13 -0
  122. package/src/Icons/MonitorMobileIcon.svg +14 -0
  123. package/src/Icons/PlusIcon.svg +1 -0
  124. package/src/Icons/Profile2UserIcon.svg +14 -0
  125. package/src/Icons/ShieldTickIcon.svg +7 -0
  126. package/src/Icons/UnionPayIcon.svg +7 -0
  127. package/src/Icons/UserIcon.svg +11 -0
  128. package/src/Icons/VisaIcon.svg +7 -0
  129. package/src/Icons/WalletIcon.svg +19 -0
  130. package/src/components/BaseTile/BaseTile.tsx +5 -10
  131. package/src/components/BlockContent.ts +2 -0
  132. package/src/components/Blocks.ts +2 -0
  133. package/src/components/ComparisonTable/ComparisonTable.tsx +14 -11
  134. package/src/components/ComparisonTable/ComparisonTableContent.ts +0 -21
  135. package/src/components/ComparisonTable/TableCarouselContainer.tsx +11 -4
  136. package/src/components/ComparisonTable/TableRow.tsx +2 -2
  137. package/src/components/ContentPage/ContentPage.page.json +415 -0
  138. package/src/components/MobileAppTile/MobileAppTileContent.ts +1 -3
  139. package/src/components/PictureText/PictureText.tsx +3 -1
  140. package/src/components/PictureText/PictureTextContent.ts +1 -2
  141. package/src/components/TariffsTable/TariffsTable.example.json +85 -0
  142. package/src/components/TariffsTable/TariffsTable.fixture.tsx +192 -0
  143. package/src/components/TariffsTable/TariffsTable.tsx +72 -0
  144. package/src/components/TariffsTable/TariffsTableCell.tsx +64 -0
  145. package/src/components/TariffsTable/TariffsTableContent.ts +61 -0
  146. package/src/components/TariffsTable/TariffsTableRow.tsx +46 -0
  147. package/src/components/TariffsTable/constants.ts +4 -0
  148. package/src/components/TextBlock/TextBlock.tsx +2 -2
  149. package/src/hooks/useComparisonTableScroll.ts +16 -0
  150. package/src/model/TableVersion.ts +1 -0
  151. package/src/ui-kit/BlockItem/BlockItem.fixture.tsx +8 -1
  152. package/src/ui-kit/BlockItem/BlockItem.tsx +7 -18
  153. package/src/ui-kit/BlockItem/BlockItemProps.ts +22 -0
  154. package/src/ui-kit/Button/ButtonProps.ts +2 -1
  155. package/src/ui-kit/Icon/IconProps.ts +35 -3
@@ -0,0 +1,7 @@
1
+ <svg id="icon" width="56" height="56" viewBox="0 0 56 56" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <rect width="56" height="56" fill="white"/>
3
+ <path d="M20.3691 35.4068L22.9991 19.7295H27.2057L24.5738 35.4068H20.3691Z" fill="#0E4595"/>
4
+ <path d="M39.7709 20.0671C38.9376 19.7495 37.6317 19.4087 36.0008 19.4087C31.8442 19.4087 28.9163 21.535 28.8913 24.5824C28.8679 26.835 30.9816 28.0917 32.5773 28.8416C34.2147 29.6101 34.7651 30.1002 34.7572 30.7862C34.7467 31.8372 33.4497 32.3171 32.2405 32.3171C30.5569 32.3171 29.6624 32.0795 28.2809 31.4943L27.7388 31.2451L27.1484 34.7546C28.131 35.1923 29.9478 35.5713 31.8343 35.591C36.2562 35.591 39.1268 33.489 39.1594 30.2348C39.1751 28.4513 38.0545 27.0942 35.6275 25.9753C34.1572 25.2501 33.2567 24.7662 33.2663 24.0318C33.2663 23.3802 34.0285 22.6834 35.6754 22.6834C37.0509 22.6617 38.0475 22.9664 38.8238 23.284L39.2008 23.4649L39.7709 20.0671Z" fill="#0E4595"/>
5
+ <path d="M50.595 19.729H47.3446C46.3376 19.729 45.584 20.0082 45.1418 21.0291L38.8945 35.3961H43.3118C43.3118 35.3961 44.0339 33.4644 44.1973 33.0402C44.68 33.0402 48.9712 33.0469 49.5846 33.0469C49.7105 33.5958 50.0964 35.3961 50.0964 35.3961H53.9998L50.595 19.729ZM45.4378 29.8521C45.7858 28.9489 47.1138 25.4697 47.1138 25.4697C47.0891 25.5114 47.4592 24.562 47.6715 23.9734L47.9559 25.325C47.9559 25.325 48.7614 29.0672 48.9297 29.8519H45.4378V29.8521Z" fill="#0E4595"/>
6
+ <path d="M2.05374 19.7295L2 20.0556C3.66289 20.4645 5.14809 21.0563 6.44839 21.7926L10.1809 35.3816L14.6316 35.3766L21.2542 19.7295H16.798L12.6797 30.4202L12.241 28.2475C12.2205 28.1804 12.1981 28.1132 12.1753 28.0458L10.7436 21.053C10.489 20.0603 9.75052 19.7641 8.83688 19.7295H2.05374Z" fill="#0E4595"/>
7
+ </svg>
@@ -0,0 +1,19 @@
1
+ <svg id="icon" width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <path
3
+ d="M10.7496 16.8599V18.8899C10.7496 20.6099 9.14963 21.9999 7.17963 21.9999C5.20963 21.9999 3.59961 20.6099 3.59961 18.8899V16.8599C3.59961 18.5799 5.19963 19.7999 7.17963 19.7999C9.14963 19.7999 10.7496 18.5699 10.7496 16.8599Z"
4
+ stroke="#42AB44" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
5
+ <path
6
+ d="M10.7498 14.1097C10.7498 14.6097 10.6098 15.0697 10.3698 15.4697C9.77981 16.4397 8.5698 17.0497 7.1698 17.0497C5.7698 17.0497 4.55979 16.4297 3.96979 15.4697C3.72979 15.0697 3.58984 14.6097 3.58984 14.1097C3.58984 13.2497 3.98982 12.4797 4.62982 11.9197C5.27982 11.3497 6.16979 11.0098 7.15979 11.0098C8.14979 11.0098 9.03982 11.3597 9.68982 11.9197C10.3498 12.4697 10.7498 13.2497 10.7498 14.1097Z"
7
+ stroke="#42AB44" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
8
+ <path
9
+ d="M10.7496 14.11V16.86C10.7496 18.58 9.14963 19.8 7.17963 19.8C5.20963 19.8 3.59961 18.57 3.59961 16.86V14.11C3.59961 12.39 5.19963 11 7.17963 11C8.16963 11 9.05966 11.35 9.70966 11.91C10.3497 12.47 10.7496 13.25 10.7496 14.11Z"
10
+ stroke="#42AB44" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
11
+ <path
12
+ d="M22.0002 10.9702V13.0302C22.0002 13.5802 21.5602 14.0302 21.0002 14.0502H19.0402C17.9602 14.0502 16.9702 13.2602 16.8802 12.1802C16.8202 11.5502 17.0602 10.9602 17.4802 10.5502C17.8502 10.1702 18.3602 9.9502 18.9202 9.9502H21.0002C21.5602 9.9702 22.0002 10.4202 22.0002 10.9702Z"
13
+ stroke="#1C1C1C" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
14
+ <path
15
+ d="M16 3.5C16.26 3.5 16.51 3.50999 16.75 3.54999C19.33 3.84999 21 5.76 21 8.5V9.95001H18.92C18.36 9.95001 17.85 10.17 17.48 10.55C17.06 10.96 16.82 11.55 16.88 12.18C16.97 13.26 17.96 14.05 19.04 14.05H21V15.5C21 18.5 19 20.5 16 20.5H13.5"
16
+ stroke="#1C1C1C" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
17
+ <path d="M2 10.5V8.5C2 5.78 3.64 3.88 6.19 3.56C6.45 3.52 6.72 3.5 7 3.5H12" stroke="#1C1C1C" stroke-width="2"
18
+ stroke-linecap="round" stroke-linejoin="round"/>
19
+ </svg>
@@ -98,14 +98,9 @@ function renderItems(items: string[] = [], version?: BlockVersion) {
98
98
  function renderButton({ icon, ...button }: BaseTileIconButton, i: number) {
99
99
  if (!button?.text) return;
100
100
 
101
- if (icon)
102
- return (
103
- <Button
104
- key={String(i)}
105
- appendLeft={<Icon name={icon} width="24" height="24" />}
106
- {...button}
107
- />
108
- );
109
-
110
- return <Button key={String(i)} {...button} />;
101
+ return icon ? (
102
+ <Button key={String(i)} appendLeft={<Icon name={icon} width="24" height="24" />} {...button} />
103
+ ) : (
104
+ <Button key={String(i)} {...button} />
105
+ );
111
106
  }
@@ -15,6 +15,7 @@ import type { PromoTileContent } from './PromoTile/PromoTileContent';
15
15
  import type { StepsBlockContent } from './StepsBlock/StepsBlockContent';
16
16
  import type { TextBlockContent } from './TextBlock/TextBlockContent';
17
17
  import type { TileContent } from './Tile/TileContent';
18
+ import { TariffsTableContent } from './TariffsTable/TariffsTableContent';
18
19
 
19
20
  /**
20
21
  * @hidden
@@ -35,5 +36,6 @@ export type BlockContent =
35
36
  | ProductTileContent
36
37
  | PromoTileContent
37
38
  | StepsBlockContent
39
+ | TariffsTableContent
38
40
  | TextBlockContent
39
41
  | TileContent;
@@ -19,6 +19,7 @@ import { PromoTile } from './PromoTile/PromoTile';
19
19
  import { StepsBlock } from './StepsBlock/StepsBlock';
20
20
  import { TextBlock } from './TextBlock/TextBlock';
21
21
  import { Tile } from './Tile/Tile';
22
+ import { TariffsTable } from './TariffsTable/TariffsTable';
22
23
 
23
24
  export const Blocks = {
24
25
  Accordion,
@@ -40,6 +41,7 @@ export const Blocks = {
40
41
  ProductTile,
41
42
  PromoTile,
42
43
  StepsBlock,
44
+ TariffsTable,
43
45
  TextBlock,
44
46
  Tile,
45
47
  };
@@ -5,10 +5,11 @@ import { Title } from '../../ui-kit/Title/Title';
5
5
  import { TableRowContainer } from './TableRowContainer';
6
6
  import { TableCarouselContainer } from './TableCarouselContainer';
7
7
  import { useLink } from '../../hooks/useLink';
8
- import type { ComparisonTableContent, RowData } from './ComparisonTableContent';
8
+ import type { ComparisonTableContent } from './ComparisonTableContent';
9
9
  import { HeaderCell } from './HeaderCell';
10
10
  import { TableRow } from './TableRow';
11
- import { COLS_LENGTH_FOR_SCROLL, FIRST_CELL_CLASSES } from './constants';
11
+ import { COLS_LENGTH_FOR_SCROLL, COLUMN_WIDTH, FIRST_CELL_CLASSES } from './constants';
12
+ import { useComparisonTableScroll } from '../../hooks/useComparisonTableScroll';
12
13
 
13
14
  export interface ComparisonTableProps extends ComparisonTableContent, UniBlockProps {}
14
15
 
@@ -24,26 +25,28 @@ export const ComparisonTable = JSX<ComparisonTableProps>(
24
25
  }) => {
25
26
  const router = context.useRouter();
26
27
  const { handlerDecorator } = context;
28
+
27
29
  const [activeCardIndex, setActiveCardIndex] = context.useState(0);
28
30
  const [isShowAllRow, setIsShowAllRow] = context.useState(!visibleRowLength);
29
31
 
30
32
  const colHeaders = columns?.map(({ header }) => header || {});
31
33
  const colData = columns?.map(({ data }) => data) || [];
32
- const rowData: RowData = rowHeaders
34
+ const rowData = rowHeaders
33
35
  ?.map((header, i) => ({
34
36
  header,
35
37
  data: colData.map((col) => col?.[i] || [{}]),
36
38
  }))
37
39
  .slice(0, isShowAllRow ? rowHeaders.length : visibleRowLength);
38
40
 
39
- const nextClick = () => setActiveCardIndex(activeCardIndex + 1);
40
- const prevClick = () => setActiveCardIndex(activeCardIndex - 1);
41
- const showToggle = () => setIsShowAllRow(!isShowAllRow);
41
+ const { nextClick, prevClick, isScrollAvailable, showNextButton, showPrevButton } =
42
+ useComparisonTableScroll(
43
+ colData,
44
+ COLS_LENGTH_FOR_SCROLL,
45
+ activeCardIndex,
46
+ setActiveCardIndex,
47
+ );
42
48
 
43
- const isScrollAvailable = colData?.length && colData.length > COLS_LENGTH_FOR_SCROLL;
44
- const showNextButton =
45
- isScrollAvailable && colData?.length - activeCardIndex > COLS_LENGTH_FOR_SCROLL;
46
- const showPrevButton = isScrollAvailable && activeCardIndex > 0;
49
+ const showToggle = () => setIsShowAllRow(!isShowAllRow);
47
50
 
48
51
  return (
49
52
  <section
@@ -56,7 +59,7 @@ export const ComparisonTable = JSX<ComparisonTableProps>(
56
59
  {colHeaders?.length ? (
57
60
  <TableRowContainer>
58
61
  <div className={FIRST_CELL_CLASSES} role="columnheader" scope="col" />
59
- <TableCarouselContainer activeCardIndex={activeCardIndex}>
62
+ <TableCarouselContainer activeCardIndex={activeCardIndex} columnWidth={COLUMN_WIDTH}>
60
63
  {colHeaders.map((header, i) => (
61
64
  <HeaderCell
62
65
  key={String(i)}
@@ -1,6 +1,5 @@
1
1
  import type { LinkProps } from '../../model/LinkProps';
2
2
  import type { Picture } from '../../model/Picture';
3
- import type { ButtonProps } from '../../ui-kit/Button/ButtonProps';
4
3
  import type { IconName } from '../../ui-kit/Icon/IconProps';
5
4
 
6
5
  /**
@@ -11,11 +10,6 @@ export type Row = {
11
10
  data: CellData[][];
12
11
  };
13
12
 
14
- /**
15
- * @hidden
16
- */
17
- export type RowData = Row[] | undefined;
18
-
19
13
  /**
20
14
  * @title Ячейка
21
15
  */
@@ -24,18 +18,6 @@ export interface CellData {
24
18
  label?: string;
25
19
  /** @title Описание */
26
20
  description?: string;
27
- /**
28
- * @title Иконки
29
- * @hidden
30
- */
31
- icons?: IconName[];
32
- /** @hidden */
33
- image?: Picture;
34
- /**
35
- * @title Кнопки
36
- * @hidden
37
- */
38
- buttons?: ButtonProps[];
39
21
  }
40
22
 
41
23
  /**
@@ -44,11 +26,9 @@ export interface CellData {
44
26
  export interface ColumnHeader {
45
27
  /** @title Заголовок */
46
28
  title?: string;
47
- /** @hidden */
48
29
  icon?: IconName;
49
30
  /** @hidden */
50
31
  image?: Picture;
51
- /** @hidden */
52
32
  link?: LinkProps;
53
33
  }
54
34
 
@@ -67,7 +47,6 @@ export interface Column {
67
47
  export interface RowHeader {
68
48
  /** @title Заголовок */
69
49
  title?: string;
70
- icon?: IconName;
71
50
  }
72
51
  /**
73
52
  * @title Сравнительная таблица
@@ -1,16 +1,23 @@
1
1
  import { JSX } from '@redneckz/uni-jsx';
2
- import { COLUMN_WIDTH } from './constants';
2
+ import { TableVersion } from '../../model/TableVersion';
3
3
 
4
4
  export interface TableCarouselContainerProps {
5
5
  activeCardIndex: number;
6
+ columnWidth: number;
7
+ version?: TableVersion;
6
8
  }
7
9
 
10
+ const carouselContainerClassesMap: Record<TableVersion, string> = {
11
+ comparison: 'flex gap-4 duration-1000',
12
+ tariff: 'flex flex-grow duration-1000',
13
+ };
14
+
8
15
  export const TableCarouselContainer = JSX<TableCarouselContainerProps>(
9
- ({ children, activeCardIndex }) => (
16
+ ({ children, activeCardIndex, columnWidth, version = 'comparison' }) => (
10
17
  <div className="flex flex-1 overflow-hidden">
11
18
  <div
12
- className="flex gap-4 duration-1000"
13
- style={{ transform: `translateX(-${activeCardIndex * COLUMN_WIDTH}px)` }}
19
+ className={carouselContainerClassesMap[version]}
20
+ style={{ transform: `translateX(-${activeCardIndex * columnWidth}px)` }}
14
21
  >
15
22
  {children}
16
23
  </div>
@@ -1,6 +1,6 @@
1
1
  import { JSX } from '@redneckz/uni-jsx';
2
2
  import type { Row } from './ComparisonTableContent';
3
- import { DIVIDER_CLASSES, FIRST_CELL_CLASSES } from './constants';
3
+ import { COLUMN_WIDTH, DIVIDER_CLASSES, FIRST_CELL_CLASSES } from './constants';
4
4
  import { TableCarouselContainer } from './TableCarouselContainer';
5
5
  import { TableCell } from './TableCell';
6
6
  import { TableRowContainer } from './TableRowContainer';
@@ -27,7 +27,7 @@ export const TableRow = JSX<TableRowProps>(
27
27
  </div>
28
28
  ) : null}
29
29
  {data?.length ? (
30
- <TableCarouselContainer activeCardIndex={activeCardIndex}>
30
+ <TableCarouselContainer activeCardIndex={activeCardIndex} columnWidth={COLUMN_WIDTH}>
31
31
  {data.map((cell, i) => (
32
32
  <TableCell
33
33
  key={String(i)}
@@ -1425,6 +1425,421 @@
1425
1425
  ]
1426
1426
  }
1427
1427
  },
1428
+ {
1429
+ "type": "TariffsTable",
1430
+ "style": ["col-span-12"],
1431
+ "content": {
1432
+ "title": "Другие дебетовые карты Россельхозбанка",
1433
+ "rowHeaders": [
1434
+ {
1435
+ "title": "Начисление процентов на остаток по счету",
1436
+ "icon": "OkIcon"
1437
+ },
1438
+ {
1439
+ "title": "Снятие наличных",
1440
+ "icon": "GlassIcon"
1441
+ },
1442
+ {
1443
+ "title": "Оформление онлайн",
1444
+ "icon": "ShieldTickIcon"
1445
+ },
1446
+ {
1447
+ "title": "Кэшбэк баллами"
1448
+ },
1449
+ {
1450
+ "title": "Стоимость обслуживания"
1451
+ },
1452
+ {
1453
+ "title": "Стоимость SMS-сервиса"
1454
+ },
1455
+ {
1456
+ "title": "Дополнительная информация"
1457
+ }
1458
+ ],
1459
+ "columns": [
1460
+ {
1461
+ "data": [
1462
+ [
1463
+ {
1464
+ "label": "Нет"
1465
+ }
1466
+ ],
1467
+ [
1468
+ {
1469
+ "label": "Бесплатно",
1470
+ "description": "В банкоматах и кассах Россельхозбанка и банков-партнеров"
1471
+ },
1472
+ {
1473
+ "label": "Бесплатно",
1474
+ "description": "В сторонних банкоматах - 1 раз в месяц, далее 1% минимум 150 руб"
1475
+ }
1476
+ ],
1477
+ [
1478
+ {
1479
+ "label": "Нет"
1480
+ }
1481
+ ],
1482
+ [
1483
+ {
1484
+ "label": "Платёжные системы картинкой"
1485
+ },
1486
+ {
1487
+ "image": {
1488
+ "src": "payment-systems.png",
1489
+ "format": "webp",
1490
+ "size": {
1491
+ "width": 288,
1492
+ "height": 56
1493
+ }
1494
+ }
1495
+ }
1496
+ ],
1497
+ [
1498
+ {
1499
+ "label": "Кнопки-иконки"
1500
+ },
1501
+ {
1502
+ "buttons": [
1503
+ {
1504
+ "icon": "AppleIcon",
1505
+ "rounded": true,
1506
+ "version": "secondary",
1507
+ "href": "/_blank",
1508
+ "target": "_blank"
1509
+ },
1510
+ {
1511
+ "icon": "PlayMarketIcon",
1512
+ "rounded": true,
1513
+ "version": "secondary",
1514
+ "href": "/secondary"
1515
+ }
1516
+ ]
1517
+ }
1518
+ ],
1519
+ [
1520
+ {
1521
+ "label": "Бесплатно",
1522
+ "list": {
1523
+ "items": [
1524
+ "item 1",
1525
+ "item 2",
1526
+ "item 3"
1527
+ ]
1528
+ }
1529
+ }
1530
+ ],
1531
+ [
1532
+ {
1533
+ "image": {
1534
+ "src": "money-1.png",
1535
+ "format": "webp",
1536
+ "size": {
1537
+ "width": 140,
1538
+ "height": 140
1539
+ }
1540
+ }
1541
+ }
1542
+ ]
1543
+ ]
1544
+ },
1545
+ {
1546
+ "data": [
1547
+ [
1548
+ {
1549
+ "label": "Нет"
1550
+ }
1551
+ ],
1552
+ [
1553
+ {
1554
+ "label": "Бесплатно",
1555
+ "description": "В банкоматах и кассах Россельхозбанка и банков-партнеров"
1556
+ },
1557
+ {
1558
+ "label": "1%",
1559
+ "description": "В сторонних банкоматах, минимум 150 руб"
1560
+ }
1561
+ ],
1562
+ [
1563
+ {
1564
+ "label": "Нет"
1565
+ }
1566
+ ],
1567
+ [
1568
+ {
1569
+ "label": "До 20%"
1570
+ },
1571
+ {
1572
+ "list": {
1573
+ "isDotted": false,
1574
+ "items": [
1575
+ "item 1",
1576
+ "item 2",
1577
+ "item 3"
1578
+ ]
1579
+ }
1580
+ }
1581
+ ],
1582
+ [
1583
+ {
1584
+ "label": "Бесплатно",
1585
+ "description": "При обороте по карте от 10000 ₽ в месяц"
1586
+ }
1587
+ ],
1588
+ [
1589
+ {
1590
+ "label": "69 рублей в месяц"
1591
+ },
1592
+ {
1593
+ "list": {
1594
+ "version": "primary",
1595
+ "items": [
1596
+ "item 1",
1597
+ "item 2",
1598
+ "item 3"
1599
+ ]
1600
+ }
1601
+ }
1602
+ ],
1603
+ [
1604
+ {
1605
+ "description": "Копите баллы каждый день и обменивайте их на скидки на электронику и бытовую технику Panasonic"
1606
+ }
1607
+ ]
1608
+ ]
1609
+ },
1610
+ {
1611
+ "data": [
1612
+ [
1613
+ {
1614
+ "label": "Нет"
1615
+ }
1616
+ ],
1617
+ [
1618
+ {
1619
+ "label": "Бесплатно"
1620
+ }
1621
+ ],
1622
+ [
1623
+ {
1624
+ "label": "Есть"
1625
+ }
1626
+ ],
1627
+ [
1628
+ {
1629
+ "label": "До 20%"
1630
+ }
1631
+ ],
1632
+ [
1633
+ {
1634
+ "label": "Бесплатно",
1635
+ "description": "При обороте по карте от 10000 ₽ в месяц"
1636
+ }
1637
+ ],
1638
+ [
1639
+ {
1640
+ "label": "69 рублей в месяц"
1641
+ }
1642
+ ],
1643
+ [
1644
+ {
1645
+ "description": "Для членов профсоюзных организаций"
1646
+ }
1647
+ ]
1648
+ ]
1649
+ },
1650
+ {
1651
+ "data": [
1652
+ [
1653
+ {
1654
+ "label": "Нет"
1655
+ }
1656
+ ],
1657
+ [
1658
+ {
1659
+ "label": "Бесплатно",
1660
+ "description": "В банкоматах и кассах Россельхозбанка и банков-партнеров"
1661
+ },
1662
+ {
1663
+ "label": "Бесплатно",
1664
+ "description": "В сторонних банкоматах - 1 раз в месяц, далее 1% минимум 150 руб"
1665
+ }
1666
+ ],
1667
+ [
1668
+ {
1669
+ "label": "Нет"
1670
+ }
1671
+ ],
1672
+ [
1673
+ {
1674
+ "label": "Платёжные системы картинкой"
1675
+ },
1676
+ {
1677
+ "image": {
1678
+ "src": "payment-systems.png",
1679
+ "format": "webp",
1680
+ "size": {
1681
+ "width": 288,
1682
+ "height": 56
1683
+ }
1684
+ }
1685
+ }
1686
+ ],
1687
+ [
1688
+ {
1689
+ "label": "Кнопки-иконки"
1690
+ },
1691
+ {
1692
+ "buttons": [
1693
+ {
1694
+ "icon": "AppleIcon",
1695
+ "rounded": true,
1696
+ "version": "secondary",
1697
+ "href": "/_blank",
1698
+ "target": "_blank"
1699
+ },
1700
+ {
1701
+ "icon": "PlayMarketIcon",
1702
+ "rounded": true,
1703
+ "version": "secondary",
1704
+ "href": "/secondary"
1705
+ }
1706
+ ]
1707
+ }
1708
+ ],
1709
+ [
1710
+ {
1711
+ "label": "Бесплатно",
1712
+ "list": {
1713
+ "items": [
1714
+ "item 1",
1715
+ "item 2",
1716
+ "item 3"
1717
+ ]
1718
+ }
1719
+ }
1720
+ ],
1721
+ [
1722
+ {
1723
+ "image": {
1724
+ "src": "money-1.png",
1725
+ "format": "webp",
1726
+ "size": {
1727
+ "width": 140,
1728
+ "height": 140
1729
+ }
1730
+ }
1731
+ }
1732
+ ]
1733
+ ]
1734
+ },
1735
+ {
1736
+ "data": [
1737
+ [
1738
+ {
1739
+ "label": "Нет"
1740
+ }
1741
+ ],
1742
+ [
1743
+ {
1744
+ "label": "Бесплатно",
1745
+ "description": "В банкоматах и кассах Россельхозбанка и банков-партнеров"
1746
+ },
1747
+ {
1748
+ "label": "1%",
1749
+ "description": "В сторонних банкоматах, минимум 150 руб"
1750
+ }
1751
+ ],
1752
+ [
1753
+ {
1754
+ "label": "Нет"
1755
+ }
1756
+ ],
1757
+ [
1758
+ {
1759
+ "label": "До 20%"
1760
+ },
1761
+ {
1762
+ "list": {
1763
+ "isDotted": false,
1764
+ "items": [
1765
+ "item 1",
1766
+ "item 2",
1767
+ "item 3"
1768
+ ]
1769
+ }
1770
+ }
1771
+ ],
1772
+ [
1773
+ {
1774
+ "label": "Бесплатно",
1775
+ "description": "При обороте по карте от 10000 ₽ в месяц"
1776
+ }
1777
+ ],
1778
+ [
1779
+ {
1780
+ "label": "69 рублей в месяц"
1781
+ },
1782
+ {
1783
+ "list": {
1784
+ "version": "primary",
1785
+ "items": [
1786
+ "item 1",
1787
+ "item 2",
1788
+ "item 3"
1789
+ ]
1790
+ }
1791
+ }
1792
+ ],
1793
+ [
1794
+ {
1795
+ "description": "Копите баллы каждый день и обменивайте их на скидки на электронику и бытовую технику Panasonic"
1796
+ }
1797
+ ]
1798
+ ]
1799
+ },
1800
+ {
1801
+ "data": [
1802
+ [
1803
+ {
1804
+ "label": "Нет"
1805
+ }
1806
+ ],
1807
+ [
1808
+ {
1809
+ "label": "Бесплатно"
1810
+ }
1811
+ ],
1812
+ [
1813
+ {
1814
+ "label": "Есть"
1815
+ }
1816
+ ],
1817
+ [
1818
+ {
1819
+ "label": "До 20%"
1820
+ }
1821
+ ],
1822
+ [
1823
+ {
1824
+ "label": "Бесплатно",
1825
+ "description": "При обороте по карте от 10000 ₽ в месяц"
1826
+ }
1827
+ ],
1828
+ [
1829
+ {
1830
+ "label": "69 рублей в месяц"
1831
+ }
1832
+ ],
1833
+ [
1834
+ {
1835
+ "description": "Для членов профсоюзных организаций"
1836
+ }
1837
+ ]
1838
+ ]
1839
+ }
1840
+ ]
1841
+ }
1842
+ },
1428
1843
  {
1429
1844
  "type": "PictureText",
1430
1845
  "style": ["col-span-12"],
@@ -13,8 +13,6 @@ export interface QRCode {
13
13
  /**
14
14
  * @title Мобильное приложение
15
15
  */
16
- export interface MobileAppTileContent extends BaseTileCommonProps {
17
- /** @title Заголовок */
18
- title?: string;
16
+ export interface MobileAppTileContent extends Pick<BaseTileCommonProps, 'title' | 'buttons'> {
19
17
  qr?: QRCode;
20
18
  }