@redneckz/wildless-cms-uni-blocks 0.4.1 → 0.4.2

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 (238) hide show
  1. package/bundle/blocks.schema.json +1 -1
  2. package/bundle/bundle.umd.js +49 -54
  3. package/bundle/bundle.umd.min.js +1 -1
  4. package/dist/components/BaseTile/BaseTile.js +1 -1
  5. package/dist/components/BaseTile/BaseTile.js.map +1 -1
  6. package/dist/components/BenefitsBlock/BenefitsBlock.js.map +1 -1
  7. package/dist/components/BenefitsBlock/BenefitsBlockContent.d.ts +2 -2
  8. package/dist/components/BlockContent.d.ts +1 -2
  9. package/dist/components/Blocks.d.ts +0 -1
  10. package/dist/components/Blocks.js +0 -2
  11. package/dist/components/Blocks.js.map +1 -1
  12. package/dist/components/Footer/MediaButton.d.ts +1 -1
  13. package/dist/components/Footer/SocialMedia.d.ts +1 -1
  14. package/dist/components/Footer/SocialMedia.mobile.d.ts +1 -1
  15. package/dist/components/Gallery/GalleryContainer.js.map +1 -1
  16. package/dist/components/PictureText/PictureText.js +14 -5
  17. package/dist/components/PictureText/PictureText.js.map +1 -1
  18. package/dist/components/PictureText/PictureTextContent.d.ts +8 -16
  19. package/dist/components/ProductBlock/ProductBlockContent.d.ts +3 -15
  20. package/dist/components/ProductBlock/ProductBlockInner.js +1 -1
  21. package/dist/components/ProductBlock/ProductBlockInner.js.map +1 -1
  22. package/dist/components/ProductBlock/ProductBlockInner.mobile.js +1 -1
  23. package/dist/components/ProductBlock/ProductBlockInner.mobile.js.map +1 -1
  24. package/dist/components/ProductBlock/renderBenefit.d.ts +4 -2
  25. package/dist/components/ProductBlock/renderBenefit.js +3 -22
  26. package/dist/components/ProductBlock/renderBenefit.js.map +1 -1
  27. package/dist/components/ProductGallery/ProductGallery.js +5 -5
  28. package/dist/components/ProductGallery/ProductGallery.js.map +1 -1
  29. package/dist/components/ProductTile/ProductTile.js +1 -1
  30. package/dist/components/ProductTile/ProductTile.js.map +1 -1
  31. package/dist/components/PromoTile/PromoTile.js +1 -1
  32. package/dist/components/PromoTile/PromoTile.js.map +1 -1
  33. package/dist/components/Recommendation/RecommendationCard.d.ts +1 -1
  34. package/dist/components/StepsBlock/StepsBlockStyleMaps.d.ts +1 -1
  35. package/dist/ui-kit/BenefitItem/BenefitItem.d.ts +4 -0
  36. package/dist/ui-kit/BenefitItem/BenefitItem.js +29 -0
  37. package/dist/ui-kit/BenefitItem/BenefitItem.js.map +1 -0
  38. package/dist/ui-kit/BenefitItem/BenefitItemProps.d.ts +24 -0
  39. package/dist/{components/Insurance/InsuranceContent.js → ui-kit/BenefitItem/BenefitItemProps.js} +1 -1
  40. package/dist/ui-kit/BenefitItem/BenefitItemProps.js.map +1 -0
  41. package/dist/ui-kit/Foldable/Foldable.js +1 -1
  42. package/dist/ui-kit/Foldable/Foldable.js.map +1 -1
  43. package/lib/common.css +1 -1
  44. package/lib/components/BaseTile/BaseTile.js +1 -1
  45. package/lib/components/BaseTile/BaseTile.js.map +1 -1
  46. package/lib/components/BenefitsBlock/BenefitsBlock.js.map +1 -1
  47. package/lib/components/BenefitsBlock/BenefitsBlockContent.d.ts +2 -2
  48. package/lib/components/BlockContent.d.ts +1 -2
  49. package/lib/components/Blocks.d.ts +0 -1
  50. package/lib/components/Blocks.js +0 -2
  51. package/lib/components/Blocks.js.map +1 -1
  52. package/lib/components/Footer/MediaButton.d.ts +1 -1
  53. package/lib/components/Footer/SocialMedia.d.ts +1 -1
  54. package/lib/components/Footer/SocialMedia.mobile.d.ts +1 -1
  55. package/lib/components/Gallery/GalleryContainer.js.map +1 -1
  56. package/lib/components/PictureText/PictureText.fixture.d.ts +4 -0
  57. package/lib/components/PictureText/PictureText.js +14 -5
  58. package/lib/components/PictureText/PictureText.js.map +1 -1
  59. package/lib/components/PictureText/PictureTextContent.d.ts +8 -16
  60. package/lib/components/ProductBlock/ProductBlockContent.d.ts +3 -15
  61. package/lib/components/ProductBlock/ProductBlockInner.js +1 -1
  62. package/lib/components/ProductBlock/ProductBlockInner.js.map +1 -1
  63. package/lib/components/ProductBlock/ProductBlockInner.mobile.js +1 -1
  64. package/lib/components/ProductBlock/ProductBlockInner.mobile.js.map +1 -1
  65. package/lib/components/ProductBlock/renderBenefit.d.ts +4 -3
  66. package/lib/components/ProductBlock/renderBenefit.js +4 -23
  67. package/lib/components/ProductBlock/renderBenefit.js.map +1 -1
  68. package/lib/components/ProductGallery/ProductGallery.js +5 -5
  69. package/lib/components/ProductGallery/ProductGallery.js.map +1 -1
  70. package/lib/components/ProductTile/ProductTile.js +1 -1
  71. package/lib/components/ProductTile/ProductTile.js.map +1 -1
  72. package/lib/components/PromoTile/PromoTile.js +1 -1
  73. package/lib/components/PromoTile/PromoTile.js.map +1 -1
  74. package/lib/components/Recommendation/RecommendationCard.d.ts +1 -1
  75. package/lib/components/StepsBlock/StepsBlockStyleMaps.d.ts +1 -1
  76. package/lib/ui-kit/BenefitItem/BenefitItem.d.ts +4 -0
  77. package/lib/ui-kit/BenefitItem/BenefitItem.js +27 -0
  78. package/lib/ui-kit/BenefitItem/BenefitItem.js.map +1 -0
  79. package/lib/ui-kit/BenefitItem/BenefitItemProps.d.ts +24 -0
  80. package/lib/ui-kit/BenefitItem/BenefitItemProps.js +2 -0
  81. package/lib/ui-kit/BenefitItem/BenefitItemProps.js.map +1 -0
  82. package/lib/ui-kit/Foldable/Foldable.js +1 -1
  83. package/lib/ui-kit/Foldable/Foldable.js.map +1 -1
  84. package/mobile/bundle/bundle.umd.js +20 -12
  85. package/mobile/bundle/bundle.umd.min.js +1 -1
  86. package/mobile/dist/components/BaseTile/BaseTile.js +1 -1
  87. package/mobile/dist/components/BaseTile/BaseTile.js.map +1 -1
  88. package/mobile/dist/components/BenefitsBlock/BenefitsBlock.js.map +1 -1
  89. package/mobile/dist/components/BenefitsBlock/BenefitsBlockContent.d.ts +2 -2
  90. package/mobile/dist/components/BlockContent.d.ts +1 -2
  91. package/mobile/dist/components/Footer/MediaButton.d.ts +1 -1
  92. package/mobile/dist/components/Footer/SocialMedia.d.ts +1 -1
  93. package/mobile/dist/components/Gallery/GalleryContainer.js.map +1 -1
  94. package/mobile/dist/components/PictureText/PictureText.js +14 -5
  95. package/mobile/dist/components/PictureText/PictureText.js.map +1 -1
  96. package/mobile/dist/components/PictureText/PictureTextContent.d.ts +8 -16
  97. package/mobile/dist/components/ProductBlock/ProductBlockContent.d.ts +3 -15
  98. package/mobile/dist/components/ProductBlock/ProductBlockInner.js +1 -1
  99. package/mobile/dist/components/ProductBlock/ProductBlockInner.js.map +1 -1
  100. package/mobile/dist/components/ProductBlock/renderBenefit.d.ts +4 -2
  101. package/mobile/dist/components/ProductBlock/renderBenefit.js +3 -19
  102. package/mobile/dist/components/ProductBlock/renderBenefit.js.map +1 -1
  103. package/mobile/dist/components/ProductTile/ProductTile.js +1 -1
  104. package/mobile/dist/components/ProductTile/ProductTile.js.map +1 -1
  105. package/mobile/dist/components/PromoTile/PromoTile.js +1 -1
  106. package/mobile/dist/components/PromoTile/PromoTile.js.map +1 -1
  107. package/mobile/dist/components/Recommendation/RecommendationCard.d.ts +1 -1
  108. package/mobile/dist/components/StepsBlock/StepsBlockStyleMaps.d.ts +1 -1
  109. package/mobile/dist/ui-kit/BenefitItem/BenefitItem.d.ts +4 -0
  110. package/mobile/dist/ui-kit/BenefitItem/BenefitItem.js +29 -0
  111. package/mobile/dist/ui-kit/BenefitItem/BenefitItem.js.map +1 -0
  112. package/mobile/dist/ui-kit/BenefitItem/BenefitItemProps.d.ts +24 -0
  113. package/mobile/dist/{components/Insurance/InsuranceContent.js → ui-kit/BenefitItem/BenefitItemProps.js} +1 -1
  114. package/mobile/dist/ui-kit/BenefitItem/BenefitItemProps.js.map +1 -0
  115. package/mobile/dist/ui-kit/Foldable/Foldable.js +1 -1
  116. package/mobile/dist/ui-kit/Foldable/Foldable.js.map +1 -1
  117. package/mobile/lib/components/BaseTile/BaseTile.js +1 -1
  118. package/mobile/lib/components/BaseTile/BaseTile.js.map +1 -1
  119. package/mobile/lib/components/BenefitsBlock/BenefitsBlock.js.map +1 -1
  120. package/mobile/lib/components/BenefitsBlock/BenefitsBlockContent.d.ts +2 -2
  121. package/mobile/lib/components/BlockContent.d.ts +1 -2
  122. package/mobile/lib/components/Footer/MediaButton.d.ts +1 -1
  123. package/mobile/lib/components/Footer/SocialMedia.d.ts +1 -1
  124. package/mobile/lib/components/Gallery/GalleryContainer.js.map +1 -1
  125. package/mobile/lib/components/PictureText/PictureText.js +14 -5
  126. package/mobile/lib/components/PictureText/PictureText.js.map +1 -1
  127. package/mobile/lib/components/PictureText/PictureTextContent.d.ts +8 -16
  128. package/mobile/lib/components/ProductBlock/ProductBlockContent.d.ts +3 -15
  129. package/mobile/lib/components/ProductBlock/ProductBlockInner.js +1 -1
  130. package/mobile/lib/components/ProductBlock/ProductBlockInner.js.map +1 -1
  131. package/mobile/lib/components/ProductBlock/renderBenefit.d.ts +4 -2
  132. package/mobile/lib/components/ProductBlock/renderBenefit.js +4 -20
  133. package/mobile/lib/components/ProductBlock/renderBenefit.js.map +1 -1
  134. package/mobile/lib/components/ProductTile/ProductTile.js +1 -1
  135. package/mobile/lib/components/ProductTile/ProductTile.js.map +1 -1
  136. package/mobile/lib/components/PromoTile/PromoTile.js +1 -1
  137. package/mobile/lib/components/PromoTile/PromoTile.js.map +1 -1
  138. package/mobile/lib/components/Recommendation/RecommendationCard.d.ts +1 -1
  139. package/mobile/lib/components/StepsBlock/StepsBlockStyleMaps.d.ts +1 -1
  140. package/mobile/lib/ui-kit/BenefitItem/BenefitItem.d.ts +4 -0
  141. package/mobile/lib/ui-kit/BenefitItem/BenefitItem.js +27 -0
  142. package/mobile/lib/ui-kit/BenefitItem/BenefitItem.js.map +1 -0
  143. package/mobile/lib/ui-kit/BenefitItem/BenefitItemProps.d.ts +24 -0
  144. package/mobile/lib/ui-kit/BenefitItem/BenefitItemProps.js +2 -0
  145. package/mobile/lib/ui-kit/BenefitItem/BenefitItemProps.js.map +1 -0
  146. package/mobile/lib/ui-kit/Foldable/Foldable.js +1 -1
  147. package/mobile/lib/ui-kit/Foldable/Foldable.js.map +1 -1
  148. package/mobile/src/components/BaseTile/BaseTile.tsx +2 -2
  149. package/mobile/src/components/BenefitsBlock/BenefitsBlock.tsx +2 -2
  150. package/mobile/src/components/BenefitsBlock/BenefitsBlockContent.ts +2 -2
  151. package/mobile/src/components/BlockContent.ts +0 -2
  152. package/mobile/src/components/ContentPage/ContentPage.page.json +41 -41
  153. package/mobile/src/components/Footer/MediaButton.tsx +1 -1
  154. package/mobile/src/components/Footer/SocialMedia.tsx +1 -1
  155. package/mobile/src/components/Gallery/Gallery.tsx +1 -1
  156. package/mobile/src/components/Gallery/GalleryContainer.tsx +0 -1
  157. package/mobile/src/components/PictureText/PictureText.example.json +7 -4
  158. package/mobile/src/components/PictureText/PictureText.tsx +55 -34
  159. package/mobile/src/components/PictureText/PictureTextContent.ts +8 -17
  160. package/mobile/src/components/ProductBlock/ProductBlockContent.ts +3 -17
  161. package/mobile/src/components/ProductBlock/ProductBlockInner.tsx +1 -5
  162. package/mobile/src/components/ProductBlock/renderBenefit.tsx +17 -42
  163. package/mobile/src/components/ProductTile/ProductTile.tsx +1 -1
  164. package/mobile/src/components/PromoTile/PromoTile.tsx +1 -1
  165. package/mobile/src/components/Recommendation/RecommendationCard.tsx +1 -1
  166. package/mobile/src/components/StepsBlock/StepsBlockStyleMaps.ts +1 -1
  167. package/mobile/src/components/__snapshots__/Blocks.spec.tsx.snap +15 -30
  168. package/mobile/src/ui-kit/BenefitItem/BenefitItem.tsx +58 -0
  169. package/mobile/src/ui-kit/BenefitItem/BenefitItemProps.ts +27 -0
  170. package/mobile/src/ui-kit/Foldable/Foldable.tsx +1 -1
  171. package/package.json +1 -1
  172. package/src/components/BaseTile/BaseTile.tsx +2 -2
  173. package/src/components/BenefitsBlock/BenefitsBlock.tsx +2 -2
  174. package/src/components/BenefitsBlock/BenefitsBlockContent.ts +2 -2
  175. package/src/components/BlockContent.ts +0 -2
  176. package/src/components/Blocks.ts +0 -2
  177. package/src/components/ContentPage/ContentPage.page.json +41 -41
  178. package/src/components/Footer/MediaButton.tsx +1 -1
  179. package/src/components/Footer/SocialMedia.mobile.tsx +1 -1
  180. package/src/components/Footer/SocialMedia.tsx +1 -1
  181. package/src/components/Gallery/Gallery.mobile.tsx +1 -1
  182. package/src/components/Gallery/GalleryContainer.tsx +0 -1
  183. package/src/components/PictureText/PictureText.example.json +7 -4
  184. package/src/components/PictureText/PictureText.fixture.tsx +74 -5
  185. package/src/components/PictureText/PictureText.tsx +55 -34
  186. package/src/components/PictureText/PictureTextContent.ts +8 -17
  187. package/src/components/ProductBlock/ProductBlock.fixture.mobile.tsx +3 -3
  188. package/src/components/ProductBlock/ProductBlock.fixture.tsx +28 -6
  189. package/src/components/ProductBlock/ProductBlockContent.ts +3 -17
  190. package/src/components/ProductBlock/ProductBlockInner.mobile.tsx +1 -5
  191. package/src/components/ProductBlock/ProductBlockInner.tsx +1 -3
  192. package/src/components/ProductBlock/renderBenefit.tsx +17 -51
  193. package/src/components/ProductGallery/ProductGallery.tsx +5 -4
  194. package/src/components/ProductTile/ProductTile.tsx +1 -1
  195. package/src/components/PromoTile/PromoTile.tsx +1 -1
  196. package/src/components/Recommendation/RecommendationCard.tsx +1 -1
  197. package/src/components/StepsBlock/StepsBlockStyleMaps.ts +1 -1
  198. package/src/components/__snapshots__/Blocks.spec.tsx.snap +15 -30
  199. package/src/ui-kit/BenefitItem/BenefitItem.tsx +58 -0
  200. package/src/ui-kit/BenefitItem/BenefitItemProps.ts +27 -0
  201. package/src/ui-kit/Foldable/Foldable.tsx +1 -1
  202. package/dist/components/Insurance/Insurance.d.ts +0 -5
  203. package/dist/components/Insurance/Insurance.js +0 -24
  204. package/dist/components/Insurance/Insurance.js.map +0 -1
  205. package/dist/components/Insurance/InsuranceContent.d.ts +0 -27
  206. package/dist/components/Insurance/InsuranceContent.js.map +0 -1
  207. package/dist/components/ProductBlock/renderBenefit.mobile.d.ts +0 -3
  208. package/dist/components/ProductBlock/renderBenefit.mobile.js +0 -25
  209. package/dist/components/ProductBlock/renderBenefit.mobile.js.map +0 -1
  210. package/lib/components/Insurance/Insurance.d.ts +0 -5
  211. package/lib/components/Insurance/Insurance.fixture.d.ts +0 -6
  212. package/lib/components/Insurance/Insurance.js +0 -22
  213. package/lib/components/Insurance/Insurance.js.map +0 -1
  214. package/lib/components/Insurance/InsuranceContent.d.ts +0 -27
  215. package/lib/components/Insurance/InsuranceContent.js +0 -2
  216. package/lib/components/Insurance/InsuranceContent.js.map +0 -1
  217. package/lib/components/ProductBlock/renderBenefit.mobile.d.ts +0 -3
  218. package/lib/components/ProductBlock/renderBenefit.mobile.js +0 -22
  219. package/lib/components/ProductBlock/renderBenefit.mobile.js.map +0 -1
  220. package/mobile/dist/components/Insurance/Insurance.d.ts +0 -5
  221. package/mobile/dist/components/Insurance/Insurance.js +0 -24
  222. package/mobile/dist/components/Insurance/Insurance.js.map +0 -1
  223. package/mobile/dist/components/Insurance/InsuranceContent.d.ts +0 -27
  224. package/mobile/dist/components/Insurance/InsuranceContent.js.map +0 -1
  225. package/mobile/lib/components/Insurance/Insurance.d.ts +0 -5
  226. package/mobile/lib/components/Insurance/Insurance.js +0 -22
  227. package/mobile/lib/components/Insurance/Insurance.js.map +0 -1
  228. package/mobile/lib/components/Insurance/InsuranceContent.d.ts +0 -27
  229. package/mobile/lib/components/Insurance/InsuranceContent.js +0 -2
  230. package/mobile/lib/components/Insurance/InsuranceContent.js.map +0 -1
  231. package/mobile/src/components/Insurance/Insurance.example.json +0 -29
  232. package/mobile/src/components/Insurance/Insurance.tsx +0 -83
  233. package/mobile/src/components/Insurance/InsuranceContent.ts +0 -29
  234. package/src/components/Insurance/Insurance.example.json +0 -29
  235. package/src/components/Insurance/Insurance.fixture.tsx +0 -70
  236. package/src/components/Insurance/Insurance.tsx +0 -83
  237. package/src/components/Insurance/InsuranceContent.ts +0 -29
  238. package/src/components/ProductBlock/renderBenefit.mobile.tsx +0 -44
