@redneckz/wildless-cms-uni-blocks 0.11.2 → 0.11.3

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 (446) hide show
  1. package/bin/migration-scripts/0.11.1.js +34 -0
  2. package/bundle/blocks.schema.json +1 -1
  3. package/bundle/bundle.umd.js +76 -56
  4. package/bundle/bundle.umd.min.js +1 -1
  5. package/bundle/components/ButtonsBlock/ButtonsBlock.d.ts +6 -0
  6. package/bundle/components/ButtonsBlock/ButtonsBlockContent.d.ts +8 -0
  7. package/bundle/components/CarouselCard/CarouselCard.d.ts +1 -1
  8. package/bundle/components/CarouselCard/getCardWidth.d.ts +1 -0
  9. package/bundle/components/CarouselCard/titleSize.d.ts +1 -0
  10. package/bundle/components/CarouselCard/titleSize.mobile.d.ts +1 -0
  11. package/bundle/components/Footer/Contacts.d.ts +2 -2
  12. package/bundle/components/Footer/FooterContent.d.ts +9 -1
  13. package/bundle/components/Footer/FooterDataProps.d.ts +2 -2
  14. package/bundle/components/PictureText/positionStyle.d.ts +1 -0
  15. package/bundle/components/PictureText/positionStyle.mobile.d.ts +1 -0
  16. package/bundle/components/PictureText/renderInsuranceSumMonth.d.ts +2 -0
  17. package/bundle/components/PictureText/styleInsuranceSum.d.ts +1 -0
  18. package/bundle/components/PictureText/styleInsuranceSum.mobile.d.ts +1 -0
  19. package/bundle/components/PictureText/styleValueBlock.d.ts +2 -0
  20. package/bundle/components/PictureText/styleValueBlock.mobile.d.ts +2 -0
  21. package/bundle/components/RollupItem/RollupItemContent.d.ts +4 -2
  22. package/bundle/components/RollupItem/renderRoundedIcon.d.ts +3 -0
  23. package/bundle/components/RollupItem/renderRoundedIcon.mobile.d.ts +4 -0
  24. package/bundle/ui-kit/BenefitItem/borderRadius.mobile.d.ts +1 -0
  25. package/bundle/ui-kit/BenefitItem/labelSize.d.ts +1 -0
  26. package/bundle/ui-kit/BenefitItem/labelSize.mobile.d.ts +1 -0
  27. package/bundle/ui-kit/Icon/IconProps.d.ts +8 -3
  28. package/bundle/ui-kit/Icon/RoundedIcon.d.ts +5 -1
  29. package/dist/components/BenefitsBlock/BenefitsBlock.js +1 -1
  30. package/dist/components/Blocks.js +2 -2
  31. package/dist/components/Blocks.js.map +1 -1
  32. package/dist/components/Blocks.mobile.js +6 -0
  33. package/dist/components/Blocks.mobile.js.map +1 -1
  34. package/dist/components/Bonus/Bonus.js +1 -1
  35. package/dist/components/BusinessBlock/BusinessCard.js +1 -1
  36. package/dist/components/ButtonsBlock/ButtonsBlock.d.ts +6 -0
  37. package/{mobile/dist/components/ButtonBlock/ButtonBlock.js → dist/components/ButtonsBlock/ButtonsBlock.js} +3 -3
  38. package/dist/components/ButtonsBlock/ButtonsBlock.js.map +1 -0
  39. package/dist/components/ButtonsBlock/ButtonsBlockContent.d.ts +8 -0
  40. package/dist/components/{ButtonBlock/ButtonBlockContent.js → ButtonsBlock/ButtonsBlockContent.js} +1 -1
  41. package/dist/components/ButtonsBlock/ButtonsBlockContent.js.map +1 -0
  42. package/dist/components/CardTransfer/CardTransfer.js +1 -1
  43. package/dist/components/CardTransfer/CardTransfer.js.map +1 -1
  44. package/dist/components/CarouselCard/CarouselCard.d.ts +1 -1
  45. package/dist/components/CarouselCard/CarouselCard.js +9 -7
  46. package/dist/components/CarouselCard/CarouselCard.js.map +1 -1
  47. package/dist/components/CarouselCard/getCardWidth.d.ts +1 -0
  48. package/dist/components/CarouselCard/getCardWidth.js +18 -0
  49. package/dist/components/CarouselCard/getCardWidth.js.map +1 -0
  50. package/dist/components/CarouselCard/titleSize.d.ts +1 -0
  51. package/dist/components/CarouselCard/titleSize.js +4 -0
  52. package/dist/components/CarouselCard/titleSize.js.map +1 -0
  53. package/dist/components/CarouselCard/titleSize.mobile.d.ts +1 -0
  54. package/dist/components/CarouselCard/titleSize.mobile.js +4 -0
  55. package/dist/components/CarouselCard/titleSize.mobile.js.map +1 -0
  56. package/dist/components/CarouselProductCard/CarouselProductCard.js +1 -1
  57. package/dist/components/CarouselProductCard/CarouselProductCard.js.map +1 -1
  58. package/dist/components/Footer/Contacts.d.ts +2 -2
  59. package/dist/components/Footer/Contacts.js +4 -5
  60. package/dist/components/Footer/Contacts.js.map +1 -1
  61. package/dist/components/Footer/FooterContent.d.ts +9 -1
  62. package/dist/components/Footer/FooterDataProps.d.ts +2 -2
  63. package/dist/components/PictureText/PictureText.js +5 -11
  64. package/dist/components/PictureText/PictureText.js.map +1 -1
  65. package/dist/components/PictureText/positionStyle.d.ts +1 -0
  66. package/dist/components/PictureText/positionStyle.js +4 -0
  67. package/dist/components/PictureText/positionStyle.js.map +1 -0
  68. package/dist/components/PictureText/positionStyle.mobile.d.ts +1 -0
  69. package/dist/components/PictureText/positionStyle.mobile.js +4 -0
  70. package/dist/components/PictureText/positionStyle.mobile.js.map +1 -0
  71. package/dist/components/PictureText/renderInsuranceSumMonth.d.ts +2 -0
  72. package/dist/components/PictureText/renderInsuranceSumMonth.js +15 -0
  73. package/dist/components/PictureText/renderInsuranceSumMonth.js.map +1 -0
  74. package/dist/components/PictureText/styleInsuranceSum.d.ts +1 -0
  75. package/dist/components/PictureText/styleInsuranceSum.js +4 -0
  76. package/dist/components/PictureText/styleInsuranceSum.js.map +1 -0
  77. package/dist/components/PictureText/styleInsuranceSum.mobile.d.ts +1 -0
  78. package/dist/components/PictureText/styleInsuranceSum.mobile.js +4 -0
  79. package/dist/components/PictureText/styleInsuranceSum.mobile.js.map +1 -0
  80. package/dist/components/PictureText/styleValueBlock.d.ts +2 -0
  81. package/dist/components/PictureText/styleValueBlock.js +5 -0
  82. package/dist/components/PictureText/styleValueBlock.js.map +1 -0
  83. package/dist/components/PictureText/styleValueBlock.mobile.d.ts +2 -0
  84. package/dist/components/PictureText/styleValueBlock.mobile.js +5 -0
  85. package/dist/components/PictureText/styleValueBlock.mobile.js.map +1 -0
  86. package/dist/components/RollupItem/RollupItem.js +14 -9
  87. package/dist/components/RollupItem/RollupItem.js.map +1 -1
  88. package/dist/components/RollupItem/RollupItemContent.d.ts +4 -2
  89. package/dist/components/RollupItem/renderRoundedIcon.d.ts +3 -0
  90. package/dist/components/RollupItem/renderRoundedIcon.js +5 -0
  91. package/dist/components/RollupItem/renderRoundedIcon.js.map +1 -0
  92. package/dist/components/RollupItem/renderRoundedIcon.mobile.d.ts +4 -0
  93. package/dist/components/RollupItem/renderRoundedIcon.mobile.js +7 -0
  94. package/dist/components/RollupItem/renderRoundedIcon.mobile.js.map +1 -0
  95. package/dist/ui-kit/BenefitItem/BenefitItem.js +12 -11
  96. package/dist/ui-kit/BenefitItem/BenefitItem.js.map +1 -1
  97. package/dist/ui-kit/BenefitItem/borderRadius.mobile.d.ts +1 -0
  98. package/dist/ui-kit/BenefitItem/borderRadius.mobile.js +4 -0
  99. package/dist/ui-kit/BenefitItem/borderRadius.mobile.js.map +1 -0
  100. package/dist/ui-kit/BenefitItem/labelSize.d.ts +1 -0
  101. package/dist/ui-kit/BenefitItem/labelSize.js +4 -0
  102. package/dist/ui-kit/BenefitItem/labelSize.js.map +1 -0
  103. package/dist/ui-kit/BenefitItem/labelSize.mobile.d.ts +1 -0
  104. package/dist/ui-kit/BenefitItem/labelSize.mobile.js +4 -0
  105. package/dist/ui-kit/BenefitItem/labelSize.mobile.js.map +1 -0
  106. package/dist/ui-kit/Button/renderButtonsSection.js +2 -2
  107. package/dist/ui-kit/Button/renderButtonsSection.js.map +1 -1
  108. package/dist/ui-kit/Icon/IconProps.d.ts +8 -3
  109. package/dist/ui-kit/Icon/RoundedIcon.d.ts +5 -1
  110. package/dist/ui-kit/Icon/RoundedIcon.js +5 -1
  111. package/dist/ui-kit/Icon/RoundedIcon.js.map +1 -1
  112. package/lib/common.css +1 -1
  113. package/lib/components/BenefitsBlock/BenefitsBlock.js +1 -1
  114. package/lib/components/Blocks.js +2 -2
  115. package/lib/components/Blocks.js.map +1 -1
  116. package/lib/components/Blocks.mobile.js +6 -0
  117. package/lib/components/Blocks.mobile.js.map +1 -1
  118. package/lib/components/Bonus/Bonus.js +1 -1
  119. package/lib/components/BusinessBlock/BusinessCard.js +1 -1
  120. package/lib/components/ButtonsBlock/ButtonsBlock.d.ts +6 -0
  121. package/lib/components/ButtonsBlock/ButtonsBlock.fixture.mobile.d.ts +6 -0
  122. package/lib/components/{ButtonBlock/ButtonBlock.js → ButtonsBlock/ButtonsBlock.js} +2 -2
  123. package/lib/components/ButtonsBlock/ButtonsBlock.js.map +1 -0
  124. package/lib/components/ButtonsBlock/ButtonsBlockContent.d.ts +8 -0
  125. package/lib/components/ButtonsBlock/ButtonsBlockContent.js +2 -0
  126. package/lib/components/ButtonsBlock/ButtonsBlockContent.js.map +1 -0
  127. package/lib/components/CardTransfer/CardTransfer.fixture.mobile.d.ts +6 -0
  128. package/lib/components/CardTransfer/CardTransfer.js +1 -1
  129. package/lib/components/CardTransfer/CardTransfer.js.map +1 -1
  130. package/lib/components/CarouselCard/CarouselCard.d.ts +1 -1
  131. package/lib/components/CarouselCard/CarouselCard.fixture.mobile.d.ts +8 -0
  132. package/lib/components/CarouselCard/CarouselCard.js +9 -7
  133. package/lib/components/CarouselCard/CarouselCard.js.map +1 -1
  134. package/lib/components/CarouselCard/getCardWidth.d.ts +1 -0
  135. package/lib/components/CarouselCard/getCardWidth.js +15 -0
  136. package/lib/components/CarouselCard/getCardWidth.js.map +1 -0
  137. package/lib/components/CarouselCard/titleSize.d.ts +1 -0
  138. package/lib/components/CarouselCard/titleSize.js +2 -0
  139. package/lib/components/CarouselCard/titleSize.js.map +1 -0
  140. package/lib/components/CarouselCard/titleSize.mobile.d.ts +1 -0
  141. package/lib/components/CarouselCard/titleSize.mobile.js +2 -0
  142. package/lib/components/CarouselCard/titleSize.mobile.js.map +1 -0
  143. package/lib/components/CarouselProductCard/CarouselProductCard.js +1 -1
  144. package/lib/components/CarouselProductCard/CarouselProductCard.js.map +1 -1
  145. package/lib/components/Footer/Contacts.d.ts +2 -2
  146. package/lib/components/Footer/Contacts.js +4 -5
  147. package/lib/components/Footer/Contacts.js.map +1 -1
  148. package/lib/components/Footer/FooterContent.d.ts +9 -1
  149. package/lib/components/Footer/FooterDataProps.d.ts +2 -2
  150. package/lib/components/PictureText/PictureText.fixture.mobile.d.ts +14 -0
  151. package/lib/components/PictureText/PictureText.js +5 -11
  152. package/lib/components/PictureText/PictureText.js.map +1 -1
  153. package/lib/components/PictureText/positionStyle.d.ts +1 -0
  154. package/lib/components/PictureText/positionStyle.js +2 -0
  155. package/lib/components/PictureText/positionStyle.js.map +1 -0
  156. package/lib/components/PictureText/positionStyle.mobile.d.ts +1 -0
  157. package/lib/components/PictureText/positionStyle.mobile.js +2 -0
  158. package/lib/components/PictureText/positionStyle.mobile.js.map +1 -0
  159. package/lib/components/PictureText/renderBenefit.d.ts +0 -1
  160. package/lib/components/PictureText/renderInsuranceSumMonth.d.ts +1 -0
  161. package/lib/components/PictureText/renderInsuranceSumMonth.js +12 -0
  162. package/lib/components/PictureText/renderInsuranceSumMonth.js.map +1 -0
  163. package/lib/components/PictureText/styleInsuranceSum.d.ts +1 -0
  164. package/lib/components/PictureText/styleInsuranceSum.js +2 -0
  165. package/lib/components/PictureText/styleInsuranceSum.js.map +1 -0
  166. package/lib/components/PictureText/styleInsuranceSum.mobile.d.ts +1 -0
  167. package/lib/components/PictureText/styleInsuranceSum.mobile.js +2 -0
  168. package/lib/components/PictureText/styleInsuranceSum.mobile.js.map +1 -0
  169. package/lib/components/PictureText/styleValueBlock.d.ts +2 -0
  170. package/lib/components/PictureText/styleValueBlock.js +3 -0
  171. package/lib/components/PictureText/styleValueBlock.js.map +1 -0
  172. package/lib/components/PictureText/styleValueBlock.mobile.d.ts +2 -0
  173. package/lib/components/PictureText/styleValueBlock.mobile.js +3 -0
  174. package/lib/components/PictureText/styleValueBlock.mobile.js.map +1 -0
  175. package/lib/components/RollupItem/RollupItem.fixture.mobile.d.ts +1 -0
  176. package/lib/components/RollupItem/RollupItem.js +14 -9
  177. package/lib/components/RollupItem/RollupItem.js.map +1 -1
  178. package/lib/components/RollupItem/RollupItemContent.d.ts +4 -2
  179. package/lib/components/RollupItem/renderRoundedIcon.d.ts +3 -0
  180. package/lib/components/RollupItem/renderRoundedIcon.js +2 -0
  181. package/lib/components/RollupItem/renderRoundedIcon.js.map +1 -0
  182. package/lib/components/RollupItem/renderRoundedIcon.mobile.d.ts +3 -0
  183. package/lib/components/RollupItem/renderRoundedIcon.mobile.js +4 -0
  184. package/lib/components/RollupItem/renderRoundedIcon.mobile.js.map +1 -0
  185. package/lib/ui-kit/BenefitItem/BenefitItem.js +12 -11
  186. package/lib/ui-kit/BenefitItem/BenefitItem.js.map +1 -1
  187. package/lib/ui-kit/BenefitItem/borderRadius.mobile.d.ts +1 -0
  188. package/lib/ui-kit/BenefitItem/borderRadius.mobile.js +2 -0
  189. package/lib/ui-kit/BenefitItem/borderRadius.mobile.js.map +1 -0
  190. package/lib/ui-kit/BenefitItem/labelSize.d.ts +1 -0
  191. package/lib/ui-kit/BenefitItem/labelSize.js +2 -0
  192. package/lib/ui-kit/BenefitItem/labelSize.js.map +1 -0
  193. package/lib/ui-kit/BenefitItem/labelSize.mobile.d.ts +1 -0
  194. package/lib/ui-kit/BenefitItem/labelSize.mobile.js +2 -0
  195. package/lib/ui-kit/BenefitItem/labelSize.mobile.js.map +1 -0
  196. package/lib/ui-kit/Button/renderButtonsSection.js +2 -2
  197. package/lib/ui-kit/Button/renderButtonsSection.js.map +1 -1
  198. package/lib/ui-kit/Icon/IconProps.d.ts +8 -3
  199. package/lib/ui-kit/Icon/RoundedIcon.d.ts +5 -1
  200. package/lib/ui-kit/Icon/RoundedIcon.js +5 -1
  201. package/lib/ui-kit/Icon/RoundedIcon.js.map +1 -1
  202. package/mobile/bundle/bundle.umd.js +542 -378
  203. package/mobile/bundle/bundle.umd.min.js +1 -1
  204. package/mobile/bundle/components/ButtonsBlock/ButtonsBlock.d.ts +6 -0
  205. package/mobile/bundle/components/ButtonsBlock/ButtonsBlockContent.d.ts +8 -0
  206. package/mobile/bundle/components/CarouselCard/CarouselCard.d.ts +1 -1
  207. package/mobile/bundle/components/CarouselCard/getCardWidth.d.ts +1 -0
  208. package/mobile/bundle/components/CarouselCard/titleSize.d.ts +1 -0
  209. package/mobile/bundle/components/Footer/Contacts.d.ts +2 -2
  210. package/mobile/bundle/components/Footer/FooterContent.d.ts +9 -1
  211. package/mobile/bundle/components/Footer/FooterDataProps.d.ts +2 -2
  212. package/mobile/bundle/components/PictureText/positionStyle.d.ts +1 -0
  213. package/mobile/bundle/components/PictureText/renderInsuranceSumMonth.d.ts +2 -0
  214. package/mobile/bundle/components/PictureText/styleInsuranceSum.d.ts +1 -0
  215. package/mobile/bundle/components/PictureText/styleValueBlock.d.ts +2 -0
  216. package/mobile/bundle/components/RollupItem/RollupItemContent.d.ts +4 -2
  217. package/mobile/bundle/components/RollupItem/renderRoundedIcon.d.ts +4 -0
  218. package/mobile/bundle/ui-kit/BenefitItem/labelSize.d.ts +1 -0
  219. package/mobile/bundle/ui-kit/Icon/IconProps.d.ts +8 -3
  220. package/mobile/bundle/ui-kit/Icon/RoundedIcon.d.ts +5 -1
  221. package/mobile/dist/components/BenefitsBlock/BenefitsBlock.js +1 -1
  222. package/mobile/dist/components/Blocks.js +6 -0
  223. package/mobile/dist/components/Blocks.js.map +1 -1
  224. package/mobile/dist/components/Bonus/Bonus.js +1 -1
  225. package/mobile/dist/components/BusinessBlock/BusinessCard.js +1 -1
  226. package/mobile/dist/components/ButtonsBlock/ButtonsBlock.d.ts +6 -0
  227. package/{dist/components/ButtonBlock/ButtonBlock.js → mobile/dist/components/ButtonsBlock/ButtonsBlock.js} +3 -3
  228. package/mobile/dist/components/ButtonsBlock/ButtonsBlock.js.map +1 -0
  229. package/mobile/dist/components/ButtonsBlock/ButtonsBlockContent.d.ts +8 -0
  230. package/mobile/dist/components/{ButtonBlock/ButtonBlockContent.js → ButtonsBlock/ButtonsBlockContent.js} +1 -1
  231. package/mobile/dist/components/ButtonsBlock/ButtonsBlockContent.js.map +1 -0
  232. package/mobile/dist/components/CardTransfer/CardTransfer.js +1 -1
  233. package/mobile/dist/components/CardTransfer/CardTransfer.js.map +1 -1
  234. package/mobile/dist/components/CarouselCard/CarouselCard.d.ts +1 -1
  235. package/mobile/dist/components/CarouselCard/CarouselCard.js +9 -7
  236. package/mobile/dist/components/CarouselCard/CarouselCard.js.map +1 -1
  237. package/mobile/dist/components/CarouselCard/getCardWidth.d.ts +1 -0
  238. package/mobile/dist/components/CarouselCard/getCardWidth.js +18 -0
  239. package/mobile/dist/components/CarouselCard/getCardWidth.js.map +1 -0
  240. package/mobile/dist/components/CarouselCard/titleSize.d.ts +1 -0
  241. package/mobile/dist/components/CarouselCard/titleSize.js +4 -0
  242. package/mobile/dist/components/CarouselCard/titleSize.js.map +1 -0
  243. package/mobile/dist/components/CarouselProductCard/CarouselProductCard.js +1 -1
  244. package/mobile/dist/components/CarouselProductCard/CarouselProductCard.js.map +1 -1
  245. package/mobile/dist/components/Footer/Contacts.d.ts +2 -2
  246. package/mobile/dist/components/Footer/Contacts.js +4 -5
  247. package/mobile/dist/components/Footer/Contacts.js.map +1 -1
  248. package/mobile/dist/components/Footer/FooterContent.d.ts +9 -1
  249. package/mobile/dist/components/Footer/FooterDataProps.d.ts +2 -2
  250. package/mobile/dist/components/PictureText/PictureText.js +5 -11
  251. package/mobile/dist/components/PictureText/PictureText.js.map +1 -1
  252. package/mobile/dist/components/PictureText/positionStyle.d.ts +1 -0
  253. package/mobile/dist/components/PictureText/positionStyle.js +4 -0
  254. package/mobile/dist/components/PictureText/positionStyle.js.map +1 -0
  255. package/mobile/dist/components/PictureText/renderInsuranceSumMonth.d.ts +2 -0
  256. package/mobile/dist/components/PictureText/renderInsuranceSumMonth.js +15 -0
  257. package/mobile/dist/components/PictureText/renderInsuranceSumMonth.js.map +1 -0
  258. package/mobile/dist/components/PictureText/styleInsuranceSum.d.ts +1 -0
  259. package/mobile/dist/components/PictureText/styleInsuranceSum.js +4 -0
  260. package/mobile/dist/components/PictureText/styleInsuranceSum.js.map +1 -0
  261. package/mobile/dist/components/PictureText/styleValueBlock.d.ts +2 -0
  262. package/mobile/dist/components/PictureText/styleValueBlock.js +5 -0
  263. package/mobile/dist/components/PictureText/styleValueBlock.js.map +1 -0
  264. package/mobile/dist/components/RollupItem/RollupItem.js +14 -9
  265. package/mobile/dist/components/RollupItem/RollupItem.js.map +1 -1
  266. package/mobile/dist/components/RollupItem/RollupItemContent.d.ts +4 -2
  267. package/mobile/dist/components/RollupItem/renderRoundedIcon.d.ts +4 -0
  268. package/mobile/dist/components/RollupItem/renderRoundedIcon.js +7 -0
  269. package/mobile/dist/components/RollupItem/renderRoundedIcon.js.map +1 -0
  270. package/mobile/dist/ui-kit/BenefitItem/BenefitItem.js +12 -11
  271. package/mobile/dist/ui-kit/BenefitItem/BenefitItem.js.map +1 -1
  272. package/mobile/dist/ui-kit/BenefitItem/labelSize.d.ts +1 -0
  273. package/mobile/dist/ui-kit/BenefitItem/labelSize.js +4 -0
  274. package/mobile/dist/ui-kit/BenefitItem/labelSize.js.map +1 -0
  275. package/mobile/dist/ui-kit/Button/renderButtonsSection.js +2 -2
  276. package/mobile/dist/ui-kit/Button/renderButtonsSection.js.map +1 -1
  277. package/mobile/dist/ui-kit/Icon/IconProps.d.ts +8 -3
  278. package/mobile/dist/ui-kit/Icon/RoundedIcon.d.ts +5 -1
  279. package/mobile/dist/ui-kit/Icon/RoundedIcon.js +5 -1
  280. package/mobile/dist/ui-kit/Icon/RoundedIcon.js.map +1 -1
  281. package/mobile/lib/common.css +1 -1
  282. package/mobile/lib/components/BenefitsBlock/BenefitsBlock.js +1 -1
  283. package/mobile/lib/components/Blocks.js +6 -0
  284. package/mobile/lib/components/Blocks.js.map +1 -1
  285. package/mobile/lib/components/Bonus/Bonus.js +1 -1
  286. package/mobile/lib/components/BusinessBlock/BusinessCard.js +1 -1
  287. package/mobile/lib/components/ButtonsBlock/ButtonsBlock.d.ts +6 -0
  288. package/mobile/lib/components/{ButtonBlock/ButtonBlock.js → ButtonsBlock/ButtonsBlock.js} +2 -2
  289. package/mobile/lib/components/ButtonsBlock/ButtonsBlock.js.map +1 -0
  290. package/mobile/lib/components/ButtonsBlock/ButtonsBlockContent.d.ts +8 -0
  291. package/mobile/lib/components/ButtonsBlock/ButtonsBlockContent.js +2 -0
  292. package/mobile/lib/components/ButtonsBlock/ButtonsBlockContent.js.map +1 -0
  293. package/mobile/lib/components/CardTransfer/CardTransfer.js +1 -1
  294. package/mobile/lib/components/CardTransfer/CardTransfer.js.map +1 -1
  295. package/mobile/lib/components/CarouselCard/CarouselCard.d.ts +1 -1
  296. package/mobile/lib/components/CarouselCard/CarouselCard.js +9 -7
  297. package/mobile/lib/components/CarouselCard/CarouselCard.js.map +1 -1
  298. package/mobile/lib/components/CarouselCard/getCardWidth.d.ts +1 -0
  299. package/mobile/lib/components/CarouselCard/getCardWidth.js +15 -0
  300. package/mobile/lib/components/CarouselCard/getCardWidth.js.map +1 -0
  301. package/mobile/lib/components/CarouselCard/titleSize.d.ts +1 -0
  302. package/mobile/lib/components/CarouselCard/titleSize.js +2 -0
  303. package/mobile/lib/components/CarouselCard/titleSize.js.map +1 -0
  304. package/mobile/lib/components/CarouselProductCard/CarouselProductCard.js +1 -1
  305. package/mobile/lib/components/CarouselProductCard/CarouselProductCard.js.map +1 -1
  306. package/mobile/lib/components/Footer/Contacts.d.ts +2 -2
  307. package/mobile/lib/components/Footer/Contacts.js +4 -5
  308. package/mobile/lib/components/Footer/Contacts.js.map +1 -1
  309. package/mobile/lib/components/Footer/FooterContent.d.ts +9 -1
  310. package/mobile/lib/components/Footer/FooterDataProps.d.ts +2 -2
  311. package/mobile/lib/components/PictureText/PictureText.js +5 -11
  312. package/mobile/lib/components/PictureText/PictureText.js.map +1 -1
  313. package/mobile/lib/components/PictureText/positionStyle.d.ts +1 -0
  314. package/mobile/lib/components/PictureText/positionStyle.js +2 -0
  315. package/mobile/lib/components/PictureText/positionStyle.js.map +1 -0
  316. package/mobile/lib/components/PictureText/renderInsuranceSumMonth.d.ts +2 -0
  317. package/mobile/lib/components/PictureText/renderInsuranceSumMonth.js +12 -0
  318. package/mobile/lib/components/PictureText/renderInsuranceSumMonth.js.map +1 -0
  319. package/mobile/lib/components/PictureText/styleInsuranceSum.d.ts +1 -0
  320. package/mobile/lib/components/PictureText/styleInsuranceSum.js +2 -0
  321. package/mobile/lib/components/PictureText/styleInsuranceSum.js.map +1 -0
  322. package/mobile/lib/components/PictureText/styleValueBlock.d.ts +2 -0
  323. package/mobile/lib/components/PictureText/styleValueBlock.js +3 -0
  324. package/mobile/lib/components/PictureText/styleValueBlock.js.map +1 -0
  325. package/mobile/lib/components/RollupItem/RollupItem.js +14 -9
  326. package/mobile/lib/components/RollupItem/RollupItem.js.map +1 -1
  327. package/mobile/lib/components/RollupItem/RollupItemContent.d.ts +4 -2
  328. package/mobile/lib/components/RollupItem/renderRoundedIcon.d.ts +4 -0
  329. package/mobile/lib/components/RollupItem/renderRoundedIcon.js +4 -0
  330. package/mobile/lib/components/RollupItem/renderRoundedIcon.js.map +1 -0
  331. package/mobile/lib/ui-kit/BenefitItem/BenefitItem.js +12 -11
  332. package/mobile/lib/ui-kit/BenefitItem/BenefitItem.js.map +1 -1
  333. package/mobile/lib/ui-kit/BenefitItem/labelSize.d.ts +1 -0
  334. package/mobile/lib/ui-kit/BenefitItem/labelSize.js +2 -0
  335. package/mobile/lib/ui-kit/BenefitItem/labelSize.js.map +1 -0
  336. package/mobile/lib/ui-kit/Button/renderButtonsSection.js +2 -2
  337. package/mobile/lib/ui-kit/Button/renderButtonsSection.js.map +1 -1
  338. package/mobile/lib/ui-kit/Icon/IconProps.d.ts +8 -3
  339. package/mobile/lib/ui-kit/Icon/RoundedIcon.d.ts +5 -1
  340. package/mobile/lib/ui-kit/Icon/RoundedIcon.js +5 -1
  341. package/mobile/lib/ui-kit/Icon/RoundedIcon.js.map +1 -1
  342. package/mobile/src/components/BenefitsBlock/BenefitsBlock.tsx +1 -1
  343. package/mobile/src/components/Blocks.ts +6 -0
  344. package/mobile/src/components/Bonus/Bonus.tsx +1 -1
  345. package/mobile/src/components/BusinessBlock/BusinessCard.tsx +1 -1
  346. package/mobile/src/components/ButtonsBlock/ButtonsBlock.example.json +14 -0
  347. package/mobile/src/components/{ButtonBlock/ButtonBlock.tsx → ButtonsBlock/ButtonsBlock.tsx} +4 -4
  348. package/mobile/src/components/ButtonsBlock/ButtonsBlock.ui.json +14 -0
  349. package/mobile/src/components/ButtonsBlock/ButtonsBlockContent.ts +9 -0
  350. package/mobile/src/components/CardTransfer/CardTransfer.tsx +9 -3
  351. package/mobile/src/components/CarouselCard/CarouselCard.tsx +16 -12
  352. package/mobile/src/components/CarouselCard/getCardWidth.tsx +16 -0
  353. package/mobile/src/components/CarouselCard/titleSize.tsx +1 -0
  354. package/mobile/src/components/CarouselProductCard/CarouselProductCard.tsx +1 -3
  355. package/mobile/src/components/Footer/Contacts.tsx +20 -12
  356. package/mobile/src/components/Footer/FooterContent.ts +10 -1
  357. package/mobile/src/components/Footer/FooterDataProps.ts +2 -2
  358. package/mobile/src/components/PictureText/PictureText.tsx +13 -27
  359. package/mobile/src/components/PictureText/positionStyle.tsx +1 -0
  360. package/mobile/src/components/PictureText/renderInsuranceSumMonth.tsx +28 -0
  361. package/mobile/src/components/PictureText/styleInsuranceSum.tsx +1 -0
  362. package/mobile/src/components/PictureText/styleValueBlock.tsx +2 -0
  363. package/mobile/src/components/RollupItem/RollupItem.tsx +25 -18
  364. package/mobile/src/components/RollupItem/RollupItem.ui.json +7 -1
  365. package/mobile/src/components/RollupItem/RollupItemContent.ts +4 -2
  366. package/mobile/src/components/RollupItem/renderRoundedIcon.tsx +7 -0
  367. package/mobile/src/ui-kit/BenefitItem/BenefitItem.tsx +26 -22
  368. package/mobile/src/ui-kit/BenefitItem/labelSize.tsx +1 -0
  369. package/mobile/src/ui-kit/Button/renderButtonsSection.tsx +8 -2
  370. package/mobile/src/ui-kit/Icon/IconProps.ts +9 -4
  371. package/mobile/src/ui-kit/Icon/RoundedIcon.tsx +18 -6
  372. package/package.json +1 -1
  373. package/src/components/BenefitsBlock/BenefitsBlock.tsx +1 -1
  374. package/src/components/Blocks.mobile.ts +6 -0
  375. package/src/components/Blocks.ts +2 -2
  376. package/src/components/Bonus/Bonus.tsx +1 -1
  377. package/src/components/BusinessBlock/BusinessCard.tsx +1 -1
  378. package/src/components/ButtonsBlock/ButtonsBlock.example.json +14 -0
  379. package/src/components/ButtonsBlock/ButtonsBlock.fixture.mobile.tsx +26 -0
  380. package/src/components/ButtonsBlock/ButtonsBlock.fixture.tsx +26 -0
  381. package/src/components/{ButtonBlock/ButtonBlock.tsx → ButtonsBlock/ButtonsBlock.tsx} +4 -4
  382. package/src/components/ButtonsBlock/ButtonsBlock.ui.json +14 -0
  383. package/src/components/ButtonsBlock/ButtonsBlockContent.ts +9 -0
  384. package/src/components/CardTransfer/CardTransfer.fixture.mobile.tsx +18 -0
  385. package/src/components/CardTransfer/CardTransfer.tsx +9 -3
  386. package/src/components/CarouselCard/CarouselCard.fixture.mobile.tsx +28 -0
  387. package/src/components/CarouselCard/CarouselCard.tsx +16 -12
  388. package/src/components/CarouselCard/getCardWidth.tsx +16 -0
  389. package/src/components/CarouselCard/titleSize.mobile.tsx +1 -0
  390. package/src/components/CarouselCard/titleSize.tsx +1 -0
  391. package/src/components/CarouselProductCard/CarouselProductCard.tsx +1 -3
  392. package/src/components/Footer/Contacts.tsx +20 -12
  393. package/src/components/Footer/FooterContent.ts +10 -1
  394. package/src/components/Footer/FooterDataProps.ts +2 -2
  395. package/src/components/PictureText/PictureText.fixture.mobile.tsx +122 -0
  396. package/src/components/PictureText/PictureText.tsx +13 -27
  397. package/src/components/PictureText/positionStyle.mobile.tsx +1 -0
  398. package/src/components/PictureText/positionStyle.tsx +1 -0
  399. package/src/components/PictureText/renderInsuranceSumMonth.tsx +28 -0
  400. package/src/components/PictureText/styleInsuranceSum.mobile.tsx +1 -0
  401. package/src/components/PictureText/styleInsuranceSum.tsx +1 -0
  402. package/src/components/PictureText/styleValueBlock.mobile.tsx +2 -0
  403. package/src/components/PictureText/styleValueBlock.tsx +2 -0
  404. package/src/components/RollupItem/RollupItem.fixture.mobile.tsx +15 -0
  405. package/src/components/RollupItem/RollupItem.tsx +25 -18
  406. package/src/components/RollupItem/RollupItem.ui.json +7 -1
  407. package/src/components/RollupItem/RollupItemContent.ts +4 -2
  408. package/src/components/RollupItem/renderRoundedIcon.mobile.tsx +7 -0
  409. package/src/components/RollupItem/renderRoundedIcon.tsx +4 -0
  410. package/src/ui-kit/BenefitItem/BenefitItem.tsx +26 -22
  411. package/src/ui-kit/BenefitItem/borderRadius.mobile.tsx +1 -0
  412. package/src/ui-kit/BenefitItem/labelSize.mobile.tsx +1 -0
  413. package/src/ui-kit/BenefitItem/labelSize.tsx +1 -0
  414. package/src/ui-kit/Button/renderButtonsSection.tsx +8 -2
  415. package/src/ui-kit/Icon/IconProps.ts +9 -4
  416. package/src/ui-kit/Icon/RoundedIcon.tsx +18 -6
  417. package/bundle/components/ButtonBlock/ButtonBlock.d.ts +0 -6
  418. package/bundle/components/ButtonBlock/ButtonBlockContent.d.ts +0 -8
  419. package/dist/components/ButtonBlock/ButtonBlock.d.ts +0 -6
  420. package/dist/components/ButtonBlock/ButtonBlock.js.map +0 -1
  421. package/dist/components/ButtonBlock/ButtonBlockContent.d.ts +0 -8
  422. package/dist/components/ButtonBlock/ButtonBlockContent.js.map +0 -1
  423. package/lib/components/ButtonBlock/ButtonBlock.d.ts +0 -6
  424. package/lib/components/ButtonBlock/ButtonBlock.js.map +0 -1
  425. package/lib/components/ButtonBlock/ButtonBlockContent.d.ts +0 -8
  426. package/lib/components/ButtonBlock/ButtonBlockContent.js +0 -2
  427. package/lib/components/ButtonBlock/ButtonBlockContent.js.map +0 -1
  428. package/mobile/bundle/components/ButtonBlock/ButtonBlock.d.ts +0 -6
  429. package/mobile/bundle/components/ButtonBlock/ButtonBlockContent.d.ts +0 -8
  430. package/mobile/dist/components/ButtonBlock/ButtonBlock.d.ts +0 -6
  431. package/mobile/dist/components/ButtonBlock/ButtonBlock.js.map +0 -1
  432. package/mobile/dist/components/ButtonBlock/ButtonBlockContent.d.ts +0 -8
  433. package/mobile/dist/components/ButtonBlock/ButtonBlockContent.js.map +0 -1
  434. package/mobile/lib/components/ButtonBlock/ButtonBlock.d.ts +0 -6
  435. package/mobile/lib/components/ButtonBlock/ButtonBlock.js.map +0 -1
  436. package/mobile/lib/components/ButtonBlock/ButtonBlockContent.d.ts +0 -8
  437. package/mobile/lib/components/ButtonBlock/ButtonBlockContent.js +0 -2
  438. package/mobile/lib/components/ButtonBlock/ButtonBlockContent.js.map +0 -1
  439. package/mobile/src/components/ButtonBlock/ButtonBlock.example.json +0 -12
  440. package/mobile/src/components/ButtonBlock/ButtonBlock.ui.json +0 -12
  441. package/mobile/src/components/ButtonBlock/ButtonBlockContent.ts +0 -9
  442. package/src/components/ButtonBlock/ButtonBlock.example.json +0 -12
  443. package/src/components/ButtonBlock/ButtonBlock.fixture.tsx +0 -19
  444. package/src/components/ButtonBlock/ButtonBlock.ui.json +0 -12
  445. package/src/components/ButtonBlock/ButtonBlockContent.ts +0 -9
  446. /package/lib/components/{ButtonBlock/ButtonBlock.fixture.d.ts → ButtonsBlock/ButtonsBlock.fixture.d.ts} +0 -0
