@redneckz/wildless-cms-uni-blocks 0.6.15 → 0.6.17

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 (500) hide show
  1. package/bin/migration-scripts/0.6.16.js +90 -0
  2. package/bin/utils.js +2 -0
  3. package/bundle/blocks.schema.json +1 -1
  4. package/bundle/bundle.umd.js +318 -169
  5. package/bundle/bundle.umd.min.js +1 -1
  6. package/bundle/components/Bonus/BonusContent.d.ts +1 -0
  7. package/bundle/components/ExchangeRateTile/CurrentLocation.d.ts +0 -1
  8. package/bundle/components/ExchangeRateTile/ExchangeCurrencyCalculator.d.ts +7 -3
  9. package/bundle/components/ExchangeRateTile/callbackCurrencySelect.d.ts +1 -1
  10. package/bundle/components/ExchangeRateTile/useFetchExchangeRateData.d.ts +17 -0
  11. package/bundle/components/OfficeMap/nearbyOffices.d.ts +2 -0
  12. package/bundle/components/OfficeMap/renderFunctions.d.ts +1 -1
  13. package/bundle/{hooks → components/OfficeMap}/useOfficeMap.d.ts +0 -0
  14. package/bundle/icons/IconName.d.ts +6 -2
  15. package/bundle/ui-kit/Button/ButtonProps.d.ts +5 -1
  16. package/bundle/ui-kit/Button/ButtonSection.d.ts +9 -1
  17. package/bundle/{components/OfficeMap → ui-kit/YandexMap}/YandexMap.d.ts +4 -1
  18. package/bundle/ui-kit/YandexMap/ZoomButton.d.ts +7 -0
  19. package/bundle/ui-kit/YandexMap/mockPoints.d.ts +5 -0
  20. package/bundle/ui-kit/YandexMap/renderClusterer.d.ts +2 -0
  21. package/bundle/ui-kit/YandexMap/renderOpenMap.d.ts +2 -0
  22. package/bundle/ui-kit/YandexMap/renderSearchField.d.ts +4 -0
  23. package/bundle/ui-kit/YandexMap/renderUserGeolocation.d.ts +3 -0
  24. package/bundle/ui-kit/YandexMap/useYandexMaps.d.ts +2 -0
  25. package/cosmos-static/icons/FullScreenIcon.svg +1 -0
  26. package/cosmos-static/icons/UserGeoLocationIcon.svg +1 -0
  27. package/dist/components/Bonus/BonusContent.d.ts +1 -0
  28. package/dist/components/Catalog/CatalogCard.js +2 -2
  29. package/dist/components/Catalog/CatalogCard.js.map +1 -1
  30. package/dist/components/ContentPage/renderContentPageHead.js +7 -7
  31. package/dist/components/ContentPage/renderContentPageHead.js.map +1 -1
  32. package/dist/components/ExchangeRateTile/CurrencyTable.js +2 -2
  33. package/dist/components/ExchangeRateTile/CurrencyTable.js.map +1 -1
  34. package/dist/components/ExchangeRateTile/CurrentLocation.d.ts +0 -1
  35. package/dist/components/ExchangeRateTile/CurrentLocation.js +1 -1
  36. package/dist/components/ExchangeRateTile/CurrentLocation.js.map +1 -1
  37. package/dist/components/ExchangeRateTile/ExchangeCurrencyCalculator.d.ts +7 -3
  38. package/dist/components/ExchangeRateTile/ExchangeCurrencyCalculator.js +15 -15
  39. package/dist/components/ExchangeRateTile/ExchangeCurrencyCalculator.js.map +1 -1
  40. package/dist/components/ExchangeRateTile/ExchangeRateTile.js +11 -11
  41. package/dist/components/ExchangeRateTile/ExchangeRateTile.js.map +1 -1
  42. package/dist/components/ExchangeRateTile/callbackCurrencySelect.d.ts +1 -1
  43. package/dist/components/ExchangeRateTile/renderInput.js +4 -1
  44. package/dist/components/ExchangeRateTile/renderInput.js.map +1 -1
  45. package/dist/components/ExchangeRateTile/useFetchExchangeRateData.d.ts +17 -0
  46. package/dist/components/ExchangeRateTile/useFetchExchangeRateData.js +43 -0
  47. package/dist/components/ExchangeRateTile/useFetchExchangeRateData.js.map +1 -0
  48. package/dist/components/Gallery/GalleryCardInner.js +2 -2
  49. package/dist/components/Gallery/GalleryCardInner.js.map +1 -1
  50. package/dist/components/Gallery/GalleryInner.js +2 -2
  51. package/dist/components/Gallery/GalleryInner.js.map +1 -1
  52. package/dist/components/Header/DropdownMenu.js +1 -1
  53. package/dist/components/Header/DropdownMenu.js.map +1 -1
  54. package/dist/components/Header/HeaderSubMenu.js +16 -11
  55. package/dist/components/Header/HeaderSubMenu.js.map +1 -1
  56. package/dist/components/OfficeMap/OfficeMap.js +6 -10
  57. package/dist/components/OfficeMap/OfficeMap.js.map +1 -1
  58. package/dist/components/OfficeMap/nearbyOffices.d.ts +2 -0
  59. package/dist/components/OfficeMap/nearbyOffices.js +9 -0
  60. package/dist/components/OfficeMap/nearbyOffices.js.map +1 -0
  61. package/dist/components/OfficeMap/renderFunctions.d.ts +1 -1
  62. package/dist/components/OfficeMap/renderFunctions.js +1 -1
  63. package/dist/components/OfficeMap/renderFunctions.js.map +1 -1
  64. package/dist/{hooks → components/OfficeMap}/useOfficeMap.d.ts +0 -0
  65. package/{mobile/dist/hooks → dist/components/OfficeMap}/useOfficeMap.js +1 -1
  66. package/dist/components/OfficeMap/useOfficeMap.js.map +1 -0
  67. package/dist/components/PictureText/PictureText.js +1 -1
  68. package/dist/components/PictureText/PictureText.js.map +1 -1
  69. package/dist/components/SafeDepositRental/SafeDepositRental.js +2 -2
  70. package/dist/components/SafeDepositRental/SafeDepositRental.js.map +1 -1
  71. package/dist/components/TariffsTable/EmbeddableCellData.js +5 -2
  72. package/dist/components/TariffsTable/EmbeddableCellData.js.map +1 -1
  73. package/dist/components/TariffsTable/EmbeddableCellData.mobile.js +5 -2
  74. package/dist/components/TariffsTable/EmbeddableCellData.mobile.js.map +1 -1
  75. package/dist/components/TariffsTable/dataFixture.js +2 -4
  76. package/dist/components/TariffsTable/dataFixture.js.map +1 -1
  77. package/dist/icons/IconName.d.ts +6 -2
  78. package/dist/icons/IconName.js +5 -1
  79. package/dist/icons/IconName.js.map +1 -1
  80. package/dist/ui-kit/Button/ButtonProps.d.ts +5 -1
  81. package/dist/ui-kit/Button/ButtonSection.d.ts +9 -1
  82. package/dist/ui-kit/Button/ButtonSection.js +18 -6
  83. package/dist/ui-kit/Button/ButtonSection.js.map +1 -1
  84. package/dist/ui-kit/Foldable/DefaultFoldButton.js +13 -4
  85. package/dist/ui-kit/Foldable/DefaultFoldButton.js.map +1 -1
  86. package/dist/ui-kit/IntersectionObserverTag.js +10 -10
  87. package/dist/ui-kit/IntersectionObserverTag.js.map +1 -1
  88. package/{lib/components/OfficeMap → dist/ui-kit/YandexMap}/YandexMap.d.ts +4 -1
  89. package/dist/ui-kit/YandexMap/YandexMap.js +86 -0
  90. package/dist/ui-kit/YandexMap/YandexMap.js.map +1 -0
  91. package/dist/ui-kit/YandexMap/ZoomButton.d.ts +7 -0
  92. package/dist/ui-kit/YandexMap/ZoomButton.js +26 -0
  93. package/dist/ui-kit/YandexMap/ZoomButton.js.map +1 -0
  94. package/dist/ui-kit/YandexMap/mockPoints.d.ts +5 -0
  95. package/dist/ui-kit/YandexMap/mockPoints.js +28 -0
  96. package/dist/ui-kit/YandexMap/mockPoints.js.map +1 -0
  97. package/dist/ui-kit/YandexMap/renderClusterer.d.ts +2 -0
  98. package/dist/ui-kit/YandexMap/renderClusterer.js +35 -0
  99. package/dist/ui-kit/YandexMap/renderClusterer.js.map +1 -0
  100. package/dist/ui-kit/YandexMap/renderOpenMap.d.ts +2 -0
  101. package/dist/ui-kit/YandexMap/renderOpenMap.js +19 -0
  102. package/dist/ui-kit/YandexMap/renderOpenMap.js.map +1 -0
  103. package/dist/ui-kit/YandexMap/renderSearchField.d.ts +4 -0
  104. package/dist/ui-kit/YandexMap/renderSearchField.js +31 -0
  105. package/dist/ui-kit/YandexMap/renderSearchField.js.map +1 -0
  106. package/dist/ui-kit/YandexMap/renderUserGeolocation.d.ts +3 -0
  107. package/dist/ui-kit/YandexMap/renderUserGeolocation.js +31 -0
  108. package/dist/ui-kit/YandexMap/renderUserGeolocation.js.map +1 -0
  109. package/dist/ui-kit/YandexMap/useYandexMaps.d.ts +2 -0
  110. package/dist/ui-kit/YandexMap/useYandexMaps.js +11 -0
  111. package/dist/ui-kit/YandexMap/useYandexMaps.js.map +1 -0
  112. package/lib/common.css +1 -1
  113. package/lib/components/Bonus/BonusContent.d.ts +1 -0
  114. package/lib/components/Catalog/CatalogCard.js +2 -2
  115. package/lib/components/Catalog/CatalogCard.js.map +1 -1
  116. package/lib/components/ContentPage/renderContentPageHead.js +7 -7
  117. package/lib/components/ContentPage/renderContentPageHead.js.map +1 -1
  118. package/lib/components/ExchangeRateTile/CurrencyTable.js +2 -2
  119. package/lib/components/ExchangeRateTile/CurrencyTable.js.map +1 -1
  120. package/lib/components/ExchangeRateTile/CurrentLocation.d.ts +0 -1
  121. package/lib/components/ExchangeRateTile/CurrentLocation.js +1 -1
  122. package/lib/components/ExchangeRateTile/CurrentLocation.js.map +1 -1
  123. package/lib/components/ExchangeRateTile/ExchangeCurrencyCalculator.d.ts +7 -3
  124. package/lib/components/ExchangeRateTile/ExchangeCurrencyCalculator.js +15 -15
  125. package/lib/components/ExchangeRateTile/ExchangeCurrencyCalculator.js.map +1 -1
  126. package/lib/components/ExchangeRateTile/ExchangeRateTile.js +11 -11
  127. package/lib/components/ExchangeRateTile/ExchangeRateTile.js.map +1 -1
  128. package/lib/components/ExchangeRateTile/callbackCurrencySelect.d.ts +1 -1
  129. package/lib/components/ExchangeRateTile/renderInput.js +4 -1
  130. package/lib/components/ExchangeRateTile/renderInput.js.map +1 -1
  131. package/lib/components/ExchangeRateTile/useFetchExchangeRateData.d.ts +17 -0
  132. package/lib/components/ExchangeRateTile/useFetchExchangeRateData.js +39 -0
  133. package/lib/components/ExchangeRateTile/useFetchExchangeRateData.js.map +1 -0
  134. package/lib/components/Gallery/GalleryCardInner.js +2 -2
  135. package/lib/components/Gallery/GalleryCardInner.js.map +1 -1
  136. package/lib/components/Gallery/GalleryInner.js +2 -2
  137. package/lib/components/Gallery/GalleryInner.js.map +1 -1
  138. package/lib/components/Header/DropdownMenu.js +1 -1
  139. package/lib/components/Header/DropdownMenu.js.map +1 -1
  140. package/lib/components/Header/HeaderSubMenu.js +17 -12
  141. package/lib/components/Header/HeaderSubMenu.js.map +1 -1
  142. package/lib/components/OfficeMap/OfficeMap.js +6 -10
  143. package/lib/components/OfficeMap/OfficeMap.js.map +1 -1
  144. package/lib/components/OfficeMap/nearbyOffices.d.ts +2 -0
  145. package/lib/components/OfficeMap/nearbyOffices.js +7 -0
  146. package/lib/components/OfficeMap/nearbyOffices.js.map +1 -0
  147. package/lib/components/OfficeMap/renderFunctions.d.ts +1 -1
  148. package/lib/components/OfficeMap/renderFunctions.js +1 -1
  149. package/lib/components/OfficeMap/renderFunctions.js.map +1 -1
  150. package/lib/{hooks → components/OfficeMap}/useOfficeMap.d.ts +0 -0
  151. package/{mobile/lib/hooks → lib/components/OfficeMap}/useOfficeMap.js +1 -1
  152. package/lib/components/OfficeMap/useOfficeMap.js.map +1 -0
  153. package/lib/components/PictureText/PictureText.js +1 -1
  154. package/lib/components/PictureText/PictureText.js.map +1 -1
  155. package/lib/components/SafeDepositRental/SafeDepositRental.js +2 -2
  156. package/lib/components/SafeDepositRental/SafeDepositRental.js.map +1 -1
  157. package/lib/components/TariffsTable/EmbeddableCellData.js +5 -2
  158. package/lib/components/TariffsTable/EmbeddableCellData.js.map +1 -1
  159. package/lib/components/TariffsTable/EmbeddableCellData.mobile.js +5 -2
  160. package/lib/components/TariffsTable/EmbeddableCellData.mobile.js.map +1 -1
  161. package/lib/components/TariffsTable/dataFixture.js +2 -4
  162. package/lib/components/TariffsTable/dataFixture.js.map +1 -1
  163. package/lib/icons/IconName.d.ts +6 -2
  164. package/lib/icons/IconName.js +5 -1
  165. package/lib/icons/IconName.js.map +1 -1
  166. package/lib/ui-kit/Button/ButtonProps.d.ts +5 -1
  167. package/lib/ui-kit/Button/ButtonSection.d.ts +9 -1
  168. package/lib/ui-kit/Button/ButtonSection.js +16 -5
  169. package/lib/ui-kit/Button/ButtonSection.js.map +1 -1
  170. package/lib/ui-kit/Foldable/DefaultFoldButton.js +13 -4
  171. package/lib/ui-kit/Foldable/DefaultFoldButton.js.map +1 -1
  172. package/lib/ui-kit/IntersectionObserverTag.js +11 -11
  173. package/lib/ui-kit/IntersectionObserverTag.js.map +1 -1
  174. package/{mobile/bundle/components/OfficeMap → lib/ui-kit/YandexMap}/YandexMap.d.ts +4 -1
  175. package/lib/ui-kit/YandexMap/YandexMap.js +84 -0
  176. package/lib/ui-kit/YandexMap/YandexMap.js.map +1 -0
  177. package/lib/ui-kit/YandexMap/ZoomButton.d.ts +7 -0
  178. package/lib/ui-kit/YandexMap/ZoomButton.js +24 -0
  179. package/lib/ui-kit/YandexMap/ZoomButton.js.map +1 -0
  180. package/lib/ui-kit/YandexMap/mockPoints.d.ts +5 -0
  181. package/lib/ui-kit/YandexMap/mockPoints.js +26 -0
  182. package/lib/ui-kit/YandexMap/mockPoints.js.map +1 -0
  183. package/lib/ui-kit/YandexMap/renderClusterer.d.ts +2 -0
  184. package/lib/ui-kit/YandexMap/renderClusterer.js +32 -0
  185. package/lib/ui-kit/YandexMap/renderClusterer.js.map +1 -0
  186. package/lib/ui-kit/YandexMap/renderOpenMap.d.ts +2 -0
  187. package/lib/ui-kit/YandexMap/renderOpenMap.js +16 -0
  188. package/lib/ui-kit/YandexMap/renderOpenMap.js.map +1 -0
  189. package/lib/ui-kit/YandexMap/renderSearchField.d.ts +4 -0
  190. package/lib/ui-kit/YandexMap/renderSearchField.js +28 -0
  191. package/lib/ui-kit/YandexMap/renderSearchField.js.map +1 -0
  192. package/lib/ui-kit/YandexMap/renderUserGeolocation.d.ts +3 -0
  193. package/lib/ui-kit/YandexMap/renderUserGeolocation.js +28 -0
  194. package/lib/ui-kit/YandexMap/renderUserGeolocation.js.map +1 -0
  195. package/lib/ui-kit/YandexMap/useYandexMaps.d.ts +2 -0
  196. package/lib/ui-kit/YandexMap/useYandexMaps.js +8 -0
  197. package/lib/ui-kit/YandexMap/useYandexMaps.js.map +1 -0
  198. package/mobile/bundle/bundle.umd.js +32 -19
  199. package/mobile/bundle/bundle.umd.min.js +1 -1
  200. package/mobile/bundle/components/Bonus/BonusContent.d.ts +1 -0
  201. package/mobile/bundle/components/ExchangeRateTile/CurrentLocation.d.ts +0 -1
  202. package/mobile/bundle/components/ExchangeRateTile/ExchangeCurrencyCalculator.d.ts +7 -3
  203. package/mobile/bundle/components/ExchangeRateTile/callbackCurrencySelect.d.ts +1 -1
  204. package/mobile/bundle/components/ExchangeRateTile/useFetchExchangeRateData.d.ts +17 -0
  205. package/mobile/bundle/components/OfficeMap/nearbyOffices.d.ts +2 -0
  206. package/mobile/bundle/components/OfficeMap/renderFunctions.d.ts +1 -1
  207. package/mobile/bundle/{hooks → components/OfficeMap}/useOfficeMap.d.ts +0 -0
  208. package/mobile/bundle/icons/IconName.d.ts +6 -2
  209. package/mobile/bundle/ui-kit/Button/ButtonProps.d.ts +5 -1
  210. package/mobile/bundle/ui-kit/Button/ButtonSection.d.ts +9 -1
  211. package/{dist/components/OfficeMap → mobile/bundle/ui-kit/YandexMap}/YandexMap.d.ts +4 -1
  212. package/mobile/bundle/ui-kit/YandexMap/ZoomButton.d.ts +7 -0
  213. package/mobile/bundle/ui-kit/YandexMap/mockPoints.d.ts +5 -0
  214. package/mobile/bundle/ui-kit/YandexMap/renderClusterer.d.ts +2 -0
  215. package/mobile/bundle/ui-kit/YandexMap/renderOpenMap.d.ts +2 -0
  216. package/mobile/bundle/ui-kit/YandexMap/renderSearchField.d.ts +4 -0
  217. package/mobile/bundle/ui-kit/YandexMap/renderUserGeolocation.d.ts +3 -0
  218. package/mobile/bundle/ui-kit/YandexMap/useYandexMaps.d.ts +2 -0
  219. package/mobile/dist/components/Bonus/BonusContent.d.ts +1 -0
  220. package/mobile/dist/components/Catalog/CatalogCard.js +2 -2
  221. package/mobile/dist/components/Catalog/CatalogCard.js.map +1 -1
  222. package/mobile/dist/components/ContentPage/renderContentPageHead.js +7 -7
  223. package/mobile/dist/components/ContentPage/renderContentPageHead.js.map +1 -1
  224. package/mobile/dist/components/ExchangeRateTile/CurrencyTable.js +2 -2
  225. package/mobile/dist/components/ExchangeRateTile/CurrencyTable.js.map +1 -1
  226. package/mobile/dist/components/ExchangeRateTile/CurrentLocation.d.ts +0 -1
  227. package/mobile/dist/components/ExchangeRateTile/CurrentLocation.js +1 -1
  228. package/mobile/dist/components/ExchangeRateTile/CurrentLocation.js.map +1 -1
  229. package/mobile/dist/components/ExchangeRateTile/ExchangeCurrencyCalculator.d.ts +7 -3
  230. package/mobile/dist/components/ExchangeRateTile/ExchangeCurrencyCalculator.js +15 -15
  231. package/mobile/dist/components/ExchangeRateTile/ExchangeCurrencyCalculator.js.map +1 -1
  232. package/mobile/dist/components/ExchangeRateTile/ExchangeRateTile.js +11 -11
  233. package/mobile/dist/components/ExchangeRateTile/ExchangeRateTile.js.map +1 -1
  234. package/mobile/dist/components/ExchangeRateTile/callbackCurrencySelect.d.ts +1 -1
  235. package/mobile/dist/components/ExchangeRateTile/renderInput.js +4 -1
  236. package/mobile/dist/components/ExchangeRateTile/renderInput.js.map +1 -1
  237. package/mobile/dist/components/ExchangeRateTile/useFetchExchangeRateData.d.ts +17 -0
  238. package/mobile/dist/components/ExchangeRateTile/useFetchExchangeRateData.js +43 -0
  239. package/mobile/dist/components/ExchangeRateTile/useFetchExchangeRateData.js.map +1 -0
  240. package/mobile/dist/components/Gallery/GalleryCardInner.js +2 -2
  241. package/mobile/dist/components/Gallery/GalleryCardInner.js.map +1 -1
  242. package/mobile/dist/components/Gallery/GalleryInner.js +2 -2
  243. package/mobile/dist/components/Gallery/GalleryInner.js.map +1 -1
  244. package/mobile/dist/components/Header/DropdownMenu.js +1 -1
  245. package/mobile/dist/components/Header/DropdownMenu.js.map +1 -1
  246. package/mobile/dist/components/Header/HeaderSubMenu.js +16 -11
  247. package/mobile/dist/components/Header/HeaderSubMenu.js.map +1 -1
  248. package/mobile/dist/components/OfficeMap/OfficeMap.js +6 -10
  249. package/mobile/dist/components/OfficeMap/OfficeMap.js.map +1 -1
  250. package/mobile/dist/components/OfficeMap/nearbyOffices.d.ts +2 -0
  251. package/mobile/dist/components/OfficeMap/nearbyOffices.js +9 -0
  252. package/mobile/dist/components/OfficeMap/nearbyOffices.js.map +1 -0
  253. package/mobile/dist/components/OfficeMap/renderFunctions.d.ts +1 -1
  254. package/mobile/dist/components/OfficeMap/renderFunctions.js +1 -1
  255. package/mobile/dist/components/OfficeMap/renderFunctions.js.map +1 -1
  256. package/mobile/dist/{hooks → components/OfficeMap}/useOfficeMap.d.ts +0 -0
  257. package/{dist/hooks → mobile/dist/components/OfficeMap}/useOfficeMap.js +1 -1
  258. package/mobile/dist/components/OfficeMap/useOfficeMap.js.map +1 -0
  259. package/mobile/dist/components/PictureText/PictureText.js +1 -1
  260. package/mobile/dist/components/PictureText/PictureText.js.map +1 -1
  261. package/mobile/dist/components/SafeDepositRental/SafeDepositRental.js +2 -2
  262. package/mobile/dist/components/SafeDepositRental/SafeDepositRental.js.map +1 -1
  263. package/mobile/dist/components/TariffsTable/EmbeddableCellData.js +5 -2
  264. package/mobile/dist/components/TariffsTable/EmbeddableCellData.js.map +1 -1
  265. package/mobile/dist/components/TariffsTable/dataFixture.js +2 -4
  266. package/mobile/dist/components/TariffsTable/dataFixture.js.map +1 -1
  267. package/mobile/dist/icons/IconName.d.ts +6 -2
  268. package/mobile/dist/icons/IconName.js +5 -1
  269. package/mobile/dist/icons/IconName.js.map +1 -1
  270. package/mobile/dist/ui-kit/Button/ButtonProps.d.ts +5 -1
  271. package/mobile/dist/ui-kit/Button/ButtonSection.d.ts +9 -1
  272. package/mobile/dist/ui-kit/Button/ButtonSection.js +18 -6
  273. package/mobile/dist/ui-kit/Button/ButtonSection.js.map +1 -1
  274. package/mobile/dist/ui-kit/Foldable/DefaultFoldButton.js +13 -4
  275. package/mobile/dist/ui-kit/Foldable/DefaultFoldButton.js.map +1 -1
  276. package/mobile/dist/ui-kit/IntersectionObserverTag.js +10 -10
  277. package/mobile/dist/ui-kit/IntersectionObserverTag.js.map +1 -1
  278. package/mobile/dist/ui-kit/YandexMap/YandexMap.d.ts +8 -0
  279. package/mobile/dist/ui-kit/YandexMap/YandexMap.js +86 -0
  280. package/mobile/dist/ui-kit/YandexMap/YandexMap.js.map +1 -0
  281. package/mobile/dist/ui-kit/YandexMap/ZoomButton.d.ts +7 -0
  282. package/mobile/dist/ui-kit/YandexMap/ZoomButton.js +26 -0
  283. package/mobile/dist/ui-kit/YandexMap/ZoomButton.js.map +1 -0
  284. package/mobile/dist/ui-kit/YandexMap/mockPoints.d.ts +5 -0
  285. package/mobile/dist/ui-kit/YandexMap/mockPoints.js +28 -0
  286. package/mobile/dist/ui-kit/YandexMap/mockPoints.js.map +1 -0
  287. package/mobile/dist/ui-kit/YandexMap/renderClusterer.d.ts +2 -0
  288. package/mobile/dist/ui-kit/YandexMap/renderClusterer.js +35 -0
  289. package/mobile/dist/ui-kit/YandexMap/renderClusterer.js.map +1 -0
  290. package/mobile/dist/ui-kit/YandexMap/renderOpenMap.d.ts +2 -0
  291. package/mobile/dist/ui-kit/YandexMap/renderOpenMap.js +19 -0
  292. package/mobile/dist/ui-kit/YandexMap/renderOpenMap.js.map +1 -0
  293. package/mobile/dist/ui-kit/YandexMap/renderSearchField.d.ts +4 -0
  294. package/mobile/dist/ui-kit/YandexMap/renderSearchField.js +31 -0
  295. package/mobile/dist/ui-kit/YandexMap/renderSearchField.js.map +1 -0
  296. package/mobile/dist/ui-kit/YandexMap/renderUserGeolocation.d.ts +3 -0
  297. package/mobile/dist/ui-kit/YandexMap/renderUserGeolocation.js +31 -0
  298. package/mobile/dist/ui-kit/YandexMap/renderUserGeolocation.js.map +1 -0
  299. package/mobile/dist/ui-kit/YandexMap/useYandexMaps.d.ts +2 -0
  300. package/mobile/dist/ui-kit/YandexMap/useYandexMaps.js +11 -0
  301. package/mobile/dist/ui-kit/YandexMap/useYandexMaps.js.map +1 -0
  302. package/mobile/lib/components/Bonus/BonusContent.d.ts +1 -0
  303. package/mobile/lib/components/Catalog/CatalogCard.js +2 -2
  304. package/mobile/lib/components/Catalog/CatalogCard.js.map +1 -1
  305. package/mobile/lib/components/ContentPage/renderContentPageHead.js +7 -7
  306. package/mobile/lib/components/ContentPage/renderContentPageHead.js.map +1 -1
  307. package/mobile/lib/components/ExchangeRateTile/CurrencyTable.js +2 -2
  308. package/mobile/lib/components/ExchangeRateTile/CurrencyTable.js.map +1 -1
  309. package/mobile/lib/components/ExchangeRateTile/CurrentLocation.d.ts +0 -1
  310. package/mobile/lib/components/ExchangeRateTile/CurrentLocation.js +1 -1
  311. package/mobile/lib/components/ExchangeRateTile/CurrentLocation.js.map +1 -1
  312. package/mobile/lib/components/ExchangeRateTile/ExchangeCurrencyCalculator.d.ts +7 -3
  313. package/mobile/lib/components/ExchangeRateTile/ExchangeCurrencyCalculator.js +15 -15
  314. package/mobile/lib/components/ExchangeRateTile/ExchangeCurrencyCalculator.js.map +1 -1
  315. package/mobile/lib/components/ExchangeRateTile/ExchangeRateTile.js +11 -11
  316. package/mobile/lib/components/ExchangeRateTile/ExchangeRateTile.js.map +1 -1
  317. package/mobile/lib/components/ExchangeRateTile/callbackCurrencySelect.d.ts +1 -1
  318. package/mobile/lib/components/ExchangeRateTile/renderInput.js +4 -1
  319. package/mobile/lib/components/ExchangeRateTile/renderInput.js.map +1 -1
  320. package/mobile/lib/components/ExchangeRateTile/useFetchExchangeRateData.d.ts +17 -0
  321. package/mobile/lib/components/ExchangeRateTile/useFetchExchangeRateData.js +39 -0
  322. package/mobile/lib/components/ExchangeRateTile/useFetchExchangeRateData.js.map +1 -0
  323. package/mobile/lib/components/Gallery/GalleryCardInner.js +2 -2
  324. package/mobile/lib/components/Gallery/GalleryCardInner.js.map +1 -1
  325. package/mobile/lib/components/Gallery/GalleryInner.js +2 -2
  326. package/mobile/lib/components/Gallery/GalleryInner.js.map +1 -1
  327. package/mobile/lib/components/Header/DropdownMenu.js +1 -1
  328. package/mobile/lib/components/Header/DropdownMenu.js.map +1 -1
  329. package/mobile/lib/components/Header/HeaderSubMenu.js +17 -12
  330. package/mobile/lib/components/Header/HeaderSubMenu.js.map +1 -1
  331. package/mobile/lib/components/OfficeMap/OfficeMap.js +6 -10
  332. package/mobile/lib/components/OfficeMap/OfficeMap.js.map +1 -1
  333. package/mobile/lib/components/OfficeMap/nearbyOffices.d.ts +2 -0
  334. package/mobile/lib/components/OfficeMap/nearbyOffices.js +7 -0
  335. package/mobile/lib/components/OfficeMap/nearbyOffices.js.map +1 -0
  336. package/mobile/lib/components/OfficeMap/renderFunctions.d.ts +1 -1
  337. package/mobile/lib/components/OfficeMap/renderFunctions.js +1 -1
  338. package/mobile/lib/components/OfficeMap/renderFunctions.js.map +1 -1
  339. package/mobile/lib/{hooks → components/OfficeMap}/useOfficeMap.d.ts +0 -0
  340. package/{lib/hooks → mobile/lib/components/OfficeMap}/useOfficeMap.js +1 -1
  341. package/mobile/lib/components/OfficeMap/useOfficeMap.js.map +1 -0
  342. package/mobile/lib/components/PictureText/PictureText.js +1 -1
  343. package/mobile/lib/components/PictureText/PictureText.js.map +1 -1
  344. package/mobile/lib/components/SafeDepositRental/SafeDepositRental.js +2 -2
  345. package/mobile/lib/components/SafeDepositRental/SafeDepositRental.js.map +1 -1
  346. package/mobile/lib/components/TariffsTable/EmbeddableCellData.js +5 -2
  347. package/mobile/lib/components/TariffsTable/EmbeddableCellData.js.map +1 -1
  348. package/mobile/lib/components/TariffsTable/dataFixture.js +2 -4
  349. package/mobile/lib/components/TariffsTable/dataFixture.js.map +1 -1
  350. package/mobile/lib/icons/IconName.d.ts +6 -2
  351. package/mobile/lib/icons/IconName.js +5 -1
  352. package/mobile/lib/icons/IconName.js.map +1 -1
  353. package/mobile/lib/ui-kit/Button/ButtonProps.d.ts +5 -1
  354. package/mobile/lib/ui-kit/Button/ButtonSection.d.ts +9 -1
  355. package/mobile/lib/ui-kit/Button/ButtonSection.js +16 -5
  356. package/mobile/lib/ui-kit/Button/ButtonSection.js.map +1 -1
  357. package/mobile/lib/ui-kit/Foldable/DefaultFoldButton.js +13 -4
  358. package/mobile/lib/ui-kit/Foldable/DefaultFoldButton.js.map +1 -1
  359. package/mobile/lib/ui-kit/IntersectionObserverTag.js +11 -11
  360. package/mobile/lib/ui-kit/IntersectionObserverTag.js.map +1 -1
  361. package/mobile/lib/ui-kit/YandexMap/YandexMap.d.ts +8 -0
  362. package/mobile/lib/ui-kit/YandexMap/YandexMap.js +84 -0
  363. package/mobile/lib/ui-kit/YandexMap/YandexMap.js.map +1 -0
  364. package/mobile/lib/ui-kit/YandexMap/ZoomButton.d.ts +7 -0
  365. package/mobile/lib/ui-kit/YandexMap/ZoomButton.js +24 -0
  366. package/mobile/lib/ui-kit/YandexMap/ZoomButton.js.map +1 -0
  367. package/mobile/lib/ui-kit/YandexMap/mockPoints.d.ts +5 -0
  368. package/mobile/lib/ui-kit/YandexMap/mockPoints.js +26 -0
  369. package/mobile/lib/ui-kit/YandexMap/mockPoints.js.map +1 -0
  370. package/mobile/lib/ui-kit/YandexMap/renderClusterer.d.ts +2 -0
  371. package/mobile/lib/ui-kit/YandexMap/renderClusterer.js +32 -0
  372. package/mobile/lib/ui-kit/YandexMap/renderClusterer.js.map +1 -0
  373. package/mobile/lib/ui-kit/YandexMap/renderOpenMap.d.ts +2 -0
  374. package/mobile/lib/ui-kit/YandexMap/renderOpenMap.js +16 -0
  375. package/mobile/lib/ui-kit/YandexMap/renderOpenMap.js.map +1 -0
  376. package/mobile/lib/ui-kit/YandexMap/renderSearchField.d.ts +4 -0
  377. package/mobile/lib/ui-kit/YandexMap/renderSearchField.js +28 -0
  378. package/mobile/lib/ui-kit/YandexMap/renderSearchField.js.map +1 -0
  379. package/mobile/lib/ui-kit/YandexMap/renderUserGeolocation.d.ts +3 -0
  380. package/mobile/lib/ui-kit/YandexMap/renderUserGeolocation.js +28 -0
  381. package/mobile/lib/ui-kit/YandexMap/renderUserGeolocation.js.map +1 -0
  382. package/mobile/lib/ui-kit/YandexMap/useYandexMaps.d.ts +2 -0
  383. package/mobile/lib/ui-kit/YandexMap/useYandexMaps.js +8 -0
  384. package/mobile/lib/ui-kit/YandexMap/useYandexMaps.js.map +1 -0
  385. package/mobile/src/common.css +9 -0
  386. package/mobile/src/components/Bonus/Bonus.example.json +1 -6
  387. package/mobile/src/components/Bonus/BonusContent.ts +1 -0
  388. package/mobile/src/components/Catalog/CatalogCard.tsx +2 -2
  389. package/mobile/src/components/ContentPage/renderContentPageHead.tsx +11 -7
  390. package/mobile/src/components/ExchangeRateTile/CurrencyTable.tsx +8 -6
  391. package/mobile/src/components/ExchangeRateTile/CurrentLocation.tsx +8 -15
  392. package/mobile/src/components/ExchangeRateTile/ExchangeCurrencyCalculator.tsx +31 -19
  393. package/mobile/src/components/ExchangeRateTile/ExchangeRateTile.tsx +14 -13
  394. package/mobile/src/components/ExchangeRateTile/callbackCurrencySelect.ts +1 -1
  395. package/mobile/src/components/ExchangeRateTile/renderInput.tsx +5 -2
  396. package/mobile/src/components/ExchangeRateTile/useFetchExchangeRateData.ts +71 -0
  397. package/mobile/src/components/Gallery/GalleryCardInner.tsx +2 -2
  398. package/mobile/src/components/Gallery/GalleryInner.tsx +2 -2
  399. package/mobile/src/components/Header/DropdownMenu.tsx +5 -5
  400. package/mobile/src/components/Header/HeaderSubMenu.tsx +36 -20
  401. package/mobile/src/components/OfficeMap/OfficeMap.tsx +10 -17
  402. package/mobile/src/components/OfficeMap/nearbyOffices.ts +8 -0
  403. package/mobile/src/components/OfficeMap/renderFunctions.tsx +5 -2
  404. package/mobile/src/{hooks → components/OfficeMap}/useOfficeMap.ts +1 -1
  405. package/mobile/src/components/PictureText/PictureText.tsx +1 -1
  406. package/mobile/src/components/SafeDepositRental/SafeDepositRental.tsx +2 -2
  407. package/mobile/src/components/TariffsTable/EmbeddableCellData.tsx +7 -11
  408. package/mobile/src/components/TariffsTable/dataFixture.tsx +2 -3
  409. package/mobile/src/icons/FullScreenIcon.svg +8 -0
  410. package/mobile/src/icons/IconName.ts +5 -5
  411. package/mobile/src/icons/UserGeoLocationIcon.svg +3 -0
  412. package/mobile/src/ui-kit/Button/ButtonProps.ts +5 -1
  413. package/mobile/src/ui-kit/Button/ButtonSection.tsx +41 -16
  414. package/mobile/src/ui-kit/Foldable/DefaultFoldButton.tsx +32 -23
  415. package/mobile/src/ui-kit/IntersectionObserverTag.tsx +13 -17
  416. package/mobile/src/ui-kit/YandexMap/YandexMap.tsx +128 -0
  417. package/mobile/src/ui-kit/YandexMap/ZoomButton.tsx +38 -0
  418. package/mobile/src/ui-kit/YandexMap/mockPoints.ts +30 -0
  419. package/mobile/src/ui-kit/YandexMap/renderClusterer.ts +51 -0
  420. package/mobile/src/ui-kit/YandexMap/renderOpenMap.tsx +26 -0
  421. package/mobile/src/ui-kit/YandexMap/renderSearchField.tsx +51 -0
  422. package/mobile/src/ui-kit/YandexMap/renderUserGeolocation.tsx +43 -0
  423. package/mobile/src/ui-kit/YandexMap/useYandexMaps.ts +11 -0
  424. package/package.json +1 -1
  425. package/src/common.css +9 -0
  426. package/src/components/Bonus/Bonus.example.json +1 -6
  427. package/src/components/Bonus/BonusContent.ts +1 -0
  428. package/src/components/Catalog/Catalog.fixture.tsx +3 -10
  429. package/src/components/Catalog/CatalogCard.tsx +2 -2
  430. package/src/components/ContentPage/renderContentPageHead.tsx +11 -7
  431. package/src/components/ExchangeRateTile/CurrencyTable.tsx +8 -6
  432. package/src/components/ExchangeRateTile/CurrentLocation.tsx +8 -15
  433. package/src/components/ExchangeRateTile/ExchangeCurrencyCalculator.tsx +31 -19
  434. package/src/components/ExchangeRateTile/ExchangeRateTile.tsx +14 -13
  435. package/src/components/ExchangeRateTile/callbackCurrencySelect.ts +1 -1
  436. package/src/components/ExchangeRateTile/renderInput.tsx +5 -2
  437. package/src/components/ExchangeRateTile/useFetchExchangeRateData.ts +71 -0
  438. package/src/components/Gallery/Gallery.fixture.tsx +1 -2
  439. package/src/components/Gallery/GalleryCardInner.tsx +2 -2
  440. package/src/components/Gallery/GalleryInner.tsx +2 -2
  441. package/src/components/Header/DropdownMenu.tsx +5 -5
  442. package/src/components/Header/HeaderSubMenu.tsx +36 -20
  443. package/src/components/MobileAppTile/MobileAppTile.fixture.tsx +3 -14
  444. package/src/components/OfficeMap/OfficeMap.tsx +10 -17
  445. package/src/components/OfficeMap/nearbyOffices.ts +8 -0
  446. package/src/components/OfficeMap/renderFunctions.tsx +5 -2
  447. package/src/{hooks → components/OfficeMap}/useOfficeMap.ts +1 -1
  448. package/src/components/PictureText/PictureText.tsx +1 -1
  449. package/src/components/SafeDepositRental/SafeDepositRental.tsx +2 -2
  450. package/src/components/StepsBlock/StepsBlock.fixture.tsx +2 -0
  451. package/src/components/TariffsTable/EmbeddableCellData.mobile.tsx +7 -11
  452. package/src/components/TariffsTable/EmbeddableCellData.tsx +7 -9
  453. package/src/components/TariffsTable/dataFixture.tsx +2 -3
  454. package/src/icons/FullScreenIcon.svg +8 -0
  455. package/src/icons/IconName.ts +9 -1
  456. package/src/icons/UserGeoLocationIcon.svg +3 -0
  457. package/src/ui-kit/Button/ButtonProps.ts +5 -1
  458. package/src/ui-kit/Button/ButtonSection.tsx +41 -16
  459. package/src/ui-kit/Foldable/DefaultFoldButton.tsx +32 -23
  460. package/src/ui-kit/IntersectionObserverTag.tsx +13 -17
  461. package/src/ui-kit/YandexMap/YandexMap.tsx +128 -0
  462. package/src/ui-kit/YandexMap/ZoomButton.tsx +38 -0
  463. package/src/ui-kit/YandexMap/mockPoints.ts +30 -0
  464. package/src/ui-kit/YandexMap/renderClusterer.ts +51 -0
  465. package/src/ui-kit/YandexMap/renderOpenMap.tsx +26 -0
  466. package/src/ui-kit/YandexMap/renderSearchField.tsx +51 -0
  467. package/src/ui-kit/YandexMap/renderUserGeolocation.tsx +43 -0
  468. package/src/ui-kit/YandexMap/useYandexMaps.ts +11 -0
  469. package/bundle/hooks/useExchangeRates.d.ts +0 -2
  470. package/dist/components/OfficeMap/YandexMap.js +0 -30
  471. package/dist/components/OfficeMap/YandexMap.js.map +0 -1
  472. package/dist/hooks/useExchangeRates.d.ts +0 -2
  473. package/dist/hooks/useExchangeRates.js +0 -57
  474. package/dist/hooks/useExchangeRates.js.map +0 -1
  475. package/dist/hooks/useOfficeMap.js.map +0 -1
  476. package/lib/components/OfficeMap/YandexMap.js +0 -28
  477. package/lib/components/OfficeMap/YandexMap.js.map +0 -1
  478. package/lib/hooks/useExchangeRates.d.ts +0 -2
  479. package/lib/hooks/useExchangeRates.js +0 -54
  480. package/lib/hooks/useExchangeRates.js.map +0 -1
  481. package/lib/hooks/useOfficeMap.js.map +0 -1
  482. package/mobile/bundle/hooks/useExchangeRates.d.ts +0 -2
  483. package/mobile/dist/components/OfficeMap/YandexMap.d.ts +0 -5
  484. package/mobile/dist/components/OfficeMap/YandexMap.js +0 -30
  485. package/mobile/dist/components/OfficeMap/YandexMap.js.map +0 -1
  486. package/mobile/dist/hooks/useExchangeRates.d.ts +0 -2
  487. package/mobile/dist/hooks/useExchangeRates.js +0 -57
  488. package/mobile/dist/hooks/useExchangeRates.js.map +0 -1
  489. package/mobile/dist/hooks/useOfficeMap.js.map +0 -1
  490. package/mobile/lib/components/OfficeMap/YandexMap.d.ts +0 -5
  491. package/mobile/lib/components/OfficeMap/YandexMap.js +0 -28
  492. package/mobile/lib/components/OfficeMap/YandexMap.js.map +0 -1
  493. package/mobile/lib/hooks/useExchangeRates.d.ts +0 -2
  494. package/mobile/lib/hooks/useExchangeRates.js +0 -54
  495. package/mobile/lib/hooks/useExchangeRates.js.map +0 -1
  496. package/mobile/lib/hooks/useOfficeMap.js.map +0 -1
  497. package/mobile/src/components/OfficeMap/YandexMap.tsx +0 -41
  498. package/mobile/src/hooks/useExchangeRates.ts +0 -76
  499. package/src/components/OfficeMap/YandexMap.tsx +0 -41
  500. package/src/hooks/useExchangeRates.ts +0 -76
