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

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 (295) hide show
  1. package/bundle/blocks.schema.json +1 -1
  2. package/bundle/bundle.umd.js +165 -112
  3. package/bundle/bundle.umd.min.js +1 -1
  4. package/dist/api/LikeAPI.js +1 -0
  5. package/dist/api/LikeAPI.js.map +1 -1
  6. package/dist/components/Accordion/AccordionBlocks.d.ts +1 -2
  7. package/dist/components/Accordion/AccordionBlocks.js +2 -2
  8. package/dist/components/Accordion/AccordionBlocks.js.map +1 -1
  9. package/dist/components/Accordion/AccordionContent.d.ts +38 -14
  10. package/dist/components/Accordion/AccordionItem.js +9 -10
  11. package/dist/components/Accordion/AccordionItem.js.map +1 -1
  12. package/dist/components/BaseTile/BaseTile.js +7 -2
  13. package/dist/components/BaseTile/BaseTile.js.map +1 -1
  14. package/dist/components/Blocks.js +1 -1
  15. package/dist/components/Blocks.js.map +1 -1
  16. package/dist/components/ComparisonTable/ComparisonTable.js +11 -6
  17. package/dist/components/ComparisonTable/ComparisonTable.js.map +1 -1
  18. package/dist/components/ComparisonTable/HeaderCell.js +1 -1
  19. package/dist/components/ComparisonTable/HeaderCell.js.map +1 -1
  20. package/dist/components/ContentPage/ContentPage.d.ts +9 -1
  21. package/dist/components/ContentPage/ContentPage.js +20 -17
  22. package/dist/components/ContentPage/ContentPage.js.map +1 -1
  23. package/dist/components/ContentPage/ContentPageHead.d.ts +1 -1
  24. package/dist/components/ContentPage/toMobilePage.js +13 -2
  25. package/dist/components/ContentPage/toMobilePage.js.map +1 -1
  26. package/dist/components/CreditCalculator/CreditCalculator.js +3 -3
  27. package/dist/components/CreditCalculator/CreditCalculator.js.map +1 -1
  28. package/dist/components/Footer/Contacts.js +1 -1
  29. package/dist/components/Footer/Contacts.js.map +1 -1
  30. package/dist/components/Footer/Footer.js +1 -1
  31. package/dist/components/Footer/Footer.js.map +1 -1
  32. package/dist/components/Footer/FooterContent.d.ts +1 -2
  33. package/dist/components/Footer/HorizontalNavigation.js +1 -1
  34. package/dist/components/Footer/Sitemap.js +1 -1
  35. package/dist/components/Footer/Sitemap.js.map +1 -1
  36. package/dist/components/Footer/SocialMedia.js +1 -2
  37. package/dist/components/Footer/SocialMedia.js.map +1 -1
  38. package/dist/components/Gallery/Gallery.mobile.js +1 -1
  39. package/dist/components/Gallery/Gallery.mobile.js.map +1 -1
  40. package/dist/components/Gallery/GalleryCardInner.d.ts +2 -0
  41. package/dist/components/Gallery/GalleryCardInner.js +19 -0
  42. package/dist/components/Gallery/GalleryCardInner.js.map +1 -0
  43. package/dist/components/Gallery/GalleryContainer.d.ts +13 -0
  44. package/dist/components/Gallery/GalleryContainer.js +16 -0
  45. package/dist/components/Gallery/GalleryContainer.js.map +1 -0
  46. package/dist/components/Gallery/GalleryContent.d.ts +8 -2
  47. package/dist/components/Gallery/GalleryInner.d.ts +1 -1
  48. package/dist/components/Gallery/GalleryInner.js +8 -36
  49. package/dist/components/Gallery/GalleryInner.js.map +1 -1
  50. package/dist/components/Gallery/constants.d.ts +6 -0
  51. package/dist/components/Gallery/constants.js +19 -0
  52. package/dist/components/Gallery/constants.js.map +1 -0
  53. package/dist/components/Header/Header.js +3 -3
  54. package/dist/components/Header/Header.js.map +1 -1
  55. package/dist/components/LinkDocs/LinkDocs.js +5 -5
  56. package/dist/components/LinkDocs/LinkDocs.js.map +1 -1
  57. package/dist/components/MiniGallery/MiniGalleryContent.d.ts +1 -2
  58. package/dist/components/MobileBlocks.js +0 -3
  59. package/dist/components/MobileBlocks.js.map +1 -1
  60. package/dist/components/PictureText/PictureTextContent.d.ts +1 -3
  61. package/dist/components/Placeholder/Placeholder.js.map +1 -1
  62. package/dist/components/ProductBlock/ProductBlock.js +1 -1
  63. package/dist/components/ProductBlock/ProductBlock.js.map +1 -1
  64. package/dist/components/ProductBlock/ProductBlock.mobile.js +3 -1
  65. package/dist/components/ProductBlock/ProductBlock.mobile.js.map +1 -1
  66. package/dist/components/ProductBlock/ProductBlockInner.js +2 -5
  67. package/dist/components/ProductBlock/ProductBlockInner.js.map +1 -1
  68. package/dist/components/ProductGallery/ProductGallery.js +2 -2
  69. package/dist/components/ProductGallery/ProductGallery.js.map +1 -1
  70. package/dist/components/PromoTile/PromoTile.d.ts +1 -1
  71. package/dist/components/PromoTile/PromoTile.js +1 -1
  72. package/dist/components/PromoTile/PromoTile.js.map +1 -1
  73. package/dist/components/TariffsTable/TariffsTable.js +8 -3
  74. package/dist/components/TariffsTable/TariffsTable.js.map +1 -1
  75. package/dist/components/TariffsTable/TariffsTableCell.js +3 -3
  76. package/dist/components/TariffsTable/TariffsTableCell.js.map +1 -1
  77. package/dist/components/TariffsTable/TariffsTableContent.d.ts +5 -1
  78. package/dist/components/TextBlock/TextBlockContent.d.ts +1 -2
  79. package/dist/components/Tile/Tile.d.ts +1 -1
  80. package/dist/components/Tile/Tile.js +14 -2
  81. package/dist/components/Tile/Tile.js.map +1 -1
  82. package/dist/content-page-repository/ContentPageRepository.js +1 -0
  83. package/dist/content-page-repository/ContentPageRepository.js.map +1 -1
  84. package/dist/hooks/useComparisonTableScroll.d.ts +6 -1
  85. package/dist/hooks/useComparisonTableScroll.js +1 -1
  86. package/dist/hooks/useComparisonTableScroll.js.map +1 -1
  87. package/dist/hooks/useLink.js +1 -1
  88. package/dist/hooks/useLink.js.map +1 -1
  89. package/dist/types.d.ts +8 -0
  90. package/dist/ui-kit/BlockItem/BlockItem.js +4 -4
  91. package/dist/ui-kit/BlockItem/BlockItem.js.map +1 -1
  92. package/dist/ui-kit/Checkbox/Checkbox.js +2 -2
  93. package/dist/ui-kit/Checkbox/Checkbox.js.map +1 -1
  94. package/dist/ui-kit/InputRange/InputRange.js +2 -1
  95. package/dist/ui-kit/InputRange/InputRange.js.map +1 -1
  96. package/dist/ui-kit/SearchBar.js +2 -1
  97. package/dist/ui-kit/SearchBar.js.map +1 -1
  98. package/lib/api/LikeAPI.js +1 -0
  99. package/lib/api/LikeAPI.js.map +1 -1
  100. package/lib/common.css +1 -1
  101. package/lib/components/Accordion/Accordion.fixture.d.ts +1 -4
  102. package/lib/components/Accordion/AccordionBlocks.d.ts +1 -2
  103. package/lib/components/Accordion/AccordionBlocks.js +1 -2
  104. package/lib/components/Accordion/AccordionBlocks.js.map +1 -1
  105. package/lib/components/Accordion/AccordionContent.d.ts +38 -14
  106. package/lib/components/Accordion/AccordionItem.js +9 -7
  107. package/lib/components/Accordion/AccordionItem.js.map +1 -1
  108. package/lib/components/BaseTile/BaseTile.js +7 -2
  109. package/lib/components/BaseTile/BaseTile.js.map +1 -1
  110. package/lib/components/Blocks.js +1 -1
  111. package/lib/components/Blocks.js.map +1 -1
  112. package/lib/components/ComparisonTable/ComparisonTable.js +11 -6
  113. package/lib/components/ComparisonTable/ComparisonTable.js.map +1 -1
  114. package/lib/components/ComparisonTable/HeaderCell.js +1 -1
  115. package/lib/components/ComparisonTable/HeaderCell.js.map +1 -1
  116. package/lib/components/ContentPage/ContentPage.d.ts +9 -1
  117. package/lib/components/ContentPage/ContentPage.js +20 -17
  118. package/lib/components/ContentPage/ContentPage.js.map +1 -1
  119. package/lib/components/ContentPage/ContentPageHead.d.ts +1 -1
  120. package/lib/components/ContentPage/toMobilePage.js +13 -2
  121. package/lib/components/ContentPage/toMobilePage.js.map +1 -1
  122. package/lib/components/CreditCalculator/CreditCalculator.js +3 -3
  123. package/lib/components/CreditCalculator/CreditCalculator.js.map +1 -1
  124. package/lib/components/Footer/Contacts.js +1 -1
  125. package/lib/components/Footer/Contacts.js.map +1 -1
  126. package/lib/components/Footer/Footer.js +1 -1
  127. package/lib/components/Footer/Footer.js.map +1 -1
  128. package/lib/components/Footer/FooterContent.d.ts +1 -2
  129. package/lib/components/Footer/HorizontalNavigation.js +1 -1
  130. package/lib/components/Footer/Sitemap.js +1 -1
  131. package/lib/components/Footer/Sitemap.js.map +1 -1
  132. package/lib/components/Footer/SocialMedia.js +1 -2
  133. package/lib/components/Footer/SocialMedia.js.map +1 -1
  134. package/lib/components/Gallery/Gallery.mobile.js +1 -1
  135. package/lib/components/Gallery/Gallery.mobile.js.map +1 -1
  136. package/lib/components/Gallery/GalleryCardInner.d.ts +2 -0
  137. package/lib/components/Gallery/GalleryCardInner.js +17 -0
  138. package/lib/components/Gallery/GalleryCardInner.js.map +1 -0
  139. package/lib/components/Gallery/GalleryContainer.d.ts +13 -0
  140. package/lib/components/Gallery/GalleryContainer.js +14 -0
  141. package/lib/components/Gallery/GalleryContainer.js.map +1 -0
  142. package/lib/components/Gallery/GalleryContent.d.ts +8 -2
  143. package/lib/components/Gallery/GalleryInner.d.ts +1 -1
  144. package/lib/components/Gallery/GalleryInner.js +6 -34
  145. package/lib/components/Gallery/GalleryInner.js.map +1 -1
  146. package/lib/components/Gallery/constants.d.ts +6 -0
  147. package/lib/components/Gallery/constants.js +17 -0
  148. package/lib/components/Gallery/constants.js.map +1 -0
  149. package/lib/components/Header/Header.js +3 -3
  150. package/lib/components/Header/Header.js.map +1 -1
  151. package/lib/components/Headline/Headline.fixture.d.ts +3 -2
  152. package/lib/components/LinkDocs/LinkDocs.fixture.d.ts +7 -7
  153. package/lib/components/LinkDocs/LinkDocs.js +5 -5
  154. package/lib/components/LinkDocs/LinkDocs.js.map +1 -1
  155. package/lib/components/MiniGallery/MiniGalleryContent.d.ts +1 -2
  156. package/lib/components/MobileBlocks.js +0 -3
  157. package/lib/components/MobileBlocks.js.map +1 -1
  158. package/lib/components/PictureText/PictureText.fixture.d.ts +2 -0
  159. package/lib/components/PictureText/PictureTextContent.d.ts +1 -3
  160. package/lib/components/Placeholder/Placeholder.js.map +1 -1
  161. package/lib/components/ProductBlock/ProductBlock.js +1 -1
  162. package/lib/components/ProductBlock/ProductBlock.js.map +1 -1
  163. package/lib/components/ProductBlock/ProductBlock.mobile.js +3 -1
  164. package/lib/components/ProductBlock/ProductBlock.mobile.js.map +1 -1
  165. package/lib/components/ProductBlock/ProductBlockInner.js +2 -5
  166. package/lib/components/ProductBlock/ProductBlockInner.js.map +1 -1
  167. package/lib/components/ProductGallery/ProductGallery.js +2 -2
  168. package/lib/components/ProductGallery/ProductGallery.js.map +1 -1
  169. package/lib/components/PromoTile/PromoTile.d.ts +1 -1
  170. package/lib/components/PromoTile/PromoTile.js +1 -1
  171. package/lib/components/PromoTile/PromoTile.js.map +1 -1
  172. package/lib/components/TariffsTable/TariffsTable.js +8 -3
  173. package/lib/components/TariffsTable/TariffsTable.js.map +1 -1
  174. package/lib/components/TariffsTable/TariffsTableCell.js +3 -3
  175. package/lib/components/TariffsTable/TariffsTableCell.js.map +1 -1
  176. package/lib/components/TariffsTable/TariffsTableContent.d.ts +5 -1
  177. package/lib/components/TextBlock/TextBlock.fixture.d.ts +2 -0
  178. package/lib/components/TextBlock/TextBlockContent.d.ts +1 -2
  179. package/lib/components/Tile/Tile.d.ts +1 -1
  180. package/lib/components/Tile/Tile.js +14 -2
  181. package/lib/components/Tile/Tile.js.map +1 -1
  182. package/lib/content-page-repository/ContentPageRepository.js +1 -0
  183. package/lib/content-page-repository/ContentPageRepository.js.map +1 -1
  184. package/lib/hooks/useComparisonTableScroll.d.ts +6 -1
  185. package/lib/hooks/useComparisonTableScroll.js +1 -1
  186. package/lib/hooks/useComparisonTableScroll.js.map +1 -1
  187. package/lib/hooks/useLink.js +1 -1
  188. package/lib/hooks/useLink.js.map +1 -1
  189. package/lib/types.d.ts +8 -0
  190. package/lib/ui-kit/BlockItem/BlockItem.js +4 -4
  191. package/lib/ui-kit/BlockItem/BlockItem.js.map +1 -1
  192. package/lib/ui-kit/Checkbox/Checkbox.js +2 -2
  193. package/lib/ui-kit/Checkbox/Checkbox.js.map +1 -1
  194. package/lib/ui-kit/InputRange/InputRange.js +2 -1
  195. package/lib/ui-kit/InputRange/InputRange.js.map +1 -1
  196. package/lib/ui-kit/SearchBar.js +2 -1
  197. package/lib/ui-kit/SearchBar.js.map +1 -1
  198. package/package.json +19 -8
  199. package/src/api/LikeAPI.ts +1 -0
  200. package/src/components/Accordion/Accordion.example.json +18 -42
  201. package/src/components/Accordion/Accordion.fixture.tsx +33 -119
  202. package/src/components/Accordion/AccordionBlocks.tsx +1 -3
  203. package/src/components/Accordion/AccordionContent.ts +47 -18
  204. package/src/components/Accordion/AccordionItem.tsx +14 -10
  205. package/src/components/BaseTile/BaseTile.tsx +13 -5
  206. package/src/components/BenefitsBlock/BenefitsBlock.fixture.tsx +31 -28
  207. package/src/components/Blocks.ts +1 -1
  208. package/src/components/ComparisonTable/ComparisonTable.fixture.tsx +43 -53
  209. package/src/components/ComparisonTable/ComparisonTable.tsx +8 -8
  210. package/src/components/ComparisonTable/HeaderCell.tsx +3 -3
  211. package/src/components/ContentPage/ContentPage.fixture.tsx +3 -3
  212. package/src/components/ContentPage/ContentPage.page.json +45 -56
  213. package/src/components/ContentPage/ContentPage.tsx +71 -36
  214. package/src/components/ContentPage/ContentPageHead.tsx +1 -1
  215. package/src/components/ContentPage/toMobilePage.ts +19 -2
  216. package/src/components/CreditCalculator/CreditCalculator.fixture.tsx +9 -1
  217. package/src/components/CreditCalculator/CreditCalculator.tsx +12 -9
  218. package/src/components/ExchangeRateTile/ExchangeRateTile.fixture.tsx +1 -1
  219. package/src/components/Footer/Contacts.tsx +1 -1
  220. package/src/components/Footer/Footer.fixture.tsx +265 -258
  221. package/src/components/Footer/Footer.tsx +3 -3
  222. package/src/components/Footer/FooterContent.ts +1 -1
  223. package/src/components/Footer/HorizontalNavigation.tsx +1 -1
  224. package/src/components/Footer/Sitemap.tsx +1 -1
  225. package/src/components/Footer/SocialMedia.tsx +5 -6
  226. package/src/components/Gallery/Gallery.fixture.tsx +52 -48
  227. package/src/components/Gallery/Gallery.mobile.tsx +1 -3
  228. package/src/components/Gallery/GalleryCardInner.tsx +53 -0
  229. package/src/components/Gallery/GalleryContainer.tsx +58 -0
  230. package/src/components/Gallery/GalleryContent.ts +8 -2
  231. package/src/components/Gallery/GalleryInner.tsx +15 -93
  232. package/src/components/Gallery/constants.ts +22 -0
  233. package/src/components/Header/Header.tsx +14 -12
  234. package/src/components/Headline/Headline.fixture.tsx +30 -31
  235. package/src/components/LikeControl/LikeControl.fixture.tsx +5 -1
  236. package/src/components/LinkDocs/LinkDocs.example.json +26 -0
  237. package/src/components/LinkDocs/LinkDocs.fixture.tsx +30 -13
  238. package/src/components/LinkDocs/LinkDocs.tsx +9 -8
  239. package/src/components/MiniGallery/MiniGallery.fixture.tsx +12 -22
  240. package/src/components/MiniGallery/MiniGalleryContent.ts +1 -1
  241. package/src/components/MobileAppTile/MobileAppTile.fixture.tsx +1 -1
  242. package/src/components/MobileBlocks.ts +0 -3
  243. package/src/components/PictureText/PictureText.fixture.tsx +22 -18
  244. package/src/components/PictureText/PictureTextContent.ts +1 -3
  245. package/src/components/Placeholder/Placeholder.fixture.tsx +5 -1
  246. package/src/components/Placeholder/Placeholder.tsx +2 -2
  247. package/src/components/ProductBlock/ProductBlock.fixture.tsx +83 -76
  248. package/src/components/ProductBlock/ProductBlock.mobile.tsx +1 -0
  249. package/src/components/ProductBlock/ProductBlock.tsx +3 -1
  250. package/src/components/ProductBlock/ProductBlockInner.tsx +9 -12
  251. package/src/components/ProductGallery/ProductGallery.example.json +1 -1
  252. package/src/components/ProductGallery/ProductGallery.fixture.tsx +103 -106
  253. package/src/components/ProductGallery/ProductGallery.tsx +7 -5
  254. package/src/components/ProductTile/ProductTile.fixture.tsx +4 -4
  255. package/src/components/PromoTile/PromoTile.fixture.tsx +1 -1
  256. package/src/components/PromoTile/PromoTile.tsx +3 -3
  257. package/src/components/StepsBlock/StepsBlock.fixture.tsx +21 -18
  258. package/src/components/TariffsTable/TariffsTable.example.json +3 -1
  259. package/src/components/TariffsTable/TariffsTable.fixture.tsx +8 -16
  260. package/src/components/TariffsTable/TariffsTable.tsx +39 -37
  261. package/src/components/TariffsTable/TariffsTableCell.tsx +4 -4
  262. package/src/components/TariffsTable/TariffsTableContent.ts +5 -1
  263. package/src/components/TextBlock/TextBlock.example.json +9 -2
  264. package/src/components/TextBlock/TextBlock.fixture.tsx +70 -97
  265. package/src/components/TextBlock/TextBlockContent.ts +1 -2
  266. package/src/components/Tile/Tile.example.json +5 -2
  267. package/src/components/Tile/Tile.fixture.tsx +11 -8
  268. package/src/components/Tile/Tile.tsx +16 -5
  269. package/src/content-page-repository/ContentPageRepository.ts +1 -0
  270. package/src/hooks/useComparisonTableScroll.ts +11 -6
  271. package/src/hooks/useLink.ts +1 -1
  272. package/src/setup-fixture.ts +1 -2
  273. package/src/types.ts +11 -1
  274. package/src/ui-kit/BlockItem/BlockItem.tsx +4 -4
  275. package/src/ui-kit/Checkbox/Checkbox.tsx +7 -3
  276. package/src/ui-kit/InputRange/InputRange.tsx +9 -8
  277. package/src/ui-kit/SearchBar.tsx +15 -6
  278. package/src/Icons/CalendarCircleIcon.svg +0 -14
  279. package/src/Icons/CardIcon.svg +0 -11
  280. package/src/Icons/CardPosIcon.svg +0 -12
  281. package/src/Icons/CardTickIcon.svg +0 -13
  282. package/src/Icons/EmptyWalletChangeIcon.svg +0 -21
  283. package/src/Icons/JCBIcon.svg +0 -42
  284. package/src/Icons/MastercardIcon.svg +0 -6
  285. package/src/Icons/MinusIcon.svg +0 -1
  286. package/src/Icons/MirIcon.svg +0 -13
  287. package/src/Icons/MoneyIcon.svg +0 -13
  288. package/src/Icons/MonitorMobileIcon.svg +0 -14
  289. package/src/Icons/PlusIcon.svg +0 -1
  290. package/src/Icons/Profile2UserIcon.svg +0 -14
  291. package/src/Icons/ShieldTickIcon.svg +0 -7
  292. package/src/Icons/UnionPayIcon.svg +0 -7
  293. package/src/Icons/UserIcon.svg +0 -11
  294. package/src/Icons/VisaIcon.svg +0 -7
  295. package/src/Icons/WalletIcon.svg +0 -19