@@ -237,55 +237,6 @@
237
237
  return JSXTmpl;
238
238
  };
239
239
 
240
- const style = (...atoms) => atoms
241
- .flatMap((_) => _)
242
- .filter(Boolean)
243
- .join(' ');
244
-
245
- const defaultBlockDecorator = ({ blockClassName, block, render }) => render({ blockClassName, block });
246
-
247
- const DEFAULT_ANCESTORS = [];
248
- const defaultStyle = 'col-span-12';
249
- function renderBlock(block, options, { className, ...extraProps } = {}) {
250
- const { key, blockDecorator = defaultBlockDecorator, blocksRegistry = {}, ancestors = DEFAULT_ANCESTORS, } = options;
251
- const { type } = block;
252
- if (!(type && type in blocksRegistry)) {
253
- console.warn(`No block with "${type}" is registered`);
254
- }
255
- const BlockComponent = type && blocksRegistry[type];
256
- return blockDecorator({
257
- blockClassName: style('scroll-mt-12', // TODO scroll-mt-12 ? here?
258
- className, block.style || defaultStyle),
259
- block,
260
- ancestors,
261
- // Adjusted by decorator block and blockClassName
262
- render: ({ block: adjustedBlock, blockClassName: adjustedBlockClassName }) => {
263
- const { content } = adjustedBlock;
264
- return BlockComponent ? (jsx(BlockComponent, { className: adjustedBlockClassName, block: block, options: options, ...content, ...extraProps }, key)) : null;
265
- },
266
- }, key);
267
- }
268
-
269
- const DEFAULT_SLOT_NAME = null;
270
-
271
- const EMPTY_ANCESTORS = [];
272
- const renderBlocksList = (blocks, { key, ancestors = EMPTY_ANCESTORS, slotName = DEFAULT_SLOT_NAME, renderProps = renderBlock, ...options }) => (blocks || []).map((_, j) => renderProps(_, {
273
- ...options,
274
- key: `${key ? key : _.type}-${j}`,
275
- ancestors: options.parent
276
- ? [...(ancestors || EMPTY_ANCESTORS), [options.parent, slotName]]
277
- : ancestors,
278
- }));
279
-
280
- function renderChildren({ children, block, options, renderProps, }) {
281
- if (children) {
282
- return children;
283
- }
284
- return block && options
285
- ? renderBlocksList(block.blocks, { ...options, parent: block, renderProps })
286
- : null;
287
- }
288
-
289
240
  class EventBus {
290
241
  subscribers = {};
291
242
  subjectsStateMap = {};
@@ -353,6 +304,11 @@
353
304
  return useIntersectionObserver(observerCallback, { sensitivity: 1 });
354
305
  }