@@ -1,5 +1,5 @@
1
1
  import { JSX } from '@redneckz/uni-jsx';
2
- import { useState } from '@redneckz/uni-jsx/lib/hooks';
2
+ import { useMemo, useRef, useState } from '@redneckz/uni-jsx/lib/hooks';
3
3
  import { useLink } from '../../hooks/useLink';
4
4
  import type { BgColorVersion } from '../../model/BgColorVersion';
5
5
  import type { LinkProps } from '../../model/LinkProps';
@@ -16,39 +16,52 @@ export interface HeaderSubMenuProps {
16
16
  }
17
17
 
18
18
  export const HeaderSubMenu = JSX<HeaderSubMenuProps>(({ context, subItems = [], bgColor }) => {
19
- const [menuVisible, setMenuVisible] = useState(false);
20
- const router = context.useRouter();
21
19
  const { handlerDecorator } = context;
20
+ const router = context.useRouter();
21
+
22
+ const subItemsListRef = useRef<HTMLDivElement | null>(null);
23
+
24
+ const [menuVisible, setMenuVisible] = useState(false);
22
25
 
23
26
  const [visibleItemsCount, setVisibleItemsCount] = useState(subItems.length);
24
27
  const dropDownMenuItems = subItems.slice(visibleItemsCount);
25
28
 
26
- const activeSubItem = findActiveSubItem(router)(subItems);
27
- const toggleMenu = () => setMenuVisible(!menuVisible);
29
+ const observerOptions = useMemo(
30
+ () => ({ threshold: 1, root: subItemsListRef.current }),
31
+ [subItemsListRef.current],
32
+ );
33
+
34
+ const observerCallbacks = useMemo(
35
+ () =>
36
+ subItems.map((_, index) => (entries: IntersectionObserverEntry[]) => {
37
+ if (!entries.length) {
38
+ return;
39
+ }
28
40
 
29
- const observerCallback = (itemIndex: number) => (entries: IntersectionObserverEntry[]) => {
30
- if (!entries.length) {
31
- return;
32
- }
41
+ // Assumption about sorting entries by time
42
+ const entry = entries[entries.length - 1];
33
43
 
34
- const entry = entries[0];
44
+ if (entry.isIntersecting) {
45
+ setVisibleItemsCount(handleIntersectionActivation(index));
46
+ } else {
47
+ setVisibleItemsCount(handleIntersectionDeactivation(index));
48
+ }
49
+ }),
50
+ [subItems],
51
+ );
35
52
 
36
- if (entry.intersectionRatio < 1) {
37
- setVisibleItemsCount((prev) => Math.min(prev, itemIndex));
38
- } else {
39
- setVisibleItemsCount((prev) => Math.max(prev, itemIndex + 1));
40
- }
41
- };
53
+ const activeSubItem = findActiveSubItem(router)(subItems);
54
+ const toggleMenu = () => setMenuVisible(!menuVisible);
42
55
 
43
56
  return (
44
57
  <nav className="relative mt-6">
45
- <div className="overflow-hidden whitespace-nowrap mr-52 pb-3">
58
+ <div ref={subItemsListRef} className="overflow-hidden whitespace-nowrap mr-52 pb-3">
46
59
  {subItems.map((_, i) => (
47
60
  <IntersectionObserverTag
48
- tag="span"
49
- observerCallback={observerCallback(i)}
50
- observerOptions={{ threshold: 1 }}
51
61
  key={String(i)}
62
+ tag="span"
63
+ observerCallback={observerCallbacks[i]}
64
+ observerOptions={observerOptions}
52
65
  >
53
66
  <HeaderItem
54
67
  className={`mr-8 ${visibleItemsCount - 1 < i ? 'invisible' : ''}`}
@@ -72,3 +85,6 @@ export const HeaderSubMenu = JSX<HeaderSubMenuProps>(({ context, subItems = [],
72
85
  </nav>
73
86
  );
74
87
  });
88
+
89
+ const handleIntersectionActivation = (index: number) => (prev: number) => Math.max(prev, index + 1);
90
+ const handleIntersectionDeactivation = (index: number) => (prev: number) => Math.min(prev, index);
@@ -1,8 +1,6 @@
1
- import type { IconVersion } from '../../model/IconVersion';
2
1
  import type { Picture } from '../../model/Picture';
3
2
  import { context } from '../../react/setup-fixture';
4
3
  import type { ButtonWithIconProps } from '../../ui-kit/Button/ButtonProps';
5
- import { Img } from '../../ui-kit/Img/Img';
6
4
  import { MobileAppTile } from './MobileAppTile';
7
5
 
8
6
  const image: Picture = {
@@ -34,14 +32,7 @@ const listItems = [
34
32
  const button1: ButtonWithIconProps = {
35
33
  aboveText: 'Загрузите в',
36
34
  text: 'App Store',
37
- appendLeft: (
38
- <Img
39
- image={{ icon: 'AppleIcon', iconVersion: 'white' as IconVersion }}
40
- width="24"
41
- height="24"
42
- asSVG
43
- />
44
- ),
35
+ icon: { icon: 'AppleIcon', iconVersion: 'white' },
45
36
  href: 'apps.apple.com',
46
37
  version: 'primary',
47
38
  };
@@ -49,13 +40,11 @@ const button1: ButtonWithIconProps = {
49
40
  const button2: ButtonWithIconProps = {
50
41
  aboveText: 'Доступно в',
51
42
  text: 'Google Play',
52
- appendLeft: <Img image={{ icon: 'PlayMarketIcon' }} width="24" height="24" asSVG />,
43
+ icon: { icon: 'PlayMarketIcon' },
53
44
  href: 'play.google.com',
54
45
  version: 'secondary',
55
46
  };
56
47
 
57
- const icon = <Img image={{ icon: 'AppleIcon' }} width="24" height="24" asSVG />;
58
-
59
48
  export default {
60
49
  default: (
61
50
  <div className="container grid grid-cols-12">
@@ -72,7 +61,7 @@ export default {
72
61
  buttons={[
73
62
  {
74
63
  ...button1,
75
- appendLeft: icon,
64
+ icon: { icon: 'AppleIcon' },
76
65
  version: 'secondary',
77
66
  },
78
67
  button2,
@@ -1,21 +1,18 @@
1
1
  import { JSX } from '@redneckz/uni-jsx';
2
- import { useOfficeMap } from '../../hooks/useOfficeMap';
2
+ import { useOfficeMap } from './useOfficeMap';
3
3
  import type { UniBlockProps } from '../../model/JSXBlock';
4
4
  import { Icon } from '../../ui-kit/Icon/Icon';
5
5
  import { OFFICE_MAP } from './mockOfficeMap';
6
- import type { NearbyOffices, OfficeMapProps, WorkScheduleWeek } from './OfficeMapContent';
6
+ import type { OfficeMapProps, WorkScheduleWeek } from './OfficeMapContent';
7
7
  import { renderCurrentDaySchedule, renderDay, renderNearbyOffice } from './renderFunctions';
8
- import { YandexMap } from './YandexMap';
8
+ import { YandexMap } from '../../ui-kit/YandexMap/YandexMap';
9
+ import { nearbyOffices } from './nearbyOffices';
9
10
 
10
11
  export const OfficeMap = JSX<UniBlockProps>(({ className = '' }) => {
11
12
  const resultOfficeMap = useOfficeMap('063') || OFFICE_MAP;
12
13
  const { name, address, gpsLatitude, gpsLongitude, workSchedule } =
13
14
  resultOfficeMap as OfficeMapProps;
14
15
  const {
15
- workTime,
16
- lunchHour,
17
- workTimeSaturday,
18
- lunchHourSaturday,
19
16
  workingMonday,
20
17
  workingTuesday,
21
18
  workingWednesday,
@@ -24,8 +21,8 @@ export const OfficeMap = JSX<UniBlockProps>(({ className = '' }) => {
24
21
  workingSaturday,
25
22
  workingSunday,
26
23
  } = workSchedule;
24
+ const { workTime, lunchHour, workTimeSaturday, lunchHourSaturday } = workSchedule;
27
25
  const point = gpsLatitude && gpsLongitude ? [gpsLatitude, gpsLongitude] : null;
28
-
29
26
  const workScheduleWeek: WorkScheduleWeek[] = [
30
27
  { title: 'Понедельник', status: workingMonday, workTime, lunchHour },
31
28
  { title: 'Вторник', status: workingTuesday, workTime, lunchHour },
@@ -46,12 +43,6 @@ export const OfficeMap = JSX<UniBlockProps>(({ className = '' }) => {
46
43
  },
47
44
  { title: 'Воскресенье', status: workingSunday },
48
45
  ];
49
- // Добавлено для проверки
50
- const nearbyOffices: NearbyOffices[] = [
51
- { title: 'Деловой центр', time: '1 мин', distance: '~30 м.', icon: 'MetroIcon' },
52
- { title: 'Выставочная', time: '5 мин', distance: '~120 м.', icon: 'MetroIcon' },
53
- { title: 'Деловой центр', time: '8 мин', distance: '~350 м.', icon: 'MetroIcon' },
54
- ];
55
46
  const currentWeekDayInd = new Date().getDay();
56
47
  const currentWeekDay =
57
48
  currentWeekDayInd > 0 ? workScheduleWeek[currentWeekDayInd - 1] : workScheduleWeek[6];
@@ -70,9 +61,11 @@ export const OfficeMap = JSX<UniBlockProps>(({ className = '' }) => {
70
61
  <div className="flex pt-4">{nearbyOffices.map(renderNearbyOffice)}</div>
71
62
  </div>
72
63
  <div className="flex justify-between pt-8">
73
- <div className="flex-grow h-full bg-gray">{point ? <YandexMap point={point} /> : null}</div>
74
- <div className="w-[434px] pl-9 pr-12 pb-14">
75
- <div className="flex flex-col">{workScheduleWeek.map(renderDay)}</div>
64
+ <div className="flex-grow h-full w-full overflow-hidden">
65
+ {point ? <YandexMap points={[point]} className="h-full" /> : null}
66
+ </div>
67
+ <div className="w-[434px] min-w-[434px] pl-9 pr-12 pb-14 flex flex-col">
68
+ {workScheduleWeek.map(renderDay)}
76
69
  </div>
77
70
  </div>
78
71
  </div>
@@ -0,0 +1,8 @@
1
+ import { NearbyOffices } from './OfficeMapContent';
2
+
3
+ // Добавлено для проверки
4
+ export const nearbyOffices: NearbyOffices[] = [
5
+ { title: 'Деловой центр', time: '1 мин', distance: '~30 м.', icon: 'MetroIcon' },
6
+ { title: 'Выставочная', time: '5 мин', distance: '~120 м.', icon: 'MetroIcon' },
7
+ { title: 'Деловой центр', time: '8 мин', distance: '~350 м.', icon: 'MetroIcon' },
8
+ ];
@@ -23,8 +23,11 @@ export const renderCurrentDaySchedule = ({ lunchHour, status, workTime }: WorkSc
23
23
  );
24
24
  };
25
25
 
26
- export const renderNearbyOffice = ({ icon, title, distance, time }: NearbyOffices, inx: number) => (
27
- <div className="flex mr-4" key={`nearbyOffice${inx}`}>
26
+ export const renderNearbyOffice = (
27
+ { icon, title, distance, time }: NearbyOffices,
28
+ index: number,
29
+ ) => (
30
+ <div className="flex mr-4" key={`nearbyOffice${index}`}>
28
31
  <Icon name={icon} width="16" height="16" asSVG className="mr-1" />
29
32
  {title ? <span className="text-m">{title}&nbsp;</span> : null}
30
33
  <span className="text-m-light">
@@ -1,5 +1,5 @@
1
1
  import { useAsyncData } from '@redneckz/uni-jsx/lib/hooks/useAsyncData';
2
- import { fetchJSON } from '../utils/fetchJSON';
2
+ import { fetchJSON } from '../../utils/fetchJSON';
3
3
 
4
4
  const OFFICE_MAP_URL = '/api/v1/branches';
5
5
 
@@ -47,7 +47,7 @@ export const PictureText = JSX<PictureTextProps>(
47
47
  {benefits?.length ? (
48
48
  <div className="flex flex-col gap-4">{benefits.map(renderBenefit(version))}</div>
49
49
  ) : null}
50
- {renderInsuranceSumMonth(sum, monthLimit)}
50
+ {renderInsuranceSumMonth(Number(sum), Number(monthLimit))}
51
51
  </div>
52
52
  </div>
53
53
  </BlockWrapper>
@@ -9,7 +9,7 @@ import { SafeDepositRentalForm } from './SafeDepositRentalForm';
9
9
  import { HandleChangeState, SafeDepositRentalState } from './SafeDepositRentalTypes';
10
10
  import { Region, useGetRegions } from './useGetRegions';
11
11
  import { getBranch, getCoordinates } from './utils';
12
- import { YandexMap } from './YandexMap';
12
+ import { YandexMap } from '../../ui-kit/YandexMap/YandexMap';
13
13
 
14
14
  export interface SafeDepositRentalProps extends SafeDepositRentalContent, UniBlockProps {}
15
15
 
@@ -58,7 +58,7 @@ export const SafeDepositRental = JSX<SafeDepositRentalProps>(
58
58
  />
59
59
  {footnote ? <p className="text-s-light text-secondary-text">{footnote}</p> : null}
60
60
  </div>
61
- {points.length && showMap ? <YandexMap points={points} /> : null}
61
+ {points.length && showMap ? <YandexMap points={points} className="h-[640px]" /> : null}
62
62
  </BlockWrapper>
63
63
  );
64
64
  },
@@ -113,6 +113,8 @@ export default {
113
113
  text: 'Отправить заявку',
114
114
  href: 'https://www.rshb.ru/',
115
115
  target: '_blank',
116
+ icon: { icon: 'ComfortableCompIcon' },
117
+ iconRight: { icon: 'ComfortableCompIcon' },
116
118
  }}
117
119
  />
118
120
  </div>
@@ -1,5 +1,5 @@
1
- import { Button } from '../../ui-kit/Button/Button';
2
1
  import type { ButtonContent } from '../../ui-kit/Button/ButtonProps';
2
+ import { renderButton } from '../../ui-kit/Button/ButtonSection';
3
3
  import { Img } from '../../ui-kit/Img/Img';
4
4
  import type { ImageContent } from '../../ui-kit/Img/ImgProps';
5
5
  import { List } from '../../ui-kit/List/List';
@@ -15,16 +15,12 @@ export type EmbeddableCellDataType =
15
15
  const renderButtonsCellData = ({ buttons }: ButtonContent) =>
16
16
  buttons && buttons?.length ? (
17
17
  <div>
18
- {buttons.map(({ rounded, appendLeft, ariaLabel, ...buttonProps }, idx) => (
19
- <Button
20
- className={`mt-3 ${idx > 0 && rounded ? 'ml-2.5' : ''} ${appendLeft ? 'w-12 h-12' : ''}`}
21
- key={String(idx)}
22
- appendLeft={appendLeft}
23
- rounded={rounded}
24
- ariaLabel={ariaLabel}
25
- {...buttonProps}
26
- />
27
- ))}
18
+ {buttons.map(({ rounded, icon, ...buttonProps }, idx) =>
19
+ renderButton({
20
+ button: { rounded, icon, ...buttonProps },
21
+ buttonClassName: `mt-3 ${idx > 0 && rounded ? 'ml-2.5' : ''} ${icon ? 'w-12 h-12' : ''}`,
22
+ }),
23
+ )}
28
24
  </div>
29
25
  ) : null;
30
26
 
@@ -1,8 +1,8 @@
1
1
  import { JSX } from '@redneckz/uni-jsx';
2
2
  import { useEffect, useState } from '@redneckz/uni-jsx/lib/hooks';
3
3
  import { EventBus } from '../../EventBus/EventBus';
4
- import { Button } from '../../ui-kit/Button/Button';
5
4
  import type { ButtonContent } from '../../ui-kit/Button/ButtonProps';
5
+ import { renderButton } from '../../ui-kit/Button/ButtonSection';
6
6
  import { Img } from '../../ui-kit/Img/Img';
7
7
  import type { ImageContent } from '../../ui-kit/Img/ImgProps';
8
8
  import { TableInnerButton, TableInnerButtonProps } from '../../ui-kit/InnerTable/InnerTableButton';
@@ -21,14 +21,12 @@ export type EmbeddableCellDataType =
21
21
  const renderButtonsCellData = ({ buttons }: ButtonContent) =>
22
22
  buttons && buttons?.length ? (
23
23
  <div>
24
- {buttons.map(({ rounded, ...buttonProps }, idx) => (
25
- <Button
26
- className={`${idx > 0 && rounded ? 'ml-3' : ''} w-12 h-12`}
27
- key={String(idx)}
28
- rounded={rounded}
29
- {...buttonProps}
30
- />
31
- ))}
24
+ {buttons.map(({ rounded, ...buttonProps }, idx) =>
25
+ renderButton({
26
+ button: { rounded, ...buttonProps },
27
+ buttonClassName: `${idx > 0 && rounded ? 'ml-3' : ''} w-12 h-12`,
28
+ }),
29
+ )}
32
30
  </div>
33
31
  ) : null;
34
32
 
@@ -1,5 +1,4 @@
1
1
  import type { Picture } from '../../model/Picture';
2
- import { Img } from '../../ui-kit/Img/Img';
3
2
  import type {
4
3
  InnerTableBlockDef,
5
4
  LabelDescriptionCellDef,
@@ -94,14 +93,14 @@ export const columns: TariffsTableColumn[] = [
94
93
  tableCellType: 'Buttons',
95
94
  buttons: [
96
95
  {
97
- appendLeft: <Img image={{ icon: 'AppleIcon' }} width="24" height="24" asSVG />,
96
+ icon: { icon: 'AppleIcon' },
98
97
  rounded: true,
99
98
  version: 'secondary',
100
99
  href: '/',
101
100
  target: '_blank',
102
101
  },
103
102
  {
104
- appendLeft: <Img image={{ icon: 'PlayMarketIcon' }} width="24" height="24" asSVG />,
103
+ icon: { icon: 'PlayMarketIcon' },
105
104
  rounded: true,
106
105
  version: 'secondary',
107
106
  href: '/',
@@ -0,0 +1,8 @@
1
+ <svg width="17" height="16" viewBox="0 0 17 16" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <path d="M14.5 3.33333V2H10.5" stroke="#1C1C1C" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
3
+ <path d="M14.5 5.99917V5.3125" stroke="#1C1C1C" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
4
+ <path d="M2.5 12.6641V13.9974H6.5" stroke="#1C1C1C" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
5
+ <path d="M2.5 10V10.6867" stroke="#1C1C1C" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
6
+ <path d="M14.5 2L9.5 7" stroke="#1C1C1C" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
7
+ <path d="M7.5 9L2.5 14" stroke="#1C1C1C" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
8
+ </svg>
@@ -15,6 +15,7 @@ export const IconsWithoutInversion = new Set([
15
15
  'DoneIcon',
16
16
  'EarthIcon',
17
17
  'EuroIcon',
18
+ 'FullScreenIcon',
18
19
  'GlassIcon',
19
20
  'InterestGrowthIcon',
20
21
  'JCBIcon',
@@ -32,6 +33,7 @@ export const IconsWithoutInversion = new Set([
32
33
  'SignDocsIcon',
33
34
  'SoundIcon',
34
35
  'UnionPayIcon',
36
+ 'UserGeoLocationIcon',
35
37
  'VisaIcon',
36
38
  'WateringCanIcon',
37
39
  ]);
@@ -76,6 +78,7 @@ export enum IconMap {
76
78
  EmptyWalletChangeIcon = 'EmptyWalletChangeIcon',
77
79
  EmptyWalletIcon = 'EmptyWalletIcon',
78
80
  EuroIcon = 'EuroIcon',
81
+ FullScreenIcon = 'FullScreenIcon',
79
82
  GeolocationIcon = 'GeolocationIcon',
80
83
  GlassIcon = 'GlassIcon',
81
84
  GlobalIcon = 'GlobalIcon',
@@ -119,6 +122,7 @@ export enum IconMap {
119
122
  StrongBoxIcon = 'StrongBoxIcon',
120
123
  TelegramIcon = 'TelegramIcon',
121
124
  UnionPayIcon = 'UnionPayIcon',
125
+ UserGeoLocationIcon = 'UserGeoLocationIcon',
122
126
  UserSquareIcon = 'UserSquareIcon',
123
127
  UserTickIcon = 'UserTickIcon',
124
128
  VisaIcon = 'VisaIcon',
@@ -170,6 +174,7 @@ export enum IconTitleMap {
170
174
  EmptyWalletChangeIcon = 'Пустой кошелёк с возвратом',
171
175
  EmptyWalletIcon = 'Пустой кошелёк',
172
176
  EuroIcon = 'Евро',
177
+ FullScreenIcon = 'FullScreenIcon',
173
178
  GeolocationIcon = 'Геолокация',
174
179
  GlassIcon = 'Зеркало',
175
180
  GlobalIcon = 'Глобус',
@@ -213,6 +218,7 @@ export enum IconTitleMap {
213
218
  StrongBoxIcon = 'Ящик с замочной скважиной',
214
219
  TelegramIcon = 'Лого «Telegram»',
215
220
  UnionPayIcon = 'UnionPay',
221
+ UserGeoLocationIcon = 'UserGeoLocationIcon',
216
222
  UserSquareIcon = 'Пользователь в рамке',
217
223
  UserTickIcon = 'Пользователь',
218
224
  VisaIcon = 'Visa',
@@ -229,7 +235,7 @@ export enum IconTitleMap {
229
235
  * @title Иконка
230
236
  * @enumNames [
231
237
  * "",
232
- * 'Деньги', 'Самолёт', 'Лого «Apple»', 'Стрелка \'Вниз\'', 'Стрелка', 'Стрелка вверх', 'Банкомат', 'Банк', 'Здание с деревом', 'Бургер', 'Календарь 2', 'Скруглённый календарь', 'Календарь', 'Календарь с галочкой', 'Машина2', 'Кред. карта', 'Кред. карта под наклоном', 'Кред. карта с галочкой', 'Карта с драгоценностями', 'Машина', 'Деньги внутри кошелька', 'Кинотеатр', 'Часы', 'Крестик', 'Кресло', 'Кредитные карты', 'Скидка', 'Скачать документ', 'Документ', 'Документ (одноцветный)', 'Документы', 'Документ с текстом', 'Доллар', 'Зелёная \'галочка\' в круге', 'Зелёная \'галочка\'', 'Земля', 'Пустой кошелёк с возвратом', 'Пустой кошелёк', 'Евро', 'Геолокация', 'Зеркало', 'Глобус', 'Gps', 'Сетка (белая)', 'Диаграмма роста', 'Скидка', 'JCB', 'Logo', 'Лупа', 'Маркер карты', 'Маркер карты РСХБ', 'MasterCard', 'Лого Метро', 'Минус', 'МИР', 'Деньги', 'Денежное страхование', 'Купюры', 'Монитор и мобильный', 'Новый документ', 'Офис', 'Лого «Одноклассники»', 'Пачка бумаги А4', 'Бизнес', 'Проценты (круг.)', 'Проценты', 'Персональная карта', 'Лого «PlayMarket»', 'Плюс', 'Щит', 'Профиль, 2 персоны', 'Профиль', 'Тыква', 'Рубль (круг.)', 'Сейф', 'Безопасность', 'Подписанные документы', 'Маленькие часы', 'Звук', 'Ящик с замочной скважиной', 'Лого «Telegram»', 'UnionPay', 'Пользователь в рамке', 'Пользователь', 'Visa', 'Лого «VK»', 'Пополнение карты', 'Кошелёк с плюсом', 'Кошелёк', 'Кошелёк с деньгами', 'Добавить продукт'
238
+ * 'Деньги', 'Самолёт', 'Лого «Apple»', 'Стрелка \'Вниз\'', 'Стрелка', 'Стрелка вверх', 'Банкомат', 'Банк', 'Здание с деревом', 'Бургер', 'Календарь 2', 'Скруглённый календарь', 'Календарь', 'Календарь с галочкой', 'Машина2', 'Кред. карта', 'Кред. карта под наклоном', 'Кред. карта с галочкой', 'Карта с драгоценностями', 'Машина', 'Деньги внутри кошелька', 'Кинотеатр', 'Часы', 'Крестик', 'Кресло', 'Кредитные карты', 'Скидка', 'Скачать документ', 'Документ', 'Документ (одноцветный)', 'Документы', 'Документ с текстом', 'Доллар', 'Зелёная \'галочка\' в круге', 'Зелёная \'галочка\'', 'Земля', 'Пустой кошелёк с возвратом', 'Пустой кошелёк', 'Евро', 'FullScreenIcon', 'Геолокация', 'Зеркало', 'Глобус', 'Gps', 'Сетка (белая)', 'Диаграмма роста', 'Скидка', 'JCB', 'Logo', 'Лупа', 'Маркер карты', 'Маркер карты РСХБ', 'MasterCard', 'Лого Метро', 'Минус', 'МИР', 'Деньги', 'Денежное страхование', 'Купюры', 'Монитор и мобильный', 'Новый документ', 'Офис', 'Лого «Одноклассники»', 'Пачка бумаги А4', 'Бизнес', 'Проценты (круг.)', 'Проценты', 'Персональная карта', 'Лого «PlayMarket»', 'Плюс', 'Щит', 'Профиль, 2 персоны', 'Профиль', 'Тыква', 'Рубль (круг.)', 'Сейф', 'Безопасность', 'Подписанные документы', 'Маленькие часы', 'Звук', 'Ящик с замочной скважиной', 'Лого «Telegram»', 'UnionPay', 'UserGeoLocationIcon', 'Пользователь в рамке', 'Пользователь', 'Visa', 'Лого «VK»', 'Пополнение карты', 'Кошелёк с плюсом', 'Кошелёк', 'Кошелёк с деньгами', 'Добавить продукт'
233
239
  * ]
234
240
  */
235
241
  export type IconName =
@@ -273,6 +279,7 @@ export type IconName =
273
279
  | 'EmptyWalletChangeIcon'
274
280
  | 'EmptyWalletIcon'
275
281
  | 'EuroIcon'
282
+ | 'FullScreenIcon'
276
283
  | 'GeolocationIcon'
277
284
  | 'GlassIcon'
278
285
  | 'GlobalIcon'
@@ -316,6 +323,7 @@ export type IconName =
316
323
  | 'StrongBoxIcon'
317
324
  | 'TelegramIcon'
318
325
  | 'UnionPayIcon'
326
+ | 'UserGeoLocationIcon'
319
327
  | 'UserSquareIcon'
320
328
  | 'UserTickIcon'
321
329
  | 'VisaIcon'
@@ -0,0 +1,3 @@
1
+ <svg width="21" height="16" viewBox="0 0 21 16" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <path fill-rule="evenodd" clip-rule="evenodd" d="M10.8314 14.9996H10.5631C9.83003 14.9139 9.24781 14.4212 9.12944 13.7863L8.45478 9.69953C8.39086 9.30917 8.522 8.91367 8.81511 8.61284L10.9081 6.46613C11.1812 6.18446 11.6652 6.14864 11.9891 6.38613C12.313 6.62362 12.3542 7.04448 12.0811 7.32615L9.9881 9.47286L10.6474 13.5729C10.6615 13.6299 10.7184 13.6712 10.7854 13.6729C10.8794 13.6883 10.9726 13.6436 11.0077 13.5663L17.3327 2.55938C17.367 2.50242 17.3568 2.43287 17.3071 2.38521C17.2575 2.33755 17.1789 2.32191 17.1103 2.34605L3.77052 6.73947C3.68052 6.76366 3.62065 6.83764 3.62485 6.91947C3.62336 6.98384 3.67498 7.03995 3.74752 7.05281L6.53815 7.61282C6.8052 7.66641 7.01909 7.83982 7.09924 8.06773C7.1794 8.29564 7.11364 8.54343 6.92674 8.71775C6.73985 8.89207 6.4602 8.96644 6.19315 8.91285L3.35653 8.3395C2.63532 8.17249 2.12473 7.61477 2.09921 6.96614C2.0674 6.31238 2.52658 5.71612 3.23386 5.49278L16.5737 1.09935C17.234 0.878256 17.9827 1.03374 18.4569 1.49044C18.9311 1.94713 19.0328 2.61066 18.7126 3.1594L12.4107 14.173C12.1119 14.6905 11.4972 15.0123 10.8314 14.9996Z" fill="#1C1C1C" stroke="#1C1C1C" stroke-width="0.3"/>
3
+ </svg>
@@ -1,6 +1,6 @@
1
1
  import type { ButtonVersion } from '../../model/ButtonVersion';
2
2
  import type { LinkProps } from '../../model/LinkProps';
3
- import type { IconProps } from '../../model/Picture';
3
+ import type { IconProps, Picture } from '../../model/Picture';
4
4
  import type { VNode } from '../../model/VNode';
5
5
 
6
6
  /**
@@ -29,6 +29,10 @@ export interface ButtonProps extends ButtonAdditionalProps, LinkProps {
29
29
  }
30
30
 
31
31
  export interface ButtonWithIconProps extends ButtonProps {
32
+ /** @title Иконка слева */
33
+ icon?: Picture;
34
+ /** @title Иконка справа */
35
+ iconRight?: Picture;
32
36
  /** @title Верхний текст */
33
37
  aboveText?: string;
34
38
  /** @hidden */
@@ -1,16 +1,23 @@
1
1
  import { JSX } from '@redneckz/uni-jsx';
2
- import { HandlerDecorator, Router } from '../../components/ContentPage/ContentPageContext';
3
2
  import { useLink } from '../../hooks/useLink';
3
+ import type { IconVersion } from '../../model/IconVersion';
4
4
  import type { UniBlockProps } from '../../model/JSXBlock';
5
+ import type { Picture } from '../../model/Picture';
6
+ import { Img } from '../Img/Img';
5
7
  import { Button } from './Button';
6
8
  import type { ButtonContent, ButtonWithIconProps } from './ButtonProps';
7
9
 
8
10
  export interface ButtonSectionProps extends ButtonContent, UniBlockProps {}
9
11
 
10
- interface ButtonSectionItemProps {
12
+ interface RenderButtonProps {
11
13
  button: ButtonWithIconProps;
12
- router: Router;
13
- handlerDecorator?: HandlerDecorator;
14
+ buttonClassName?: string;
15
+ index?: number;
16
+ }
17
+
18
+ interface RenderButtonIconProps {
19
+ icon?: Picture;
20
+ iconVersion?: IconVersion;
14
21
  }
15
22
 
16
23
  export const ButtonSection = JSX<ButtonSectionProps>(({ context, className = '', buttons }) => {
@@ -19,20 +26,38 @@ export const ButtonSection = JSX<ButtonSectionProps>(({ context, className = '',
19
26
 
20
27
  return buttons && buttons?.length ? (
21
28
  <div className={className}>
22
- {buttons.map((button, index) => (
23
- <ButtonSectionItem
24
- button={button}
25
- handlerDecorator={handlerDecorator}
26
- key={String(index)}
27
- router={router}
28
- />
29
- ))}
29
+ {buttons.map((button, index) =>
30
+ renderButton({ button: useLink({ router, handlerDecorator }, button), index }),
31
+ )}
30
32
  </div>
31
33
  ) : null;
32
34
  });
33
35
 
34
- const ButtonSectionItem = JSX<ButtonSectionItemProps>(({ router, handlerDecorator, button }) => {
35
- const buttonProps = useLink({ router, handlerDecorator }, button);
36
+ export function renderButton({ button, buttonClassName, index }: RenderButtonProps) {
37
+ const { icon, iconRight, version, ...rest } = button;
36
38
 
37
- return <Button {...button} {...buttonProps} />;
38
- });
39
+ const iconVersion = version === 'secondary' ? 'normal' : 'white';
40
+
41
+ const leftIcon = renderButtonIcon({ icon, iconVersion });
42
+ const rightIcon = renderButtonIcon({ icon: iconRight, iconVersion });
43
+
44
+ return (
45
+ <Button
46
+ className={buttonClassName}
47
+ appendLeft={leftIcon}
48
+ appendRight={rightIcon}
49
+ version={version}
50
+ key={index ? String(index) : ''}
51
+ {...rest}
52
+ />
53
+ );
54
+ }
55
+
56
+ const renderButtonIcon = ({ icon, iconVersion }: RenderButtonIconProps) => {
57
+ if (!icon?.icon && !icon?.src) {
58
+ return null;
59
+ }
60
+ const iconWidth = icon?.size?.width ? `${icon.size.width}` : '24';
61
+
62
+ return <Img image={{ ...icon, iconVersion: iconVersion }} width={iconWidth} height="24" asSVG />;
63
+ };
@@ -13,29 +13,38 @@ interface DefaultFoldButtonProps {
13
13
  }
14
14
 
15
15
  export const DefaultFoldButton = JSX<DefaultFoldButtonProps>(
16
- ({ className, label, icon, dataTheme = '', onClick }) => (
17
- <button
18
- className={`border-none bg-primary-main hover:bg-primary-hover px-0 py-5 mb-[1px] w-full font-sans text-white flex justify-center cursor-pointer ${
19
- className || ''
20
- }`}
21
- data-theme={dataTheme}
22
- onClick={onClick}
23
- >
24
- <span className="text-h4 pr-3">{label}</span>
25
- {icon ? (
26
- <Img
27
- image={{
28
- icon,
29
- iconVersion: 'white',
30
- }}
31
- className="flex-shrink-0 my-auto"
32
- width="20"
33
- height="20"
34
- asSVG
35
- />
36
- ) : null}
37
- </button>
38
- ),
16
+ ({ className = '', label, icon, dataTheme = '', onClick }) => {
17
+ const STATE_STYLE =
18
+ 'hover:bg-primary-hover focus:border-primary-text active:bg-primary-active outline-none';
19
+ const DIMENSIONS_STYLE = 'flex justify-center w-full px-0 py-5 mb-[1px]';
20
+
21
+ return (
22
+ <button
23
+ className={[
24
+ 'border border-transparent bg-primary-main font-sans text-white cursor-pointer',
25
+ STATE_STYLE,
26
+ DIMENSIONS_STYLE,
27
+ className,
28
+ ].join(' ')}
29
+ data-theme={dataTheme}
30
+ onClick={onClick}
31
+ >
32
+ <span className="text-h4 pr-3">{label}</span>
33
+ {icon ? (
34
+ <Img
35
+ image={{
36
+ icon,
37
+ iconVersion: 'white',
38
+ }}
39
+ className="flex-shrink-0 my-auto"
40
+ width="20"
41
+ height="20"
42
+ asSVG
43
+ />
44
+ ) : null}
45
+ </button>
46
+ );
47
+ },
39
48
  );
40
49
 
41
50
  export const renderDefaultFoldButton = ({ isUnfolded, onToggle }: FoldablePartProps) => {