@@ -195,71 +195,61 @@ const columns2: Column[] = [
195
195
 
196
196
  export default {
197
197
  'with images': (
198
- <div className="w-[1280px]">
199
- <div className="grid grid-cols-12">
200
- <ComparisonTable
201
- className="col-span-12"
202
- title="Другие дебетовые карты Россельхозбанка"
203
- context={context}
204
- rowHeaders={rowHeaders}
205
- columns={Array(2).fill(columns).flat()}
206
- />
207
- </div>
198
+ <div className="container grid grid-cols-12">
199
+ <ComparisonTable
200
+ className="col-span-12"
201
+ title="Другие дебетовые карты Россельхозбанка"
202
+ context={context}
203
+ rowHeaders={rowHeaders}
204
+ columns={Array(2).fill(columns).flat()}
205
+ />
208
206
  </div>
209
207
  ),
210
208
  'with images and hidden rows': (
211
- <div className="w-[1280px]">
212
- <div className="grid grid-cols-12">
213
- <ComparisonTable
214
- className="col-span-12"
215
- title="Другие дебетовые карты Россельхозбанка"
216
- visibleRowLength={3}
217
- context={context}
218
- rowHeaders={rowHeaders}
219
- columns={Array(2).fill(columns).flat()}
220
- />
221
- </div>
209
+ <div className="container grid grid-cols-12">
210
+ <ComparisonTable
211
+ className="col-span-12"
212
+ title="Другие дебетовые карты Россельхозбанка"
213
+ visibleRowLength={3}
214
+ context={context}
215
+ rowHeaders={rowHeaders}
216
+ columns={Array(2).fill(columns).flat()}
217
+ />
222
218
  </div>
223
219
  ),
224
220
  'with images and colored first column': (
225
- <div className="w-[1280px]">
226
- <div className="grid grid-cols-12">
227
- <ComparisonTable
228
- className="col-span-12"
229
- title="Другие дебетовые карты Россельхозбанка"
230
- visibleRowLength={3}
231
- isColoredFirstColumn={true}
232
- context={context}
233
- rowHeaders={rowHeaders}
234
- columns={Array(2).fill(columns).flat()}
235
- />
236
- </div>
221
+ <div className="container grid grid-cols-12">
222
+ <ComparisonTable
223
+ className="col-span-12"
224
+ title="Другие дебетовые карты Россельхозбанка"
225
+ visibleRowLength={3}
226
+ isColoredFirstColumn={true}
227
+ context={context}
228
+ rowHeaders={rowHeaders}
229
+ columns={Array(2).fill(columns).flat()}
230
+ />
237
231
  </div>
238
232
  ),
239
233
  'with icons': (
240
- <div className="w-[1280px]">
241
- <div className="grid grid-cols-12">
242
- <ComparisonTable
243
- className="col-span-12"
244
- title="Другие вклады и сбережения"
245
- context={context}
246
- rowHeaders={rowHeaders2}
247
- columns={Array(2).fill(columns2).flat()}
248
- />
249
- </div>
234
+ <div className="container grid grid-cols-12">
235
+ <ComparisonTable
236
+ className="col-span-12"
237
+ title="Другие вклады и сбережения"
238
+ context={context}
239
+ rowHeaders={rowHeaders2}
240
+ columns={Array(2).fill(columns2).flat()}
241
+ />
250
242
  </div>
251
243
  ),
252
244
  'with icons and two cols': (
253
- <div className="w-[1280px]">
254
- <div className="grid grid-cols-12">
255
- <ComparisonTable
256
- className="col-span-12"
257
- title="Другие вклады и сбережения"
258
- context={context}
259
- rowHeaders={rowHeaders2}
260
- columns={columns2.slice(0, 2)}
261
- />
262
- </div>
245
+ <div className="container grid grid-cols-12">
246
+ <ComparisonTable
247
+ className="col-span-12"
248
+ title="Другие вклады и сбережения"
249
+ context={context}
250
+ rowHeaders={rowHeaders2}
251
+ columns={columns2.slice(0, 2)}
252
+ />
263
253
  </div>
264
254
  ),
265
255
  };
@@ -1,15 +1,15 @@
1
1
  import { JSX } from '@redneckz/uni-jsx';
2
+ import { useComparisonTableScroll } from '../../hooks/useComparisonTableScroll';
3
+ import { useLink } from '../../hooks/useLink';
2
4
  import type { UniBlockProps } from '../../types';
3
5
  import { ArrowButton } from '../../ui-kit/Button/ArrowButton';
4
6
  import { Title } from '../../ui-kit/Title/Title';
5
- import { TableRowContainer } from './TableRowContainer';
6
- import { TableCarouselContainer } from './TableCarouselContainer';
7
- import { useLink } from '../../hooks/useLink';
8
7
  import type { ComparisonTableContent } from './ComparisonTableContent';
8
+ import { COLS_LENGTH_FOR_SCROLL, COLUMN_WIDTH, FIRST_CELL_CLASSES } from './constants';
9
9
  import { HeaderCell } from './HeaderCell';
10
+ import { TableCarouselContainer } from './TableCarouselContainer';
10
11
  import { TableRow } from './TableRow';
11
- import { COLS_LENGTH_FOR_SCROLL, COLUMN_WIDTH, FIRST_CELL_CLASSES } from './constants';
12
- import { useComparisonTableScroll } from '../../hooks/useComparisonTableScroll';
12
+ import { TableRowContainer } from './TableRowContainer';
13
13
 
14
14
  export interface ComparisonTableProps extends ComparisonTableContent, UniBlockProps {}
15
15
 
@@ -39,12 +39,12 @@ export const ComparisonTable = JSX<ComparisonTableProps>(
39
39
  .slice(0, isShowAllRow ? rowHeaders.length : visibleRowLength);
40
40
 
41
41
  const { nextClick, prevClick, isScrollAvailable, showNextButton, showPrevButton } =
42
- useComparisonTableScroll(
42
+ useComparisonTableScroll({
43
43
  colData,
44
- COLS_LENGTH_FOR_SCROLL,
44
+ colsLengthForScroll: COLS_LENGTH_FOR_SCROLL,
45
45
  activeCardIndex,
46
46
  setActiveCardIndex,
47
- );
47
+ });
48
48
 
49
49
  const showToggle = () => setIsShowAllRow(!isShowAllRow);
50
50
 
@@ -17,7 +17,7 @@ export interface HeaderCellProps {
17
17
 
18
18
  export const HeaderCell = JSX<HeaderCellProps>(({ icon, image, title, link }) => (
19
19
  <div
20
- className={`w-80 box-border flex flex-col items-center rounded-t-md border-b-0 px-7 pt-7 pb-12 ${BORDER_CLASSES} ${GRADIENT}`}
20
+ className={`w-80 box-border flex flex-col items-center rounded-t-md border-b-0 px-7 pt-7 pb-[46px] ${BORDER_CLASSES} ${GRADIENT}`}
21
21
  role="columnheader"
22
22
  scope="col"
23
23
  >
@@ -29,7 +29,7 @@ export const HeaderCell = JSX<HeaderCellProps>(({ icon, image, title, link }) =>
29
29
  height="63"
30
30
  />
31
31
  )}
32
- {image?.src && <Img className="mb-4" image={image} />}
32
+ {image?.src && <Img className="mb-[18px]" image={image} />}
33
33
  {title && (
34
34
  <Title size="S" className="font-medium m-0 text-center text-white">
35
35
  {title}
@@ -42,7 +42,7 @@ export const HeaderCell = JSX<HeaderCellProps>(({ icon, image, title, link }) =>
42
42
  target={link.target}
43
43
  className="mt-4 w-full text-primary-main bg-white hover:bg-secondary-hover active:bg-secondary-active"
44
44
  >
45
- <div className="text-xs py-[11px]">{link.text}</div>
45
+ <div className="font-medium text-xs py-[11px]">{link.text}</div>
46
46
  </Button>
47
47
  </div>
48
48
  )}
@@ -1,12 +1,12 @@
1
1
  import { context, mobileContext } from '../../setup-fixture';
2
2
 
3
+ import type { ContentPageDef } from '../../types';
3
4
  import { Blocks } from '../Blocks';
4
- import { BlockDecorator, ContentPage } from './ContentPage';
5
5
  import { MobileBlocks } from '../MobileBlocks';
6
+ import { BlockDecorator, ContentPage } from './ContentPage';
6
7
  import { toMobilePage } from './toMobilePage';
7
- import type { ContentPageDef } from '../../types';
8
8
 
9
- const data = require('./ContentPage.page.json');
9
+ import data from './ContentPage.page.json';
10
10
 
11
11
  const blockDecorator: BlockDecorator = ({ blockClassName, block, render }, i) => (
12
12
  <div
@@ -11,26 +11,32 @@
11
11
  "date": "2022-04-08",
12
12
  "style": ["p-20", "pt-0", "gap-5", "bg-secondary-light"],
13
13
  "likeControl": true,
14
- "blocks": [
15
- {
16
- "type": "Header",
17
- "style": ["col-span-12", "-mx-20", "mb-5", "shadow-[0_8px_32px_0px_#00000014]"],
18
- "content": {
19
- "defaultLocation": "Москва",
20
- "topItems": [
21
- {
22
- "href": "https://rshb.ru/",
23
- "text": "Бизнес клиентам",
24
- "target": "_blank"
25
- },
26
- {
27
- "href": "https://rshb.ru/",
28
- "text": "Частным клиентам",
29
- "target": "_blank"
14
+ "slots": {
15
+ "header": {
16
+ "blocks": [
17
+ {
18
+ "type": "Header",
19
+ "style": ["-mx-20", "mb-5", "shadow-[0_8px_32px_0px_#00000014]"],
20
+ "content": {
21
+ "defaultLocation": "Москва",
22
+ "topItems": [
23
+ {
24
+ "href": "https://rshb.ru/",
25
+ "text": "Бизнес клиентам",
26
+ "target": "_blank"
27
+ },
28
+ {
29
+ "href": "https://rshb.ru/",
30
+ "text": "Частным клиентам",
31
+ "target": "_blank"
32
+ }
33
+ ]
30
34
  }
31
- ]
32
- }
33
- },
35
+ }
36
+ ]
37
+ }
38
+ },
39
+ "blocks": [
34
40
  {
35
41
  "type": "ProductGallery",
36
42
  "style": ["col-span-12"],
@@ -92,6 +98,7 @@
92
98
  "src": "worker.png",
93
99
  "title": "Рабочий",
94
100
  "format": "webp",
101
+ "alt": "Кредит наличными",
95
102
  "size": {
96
103
  "width": 280,
97
104
  "height": 280
@@ -106,7 +113,6 @@
106
113
  },
107
114
  "productBlock": {
108
115
  "title": "Дополнительные бонусные баллы за покупки!»",
109
- "description": "Кредит наличными без залога и поручительства. Потребительский кредит на любые цели. Нужен только паспорт.",
110
116
  "buttons": [
111
117
  {
112
118
  "href": "https://rshb.ru",
@@ -119,6 +125,7 @@
119
125
  "src": "credit-card-1.png",
120
126
  "title": "Кредитка",
121
127
  "format": "webp",
128
+ "alt": "Кредит наличными",
122
129
  "size": {
123
130
  "width": 280,
124
131
  "height": 280
@@ -133,7 +140,6 @@
133
140
  },
134
141
  "productBlock": {
135
142
  "title": "Карты Unionpay»",
136
- "description": "Кэшбэк до 20% у партнеров",
137
143
  "items": [
138
144
  "Потребительский кредит по специальной процентной ставке",
139
145
  "Получите деньги без залога и поручительства",
@@ -151,6 +157,7 @@
151
157
  "src": "credit-card-1.png",
152
158
  "title": "Кредитка",
153
159
  "format": "webp",
160
+ "alt": "Кредит наличными",
154
161
  "size": {
155
162
  "width": 280,
156
163
  "height": 280
@@ -1408,7 +1415,7 @@
1408
1415
  "href": "/abc7/yolo.png"
1409
1416
  },
1410
1417
  {
1411
- "text": "Some more generic text, and even more, more text",
1418
+ "text": "Some more generic text, and even more, more text, and more generic text, and even more, more text, and even more",
1412
1419
  "href": "/abc8/archive.zip",
1413
1420
  "fileSize": "2.3МБ"
1414
1421
  },
@@ -1490,7 +1497,9 @@
1490
1497
  "size": {
1491
1498
  "width": 288,
1492
1499
  "height": 56
1493
- }
1500
+ },
1501
+ "alt": "Платёжные системы",
1502
+ "title": "Платёжные системы"
1494
1503
  }
1495
1504
  }
1496
1505
  ],
@@ -1520,11 +1529,7 @@
1520
1529
  {
1521
1530
  "label": "Бесплатно",
1522
1531
  "list": {
1523
- "items": [
1524
- "item 1",
1525
- "item 2",
1526
- "item 3"
1527
- ]
1532
+ "items": ["item 1", "item 2", "item 3"]
1528
1533
  }
1529
1534
  }
1530
1535
  ],
@@ -1536,7 +1541,8 @@
1536
1541
  "size": {
1537
1542
  "width": 140,
1538
1543
  "height": 140
1539
- }
1544
+ },
1545
+ "alt": "Деньги"
1540
1546
  }
1541
1547
  }
1542
1548
  ]
@@ -1571,11 +1577,7 @@
1571
1577
  {
1572
1578
  "list": {
1573
1579
  "isDotted": false,
1574
- "items": [
1575
- "item 1",
1576
- "item 2",
1577
- "item 3"
1578
- ]
1580
+ "items": ["item 1", "item 2", "item 3"]
1579
1581
  }
1580
1582
  }
1581
1583
  ],
@@ -1592,11 +1594,7 @@
1592
1594
  {
1593
1595
  "list": {
1594
1596
  "version": "primary",
1595
- "items": [
1596
- "item 1",
1597
- "item 2",
1598
- "item 3"
1599
- ]
1597
+ "items": ["item 1", "item 2", "item 3"]
1600
1598
  }
1601
1599
  }
1602
1600
  ],
@@ -1680,7 +1678,9 @@
1680
1678
  "size": {
1681
1679
  "width": 288,
1682
1680
  "height": 56
1683
- }
1681
+ },
1682
+ "alt": "Платёжные системы",
1683
+ "title": "Платёжные системы"
1684
1684
  }
1685
1685
  }
1686
1686
  ],