355
306
 
307
+ const style = (...atoms) => atoms
308
+ .flatMap((_) => _)
309
+ .filter(Boolean)
310
+ .join(' ');
311
+
356
312
  const blockStyles = {
357
313
  primary: 'bg-white text-primary-text',
358
314
  secondary: 'bg-primary-main text-white',
@@ -371,158 +327,6 @@
371
327
  });
372
328
  const groupStyle = (isGroup) => (isGroup ? 'group' : '');
373
329
 
374
- const mapChildren = (mapper) => (children) => {
375
- if (children === null || children === undefined) {
376
- return children;
377
- }
378
- return Array.isArray(children) ? children.map(mapper) : mapper(children, 0);
379
- };
380
-
381
- const HEADER_HEIGHT = 170;
382
- const FOOTER_HEIGHT = 48;
383
- const BLOCKS_GAP = 4;
384
- const PAGE_PADDINGS_X = 20;
385
- const DEFAULT_HEIGHT = 866;
386
- const getContainerHeight = (minHeight) => ({
387
- height: `calc(100vh - ${HEADER_HEIGHT + FOOTER_HEIGHT + BLOCKS_GAP + PAGE_PADDINGS_X}px)`,
388
- minHeight: `${minHeight || DEFAULT_HEIGHT}px`,
389
- });
390
-
391
- const SwipeListItem = JSX(({ className = '', style, idx, activeIndex, observerOptions, children, onIntersection }) => {
392
- const observerCallback = useCallback((entries) => {
393
- if (entries.length && onIntersection) {
394
- onIntersection(idx || 0, entries[entries.length - 1]);
395
- }
396
- }, [onIntersection, idx]);
397
- const ref = useIntersectionObserver(observerCallback, observerOptions);
398
- return (jsx("div", { className: `inline-block snap-always box-border ${className}`, style: style, "aria-current": Boolean(idx === activeIndex), ref: ref, children: children }));
399
- });
400
-
401
- const childStyleMap = ['min-w-[100%]', 'min-w-[50%]', 'min-w-[33.33%]', 'min-w-[25%]'];
402
- const SwipeListContainer = JSX(({ className = '', containerRef, activeIndex, visibleItemCount = 0, gap = 0, padding = 0, listType = 'horizontal-list', snapAlign = 'snap-center', minHeight, children, onVisibleItemsChange, onVisibleIndicesChange, }) => {
403
- const observerOptions = {
404
- sensitivity: 1,
405
- rootRef: containerRef,
406
- };
407
- const itemsVisibilityListRef = useRef([]);
408
- const handleIntersection = useCallback((idx, entry) => {
409
- const itemsVisibilityList = [...(itemsVisibilityListRef.current || [])];
410
- itemsVisibilityList[idx] = entry;
411
- itemsVisibilityListRef.current = itemsVisibilityList;
412
- onVisibleItemsChange && onVisibleItemsChange(itemsVisibilityList);
413
- onVisibleIndicesChange && onVisibleIndicesChange(getVisibleIndices(itemsVisibilityList));
414
- }, [onVisibleItemsChange, onVisibleIndicesChange]);
415
- const additionPadding = visibleItemCount > 0 ? gap * Number(visibleItemCount) - 1 : 0;
416
- const isVerticalList = listType === 'vertical-list';
417
- const isHorizontalList = listType === 'horizontal-list';
418
- const containerStyle = {
419
- ...(isHorizontalList ? getContainerOffset(padding, additionPadding) : {}),
420
- ...(isVerticalList ? getContainerHeight(minHeight) : {}),
421
- gap: `${gap}px`,
422
- };
423
- return (jsx("div", { className: style('box-border overflow-auto no-scrollbar', listType, className), style: containerStyle, ref: containerRef, children: mapChildren((child, idx) => (jsx(SwipeListItem, { className: style(snapAlign, visibleItemCount ? childStyleMap[visibleItemCount - 1] : '', isVerticalList ? 'h-full' : ''), style: isHorizontalList ? getContainerOffset(padding / 4) : {}, activeIndex: activeIndex, idx: idx, observerOptions: observerOptions, onIntersection: handleIntersection, children: child }, String(idx))))(children) }));
424
- });
425
- // Styles used to compensate outer container padding to get rid of clipping effect
426
- const getContainerOffset = (padding, additionalPadding = 0) => ({
427
- marginLeft: `${-padding}px`,
428
- marginRight: `${-padding}px`,
429
- paddingLeft: `${padding}px`,
430
- paddingRight: `${padding + additionalPadding}px`,
431
- });
432
- const getVisibleIndices = (itemsVisibilityList) => itemsVisibilityList
433
- .map((_, i) => [_, i])
434
- .filter(([_]) => _ && _.intersectionRatio >= 0.9)
435
- .map(([, i]) => i);
436
-
437
- const containerStyles = {
438
- 'horizontal-list': 'mx-auto mt-5 w-fit',
439
- 'vertical-list': 'absolute flex-col justify-center h-full top-0 left-4',
440
- };
441
- const activeDotStyles = {
442
- 'horizontal-list': 'w-6',
443
- 'vertical-list': 'h-6',
444
- };
445
- const dotStyle = 'cursor-pointer rounded-full transition-width duration-300 bg-primary-main group-data-secondary:bg-white group-data-transparent:bg-white';
446
- const inactiveDotStyle = 'w-2 h-2 opacity-30';
447
- const SwipeListControlDots = JSX(({ containerRef, activeIndex, dotCount = 0, listType = 'horizontal-list', version }) => {
448
- const handleClick = (idx) => {
449
- if (idx !== activeIndex && containerRef?.current) {
450
- containerRef.current.children[idx]?.scrollIntoView({
451
- behavior: 'smooth',
452
- block: 'nearest',
453
- });
454
- }
455
- };
456
- return dotCount ? (jsx("div", { className: style('flex gap-2', containerStyles[listType], version ? 'group' : ''), ...(version ? { 'data-ver': version } : {}), children: new Array(dotCount).fill(null).map((_, idx) => (jsx("div", { className: `${dotStyle} ${idx === activeIndex ? activeDotStyles[listType] : inactiveDotStyle}`, role: "button", "aria-hidden": true, onClick: () => handleClick(idx) }, String(idx)))) })) : null;
457
- });
458
-
459
- const areArraysEqual = (as, bs) => as === bs || Boolean(as && bs && as?.length === bs?.length && as.every((_, i) => _ === bs[i]));
460
-
461
- const defaultDiscriminator = (_) => _;
462
- const maxBy = (discriminator = defaultDiscriminator) => (list) => list.reduceRight((a, b) => (discriminator(a) > discriminator(b) ? a : b));
463
-
464
- const minBy = (discriminator = defaultDiscriminator) => maxBy((_) => -discriminator(_));
465
-
466
- const getItemWidth = (container) => (itemCount) => container.scrollWidth / itemCount;
467
- const scrollBy = (container) => (itemCount, delta) => {
468
- container.scrollBy({ left: delta * getItemWidth(container)(itemCount), behavior: 'smooth' });
469
- };
470
-
471
- const scrollToEnd = (container) => {
472
- container.scrollTo({ left: container.scrollWidth, behavior: 'smooth' });
473
- };
474
-
475
- const scrollToStart = (container) => {
476
- container.scrollTo({ left: 0, behavior: 'smooth' });
477
- };
478
-
479
- const useSwipeListScroll = ({ itemCount, isCyclic, onVisibleIndicesChange, }) => {
480
- const containerRef = useRef(null);
481
- const [visibleIndices, setVisibleIndices] = useState([]);
482
- const handleVisibleIndicesChange = useCallback((indices) => {
483
- setVisibleIndices((prevIndices) => areArraysEqual(prevIndices, indices) ? prevIndices : indices);
484
- onVisibleIndicesChange && onVisibleIndicesChange(indices);
485
- }, [itemCount]);
486
- const [minIndex, maxIndex] = visibleIndices.length
487
- ? [minBy()(visibleIndices), maxBy()(visibleIndices)]
488
- : [-1, -1];
489
- const canScrollLeft = minIndex > 0;
490
- const canScrollRight = maxIndex < itemCount - 1;
491
- const scrollLeft = useCallback(() => {
492
- if (!containerRef.current) {
493
- return;
494
- }
495
- if (isCyclic && !canScrollLeft) {
496
- scrollToEnd(containerRef.current);
497
- }
498
- else {
499
- scrollBy(containerRef.current)(itemCount, -1);
500
- }
501
- }, [isCyclic, itemCount, canScrollLeft]);
502
- const scrollRight = useCallback(() => {
503
- if (!containerRef.current) {
504
- return;
505
- }
506
- if (isCyclic && !canScrollRight) {
507
- scrollToStart(containerRef.current);
508
- }
509
- else {
510
- scrollBy(containerRef.current)(itemCount, 1);
511
- }
512
- }, [itemCount, isCyclic, canScrollRight]);
513
- return [
514
- containerRef,
515
- {
516
- scrollLeft,
517
- scrollRight,
518
- canScrollLeft: isCyclic || canScrollLeft,
519
- canScrollRight: isCyclic || canScrollRight,
520
- visibleIndicesRange: [minIndex, maxIndex],
521
- handleVisibleIndicesChange,
522
- },
523
- ];
524
- };
525
-
526
330
  function useRouter() {
527
331
  return useRouter._impl();
528
332
  }
