@redneckz/wildless-cms-uni-blocks 0.6.40 → 0.6.42

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 (397) hide show
  1. package/bundle/blocks.schema.json +1 -1
  2. package/bundle/bundle.umd.js +161 -47
  3. package/bundle/bundle.umd.min.js +1 -1
  4. package/bundle/components/ButtonBlock/ButtonBlock.d.ts +6 -0
  5. package/bundle/components/ButtonBlock/ButtonBlockContent.d.ts +8 -0
  6. package/bundle/components/CarouselRecommendationCard/CarouselRecommendationCard.d.ts +5 -0
  7. package/bundle/components/CarouselRecommendationCard/CarouselRecommendationCardContent.d.ts +44 -0
  8. package/bundle/components/Header/HeaderSecondaryMenu.d.ts +2 -0
  9. package/bundle/components/Header/HeaderTop.d.ts +2 -0
  10. package/bundle/components/ProductTile/ProductTileContent.d.ts +2 -0
  11. package/bundle/hooks/useCachedAsyncData.d.ts +2 -0
  12. package/bundle/hooks/useLocation.d.ts +6 -0
  13. package/bundle/hooks/useRegions.d.ts +6 -0
  14. package/bundle/model/LogoType.d.ts +5 -0
  15. package/bundle/services/sitemap/SitemapProps.d.ts +10 -4
  16. package/bundle/ui-kit/Location/Location.d.ts +19 -0
  17. package/bundle/ui-kit/Location/SearchBar.d.ts +6 -0
  18. package/bundle/ui-kit/Logo/Logo.d.ts +2 -5
  19. package/bundle/ui-kit/Logo/Logo.mobile.d.ts +2 -0
  20. package/bundle/ui-kit/Logo/renderImage.d.ts +6 -0
  21. package/bundle/ui-kit/Logo/renderTitle.d.ts +3 -0
  22. package/bundle/utils/groupBy.d.ts +1 -0
  23. package/dist/components/Blocks.js +6 -2
  24. package/dist/components/Blocks.js.map +1 -1
  25. package/dist/components/ButtonBlock/ButtonBlock.d.ts +6 -0
  26. package/dist/components/ButtonBlock/ButtonBlock.js +11 -0
  27. package/dist/components/ButtonBlock/ButtonBlock.js.map +1 -0
  28. package/dist/components/ButtonBlock/ButtonBlockContent.d.ts +8 -0
  29. package/dist/components/ButtonBlock/ButtonBlockContent.js +2 -0
  30. package/dist/components/ButtonBlock/ButtonBlockContent.js.map +1 -0
  31. package/dist/components/Calculator/constants.js +1 -1
  32. package/dist/components/CarouselRecommendationCard/CarouselRecommendationCard.d.ts +5 -0
  33. package/dist/components/CarouselRecommendationCard/CarouselRecommendationCard.js +22 -0
  34. package/dist/components/CarouselRecommendationCard/CarouselRecommendationCard.js.map +1 -0
  35. package/dist/components/CarouselRecommendationCard/CarouselRecommendationCardContent.d.ts +44 -0
  36. package/dist/components/CarouselRecommendationCard/CarouselRecommendationCardContent.js +2 -0
  37. package/dist/components/CarouselRecommendationCard/CarouselRecommendationCardContent.js.map +1 -0
  38. package/dist/components/Header/Header.js +2 -2
  39. package/dist/components/Header/Header.js.map +1 -1
  40. package/dist/components/Header/Header.mobile.js +2 -2
  41. package/dist/components/Header/Header.mobile.js.map +1 -1
  42. package/dist/components/Header/HeaderBurger.js +4 -3
  43. package/dist/components/Header/HeaderBurger.js.map +1 -1
  44. package/dist/components/Header/HeaderSecondaryMenu.d.ts +2 -0
  45. package/dist/components/Header/HeaderSecondaryMenu.js +13 -4
  46. package/dist/components/Header/HeaderSecondaryMenu.js.map +1 -1
  47. package/dist/components/Header/HeaderTop.d.ts +2 -0
  48. package/dist/components/Header/HeaderTop.js +1 -1
  49. package/dist/components/Header/HeaderTop.js.map +1 -1
  50. package/dist/components/ProductTile/ProductTile.js +8 -2
  51. package/dist/components/ProductTile/ProductTile.js.map +1 -1
  52. package/dist/components/ProductTile/ProductTileContent.d.ts +2 -0
  53. package/dist/components/Recommendation/RecommendationCard.js +1 -1
  54. package/dist/components/Recommendation/RecommendationCard.js.map +1 -1
  55. package/dist/hooks/useCachedAsyncData.d.ts +2 -0
  56. package/dist/hooks/useCachedAsyncData.js +25 -0
  57. package/dist/hooks/useCachedAsyncData.js.map +1 -0
  58. package/dist/hooks/useLocation.d.ts +6 -0
  59. package/dist/hooks/useLocation.js +26 -0
  60. package/dist/hooks/useLocation.js.map +1 -0
  61. package/dist/hooks/useRegions.d.ts +6 -0
  62. package/dist/hooks/useRegions.js +11 -0
  63. package/dist/hooks/useRegions.js.map +1 -0
  64. package/dist/model/LogoType.d.ts +5 -0
  65. package/dist/model/LogoType.js +2 -0
  66. package/dist/model/LogoType.js.map +1 -0
  67. package/dist/services/sitemap/SitemapProps.d.ts +10 -4
  68. package/dist/ui-kit/Location/Location.d.ts +19 -0
  69. package/dist/ui-kit/Location/Location.js +44 -0
  70. package/dist/ui-kit/Location/Location.js.map +1 -0
  71. package/dist/ui-kit/Location/SearchBar.d.ts +6 -0
  72. package/dist/ui-kit/Location/SearchBar.js +9 -0
  73. package/dist/ui-kit/Location/SearchBar.js.map +1 -0
  74. package/dist/ui-kit/Logo/Logo.d.ts +2 -5
  75. package/dist/ui-kit/Logo/Logo.js +3 -21
  76. package/dist/ui-kit/Logo/Logo.js.map +1 -1
  77. package/dist/ui-kit/Logo/Logo.mobile.d.ts +2 -0
  78. package/dist/ui-kit/Logo/Logo.mobile.js +4 -15
  79. package/dist/ui-kit/Logo/Logo.mobile.js.map +1 -1
  80. package/dist/ui-kit/Logo/renderImage.d.ts +6 -0
  81. package/dist/ui-kit/Logo/renderImage.js +20 -0
  82. package/dist/ui-kit/Logo/renderImage.js.map +1 -0
  83. package/dist/ui-kit/Logo/renderTitle.d.ts +3 -0
  84. package/dist/ui-kit/Logo/renderTitle.js +12 -0
  85. package/dist/ui-kit/Logo/renderTitle.js.map +1 -0
  86. package/dist/ui-kit/SwipeListControl/SwipeListContainer.js +8 -4
  87. package/dist/ui-kit/SwipeListControl/SwipeListContainer.js.map +1 -1
  88. package/dist/utils/groupBy.d.ts +1 -0
  89. package/dist/utils/groupBy.js +13 -0
  90. package/dist/utils/groupBy.js.map +1 -0
  91. package/lib/common.css +1 -1
  92. package/lib/components/Blocks.js +6 -2
  93. package/lib/components/Blocks.js.map +1 -1
  94. package/lib/components/ButtonBlock/ButtonBlock.d.ts +6 -0
  95. package/lib/components/ButtonBlock/ButtonBlock.fixture.d.ts +6 -0
  96. package/lib/components/ButtonBlock/ButtonBlock.js +9 -0
  97. package/lib/components/ButtonBlock/ButtonBlock.js.map +1 -0
  98. package/lib/components/ButtonBlock/ButtonBlockContent.d.ts +8 -0
  99. package/lib/components/ButtonBlock/ButtonBlockContent.js +2 -0
  100. package/lib/components/ButtonBlock/ButtonBlockContent.js.map +1 -0
  101. package/lib/components/Calculator/constants.js +1 -1
  102. package/lib/components/Carousel/Carousel.fixture.d.ts +1 -0
  103. package/lib/components/CarouselRecommendationCard/CarouselRecommendationCard.d.ts +5 -0
  104. package/lib/components/CarouselRecommendationCard/CarouselRecommendationCard.fixture.d.ts +9 -0
  105. package/lib/components/CarouselRecommendationCard/CarouselRecommendationCard.js +20 -0
  106. package/lib/components/CarouselRecommendationCard/CarouselRecommendationCard.js.map +1 -0
  107. package/lib/components/CarouselRecommendationCard/CarouselRecommendationCardContent.d.ts +44 -0
  108. package/lib/components/CarouselRecommendationCard/CarouselRecommendationCardContent.js +2 -0
  109. package/lib/components/CarouselRecommendationCard/CarouselRecommendationCardContent.js.map +1 -0
  110. package/lib/components/Header/Header.js +2 -2
  111. package/lib/components/Header/Header.js.map +1 -1
  112. package/lib/components/Header/Header.mobile.js +2 -2
  113. package/lib/components/Header/Header.mobile.js.map +1 -1
  114. package/lib/components/Header/HeaderBurger.js +4 -3
  115. package/lib/components/Header/HeaderBurger.js.map +1 -1
  116. package/lib/components/Header/HeaderSecondaryMenu.d.ts +2 -0
  117. package/lib/components/Header/HeaderSecondaryMenu.js +13 -4
  118. package/lib/components/Header/HeaderSecondaryMenu.js.map +1 -1
  119. package/lib/components/Header/HeaderTop.d.ts +2 -0
  120. package/lib/components/Header/HeaderTop.js +1 -1
  121. package/lib/components/Header/HeaderTop.js.map +1 -1
  122. package/lib/components/ProductTile/ProductTile.fixture.d.ts +1 -0
  123. package/lib/components/ProductTile/ProductTile.js +8 -2
  124. package/lib/components/ProductTile/ProductTile.js.map +1 -1
  125. package/lib/components/ProductTile/ProductTileContent.d.ts +2 -0
  126. package/lib/components/Recommendation/Recommendation.fixture.d.ts +1 -1
  127. package/lib/components/Recommendation/RecommendationCard.js +1 -1
  128. package/lib/components/Recommendation/RecommendationCard.js.map +1 -1
  129. package/lib/hooks/useCachedAsyncData.d.ts +2 -0
  130. package/lib/hooks/useCachedAsyncData.js +22 -0
  131. package/lib/hooks/useCachedAsyncData.js.map +1 -0
  132. package/lib/hooks/useLocation.d.ts +6 -0
  133. package/lib/hooks/useLocation.js +23 -0
  134. package/lib/hooks/useLocation.js.map +1 -0
  135. package/lib/hooks/useRegions.d.ts +6 -0
  136. package/lib/hooks/useRegions.js +8 -0
  137. package/lib/hooks/useRegions.js.map +1 -0
  138. package/lib/model/LogoType.d.ts +5 -0
  139. package/lib/model/LogoType.js +2 -0
  140. package/lib/model/LogoType.js.map +1 -0
  141. package/lib/services/sitemap/SitemapProps.d.ts +10 -4
  142. package/lib/ui-kit/Location/Location.d.ts +19 -0
  143. package/lib/ui-kit/Location/Location.fixture.d.ts +6 -0
  144. package/lib/ui-kit/Location/Location.js +42 -0
  145. package/lib/ui-kit/Location/Location.js.map +1 -0
  146. package/lib/ui-kit/Location/SearchBar.d.ts +6 -0
  147. package/lib/ui-kit/Location/SearchBar.js +7 -0
  148. package/lib/ui-kit/Location/SearchBar.js.map +1 -0
  149. package/lib/ui-kit/Logo/Logo.d.ts +2 -5
  150. package/lib/ui-kit/Logo/Logo.js +4 -22
  151. package/lib/ui-kit/Logo/Logo.js.map +1 -1
  152. package/lib/ui-kit/Logo/Logo.mobile.d.ts +2 -0
  153. package/lib/ui-kit/Logo/Logo.mobile.js +5 -16
  154. package/lib/ui-kit/Logo/Logo.mobile.js.map +1 -1
  155. package/lib/ui-kit/Logo/renderImage.d.ts +5 -0
  156. package/lib/ui-kit/Logo/renderImage.js +17 -0
  157. package/lib/ui-kit/Logo/renderImage.js.map +1 -0
  158. package/lib/ui-kit/Logo/renderTitle.d.ts +2 -0
  159. package/lib/ui-kit/Logo/renderTitle.js +9 -0
  160. package/lib/ui-kit/Logo/renderTitle.js.map +1 -0
  161. package/lib/ui-kit/SwipeListControl/SwipeListContainer.js +8 -4
  162. package/lib/ui-kit/SwipeListControl/SwipeListContainer.js.map +1 -1
  163. package/lib/utils/groupBy.d.ts +1 -0
  164. package/lib/utils/groupBy.js +10 -0
  165. package/lib/utils/groupBy.js.map +1 -0
  166. package/mobile/bundle/bundle.umd.js +65 -26
  167. package/mobile/bundle/bundle.umd.min.js +1 -1
  168. package/mobile/bundle/components/ButtonBlock/ButtonBlock.d.ts +6 -0
  169. package/mobile/bundle/components/ButtonBlock/ButtonBlockContent.d.ts +8 -0
  170. package/mobile/bundle/components/CarouselRecommendationCard/CarouselRecommendationCard.d.ts +5 -0
  171. package/mobile/bundle/components/CarouselRecommendationCard/CarouselRecommendationCardContent.d.ts +44 -0
  172. package/mobile/bundle/components/Header/HeaderSecondaryMenu.d.ts +2 -0
  173. package/mobile/bundle/components/Header/HeaderTop.d.ts +2 -0
  174. package/mobile/bundle/components/ProductTile/ProductTileContent.d.ts +2 -0
  175. package/mobile/bundle/hooks/useCachedAsyncData.d.ts +2 -0
  176. package/mobile/bundle/hooks/useLocation.d.ts +6 -0
  177. package/mobile/bundle/hooks/useRegions.d.ts +6 -0
  178. package/mobile/bundle/model/LogoType.d.ts +5 -0
  179. package/mobile/bundle/services/sitemap/SitemapProps.d.ts +10 -4
  180. package/mobile/bundle/ui-kit/Location/Location.d.ts +19 -0
  181. package/mobile/bundle/ui-kit/Location/SearchBar.d.ts +6 -0
  182. package/mobile/bundle/ui-kit/Logo/Logo.d.ts +2 -0
  183. package/mobile/bundle/ui-kit/Logo/renderImage.d.ts +6 -0
  184. package/mobile/bundle/ui-kit/Logo/renderTitle.d.ts +3 -0
  185. package/mobile/bundle/utils/groupBy.d.ts +1 -0
  186. package/mobile/dist/components/ButtonBlock/ButtonBlock.d.ts +6 -0
  187. package/mobile/dist/components/ButtonBlock/ButtonBlock.js +11 -0
  188. package/mobile/dist/components/ButtonBlock/ButtonBlock.js.map +1 -0
  189. package/mobile/dist/components/ButtonBlock/ButtonBlockContent.d.ts +8 -0
  190. package/mobile/dist/components/ButtonBlock/ButtonBlockContent.js +2 -0
  191. package/mobile/dist/components/ButtonBlock/ButtonBlockContent.js.map +1 -0
  192. package/mobile/dist/components/Calculator/constants.js +1 -1
  193. package/mobile/dist/components/CarouselRecommendationCard/CarouselRecommendationCard.d.ts +5 -0
  194. package/mobile/dist/components/CarouselRecommendationCard/CarouselRecommendationCard.js +22 -0
  195. package/mobile/dist/components/CarouselRecommendationCard/CarouselRecommendationCard.js.map +1 -0
  196. package/mobile/dist/components/CarouselRecommendationCard/CarouselRecommendationCardContent.d.ts +44 -0
  197. package/mobile/dist/components/CarouselRecommendationCard/CarouselRecommendationCardContent.js +2 -0
  198. package/mobile/dist/components/CarouselRecommendationCard/CarouselRecommendationCardContent.js.map +1 -0
  199. package/mobile/dist/components/Header/Header.js +2 -2
  200. package/mobile/dist/components/Header/Header.js.map +1 -1
  201. package/mobile/dist/components/Header/HeaderBurger.js +4 -3
  202. package/mobile/dist/components/Header/HeaderBurger.js.map +1 -1
  203. package/mobile/dist/components/Header/HeaderSecondaryMenu.d.ts +2 -0
  204. package/mobile/dist/components/Header/HeaderSecondaryMenu.js +13 -4
  205. package/mobile/dist/components/Header/HeaderSecondaryMenu.js.map +1 -1
  206. package/mobile/dist/components/Header/HeaderTop.d.ts +2 -0
  207. package/mobile/dist/components/Header/HeaderTop.js +1 -1
  208. package/mobile/dist/components/Header/HeaderTop.js.map +1 -1
  209. package/mobile/dist/components/ProductTile/ProductTile.js +8 -2
  210. package/mobile/dist/components/ProductTile/ProductTile.js.map +1 -1
  211. package/mobile/dist/components/ProductTile/ProductTileContent.d.ts +2 -0
  212. package/mobile/dist/components/Recommendation/RecommendationCard.js +1 -1
  213. package/mobile/dist/components/Recommendation/RecommendationCard.js.map +1 -1
  214. package/mobile/dist/hooks/useCachedAsyncData.d.ts +2 -0
  215. package/mobile/dist/hooks/useCachedAsyncData.js +25 -0
  216. package/mobile/dist/hooks/useCachedAsyncData.js.map +1 -0
  217. package/mobile/dist/hooks/useLocation.d.ts +6 -0
  218. package/mobile/dist/hooks/useLocation.js +26 -0
  219. package/mobile/dist/hooks/useLocation.js.map +1 -0
  220. package/mobile/dist/hooks/useRegions.d.ts +6 -0
  221. package/mobile/dist/hooks/useRegions.js +11 -0
  222. package/mobile/dist/hooks/useRegions.js.map +1 -0
  223. package/mobile/dist/model/LogoType.d.ts +5 -0
  224. package/mobile/dist/model/LogoType.js +2 -0
  225. package/mobile/dist/model/LogoType.js.map +1 -0
  226. package/mobile/dist/services/sitemap/SitemapProps.d.ts +10 -4
  227. package/mobile/dist/ui-kit/Location/Location.d.ts +19 -0
  228. package/mobile/dist/ui-kit/Location/Location.js +44 -0
  229. package/mobile/dist/ui-kit/Location/Location.js.map +1 -0
  230. package/mobile/dist/ui-kit/Location/SearchBar.d.ts +6 -0
  231. package/mobile/dist/ui-kit/Location/SearchBar.js +9 -0
  232. package/mobile/dist/ui-kit/Location/SearchBar.js.map +1 -0
  233. package/mobile/dist/ui-kit/Logo/Logo.d.ts +2 -0
  234. package/mobile/dist/ui-kit/Logo/Logo.js +4 -15
  235. package/mobile/dist/ui-kit/Logo/Logo.js.map +1 -1
  236. package/mobile/dist/ui-kit/Logo/renderImage.d.ts +6 -0
  237. package/mobile/dist/ui-kit/Logo/renderImage.js +20 -0
  238. package/mobile/dist/ui-kit/Logo/renderImage.js.map +1 -0
  239. package/mobile/dist/ui-kit/Logo/renderTitle.d.ts +3 -0
  240. package/mobile/dist/ui-kit/Logo/renderTitle.js +12 -0
  241. package/mobile/dist/ui-kit/Logo/renderTitle.js.map +1 -0
  242. package/mobile/dist/ui-kit/SwipeListControl/SwipeListContainer.js +8 -4
  243. package/mobile/dist/ui-kit/SwipeListControl/SwipeListContainer.js.map +1 -1
  244. package/mobile/dist/utils/groupBy.d.ts +1 -0
  245. package/mobile/dist/utils/groupBy.js +13 -0
  246. package/mobile/dist/utils/groupBy.js.map +1 -0
  247. package/mobile/lib/components/ButtonBlock/ButtonBlock.d.ts +6 -0
  248. package/mobile/lib/components/ButtonBlock/ButtonBlock.js +9 -0
  249. package/mobile/lib/components/ButtonBlock/ButtonBlock.js.map +1 -0
  250. package/mobile/lib/components/ButtonBlock/ButtonBlockContent.d.ts +8 -0
  251. package/mobile/lib/components/ButtonBlock/ButtonBlockContent.js +2 -0
  252. package/mobile/lib/components/ButtonBlock/ButtonBlockContent.js.map +1 -0
  253. package/mobile/lib/components/Calculator/constants.js +1 -1
  254. package/mobile/lib/components/CarouselRecommendationCard/CarouselRecommendationCard.d.ts +5 -0
  255. package/mobile/lib/components/CarouselRecommendationCard/CarouselRecommendationCard.js +20 -0
  256. package/mobile/lib/components/CarouselRecommendationCard/CarouselRecommendationCard.js.map +1 -0
  257. package/mobile/lib/components/CarouselRecommendationCard/CarouselRecommendationCardContent.d.ts +44 -0
  258. package/mobile/lib/components/CarouselRecommendationCard/CarouselRecommendationCardContent.js +2 -0
  259. package/mobile/lib/components/CarouselRecommendationCard/CarouselRecommendationCardContent.js.map +1 -0
  260. package/mobile/lib/components/Header/Header.js +2 -2
  261. package/mobile/lib/components/Header/Header.js.map +1 -1
  262. package/mobile/lib/components/Header/HeaderBurger.js +4 -3
  263. package/mobile/lib/components/Header/HeaderBurger.js.map +1 -1
  264. package/mobile/lib/components/Header/HeaderSecondaryMenu.d.ts +2 -0
  265. package/mobile/lib/components/Header/HeaderSecondaryMenu.js +13 -4
  266. package/mobile/lib/components/Header/HeaderSecondaryMenu.js.map +1 -1
  267. package/mobile/lib/components/Header/HeaderTop.d.ts +2 -0
  268. package/mobile/lib/components/Header/HeaderTop.js +1 -1
  269. package/mobile/lib/components/Header/HeaderTop.js.map +1 -1
  270. package/mobile/lib/components/ProductTile/ProductTile.js +8 -2
  271. package/mobile/lib/components/ProductTile/ProductTile.js.map +1 -1
  272. package/mobile/lib/components/ProductTile/ProductTileContent.d.ts +2 -0
  273. package/mobile/lib/components/Recommendation/RecommendationCard.js +1 -1
  274. package/mobile/lib/components/Recommendation/RecommendationCard.js.map +1 -1
  275. package/mobile/lib/hooks/useCachedAsyncData.d.ts +2 -0
  276. package/mobile/lib/hooks/useCachedAsyncData.js +22 -0
  277. package/mobile/lib/hooks/useCachedAsyncData.js.map +1 -0
  278. package/mobile/lib/hooks/useLocation.d.ts +6 -0
  279. package/mobile/lib/hooks/useLocation.js +23 -0
  280. package/mobile/lib/hooks/useLocation.js.map +1 -0
  281. package/mobile/lib/hooks/useRegions.d.ts +6 -0
  282. package/mobile/lib/hooks/useRegions.js +8 -0
  283. package/mobile/lib/hooks/useRegions.js.map +1 -0
  284. package/mobile/lib/model/LogoType.d.ts +5 -0
  285. package/mobile/lib/model/LogoType.js +2 -0
  286. package/mobile/lib/model/LogoType.js.map +1 -0
  287. package/mobile/lib/services/sitemap/SitemapProps.d.ts +10 -4
  288. package/mobile/lib/ui-kit/Location/Location.d.ts +19 -0
  289. package/mobile/lib/ui-kit/Location/Location.js +42 -0
  290. package/mobile/lib/ui-kit/Location/Location.js.map +1 -0
  291. package/mobile/lib/ui-kit/Location/SearchBar.d.ts +6 -0
  292. package/mobile/lib/ui-kit/Location/SearchBar.js +7 -0
  293. package/mobile/lib/ui-kit/Location/SearchBar.js.map +1 -0
  294. package/mobile/lib/ui-kit/Logo/Logo.d.ts +2 -0
  295. package/mobile/lib/ui-kit/Logo/Logo.js +5 -16
  296. package/mobile/lib/ui-kit/Logo/Logo.js.map +1 -1
  297. package/mobile/lib/ui-kit/Logo/renderImage.d.ts +6 -0
  298. package/mobile/lib/ui-kit/Logo/renderImage.js +17 -0
  299. package/mobile/lib/ui-kit/Logo/renderImage.js.map +1 -0
  300. package/mobile/lib/ui-kit/Logo/renderTitle.d.ts +3 -0
  301. package/mobile/lib/ui-kit/Logo/renderTitle.js +9 -0
  302. package/mobile/lib/ui-kit/Logo/renderTitle.js.map +1 -0
  303. package/mobile/lib/ui-kit/SwipeListControl/SwipeListContainer.js +8 -4
  304. package/mobile/lib/ui-kit/SwipeListControl/SwipeListContainer.js.map +1 -1
  305. package/mobile/lib/utils/groupBy.d.ts +1 -0
  306. package/mobile/lib/utils/groupBy.js +10 -0
  307. package/mobile/lib/utils/groupBy.js.map +1 -0
  308. package/mobile/src/components/ButtonBlock/ButtonBlock.example.json +10 -0
  309. package/mobile/src/components/ButtonBlock/ButtonBlock.tsx +17 -0
  310. package/mobile/src/components/ButtonBlock/ButtonBlock.ui.json +12 -0
  311. package/mobile/src/components/ButtonBlock/ButtonBlockContent.ts +9 -0
  312. package/mobile/src/components/Calculator/constants.ts +1 -1
  313. package/mobile/src/components/CarouselRecommendationCard/CarouselRecommendationCard.example.json +19 -0
  314. package/mobile/src/components/CarouselRecommendationCard/CarouselRecommendationCard.tsx +62 -0
  315. package/mobile/src/components/CarouselRecommendationCard/CarouselRecommendationCard.ui.json +9 -0
  316. package/mobile/src/components/CarouselRecommendationCard/CarouselRecommendationCardContent.ts +45 -0
  317. package/mobile/src/components/Header/Header.tsx +2 -2
  318. package/mobile/src/components/Header/HeaderBurger.tsx +5 -7
  319. package/mobile/src/components/Header/HeaderSecondaryMenu.tsx +32 -5
  320. package/mobile/src/components/Header/HeaderTop.tsx +4 -2
  321. package/mobile/src/components/MiniGallery/MiniGallery.ui.json +1 -1
  322. package/mobile/src/components/ProductTile/ProductTile.example.json +2 -1
  323. package/mobile/src/components/ProductTile/ProductTile.tsx +34 -18
  324. package/mobile/src/components/ProductTile/ProductTileContent.ts +2 -0
  325. package/mobile/src/components/Recommendation/Recommendation.example.json +6 -5
  326. package/mobile/src/components/Recommendation/Recommendation.ui.json +8 -0
  327. package/mobile/src/components/Recommendation/RecommendationCard.tsx +1 -1
  328. package/mobile/src/hooks/useCachedAsyncData.ts +37 -0
  329. package/mobile/src/hooks/useLocation.ts +48 -0
  330. package/mobile/src/hooks/useRegions.ts +16 -0
  331. package/mobile/src/model/LogoType.ts +6 -0
  332. package/mobile/src/services/sitemap/SitemapProps.ts +11 -4
  333. package/mobile/src/ui-kit/Location/Location.tsx +168 -0
  334. package/mobile/src/ui-kit/Location/SearchBar.tsx +30 -0
  335. package/mobile/src/ui-kit/Logo/Logo.tsx +16 -31
  336. package/mobile/src/ui-kit/Logo/renderImage.tsx +40 -0
  337. package/mobile/src/ui-kit/Logo/renderTitle.tsx +15 -0
  338. package/mobile/src/ui-kit/SwipeListControl/SwipeListContainer.tsx +8 -4
  339. package/mobile/src/utils/groupBy.ts +10 -0
  340. package/package.json +2 -2
  341. package/src/components/Blocks.ts +6 -2
  342. package/src/components/ButtonBlock/ButtonBlock.example.json +10 -0
  343. package/src/components/ButtonBlock/ButtonBlock.fixture.tsx +18 -0
  344. package/src/components/ButtonBlock/ButtonBlock.tsx +17 -0
  345. package/src/components/ButtonBlock/ButtonBlock.ui.json +12 -0
  346. package/src/components/ButtonBlock/ButtonBlockContent.ts +9 -0
  347. package/src/components/Calculator/constants.ts +1 -1
  348. package/src/components/Carousel/Carousel.fixture.tsx +22 -4
  349. package/src/components/CarouselRecommendationCard/CarouselRecommendationCard.example.json +19 -0
  350. package/src/components/CarouselRecommendationCard/CarouselRecommendationCard.fixture.tsx +47 -0
  351. package/src/components/CarouselRecommendationCard/CarouselRecommendationCard.tsx +62 -0
  352. package/src/components/CarouselRecommendationCard/CarouselRecommendationCard.ui.json +9 -0
  353. package/src/components/CarouselRecommendationCard/CarouselRecommendationCardContent.ts +45 -0
  354. package/src/components/Header/Header.mobile.tsx +2 -2
  355. package/src/components/Header/Header.tsx +6 -4
  356. package/src/components/Header/HeaderBurger.tsx +5 -7
  357. package/src/components/Header/HeaderSecondaryMenu.tsx +32 -5
  358. package/src/components/Header/HeaderTop.tsx +4 -2
  359. package/src/components/MiniGallery/MiniGallery.ui.json +1 -1
  360. package/src/components/ProductTile/ProductTile.example.json +2 -1
  361. package/src/components/ProductTile/ProductTile.fixture.tsx +13 -0
  362. package/src/components/ProductTile/ProductTile.tsx +34 -18
  363. package/src/components/ProductTile/ProductTileContent.ts +2 -0
  364. package/src/components/Recommendation/Recommendation.example.json +6 -5
  365. package/src/components/Recommendation/Recommendation.fixture.tsx +11 -10
  366. package/src/components/Recommendation/Recommendation.ui.json +8 -0
  367. package/src/components/Recommendation/RecommendationCard.tsx +1 -1
  368. package/src/hooks/useCachedAsyncData.ts +37 -0
  369. package/src/hooks/useLocation.ts +48 -0
  370. package/src/hooks/useRegions.ts +16 -0
  371. package/src/model/LogoType.ts +6 -0
  372. package/src/services/sitemap/SitemapProps.ts +11 -4
  373. package/src/ui-kit/Location/Location.fixture.tsx +81 -0
  374. package/src/ui-kit/Location/Location.tsx +168 -0
  375. package/src/ui-kit/Location/SearchBar.tsx +30 -0
  376. package/src/ui-kit/Logo/Logo.mobile.tsx +16 -31
  377. package/src/ui-kit/Logo/Logo.tsx +6 -43
  378. package/src/ui-kit/Logo/renderImage.tsx +40 -0
  379. package/src/ui-kit/Logo/renderTitle.tsx +15 -0
  380. package/src/ui-kit/SwipeListControl/SwipeListContainer.tsx +8 -4
  381. package/src/utils/groupBy.ts +10 -0
  382. package/bundle/hooks/useGeolocation.d.ts +0 -1
  383. package/dist/hooks/useGeolocation.d.ts +0 -1
  384. package/dist/hooks/useGeolocation.js +0 -21
  385. package/dist/hooks/useGeolocation.js.map +0 -1
  386. package/lib/hooks/useGeolocation.d.ts +0 -1
  387. package/lib/hooks/useGeolocation.js +0 -18
  388. package/lib/hooks/useGeolocation.js.map +0 -1
  389. package/mobile/bundle/hooks/useGeolocation.d.ts +0 -1
  390. package/mobile/dist/hooks/useGeolocation.d.ts +0 -1
  391. package/mobile/dist/hooks/useGeolocation.js +0 -21
  392. package/mobile/dist/hooks/useGeolocation.js.map +0 -1
  393. package/mobile/lib/hooks/useGeolocation.d.ts +0 -1
  394. package/mobile/lib/hooks/useGeolocation.js +0 -18
  395. package/mobile/lib/hooks/useGeolocation.js.map +0 -1
  396. package/mobile/src/hooks/useGeolocation.ts +0 -22
  397. package/src/hooks/useGeolocation.ts +0 -22