@@ -1710,11 +1710,7 @@
1710
1710
  {
1711
1711
  "label": "Бесплатно",
1712
1712
  "list": {
1713
- "items": [
1714
- "item 1",
1715
- "item 2",
1716
- "item 3"
1717
- ]
1713
+ "items": ["item 1", "item 2", "item 3"]
1718
1714
  }
1719
1715
  }
1720
1716
  ],
@@ -1726,7 +1722,8 @@
1726
1722
  "size": {
1727
1723
  "width": 140,
1728
1724
  "height": 140
1729
- }
1725
+ },
1726
+ "alt": "Деньги"
1730
1727
  }
1731
1728
  }
1732
1729
  ]
@@ -1761,11 +1758,7 @@
1761
1758
  {
1762
1759
  "list": {
1763
1760
  "isDotted": false,
1764
- "items": [
1765
- "item 1",
1766
- "item 2",
1767
- "item 3"
1768
- ]
1761
+ "items": ["item 1", "item 2", "item 3"]
1769
1762
  }
1770
1763
  }
1771
1764
  ],
@@ -1782,11 +1775,7 @@
1782
1775
  {
1783
1776
  "list": {
1784
1777
  "version": "primary",
1785
- "items": [
1786
- "item 1",
1787
- "item 2",
1788
- "item 3"
1789
- ]
1778
+ "items": ["item 1", "item 2", "item 3"]
1790
1779
  }
1791
1780
  }
