@redneckz/wildless-cms-uni-blocks 0.8.24 → 0.8.25

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 (292) hide show
  1. package/bundle/blocks.schema.json +1 -1
  2. package/bundle/bundle.umd.js +159 -178
  3. package/bundle/bundle.umd.min.js +1 -1
  4. package/bundle/components/Headline/HeadlineContent.d.ts +2 -0
  5. package/bundle/components/RollupItem/RollupItem.mobile.d.ts +5 -0
  6. package/dist/components/Accordion/Accordion.js +2 -3
  7. package/dist/components/Accordion/Accordion.js.map +1 -1
  8. package/dist/components/Accordion/Accordion.mobile.js +2 -3
  9. package/dist/components/Accordion/Accordion.mobile.js.map +1 -1
  10. package/dist/components/BenefitsBlock/BenefitsBlock.js +1 -1
  11. package/dist/components/BenefitsBlock/BenefitsBlock.js.map +1 -1
  12. package/dist/components/Blocks.js +0 -4
  13. package/dist/components/Blocks.js.map +1 -1
  14. package/dist/components/Blocks.mobile.js +4 -2
  15. package/dist/components/Blocks.mobile.js.map +1 -1
  16. package/dist/components/BonusBenefitsBlock/BonusBenefitsBlock.js +2 -1
  17. package/dist/components/BonusBenefitsBlock/BonusBenefitsBlock.js.map +1 -1
  18. package/dist/components/CarouselLinks/CarouselLinks.js +1 -1
  19. package/dist/components/CarouselLinks/CarouselLinks.js.map +1 -1
  20. package/dist/components/Footer/Footer.mobile.js +3 -3
  21. package/dist/components/Footer/Footer.mobile.js.map +1 -1
  22. package/dist/components/Header/Header.mobile.js +2 -3
  23. package/dist/components/Header/Header.mobile.js.map +1 -1
  24. package/dist/components/Headline/Headline.js +3 -2
  25. package/dist/components/Headline/Headline.js.map +1 -1
  26. package/dist/components/Headline/HeadlineContent.d.ts +2 -0
  27. package/dist/components/RollupItem/RollupItem.js +9 -4
  28. package/dist/components/RollupItem/RollupItem.js.map +1 -1
  29. package/dist/components/RollupItem/RollupItem.mobile.d.ts +5 -0
  30. package/dist/components/RollupItem/RollupItem.mobile.js +33 -0
  31. package/dist/components/RollupItem/RollupItem.mobile.js.map +1 -0
  32. package/dist/ui-kit/Icon/Icon.js +4 -1
  33. package/dist/ui-kit/Icon/Icon.js.map +1 -1
  34. package/dist/ui-kit/List/List.js +1 -1
  35. package/dist/ui-kit/List/List.js.map +1 -1
  36. package/dist/ui-kit/SwipeListControl/SwipeListContainer.js +1 -1
  37. package/dist/ui-kit/SwipeListControl/SwipeListContainer.js.map +1 -1
  38. package/dist/ui-kit/SwipeListControl/SwipeListItem.js +1 -1
  39. package/dist/ui-kit/SwipeListControl/SwipeListItem.js.map +1 -1
  40. package/lib/common.css +1 -1
  41. package/lib/components/Accordion/Accordion.fixture.d.ts +0 -2
  42. package/lib/components/Accordion/Accordion.fixture.mobile.d.ts +1 -1
  43. package/lib/components/Accordion/Accordion.js +2 -3
  44. package/lib/components/Accordion/Accordion.js.map +1 -1
  45. package/lib/components/Accordion/Accordion.mobile.js +2 -3
  46. package/lib/components/Accordion/Accordion.mobile.js.map +1 -1
  47. package/lib/components/BenefitsBlock/BenefitsBlock.js +1 -1
  48. package/lib/components/BenefitsBlock/BenefitsBlock.js.map +1 -1
  49. package/lib/components/Blocks.js +0 -4
  50. package/lib/components/Blocks.js.map +1 -1
  51. package/lib/components/Blocks.mobile.js +4 -2
  52. package/lib/components/Blocks.mobile.js.map +1 -1
  53. package/lib/components/BonusBenefitsBlock/BonusBenefitsBlock.js +2 -1
  54. package/lib/components/BonusBenefitsBlock/BonusBenefitsBlock.js.map +1 -1
  55. package/lib/components/CarouselLinks/CarouselLinks.js +1 -1
  56. package/lib/components/CarouselLinks/CarouselLinks.js.map +1 -1
  57. package/lib/components/Footer/Footer.mobile.js +3 -3
  58. package/lib/components/Footer/Footer.mobile.js.map +1 -1
  59. package/lib/components/Header/Header.mobile.js +2 -3
  60. package/lib/components/Header/Header.mobile.js.map +1 -1
  61. package/lib/components/Headline/Headline.js +3 -2
  62. package/lib/components/Headline/Headline.js.map +1 -1
  63. package/lib/components/Headline/HeadlineContent.d.ts +2 -0
  64. package/lib/components/{AccordionItem/AccordionItem.fixture.d.ts → RollupItem/RollupItem.fixture.mobile.d.ts} +2 -0
  65. package/lib/components/RollupItem/RollupItem.js +9 -4
  66. package/lib/components/RollupItem/RollupItem.js.map +1 -1
  67. package/lib/components/RollupItem/RollupItem.mobile.d.ts +5 -0
  68. package/lib/components/RollupItem/RollupItem.mobile.js +31 -0
  69. package/lib/components/RollupItem/RollupItem.mobile.js.map +1 -0
  70. package/lib/ui-kit/Foldable/DefaultFoldButton.d.ts +0 -1
  71. package/lib/ui-kit/Icon/Icon.js +4 -1
  72. package/lib/ui-kit/Icon/Icon.js.map +1 -1
  73. package/lib/ui-kit/List/List.js +1 -1
  74. package/lib/ui-kit/List/List.js.map +1 -1
  75. package/lib/ui-kit/SwipeListControl/SwipeListContainer.js +1 -1
  76. package/lib/ui-kit/SwipeListControl/SwipeListContainer.js.map +1 -1
  77. package/lib/ui-kit/SwipeListControl/SwipeListItem.js +1 -1
  78. package/lib/ui-kit/SwipeListControl/SwipeListItem.js.map +1 -1
  79. package/mobile/bundle/bundle.umd.js +204 -154
  80. package/mobile/bundle/bundle.umd.min.js +1 -1
  81. package/mobile/bundle/components/Headline/HeadlineContent.d.ts +2 -0
  82. package/mobile/dist/components/Accordion/Accordion.js +2 -3
  83. package/mobile/dist/components/Accordion/Accordion.js.map +1 -1
  84. package/mobile/dist/components/BenefitsBlock/BenefitsBlock.js +1 -1
  85. package/mobile/dist/components/BenefitsBlock/BenefitsBlock.js.map +1 -1
  86. package/mobile/dist/components/Blocks.js +4 -2
  87. package/mobile/dist/components/Blocks.js.map +1 -1
  88. package/mobile/dist/components/BonusBenefitsBlock/BonusBenefitsBlock.js +2 -1
  89. package/mobile/dist/components/BonusBenefitsBlock/BonusBenefitsBlock.js.map +1 -1
  90. package/mobile/dist/components/CarouselLinks/CarouselLinks.js +1 -1
  91. package/mobile/dist/components/CarouselLinks/CarouselLinks.js.map +1 -1
  92. package/mobile/dist/components/Footer/Footer.js +3 -3
  93. package/mobile/dist/components/Footer/Footer.js.map +1 -1
  94. package/mobile/dist/components/Header/Header.js +2 -3
  95. package/mobile/dist/components/Header/Header.js.map +1 -1
  96. package/mobile/dist/components/Headline/Headline.js +3 -2
  97. package/mobile/dist/components/Headline/Headline.js.map +1 -1
  98. package/mobile/dist/components/Headline/HeadlineContent.d.ts +2 -0
  99. package/mobile/dist/components/RollupItem/RollupItem.js +17 -5
  100. package/mobile/dist/components/RollupItem/RollupItem.js.map +1 -1
  101. package/mobile/dist/ui-kit/Icon/Icon.js +4 -1
  102. package/mobile/dist/ui-kit/Icon/Icon.js.map +1 -1
  103. package/mobile/dist/ui-kit/List/List.js +1 -1
  104. package/mobile/dist/ui-kit/List/List.js.map +1 -1
  105. package/mobile/dist/ui-kit/SwipeListControl/SwipeListContainer.js +1 -1
  106. package/mobile/dist/ui-kit/SwipeListControl/SwipeListContainer.js.map +1 -1
  107. package/mobile/dist/ui-kit/SwipeListControl/SwipeListItem.js +1 -1
  108. package/mobile/dist/ui-kit/SwipeListControl/SwipeListItem.js.map +1 -1
  109. package/mobile/lib/components/Accordion/Accordion.js +2 -3
  110. package/mobile/lib/components/Accordion/Accordion.js.map +1 -1
  111. package/mobile/lib/components/BenefitsBlock/BenefitsBlock.js +1 -1
  112. package/mobile/lib/components/BenefitsBlock/BenefitsBlock.js.map +1 -1
  113. package/mobile/lib/components/Blocks.js +4 -2
  114. package/mobile/lib/components/Blocks.js.map +1 -1
  115. package/mobile/lib/components/BonusBenefitsBlock/BonusBenefitsBlock.js +2 -1
  116. package/mobile/lib/components/BonusBenefitsBlock/BonusBenefitsBlock.js.map +1 -1
  117. package/mobile/lib/components/CarouselLinks/CarouselLinks.js +1 -1
  118. package/mobile/lib/components/CarouselLinks/CarouselLinks.js.map +1 -1
  119. package/mobile/lib/components/Footer/Footer.js +3 -3
  120. package/mobile/lib/components/Footer/Footer.js.map +1 -1
  121. package/mobile/lib/components/Header/Header.js +2 -3
  122. package/mobile/lib/components/Header/Header.js.map +1 -1
  123. package/mobile/lib/components/Headline/Headline.js +3 -2
  124. package/mobile/lib/components/Headline/Headline.js.map +1 -1
  125. package/mobile/lib/components/Headline/HeadlineContent.d.ts +2 -0
  126. package/mobile/lib/components/RollupItem/RollupItem.js +17 -5
  127. package/mobile/lib/components/RollupItem/RollupItem.js.map +1 -1
  128. package/mobile/lib/ui-kit/Icon/Icon.js +4 -1
  129. package/mobile/lib/ui-kit/Icon/Icon.js.map +1 -1
  130. package/mobile/lib/ui-kit/List/List.js +1 -1
  131. package/mobile/lib/ui-kit/List/List.js.map +1 -1
  132. package/mobile/lib/ui-kit/SwipeListControl/SwipeListContainer.js +1 -1
  133. package/mobile/lib/ui-kit/SwipeListControl/SwipeListContainer.js.map +1 -1
  134. package/mobile/lib/ui-kit/SwipeListControl/SwipeListItem.js +1 -1
  135. package/mobile/lib/ui-kit/SwipeListControl/SwipeListItem.js.map +1 -1
  136. package/mobile/src/components/Accordion/Accordion.example.json +3 -3
  137. package/mobile/src/components/Accordion/Accordion.tsx +2 -3
  138. package/mobile/src/components/BenefitsBlock/BenefitsBlock.tsx +1 -1
  139. package/mobile/src/components/Blocks.ts +4 -2
  140. package/mobile/src/components/BonusBenefitsBlock/BonusBenefitsBlock.tsx +10 -3
  141. package/mobile/src/components/CarouselLinks/CarouselLinks.tsx +1 -1
  142. package/mobile/src/components/Footer/Footer.tsx +9 -9
  143. package/mobile/src/components/Header/Header.tsx +5 -6
  144. package/mobile/src/components/Headline/Headline.tsx +4 -1
  145. package/mobile/src/components/Headline/HeadlineContent.ts +2 -0
  146. package/mobile/src/components/RollupItem/RollupItem.tsx +77 -28
  147. package/mobile/src/ui-kit/Icon/Icon.tsx +4 -1
  148. package/mobile/src/ui-kit/List/List.tsx +1 -1
  149. package/mobile/src/ui-kit/SwipeListControl/SwipeListContainer.tsx +0 -1
  150. package/mobile/src/ui-kit/SwipeListControl/SwipeListItem.tsx +1 -2
  151. package/package.json +1 -1
  152. package/src/components/Accordion/Accordion.example.json +3 -3
  153. package/src/components/Accordion/Accordion.fixture.mobile.tsx +20 -11
  154. package/src/components/Accordion/Accordion.fixture.tsx +42 -27
  155. package/src/components/Accordion/Accordion.mobile.tsx +2 -3
  156. package/src/components/Accordion/Accordion.tsx +2 -3
  157. package/src/components/BenefitsBlock/BenefitsBlock.tsx +1 -1
  158. package/src/components/Blocks.mobile.ts +4 -2
  159. package/src/components/Blocks.ts +0 -4
  160. package/src/components/BonusBenefitsBlock/BonusBenefitsBlock.tsx +10 -3
  161. package/src/components/CarouselBankHistoryCard/CarouselBankHistoryCard.fixture.tsx +2 -2
  162. package/src/components/CarouselLinks/CarouselLinks.tsx +1 -1
  163. package/src/components/Footer/Footer.mobile.tsx +9 -9
  164. package/src/components/Header/Header.mobile.tsx +5 -6
  165. package/src/components/Headline/Headline.tsx +4 -1
  166. package/src/components/Headline/HeadlineContent.ts +2 -0
  167. package/src/components/OtherProducts/OtherProducts.fixture.tsx +15 -14
  168. package/src/components/RollupItem/RollupItem.fixture.mobile.tsx +33 -0
  169. package/src/components/RollupItem/RollupItem.mobile.tsx +143 -0
  170. package/src/components/RollupItem/RollupItem.tsx +17 -13
  171. package/src/components/VerticalLayout/VerticalLayout.fixture.tsx +1 -0
  172. package/src/ui-kit/Icon/Icon.tsx +4 -1
  173. package/src/ui-kit/List/List.tsx +1 -1
  174. package/src/ui-kit/SwipeListControl/SwipeListContainer.tsx +0 -1
  175. package/src/ui-kit/SwipeListControl/SwipeListItem.tsx +1 -2
  176. package/bundle/components/Accordion/AccordionItemsList.d.ts +0 -1
  177. package/bundle/components/AccordionItem/AccordionItem.d.ts +0 -3
  178. package/bundle/components/AccordionItem/AccordionItem.mobile.d.ts +0 -3
  179. package/bundle/components/AccordionItem/AccordionItemContent.d.ts +0 -14
  180. package/bundle/components/AccordionItem/AccordionItemProps.d.ts +0 -4
  181. package/bundle/components/OtherProductsItem/OtherProductsItem.d.ts +0 -5
  182. package/bundle/components/OtherProductsItem/OtherProductsItemContent.d.ts +0 -12
  183. package/dist/components/Accordion/AccordionItemsList.d.ts +0 -1
  184. package/dist/components/Accordion/AccordionItemsList.js +0 -6
  185. package/dist/components/Accordion/AccordionItemsList.js.map +0 -1
  186. package/dist/components/AccordionItem/AccordionItem.d.ts +0 -3
  187. package/dist/components/AccordionItem/AccordionItem.js +0 -14
  188. package/dist/components/AccordionItem/AccordionItem.js.map +0 -1
  189. package/dist/components/AccordionItem/AccordionItem.mobile.d.ts +0 -3
  190. package/dist/components/AccordionItem/AccordionItem.mobile.js +0 -19
  191. package/dist/components/AccordionItem/AccordionItem.mobile.js.map +0 -1
  192. package/dist/components/AccordionItem/AccordionItemContent.d.ts +0 -14
  193. package/dist/components/AccordionItem/AccordionItemContent.js +0 -2
  194. package/dist/components/AccordionItem/AccordionItemContent.js.map +0 -1
  195. package/dist/components/AccordionItem/AccordionItemProps.d.ts +0 -4
  196. package/dist/components/AccordionItem/AccordionItemProps.js +0 -2
  197. package/dist/components/AccordionItem/AccordionItemProps.js.map +0 -1
  198. package/dist/components/OtherProductsItem/OtherProductsItem.d.ts +0 -5
  199. package/dist/components/OtherProductsItem/OtherProductsItem.js +0 -18
  200. package/dist/components/OtherProductsItem/OtherProductsItem.js.map +0 -1
  201. package/dist/components/OtherProductsItem/OtherProductsItemContent.d.ts +0 -12
  202. package/dist/components/OtherProductsItem/OtherProductsItemContent.js +0 -2
  203. package/dist/components/OtherProductsItem/OtherProductsItemContent.js.map +0 -1
  204. package/lib/components/Accordion/AccordionItemsList.d.ts +0 -1
  205. package/lib/components/Accordion/AccordionItemsList.js +0 -4
  206. package/lib/components/Accordion/AccordionItemsList.js.map +0 -1
  207. package/lib/components/AccordionItem/AccordionItem.d.ts +0 -3
  208. package/lib/components/AccordionItem/AccordionItem.fixture.mobile.d.ts +0 -5
  209. package/lib/components/AccordionItem/AccordionItem.js +0 -12
  210. package/lib/components/AccordionItem/AccordionItem.js.map +0 -1
  211. package/lib/components/AccordionItem/AccordionItem.mobile.d.ts +0 -3
  212. package/lib/components/AccordionItem/AccordionItem.mobile.js +0 -17
  213. package/lib/components/AccordionItem/AccordionItem.mobile.js.map +0 -1
  214. package/lib/components/AccordionItem/AccordionItemContent.d.ts +0 -14
  215. package/lib/components/AccordionItem/AccordionItemContent.js +0 -2
  216. package/lib/components/AccordionItem/AccordionItemContent.js.map +0 -1
  217. package/lib/components/AccordionItem/AccordionItemProps.d.ts +0 -4
  218. package/lib/components/AccordionItem/AccordionItemProps.js +0 -2
  219. package/lib/components/AccordionItem/AccordionItemProps.js.map +0 -1
  220. package/lib/components/OtherProductsItem/OtherProductsItem.d.ts +0 -5
  221. package/lib/components/OtherProductsItem/OtherProductsItem.fixture.d.ts +0 -5
  222. package/lib/components/OtherProductsItem/OtherProductsItem.js +0 -16
  223. package/lib/components/OtherProductsItem/OtherProductsItem.js.map +0 -1
  224. package/lib/components/OtherProductsItem/OtherProductsItemContent.d.ts +0 -12
  225. package/lib/components/OtherProductsItem/OtherProductsItemContent.js +0 -2
  226. package/lib/components/OtherProductsItem/OtherProductsItemContent.js.map +0 -1
  227. package/mobile/bundle/components/Accordion/AccordionItemsList.d.ts +0 -1
  228. package/mobile/bundle/components/AccordionItem/AccordionItem.d.ts +0 -3
  229. package/mobile/bundle/components/AccordionItem/AccordionItemContent.d.ts +0 -14
  230. package/mobile/bundle/components/AccordionItem/AccordionItemProps.d.ts +0 -4
  231. package/mobile/bundle/components/OtherProductsItem/OtherProductsItem.d.ts +0 -5
  232. package/mobile/bundle/components/OtherProductsItem/OtherProductsItemContent.d.ts +0 -12
  233. package/mobile/dist/components/Accordion/AccordionItemsList.d.ts +0 -1
  234. package/mobile/dist/components/Accordion/AccordionItemsList.js +0 -6
  235. package/mobile/dist/components/Accordion/AccordionItemsList.js.map +0 -1
  236. package/mobile/dist/components/AccordionItem/AccordionItem.d.ts +0 -3
  237. package/mobile/dist/components/AccordionItem/AccordionItem.js +0 -19
  238. package/mobile/dist/components/AccordionItem/AccordionItem.js.map +0 -1
  239. package/mobile/dist/components/AccordionItem/AccordionItemContent.d.ts +0 -14
  240. package/mobile/dist/components/AccordionItem/AccordionItemContent.js +0 -2
  241. package/mobile/dist/components/AccordionItem/AccordionItemContent.js.map +0 -1
  242. package/mobile/dist/components/AccordionItem/AccordionItemProps.d.ts +0 -4
  243. package/mobile/dist/components/AccordionItem/AccordionItemProps.js +0 -2
  244. package/mobile/dist/components/AccordionItem/AccordionItemProps.js.map +0 -1
  245. package/mobile/dist/components/OtherProductsItem/OtherProductsItem.d.ts +0 -5
  246. package/mobile/dist/components/OtherProductsItem/OtherProductsItem.js +0 -18
  247. package/mobile/dist/components/OtherProductsItem/OtherProductsItem.js.map +0 -1
  248. package/mobile/dist/components/OtherProductsItem/OtherProductsItemContent.d.ts +0 -12
  249. package/mobile/dist/components/OtherProductsItem/OtherProductsItemContent.js +0 -2
  250. package/mobile/dist/components/OtherProductsItem/OtherProductsItemContent.js.map +0 -1
  251. package/mobile/lib/components/Accordion/AccordionItemsList.d.ts +0 -1
  252. package/mobile/lib/components/Accordion/AccordionItemsList.js +0 -4
  253. package/mobile/lib/components/Accordion/AccordionItemsList.js.map +0 -1
  254. package/mobile/lib/components/AccordionItem/AccordionItem.d.ts +0 -3
  255. package/mobile/lib/components/AccordionItem/AccordionItem.js +0 -17
  256. package/mobile/lib/components/AccordionItem/AccordionItem.js.map +0 -1
  257. package/mobile/lib/components/AccordionItem/AccordionItemContent.d.ts +0 -14
  258. package/mobile/lib/components/AccordionItem/AccordionItemContent.js +0 -2
  259. package/mobile/lib/components/AccordionItem/AccordionItemContent.js.map +0 -1
  260. package/mobile/lib/components/AccordionItem/AccordionItemProps.d.ts +0 -4
  261. package/mobile/lib/components/AccordionItem/AccordionItemProps.js +0 -2
  262. package/mobile/lib/components/AccordionItem/AccordionItemProps.js.map +0 -1
  263. package/mobile/lib/components/OtherProductsItem/OtherProductsItem.d.ts +0 -5
  264. package/mobile/lib/components/OtherProductsItem/OtherProductsItem.js +0 -16
  265. package/mobile/lib/components/OtherProductsItem/OtherProductsItem.js.map +0 -1
  266. package/mobile/lib/components/OtherProductsItem/OtherProductsItemContent.d.ts +0 -12
  267. package/mobile/lib/components/OtherProductsItem/OtherProductsItemContent.js +0 -2
  268. package/mobile/lib/components/OtherProductsItem/OtherProductsItemContent.js.map +0 -1
  269. package/mobile/src/components/Accordion/AccordionItemsList.tsx +0 -5
  270. package/mobile/src/components/AccordionItem/AccordionItem.example.json +0 -25
  271. package/mobile/src/components/AccordionItem/AccordionItem.tsx +0 -90
  272. package/mobile/src/components/AccordionItem/AccordionItem.ui.json +0 -7
  273. package/mobile/src/components/AccordionItem/AccordionItemContent.ts +0 -15
  274. package/mobile/src/components/AccordionItem/AccordionItemProps.ts +0 -4
  275. package/mobile/src/components/OtherProductsItem/OtherProductsItem.example.json +0 -22
  276. package/mobile/src/components/OtherProductsItem/OtherProductsItem.tsx +0 -50
  277. package/mobile/src/components/OtherProductsItem/OtherProductsItem.ui.json +0 -1
  278. package/mobile/src/components/OtherProductsItem/OtherProductsItemContent.ts +0 -13
  279. package/src/components/Accordion/AccordionItemsList.tsx +0 -5
  280. package/src/components/AccordionItem/AccordionItem.example.json +0 -25
  281. package/src/components/AccordionItem/AccordionItem.fixture.mobile.tsx +0 -17
  282. package/src/components/AccordionItem/AccordionItem.fixture.tsx +0 -17
  283. package/src/components/AccordionItem/AccordionItem.mobile.tsx +0 -90
  284. package/src/components/AccordionItem/AccordionItem.tsx +0 -58
  285. package/src/components/AccordionItem/AccordionItem.ui.json +0 -7
  286. package/src/components/AccordionItem/AccordionItemContent.ts +0 -15
  287. package/src/components/AccordionItem/AccordionItemProps.ts +0 -4
  288. package/src/components/OtherProductsItem/OtherProductsItem.example.json +0 -22
  289. package/src/components/OtherProductsItem/OtherProductsItem.fixture.tsx +0 -20
  290. package/src/components/OtherProductsItem/OtherProductsItem.tsx +0 -50
  291. package/src/components/OtherProductsItem/OtherProductsItem.ui.json +0 -1
  292. package/src/components/OtherProductsItem/OtherProductsItemContent.ts +0 -13
