@redneckz/wildless-cms-uni-blocks 0.2.93 → 0.2.97

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 (216) hide show
  1. package/bundle/blocks.schema.json +1 -1
  2. package/bundle/bundle.umd.js +134 -78
  3. package/bundle/bundle.umd.min.js +1 -1
  4. package/dist/components/Accordion/AccordionBlocks.d.ts +1 -2
  5. package/dist/components/Accordion/AccordionBlocks.js +2 -2
  6. package/dist/components/Accordion/AccordionBlocks.js.map +1 -1
  7. package/dist/components/Accordion/AccordionItem.js +3 -6
  8. package/dist/components/Accordion/AccordionItem.js.map +1 -1
  9. package/dist/components/BaseTile/BaseTile.js +9 -4
  10. package/dist/components/BaseTile/BaseTile.js.map +1 -1
  11. package/dist/components/ComparisonTable/ComparisonTableContent.d.ts +2 -3
  12. package/dist/components/ContentPage/ContentPage.d.ts +9 -1
  13. package/dist/components/ContentPage/ContentPage.js +20 -17
  14. package/dist/components/ContentPage/ContentPage.js.map +1 -1
  15. package/dist/components/ContentPage/toMobilePage.js +13 -2
  16. package/dist/components/ContentPage/toMobilePage.js.map +1 -1
  17. package/dist/components/CreditCalculator/CreditCalculator.js +3 -3
  18. package/dist/components/CreditCalculator/CreditCalculator.js.map +1 -1
  19. package/dist/components/Footer/Footer.js +1 -1
  20. package/dist/components/Footer/Footer.js.map +1 -1
  21. package/dist/components/Footer/Sitemap.js +1 -1
  22. package/dist/components/Footer/Sitemap.js.map +1 -1
  23. package/dist/components/Gallery/Gallery.mobile.js +1 -1
  24. package/dist/components/Gallery/Gallery.mobile.js.map +1 -1
  25. package/dist/components/Gallery/GalleryCardInner.d.ts +2 -0
  26. package/dist/components/Gallery/GalleryCardInner.js +19 -0
  27. package/dist/components/Gallery/GalleryCardInner.js.map +1 -0
  28. package/dist/components/Gallery/GalleryContainer.d.ts +13 -0
  29. package/dist/components/Gallery/GalleryContainer.js +16 -0
  30. package/dist/components/Gallery/GalleryContainer.js.map +1 -0
  31. package/dist/components/Gallery/GalleryContent.d.ts +8 -2
  32. package/dist/components/Gallery/GalleryInner.d.ts +1 -1
  33. package/dist/components/Gallery/GalleryInner.js +8 -36
  34. package/dist/components/Gallery/GalleryInner.js.map +1 -1
  35. package/dist/components/Gallery/constants.d.ts +6 -0
  36. package/dist/components/Gallery/constants.js +19 -0
  37. package/dist/components/Gallery/constants.js.map +1 -0
  38. package/dist/components/Header/Header.js +3 -3
  39. package/dist/components/Header/Header.js.map +1 -1
  40. package/dist/components/LinkDocs/LinkDocs.js +3 -3
  41. package/dist/components/LinkDocs/LinkDocs.js.map +1 -1
  42. package/dist/components/LinkDocs/LinkDocsContent.d.ts +3 -3
  43. package/dist/components/ProductBlock/ProductBlock.d.ts +1 -1
  44. package/dist/components/ProductBlock/ProductBlock.js +12 -4
  45. package/dist/components/ProductBlock/ProductBlock.js.map +1 -1
  46. package/dist/components/ProductBlock/ProductBlockContent.d.ts +13 -2
  47. package/dist/components/ProductBlock/ProductBlockInner.js +16 -4
  48. package/dist/components/ProductBlock/ProductBlockInner.js.map +1 -1
  49. package/dist/components/ProductTile/ProductTileContent.d.ts +2 -2
  50. package/dist/components/TariffsTable/TariffsTableContent.d.ts +5 -1
  51. package/dist/components/TextBlock/TextBlockContent.d.ts +1 -0
  52. package/dist/components/Tile/TileContent.d.ts +1 -1
  53. package/dist/model/ButtonVersion.d.ts +1 -0
  54. package/dist/model/LinkProps.d.ts +2 -1
  55. package/dist/types.d.ts +8 -0
  56. package/dist/ui-kit/BlockItem/BlockItem.js +4 -4
  57. package/dist/ui-kit/BlockItem/BlockItem.js.map +1 -1
  58. package/dist/ui-kit/Button/ButtonProps.d.ts +6 -1
  59. package/dist/ui-kit/Checkbox/Checkbox.js +2 -2
  60. package/dist/ui-kit/Checkbox/Checkbox.js.map +1 -1
  61. package/dist/ui-kit/Icon/Icon.js +1 -1
  62. package/dist/ui-kit/Icon/Icon.js.map +1 -1
  63. package/dist/ui-kit/Icon/IconProps.d.ts +49 -41
  64. package/dist/ui-kit/Icon/IconProps.js +45 -41
  65. package/dist/ui-kit/Icon/IconProps.js.map +1 -1
  66. package/dist/ui-kit/Img.js +9 -3
  67. package/dist/ui-kit/Img.js.map +1 -1
  68. package/dist/ui-kit/InputRange/InputRange.js +2 -1
  69. package/dist/ui-kit/InputRange/InputRange.js.map +1 -1
  70. package/dist/ui-kit/SearchBar.js +1 -1
  71. package/dist/ui-kit/SearchBar.js.map +1 -1
  72. package/lib/common.css +1 -1
  73. package/lib/components/Accordion/AccordionBlocks.d.ts +1 -2
  74. package/lib/components/Accordion/AccordionBlocks.js +1 -2
  75. package/lib/components/Accordion/AccordionBlocks.js.map +1 -1
  76. package/lib/components/Accordion/AccordionItem.js +1 -1
  77. package/lib/components/Accordion/AccordionItem.js.map +1 -1
  78. package/lib/components/BaseTile/BaseTile.js +9 -4
  79. package/lib/components/BaseTile/BaseTile.js.map +1 -1
  80. package/lib/components/ComparisonTable/ComparisonTableContent.d.ts +2 -3
  81. package/lib/components/ContentPage/ContentPage.d.ts +9 -1
  82. package/lib/components/ContentPage/ContentPage.js +20 -17
  83. package/lib/components/ContentPage/ContentPage.js.map +1 -1
  84. package/lib/components/ContentPage/toMobilePage.js +13 -2
  85. package/lib/components/ContentPage/toMobilePage.js.map +1 -1
  86. package/lib/components/CreditCalculator/CreditCalculator.js +3 -3
  87. package/lib/components/CreditCalculator/CreditCalculator.js.map +1 -1
  88. package/lib/components/Footer/Footer.js +1 -1
  89. package/lib/components/Footer/Footer.js.map +1 -1
  90. package/lib/components/Footer/Sitemap.js +1 -1
  91. package/lib/components/Footer/Sitemap.js.map +1 -1
  92. package/lib/components/Gallery/Gallery.mobile.js +1 -1
  93. package/lib/components/Gallery/Gallery.mobile.js.map +1 -1
  94. package/lib/components/Gallery/GalleryCardInner.d.ts +2 -0
  95. package/lib/components/Gallery/GalleryCardInner.js +17 -0
  96. package/lib/components/Gallery/GalleryCardInner.js.map +1 -0
  97. package/lib/components/Gallery/GalleryContainer.d.ts +13 -0
  98. package/lib/components/Gallery/GalleryContainer.js +14 -0
  99. package/lib/components/Gallery/GalleryContainer.js.map +1 -0
  100. package/lib/components/Gallery/GalleryContent.d.ts +8 -2
  101. package/lib/components/Gallery/GalleryInner.d.ts +1 -1
  102. package/lib/components/Gallery/GalleryInner.js +6 -34
  103. package/lib/components/Gallery/GalleryInner.js.map +1 -1
  104. package/lib/components/Gallery/constants.d.ts +6 -0
  105. package/lib/components/Gallery/constants.js +17 -0
  106. package/lib/components/Gallery/constants.js.map +1 -0
  107. package/lib/components/Header/Header.js +3 -3
  108. package/lib/components/Header/Header.js.map +1 -1
  109. package/lib/components/LinkDocs/LinkDocs.fixture.d.ts +3 -3
  110. package/lib/components/LinkDocs/LinkDocs.js +3 -3
  111. package/lib/components/LinkDocs/LinkDocs.js.map +1 -1
  112. package/lib/components/LinkDocs/LinkDocsContent.d.ts +3 -3
  113. package/lib/components/ProductBlock/ProductBlock.d.ts +1 -1
  114. package/lib/components/ProductBlock/ProductBlock.fixture.d.ts +1 -0
  115. package/lib/components/ProductBlock/ProductBlock.js +12 -4
  116. package/lib/components/ProductBlock/ProductBlock.js.map +1 -1
  117. package/lib/components/ProductBlock/ProductBlockContent.d.ts +13 -2
  118. package/lib/components/ProductBlock/ProductBlockInner.js +16 -4
  119. package/lib/components/ProductBlock/ProductBlockInner.js.map +1 -1
  120. package/lib/components/ProductTile/ProductTileContent.d.ts +2 -2
  121. package/lib/components/TariffsTable/TariffsTableContent.d.ts +5 -1
  122. package/lib/components/TextBlock/TextBlockContent.d.ts +1 -0
  123. package/lib/components/Tile/TileContent.d.ts +1 -1
  124. package/lib/model/ButtonVersion.d.ts +1 -0
  125. package/lib/model/LinkProps.d.ts +2 -1
  126. package/lib/types.d.ts +8 -0
  127. package/lib/ui-kit/BlockItem/BlockItem.js +4 -4
  128. package/lib/ui-kit/BlockItem/BlockItem.js.map +1 -1
  129. package/lib/ui-kit/Button/ButtonProps.d.ts +6 -1
  130. package/lib/ui-kit/Checkbox/Checkbox.js +2 -2
  131. package/lib/ui-kit/Checkbox/Checkbox.js.map +1 -1
  132. package/lib/ui-kit/Icon/Icon.js +1 -1
  133. package/lib/ui-kit/Icon/Icon.js.map +1 -1
  134. package/lib/ui-kit/Icon/IconProps.d.ts +49 -41
  135. package/lib/ui-kit/Icon/IconProps.js +45 -41
  136. package/lib/ui-kit/Icon/IconProps.js.map +1 -1
  137. package/lib/ui-kit/Img.js +9 -3
  138. package/lib/ui-kit/Img.js.map +1 -1
  139. package/lib/ui-kit/InputRange/InputRange.js +2 -1
  140. package/lib/ui-kit/InputRange/InputRange.js.map +1 -1
  141. package/lib/ui-kit/SearchBar.js +1 -1
  142. package/lib/ui-kit/SearchBar.js.map +1 -1
  143. package/package.json +6 -4
  144. package/src/components/Accordion/Accordion.example.json +4 -4
  145. package/src/components/Accordion/Accordion.fixture.tsx +5 -1
  146. package/src/components/Accordion/AccordionBlocks.tsx +1 -3
  147. package/src/components/Accordion/AccordionItem.tsx +1 -1
  148. package/src/components/BaseTile/BaseTile.tsx +14 -5
  149. package/src/components/BenefitsBlock/BenefitsBlock.fixture.tsx +31 -28
  150. package/src/components/ComparisonTable/ComparisonTable.example.json +1 -1
  151. package/src/components/ComparisonTable/ComparisonTable.fixture.tsx +43 -53
  152. package/src/components/ComparisonTable/ComparisonTableContent.ts +2 -3
  153. package/src/components/ContentPage/ContentPage.page.json +31 -49
  154. package/src/components/ContentPage/ContentPage.tsx +71 -36
  155. package/src/components/ContentPage/toMobilePage.ts +19 -2
  156. package/src/components/CreditCalculator/CreditCalculator.fixture.tsx +9 -1
  157. package/src/components/CreditCalculator/CreditCalculator.tsx +11 -8
  158. package/src/components/ExchangeRateTile/ExchangeRateTile.fixture.tsx +1 -1
  159. package/src/components/Footer/Footer.fixture.tsx +265 -258
  160. package/src/components/Footer/Footer.tsx +3 -3
  161. package/src/components/Footer/Sitemap.tsx +1 -1
  162. package/src/components/Gallery/Gallery.fixture.tsx +52 -48
  163. package/src/components/Gallery/Gallery.mobile.tsx +1 -3
  164. package/src/components/Gallery/GalleryCardInner.tsx +53 -0
  165. package/src/components/Gallery/GalleryContainer.tsx +58 -0
  166. package/src/components/Gallery/GalleryContent.ts +8 -2
  167. package/src/components/Gallery/GalleryInner.tsx +15 -94
  168. package/src/components/Gallery/constants.ts +22 -0
  169. package/src/components/Header/Header.tsx +14 -12
  170. package/src/components/Headline/Headline.fixture.tsx +25 -3
  171. package/src/components/LikeControl/LikeControl.fixture.tsx +5 -1
  172. package/src/components/LinkDocs/LinkDocs.example.json +26 -0
  173. package/src/components/LinkDocs/LinkDocs.fixture.tsx +23 -6
  174. package/src/components/LinkDocs/LinkDocs.tsx +3 -3
  175. package/src/components/LinkDocs/LinkDocsContent.ts +3 -3
  176. package/src/components/MiniGallery/MiniGallery.fixture.tsx +12 -22
  177. package/src/components/MobileAppTile/MobileAppTile.fixture.tsx +3 -1
  178. package/src/components/PictureText/PictureText.example.json +1 -1
  179. package/src/components/PictureText/PictureText.fixture.tsx +5 -1
  180. package/src/components/Placeholder/Placeholder.fixture.tsx +5 -1
  181. package/src/components/ProductBlock/ProductBlock.example.json +1 -1
  182. package/src/components/ProductBlock/ProductBlock.fixture.tsx +141 -77
  183. package/src/components/ProductBlock/ProductBlock.tsx +20 -7
  184. package/src/components/ProductBlock/ProductBlockContent.ts +14 -2
  185. package/src/components/ProductBlock/ProductBlockInner.tsx +39 -7
  186. package/src/components/ProductGallery/ProductGallery.fixture.tsx +96 -93
  187. package/src/components/ProductTile/ProductTile.example.json +1 -1
  188. package/src/components/ProductTile/ProductTile.fixture.tsx +4 -4
  189. package/src/components/ProductTile/ProductTileContent.ts +2 -2
  190. package/src/components/PromoTile/PromoTile.fixture.tsx +1 -1
  191. package/src/components/StepsBlock/StepsBlock.fixture.tsx +21 -18
  192. package/src/components/TariffsTable/TariffsTable.fixture.tsx +5 -16
  193. package/src/components/TariffsTable/TariffsTableContent.ts +5 -1
  194. package/src/components/TextBlock/TextBlock.fixture.tsx +62 -45
  195. package/src/components/TextBlock/TextBlockContent.ts +1 -0
  196. package/src/components/Tile/Tile.example.json +1 -1
  197. package/src/components/Tile/Tile.fixture.tsx +11 -8
  198. package/src/components/Tile/TileContent.ts +1 -1
  199. package/src/icons/AppleIcon.svg +1 -1
  200. package/src/icons/CalendarWhiteIcon.svg +17 -0
  201. package/src/icons/EmptyWalletWhiteIcon.svg +16 -0
  202. package/src/icons/GridIcon.svg +2 -2
  203. package/src/icons/PercentageSquareWhiteIcon.svg +16 -0
  204. package/src/icons/PlayMarketIcon.svg +1 -1
  205. package/src/model/ButtonVersion.ts +1 -0
  206. package/src/model/LinkProps.ts +2 -1
  207. package/src/setup-fixture.ts +1 -2
  208. package/src/types.ts +11 -1
  209. package/src/ui-kit/BlockItem/BlockItem.tsx +4 -4
  210. package/src/ui-kit/Button/ButtonProps.ts +6 -1
  211. package/src/ui-kit/Checkbox/Checkbox.tsx +7 -3
  212. package/src/ui-kit/Icon/Icon.tsx +1 -1
  213. package/src/ui-kit/Icon/IconProps.ts +8 -0
  214. package/src/ui-kit/Img.tsx +23 -10
  215. package/src/ui-kit/InputRange/InputRange.tsx +7 -6
  216. package/src/ui-kit/SearchBar.tsx +3 -4