@@ -620,119 +424,466 @@
620
424
  return image.icon ? (jsx(Icon, { className: className, imageClassName: imageClassName, iconVersion: image?.iconVersion, name: image.icon, ...iconProps })) : (jsx(ImgAsPicture, { className: className, imageClassName: imageClassName, image: image, isMobile: isMobile, pathPrefix: pathPrefix }));
621
425
  });
622
426
 
623
- const Img = JSX((props) => jsx(ImgInner, { ...props, isMobile: true }));
624
-
625
- const useDialog = (id = '') => ({
626
- open: (message) => defaultEventBus.fire('dialog', { type: 'open', id, message }),
627
- close: () => defaultEventBus.fire('dialog', { type: 'close' }),
628
- });
427
+ const Img = JSX((props) => jsx(ImgInner, { ...props, isMobile: true }));
428
+
429
+ const useDialog = (id = '') => ({
430
+ open: (message) => defaultEventBus.fire('dialog', { type: 'open', id, message }),
431
+ close: () => defaultEventBus.fire('dialog', { type: 'close' }),
432
+ });
433
+
434
+ /* eslint-disable @typescript-eslint/ban-types */
435
+ const handlerDecorator = (handler, targetContent) => {
436
+ return handlerDecorator._impl(handler, targetContent);
437
+ };
438
+ handlerDecorator._impl = (handler) => handler;
439
+ handlerDecorator.setup = (impl) => {
440
+ handlerDecorator._impl = impl;
441
+ };
442
+
443
+ function useLink(params = {}) {
444
+ const { isRemote, basePath } = params;
445
+ const router = useRouter();
446
+ const { close } = useDialog();
447
+ return (props) => ({
448
+ ...props,
449
+ href: isRemote && !basePath ? props.href : adjustHref(router)(props.href, basePath),
450
+ 'aria-label': props.text,
451
+ onClick: handlerDecorator(handleHref(props), props),
452
+ });
453
+ function handleHref({ href, target, onClick }) {
454
+ return (ev) => {
455
+ onClick && onClick(ev);
456
+ if (!href || isRemote || !isLocalURL(href, target)) {
457
+ // Default routing
458
+ return;
459
+ }
460
+ close();
461
+ // Client routing
462
+ ev?.preventDefault();
463
+ router.push(href);
464
+ };
465
+ }
466
+ }
467
+
468
+ const buttonStyleMap = {
469
+ primary: 'text-white bg-primary-main hover:bg-primary-hover active:bg-primary-active',
470
+ secondary: 'text-primary-main bg-main-divider hover:text-white hover:bg-primary-hover active:bg-primary-active',
471
+ white: 'text-primary-main bg-white hover:text-white hover:bg-primary-hover active:bg-white active:text-primary-main',
472
+ link: '',
473
+ transparent: '',
474
+ gray: 'text-primary-main bg-main-divider hover:text-white hover:bg-primary-hover active:bg-primary-active',
475
+ '': '',
476
+ };
477
+ const DisabledStyle = 'bg-main-divider text-main-disabled';
478
+ const buttonDisabledStyleMap = {
479
+ primary: DisabledStyle,
480
+ secondary: DisabledStyle,
481
+ white: DisabledStyle,
482
+ link: '',
483
+ transparent: '',
484
+ gray: DisabledStyle,
485
+ '': '',
486
+ };
487
+ const buttonStyle = 'text-center font-sans select-none';
488
+ const iconStyleMap = {
489
+ primary: 'group-hover/btn:brightness-0 group-hover/btn:invert',
490
+ secondary: 'group-hover/btn:brightness-0 group-hover/btn:invert',
491
+ white: 'group-hover/btn:brightness-0 group-hover/btn:invert',
492
+ link: '',
493
+ transparent: '',
494
+ gray: 'group-hover/btn:brightness-0 group-hover/btn:invert',
495
+ '': '',
496
+ };
497
+
498
+ const ButtonInner = JSX((props) => {
499
+ const { text, aboveText, appendLeft, appendRight, version = 'primary' } = props;
500
+ return (jsxs("div", { className: style(getButtonStyle(props), 'flex gap-2'), children: [appendLeft ? jsx("div", { className: iconStyleMap[version], children: appendLeft }) : null, isWithText(props) ? (jsxs("div", { children: [aboveText ? jsx("div", { className: "text-xs-light text-left", children: aboveText }) : null, jsx("div", { className: `text-left ${aboveText ? 'text-s -mt-0.5' : 'text-l'}`, children: text })] })) : null, appendRight ? jsx("div", { className: iconStyleMap[version], children: appendRight }) : null] }));
501
+ });
502
+ const getButtonStyle = (props) => {
503
+ const { version, aboveText, rounded } = props;
504
+ if (version === 'link') {
505
+ return '';
506
+ }
507
+ const withTextStyle = `${aboveText ? 'py-2.5 px-7' : 'py-4 px-4'}`;
508
+ return [
509
+ 'group/btn items-center justify-center',
510
+ isWithText(props) ? withTextStyle : 'h-12 w-12',
511
+ rounded ? 'rounded-full' : '',
512
+ ].join(' ');
513
+ };
514
+ const isWithText = ({ text, aboveText, appendLeft }) => Boolean(text || aboveText || !appendLeft);
515
+
516
+ const getDisabledButtonClasses = ({ className, rounded, version, }) => [
517
+ 'inline-block',
518
+ buttonStyle,
519
+ version ? buttonDisabledStyleMap[version] : '',
520
+ rounded ? 'rounded-full' : 'rounded-md',
521
+ className,
522
+ ].join(' ');
523
+
524
+ const getRegularButtonClasses = ({ className, rounded, version, }) => [
525
+ buttonStyle,
526
+ 'border border-transparent inline-block cursor-pointer no-underline focus:border-primary-text focus:border h-fit',
527
+ version ? buttonStyleMap[version] : '',
528
+ rounded ? 'rounded-full' : 'rounded-md',
529
+ className,
530
+ ].join(' ');
531
+
532
+ const Button = JSX(({ disabled, children, ...rest }) => {
533
+ const link = useLink();
534
+ const adjustedProps = link(rest);
535
+ const buttonInner = children ?? jsx(ButtonInner, { ...adjustedProps });
536
+ return disabled ? (jsx(DisabledButton, { ...adjustedProps, children: buttonInner })) : (jsx(RegularButton, { ...adjustedProps, children: buttonInner }));
537
+ });
538
+ const RegularButton = JSX(({ className = '', href, rel, target, ariaLabel, version, rounded, onClick, children }) => (jsx("a", { className: getRegularButtonClasses({ className, version, rounded }), href: href, rel: rel, target: target, "aria-label": ariaLabel, role: href ? 'link' : 'button', onClick: onClick, children: children })));
539
+ const DisabledButton = JSX(({ className, ariaLabel, version, rounded, children }) => (jsx("div", { role: "button", "aria-disabled": "true", "aria-label": ariaLabel, tabIndex: -1, className: getDisabledButtonClasses({ className, rounded, version }), children: children })));
540
+
541
+ const renderButtonsSection = (buttons, { className = '', buttonClassName, isVertical } = {}) => buttons?.length && buttons.some((_) => _?.text || _?.icon?.icon) ? (jsx("div", { className: style('flex', isVertical ? 'flex-col gap-2 justify-items-stretch' : 'flex-wrap gap-4', className), children: buttons.map(renderButton(buttonClassName)) })) : null;
542
+ const renderButton = (buttonClassName = '') => (button, index) => {
543
+ const { text, icon, iconRight, version, ...rest } = button || {};
544
+ const iconVersionDefault = version === 'secondary' ? 'color' : 'white';
545
+ const iconVersion = icon?.iconVersion ? icon?.iconVersion : iconVersionDefault;
546
+ return text || icon?.icon ? (jsx(Button, { className: style('basis-full sm:basis-auto', buttonClassName), appendLeft: renderButtonIcon({ ...icon, iconVersion }), appendRight: renderButtonIcon({ ...iconRight, iconVersion }), version: version, text: text, ...rest }, index ? String(index) : '')) : null;
547
+ };
548
+ const DEFAULT_ICON_W = 24;
549
+ const renderButtonIcon = (icon) => icon?.icon || icon?.src ? (jsx(Img, { image: icon, width: String(icon?.size?.width || DEFAULT_ICON_W), height: String(DEFAULT_ICON_W) })) : null;
550
+
551
+ const ButtonsBlock = JSX(({ buttons, className, ...rest }) => (jsx(BlockWrapper, { className: style('!bg-transparent', className), ...rest, children: renderButtonsSection(buttons) })));
552
+
553
+ const identity = (_) => _;
554
+
555
+ const useForm = (initialState, onSubmit) => {
556
+ const [formState, setFormState] = useState(initialState);
557
+ const [isDirtyForm, setDirtyForm] = useState(false);
558
+ const [dirtyFieldsMap, setDirtyFieldsMap] = useState({});
559
+ const handlersMap = useRef({});
560
+ const field = useCallback((fieldName, options) => {
561
+ const { parse = identity, format = identity } = options || {};
562
+ if (!handlersMap.current) {
563
+ handlersMap.current = {};
564
+ }
565
+ handlersMap.current[fieldName] ||= (value) => {
566
+ setFormState((prev) => ({ ...prev, [fieldName]: parse(value) }));
567
+ setDirtyFieldsMap((prev) => ({ ...prev, [fieldName]: true }));
568
+ };
569
+ return {
570
+ value: format(formState[fieldName]),
571
+ isDirty: isDirtyForm || dirtyFieldsMap[fieldName],
572
+ onChange: handlersMap.current[fieldName],
573
+ };
574
+ }, [formState, isDirtyForm, dirtyFieldsMap]);
575
+ const reset = useCallback(() => {
576
+ setFormState(initialState);
577
+ setDirtyForm(false);
578
+ setDirtyFieldsMap({});
579
+ }, [initialState]);
580
+ const handleSubmit = useCallback((e) => {
581
+ e.preventDefault();
582
+ setDirtyForm(true);
583
+ onSubmit && onSubmit(formState);
584
+ }, [onSubmit, formState]);
585
+ return [
586
+ formState,
587
+ {
588
+ isDirty: isDirtyForm || Object.values(dirtyFieldsMap).some(Boolean),
589
+ field,
590
+ reset,
591
+ onSubmit: handleSubmit,
592
+ },
593
+ ];
594
+ };
595
+
596
+ const useNormalizedInput = (props, { normalize, format }) => {
597
+ const { value, onFocus, onBlur, onChange } = props;
598
+ const [isFocused, setIsFocused] = useState(false);
599
+ const handleFocus = useCallback((e) => {
600
+ setIsFocused(true);
601
+ onFocus && onFocus(e);
602
+ }, []);
603
+ const handleBlur = useCallback(() => {
604
+ setIsFocused(false);
605
+ onChange && onChange(normalize(value));
606
+ onBlur && onBlur();
607
+ }, [onChange, value]);
608
+ return {
609
+ value: (isFocused || !format ? value : format(value)),
610
+ onFocus: handleFocus,
611
+ onBlur: handleBlur,
612
+ };
613
+ };
614
+
615
+ const clamp = (value, min, max) => Math.max(min, Math.min(value, max));
616
+
617
+ const toLocalNumberFormat = (fractionDigits = 0) => (_ = 0) => new Intl.NumberFormat('ru-RU', {
618
+ minimumFractionDigits: 0,
619
+ maximumFractionDigits: fractionDigits,
620
+ }).format(Number(_) || 0);
621
+
622
+ const Text = JSX(({ children, ...style }) => (jsx("span", { className: ['font-sans', ...Object.values(style)].join(' '), children: children })));
623
+
624
+ const Input = JSX(({ key, className = '', inputClassName = '', id, name, type = 'text', label, placeholder, value = '', valid = true, children, onChange, onFocus, onBlur, pattern, }) => {
625
+ const handleChange = useCallback((e) => {
626
+ onChange && onChange(e.target?.value || '');
627
+ }, [onChange]);
628
+ const paddingStyle = children ? 'pr-8' : '';
629
+ const validStyle = valid
630
+ ? 'border-gray hover:border-primary-hover active:border-primary-text focus:border-primary-text'
631
+ : 'border-error';
632
+ return (jsxs("div", { className: style('relative', className), children: [jsxs("label", { children: [label ? (jsx("div", { className: "mb-2", children: jsx(Text, { size: "text-m", font: "font-light", children: label }) })) : null, jsx("input", { className: style('w-full border rounded-md text-primary-text outline-none p-4', paddingStyle, validStyle, inputClassName), id: id, name: name || id, placeholder: placeholder, type: type, value: value, onInput: handleChange, onFocus: onFocus, onBlur: onBlur, pattern: pattern }, key)] }), children] }));
633
+ });
634
+
635
+ const NumberInput = JSX((props) => {
636
+ const { onChange, min, max, defaultValue = '0', fractionDigits = 0, ...inputProps } = props;
637
+ const normalizedProps = useNormalizedInput(props, {
638
+ normalize: (_ = defaultValue) => min && max ? String(clamp(Number(sanitizeNumberStr(_)), min, max)) : sanitizeNumberStr(_),
639
+ format: toLocalNumberFormat(fractionDigits),
640
+ });
641
+ const handleChange = useCallback((_) => onChange && onChange(sanitizeNumberStr(_)), [onChange]);
642
+ return jsx(Input, { onChange: handleChange, ...inputProps, ...normalizedProps });
643
+ });
644
+ const sanitizeNumberStr = (_ = '') => _.replaceAll(',', '.')
645
+ .replace(/[^\d.]/g, '')
646
+ .replace(/([^.]*\.[^.]*)\./, '$1');
647
+
648
+ const CurrencyInput = JSX((props) => (jsx(NumberInput, { ...props, fractionDigits: 2, children: jsx("div", { className: "absolute right-4 bottom-4", children: jsx(Text, { size: "text-xl", font: "font-light", children: "\u20BD" }) }) })));
649
+
650
+ const mobileHeadingTagMap = {
651
+ h1: 'h1',
652
+ h2: 'h1',
653
+ h3: 'h2',
654
+ h4: 'h2',
655
+ h5: 'h3',
656
+ h6: 'h3',
657
+ };
658
+ const headingTag = (tag) => mobileHeadingTagMap[tag] || 'h3';
659
+
660
+ const styles = {
661
+ h0: 'text-h0',
662
+ h1: 'text-h1',
663
+ h2: 'text-h2',
664
+ h3: 'text-h3',
665
+ h4: 'text-h4',
666
+ h5: 'text-h5',
667
+ h6: 'text-h6', // 20
668
+ };
669
+ const Heading = JSX(({ className = '', headingType = 'h3', as = 'h3', title, children }) => {
670
+ const Tag = headingTag(as);
671
+ return (jsx(Tag, { className: `font-sans m-0 ${styles[headingType]} ${className}`, children: title || children }));
672
+ });
673
+
674
+ const DEFAULT_TITLE = 'Укажите сумму перевода';
675
+ const DEFAULT_LABEL = 'Сумма перевода';
676
+ const DEFAULT_PLACEHOLDER = '1500';
677
+ const FORM_URL = 'https://www.rshb.ru/p2p/';
678
+ const AMOUNT_KEY = 'amount';
679
+ const INITIAL_FORM_STATE = {
680
+ [AMOUNT_KEY]: 1500,
681
+ };
682
+ const CardTransfer = JSX(({ className = '', title = DEFAULT_TITLE, label = DEFAULT_LABEL, placeholder = DEFAULT_PLACEHOLDER, button, ...rest }) => {
683
+ const [{ amount }, { field }] = useForm(INITIAL_FORM_STATE);
684
+ const isDisabled = amount <= 0;
685
+ const buttonStyle = isDisabled
686
+ ? getDisabledButtonClasses({ version: button?.version })
687
+ : getRegularButtonClasses({ className: 'text-white', version: button?.version });
688
+ const link = useLink();
689
+ return (jsxs(BlockWrapper, { className: style('p-default flex flex-col items-center', className), ...rest, children: [title ? (jsx(Heading, { className: "pb-5 xl:pb-9 self-start xl:self-center", headingType: "h2", title: title })) : null, jsxs("form", { className: "w-full xl:max-w-[468px]", method: "POST", action: FORM_URL, children: [jsx(CurrencyInput, { name: AMOUNT_KEY, valid: !isDisabled, placeholder: placeholder, label: label, ...field(AMOUNT_KEY, { parse: Number, format: String }) }), button?.text ? (jsx("button", { type: "submit", className: style('w-full p-4 mt-5 xl:mt-6', buttonStyle), disabled: isDisabled, ...link(button), children: button.text })) : null] })] }));
690
+ });
691
+
692
+ const defaultBlockDecorator = ({ blockClassName, block, render }) => render({ blockClassName, block });
693
+
694
+ const DEFAULT_ANCESTORS = [];
695
+ const defaultStyle = 'col-span-12';
696
+ function renderBlock(block, options, { className, ...extraProps } = {}) {
697
+ const { key, blockDecorator = defaultBlockDecorator, blocksRegistry = {}, ancestors = DEFAULT_ANCESTORS, } = options;
698
+ const { type } = block;
699
+ if (!(type && type in blocksRegistry)) {
700
+ console.warn(`No block with "${type}" is registered`);
701
+ }
702
+ const BlockComponent = type && blocksRegistry[type];
703
+ return blockDecorator({
704
+ blockClassName: style('scroll-mt-12', // TODO scroll-mt-12 ? here?
705
+ className, block.style || defaultStyle),
706
+ block,
707
+ ancestors,
708
+ // Adjusted by decorator block and blockClassName
709
+ render: ({ block: adjustedBlock, blockClassName: adjustedBlockClassName }) => {
710
+ const { content } = adjustedBlock;
711
+ return BlockComponent ? (jsx(BlockComponent, { className: adjustedBlockClassName, block: block, options: options, ...content, ...extraProps }, key)) : null;
712
+ },
713
+ }, key);
714
+ }
715
+
716
+ const DEFAULT_SLOT_NAME = null;
717
+
718
+ const EMPTY_ANCESTORS = [];
719
+ const renderBlocksList = (blocks, { key, ancestors = EMPTY_ANCESTORS, slotName = DEFAULT_SLOT_NAME, renderProps = renderBlock, ...options }) => (blocks || []).map((_, j) => renderProps(_, {
720
+ ...options,
721
+ key: `${key ? key : _.type}-${j}`,
722
+ ancestors: options.parent
723
+ ? [...(ancestors || EMPTY_ANCESTORS), [options.parent, slotName]]
724
+ : ancestors,
725
+ }));
726
+
727
+ function renderChildren({ children, block, options, renderProps, }) {
728
+ if (children) {
729
+ return children;
730
+ }
731
+ return block && options
732
+ ? renderBlocksList(block.blocks, { ...options, parent: block, renderProps })
733
+ : null;
734
+ }
735
+
736
+ const mapChildren = (mapper) => (children) => {
737
+ if (children === null || children === undefined) {
738
+ return children;
739
+ }
740
+ return Array.isArray(children) ? children.map(mapper) : mapper(children, 0);
741
+ };
742
+
743
+ const HEADER_HEIGHT = 170;
744
+ const FOOTER_HEIGHT = 48;
745
+ const BLOCKS_GAP = 4;
746
+ const PAGE_PADDINGS_X = 20;
747
+ const DEFAULT_HEIGHT = 866;
748
+ const getContainerHeight = (minHeight) => ({
749
+ height: `calc(100vh - ${HEADER_HEIGHT + FOOTER_HEIGHT + BLOCKS_GAP + PAGE_PADDINGS_X}px)`,
750
+ minHeight: `${minHeight || DEFAULT_HEIGHT}px`,
751
+ });
752
+
753
+ const SwipeListItem = JSX(({ className = '', style, idx, activeIndex, observerOptions, children, onIntersection }) => {
754
+ const observerCallback = useCallback((entries) => {
755
+ if (entries.length && onIntersection) {
756
+ onIntersection(idx || 0, entries[entries.length - 1]);
757
+ }
758
+ }, [onIntersection, idx]);
759
+ const ref = useIntersectionObserver(observerCallback, observerOptions);
760
+ return (jsx("div", { className: `inline-block snap-always box-border ${className}`, style: style, "aria-current": Boolean(idx === activeIndex), ref: ref, children: children }));
761
+ });
762
+
763
+ const childStyleMap = ['min-w-[100%]', 'min-w-[50%]', 'min-w-[33.33%]', 'min-w-[25%]'];
764
+ const SwipeListContainer = JSX(({ className = '', containerRef, activeIndex, visibleItemCount = 0, gap = 0, padding = 0, listType = 'horizontal-list', snapAlign = 'snap-center', minHeight, children, onVisibleItemsChange, onVisibleIndicesChange, }) => {
765
+ const observerOptions = {
766
+ sensitivity: 1,
767
+ rootRef: containerRef,
768
+ };
769
+ const itemsVisibilityListRef = useRef([]);
770
+ const handleIntersection = useCallback((idx, entry) => {
771
+ const itemsVisibilityList = [...(itemsVisibilityListRef.current || [])];
772
+ itemsVisibilityList[idx] = entry;
773
+ itemsVisibilityListRef.current = itemsVisibilityList;
774
+ onVisibleItemsChange && onVisibleItemsChange(itemsVisibilityList);
775
+ onVisibleIndicesChange && onVisibleIndicesChange(getVisibleIndices(itemsVisibilityList));
776
+ }, [onVisibleItemsChange, onVisibleIndicesChange]);
777
+ const additionPadding = visibleItemCount > 0 ? gap * Number(visibleItemCount) - 1 : 0;
778
+ const isVerticalList = listType === 'vertical-list';
779
+ const isHorizontalList = listType === 'horizontal-list';
780
+ const containerStyle = {
781
+ ...(isHorizontalList ? getContainerOffset(padding, additionPadding) : {}),
782
+ ...(isVerticalList ? getContainerHeight(minHeight) : {}),
783
+ gap: `${gap}px`,
784
+ };
785
+ return (jsx("div", { className: style('box-border overflow-auto no-scrollbar', listType, className), style: containerStyle, ref: containerRef, children: mapChildren((child, idx) => (jsx(SwipeListItem, { className: style(snapAlign, visibleItemCount ? childStyleMap[visibleItemCount - 1] : '', isVerticalList ? 'h-full' : ''), style: isHorizontalList ? getContainerOffset(padding / 4) : {}, activeIndex: activeIndex, idx: idx, observerOptions: observerOptions, onIntersection: handleIntersection, children: child }, String(idx))))(children) }));
786
+ });
787
+ // Styles used to compensate outer container padding to get rid of clipping effect
788
+ const getContainerOffset = (padding, additionalPadding = 0) => ({
789
+ marginLeft: `${-padding}px`,
790
+ marginRight: `${-padding}px`,
791
+ paddingLeft: `${padding}px`,
792
+ paddingRight: `${padding + additionalPadding}px`,
793
+ });
794
+ const getVisibleIndices = (itemsVisibilityList) => itemsVisibilityList
795
+ .map((_, i) => [_, i])
796
+ .filter(([_]) => _ && _.intersectionRatio >= 0.9)
797
+ .map(([, i]) => i);
798
+
799
+ const containerStyles = {
800
+ 'horizontal-list': 'mx-auto mt-5 w-fit',
801
+ 'vertical-list': 'absolute flex-col justify-center h-full top-0 left-4',
802
+ };
803
+ const activeDotStyles = {
804
+ 'horizontal-list': 'w-6',
805
+ 'vertical-list': 'h-6',
806
+ };
807
+ const dotStyle = 'cursor-pointer rounded-full transition-width duration-300 bg-primary-main group-data-secondary:bg-white group-data-transparent:bg-white';
808
+ const inactiveDotStyle = 'w-2 h-2 opacity-30';
809
+ const SwipeListControlDots = JSX(({ containerRef, activeIndex, dotCount = 0, listType = 'horizontal-list', version }) => {
810
+ const handleClick = (idx) => {
811
+ if (idx !== activeIndex && containerRef?.current) {
812
+ containerRef.current.children[idx]?.scrollIntoView({
813
+ behavior: 'smooth',
814
+ block: 'nearest',
815
+ });
816
+ }
817
+ };
818
+ return dotCount ? (jsx("div", { className: style('flex gap-2', containerStyles[listType], version ? 'group' : ''), ...(version ? { 'data-ver': version } : {}), children: new Array(dotCount).fill(null).map((_, idx) => (jsx("div", { className: `${dotStyle} ${idx === activeIndex ? activeDotStyles[listType] : inactiveDotStyle}`, role: "button", "aria-hidden": true, onClick: () => handleClick(idx) }, String(idx)))) })) : null;
819
+ });
820
+
821
+ const areArraysEqual = (as, bs) => as === bs || Boolean(as && bs && as?.length === bs?.length && as.every((_, i) => _ === bs[i]));
629
822
 