1792
1781
  ],
@@ -3,6 +3,7 @@ import type { BlockDef, ContentPageDef, UniBlockProps } from '../../types';
3
3
  import type { BlockContent } from '../BlockContent';
4
4
  import { LikeControl } from '../LikeControl/LikeControl';
5
5
  import { Placeholder } from '../Placeholder/Placeholder';
6
+ import { ContentPageContext } from './ContentPageContext';
6
7
 
7
8
  interface BlockDecoratorProps<VNode> {
8
9
  blockClassName: string;
@@ -20,12 +21,21 @@ export type JSXBlock = (
20
21
  context?: any,
21
22
  ) => any;
22
23
 
24
+ export type BlocksRegistry = Record<string, JSXBlock>;
25
+
23
26
  export interface ContentPageProps extends UniBlockProps {
24
- blocksRegistry: Record<string, JSXBlock>;
27
+ blocksRegistry: BlocksRegistry;
25
28
  data: ContentPageDef;
26
29
  blockDecorator?: BlockDecorator;
27
30
  }
28
31
 
32
+ export interface RenderBlockFunc {
33
+ block: BlockDef;
34
+ blockDecorator: BlockDecorator;
35
+ blocksRegistry: BlocksRegistry;
36
+ context: ContentPageContext;
37
+ }
38
+
29
39
  const defaultBlockDecorator: BlockDecorator = ({ blockClassName, block, render }) =>
30
40
  render({ blockClassName, block });
31
41
 
@@ -34,14 +44,32 @@ export const ContentPage = JSX<ContentPageProps>(
34
44
  className,
35
45
  context,
36
46
  blocksRegistry,
37
- data: { style: pageStyle, blocks, likeControl, colorPalette = 'pc' },
47
+ data: { style: pageStyle, blocks, slots = {}, likeControl, colorPalette = 'pc' },
38
48
  blockDecorator = defaultBlockDecorator,
39
49
  }) => {
50
+ const { header } = slots;
51
+
40
52
  return (
41
- <section className="relative" data-theme={colorPalette}>
42
- <div className={`grid grid-cols-12 gap-1 ${style2className(pageStyle)} ${className || ''}`}>
43
- {blocks?.length ? blocks.map(renderBlock) : null}
44
- </div>
53
+ <section
54
+ className={`relative ${style2className(pageStyle)} ${className || ''}`}
55
+ data-theme={colorPalette}
56
+ >
57
+ {header?.blocks?.length ? (
58
+ <div className={`${style2className(header?.style)}`}>
59
+ {header.blocks.map((block, i) =>
60
+ renderBlock({ block, blockDecorator, blocksRegistry, context }, i),
61
+ )}
62
+ </div>
63
+ ) : null}
64
+
65
+ {blocks?.length ? (
66
+ <div className="container grid grid-cols-12 gap-1">
67
+ {blocks.map((block, i) =>
68
+ renderBlock({ block, blockDecorator, blocksRegistry, context }, i),
69
+ )}
70
+ </div>
71
+ ) : null}
72
+
45
73
  {likeControl && (
46
74
  <div className="flex items-end absolute bottom-0 right-0 h-full pointer-events-none">
47
75
  <LikeControl
@@ -52,39 +80,46 @@ export const ContentPage = JSX<ContentPageProps>(
52
80
  )}
53
81
  </section>
54
82
  );
55
-
56
- function renderBlock(block: BlockDef, i: number) {
57
- const { type } = block;
58
- if (!(type in blocksRegistry)) {
59
- console.warn(`No block with "${type}" is registered`);
60
- }
61
-
62
- const BlockComponent = blocksRegistry[type] || Placeholder;
63
- return blockDecorator(
64
- {
65
- blockClassName: style2className(block.style),
66
- block,
67
- render: (props) => {
68
- const { version, content, blocks } = props.block;
69
- return (
70
- <BlockComponent
71
- key={`${type}-${i}`}
72
- className={props.blockClassName}
73
- version={version}
74
- context={context}
75
- {...content}
76
- >
77
- {blocks?.length ? blocks.map(renderBlock) : null}
78
- </BlockComponent>
79
- );
80
- },
81
- },
82
- `block-${i}`,
83
- );
84
- }
85
83
  },
86
84
  );