@@ -1,21 +1,39 @@
1
1
  import { context } from '../../react/setup-fixture';
2
-
3
2
  import type { Picture } from '../../model/Picture';
4
- import { PictureText } from './PictureText';
5
3
  import type { PictureTextContent } from './PictureTextContent';
4
+ import { PictureText } from './PictureText';
6
5
 
7
6
  const image: Picture = {
8
7
  src: 'legal-support-business.png',
9
8
  format: 'webp',
10
9
  size: {
11
- width: 200,
12
- height: 200,
10
+ width: 400,
11
+ height: 300,
13
12
  },
14
13
  alt: 'Варианты потребительского кредита',
15
14
  };
16
15
 
16
+ const imageInsurance: Picture = {
17
+ src: 'insurance.png',
18
+ format: 'webp',
19
+ alt: 'Страховые риски и продукты',
20
+ size: {
21
+ width: 400,
22
+ height: 300,
23
+ },
24
+ sources: [
25
+ {
26
+ src: 'insurance.png 1x, insurance-2x.png 2x',
27
+ format: 'png',
28
+ },
29
+ ],
30
+ };
31
+
17
32
  export const PICTURE_TEXT: PictureTextContent = {
18
- title: 'Варианты потребительского кредита',
33
+ title: 'Обменивайте бонусы на путешествия',
34
+ description:
35
+ 'Получайте 1% бонусными баллами с любых покупок и 1,5% баллами с покупок в категории «Путешествия». Обменивайте ' +
36
+ 'бонусные баллы на авиа и ж/д билеты, бронирование отелей и прокат автомобилей.',
19
37
  benefits: [
20
38
  {
21
39
  label: 'Кредит по одному документу',
@@ -31,10 +49,61 @@ export const PICTURE_TEXT: PictureTextContent = {
31
49
  image,
32
50
  };
33
51
 
52
+ export const INSURANCE_TEXT: PictureTextContent = {
53
+ title: 'Страховые риски и продукты',
54
+ description: 'Покрываемые риски программы «Защита вас и ваших близких»',
55
+ benefits: [
56
+ {
57
+ label: 'Телесное повреждение',
58
+ description: 'Описание',
59
+ icon: { icon: 'ShieldTickIcon' },
60
+ },
61
+ {
62
+ label: 'Госпитализация застрахованного',
63
+ icon: { icon: 'ShieldTickIcon' },
64
+ },
65
+ {
66
+ label: 'Сокращение численности работников организации',
67
+ icon: { icon: 'ShieldTickIcon' },
68
+ },
69
+ {
70
+ label: 'Смерть застрахованного',
71
+ icon: { icon: 'ShieldTickIcon' },
72
+ },
73
+ ],
74
+ image: imageInsurance,
75
+ sum: 500000,
76
+ };
77
+
34
78
  export default {
35
79
  default: (
36
80
  <div className="container grid grid-cols-12">
37
81
  <PictureText className="col-span-12" context={context} {...PICTURE_TEXT} />
38
82
  </div>
39
83
  ),
84
+ secondary: (
85
+ <div className="container grid grid-cols-12">
86
+ <PictureText
87
+ className="col-span-12"
88
+ context={context}
89
+ {...PICTURE_TEXT}
90
+ version="secondary"
91
+ />
92
+ </div>
93
+ ),
94
+ 'insurance sum': (
95
+ <div className="container grid grid-cols-12">
96
+ <PictureText context={context} className="col-span-12" {...INSURANCE_TEXT} />
97
+ </div>
98
+ ),
99
+ 'insurance monthPay': (
100
+ <div className="container grid grid-cols-12">
101
+ <PictureText
102
+ context={context}
103
+ className="col-span-12"
104
+ {...INSURANCE_TEXT}
105
+ monthLimit={25000}
106
+ />
107
+ </div>
108
+ ),
40
109
  };
@@ -1,11 +1,13 @@
1
1
  import { JSX } from '@redneckz/uni-jsx';
2
2
  import type { UniBlockProps } from '../../types';
3
- import type { PictureTextBenefit, PictureTextContent } from './PictureTextContent';
4
-
5
- import { BlockVersion } from '../../model/BlockVersion';
3
+ import type { PictureTextContent } from './PictureTextContent';
4
+ import type { BlockVersion } from '../../model/BlockVersion';
5
+ import type { BenefitItemProps } from '../../ui-kit/BenefitItem/BenefitItemProps';
6
6
  import { BlockWrapper } from '../../ui-kit/BlockWrapper';
7
- import { Heading } from '../../ui-kit/Heading/Heading';
8
7
  import { Img } from '../../ui-kit/Img/Img';
8
+ import { BenefitItem } from '../../ui-kit/BenefitItem/BenefitItem';
9
+ import { Headline } from '../Headline/Headline';
10
+ import { addSpacesBetweenNumbers } from '../../utils/addSpacesBetweenNumbers';
9
11
 
10
12
  export interface PictureTextProps extends PictureTextContent, UniBlockProps {}
11
13
 
@@ -17,56 +19,75 @@ const pictureTextStyleMap: Record<BlockVersion, string> = {
17
19
  export const PictureText = JSX<PictureTextProps>(
18
20
  ({
19
21
  className = '',
22
+ context,
20
23
  title,
24
+ description,
21
25
  image,
22
26
  benefits,
23
27
  version = 'primary',
28
+ sum,
29
+ monthLimit,
24
30
  directionRight = false,
25
31
  ...rest
26
32
  }) => {
27
33
  return (
28
34
  <BlockWrapper
29
35
  className={`relative font-sans p-14 ${pictureTextStyleMap[version]} ${className}`}
36
+ context={context}
30
37
  {...rest}
31
38
  >
32
- <Heading headingType="h2" className="text-center" title={title} />
33
- <div className={'flex justify-center mt-9'}>
39
+ <Headline
40
+ context={context}
41
+ className="!p-0"
42
+ title={title}
43
+ description={description}
44
+ headlineVersion="M"
45
+ bgColorHeadline={version}
46
+ align="center"
47
+ />
48
+ <div className={'flex justify-center gap-[122px] mt-[30px]'}>
34
49
  {image?.src && <Img className={directionRight ? 'order-2 ml-6' : 'mr-6'} image={image} />}
35
- {benefits?.length ? (
36
- <div className="flex flex-col">
37
- {benefits.map((_, i) => renderBenefit(_, i, version))}
38
- </div>
39
- ) : null}
50
+ <div className="w-[558px] m-auto">
51
+ {benefits?.length ? (
52
+ <div className="flex flex-col gap-4">{benefits.map(renderBenefit(version))}</div>
53
+ ) : null}
54
+ {renderInsuranceSumMonth(sum, monthLimit)}
55
+ </div>
40
56
  </div>
41
57
  </BlockWrapper>
42
58
  );
43
59
  },
44
60
  );
45
61
 
46
- function renderBenefit(benefit: PictureTextBenefit, i: number, version: string) {
62
+ const renderBenefit = (version: BlockVersion) => (benefit: BenefitItemProps, i: number) =>
63
+ (
64
+ <BenefitItem
65
+ key={String(i)}
66
+ icon={benefit.icon}
67
+ label={benefit.label}
68
+ description={benefit.description}
69
+ version={version}
70
+ />
71
+ );
72
+
73
+ function renderInsuranceSumMonth(sum?: number, monthLimit?: number) {
74
+ return sum || monthLimit ? (
75
+ <div className="bg-main-divider rounded-md flex mt-7 gap-6 px-5 py-4">
76
+ {Number.isFinite(sum) ? renderValueBlock('Страховая сумма:', sum, Boolean(monthLimit)) : null}
77
+ {Number.isFinite(monthLimit)
78
+ ? renderValueBlock('Ежемесячный лимит:', monthLimit, Boolean(sum))
79
+ : null}
80
+ </div>
81
+ ) : null;
82
+ }
83
+
84
+ function renderValueBlock(title: string, sum = 0, isAnotherBlock = false) {
85
+ const widthStyle = isAnotherBlock ? 'w-fit' : 'w-full';
86
+
47
87
  return (
48
- <div key={String(i)} className="flex flex-row mb-8">
49
- {benefit.icon ? (
50
- <Img
51
- className="w-[48px] h-[48px] bg-main rounded-full box-border p-[12px]"
52
- image={benefit.icon}
53
- width="48"
54
- height="48"
55
- asSVG
56
- />
57
- ) : null}
58
- <div className="flex gap-1 flex-col h-full ml-5 max-w-[490px]">
59
- {benefit?.label ? (
60
- <div className={`text-xl m-0 ${version === 'primary' ? 'text-primary-text' : ''}`}>
61
- {benefit.label}
62
- </div>
63
- ) : null}
64
- {benefit?.description ? (
65
- <div className={`text-s ${version === 'primary' ? 'text-secondary-text' : ''}`}>
66
- {benefit.description}
67
- </div>
68
- ) : null}
69
- </div>
88
+ <div className={`flex justify-between items-center gap-2 w-full ${widthStyle}`}>
89
+ <span className="text-secondary-text text-l-light">{title}</span>
90
+ <span className="text-primary-main text-h6">{addSpacesBetweenNumbers(sum)} ₽</span>
70
91
  </div>
71
92
  );
72
93
  }
@@ -1,29 +1,20 @@
1
- import { BlockVersion } from '../../model/BlockVersion';
2
- import type { TitleProp } from '../../model/HeadlineType';
3
1
  import type { ImageContent } from '../../ui-kit/Img/ImgProps';
4
- import type { Picture } from '../../model/Picture';
2
+ import type { BenefitsProps } from '../../ui-kit/BenefitItem/BenefitItemProps';
3
+ import type { HeadlineCommonProps } from '../../model/HeadlineType';
5
4
 
6
- export type TitleWithImageContent = TitleProp & ImageContent;
7
-
8
- export interface PictureTextBenefit {
9
- /** @title Иконка */
10
- icon?: Picture;
11
- /** @title Название */
12
- label?: string;
13
- /** @title Описание */
14
- description?: string;
15
- }
5
+ export type TitleWithImageContent = HeadlineCommonProps & ImageContent;
16
6
 
17
7
  /**
18
8
  * @title Картинка с текстом
19
9
  */
20
- export interface PictureTextContent extends TitleWithImageContent {
21
- version?: BlockVersion;
22
- /** @title Список преимуществ */
23
- benefits?: PictureTextBenefit[];
10
+ export interface PictureTextContent extends BenefitsProps, TitleWithImageContent {
24
11
  /**
25
12
  * @title Картинка справа/текст слева
26
13
  * @default false
27
14
  */
28
15
  directionRight?: boolean;
16
+ /** @title Ежемесячный лимит */
17
+ monthLimit?: number;
18
+ /** @title Страховая сумма */
19
+ sum?: number;
29
20
  }
@@ -1,8 +1,8 @@
1
- import type { Picture } from '../../model/Picture';
2
1
  import { context } from '../../react/setup-fixture';
3
2
  import { ProductBlock } from './ProductBlock';
3
+ import type { Picture } from '../../model/Picture';
4
4
  import type { ButtonWithIconProps } from '../../ui-kit/Button/ButtonProps';
5
- import type { ProductBlockBenefit } from './ProductBlockContent';
5
+ import type { BenefitItemProps } from '../../ui-kit/BenefitItem/BenefitItemProps';
6
6
 
7
7
  const title = 'Кредит до 5 000 000 Р\nбез залога и поручителей';
8
8
  const description =
@@ -25,7 +25,7 @@ const image: Picture = {
25
25
  ],
26
26
  };
27
27
 
28
- const benefits: ProductBlockBenefit[] = [
28
+ const benefits: BenefitItemProps[] = [
29
29
  {
30
30
  label: 'До 5 млн ₽',
31
31
  description: 'Кредитный лимит',
@@ -1,8 +1,9 @@
1
- import type { Picture } from '../../model/Picture';
2
1
  import { context } from '../../react/setup-fixture';
3
- import type { BackwardButtonProps, ButtonWithIconProps } from '../../ui-kit/Button/ButtonProps';
4
2
  import { ProductBlock } from './ProductBlock';
5
- import type { ProductBlockBenefit, ProductBlockContent } from './ProductBlockContent';
3
+ import type { Picture } from '../../model/Picture';
4
+ import type { BackwardButtonProps, ButtonWithIconProps } from '../../ui-kit/Button/ButtonProps';
5
+ import type { ProductBlockContent } from './ProductBlockContent';
6
+ import type { BenefitItemProps } from '../../ui-kit/BenefitItem/BenefitItemProps';
6
7
 
7
8
  const image: Picture = {
8
9
  src: 'money-1.png',
@@ -14,7 +15,7 @@ const image: Picture = {
14
15
  },
15
16
  };
16
17
 
17
- const benefits: ProductBlockBenefit[] = [
18
+ const benefits: BenefitItemProps[] = [
18
19
  {
19
20
  label: 'До 5 млн ₽',
20
21
  description: 'Кредитный лимит',
@@ -81,14 +82,35 @@ export default {
81
82
  <ProductBlock
82
83
  className="col-span-12"
83
84
  context={context}
84
- backwardButton={backwardButton}
85
- headlineVersion="XL"
85
+ headlineVersion="L"
86
86
  title="Потребительский кредит наличными"
87
87
  description="Кредит наличными без залога и поручительства. Потребительский кредит на любые цели. Нужен только паспорт."
88
88
  benefits={benefits}
89
+ benefitsVersion="normal"
89
90
  buttons={buttons}
90
91
  image={image}
91
92
  />
93
+ <ProductBlock
94
+ className="col-span-12"
95
+ context={context}
96
+ title="Потребительский кредит наличными"
97
+ headlineVersion="L"
98
+ description="Кредит наличными без залога и поручительства. Потребительский кредит на любые цели. Нужен только паспорт."
99
+ benefits={benefits}
100
+ benefitsVersion="white"
101
+ image={image}
102
+ />
103
+ <ProductBlock
104
+ className="col-span-12"
105
+ context={context}
106
+ title="Потребительский кредит наличными"
107
+ headlineVersion="L"
108
+ description="Кредит наличными без залога и поручительства. Потребительский кредит на любые цели. Нужен только паспорт."
109
+ benefits={benefits}
110
+ benefitsVersion="white"
111
+ image={image}
112
+ version="secondary"
113
+ />
92
114
  </div>
93
115
  ),
94
116
  'primary with color benefits': (
@@ -4,33 +4,19 @@ import type { LinkProps } from '../../model/LinkProps';
4
4
  import type { ButtonContent, BackwardButtonProps } from '../../ui-kit/Button/ButtonProps';
5
5
  import type { ImageContent } from '../../ui-kit/Img/ImgProps';
6
6
  import type { ListContent } from '../../ui-kit/List/ListContent';
7
- import type { Picture } from '../../model/Picture';
8
7
  import type { HeadlineProps } from '../../model/HeadlineType';
9
-
10
- export interface ProductBlockBenefit {
11
- icon?: Picture;
12
- /** @title Название */
13
- label?: string;
14
- /** @title Описание */
15
- description?: string;
16
- }
17
-
18
- export type BenefitItemProps = {
19
- benefit: ProductBlockBenefit;
20
- version?: BlockVersion;
21
- benefitsVersion?: IconVersion;
22
- };
8
+ import type { BenefitItemProps } from '../../ui-kit/BenefitItem/BenefitItemProps';
23
9
 
24
10
  export type ProductBlockInnerContent = HeadlineProps &
25
11
  ListContent &
26
12
  ButtonContent &
27
13
  ImageContent & {
28
14
  /**
29
- * @title Преимущества
15
+ * @title Список преимуществ
30
16
  * @minItems 2
31
17
  * @maxItems 3
32
18
  */
33
- benefits?: ProductBlockBenefit[];
19
+ benefits?: BenefitItemProps[];
34
20
  benefitsVersion?: IconVersion;
35
21
  version?: BlockVersion;
36
22
  /**
@@ -52,11 +52,7 @@ export const ProductBlockInner = JSX<ProductBlockInnerProps>(
52
52
  }
53
53
  >
54
54
  {benefits?.filter((_) => _.label)?.length ? (
55
- <div className="mt-3">
56
- {benefits.map((benefit, i) =>
57
- renderBenefit({ benefit, version, benefitsVersion }, i),
58
- )}
59
- </div>
55
+ <div className="mt-3">{benefits.map(renderBenefit(version, benefitsVersion))}</div>
60
56
  ) : null}
61
57
  {items?.length ? (
62
58
  <List className="mt-3 text-m" items={items} version={version} isDotted={isDotted} />
@@ -41,9 +41,7 @@ export const ProductBlockInner = JSX<ProductBlockInnerProps>(
41
41
  <BaseTile context={context} buttons={getButtons(context, buttons)}>
42
42
  {benefits?.filter((_) => _.label)?.length ? (
43
43
  <div className="flex gap-6 mt-6">
44
- {benefits.map((benefit, i) =>
45
- renderBenefit({ benefit, version, benefitsVersion }, i),
46
- )}
44
+ {benefits.map(renderBenefit(version, benefitsVersion))}
47
45
  </div>
48
46
  ) : null}
49
47
  {items?.length ? (
@@ -1,53 +1,19 @@
1
1
  import type { BlockVersion } from '../../model/BlockVersion';
2
- import { Img } from '../../ui-kit/Img/Img';
3
- import { BenefitItemProps } from './ProductBlockContent';
2
+ import type { BenefitItemProps } from '../../ui-kit/BenefitItem/BenefitItemProps';
3
+ import type { IconVersion } from '../../model/IconVersion';
4
+ import { BenefitItem } from '../../ui-kit/BenefitItem/BenefitItem';
4
5
 
5
- const benefitTitleStyleMap: Record<BlockVersion, string> = {
6
- primary: 'text-primary-text',
7
- secondary: 'text-white',
8
- };
9
- const benefitDescStyleMap: Record<BlockVersion, string> = {
10
- primary: 'text-secondary-text',
11
- secondary: 'text-white',
12
- };
13
-
14
- export function renderBenefit(
15
- { benefit, version = 'primary', benefitsVersion = 'normal' }: BenefitItemProps,
16
- i: number,
17
- ) {
18
- const isIconWhite = benefitsVersion === 'white' || version === 'secondary';
19
-
20
- return (
21
- <div key={String(i)} className="flex gap-4 items-center">
22
- {benefit.icon ? (
23
- <Img
24
- className={renderBenefitIconBgStyle(version, benefitsVersion)}
25
- image={{ ...benefit?.icon, iconVersion: isIconWhite ? 'white' : 'normal' }}
26
- width="24"
27
- height="24"
28
- asSVG
29
- />
30
- ) : null}
31
- <div className="flex gap-0.5 flex-col h-full max-w-[149px] min-w-[149px]">
32
- <div className={`text-h6 m-0 ${benefitTitleStyleMap[version]}`}>{benefit.label}</div>
33
- {benefit.description ? (
34
- <div className={`text-m-light ${benefitDescStyleMap[version]}`}>
35
- {benefit.description}
36
- </div>
37
- ) : null}
38
- </div>
39
- </div>
40
- );
41
- }
42
-
43
- function renderBenefitIconBgStyle(version, benefitsVersion) {
44
- let bgColorStyle = 'bg-primary-main text-black';
45
-
46
- if (version === 'secondary') {
47
- bgColorStyle = 'bg-white/30 text-black';
48
- } else if (benefitsVersion === 'normal') {
49
- bgColorStyle = 'bg-secondary-light text-primary-main';
50
- }
51
-
52
- return `w-[50px] h-[50px] min-w-[50px] min-h-[50px] rounded-full p-[10px] box-border ${bgColorStyle}`;
53
- }
6
+ export const renderBenefit =
7
+ (version: BlockVersion = 'primary', benefitsVersion: IconVersion = 'normal') =>
8
+ ({ icon, label, description }: BenefitItemProps, i: number) => {
9
+ return (
10
+ <BenefitItem
11
+ key={String(i)}
12
+ icon={icon}
13
+ label={label}
14
+ description={description}
15
+ version={version}
16
+ benefitsVersion={benefitsVersion}
17
+ />
18
+ );
19
+ };
@@ -50,7 +50,7 @@ export const ProductGallery = JSX<ProductGalleryProps>(
50
50
  {galleryBlocks.map((_, i) => renderProductBlock({ ..._, version }, i, context))}
51
51
  </div>
52
52
 
53
- <div className="flex items-center absolute bottom-6 left-0 right-0 px-[26px] box-border">
53
+ <div className="flex items-center absolute bottom-6 left-0 right-0 px-[26px] box-border h-28">
54
54
  {galleryNav.map((slide, i) =>
55
55
  renderNavButton({
56
56
  slide,
@@ -82,6 +82,7 @@ function renderProductBlock(block: ProductBlockInnerContent, i: number, context)
82
82
  context={context}
83
83
  textBlockClassName="mb-[154px]"
84
84
  {...block}
85
+ headlineVersion="XXL"
85
86
  />
86
87
  </div>
87
88
  </section>
@@ -92,8 +93,8 @@ function renderNavButton({ slide, i, activeSlideIndex, onClick, version }) {
92
93
  const isActiveBtn = i === activeSlideIndex;
93
94
 
94
95
  const btnClassName = isActiveBtn
95
- ? 'bg-white shadow-dark-blue/42 h-[102px] w-[354px] min-w-[354px] p-0 border-none'
96
- : `min-w-[277px] px-0 pt-4 pb-[23px] hover:py-[26px] hover:py-[26px] ease-in duration-300 bg-white/10
96
+ ? 'bg-white shadow-dark-blue/42 w-[354px] min-w-[354px] border-none'
97
+ : `min-w-[277px] hover:py-[26px] hover:py-[26px] ease-in duration-300 bg-white/10
97
98
  ${productSlideStyleMap[version]}`;
98
99
  const btnTitleClassName = isActiveBtn
99
100
  ? 'text-primary-text text-h6'
@@ -110,7 +111,7 @@ function renderNavButton({ slide, i, activeSlideIndex, onClick, version }) {
110
111
  key={String(i)}
111
112
  onClick={onClick}
112
113
  aria-label={slide?.title}
113
- className={`box-border font-sans relative overflow-hidden border border-white/50 cursor-pointer text-left mx-1 grow basis-0
114
+ className={`box-border font-sans relative overflow-hidden border border-white/50 cursor-pointer text-left mx-1 grow basis-0 pt-5 pb-[23px]
114
115
  ${btnClassName} ${additionalBorder}
115
116
  `}
116
117
  >
@@ -69,7 +69,7 @@ export const ProductTile = JSX<ProductTileProps>(
69
69
 
70
70
  function renderBenefits(benefits: TextBenefit[], version: BlockVersion) {
71
71
  return (
72
- <div className="flex mt-4">
72
+ <div className="flex mt-3.5">
73
73
  {benefits.length ? (
74
74
  <div className="mr-6 gap-2.5 text-h6">{benefits.map(renderBenefitLabel)}</div>
75
75
  ) : null}
@@ -55,7 +55,7 @@ export const PromoTile = JSX<PromoTileProps>(
55
55
  }
56
56
  buttons={
57
57
  buttons?.length ? (
58
- <ButtonSection context={context} buttons={buttons} className="flex mt-9 gap-3" />
58
+ <ButtonSection context={context} buttons={buttons} className="flex gap-3" />
59
59
  ) : null
60
60
  }
61
61
  >
@@ -1,5 +1,5 @@
1
1
  import { JSX } from '@redneckz/uni-jsx';
2
- import { BlockVersion } from '../../model/BlockVersion';
2
+ import type { BlockVersion } from '../../model/BlockVersion';
3
3
  import type { UniBlockProps } from '../../types';
4
4
  import { Description } from '../../ui-kit/Description/Description';
5
5
  import { Heading } from '../../ui-kit/Heading/Heading';
@@ -1,4 +1,4 @@
1
- import { BlockVersion } from '../../model/BlockVersion';
1
+ import type { BlockVersion } from '../../model/BlockVersion';
2
2
 
3
3
  export type StyleType = {
4
4
  background: string;
@@ -109,7 +109,7 @@ exports[`Blocks ExchangeRateTile should render block "ExchangeRateTile" without
109
109
  class="flex grow w-full justify-between"
110
110
  >
111
111
  <div
112
- class="flex flex-col justify-between w-full"
112
+ class="flex flex-col w-full"
113
113
  >
114
114
  <div>
115
115
  <div
@@ -522,25 +522,6 @@ exports[`Blocks Headline should render block "Headline" without content 1`] = `
522
522
  />
523
523
  `;
524
524
 
525
- exports[`Blocks Insurance should render block "Insurance" without content 1`] = `
526
- <section
527
- class="px-[100px] py-[50px] bg-white text-primary-text font-sans "
528
- >
529
- <section
530
- class="font-sans flex flex-col p-[50px] gap-3 bg-transparent !p-0"
531
- />
532
- <div>
533
- <div
534
- class="mx-auto flex justify-center gap-[122px] mt-[30px]"
535
- >
536
- <div
537
- class="w-[558px] m-auto"
538
- />
539
- </div>
540
- </div>
541
- </section>
542
- `;
543
-
544
525
  exports[`Blocks InsuranceAmountBlock should render block "InsuranceAmountBlock" without content 1`] = `
545
526
  <section
546
527
  class="box-border py-[50px] overflow-hidden relative font-sans w-100 bg-white "
@@ -610,7 +591,7 @@ exports[`Blocks MobileAppTile should render block "MobileAppTile" without conten
610
591
  class="flex grow w-full justify-between"
611
592
  >
612
593
  <div
613
- class="flex flex-col justify-between w-full"
594
+ class="flex flex-col w-full"
614
595
  >
615
596
  <div>
616
597
  <div
@@ -655,12 +636,16 @@ exports[`Blocks PictureText should render block "PictureText" without content 1`
655
636
  <section
656
637
  class="relative font-sans p-14 bg-white text-primary-text "
657
638
  >
658
- <h3
659
- class="font-sans m-0 text-h2 text-center"
639
+ <section
640
+ class="font-sans flex flex-col p-[50px] gap-3 bg-white !p-0"
660
641
  />
661
642
  <div
662
- class="flex justify-center mt-9"
663
- />
643
+ class="flex justify-center gap-[122px] mt-[30px]"
644
+ >
645
+ <div
646
+ class="w-[558px] m-auto"
647
+ />
648
+ </div>
664
649
  </section>
665
650
  `;
666
651
 
@@ -721,7 +706,7 @@ exports[`Blocks ProductBlock should render block "ProductBlock" without content
721
706
  class="flex grow w-full justify-between"
722
707
  >
723
708
  <div
724
- class="flex flex-col justify-between w-full"
709
+ class="flex flex-col w-full"
725
710
  >
726
711
  <div />
727
712
  </div>
@@ -743,7 +728,7 @@ exports[`Blocks ProductGallery should render block "ProductGallery" without cont
743
728
  style="transform: translateX(-000%);"
744
729
  />
745
730
  <div
746
- class="flex items-center absolute bottom-6 left-0 right-0 px-[26px] box-border"
731
+ class="flex items-center absolute bottom-6 left-0 right-0 px-[26px] box-border h-28"
747
732
  />
748
733
  </section>
749
734
  `;
@@ -759,7 +744,7 @@ exports[`Blocks ProductTile should render block "ProductTile" without content 1`
759
744
  class="font-sans flex flex-col p-[50px] gap-2 bg-white !p-0"
760
745
  />
761
746
  <div
762
- class="flex mt-4"
747
+ class="flex mt-3.5"
763
748
  />
764
749
  </div>
765
750
  </section>
@@ -787,7 +772,7 @@ exports[`Blocks PromoTile should render block "PromoTile" without content 1`] =
787
772
  class="flex grow w-full justify-between"
788
773
  >
789
774
  <div
790
- class="flex flex-col justify-between w-full"
775
+ class="flex flex-col w-full"
791
776
  >
792
777
  <div>
793
778
  <div
@@ -1203,7 +1188,7 @@ exports[`Blocks Tile should render block "Tile" without content 1`] = `
1203
1188
  class="flex grow w-full justify-between"
1204
1189
  >
1205
1190
  <div
1206
- class="flex flex-col justify-between w-full"
1191
+ class="flex flex-col w-full"
1207
1192
  >
1208
1193
  <div />
1209
1194
  </div>