630
- /* eslint-disable @typescript-eslint/ban-types */
631
- const handlerDecorator = (handler, targetContent) => {
632
- return handlerDecorator._impl(handler, targetContent);
633
- };
634
- handlerDecorator._impl = (handler) => handler;
635
- handlerDecorator.setup = (impl) => {
636
- handlerDecorator._impl = impl;
637
- };
823
+ const defaultDiscriminator = (_) => _;
824
+ const maxBy = (discriminator = defaultDiscriminator) => (list) => list.reduceRight((a, b) => (discriminator(a) > discriminator(b) ? a : b));
638
825
 
639
- function useLink(params = {}) {
640
- const { isRemote, basePath } = params;
641
- const router = useRouter();
642
- const { close } = useDialog();
643
- return (props) => ({
644
- ...props,
645
- href: isRemote && !basePath ? props.href : adjustHref(router)(props.href, basePath),
646
- 'aria-label': props.text,
647
- onClick: handlerDecorator(handleHref(props), props),
648
- });
649
- function handleHref({ href, target, onClick }) {
650
- return (ev) => {
651
- onClick && onClick(ev);
652
- if (!href || isRemote || !isLocalURL(href, target)) {
653
- // Default routing
654
- return;
655
- }
656
- close();
657
- // Client routing
658
- ev?.preventDefault();
659
- router.push(href);
660
- };
661
- }
662
- }
826
+ const minBy = (discriminator = defaultDiscriminator) => maxBy((_) => -discriminator(_));
663
827
 