87
85
 
86
+ function renderBlock(
87
+ { block, blockDecorator, blocksRegistry, context }: RenderBlockFunc,
88
+ i: number,
89
+ ) {
90
+ const { type } = block;
91
+ if (!(type in blocksRegistry)) {
92
+ console.warn(`No block with "${type}" is registered`);
93
+ }
94
+
95
+ const BlockComponent = blocksRegistry[type] || Placeholder;
96
+ return blockDecorator(
97
+ {
98
+ blockClassName: style2className(block.style),
99
+ block,
100
+ render: (props) => {
101
+ const { version, content, blocks } = props.block;
102
+ return (
103
+ <BlockComponent
104
+ key={`${type}-${i}`}
105
+ className={props.blockClassName}
106
+ version={version}
107
+ context={context}
108
+ {...content}
109
+ >
110
+ {blocks?.length
111
+ ? blocks.map((block, i) =>
112
+ renderBlock({ block, blockDecorator, blocksRegistry, context }, i),
113
+ )
114
+ : null}
115
+ </BlockComponent>
116
+ );
117
+ },
118
+ },
119
+ `block-${i}`,
120
+ );
121
+ }
122
+
88
123
  function style2className(style: string[] | undefined | null): string {
89
124
  return style ? style.join(' ') : '';
90
125
  }