@@ -1,5 +1,4 @@
1
1
  import type { BlockRendererOptions } from '../../BlockRenderer/BlockRendererOptions';
2
- import type { BlockDef } from '../../model/ContentPageDef';
3
2
  import '../../setup-fixture';
4
3
  import { Blocks } from '../Blocks';
5
4
  import { HEADLINE } from '../Headline/Headline.fixture';
@@ -8,16 +7,7 @@ import { PICTURE_TEXT } from '../PictureText/PictureText.fixture';
8
7
  import { PRODUCT_TILE } from '../ProductTile/ProductTile.fixture';
9
8
  import { TEXT_BLOCK } from '../TextBlock/TextBlock.fixture';
10
9
  import { TILE } from '../Tile/Tile.fixture';
11
- import { Accordion } from './Accordion';
12
-
13
- export const ACCORDION_ITEM: BlockDef = {
14
- type: 'AccordionItem',
15
- content: { label: 'Accordion label 1', isExpanded: true },
16
- blocks: [
17
- { type: 'TextBlock', content: TEXT_BLOCK },
18
- { type: 'TextBlock', content: TEXT_BLOCK },
19
- ],
20
- };
10
+ import { VerticalLayout } from '../VerticalLayout/VerticalLayout';
21
11
 
22
12
  const options = {
23
13
  blocksRegistry: Blocks,
@@ -26,31 +16,47 @@ const options = {
26
16
  export default {
27
17
  default: (
28
18
  <div className="container grid grid-cols-12">
29
- <Accordion
19
+ <VerticalLayout
30
20
  className="col-span-12"
31
- title="Accordion title"
32
- description="Accordion description"
21
+ version="primary"
22
+ isInnerPadding={false}
23
+ isPadding={true}
33
24
  block={{
34
- type: 'Accordion',
25
+ type: 'VerticalLayout',
35
26
  blocks: [
36
- ACCORDION_ITEM,
37
27
  {
38
- type: 'AccordionItem',
28
+ type: 'Headline',
29
+ content: {
30
+ title: 'Accordion title',
31
+ description: 'Accordion description',
32
+ headlineVersion: 'M',
33
+ },
34
+ },
35
+ {
36
+ type: 'RollupItem',
37
+ content: { label: 'Accordion label 1', isExpanded: true },
38
+ blocks: [
39
+ { type: 'TextBlock', content: TEXT_BLOCK },
40
+ { type: 'TextBlock', content: TEXT_BLOCK },
41
+ ],
42
+ },
43
+ {
44
+ type: 'RollupItem',
39
45
  content: { label: 'Accordion label 2', isExpanded: true },
40
46
  blocks: [{ type: 'PictureText', content: PICTURE_TEXT }],
41
47
  },
42
48
  {
43
- type: 'AccordionItem',
49
+ type: 'RollupItem',
44
50
  content: { label: 'Accordion label 3', isExpanded: true },
45
51
  blocks: [{ type: 'Headline', content: HEADLINE }],
46
52
  },
47
53
  {
48
- type: 'AccordionItem',
54
+ type: 'RollupItem',
49
55
  content: { label: 'Accordion label 4' },
50
56
  blocks: [{ type: 'LinkDocs', content: { ...linkDocsContentExample, title: '' } }],
51
57
  },
52
58
  {
53
- type: 'AccordionItem',
59
+ type: 'RollupItem',
54
60
  content: { label: 'Accordion label 5' },
55
61
  blocks: [
56
62
  { type: 'Tile', content: TILE, style: ['col-span-6'] },
@@ -58,7 +64,7 @@ export default {
58
64
  ],
59
65
  },
60
66
  {
61
- type: 'AccordionItem',
67
+ type: 'RollupItem',
62
68
  content: { label: 'Accordion label 6' },
63
69
  blocks: [
64
70
  { type: 'ProductTile', content: PRODUCT_TILE, style: ['col-span-6'] },
@@ -73,16 +79,22 @@ export default {
73
79
  ),
74
80
  'right-align-title': (
75
81
  <div className="container grid grid-cols-12">
76
- <Accordion
82
+ <VerticalLayout
77
83
  className="col-span-12"
78
- title="Accordion title"
79
- accordionAlignTitle="right"
80
- description="Accordion description"
81
84
  block={{
82
- type: 'Accordion',
85
+ type: 'VerticalLayout',
83
86
  blocks: [
84
87
  {
85
- type: 'AccordionItem',
88
+ type: 'Headline',
89
+ content: {
90
+ title: 'Accordion title',
91
+ description: 'Accordion description',
92
+ headlineVersion: 'M',
93
+ align: 'text-right',
94
+ },
95
+ },
96
+ {
97
+ type: 'RollupItem',
86
98
  content: { label: 'Accordion label 1', isExpanded: true },
87
99
  blocks: [
88
100
  { type: 'TextBlock', content: TEXT_BLOCK },
@@ -91,6 +103,9 @@ export default {
91
103
  },
92
104
  ],
93
105
  }}
106
+ version="primary"
107
+ isInnerPadding={false}
108
+ isPadding={true}
94
109
  options={options}
95
110
  />
96
111
  </div>
@@ -5,7 +5,6 @@ import { BlockWrapper } from '../../ui-kit/BlockWrapper';
5
5
  import { Heading } from '../../ui-kit/Heading/Heading';
6
6
  import { Paragraph } from '../../ui-kit/Paragraph/Paragraph';
7
7
  import type { AccordionContent } from './AccordionContent';
8
- import { AccordionItemsList } from './AccordionItemsList';
9
8
 
10
9
  export interface AccordionProps extends AccordionContent, UniBlockProps {}
11
10
 
@@ -20,9 +19,9 @@ export const Accordion: JSXBlock<AccordionProps> = JSX<AccordionProps>(
20
19
  </Paragraph>
21
20
  </div>
22
21
  ) : null}
23
- <AccordionItemsList>{renderChildren(rest)}</AccordionItemsList>
22
+ <div className="list-none m-0 p-0">{renderChildren(rest)}</div>
24
23
  </BlockWrapper>
25
24
  ),
26
25
  );
27
26
 
28
- Accordion.childrenTypes = ['AccordionItem'];
27
+ Accordion.childrenTypes = ['Accordion'];
@@ -6,7 +6,6 @@ import { BlockWrapper } from '../../ui-kit/BlockWrapper';
6
6
  import { Heading } from '../../ui-kit/Heading/Heading';
7
7
  import { Paragraph } from '../../ui-kit/Paragraph/Paragraph';
8
8
  import type { AccordionContent } from './AccordionContent';
9
- import { AccordionItemsList } from './AccordionItemsList';
10
9
 
11
10
  export interface AccordionProps extends AccordionContent, UniBlockProps {}
12
11
 
@@ -26,9 +25,9 @@ export const Accordion: JSXBlock<AccordionProps> = JSX<AccordionProps>(
26
25
  <Paragraph size="text-l">{description}</Paragraph>
27
26
  </div>
28
27
  ) : null}
29
- <AccordionItemsList>{renderChildren(rest)}</AccordionItemsList>
28
+ <div className="list-none m-0 p-0">{renderChildren(rest)}</div>
30
29
  </BlockWrapper>
31
30
  ),
32
31
  );
33
32
 
34
- Accordion.childrenTypes = ['AccordionItem'];
33
+ Accordion.childrenTypes = ['Accordion'];
@@ -41,7 +41,7 @@ const renderStep = (benefit: BenefitBlockItemProps, i: number) => {
41
41
  />
42
42
  ) : null}
43
43
  {benefit?.icon?.src ? <Img image={benefit.icon} /> : null}
44
- <div className="ml-5">
44
+ <div className="ml-5 h-full">
45
45
  {benefit?.label ? <Heading headingType="h6">{benefit.label}</Heading> : null}
46
46
  {renderDescription(description)}
47
47
  </div>
@@ -1,6 +1,5 @@
1
1
  import type { BlocksRegistry } from '../model/BlocksRegistry';
2
2
  import { Accordion } from './Accordion/Accordion';
3
- import { AccordionItem } from './AccordionItem/AccordionItem';
4
3
  import { ComparisonTable } from './ComparisonTable/ComparisonTable';
5
4
  import { Footer } from './Footer/Footer';
6
5
  import { Header } from './Header/Header';
@@ -10,13 +9,14 @@ import { LinkList } from './LinkList/LinkList';
10
9
  import { MobileAppTile } from './MobileAppTile/MobileAppTile';
11
10
  import { Placeholder } from './Placeholder/Placeholder';
12
11
  import { ProductBlock } from './ProductBlock/ProductBlock';
12
+ import { RollupItem } from './RollupItem/RollupItem';
13
13
  import { StepsBlock } from './StepsBlock/StepsBlock';
14
14
  import { TariffsTable } from './TariffsTable/TariffsTable';
15
15
  import { TextBlock } from './TextBlock/TextBlock';
16
+ import { VerticalLayout } from './VerticalLayout/VerticalLayout';
16
17
 
17
18
  export const Blocks: BlocksRegistry = {
18
19
  Accordion,
19
- AccordionItem,
20
20
  ComparisonTable,
21
21
  Footer,
22
22
  Header,
@@ -25,8 +25,10 @@ export const Blocks: BlocksRegistry = {
25
25
  LinkList,
26
26
  MobileAppTile,
27
27
  ProductBlock,
28
+ RollupItem,
28
29
  StepsBlock,
29
30
  TariffsTable,
30
31
  TextBlock,
31
32
  Placeholder,
33
+ VerticalLayout,
32
34
  };
@@ -1,6 +1,5 @@
1
1
  import type { BlocksRegistry } from '../model/BlocksRegistry';
2
2
  import { Accordion } from './Accordion/Accordion';
3
- import { AccordionItem } from './AccordionItem/AccordionItem';
4
3
  import { ApplicationForm } from './ApplicationForm/ApplicationForm';
5
4
  import { BenefitsBlock } from './BenefitsBlock/BenefitsBlock';
6
5
  import { Bonus } from './Bonus/Bonus';
@@ -37,7 +36,6 @@ import { MobileAppTile } from './MobileAppTile/MobileAppTile';
37
36
  import { OfficeMap } from './OfficeMap/OfficeMap';
38
37
  import { OfficeServicesBlock } from './OfficeServicesBlock/OfficeServicesBlock';
39
38
  import { OtherProducts } from './OtherProducts/OtherProducts';
40
- import { OtherProductsItem } from './OtherProductsItem/OtherProductsItem';
41
39
  import { ParagraphBlock } from './ParagraphBlock/ParagraphBlock';
42
40
  import { PictureText } from './PictureText/PictureText';
43
41
  import { Placeholder } from './Placeholder/Placeholder';
@@ -60,7 +58,6 @@ import { Video } from './Video/Video';
60
58
 
61
59
  export const Blocks: BlocksRegistry = {
62
60
  Accordion,
63
- AccordionItem,
64
61
  ApplicationForm,
65
62
  BenefitsBlock,
66
63
  Bonus,
@@ -97,7 +94,6 @@ export const Blocks: BlocksRegistry = {
97
94
  OfficeMap,
98
95
  OfficeServicesBlock,
99
96
  OtherProducts,
100
- OtherProductsItem,
101
97
  ParagraphBlock,
102
98
  PictureText,
103
99
  Placeholder,
@@ -9,6 +9,7 @@ import type {
9
9
  BonusBenefitsBlockContent,
10
10
  ColumnsCount,
11
11
  } from './BonusBenefitsBlockContent';
12
+ import { style } from '../../utils/style';
12
13
 
13
14
  export interface BenefitsBlockProps extends BonusBenefitsBlockContent, UniBlockProps {}
14
15
 
@@ -40,10 +41,16 @@ export const BonusBenefitsBlock = JSX<BenefitsBlockProps>(
40
41
 
41
42
  const renderBonusBenefit = ({ icon, title, description }: BonusBenefit, i: number) => {
42
43
  return (
43
- <div key={String(i)} className="flex flex-col items-center text-h6">
44
+ <div
45
+ key={String(i)}
46
+ className={style(
47
+ 'flex flex-col items-center text-h6',
48
+ !description && !title ? 'justify-center' : '',
49
+ )}
50
+ >
44
51
  {title ? <span>{title}</span> : null}
45
- {icon ? <Img image={icon} height="180" width="auto" className="h-[180px] w-auto" /> : null}
46
- <div>{description ? <span>{description}</span> : null}</div>
52
+ {icon ? <Img image={icon} height="180" width="auto" className="w-auto" /> : null}
53
+ {description ? <span>{description}</span> : null}
47
54
  </div>
48
55
  );
49
56
  };
@@ -3,13 +3,13 @@ import { CarouselBankHistoryCard } from './CarouselBankHistoryCard';
3
3
  export const BANK_HISTORY_CARD = {
4
4
  title: '1796г.',
5
5
  description:
6
- "Россельхозбанк стал одним из ключевых участников Приоритетного национального проекта 'Развитие АПК' основной целью которого было развитие агропромышленного сектора российской экономики и обеспечение продовольственной безопасности страны.",
6
+ "Россельхозбанк стал одним из ключевых участников Приоритетного национального проекта 'Развитие АПК' целью которого развитие агропромышленного сектора российской экономики",
7
7
  };
8
8
 
9
9
  export const ACTIVE_BANK_HISTORY_CARD = {
10
10
  title: '1796г.',
11
11
  description:
12
- "Россельхозбанк стал одним из ключевых участников Приоритетного национального проекта 'Развитие АПК' основной целью которого было развитие агропромышленного сектора российской экономики и обеспечение продовольственной безопасности страны.",
12
+ "Россельхозбанк стал одним из ключевых участников Приоритетного национального проекта 'Развитие АПК' целью которого развитие агропромышленного сектора российской экономики",
13
13
  isActive: true,
14
14
  };
15
15
 
@@ -21,7 +21,7 @@ export const CarouselLinks = JSX<CarouselLinksProps>(
21
21
  >
22
22
  <div className="flex flex-col max-w-96 pr-9 text-white text-xl-light">
23
23
  <Headline
24
- className="p-0"
24
+ isPadding={false}
25
25
  title={title}
26
26
  description={description}
27
27
  as="h1"
@@ -1,16 +1,16 @@
1
1
  import { JSX } from '@redneckz/uni-jsx';
2
- import { projectSettings } from '../../ProjectSettings';
3
2
  import type { UniBlockProps } from '../../model/JSXBlock';
3
+ import { projectSettings } from '../../ProjectSettings';
4
4
  import type { SitemapDataProps } from '../../services/sitemap/SitemapProps';
5
5
  import { useSWRResource } from '../../services/sitemap/useSWRResource';
6
+ import { BlockWrapper } from '../../ui-kit/BlockWrapper';
6
7
  import { Button } from '../../ui-kit/Button/Button';
7
8
  import { Img } from '../../ui-kit/Img/Img';
8
9
  import { SearchBar } from '../../ui-kit/SearchBar/SearchBar';
9
10
  import { getIconWithVersion } from '../../utils/getIconWithVersion';
10
- import { AccordionItemsList } from '../Accordion/AccordionItemsList';
11
- import { AccordionItem } from '../AccordionItem/AccordionItem';
12
11
  import { LinkList } from '../LinkList/LinkList';
13
12
  import { MobileAppTile } from '../MobileAppTile/MobileAppTile';
13
+ import { RollupItem } from '../RollupItem/RollupItem';
14
14
  import { Contacts } from './Contacts';
15
15
  import type { FooterContent, SubMenuItem } from './FooterContent';
16
16
  import type { FooterDataProps } from './FooterDataProps';
@@ -28,15 +28,15 @@ export const Footer = JSX<FooterProps>(({ className = '', ...rest }) => {
28
28
  useSWRResource<FooterDataProps>(projectSettings.FOOTER || 'footer', fallback);
29
29
 
30
30
  return (
31
- <footer className={`font-sans px-4 py-[26px] bg-white ${className}`}>
31
+ <BlockWrapper tag="footer" className={`px-4 py-[26px] ${className}`} {...rest}>
32
32
  <Contacts className="overflow-hidden" items={contacts} hasButton />
33
- <AccordionItemsList>
33
+ <div className="m-0 p-0">
34
34
  {sitemap.topItems?.map((item, i) => (
35
- <AccordionItem key={String(i)} label={item.text}>
35
+ <RollupItem key={String(i)} label={item?.text}>
36
36
  <LinkList documents={item.items} />
37
- </AccordionItem>
37
+ </RollupItem>
38
38
  ))}
39
- </AccordionItemsList>
39
+ </div>
40
40
  <div>{sitemap?.dispositions?.map(renderSubMenuItem)}</div>
41
41
  <MobileAppTile
42
42
  title="Мобильное приложение"
@@ -47,7 +47,7 @@ export const Footer = JSX<FooterProps>(({ className = '', ...rest }) => {
47
47
  <SocialMedia className="pb-4" media={socialMedia} />
48
48
  <HorizontalNavigation title={horizontalNavigationTitle} links={relatedEnterprises} />
49
49
  <TextInformation links={documents} />
50
- </footer>
50
+ </BlockWrapper>
51
51
  );
52
52
  });
53
53
 
@@ -12,9 +12,8 @@ import type { SitemapDataProps } from '../../services/sitemap/SitemapProps';
12
12
  import { useSWRResource } from '../../services/sitemap/useSWRResource';
13
13
  import { BlockWrapper } from '../../ui-kit/BlockWrapper';
14
14
  import { HeaderItem } from '../../ui-kit/HeaderItem/HeaderItem';
15
- import { AccordionItemsList } from '../Accordion/AccordionItemsList';
16
- import { AccordionItem } from '../AccordionItem/AccordionItem';
17
15
  import { LinkList } from '../LinkList/LinkList';
16
+ import { RollupItem } from '../RollupItem/RollupItem';
18
17
  import { HeaderBurger } from './HeaderBurger';
19
18
  import type { HeaderContent } from './HeaderContent';
20
19
  import { HeaderTop } from './HeaderTop';
@@ -65,13 +64,13 @@ export const Header = JSX<HeaderProps>(
65
64
  burgerSubMenu={dispositions}
66
65
  defaultLocation={defaultLocation}
67
66
  >
68
- <AccordionItemsList>
67
+ <div className="list-none m-0 p-0">
69
68
  {topItems?.map((item, i) => (
70
- <AccordionItem key={String(i)} label={item.text}>
69
+ <RollupItem key={String(i)} label={item.text}>
71
70
  <LinkList documents={item.items} />
72
- </AccordionItem>
71
+ </RollupItem>
73
72
  ))}
74
- </AccordionItemsList>
73
+ </div>
75
74
  </HeaderBurger>
76
75
  ) : null}
77
76
  </BlockWrapper>
@@ -18,14 +18,17 @@ export const Headline = JSX<HeadlineProps>(
18
18
  headlineVersion = 'XL',
19
19
  align = 'text-center',
20
20
  as,
21
+ isPadding = true,
21
22
  ...rest
22
23
  }) => {
23
24
  const versionStyle = headlineVersionStyles[headlineVersion];
25
+ const paddingStyle = isPadding ? 'p-12' : '';
24
26
 
25
27
  return (
26
28
  <BlockWrapper
27
29
  className={style(
28
- 'flex flex-col p-12 group-data-secondary:bg-primary-main group-data-secondary:text-white',
30
+ 'flex flex-col group-data-secondary:bg-primary-main group-data-secondary:text-white',
31
+ paddingStyle,
29
32
  versionStyle.wrapper,
30
33
  className,
31
34
  )}
@@ -13,4 +13,6 @@ export type HeadlineContent = UniBlockContent &
13
13
  align?: TextAlign;
14
14
  /** @hidden */
15
15
  as?: HeadingTagType;
16
+ /** @title Внутренний отступ блока */
17
+ isPadding?: boolean;
16
18
  };
@@ -16,8 +16,8 @@ const options = {
16
16
  } as BlockRendererOptions;
17
17
 
18
18
  export const OTHER_PRODUCTS_ITEM: BlockDef = {
19
- type: 'OtherProductsItem',
20
- content: { label: 'OtherProducts №1 Tiles' },
19
+ type: 'RollupItem',
20
+ content: { label: 'OtherProducts №1 Tiles', version: 'secondary' },
21
21
  blocks: [
22
22
  { type: 'Tile', content: TILE_PREMIUM, style: ['col-span-6'] },
23
23
  { type: 'Tile', content: TILE_PREMIUM, style: ['col-span-6'] },
@@ -36,8 +36,9 @@ export default {
36
36
  blocks: [
37
37
  OTHER_PRODUCTS_ITEM,
38
38
  {
39
- type: 'OtherProductsItem',
40
- content: { label: 'OtherProducts №2 Product_Tiles' },
39
+ type: 'RollupItem',
40
+
41
+ content: { label: 'OtherProducts №2 Product_Tiles', version: 'secondary' },
41
42
  blocks: [
42
43
  { type: 'ProductTile', content: PRODUCT_TILE, style: ['col-span-6'] },
43
44
  { type: 'ProductTile', content: PRODUCT_TILE, style: ['col-span-6'] },
@@ -46,16 +47,16 @@ export default {
46
47
  ],
47
48
  },
48
49
  {
49
- type: 'OtherProductsItem',
50
- content: { label: 'OtherProducts №3 Product_Block' },
50
+ type: 'RollupItem',
51
+ content: { label: 'OtherProducts №3 Product_Block', version: 'secondary' },
51
52
  blocks: [
52
53
  { type: 'ProductBlock', content: PRODUCT_BLOCK, style: ['col-span-6'] },
53
54
  { type: 'ProductBlock', content: PRODUCT_BLOCK, style: ['col-span-6'] },
54
55
  ],
55
56
  },
56
57
  {
57
- type: 'OtherProductsItem',
58
- content: { label: 'OtherProducts №4 Text_Block' },
58
+ type: 'RollupItem',
59
+ content: { label: 'OtherProducts №4 Text_Block', version: 'secondary' },
59
60
  blocks: [
60
61
  { type: 'TextBlock', content: TEXT_BLOCK },
61
62
  { type: 'TextBlock', content: TEXT_BLOCK },
@@ -64,18 +65,18 @@ export default {
64
65
  ],
65
66
  },
66
67
  {
67
- type: 'OtherProductsItem',
68
- content: { label: 'OtherProducts №5 Picture_Text' },
68
+ type: 'RollupItem',
69
+ content: { label: 'OtherProducts №5 Picture_Text', version: 'secondary' },
69
70
  blocks: [{ type: 'PictureText', content: PICTURE_TEXT }],
70
71
  },
71
72
  {
72
- type: 'OtherProductsItem',
73
- content: { label: 'OtherProducts №6 Headline' },
73
+ type: 'RollupItem',
74
+ content: { label: 'OtherProducts №6 Headline', version: 'secondary' },
74
75
  blocks: [{ type: 'Headline', content: HEADLINE }],
75
76
  },
76
77
  {
77
- type: 'OtherProductsItem',
78
- content: { label: 'OtherProducts №7 Link_Docs' },
78
+ type: 'RollupItem',
79
+ content: { label: 'OtherProducts №7 Link_Docs', version: 'secondary' },
79
80
  blocks: [{ type: 'LinkDocs', content: linkDocsContentExample }],
80
81
  },
81
82
  ],
@@ -0,0 +1,33 @@
1
+ import type { BlockRendererOptions } from '../../BlockRenderer/BlockRendererOptions';
2
+ import { BlockDef } from '../../model/ContentPageDef';
3
+ import { Blocks } from '../Blocks.mobile';
4
+
5
+ import { TEXT_BLOCK } from '../TextBlock/TextBlock.fixture.mobile';
6
+ import { RollupItem } from './RollupItem.mobile';
7
+
8
+ const options = {
9
+ blocksRegistry: Blocks,
10
+ } as BlockRendererOptions;
11
+
12
+ export const ROLLUP_ITEM: BlockDef = {
13
+ type: 'RollupItem',
14
+ content: {
15
+ label: 'RollupItem label 1',
16
+ labelIcon: { icon: 'CardIcon' },
17
+ isExpanded: true,
18
+ },
19
+ blocks: [
20
+ { type: 'TextBlock', content: TEXT_BLOCK },
21
+ { type: 'TextBlock', content: TEXT_BLOCK },
22
+ ],
23
+ };
24
+
25
+ export default {
26
+ default: (
27
+ <div>
28
+ <div className="list-none m-0 p-0">
29
+ <RollupItem {...ROLLUP_ITEM.content} block={ROLLUP_ITEM} options={options} />
30
+ </div>
31
+ </div>
32
+ ),
33
+ };
@@ -0,0 +1,143 @@
1
+ import { JSX } from '@redneckz/uni-jsx';
2
+ import { getParentBlockContent } from '../../BlockRenderer/getParentBlockContent';
3
+ import { renderChildren } from '../../BlockRenderer/renderChildren';
4
+ import type { IconName } from '../../icons/IconName';
5
+ import { BlockVersion } from '../../model/BlockVersion';
6
+ import type { JSXBlock, UniBlockProps } from '../../model/JSXBlock';
7
+ import { Picture } from '../../model/Picture';
8
+ import { BlockWrapper } from '../../ui-kit/BlockWrapper';
9
+ import { DefaultFoldButton } from '../../ui-kit/Foldable/DefaultFoldButton';
10
+ import { Foldable } from '../../ui-kit/Foldable/Foldable';
11
+ import type { FoldablePartProps } from '../../ui-kit/Foldable/FoldablePartProps';
12
+ import { FoldableSection } from '../../ui-kit/Foldable/FoldableSection';
13
+ import { Img } from '../../ui-kit/Img/Img';
14
+ import { Text } from '../../ui-kit/Text/Text';
15
+ import { getIconWithVersion } from '../../utils/getIconWithVersion';
16
+ import { style } from '../../utils/style';
17
+ import { AccordionContent } from '../Accordion/AccordionContent';
18
+ import type { RollupItemContent } from './RollupItemContent';
19
+
20
+ export interface RollupItemProps extends RollupItemContent, UniBlockProps {}
21
+
22
+ export const RollupItem: JSXBlock<RollupItemProps> = JSX<RollupItemProps>(
23
+ ({
24
+ className = '',
25
+ label = 'Развернуть',
26
+ isExpanded,
27
+ isFoldButtonOnTop = true,
28
+ version = 'primary',
29
+ ...rest
30
+ }) => {
31
+ const { bordered } = getParentBlockContent(rest.options, {} as AccordionContent);
32
+
33
+ return (
34
+ <BlockWrapper
35
+ className={style(
36
+ 'border-b border-solid border-main-divider w-full',
37
+ bordered ? 'border p-4 rounded mb-4' : 'border-0 border-b last:border-b-0',
38
+ className,
39
+ )}
40
+ tag="div"
41
+ version="transparent"
42
+ {...rest}
43
+ >
44
+ <Foldable
45
+ isFoldButtonOnTop={isFoldButtonOnTop}
46
+ unfoldedByDefault={isExpanded}
47
+ renderFoldableSection={({ isUnfolded }) => (
48
+ <FoldableSection
49
+ className="flex flex-wrap group-last:last:pb-0 gap-5 [&>*]:p-0"
50
+ isUnfolded={isUnfolded}
51
+ >
52
+ {renderChildren(rest)}
53
+ </FoldableSection>
54
+ )}
55
+ renderFoldButton={({ isUnfolded, onToggle }) =>
56
+ renderFoldButton({ version, label, isUnfolded, onToggle })
57
+ }
58
+ />
59
+ </BlockWrapper>
60
+ );
61
+ },
62
+ );
63
+
64
+ RollupItem.childrenTypes = {
65
+ exclude: ['RollupItem', 'Accordion', 'OtherProducts'],
66
+ };
67
+
68
+ interface FoldButtonProps extends FoldablePartProps {
69
+ version?: BlockVersion;
70
+ label?: string;
71
+ className?: string;
72
+ primaryIcon?: Picture;
73
+ }
74
+
75
+ const renderFoldButton = ({
76
+ version,
77
+ label: defaultLabel,
78
+ isUnfolded,
79
+ onToggle,
80
+ className = '',
81
+ primaryIcon,
82
+ }: FoldButtonProps) => {
83
+ const label = defaultLabel || (isUnfolded ? 'Скрыть' : 'Развернуть');
84
+
85
+ return version === 'primary' ? (
86
+ renderPrimaryFoldButton({
87
+ label,
88
+ icon: isUnfolded ? 'MinusIcon' : 'PlusIcon',
89
+ onToggle,
90
+ className,
91
+ primaryIcon,
92
+ })
93
+ ) : (
94
+ <DefaultFoldButton
95
+ label={label}
96
+ icon={isUnfolded ? 'ArrowUpIcon' : 'ArrowDownIcon'}
97
+ onClick={onToggle}
98
+ />
99
+ );
100
+ };
101
+
102
+ interface PrimaryFoldButtonProps {
103
+ label?: string;
104
+ icon?: IconName;
105
+ primaryIcon?: Picture;
106
+ onToggle?: () => void;
107
+ onClick?: () => void;
108
+ className?: string;
109
+ }
110
+
111
+ const renderPrimaryFoldButton = ({
112
+ label,
113
+ icon,
114
+ primaryIcon,
115
+ onToggle,
116
+ }: PrimaryFoldButtonProps) => (
117
+ <button
118
+ className={`border-none bg-transparent flex justify-between text-left w-full text-primary-text group cursor-pointer py-3.5 px-0`}
119
+ onClick={onToggle}
120
+ >
121
+ <div className="flex group-hover:text-primary-main">
122
+ {primaryIcon ? (
123
+ <Img
124
+ image={{ ...getIconWithVersion({ ...primaryIcon } as Picture) }}
125
+ className="mr-3 flex-shrink-0"
126
+ width="24"
127
+ height="24"
128
+ asSVG
129
+ />
130
+ ) : null}
131
+ <Text size="text-m-title-xs" font="font-medium">
132
+ {label}
133
+ </Text>
134
+ </div>
135
+ <Img
136
+ className="flex-shrink-0"
137
+ image={{ ...getIconWithVersion({ icon: icon }) }}
138
+ width="24"
139
+ height="24"
140
+ asSVG
141
+ />
142
+ </button>
143
+ );