@@ -0,0 +1,62 @@
1
+ import { BaseTile } from '../BaseTile/BaseTile';
2
+ import { BlockWrapper } from '../../ui-kit/BlockWrapper';
3
+ import { BorderVersionStyleMap } from '../../model/BorderVersion';
4
+ import { Heading } from '../../ui-kit/Heading/Heading';
5
+ import { Img } from '../../ui-kit/Img/Img';
6
+ import { JSX } from '@redneckz/uni-jsx';
7
+ import { List } from '../../ui-kit/List/List';
8
+ import { renderButton } from '../../ui-kit/Button/ButtonSection';
9
+ import { SocialMedia } from '../Footer/SocialMedia';
10
+ import { VersionStyleMap } from '../../model/BlockVersion';
11
+ import type { CarouselRecommendationCardContent } from './CarouselRecommendationCardContent';
12
+ import type { UniBlockProps } from '../../model/JSXBlock';
13
+
14
+ export interface RecommendationCardProps extends CarouselRecommendationCardContent, UniBlockProps {}
15
+
16
+ export const CarouselRecommendationCard = JSX<RecommendationCardProps>(
17
+ ({
18
+ button,
19
+ className = '',
20
+ description,
21
+ image,
22
+ items = [],
23
+ socialMedia = [],
24
+ title,
25
+ version = 'primary',
26
+ ...rest
27
+ }) => {
28
+ const tileTitle = title ? (
29
+ <Heading headingType="h5" as="h3" className="mb-3.5 z-10" title={title} />
30
+ ) : null;
31
+ const tileImage = image?.src ? (
32
+ <Img className="absolute bottom-0 right-0 m-0" image={image} />
33
+ ) : null;
34
+
35
+ return (
36
+ <BlockWrapper
37
+ className={`relative text-left border border-solid box-border p-7 min-w-[524px]
38
+ ${BorderVersionStyleMap[version]}
39
+ ${VersionStyleMap[version]}
40
+ ${className}`}
41
+ {...rest}
42
+ >
43
+ <BaseTile className="flex justify-between" title={tileTitle} image={tileImage}>
44
+ <div className="h-full flex flex-col justify-between">
45
+ {description ? <span className="mb-2">{description}</span> : null}
46
+ {items.length ? (
47
+ <List
48
+ className="text-xl-light flex flex-col flex-1 gap-2 max-w-[236px]"
49
+ items={items}
50
+ version={version}
51
+ />
52
+ ) : null}
53
+ {socialMedia.length ? (
54
+ <SocialMedia className="pt-10 pb-0" media={socialMedia} version={version} />
55
+ ) : null}
56
+ {button?.text ? <div className="pt-2 mt-16">{renderButton({ button })}</div> : null}
57
+ </div>
58
+ </BaseTile>
59
+ </BlockWrapper>
60
+ );
61
+ },
62
+ );
@@ -0,0 +1,9 @@
1
+ {
2
+ "content": {
3
+ "items": {
4
+ "image": {
5
+ "ui:field": "picture"
6
+ }
7
+ }
8
+ }
9
+ }
@@ -0,0 +1,45 @@
1
+ import type { BlockVersion } from '../../model/BlockVersion';
2
+ import type { HeadlineCommonProps } from '../../model/HeadlineType';
3
+ import type { LinkCommonProps } from '../../model/LinkProps';
4
+ import type { Picture } from '../../model/Picture';
5
+ import type { ButtonProps } from '../../ui-kit/Button/ButtonProps';
6
+ import type { ListContent } from '../../ui-kit/List/ListContent';
7
+
8
+ /**
9
+ * @title Карточка рекомендаций
10
+ */
11
+ export interface CarouselRecommendationCardContent extends HeadlineCommonProps, ListContent {
12
+ /**
13
+ * @title Соц сети
14
+ * @minItems 3
15
+ * @default [
16
+ * { "href": "https://t.me" },
17
+ * { "href": "https://vk.com" },
18
+ * { "href": "https://ok.ru" },
19
+ * ]
20
+ */
21
+ socialMedia?: LinkCommonProps[];
22
+ /**
23
+ * @default {
24
+ * "format": "webp",
25
+ * "size": {
26
+ * "width": 290
27
+ * },
28
+ * "sources": [{
29
+ * "media": 1279,
30
+ * "width": 174,
31
+ * "format": "webp",
32
+ * "alignment": "southeast"
33
+ * }]
34
+ * }
35
+ */
36
+ image?: Picture;
37
+ /**
38
+ * @default {
39
+ * "text": "",
40
+ * "version": "secondary"
41
+ * }
42
+ */
43
+ button?: ButtonProps;
44
+ version?: BlockVersion;
45
+ }
@@ -22,7 +22,7 @@ export const Header = JSX<HeaderProps>(({ className = '', bgColor = 'bg-white',
22
22
  const router = useRouter();
23
23
 
24
24
  const fallback: Fallback | undefined = rest.options?.page?.fallback;
25
- const { topItems, dispositions, defaultLocation } = useSWRResource<SitemapDataProps>(
25
+ const { topItems, dispositions, defaultLocation, logo } = useSWRResource<SitemapDataProps>(
26
26
  projectSettings.SITEMAP || 'sitemap',
27
27
  fallback,
28
28
  );
@@ -36,7 +36,7 @@ export const Header = JSX<HeaderProps>(({ className = '', bgColor = 'bg-white',
36
36
  return (
37
37
  <header className={`${bgColor} ${className}`}>
38
38
  <div className="container px-4 py-0 box-border">
39
- <HeaderTop onClick={handleBurgerMenuShow} bgColor={bgColor} />
39
+ <HeaderTop onClick={handleBurgerMenuShow} bgColor={bgColor} logo={logo} />
40
40
  <nav className="flex items-center m-0 p-0 overflow-y-hidden w-full h-12">
41
41
  <div className="flex no-scrollbar horizontal-list h-full items-center">
42
42
  {subItems?.map((_, i) => (
@@ -1,8 +1,9 @@
1
1
  import { JSX } from '@redneckz/uni-jsx';
2
- import { useGeolocation } from '../../hooks/useGeolocation';
2
+ import { useLocation } from '../../hooks/useLocation';
3
3
  import type { VNode } from '../../model/VNode';
4
4
  import { Img } from '../../ui-kit/Img/Img';
5
5
  import { SearchBar } from '../../ui-kit/SearchBar/SearchBar';
6
+ import { Text } from '../../ui-kit/Text/Text';
6
7
  import type { DispositionItem } from './HeaderContent';
7
8
 
8
9
  export interface HeaderBurgerProps {
@@ -14,7 +15,7 @@ export interface HeaderBurgerProps {
14
15
 
15
16
  export const HeaderBurger = JSX<HeaderBurgerProps>(
16
17
  ({ burgerSubMenu, onClick, defaultLocation = '', children }) => {
17
- const [city, getCity] = useGeolocation(defaultLocation);
18
+ const [location] = useLocation(defaultLocation);
18
19
 
19
20
  return (
20
21
  <div className="absolute top-0 left-0 w-full h-full bg-white p-4 box-border z-20">
@@ -24,10 +25,7 @@ export const HeaderBurger = JSX<HeaderBurgerProps>(
24
25
  >
25
26
  <Img image="CloseIcon" width="24" height="24" asSVG />
26
27
  </button>
27
- <button
28
- onClick={getCity}
29
- className="flex items-center text-s text-secondary-text p-0 mb-4 bg-transparent cursor-pointer"
30
- >
28
+ <button className="flex items-center text-s p-0 mb-4 bg-transparent cursor-pointer">
31
29
  <Img
32
30
  image="GeolocationIcon"
33
31
  width="20"
@@ -35,7 +33,7 @@ export const HeaderBurger = JSX<HeaderBurgerProps>(
35
33
  className="text-primary-main box-border mr-2"
36
34
  asSVG
37
35
  />
38
- {city}
36
+ <Text color="text-secondary-text">{location.name}</Text>
39
37
  </button>
40
38
  {children}
41
39
  <div className="mb-7">{burgerSubMenu?.map(renderBurgerSubMenuItem)}</div>
@@ -1,8 +1,11 @@
1
1
  import { JSX } from '@redneckz/uni-jsx';
2
- import { useGeolocation } from '../../hooks/useGeolocation';
2
+ import { useState } from '@redneckz/uni-jsx/lib/hooks';
3
+ import { useLocation } from '../../hooks/useLocation';
3
4
  import type { BgColorVersion } from '../../model/BgColorVersion';
4
5
  import type { IconVersion } from '../../model/IconVersion';
6
+ import type { ForeignOffice } from '../../services/sitemap/SitemapProps';
5
7
  import { Img } from '../../ui-kit/Img/Img';
8
+ import { Location } from '../../ui-kit/Location/Location';
6
9
  import { TopItem } from '../../ui-kit/TopItem/TopItem';
7
10
  import { HeaderSecondaryMenuButton } from './HeaderSecondaryMenuButton';
8
11
 
@@ -10,6 +13,7 @@ interface HeaderSecondaryMenuContent {
10
13
  defaultLocation?: string;
11
14
  officesLink?: string;
12
15
  bgColor?: BgColorVersion;
16
+ foreignOffices?: ForeignOffice[];
13
17
  }
14
18
 
15
19
  export interface HeaderSecondaryMenuProps extends HeaderSecondaryMenuContent {
@@ -30,8 +34,23 @@ const LINKS_ICON_VERSION_MAP: Record<BgColorVersion, IconVersion> = {
30
34
  };
31
35
 
32
36
  export const HeaderSecondaryMenu = JSX<HeaderSecondaryMenuProps>(
33
- ({ className, officesLink, defaultLocation = 'Москва', bgColor = 'bg-white' }) => {
34
- const [city, getCity] = useGeolocation(defaultLocation);
37
+ ({
38
+ className,
39
+ officesLink,
40
+ defaultLocation = 'Москва',
41
+ foreignOffices,
42
+ bgColor = 'bg-white',
43
+ }) => {
44
+ const [isShowLocationModal, setShowLocationModal] = useState<boolean>(false);
45
+
46
+ const [location, onChangeLocation] = useLocation(defaultLocation);
47
+
48
+ const showLocationModal = () => {
49
+ setShowLocationModal(true);
50
+ };
51
+ const hideLocationModal = () => {
52
+ setShowLocationModal(false);
53
+ };
35
54
 
36
55
  return (
37
56
  <div className={`flex items-center ${className || ''}`}>
@@ -39,9 +58,9 @@ export const HeaderSecondaryMenu = JSX<HeaderSecondaryMenuProps>(
39
58
  className="mr-5"
40
59
  flat={true}
41
60
  href="#"
42
- text={city}
61
+ text={location.name}
43
62
  ariaLabel="Местоположение"
44
- onClick={getCity}
63
+ onClick={showLocationModal}
45
64
  bgColor={bgColor}
46
65
  />
47
66
  {officesLink ? (
@@ -76,6 +95,14 @@ export const HeaderSecondaryMenu = JSX<HeaderSecondaryMenuProps>(
76
95
  asSVG
77
96
  />
78
97
  </HeaderSecondaryMenuButton>
98
+ {isShowLocationModal ? (
99
+ <Location
100
+ currentLocation={location}
101
+ foreignOffices={foreignOffices}
102
+ onChangeLocation={onChangeLocation}
103
+ close={hideLocationModal}
104
+ />
105
+ ) : null}
79
106
  </div>
80
107
  );
81
108
  },
@@ -1,13 +1,15 @@
1
1
  import { JSX } from '@redneckz/uni-jsx';
2
2
  import type { BgColorVersion } from '../../model/BgColorVersion';
3
+ import type { LogoType } from '../../model/LogoType';
3
4
  import { Img } from '../../ui-kit/Img/Img';
4
5
  import { Logo } from '../../ui-kit/Logo/Logo';
5
6
 
6
7
  export interface HeaderTopProps {
7
8
  onClick: () => void;
8
9
  bgColor?: BgColorVersion;
10
+ logo?: LogoType;
9
11
  }
10
- export const HeaderTop = JSX<HeaderTopProps>(({ onClick, bgColor }) => (
12
+ export const HeaderTop = JSX<HeaderTopProps>(({ onClick, bgColor, logo }) => (
11
13
  <div className="flex items-center justify-between border-0 border-b border-main-divider h-12">
12
14
  <div className="flex items-center">
13
15
  <button
@@ -23,7 +25,7 @@ export const HeaderTop = JSX<HeaderTopProps>(({ onClick, bgColor }) => (
23
25
  asSVG
24
26
  />
25
27
  </button>
26
- <Logo className="mr-8" bgColor={bgColor} />
28
+ <Logo className="mr-8" bgColor={bgColor} logo={logo} />
27
29
  </div>
28
30
  <button
29
31
  className={`${
@@ -8,7 +8,7 @@
8
8
  "button": {
9
9
  "icon": {
10
10
  "ui:field": "icon"
11
- },
11
+ },
12
12
  "iconRight": {
13
13
  "ui:field": "icon"
14
14
  }
@@ -29,6 +29,7 @@
29
29
  "text": "Кнопка",
30
30
  "version": "primary"
31
31
  }
32
- ]
32
+ ],
33
+ "isImageOnRightSide": true
33
34
  }
34
35
  }
@@ -22,30 +22,33 @@ export const ProductTile = JSX<ProductTileProps>(
22
22
  benefits = [],
23
23
  buttons,
24
24
  image,
25
+ isImageOnRightSide = true,
25
26
  version = 'primary',
26
27
  ...rest
27
28
  }) => (
28
29
  <BlockWrapper
29
- className={`overflow-hidden font-sans p-9 box-border relative justify-between grid min-h-[364px]
30
- ${className} ${VersionStyleMap[version]} ${getTileRightPadding(className)}`}
30
+ className={`overflow-hidden font-sans p-9 box-border relative min-h-[364px]
31
+ ${VersionStyleMap[version]} ${getTileRightPadding(className)} ${className}`}
31
32
  {...rest}
32
33
  >
33
- <Headline
34
- className={`!p-0 !bg-transparent z-10 ${title || description ? 'mb-3.5' : ''}`}
35
- as="h2"
36
- title={title}
37
- description={description}
38
- headlineVersion={headlineVersion}
39
- bgColorHeadline={version}
40
- align="left"
41
- {...rest}
42
- />
43
- {renderBenefits(benefits, version, image)}
44
- {additionalDescription ? renderAdditionalDescription(additionalDescription, image) : null}
45
- {buttons?.length ? (
46
- <ButtonSection buttons={buttons} className="flex self-end mt-5 gap-4 z-10 text-l" />
47
- ) : null}
48
- {image?.src ? <Img className="absolute right-0 bottom-0" image={image} /> : null}
34
+ <div className={`flex flex-col ${isImageOnRightSide ? '' : 'items-end'}`}>
35
+ <Headline
36
+ className={`!p-0 !bg-transparent z-10 ${title || description ? 'mb-3.5' : ''}`}
37
+ as="h2"
38
+ title={title}
39
+ description={description}
40
+ headlineVersion={headlineVersion}
41
+ bgColorHeadline={version}
42
+ align="left"
43
+ {...rest}
44
+ />
45
+ {renderBenefits(benefits, version, image)}
46
+ {additionalDescription ? renderAdditionalDescription(additionalDescription, image) : null}
47
+ {buttons?.length ? (
48
+ <ButtonSection buttons={buttons} className="mt-5 gap-4 z-10 text-l" />
49
+ ) : null}
50
+ </div>
51
+ {renderImage(image, isImageOnRightSide)}
49
52
  </BlockWrapper>
50
53
  ),
51
54
  );
@@ -87,3 +90,16 @@ function renderAdditionalDescription(additionalDescription: string, image?: Pict
87
90
  <div className={`text-m-light mt-2.5 z-10 ${DESCRIPTION_WIDTH}`}>{additionalDescription}</div>
88
91
  );
89
92
  }
93
+
94
+ function renderImage(image?: Picture, isImageOnRightSide?: boolean) {
95
+ if (!image?.src) {
96
+ return null;
97
+ }
98
+
99
+ return (
100
+ <Img
101
+ className={`absolute ${isImageOnRightSide ? 'right-0' : 'left-0'} bottom-0`}
102
+ image={image}
103
+ />
104
+ );
105
+ }
@@ -33,4 +33,6 @@ export type ProductTileContent = HeadlineProps &
33
33
  benefits?: TextBenefit[];
34
34
  /** @title Дополнительное описание */
35
35
  additionalDescription?: string;
36
+ /** @title Картинка справа/текст слева */
37
+ isImageOnRightSide?: boolean;
36
38
  };
@@ -28,11 +28,12 @@
28
28
  },
29
29
  "title": "Заголовок 2",
30
30
  "description": "Описание 2",
31
- "socialMedia": [
32
- { "href": "https://t.me" },
33
- { "href": "https://vk.com" },
34
- { "href": "https://ok.ru" }
35
- ]
31
+ "button": {
32
+ "href": "",
33
+ "text": "Подробнее",
34
+ "target": "_self",
35
+ "version": "primary"
36
+ }
36
37
  },
37
38
  {
38
39
  "image": {
@@ -4,6 +4,14 @@
4
4
  "items": {
5
5
  "image": {
6
6
  "ui:field": "picture"
7
+ },
8
+ "button": {
9
+ "icon": {
10
+ "ui:field": "icon"
11
+ },
12
+ "iconRight": {
13
+ "ui:field": "icon"
14
+ }
7
15
  }
8
16
  }
9
17
  }
@@ -41,7 +41,7 @@ export const RecommendationCard = JSX<RecommendationCardProps>(
41
41
  <SocialMedia className="pt-10 pb-0" media={socialMedia} version={version} />
42
42
  ) : null}
43
43
  {button?.text ? (
44
- <div className="pt-2">{renderButton({ button, buttonClassName: 'mt-16' })}</div>
44
+ <div className="pt-2">{renderButton({ button, buttonClassName: 'mt-16 px-5' })}</div>
45
45
  ) : null}
46
46
  </div>
47
47
  </BaseTile>
@@ -0,0 +1,37 @@
1
+ import { useCallback } from '@redneckz/uni-jsx/lib/hooks';
2
+ import type { AsyncDataResponse, Fetcher } from '@redneckz/uni-jsx/lib/hooks/useAsyncData';
3
+ import { useAsyncData } from '@redneckz/uni-jsx/lib/hooks/useAsyncData';
4
+
5
+ const STORAGE_DEFAULT_TTL = 86400000; // 24 * 60 * 60 * 1000
6
+
7
+ export function useCachedAsyncData<Data = any>(
8
+ key: string,
9
+ fetcher: Fetcher<Data, string>,
10
+ storage: any = globalThis?.localStorage,
11
+ ): AsyncDataResponse<Data> {
12
+ const cachedFetcher: typeof fetcher = useCallback(
13
+ async (...args) => {
14
+ const storageKey = `async:${key}`;
15
+ const storageData: string = storage.getItem(storageKey);
16
+
17
+ const cachedData = getParsedData(storageData);
18
+ if (cachedData) {
19
+ return cachedData;
20
+ }
21
+
22
+ const data = await fetcher(...args);
23
+ storage.setItem(storageKey, JSON.stringify({ data, timestamp: Date.now() }));
24
+
25
+ return data;
26
+ },
27
+ [key, fetcher],
28
+ );
29
+
30
+ return useAsyncData(key, cachedFetcher);
31
+ }
32
+
33
+ function getParsedData(storageData: string) {
34
+ const { data = null, timestamp = null } = storageData ? JSON.parse(storageData) : {};
35
+
36
+ return data && Date.now() - timestamp < STORAGE_DEFAULT_TTL ? data : undefined;
37
+ }
@@ -0,0 +1,48 @@
1
+ import { useCallback, useEffect, useState } from '@redneckz/uni-jsx/lib/hooks';
2
+ import { fetchJSONUnsafe } from '../utils/fetchJSON';
3
+ import { useCachedAsyncData } from './useCachedAsyncData';
4
+
5
+ const REGION_URL = '/api/v1/region';
6
+
7
+ export interface RegionData {
8
+ id?: number;
9
+ code?: string;
10
+ name?: string;
11
+ }
12
+
13
+ interface LocationStorageData {
14
+ manual?: boolean;
15
+ region: RegionData;
16
+ }
17
+
18
+ const localStorageLocation = globalThis?.localStorage.getItem('location');
19
+ const currentLocation: LocationStorageData | null = localStorageLocation
20
+ ? JSON.parse(localStorageLocation)
21
+ : null;
22
+
23
+ export function useLocation(
24
+ defaultLocation: string,
25
+ ): [RegionData, (newLocation: RegionData) => void] {
26
+ const [location, setLocation] = useState<RegionData>(
27
+ currentLocation?.region ?? { name: defaultLocation },
28
+ );
29
+ const { data } = useCachedAsyncData<RegionData>(REGION_URL, fetchJSONUnsafe);
30
+
31
+ useEffect(() => {
32
+ setLocation(
33
+ currentLocation?.region && currentLocation?.manual
34
+ ? currentLocation.region
35
+ : data || { name: defaultLocation },
36
+ );
37
+ }, [data]);
38
+
39
+ const onChangeLocation = useCallback(
40
+ (region: RegionData) => {
41
+ globalThis?.localStorage.setItem('location', JSON.stringify({ manual: true, region }));
42
+ setLocation(region);
43
+ },
44
+ [setLocation],
45
+ );
46
+
47
+ return [location, onChangeLocation];
48
+ }
@@ -0,0 +1,16 @@
1
+ import { useAsyncData } from '@redneckz/uni-jsx/lib/hooks/useAsyncData';
2
+ import { fetchJSONUnsafe } from '../utils/fetchJSON';
3
+
4
+ const REGIONS_URL = '/api/v1/regions';
5
+
6
+ export interface Region {
7
+ id?: number;
8
+ code?: string;
9
+ name?: string;
10
+ }
11
+
12
+ export function useRegions(): Region[] {
13
+ const { data } = useAsyncData<Region[]>(REGIONS_URL, fetchJSONUnsafe);
14
+
15
+ return data || [];
16
+ }
@@ -0,0 +1,6 @@
1
+ import type { Picture } from './Picture';
2
+
3
+ export type LogoType = {
4
+ image?: Picture;
5
+ title?: string;
6
+ };
@@ -1,4 +1,5 @@
1
1
  import type { LinkProps } from '../../model/LinkProps';
2
+ import type { LogoType } from '../../model/LogoType';
2
3
  import type { Picture } from '../../model/Picture';
3
4
 
4
5
  /**
@@ -19,13 +20,19 @@ export interface DispositionItem extends LinkProps {
19
20
  icon?: Picture;
20
21
  }
21
22
 
23
+ /**
24
+ * @title Представительства за рубежом
25
+ * @required ["text", "href"]
26
+ */
27
+ export interface ForeignOffice extends LinkProps {
28
+ icon?: Picture;
29
+ }
30
+
22
31
  export interface SitemapDataProps {
23
32
  topItems?: TopMenuItem[];
24
33
  dispositions?: DispositionItem[];
25
- logo?: {
26
- image?: Picture;
27
- title?: string;
28
- };
34
+ logo?: LogoType;
35
+ foreignOffices?: ForeignOffice[];
29
36
  defaultLocation?: string;
30
37
  officesLink?: string;
31
38
  }