664
- const buttonStyleMap = {
665
- primary: 'text-white bg-primary-main hover:bg-primary-hover active:bg-primary-active',
666
- secondary: 'text-primary-main bg-main-divider hover:text-white hover:bg-primary-hover active:bg-primary-active',
667
- white: 'text-primary-main bg-white hover:text-white hover:bg-primary-hover active:bg-white active:text-primary-main',
668
- link: '',
669
- transparent: '',
670
- gray: 'text-primary-main bg-main-divider hover:text-white hover:bg-primary-hover active:bg-primary-active',
671
- '': '',
828
+ const getItemWidth = (container) => (itemCount) => container.scrollWidth / itemCount;
829
+ const scrollBy = (container) => (itemCount, delta) => {
830
+ container.scrollBy({ left: delta * getItemWidth(container)(itemCount), behavior: 'smooth' });
672
831
  };
673
- const DisabledStyle = 'bg-main-divider text-main-disabled';
674
- const buttonDisabledStyleMap = {
675
- primary: DisabledStyle,
676
- secondary: DisabledStyle,
677
- white: DisabledStyle,
678
- link: '',
679
- transparent: '',
680
- gray: DisabledStyle,
681
- '': '',
832
+
833
+ const scrollToEnd = (container) => {
834
+ container.scrollTo({ left: container.scrollWidth, behavior: 'smooth' });
682
835
  };
683
- const buttonStyle = 'text-center font-sans select-none';
684
- const iconStyleMap = {
685
- primary: 'group-hover/btn:brightness-0 group-hover/btn:invert',
686
- secondary: 'group-hover/btn:brightness-0 group-hover/btn:invert',
687
- white: 'group-hover/btn:brightness-0 group-hover/btn:invert',
688
- link: '',
689
- transparent: '',
690
- gray: 'group-hover/btn:brightness-0 group-hover/btn:invert',
691
- '': '',
836
+
837
+ const scrollToStart = (container) => {
838
+ container.scrollTo({ left: 0, behavior: 'smooth' });
692
839
  };
693
840
 
694
- const ButtonInner = JSX((props) => {
695
- const { text, aboveText, appendLeft, appendRight, version = 'primary' } = props;
696
- return (jsxs("div", { className: style(getButtonStyle(props), 'flex gap-2'), children: [appendLeft ? jsx("div", { className: iconStyleMap[version], children: appendLeft }) : null, isWithText(props) ? (jsxs("div", { children: [aboveText ? jsx("div", { className: "text-xs-light text-left", children: aboveText }) : null, jsx("div", { className: `text-left ${aboveText ? 'text-s -mt-0.5' : 'text-l'}`, children: text })] })) : null, appendRight ? jsx("div", { className: iconStyleMap[version], children: appendRight }) : null] }));
697
- });
698
- const getButtonStyle = (props) => {
699
- const { version, aboveText, rounded } = props;
700
- if (version === 'link') {
701
- return '';
702
- }
703
- const withTextStyle = `${aboveText ? 'py-2.5 px-7' : 'py-4 px-4'}`;
841
+ const useSwipeListScroll = ({ itemCount, isCyclic, onVisibleIndicesChange, }) => {
842
+ const containerRef = useRef(null);
843
+ const [visibleIndices, setVisibleIndices] = useState([]);
844
+ const handleVisibleIndicesChange = useCallback((indices) => {
845
+ setVisibleIndices((prevIndices) => areArraysEqual(prevIndices, indices) ? prevIndices : indices);
846
+ onVisibleIndicesChange && onVisibleIndicesChange(indices);
847
+ }, [itemCount]);
848
+ const [minIndex, maxIndex] = visibleIndices.length
849
+ ? [minBy()(visibleIndices), maxBy()(visibleIndices)]
850
+ : [-1, -1];
851
+ const canScrollLeft = minIndex > 0;
852
+ const canScrollRight = maxIndex < itemCount - 1;
853
+ const scrollLeft = useCallback(() => {
854
+ if (!containerRef.current) {
855
+ return;
856
+ }
857
+ if (isCyclic && !canScrollLeft) {
858
+ scrollToEnd(containerRef.current);
859
+ }
860
+ else {
861
+ scrollBy(containerRef.current)(itemCount, -1);
862
+ }
863
+ }, [isCyclic, itemCount, canScrollLeft]);
864
+ const scrollRight = useCallback(() => {
865
+ if (!containerRef.current) {
866
+ return;
867
+ }
868
+ if (isCyclic && !canScrollRight) {
869
+ scrollToStart(containerRef.current);
870
+ }
871
+ else {
872
+ scrollBy(containerRef.current)(itemCount, 1);
873
+ }
874
+ }, [itemCount, isCyclic, canScrollRight]);
704
875
  return [
705
- 'group/btn items-center justify-center',
706
- isWithText(props) ? withTextStyle : 'h-12 w-12',
707
- rounded ? 'rounded-full' : '',
708
- ].join(' ');
876
+ containerRef,
877
+ {
878
+ scrollLeft,
879
+ scrollRight,
880
+ canScrollLeft: isCyclic || canScrollLeft,
881
+ canScrollRight: isCyclic || canScrollRight,
882
+ visibleIndicesRange: [minIndex, maxIndex],
883
+ handleVisibleIndicesChange,
884
+ },
885
+ ];
709
886
  };
710
- const isWithText = ({ text, aboveText, appendLeft }) => Boolean(text || aboveText || !appendLeft);
711
-
712
- const getDisabledButtonClasses = ({ className, rounded, version, }) => [
713
- 'inline-block',
714
- buttonStyle,
715
- version ? buttonDisabledStyleMap[version] : '',
716
- rounded ? 'rounded-full' : 'rounded-md',
717
- className,
718
- ].join(' ');
719
-
720
- const getRegularButtonClasses = ({ className, rounded, version, }) => [
721
- buttonStyle,
722
- 'border border-transparent inline-block cursor-pointer no-underline focus:border-primary-text focus:border h-fit',
723
- version ? buttonStyleMap[version] : '',
724
- rounded ? 'rounded-full' : 'rounded-md',
725
- className,
726
- ].join(' ');
727
-
728
- const Button = JSX(({ disabled, children, ...rest }) => {
729
- const link = useLink();
730
- const adjustedProps = link(rest);
731
- const buttonInner = children ?? jsx(ButtonInner, { ...adjustedProps });
732
- return disabled ? (jsx(DisabledButton, { ...adjustedProps, children: buttonInner })) : (jsx(RegularButton, { ...adjustedProps, children: buttonInner }));
733
- });
734
- const RegularButton = JSX(({ className = '', href, rel, target, ariaLabel, version, rounded, onClick, children }) => (jsx("a", { className: getRegularButtonClasses({ className, version, rounded }), href: href, rel: rel, target: target, "aria-label": ariaLabel, role: href ? 'link' : 'button', onClick: onClick, children: children })));
735
- const DisabledButton = JSX(({ className, ariaLabel, version, rounded, children }) => (jsx("div", { role: "button", "aria-disabled": "true", "aria-label": ariaLabel, tabIndex: -1, className: getDisabledButtonClasses({ className, rounded, version }), children: children })));
736
887
 
737
888
  const ArrowButton = JSX(({ className, disabled, ...rest }) => (jsx(Button, { rounded: true, className: `group/btn shadow-[0_4px_25px_rgba(0,0,0,0.07)] w-12 h-12 min-h-12 max-h-12 flex items-center justify-center ${disabled
738
889
  ? 'bg-secondary-light text-secondary-text'
@@ -809,30 +960,6 @@
809
960
  const getAlignStyle = (isAlignCenter) => isAlignCenter ? 'flex justify-center' : '';
810
961
  const renderDots = (containerRef, dotsActiveIndex, itemCount) => (jsx(SwipeListControlDots, { containerRef: containerRef, activeIndex: dotsActiveIndex, dotCount: itemCount, listType: 'horizontal-list' }));
811
962
 
812
- const mobileHeadingTagMap = {
813
- h1: 'h1',
814
- h2: 'h1',
815
- h3: 'h2',
816
- h4: 'h2',
817
- h5: 'h3',
818
- h6: 'h3',
819
- };
820
- const headingTag = (tag) => mobileHeadingTagMap[tag] || 'h3';
821
-
822
- const styles = {
823
- h0: 'text-h0',
824
- h1: 'text-h1',
825
- h2: 'text-h2',
826
- h3: 'text-h3',
827
- h4: 'text-h4',
828
- h5: 'text-h5',
829
- h6: 'text-h6', // 20
830
- };
831
- const Heading = JSX(({ className = '', headingType = 'h3', as = 'h3', title, children }) => {
832
- const Tag = headingTag(as);
833
- return (jsx(Tag, { className: `font-sans m-0 ${styles[headingType]} ${className}`, children: title || children }));
834
- });
835
-
836
963
  const LinkWrapper = JSX(({ className = '', href, target, isRemote = false, children }) => {
837
964
  const link = useLink({ isRemote });
838
965
  const linkProps = link({ href, target });
@@ -987,18 +1114,6 @@
987
1114
 
988
1115
  const getPaddingStyle = (isHighlighting = false) => isHighlighting ? 'p-default mt-6' : 'mt-6 p-default'; // Хак для мобильной версии т.к. контракт должен быть идентичный
989
1116
 
990
- const renderButtonsSection = (buttons, { className = '', buttonClassName, isVertical } = {}) => buttons?.length && buttons.some((_) => _?.text || _?.icon?.icon) ? (jsx("div", { className: style('flex', isVertical ? 'flex-col gap-2' : 'flex-wrap gap-4', className), children: buttons.map(renderButton(buttonClassName)) })) : null;
991
- const renderButton = (buttonClassName = '') => (button, index) => {
992
- const { text, icon, iconRight, version, ...rest } = button || {};
993
- const iconVersionDefault = version === 'secondary' ? 'color' : 'white';
994
- const iconVersion = icon?.iconVersion ? icon?.iconVersion : iconVersionDefault;
995
- return text || icon?.icon ? (jsx(Button, { className: buttonClassName, appendLeft: renderButtonIcon({ ...icon, iconVersion }), appendRight: renderButtonIcon({ ...iconRight, iconVersion }), version: version, text: text, ...rest }, index ? String(index) : '')) : null;
996
- };
997
- const DEFAULT_ICON_W = 24;
998
- const renderButtonIcon = (icon) => icon?.icon || icon?.src ? (jsx(Img, { image: icon, width: String(icon?.size?.width || DEFAULT_ICON_W), height: String(DEFAULT_ICON_W) })) : null;
999
-
1000
- const Text = JSX(({ children, ...style }) => (jsx("span", { className: ['font-sans', ...Object.values(style)].join(' '), children: children })));
1001
-
1002
1117
  const descriptionSize = 'text-l';
1003
1118
 
1004
1119
  const renderCardInfo = (cell, i) => {
@@ -1178,45 +1293,54 @@
1178
1293
  secondary: 'bg-white/30',
1179
1294
  'secondary-light': 'bg-secondary-light',
1180
1295
  };
1181
- const RoundedIcon = JSX(({ iconBgVersion = 'primary', ...rest }) => (jsx("div", { className: style('rounded-icon p-2.5 mr-3', iconBgStyles[iconBgVersion]), children: jsx(Icon, { ...rest }) })));
1296
+ const RoundedIcon = JSX(({ iconBgVersion = 'primary', size, icon, ...rest }) => {
1297
+ const width = String(size?.width || 24);
1298
+ const height = String(size?.height || 24);
1299
+ return icon ? (jsx("div", { className: style('rounded-icon p-2.5 mr-3', iconBgStyles[iconBgVersion]), children: jsx(Icon, { ...rest, width: width, height: height, name: icon }) })) : null;
1300
+ });
1301
+
1302
+ const renderRoundedIcon = (icon, iconBgVersion) => (jsx(RoundedIcon, { ...icon, iconBgVersion: iconBgVersion }));
1182
1303
 
1183
1304
  const foldableSectionStyles = 'flex flex-wrap group-last:last:pb-0';
1184
1305
 
1185
1306
  const getIconName = (isUnfolded) => isUnfolded ? 'ArrowUpSolidIcon' : 'ArrowDownSolidIcon';
1186
1307
 
1187
- const labelSize = 'text-l';
1308
+ const labelSize$1 = 'text-l';
1188
1309
 
1189
1310
  const rollupIconVersion = 'normal';
1190
1311
 
1191
1312
  const rollupItemStyles = '';
1192
1313
 
1193
- const RollupItem = JSX(({ className = '', label = 'Развернуть', labelIcon, isExpanded, isFoldButtonOnTop = true, version = 'primary', ...rest }) => {
1194
- return (jsx(BlockWrapper, { className: style('w-full', rollupItemStyles, className), tag: "div", version: "transparent", ...rest, children: jsx(Foldable, { isFoldButtonOnTop: isFoldButtonOnTop, unfoldedByDefault: isExpanded, renderFoldableSection: ({ isUnfolded }) => (jsx(FoldableSection, { className: style('gap-5 [&>*]:p-0', foldableSectionStyles), isUnfolded: isUnfolded, children: renderChildren(rest) })), renderFoldButton: ({ isUnfolded, onToggle }) => renderFoldButton({ version, label, labelIcon, isUnfolded, onToggle }) }) }));
1314
+ const RollupItem = JSX(({ className = '', label = 'Развернуть', labelIcon, labelIconBgVersion, isExpanded, isFoldButtonOnTop = true, version = 'primary', ...rest }) => {
1315
+ return (jsx(BlockWrapper, { className: style('w-full', rollupItemStyles, className), tag: "div", version: "transparent", ...rest, children: jsx(Foldable, { isFoldButtonOnTop: isFoldButtonOnTop, unfoldedByDefault: isExpanded, renderFoldableSection: ({ isUnfolded }) => (jsx(FoldableSection, { className: style('gap-5 [&>*]:p-0', foldableSectionStyles), isUnfolded: isUnfolded, children: renderChildren(rest) })), renderFoldButton: ({ isUnfolded, onToggle }) => renderFoldButton({
1316
+ version,
1317
+ label,
1318
+ labelIcon,
1319
+ labelIconBgVersion,
1320
+ isUnfolded,
1321
+ onToggle,
1322
+ }) }) }));
1195
1323
  });
1196
1324
  RollupItem.childrenTypes = {
1197
1325
  exclude: ['RollupItem'],
1198
1326
  };
1199
- const renderFoldButton = ({ version, label: defaultLabel, labelIcon, isUnfolded, onToggle, }) => {
1327
+ const renderFoldButton = ({ version, label: defaultLabel, labelIcon, labelIconBgVersion, isUnfolded, onToggle, }) => {
1200
1328
  const label = defaultLabel || (isUnfolded ? 'Скрыть' : 'Развернуть');
1201
1329
  return version === 'primary' ? (renderPrimaryFoldButton({
1202
1330
  label,
1203
1331
  labelIcon,
1332
+ labelIconBgVersion,
1204
1333
  icon: getIconName(isUnfolded),
1205
1334
  onToggle,
1206
1335
  })) : (jsx(DefaultFoldButton, { label: label, icon: isUnfolded ? 'ArrowUpIcon' : 'ArrowDownIcon', onClick: onToggle }));
1207
1336
  };
1208
- const renderPrimaryFoldButton = ({ label, icon, onToggle, labelIcon }) => {
1209
- const iconWidth = String(labelIcon?.size?.width || 24);
1210
- const iconHeight = String(labelIcon?.size?.height || 24);
1211
- const iconName = labelIcon?.icon;
1212
- return (jsxs("button", { className: style('border-none bg-transparent px-0 flex justify-between items-center w-full cursor-pointer group/button', iconName ? 'py-2' : 'py-5'), onClick: onToggle, children: [jsxs("div", { className: "flex items-center group-hover/button:text-primary-main", children: [iconName ? (jsx(RoundedIcon, { name: iconName, width: iconWidth, height: iconHeight, iconVersion: labelIcon?.iconVersion })) : null, label ? (jsx(Text, { size: labelSize, font: "font-normal", children: label })) : null] }), icon ? jsx(Icon, { name: icon, iconVersion: rollupIconVersion, width: "24", height: "24" }) : null] }));
1337
+ const renderPrimaryFoldButton = ({ label, labelIconBgVersion, icon, onToggle, labelIcon, }) => {
1338
+ return (jsxs("button", { className: style('border-none bg-transparent px-0 flex justify-between items-center w-full cursor-pointer group/button', labelIcon?.icon ? 'py-2' : 'py-5'), onClick: onToggle, children: [jsxs("div", { className: "flex items-center group-hover/button:text-primary-main", children: [renderRoundedIcon(labelIcon, labelIconBgVersion), label ? (jsx(Text, { size: labelSize$1, font: "font-normal", children: label })) : null] }), icon ? jsx(Icon, { name: icon, iconVersion: rollupIconVersion, width: "24", height: "24" }) : null] }));
1213
1339
  };
1214
1340
 
1215
- const Contacts = JSX(({ className = '', items, hasButton }) => (jsxs("div", { className: className, children: [items?.length ? items.map(renderContact) : null, hasButton ? (jsx(Button, { version: "primary", className: "mb-6 w-full", href: "https://www.rshb.ru/feedback/question/", target: "_blank", ariaLabel: "\u041E\u0431\u0440\u0430\u0442\u043D\u0430\u044F \u0441\u0432\u044F\u0437\u044C", text: "\u041E\u0431\u0440\u0430\u0442\u043D\u0430\u044F \u0441\u0432\u044F\u0437\u044C" })) : null] })));
1216
- const renderContact = (item, index) => {
1217
- const { type, text, description } = item;
1218
- return (jsxs("div", { className: "mb-4", children: [jsx("div", { children: renderText(type, text) }), jsx("div", { className: "mt-1 text-s-light text-secondary-text", children: description })] }, String(index)));
1219
- };
1341
+ const Contacts = JSX(({ className = '', items, hasButton }) => (jsxs("div", { className: className, children: [items?.length ? items.map(renderContactsGroup) : null, hasButton ? (jsx(Button, { version: "primary", className: "mb-6 w-full", href: "https://www.rshb.ru/feedback/question/", target: "_blank", ariaLabel: "\u041E\u0431\u0440\u0430\u0442\u043D\u0430\u044F \u0441\u0432\u044F\u0437\u044C", text: "\u041E\u0431\u0440\u0430\u0442\u043D\u0430\u044F \u0441\u0432\u044F\u0437\u044C" })) : null] })));
1342
+ const renderContactsGroup = (item, i) => (jsxs("div", { className: "mb-6", children: [jsx("div", { className: "mb-4", children: jsx(Text, { size: "text-l", font: "font-medium", children: item?.title }) }), jsx("div", { children: item.items?.map(renderContact) })] }, String(i)));
1343
+ const renderContact = (item, index) => (jsxs("div", { className: "mb-4", children: [jsx("div", { children: renderText(item.type, item.text) }), jsx("div", { className: "mt-1 text-s-light text-secondary-text", children: item.description })] }, String(index)));
1220
1344
  const renderText = (type, text = '') => {
1221
1345
  switch (type) {
1222
1346
  case 'tel':
@@ -1335,6 +1459,64 @@
1335
1459
  return (jsx("div", { className: style('col-span-12 rounded-md cursor-pointer p-4 bg-secondary-light font-sans', className), children: href ? (jsxs("div", { className: "flex", children: [jsx("div", { className: "flex justify-center align-middle rounded-md bg-primary-main w-12 h-12", children: jsx(Logo, { className: "w-8", bgColor: "transparent", showTitle: true }) }), jsxs("a", { href: href, target: "_blank", className: "flex flex-col justify-center pl-3", children: [jsx("div", { className: "text-s font-medium mb-[3px]", children: title }), jsx("div", { className: "text-s text-secondary-text", children: description })] })] })) : null }));
1336
1460
  });
1337
1461
 
1462
+ const labelSize = 'text-l';
1463
+
1464
+ const BenefitItem = JSX((props) => {
1465
+ const { className = '', icon, label, description, benefitsVersion = 'normal' } = props;
1466
+ const listItemAlign = description ? 'items-start' : 'items-center';
1467
+ return (jsxs("div", { className: `flex gap-5 ${listItemAlign} ${className}`, children: [icon ? (jsx("div", { className: getBenefitIconBgStyle(benefitsVersion), children: jsx(Img, { className: "w-6 h-6", image: { ...icon, iconVersion: icon.iconVersion || benefitsVersion } }) })) : null, jsxs("div", { className: "gap-0.5", children: [label ? (jsx(Text, { color: "text-primary-text group-data-secondary:text-white", size: labelSize, children: label })) : null, description ? (jsx(Paragraph, { font: "font-light", size: "text-m", color: "text-secondary-text group-data-secondary:text-white", children: description })) : null] })] }));
1468
+ });
1469
+ function getBenefitIconBgStyle(benefitsVersion) {
1470
+ const bgColorStyle = benefitsVersion === 'normal'
1471
+ ? 'bg-secondary-light text-primary-main'
1472
+ : 'bg-primary-main text-black group-data-secondary:bg-white/30 group-data-secondary:text-black';
1473
+ return style('w-12 h-12 min-w-12 p-2.5 box-border flex items-center justify-center rounded-icon', bgColorStyle);
1474
+ }
1475
+
1476
+ const RichText = JSX((props) => {
1477
+ const { __html = '', richVersion = '' } = props;
1478
+ return (jsx("div", { className: style(richVersion, 'md-container'), dangerouslySetInnerHTML: { __html } }));
1479
+ });
1480
+
1481
+ function assertUnreachable(x) {
1482
+ throw new Error(x);
1483
+ }
1484
+
1485
+ // TODO: Create universal function for this case
1486
+ const renderBenefit$1 =
1487
+ // Linter doesn't understand that switch processes all cases
1488
+ // eslint-disable-next-line consistent-return
1489
+ (version) => (benefit, i) => {
1490
+ const { type } = benefit;
1491
+ if (!(type === 'default' || type === 'rte')) {
1492
+ return null;
1493
+ }
1494
+ switch (type) {
1495
+ case 'default':
1496
+ return (jsx(BenefitItem, { icon: benefit.icon, label: benefit.label, description: benefit.description, version: version }, String(i)));
1497
+ case 'rte':
1498
+ return jsx(RichText, { __html: benefit.__html });
1499
+ default:
1500
+ assertUnreachable(benefit);
1501
+ }
1502
+ };
1503
+
1504
+ const positionStyle = 'justify-end flex-col-reverse gap-4';
1505
+
1506
+ const styleInsuranceSum = 'flex-col gap-2';
1507
+
1508
+ const styleValueBlock = 'flex-col gap-1';
1509
+ const styleValueBlockText = '';
1510
+
1511
+ const renderInsuranceSumMonth = (sum = 0, monthLimit = 0) => sum || monthLimit ? (jsxs("div", { className: style('flex mt-6', styleInsuranceSum), children: [sum > 0 ? renderValueBlock('Страховая сумма:', sum, Boolean(monthLimit)) : null, monthLimit > 0 ? renderValueBlock('Ежемесячный лимит:', monthLimit, Boolean(sum)) : null] })) : null;
1512
+ const renderValueBlock = (title, sum = 0, isAnotherBlock = false) => {
1513
+ const widthStyle = isAnotherBlock ? 'w-fit' : 'w-full';
1514
+ return (jsxs("div", { className: style(`flex w-full whitespace-pre`, styleValueBlock, widthStyle), children: [jsx(Text, { font: "font-light", size: "text-l", children: title }), jsxs(Text, { size: "text-h6", color: styleValueBlockText, children: [toLocalNumberFormat(2)(sum), " \u20BD"] })] }));
1515
+ };
1516
+
1517
+ const PictureText = JSX(({ className = '', title, description, image, benefits, sum, monthLimit, directionRight = false, version = 'primary', ...rest }) => (jsxs(BlockWrapper, { className: style('relative p-default', className), version: version, ...rest, children: [jsx(Headline, { className: "!p-0", title: title, description: description, headlineVersion: "M" // TODO: Сверить с макетом после влития мобильных правок Headline (DRAFT)
1518
+ , align: "text-left" }), jsxs("div", { className: style('flex mt-6', positionStyle), children: [image?.src ? jsx(Img, { className: directionRight ? 'order-2' : '', image: image }) : null, jsxs("div", { children: [benefits?.length ? (jsx("div", { className: "flex flex-col gap-4", children: benefits.map(renderBenefit$1(version)) })) : null, renderInsuranceSumMonth(Number(sum), Number(monthLimit))] })] })] })));
1519
+
1338
1520
  const getColSpan = (className) => {
1339
1521
  const colSpanPrefix = 'col-span-';
1340
1522
  const colSpanStr = className?.split(/\s+/).find((_) => _.startsWith(colSpanPrefix));
@@ -1390,26 +1572,9 @@
1390
1572
  const renderShimmerItem = (width, index) => (jsx("div", { style: { width: `${width || 100}%` }, className: "h-4 mt-2 bg-secondary-light" }, String(index)));
1391
1573
  const goldenSequence = (first, size) => [first].concat(size > 0 ? goldenSequence(first / GOLDEN_RATIO, size - 1) : []);
1392
1574
 
1393
- const RichText = JSX((props) => {
1394
- const { __html = '', richVersion = '' } = props;
1395
- return (jsx("div", { className: style(richVersion, 'md-container'), dangerouslySetInnerHTML: { __html } }));
1396
- });
1397
-
1398
1575
  const BaseTile = JSX(({ className, title = '', insetTitle = '', buttons, leftImage, rightImage, backImage, children, }) => (jsxs("div", { className: style('relative flex flex-col font-sans', className), children: [backImage ? jsx("div", { className: "absolute bottom-0 right-0 z-0", children: backImage }) : null, title, jsxs("div", { className: "grow relative flex flex-wrap sm:flex-nowrap justify-between items-stretch gap-8", children: [renderImageContainer(leftImage), jsxs("div", { className: style('flex flex-col gap-8', leftImage ? '' : 'grow'), children: [insetTitle, jsx("div", { className: "grow", children: children }), buttons] }), renderImageContainer(rightImage, { className: '-order-1 sm:order-1' })] })] })));
1399
1576
  const renderImageContainer = (image, { className } = {}) => image ? jsx("div", { className: style('flex-none', className), children: image }) : null;
1400
1577
 
1401
- const BenefitItem = JSX(({ className, icon, label, description, version = 'primary', benefitsVersion = 'normal' }) => (jsxs("div", { className: style('flex gap-5', description ? 'items-start' : 'items-center', className), children: [icon ? (jsx("div", { className: getBenefitIconBgStyle(version, benefitsVersion), children: jsx(Img, { className: "w-6 h-6", image: { ...icon, iconVersion: icon.iconVersion || benefitsVersion } }) })) : null, jsxs("div", { children: [label ? (jsx(Text, { size: "text-h6", color: "text-primary-text group-data-secondary:text-white", children: label })) : null, description ? (jsx(Paragraph, { size: "text-m-light", color: "text-secondary-text group-data-secondary:text-white", children: description })) : null] })] })));
1402
- function getBenefitIconBgStyle(version, benefitsVersion) {
1403
- let bgColorStyle = 'bg-primary-main text-black';
1404
- if (version === 'secondary') {
1405
- bgColorStyle = 'bg-white/30 text-black';
1406
- }
1407
- else if (benefitsVersion === 'normal') {
1408
- bgColorStyle = 'bg-secondary-light text-primary-main';
1409
- }
1410
- return `w-12 h-12 min-w-12 rounded-full p-2.5 box-border flex items-center justify-center ${bgColorStyle}`;
1411
- }
1412
-
1413
1578
  const renderBenefit = (version = 'primary', benefitsVersion = 'normal') => (props, i) => jsx(BenefitItem, { version: version, benefitsVersion: benefitsVersion, ...props }, String(i));
1414
1579
 
1415
1580
  const ProductBlockInner = JSX(({ className, version = 'primary', headlineVersion = 'L', title, description, benefits, benefitsVersion, items, isDotted = true, __html, buttons, image, directionRight = true, }) => {
@@ -1443,10 +1608,6 @@
1443
1608
  return (jsx(BlockWrapper, { ...rest, children: jsx(RichText, { __html: __html, richVersion: richVersion }) }));
1444
1609
  });
1445
1610
 
1446
- function assertUnreachable(x) {
1447
- throw new Error(x);
1448
- }
1449
-
1450
1611
  const checkCanRenderIcon = (icon) => Boolean(icon?.icon || icon?.src);
1451
1612
 
1452
1613
  const STEPS_BLOCK_STYLE = {
@@ -1581,6 +1742,8 @@
1581
1742
  VerticalLayout.childrenTypes = [];
1582
1743
 
1583
1744
  const Blocks = {
1745
+ ButtonsBlock,
1746
+ CardTransfer,
1584
1747
  Carousel,
1585
1748
  CarouselTariffsCard,
1586
1749
  ComparisonTable,
@@ -1590,6 +1753,7 @@
1590
1753
  ImgBlock,
1591
1754
  LinkDocs,
1592
1755
  MobileAppTile,
1756
+ PictureText,
1593
1757
  Placeholder,
1594
1758
  ProductBlock,
1595
1759
  StepsBlock,
@@ -1800,7 +1964,7 @@
1800
1964
 
1801
1965
  const joinList = (sep) => (list) => list.reduce((acc, el, i) => (acc.length ? acc.concat({ ...sep, key: `sep-${i}` }, el) : [el]), []);
1802
1966
 
1803
- const packageVersion = "0.11.2";
1967
+ const packageVersion = "0.11.3";
1804
1968
 
1805
1969
  exports.Blocks = Blocks;
1806
1970
  exports.ContentPage = ContentPage;