@@ -2,7 +2,7 @@ import { JSX } from '@redneckz/uni-jsx';
2
2
  import type { ContentPageMeta } from '../../types';
3
3
 
4
4
  export interface ContentPageHeadProps {
5
- HeadComponent: Function;
5
+ HeadComponent: <Props, Context, VNode>(props: Props, context?: Context) => VNode;
6
6
  data: ContentPageMeta;
7
7
  }
8
8
 
@@ -1,13 +1,30 @@
1
1
  import type { BlockDef, ContentPageDef } from '../../types';
2
2
 
3
3
  export function toMobilePage(contentPage: ContentPageDef): ContentPageDef {
4
- const blocks = contentPage.blocks?.filter(({ mobile }) => !mobile?.hidden).map(toMobileBlock);
4
+ const { blocks, slots } = contentPage;
5
+
5
6
  return {
6
7
  ...contentPage,
7
- blocks,
8
+ blocks: getMobileBlocks(blocks),
9
+ slots:
10
+ slots &&
11
+ Object.keys(slots).reduce(
12
+ (res, key) => ({
13
+ ...res,
14
+ [key]: {
15
+ ...slots[key],
16
+ blocks: getMobileBlocks(slots[key].blocks),
17
+ },
18
+ }),
19
+ {},
20
+ ),
8
21
  };
9
22
  }
10
23
 
24
+ function getMobileBlocks(blocks?: BlockDef[]) {
25
+ return blocks?.filter(({ mobile }) => !mobile?.hidden).map(toMobileBlock);
26
+ }
27
+
11
28
  function toMobileBlock(block: BlockDef): BlockDef {
12
29
  const { mobile } = block;
13
30
  if (mobile) {
@@ -1,4 +1,12 @@
1
1
  import { CreditCalculator } from './CreditCalculator';
2
2
  import { context } from '../../setup-fixture';
3
3
 
4
- export default <CreditCalculator context={context} directoryName="credit-calculator-data" />;
4
+ export default (
5
+ <div className="container grid grid-cols-12">
6
+ <CreditCalculator
7
+ className="col-span-12"
8
+ context={context}
9
+ directoryName="credit-calculator-data"
10
+ />
11
+ </div>
12
+ );