@@ -13,7 +13,7 @@ const titleAlignStyleMap: Record<AlignType, string> = {
13
13
 
14
14
  const titleMarginsStyleMap: Record<LinkColumnsMode, string> = {
15
15
  double: 'mb-8',
16
- single: '',
16
+ single: 'mb-[26px]',
17
17
  };
18
18
 
19
19
  const linkColumnsModeStyleMap: Record<LinkColumnsMode, string> = {
@@ -24,7 +24,7 @@ const linkColumnsModeStyleMap: Record<LinkColumnsMode, string> = {
24
24
  export interface LinkDocsProps extends LinkDocsContent, UniBlockProps {}
25
25
 
26
26
  export const LinkDocs = JSX<LinkDocsProps>(
27
- ({ className, title, align, documents, icon, columnsMode = 'single' }) => {
27
+ ({ className, title, align, documents, icon, columnsMode = 'double' }) => {
28
28
  const containerClasses = linkColumnsModeStyleMap[columnsMode];
29
29
 
30
30
  return (
@@ -49,7 +49,7 @@ export const LinkDocs = JSX<LinkDocsProps>(
49
49
  role="listitem"
50
50
  {...linkProps}
51
51
  >
52
- {icon && <Icon className="mr-3.5" name={icon} width="24px" height="24px" />}
52
+ {icon && <Icon className="mr-2.5 h-fit" name={icon} width="24px" height="24px" />}
53
53
  <span className="self-center">
54
54
  {text}
55
55
  <span className="text-secondary-text group-hover:text-primary-main">
@@ -16,11 +16,11 @@ export interface LinkDocsItem extends LinkProps {
16
16
  /**
17
17
  * @title Список документов
18
18
  */
19
- export interface LinkDocsContent extends Pick<BaseTileCommonProps, 'align' | 'title'> {
19
+ export interface LinkDocsContent extends Pick<BaseTileCommonProps, 'title' | 'align'> {
20
+ /** @title Отображение списка */
21
+ columnsMode?: LinkColumnsMode;
20
22
  /** @title Название иконки */
21
23
  icon?: IconName;
22
24
  /** @title Список */
23
25
  documents?: LinkDocsItem[];
24
- /** @title Отображение списка */
25
- columnsMode?: LinkColumnsMode;
26
26
  }
@@ -1,7 +1,6 @@
1
+ import type { Picture } from '../../model/Picture';
1
2
  import { context } from '../../setup-fixture';
2
-
3
3
  import { MiniGallery, MiniGalleryProps } from './MiniGallery';
4
- import { Picture } from '../../model/Picture';
5
4
 
6
5
  const image: Picture = {
7
6
  src: 'domovoj-kupon.png',
@@ -10,6 +9,7 @@ const image: Picture = {
10
9
  width: 120,
11
10
  height: 70,
12
11
  },
12
+ title: 'domovoj-kupon',
13
13
  };
14
14
 
15
15
  const defaultProps: MiniGalleryProps = {
@@ -39,16 +39,6 @@ const defaultProps: MiniGalleryProps = {
39
39
  'Время копить: ставка растет в зависимости от срока нахождения средств на Счете!',
40
40
  image,
41
41
  },
42
- {
43
- title: 'Фермерские продукты',
44
- description: 'Высокий процент даже при небольшой сумме денежных средств',
45
- image,
46
- },
47
- {
48
- title: 'Фермерские продукты',
49
- description: 'Высокий процент даже при небольшой сумме денежных средств',
50
- image,
51
- },
52
42
  ],
53
43
  };
54
44
 
@@ -73,18 +63,18 @@ const onlyTitleProps: MiniGalleryProps = {
73
63
  title: '«Моя выгода»',
74
64
  image,
75
65
  },
76
- {
77
- title: 'Фермерские продукты',
78
- image,
79
- },
80
- {
81
- title: 'Фермерские продукты',
82
- image,
83
- },
84
66
  ],
85
67
  };
86
68
 
87
69
  export default {
88
- default: <MiniGallery {...defaultProps} />,
89
- 'only title': <MiniGallery {...onlyTitleProps} />,
70
+ default: (
71
+ <div className="container grid grid-cols-12">
72
+ <MiniGallery className="col-span-12" {...defaultProps} />
73
+ </div>
74
+ ),
75
+ 'only title': (
76
+ <div className="container grid grid-cols-12">
77
+ <MiniGallery className="col-span-12" {...onlyTitleProps} />
78
+ </div>
79
+ ),
90
80
  };
@@ -4,7 +4,7 @@ import { MobileAppTile } from './MobileAppTile';
4
4
 
5
5
  export default {
6
6
  default: (
7
- <div className="grid grid-cols-12">
7
+ <div className="container grid grid-cols-12">
8
8
  <MobileAppTile
9
9
  context={context}
10
10
  className="col-span-4"
@@ -18,6 +18,7 @@ export default {
18
18
  text: 'App Store',
19
19
  icon: 'AppleIcon',
20
20
  href: '#',
21
+ asSVG: true,
21
22
  version: 'secondary',
22
23
  },
23
24
  {
@@ -25,6 +26,7 @@ export default {
25
26
  text: 'Google Play',
26
27
  icon: 'PlayMarketIcon',
27
28
  href: '#',
29
+ asSVG: true,
28
30
  version: 'secondary',
29
31
  },
30
32
  ]}
@@ -1,5 +1,5 @@
1
1
  {
2
- "title": "Продукт",
2
+ "title": "Блок с картинкой",
3
3
  "description": "Описание",
4
4
  "image": {
5
5
  "format": "webp",
@@ -32,5 +32,9 @@ export const PICTURE_TEXT: PictureTextContent = {
32
32
  };
33
33
 
34
34
  export default {
35
- default: <PictureText context={context} {...PICTURE_TEXT} />,
35
+ default: (
36
+ <div className="container grid grid-cols-12">
37
+ <PictureText className="col-span-12" context={context} {...PICTURE_TEXT} />
38
+ </div>
39
+ ),
36
40
  };
@@ -2,4 +2,8 @@ import { context } from '../../setup-fixture';
2
2
 
3
3
  import { Placeholder } from './Placeholder';
4
4
 
5
- export default <Placeholder context={context} title="Неизвестный блок" />;
5
+ export default (
6
+ <div className="container grid grid-cols-12">
7
+ <Placeholder className="col-span-12" context={context} title="Неизвестный блок" />
8
+ </div>
9
+ );
@@ -10,7 +10,7 @@
10
10
  "items": ["Элемент списка 1", "Элемент списка 2", "Элемент списка 3"],
11
11
  "buttons": [
12
12
  {
13
- "text": "Подробнее",
13
+ "text": "Кнопка",
14
14
  "version": "secondary"
15
15
  }
16
16
  ]
@@ -1,11 +1,12 @@
1
1
  import { context } from '../../setup-fixture';
2
2
 
3
- import { ProductBlock } from './ProductBlock';
4
3
  import type { Picture } from '../../model/Picture';
4
+ import { ProductBlock } from './ProductBlock';
5
5
 
6
6
  const image: Picture = {
7
7
  src: 'money-1.png',
8
8
  format: 'webp',
9
+ alt: 'Потребительский кредит наличными',
9
10
  size: {
10
11
  width: 280,
11
12
  height: 280,
@@ -14,83 +15,146 @@ const image: Picture = {
14
15
 
15
16
  export default {
16
17
  default: (
17
- <ProductBlock
18
- context={context}
19
- title={'Потребительский кредит наличными'}
20
- description="Кредит наличными без залога и поручительства. Потребительский кредит на любые цели. Нужен только паспорт."
21
- breadcrumbs={[
22
- {
23
- text: 'Главная',
24
- href: '/',
25
- },
26
- {
27
- text: 'Кредитные карты',
28
- href: '/credit',
29
- },
30
- {
31
- text: 'Кредитная карта Своя Union Pay',
32
- },
33
- ]}
34
- benefits={[
35
- {
36
- label: 'До 5 млн ₽',
37
- description: 'Кредитный лимит',
38
- icon: 'EmptyWalletIcon',
39
- },
40
- {
41
- label: 'От 16,9%',
42
- description: 'Ставка по кредиту',
43
- icon: 'PercentageSquareIcon',
44
- },
45
- {
46
- label: 'До 5 лет',
47
- description: 'Срок кредитования',
48
- icon: 'CalendarIcon',
49
- },
50
- ]}
51
- buttons={[
52
- {
53
- href: 'https://rshb.ru',
54
- text: 'Оформить карту',
55
- target: '_blank',
56
- version: 'primary',
57
- },
58
- {
59
- href: 'https://rshb.ru',
60
- text: 'Подробнее',
61
- target: '_blank',
62
- version: 'secondary',
63
- },
64
- ]}
65
- image={image}
66
- />
18
+ <div className="container grid grid-cols-12">
19
+ <ProductBlock
20
+ className="col-span-12"
21
+ context={context}
22
+ title={'Потребительский кредит наличными'}
23
+ description="Кредит наличными без залога и поручительства. Потребительский кредит на любые цели. Нужен только паспорт."
24
+ breadcrumbs={[
25
+ {
26
+ text: 'Главная',
27
+ href: '/',
28
+ },
29
+ {
30
+ text: 'Кредитные карты',
31
+ href: '/credit',
32
+ },
33
+ {
34
+ text: 'Кредитная карта Своя Union Pay',
35
+ },
36
+ ]}
37
+ benefits={[
38
+ {
39
+ label: 'До 5 млн ₽',
40
+ description: 'Кредитный лимит',
41
+ icon: 'EmptyWalletIcon',
42
+ },
43
+ {
44
+ label: 'От 16,9%',
45
+ description: 'Ставка по кредиту',
46
+ icon: 'PercentageSquareIcon',
47
+ },
48
+ {
49
+ label: 'До 5 лет',
50
+ description: 'Срок кредитования',
51
+ icon: 'CalendarIcon',
52
+ },
53
+ ]}
54
+ buttons={[
55
+ {
56
+ href: 'https://rshb.ru',
57
+ text: 'Оформить карту',
58
+ target: '_blank',
59
+ version: 'primary',
60
+ },
61
+ {
62
+ href: 'https://rshb.ru',
63
+ text: 'Подробнее',
64
+ target: '_blank',
65
+ version: 'secondary',
66
+ },
67
+ ]}
68
+ image={image}
69
+ />
70
+ </div>
71
+ ),
72
+ secondary: (
73
+ <div className="container grid grid-cols-12">
74
+ <ProductBlock
75
+ context={context}
76
+ className="col-span-12"
77
+ title={'Потребительский кредит наличными'}
78
+ version={'secondary'}
79
+ description="Кредит наличными без залога и поручительства. Потребительский кредит на любые цели. Нужен только паспорт."
80
+ breadcrumbs={[
81
+ {
82
+ text: 'Главная',
83
+ href: '/',
84
+ },
85
+ {
86
+ text: 'Кредитные карты',
87
+ href: '/credit',
88
+ },
89
+ {
90
+ text: 'Кредитная карта Своя Union Pay',
91
+ href: '#',
92
+ },
93
+ ]}
94
+ benefits={[
95
+ {
96
+ label: 'До 5 млн ₽',
97
+ description: 'Кредитный лимит',
98
+ icon: 'EmptyWalletWhiteIcon',
99
+ },
100
+ {
101
+ label: 'От 16,9%',
102
+ description: 'Ставка по кредиту',
103
+ icon: 'PercentageSquareWhiteIcon',
104
+ },
105
+ {
106
+ label: 'До 5 лет',
107
+ description: 'Срок кредитования',
108
+ icon: 'CalendarWhiteIcon',
109
+ },
110
+ ]}
111
+ buttons={[
112
+ {
113
+ href: 'https://rshb.ru',
114
+ text: 'Оформить карту',
115
+ target: '_blank',
116
+ version: 'secondary',
117
+ },
118
+ {
119
+ href: 'https://rshb.ru',
120
+ text: 'Подробнее',
121
+ target: '_blank',
122
+ version: 'primary',
123
+ },
124
+ ]}
125
+ image={image}
126
+ />
127
+ </div>
67
128
  ),
68
129
  'with items': (
69
- <ProductBlock
70
- context={context}
71
- title={'Оплата проходит \nв 180 странах мира'}
72
- breadcrumbs={[]}
73
- description="Кредит наличными без залога и поручительства. Потребительский кредит на любые цели. Нужен только паспорт."
74
- items={[
75
- 'Совершайте любые личные покупки',
76
- 'Используйте корпоративную карту как обычную дебетовую, если вы ИП',
77
- 'Расходы для бизнеса на УСН 15% позволят снизить налоговую базу',
78
- ]}
79
- buttons={[
80
- {
81
- href: 'https://rshb.ru',
82
- text: 'Оформить карту',
83
- target: '_blank',
84
- version: 'primary',
85
- },
86
- {
87
- href: 'https://rshb.ru',
88
- text: 'Подробнее',
89
- target: '_blank',
90
- version: 'secondary',
91
- },
92
- ]}
93
- image={image}
94
- />
130
+ <div className="container grid grid-cols-12">
131
+ <ProductBlock
132
+ className="col-span-12"
133
+ context={context}
134
+ title={'Оплата проходит \nв 180 странах мира'}
135
+ breadcrumbs={[]}
136
+ description="Кредит наличными без залога и поручительства. Потребительский кредит на любые цели. Нужен только паспорт."
137
+ items={[
138
+ 'Совершайте любые личные покупки',
139
+ 'Используйте корпоративную карту как обычную дебетовую, если вы ИП',
140
+ 'Расходы для бизнеса на УСН 15% позволят снизить налоговую базу',
141
+ ]}
142
+ buttons={[
143
+ {
144
+ href: 'https://rshb.ru',
145
+ text: 'Оформить карту',
146
+ target: '_blank',
147
+ version: 'primary',
148
+ },
149
+ {
150
+ href: 'https://rshb.ru',
151
+ text: 'Подробнее',
152
+ target: '_blank',
153
+ version: 'secondary',
154
+ },
155
+ ]}
156
+ image={image}
157
+ />
158
+ </div>
95
159
  ),
96
160
  };
@@ -1,30 +1,43 @@
1
1
  import { JSX } from '@redneckz/uni-jsx';
2
- import type { ProductBlockContent } from './ProductBlockContent';
3
- import { ProductBlockInner } from './ProductBlockInner';
2
+ import { useLink } from '../../hooks/useLink';
3
+ import type { BlockVersion } from '../../model/BlockVersion';
4
4
  import type { UniBlockProps } from '../../types';
5
5
  import { Breadcrumb } from '../../ui-kit/Breadcrumb';
6
- import { useLink } from '../../hooks/useLink';
7
6
  import { joinList } from '../../utils/joinList';
7
+ import type { ProductBlockContent } from './ProductBlockContent';
8
+ import { ProductBlockInner } from './ProductBlockInner';
8
9
 
9
10
  export interface ProductBlockProps extends ProductBlockContent, UniBlockProps {}
10
11
 
12
+ const productBlockStyleMap: Record<BlockVersion, string> = {
13
+ primary: 'bg-white text-primary-text',
14
+ secondary: 'bg-primary-main text-white',
15
+ };
16
+
17
+ const breadcrumbsStyleMap: Record<BlockVersion, string> = {
18
+ primary: 'text-secondary-text',
19
+ secondary: 'text-white/80',
20
+ };
21
+
11
22
  export const ProductBlock = JSX<ProductBlockProps>((props) => {
12
- const { context, className, breadcrumbs } = props;
23
+ const { context, className, breadcrumbs, version = 'primary' } = props;
13
24
  const router = context.useRouter();
14
25
  const { handlerDecorator } = context;
15
26
  return (
16
27
  <section
17
- className={`font-sans bg-white pt-10 pl-[50px] pb-[50px] pr-[7.5rem] ${className || ''}`}
28
+ className={`font-sans pt-10 pl-[50px] pb-[50px] pr-[7.5rem] box-border min-h-[420px] ${
29
+ className || ''
30
+ } ${productBlockStyleMap[version]}`}
18
31
  >
19
32
  {breadcrumbs?.length ? (
20
33
  <div className="text-xs mb-6">
21
- {joinList(<span className="text-secondary-text mx-2">/</span>)(
34
+ {joinList(<span className={`mx-2 ${breadcrumbsStyleMap[version]}`}>/</span>)(
22
35
  breadcrumbs.map((breadcrumb, i) => (
23
36
  <Breadcrumb
24
37
  key={String(i)}
25
38
  {...useLink(
26
39
  { router, handlerDecorator },
27
- { className: 'text-secondary-text', ...breadcrumb },
40
+ { className: breadcrumbsStyleMap[version], ...breadcrumb },
28
41
  )}
29
42
  />
30
43
  )),
@@ -1,9 +1,21 @@
1
1
  import type { LinkProps } from '../../model/LinkProps';
2
+ import type { TitleSize } from '../../ui-kit/Title/TitleProps';
2
3
  import type { BaseTileCommonProps } from '../BaseTile/BaseTileProps';
3
4
  import type { Benefit } from '../BenefitsBlock/BenefitsBlockContent';
4
5
 
5
- export interface ProductBlockInnerCommonProps extends BaseTileCommonProps {
6
- /** @title Преимущества */
6
+ export interface ProductBlockInnerCommonProps
7
+ extends Omit<BaseTileCommonProps, 'align' | 'titleSize'> {
8
+ /**
9
+ * @title Размер заголовка
10
+ * @default M
11
+ * @hidden
12
+ */
13
+ titleSize?: TitleSize;
14
+ /**
15
+ * @title Преимущества
16
+ * @minItems 2
17
+ * @maxItems 3
18
+ */
7
19
  benefits?: Benefit[];
8
20
  }
9
21
 
@@ -1,4 +1,5 @@
1
1
  import { JSX } from '@redneckz/uni-jsx';
2
+ import type { BlockVersion } from '../../model/BlockVersion';
2
3
  import type { UniBlockProps } from '../../types';
3
4
  import { Icon } from '../../ui-kit/Icon/Icon';
4
5
  import { Img } from '../../ui-kit/Img';
@@ -8,8 +9,32 @@ import type { ProductBlockInnerCommonProps } from './ProductBlockContent';
8
9
 
9
10
  export interface ProductBlockInnerProps extends ProductBlockInnerCommonProps, UniBlockProps {}
10
11
 
12
+ const benefitIconBgStyleMap: Record<BlockVersion, string> = {
13
+ primary: 'bg-main',
14
+ secondary: 'bg-white/30',
15
+ };
16
+ const benefitTitleStyleMap: Record<BlockVersion, string> = {
17
+ primary: 'text-primary-text',
18
+ secondary: 'text-white',
19
+ };
20
+ const benefitDescStyleMap: Record<BlockVersion, string> = {
21
+ primary: 'text-secondary-text',
22
+ secondary: 'text-white',
23
+ };
24
+
11
25
  export const ProductBlockInner = JSX<ProductBlockInnerProps>(
12
- ({ className, context, title, titleSize, description, benefits, buttons, image, items }) => {
26
+ ({
27
+ className,
28
+ context,
29
+ title,
30
+ titleSize,
31
+ description,
32
+ benefits,
33
+ buttons,
34
+ image,
35
+ items,
36
+ version = 'primary',
37
+ }) => {
13
38
  return (
14
39
  <div className={`flex grow justify-between items-stretch ${className || ''}`}>
15
40
  <div className={'flex flex-col'}>
@@ -20,9 +45,12 @@ export const ProductBlockInner = JSX<ProductBlockInnerProps>(
20
45
  description={description}
21
46
  items={items}
22
47
  buttons={buttons}
48
+ version={version}
23
49
  >
24
50
  {benefits?.length ? (
25
- <div className="flex gap-6 mt-6 mb-3.5">{benefits.map(renderBenefit)}</div>
51
+ <div className="flex gap-6 mt-6 mb-3.5">
52
+ {benefits.map((_, i) => renderBenefit(_, i, version))}
53
+ </div>
26
54
  ) : null}
27
55
  </BaseTile>
28
56
  </div>
@@ -32,21 +60,25 @@ export const ProductBlockInner = JSX<ProductBlockInnerProps>(
32
60
  },
33
61
  );
34
62
 
35
- function renderBenefit(benefit: Benefit, i: number) {
63
+ function renderBenefit(benefit: Benefit, i: number, version: string) {
36
64
  return (
37
65
  <div key={String(i)} className="flex gap-4 items-center">
38
66
  {benefit.icon && (
39
67
  <Icon
40
- className="w-[50px] h-[50px] min-w-[50px] min-h-[50px] bg-main rounded-full p-[10px] box-border"
68
+ className={`w-[50px] h-[50px] min-w-[50px] min-h-[50px] rounded-full p-[10px] box-border ${benefitIconBgStyleMap[version]}`}
41
69
  name={benefit.icon}
42
70
  width="24"
43
71
  height="24"
44
72
  />
45
73
  )}
46
- <div className="flex gap-1 flex-col h-full">
47
- <h4 className="font-medium text-primary-text text-xl m-0">{benefit.label}</h4>
74
+ <div className="flex gap-1 flex-col h-full max-w-[149px]">
75
+ <h4 className={`font-medium text-xl m-0 ${benefitTitleStyleMap[version]}`}>
76
+ {benefit.label}
77
+ </h4>
48
78
  {benefit.description && (
49
- <div className="font-normal text-sm text-secondary-text">{benefit.description}</div>
79
+ <div className={`font-normal text-sm ${benefitDescStyleMap[version]}`}>
80
+ {benefit.description}
81
+ </div>
50
82
  )}
51
83
  </div>
52
84
  </div>