@redneckz/wildless-cms-uni-blocks 0.6.41 → 0.6.43

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 (381) hide show
  1. package/bin/migration-scripts/0.6.34.js +2 -0
  2. package/bin/migration-scripts/0.6.43.js +29 -0
  3. package/bundle/blocks.schema.json +1 -1
  4. package/bundle/bundle.umd.js +213 -101
  5. package/bundle/bundle.umd.min.js +1 -1
  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/ProductTile/ProductTileContent.d.ts +24 -2
  10. package/bundle/components/ProductTile/renderAdditionalDescription.d.ts +4 -0
  11. package/bundle/components/ProductTile/renderBenefit.d.ts +4 -0
  12. package/bundle/components/ProductTile/renderImage.d.ts +3 -0
  13. package/bundle/content-page-repository/transformImg.d.ts +1 -1
  14. package/bundle/hooks/useCachedAsyncData.d.ts +2 -0
  15. package/bundle/hooks/useLocation.d.ts +6 -0
  16. package/bundle/hooks/useRegions.d.ts +6 -0
  17. package/bundle/services/sitemap/SitemapProps.d.ts +8 -0
  18. package/bundle/ui-kit/Location/Location.d.ts +19 -0
  19. package/bundle/ui-kit/Location/SearchBar.d.ts +6 -0
  20. package/bundle/ui-kit/MarkdownText/MarkdownText.d.ts +2 -0
  21. package/bundle/ui-kit/MarkdownText/MarkdownTextProps.d.ts +6 -0
  22. package/bundle/utils/groupBy.d.ts +1 -0
  23. package/dist/components/Blocks.js +4 -2
  24. package/dist/components/Blocks.js.map +1 -1
  25. package/dist/components/CarouselRecommendationCard/CarouselRecommendationCard.d.ts +5 -0
  26. package/dist/components/CarouselRecommendationCard/CarouselRecommendationCard.js +22 -0
  27. package/dist/components/CarouselRecommendationCard/CarouselRecommendationCard.js.map +1 -0
  28. package/dist/components/CarouselRecommendationCard/CarouselRecommendationCardContent.d.ts +44 -0
  29. package/dist/components/CarouselRecommendationCard/CarouselRecommendationCardContent.js +2 -0
  30. package/dist/components/CarouselRecommendationCard/CarouselRecommendationCardContent.js.map +1 -0
  31. package/dist/components/Header/Header.js +2 -2
  32. package/dist/components/Header/Header.js.map +1 -1
  33. package/dist/components/Header/HeaderBurger.js +4 -3
  34. package/dist/components/Header/HeaderBurger.js.map +1 -1
  35. package/dist/components/Header/HeaderSecondaryMenu.d.ts +2 -0
  36. package/dist/components/Header/HeaderSecondaryMenu.js +13 -4
  37. package/dist/components/Header/HeaderSecondaryMenu.js.map +1 -1
  38. package/dist/components/ProductTile/ProductTile.js +9 -22
  39. package/dist/components/ProductTile/ProductTile.js.map +1 -1
  40. package/dist/components/ProductTile/ProductTileContent.d.ts +24 -2
  41. package/dist/components/ProductTile/renderAdditionalDescription.d.ts +4 -0
  42. package/dist/components/ProductTile/renderAdditionalDescription.js +18 -0
  43. package/dist/components/ProductTile/renderAdditionalDescription.js.map +1 -0
  44. package/dist/components/ProductTile/renderBenefit.d.ts +4 -0
  45. package/dist/components/ProductTile/renderBenefit.js +32 -0
  46. package/dist/components/ProductTile/renderBenefit.js.map +1 -0
  47. package/dist/components/ProductTile/renderImage.d.ts +3 -0
  48. package/dist/components/ProductTile/renderImage.js +12 -0
  49. package/dist/components/ProductTile/renderImage.js.map +1 -0
  50. package/dist/components/Recommendation/RecommendationCard.js +1 -1
  51. package/dist/components/Recommendation/RecommendationCard.js.map +1 -1
  52. package/dist/components/TextBlock/TextBlock.js +13 -28
  53. package/dist/components/TextBlock/TextBlock.js.map +1 -1
  54. package/dist/content-page-repository/transformImg.d.ts +1 -1
  55. package/dist/content-page-repository/transformImg.js +4 -10
  56. package/dist/content-page-repository/transformImg.js.map +1 -1
  57. package/dist/content-page-repository/transformMarkdown.js +3 -3
  58. package/dist/content-page-repository/transformMarkdown.js.map +1 -1
  59. package/dist/hooks/useCachedAsyncData.d.ts +2 -0
  60. package/dist/hooks/useCachedAsyncData.js +25 -0
  61. package/dist/hooks/useCachedAsyncData.js.map +1 -0
  62. package/dist/hooks/useLocation.d.ts +6 -0
  63. package/dist/hooks/useLocation.js +26 -0
  64. package/dist/hooks/useLocation.js.map +1 -0
  65. package/dist/hooks/useRegions.d.ts +6 -0
  66. package/dist/hooks/useRegions.js +11 -0
  67. package/dist/hooks/useRegions.js.map +1 -0
  68. package/dist/services/sitemap/SitemapProps.d.ts +8 -0
  69. package/dist/ui-kit/Location/Location.d.ts +19 -0
  70. package/dist/ui-kit/Location/Location.js +44 -0
  71. package/dist/ui-kit/Location/Location.js.map +1 -0
  72. package/dist/ui-kit/Location/SearchBar.d.ts +6 -0
  73. package/dist/ui-kit/Location/SearchBar.js +9 -0
  74. package/dist/ui-kit/Location/SearchBar.js.map +1 -0
  75. package/dist/ui-kit/MarkdownText/MarkdownText.d.ts +2 -0
  76. package/dist/ui-kit/MarkdownText/MarkdownText.js +9 -0
  77. package/dist/ui-kit/MarkdownText/MarkdownText.js.map +1 -0
  78. package/dist/ui-kit/MarkdownText/MarkdownTextProps.d.ts +6 -0
  79. package/dist/ui-kit/MarkdownText/MarkdownTextProps.js +2 -0
  80. package/dist/ui-kit/MarkdownText/MarkdownTextProps.js.map +1 -0
  81. package/dist/ui-kit/SwipeListControl/SwipeListContainer.js +8 -4
  82. package/dist/ui-kit/SwipeListControl/SwipeListContainer.js.map +1 -1
  83. package/dist/ui-kit/Text/Text.js +1 -5
  84. package/dist/ui-kit/Text/Text.js.map +1 -1
  85. package/dist/utils/groupBy.d.ts +1 -0
  86. package/dist/utils/groupBy.js +13 -0
  87. package/dist/utils/groupBy.js.map +1 -0
  88. package/lib/common.css +1 -1
  89. package/lib/components/Blocks.js +4 -2
  90. package/lib/components/Blocks.js.map +1 -1
  91. package/lib/components/Carousel/Carousel.fixture.d.ts +1 -0
  92. package/lib/components/CarouselRecommendationCard/CarouselRecommendationCard.d.ts +5 -0
  93. package/lib/components/CarouselRecommendationCard/CarouselRecommendationCard.fixture.d.ts +9 -0
  94. package/lib/components/CarouselRecommendationCard/CarouselRecommendationCard.js +20 -0
  95. package/lib/components/CarouselRecommendationCard/CarouselRecommendationCard.js.map +1 -0
  96. package/lib/components/CarouselRecommendationCard/CarouselRecommendationCardContent.d.ts +44 -0
  97. package/lib/components/CarouselRecommendationCard/CarouselRecommendationCardContent.js +2 -0
  98. package/lib/components/CarouselRecommendationCard/CarouselRecommendationCardContent.js.map +1 -0
  99. package/lib/components/Header/Header.js +2 -2
  100. package/lib/components/Header/Header.js.map +1 -1
  101. package/lib/components/Header/HeaderBurger.js +4 -3
  102. package/lib/components/Header/HeaderBurger.js.map +1 -1
  103. package/lib/components/Header/HeaderSecondaryMenu.d.ts +2 -0
  104. package/lib/components/Header/HeaderSecondaryMenu.js +13 -4
  105. package/lib/components/Header/HeaderSecondaryMenu.js.map +1 -1
  106. package/lib/components/ProductTile/ProductTile.js +10 -23
  107. package/lib/components/ProductTile/ProductTile.js.map +1 -1
  108. package/lib/components/ProductTile/ProductTileContent.d.ts +24 -2
  109. package/lib/components/ProductTile/renderAdditionalDescription.d.ts +4 -0
  110. package/lib/components/ProductTile/renderAdditionalDescription.js +15 -0
  111. package/lib/components/ProductTile/renderAdditionalDescription.js.map +1 -0
  112. package/lib/components/ProductTile/renderBenefit.d.ts +4 -0
  113. package/lib/components/ProductTile/renderBenefit.js +29 -0
  114. package/lib/components/ProductTile/renderBenefit.js.map +1 -0
  115. package/lib/components/ProductTile/renderImage.d.ts +3 -0
  116. package/lib/components/ProductTile/renderImage.js +9 -0
  117. package/lib/components/ProductTile/renderImage.js.map +1 -0
  118. package/lib/components/Recommendation/Recommendation.fixture.d.ts +1 -1
  119. package/lib/components/Recommendation/RecommendationCard.js +1 -1
  120. package/lib/components/Recommendation/RecommendationCard.js.map +1 -1
  121. package/lib/components/TextBlock/TextBlock.js +13 -28
  122. package/lib/components/TextBlock/TextBlock.js.map +1 -1
  123. package/lib/content-page-repository/transformImg.d.ts +1 -1
  124. package/lib/content-page-repository/transformImg.js +4 -10
  125. package/lib/content-page-repository/transformImg.js.map +1 -1
  126. package/lib/content-page-repository/transformMarkdown.js +3 -3
  127. package/lib/content-page-repository/transformMarkdown.js.map +1 -1
  128. package/lib/hooks/useCachedAsyncData.d.ts +2 -0
  129. package/lib/hooks/useCachedAsyncData.js +22 -0
  130. package/lib/hooks/useCachedAsyncData.js.map +1 -0
  131. package/lib/hooks/useLocation.d.ts +6 -0
  132. package/lib/hooks/useLocation.js +23 -0
  133. package/lib/hooks/useLocation.js.map +1 -0
  134. package/lib/hooks/useRegions.d.ts +6 -0
  135. package/lib/hooks/useRegions.js +8 -0
  136. package/lib/hooks/useRegions.js.map +1 -0
  137. package/lib/services/sitemap/SitemapProps.d.ts +8 -0
  138. package/lib/ui-kit/Location/Location.d.ts +19 -0
  139. package/lib/ui-kit/Location/Location.fixture.d.ts +6 -0
  140. package/lib/ui-kit/Location/Location.js +42 -0
  141. package/lib/ui-kit/Location/Location.js.map +1 -0
  142. package/lib/ui-kit/Location/SearchBar.d.ts +6 -0
  143. package/lib/ui-kit/Location/SearchBar.js +7 -0
  144. package/lib/ui-kit/Location/SearchBar.js.map +1 -0
  145. package/lib/ui-kit/MarkdownText/MarkdownText.d.ts +2 -0
  146. package/lib/ui-kit/MarkdownText/MarkdownText.js +7 -0
  147. package/lib/ui-kit/MarkdownText/MarkdownText.js.map +1 -0
  148. package/lib/ui-kit/MarkdownText/MarkdownTextProps.d.ts +6 -0
  149. package/lib/ui-kit/MarkdownText/MarkdownTextProps.js +2 -0
  150. package/lib/ui-kit/MarkdownText/MarkdownTextProps.js.map +1 -0
  151. package/lib/ui-kit/SwipeListControl/SwipeListContainer.js +8 -4
  152. package/lib/ui-kit/SwipeListControl/SwipeListContainer.js.map +1 -1
  153. package/lib/ui-kit/Text/Text.js +1 -5
  154. package/lib/ui-kit/Text/Text.js.map +1 -1
  155. package/lib/utils/groupBy.d.ts +1 -0
  156. package/lib/utils/groupBy.js +10 -0
  157. package/lib/utils/groupBy.js.map +1 -0
  158. package/mobile/bundle/bundle.umd.js +49 -25
  159. package/mobile/bundle/bundle.umd.min.js +1 -1
  160. package/mobile/bundle/components/CarouselRecommendationCard/CarouselRecommendationCard.d.ts +5 -0
  161. package/mobile/bundle/components/CarouselRecommendationCard/CarouselRecommendationCardContent.d.ts +44 -0
  162. package/mobile/bundle/components/Header/HeaderSecondaryMenu.d.ts +2 -0
  163. package/mobile/bundle/components/ProductTile/ProductTileContent.d.ts +24 -2
  164. package/mobile/bundle/components/ProductTile/renderAdditionalDescription.d.ts +4 -0
  165. package/mobile/bundle/components/ProductTile/renderBenefit.d.ts +4 -0
  166. package/mobile/bundle/components/ProductTile/renderImage.d.ts +3 -0
  167. package/mobile/bundle/content-page-repository/transformImg.d.ts +1 -1
  168. package/mobile/bundle/hooks/useCachedAsyncData.d.ts +2 -0
  169. package/mobile/bundle/hooks/useLocation.d.ts +6 -0
  170. package/mobile/bundle/hooks/useRegions.d.ts +6 -0
  171. package/mobile/bundle/services/sitemap/SitemapProps.d.ts +8 -0
  172. package/mobile/bundle/ui-kit/Location/Location.d.ts +19 -0
  173. package/mobile/bundle/ui-kit/Location/SearchBar.d.ts +6 -0
  174. package/mobile/bundle/ui-kit/MarkdownText/MarkdownText.d.ts +2 -0
  175. package/mobile/bundle/ui-kit/MarkdownText/MarkdownTextProps.d.ts +6 -0
  176. package/mobile/bundle/utils/groupBy.d.ts +1 -0
  177. package/mobile/dist/components/CarouselRecommendationCard/CarouselRecommendationCard.d.ts +5 -0
  178. package/mobile/dist/components/CarouselRecommendationCard/CarouselRecommendationCard.js +22 -0
  179. package/mobile/dist/components/CarouselRecommendationCard/CarouselRecommendationCard.js.map +1 -0
  180. package/mobile/dist/components/CarouselRecommendationCard/CarouselRecommendationCardContent.d.ts +44 -0
  181. package/mobile/dist/components/CarouselRecommendationCard/CarouselRecommendationCardContent.js +2 -0
  182. package/mobile/dist/components/CarouselRecommendationCard/CarouselRecommendationCardContent.js.map +1 -0
  183. package/mobile/dist/components/Header/HeaderBurger.js +4 -3
  184. package/mobile/dist/components/Header/HeaderBurger.js.map +1 -1
  185. package/mobile/dist/components/Header/HeaderSecondaryMenu.d.ts +2 -0
  186. package/mobile/dist/components/Header/HeaderSecondaryMenu.js +13 -4
  187. package/mobile/dist/components/Header/HeaderSecondaryMenu.js.map +1 -1
  188. package/mobile/dist/components/ProductTile/ProductTile.js +9 -22
  189. package/mobile/dist/components/ProductTile/ProductTile.js.map +1 -1
  190. package/mobile/dist/components/ProductTile/ProductTileContent.d.ts +24 -2
  191. package/mobile/dist/components/ProductTile/renderAdditionalDescription.d.ts +4 -0
  192. package/mobile/dist/components/ProductTile/renderAdditionalDescription.js +18 -0
  193. package/mobile/dist/components/ProductTile/renderAdditionalDescription.js.map +1 -0
  194. package/mobile/dist/components/ProductTile/renderBenefit.d.ts +4 -0
  195. package/mobile/dist/components/ProductTile/renderBenefit.js +32 -0
  196. package/mobile/dist/components/ProductTile/renderBenefit.js.map +1 -0
  197. package/mobile/dist/components/ProductTile/renderImage.d.ts +3 -0
  198. package/mobile/dist/components/ProductTile/renderImage.js +12 -0
  199. package/mobile/dist/components/ProductTile/renderImage.js.map +1 -0
  200. package/mobile/dist/components/Recommendation/RecommendationCard.js +1 -1
  201. package/mobile/dist/components/Recommendation/RecommendationCard.js.map +1 -1
  202. package/mobile/dist/content-page-repository/transformImg.d.ts +1 -1
  203. package/mobile/dist/content-page-repository/transformImg.js +4 -10
  204. package/mobile/dist/content-page-repository/transformImg.js.map +1 -1
  205. package/mobile/dist/content-page-repository/transformMarkdown.js +3 -3
  206. package/mobile/dist/content-page-repository/transformMarkdown.js.map +1 -1
  207. package/mobile/dist/hooks/useCachedAsyncData.d.ts +2 -0
  208. package/mobile/dist/hooks/useCachedAsyncData.js +25 -0
  209. package/mobile/dist/hooks/useCachedAsyncData.js.map +1 -0
  210. package/mobile/dist/hooks/useLocation.d.ts +6 -0
  211. package/mobile/dist/hooks/useLocation.js +26 -0
  212. package/mobile/dist/hooks/useLocation.js.map +1 -0
  213. package/mobile/dist/hooks/useRegions.d.ts +6 -0
  214. package/mobile/dist/hooks/useRegions.js +11 -0
  215. package/mobile/dist/hooks/useRegions.js.map +1 -0
  216. package/mobile/dist/services/sitemap/SitemapProps.d.ts +8 -0
  217. package/mobile/dist/ui-kit/Location/Location.d.ts +19 -0
  218. package/mobile/dist/ui-kit/Location/Location.js +44 -0
  219. package/mobile/dist/ui-kit/Location/Location.js.map +1 -0
  220. package/mobile/dist/ui-kit/Location/SearchBar.d.ts +6 -0
  221. package/mobile/dist/ui-kit/Location/SearchBar.js +9 -0
  222. package/mobile/dist/ui-kit/Location/SearchBar.js.map +1 -0
  223. package/mobile/dist/ui-kit/MarkdownText/MarkdownText.d.ts +2 -0
  224. package/mobile/dist/ui-kit/MarkdownText/MarkdownText.js +9 -0
  225. package/mobile/dist/ui-kit/MarkdownText/MarkdownText.js.map +1 -0
  226. package/mobile/dist/ui-kit/MarkdownText/MarkdownTextProps.d.ts +6 -0
  227. package/mobile/dist/ui-kit/MarkdownText/MarkdownTextProps.js +2 -0
  228. package/mobile/dist/ui-kit/MarkdownText/MarkdownTextProps.js.map +1 -0
  229. package/mobile/dist/ui-kit/SwipeListControl/SwipeListContainer.js +8 -4
  230. package/mobile/dist/ui-kit/SwipeListControl/SwipeListContainer.js.map +1 -1
  231. package/mobile/dist/ui-kit/Text/Text.js +1 -5
  232. package/mobile/dist/ui-kit/Text/Text.js.map +1 -1
  233. package/mobile/dist/utils/groupBy.d.ts +1 -0
  234. package/mobile/dist/utils/groupBy.js +13 -0
  235. package/mobile/dist/utils/groupBy.js.map +1 -0
  236. package/mobile/lib/components/CarouselRecommendationCard/CarouselRecommendationCard.d.ts +5 -0
  237. package/mobile/lib/components/CarouselRecommendationCard/CarouselRecommendationCard.js +20 -0
  238. package/mobile/lib/components/CarouselRecommendationCard/CarouselRecommendationCard.js.map +1 -0
  239. package/mobile/lib/components/CarouselRecommendationCard/CarouselRecommendationCardContent.d.ts +44 -0
  240. package/mobile/lib/components/CarouselRecommendationCard/CarouselRecommendationCardContent.js +2 -0
  241. package/mobile/lib/components/CarouselRecommendationCard/CarouselRecommendationCardContent.js.map +1 -0
  242. package/mobile/lib/components/Header/HeaderBurger.js +4 -3
  243. package/mobile/lib/components/Header/HeaderBurger.js.map +1 -1
  244. package/mobile/lib/components/Header/HeaderSecondaryMenu.d.ts +2 -0
  245. package/mobile/lib/components/Header/HeaderSecondaryMenu.js +13 -4
  246. package/mobile/lib/components/Header/HeaderSecondaryMenu.js.map +1 -1
  247. package/mobile/lib/components/ProductTile/ProductTile.js +10 -23
  248. package/mobile/lib/components/ProductTile/ProductTile.js.map +1 -1
  249. package/mobile/lib/components/ProductTile/ProductTileContent.d.ts +24 -2
  250. package/mobile/lib/components/ProductTile/renderAdditionalDescription.d.ts +4 -0
  251. package/mobile/lib/components/ProductTile/renderAdditionalDescription.js +15 -0
  252. package/mobile/lib/components/ProductTile/renderAdditionalDescription.js.map +1 -0
  253. package/mobile/lib/components/ProductTile/renderBenefit.d.ts +4 -0
  254. package/mobile/lib/components/ProductTile/renderBenefit.js +29 -0
  255. package/mobile/lib/components/ProductTile/renderBenefit.js.map +1 -0
  256. package/mobile/lib/components/ProductTile/renderImage.d.ts +3 -0
  257. package/mobile/lib/components/ProductTile/renderImage.js +9 -0
  258. package/mobile/lib/components/ProductTile/renderImage.js.map +1 -0
  259. package/mobile/lib/components/Recommendation/RecommendationCard.js +1 -1
  260. package/mobile/lib/components/Recommendation/RecommendationCard.js.map +1 -1
  261. package/mobile/lib/content-page-repository/transformImg.d.ts +1 -1
  262. package/mobile/lib/content-page-repository/transformImg.js +4 -10
  263. package/mobile/lib/content-page-repository/transformImg.js.map +1 -1
  264. package/mobile/lib/content-page-repository/transformMarkdown.js +3 -3
  265. package/mobile/lib/content-page-repository/transformMarkdown.js.map +1 -1
  266. package/mobile/lib/hooks/useCachedAsyncData.d.ts +2 -0
  267. package/mobile/lib/hooks/useCachedAsyncData.js +22 -0
  268. package/mobile/lib/hooks/useCachedAsyncData.js.map +1 -0
  269. package/mobile/lib/hooks/useLocation.d.ts +6 -0
  270. package/mobile/lib/hooks/useLocation.js +23 -0
  271. package/mobile/lib/hooks/useLocation.js.map +1 -0
  272. package/mobile/lib/hooks/useRegions.d.ts +6 -0
  273. package/mobile/lib/hooks/useRegions.js +8 -0
  274. package/mobile/lib/hooks/useRegions.js.map +1 -0
  275. package/mobile/lib/services/sitemap/SitemapProps.d.ts +8 -0
  276. package/mobile/lib/ui-kit/Location/Location.d.ts +19 -0
  277. package/mobile/lib/ui-kit/Location/Location.js +42 -0
  278. package/mobile/lib/ui-kit/Location/Location.js.map +1 -0
  279. package/mobile/lib/ui-kit/Location/SearchBar.d.ts +6 -0
  280. package/mobile/lib/ui-kit/Location/SearchBar.js +7 -0
  281. package/mobile/lib/ui-kit/Location/SearchBar.js.map +1 -0
  282. package/mobile/lib/ui-kit/MarkdownText/MarkdownText.d.ts +2 -0
  283. package/mobile/lib/ui-kit/MarkdownText/MarkdownText.js +7 -0
  284. package/mobile/lib/ui-kit/MarkdownText/MarkdownText.js.map +1 -0
  285. package/mobile/lib/ui-kit/MarkdownText/MarkdownTextProps.d.ts +6 -0
  286. package/mobile/lib/ui-kit/MarkdownText/MarkdownTextProps.js +2 -0
  287. package/mobile/lib/ui-kit/MarkdownText/MarkdownTextProps.js.map +1 -0
  288. package/mobile/lib/ui-kit/SwipeListControl/SwipeListContainer.js +8 -4
  289. package/mobile/lib/ui-kit/SwipeListControl/SwipeListContainer.js.map +1 -1
  290. package/mobile/lib/ui-kit/Text/Text.js +1 -5
  291. package/mobile/lib/ui-kit/Text/Text.js.map +1 -1
  292. package/mobile/lib/utils/groupBy.d.ts +1 -0
  293. package/mobile/lib/utils/groupBy.js +10 -0
  294. package/mobile/lib/utils/groupBy.js.map +1 -0
  295. package/mobile/src/common.css +50 -0
  296. package/mobile/src/components/CarouselRecommendationCard/CarouselRecommendationCard.example.json +19 -0
  297. package/mobile/src/components/CarouselRecommendationCard/CarouselRecommendationCard.tsx +62 -0
  298. package/mobile/src/components/CarouselRecommendationCard/CarouselRecommendationCard.ui.json +9 -0
  299. package/mobile/src/components/CarouselRecommendationCard/CarouselRecommendationCardContent.ts +45 -0
  300. package/mobile/src/components/Header/HeaderBurger.tsx +5 -7
  301. package/mobile/src/components/Header/HeaderSecondaryMenu.tsx +32 -5
  302. package/mobile/src/components/MiniGallery/MiniGallery.ui.json +1 -1
  303. package/mobile/src/components/ProductTile/ProductTile.example.json +3 -0
  304. package/mobile/src/components/ProductTile/ProductTile.tsx +13 -44
  305. package/mobile/src/components/ProductTile/ProductTile.ui.json +14 -1
  306. package/mobile/src/components/ProductTile/ProductTileContent.ts +26 -2
  307. package/mobile/src/components/ProductTile/renderAdditionalDescription.tsx +30 -0
  308. package/mobile/src/components/ProductTile/renderBenefit.tsx +39 -0
  309. package/mobile/src/components/ProductTile/renderImage.tsx +15 -0
  310. package/mobile/src/components/Recommendation/Recommendation.example.json +6 -5
  311. package/mobile/src/components/Recommendation/Recommendation.ui.json +8 -0
  312. package/mobile/src/components/Recommendation/RecommendationCard.tsx +1 -1
  313. package/mobile/src/content-page-repository/transformImg.ts +6 -14
  314. package/mobile/src/content-page-repository/transformMarkdown.ts +3 -3
  315. package/mobile/src/hooks/useCachedAsyncData.ts +37 -0
  316. package/mobile/src/hooks/useLocation.ts +48 -0
  317. package/mobile/src/hooks/useRegions.ts +16 -0
  318. package/mobile/src/services/sitemap/SitemapProps.ts +9 -0
  319. package/mobile/src/ui-kit/Location/Location.tsx +168 -0
  320. package/mobile/src/ui-kit/Location/SearchBar.tsx +30 -0
  321. package/mobile/src/ui-kit/MarkdownText/MarkdownText.tsx +8 -0
  322. package/mobile/src/ui-kit/MarkdownText/MarkdownTextProps.ts +6 -0
  323. package/mobile/src/ui-kit/SwipeListControl/SwipeListContainer.tsx +8 -4
  324. package/mobile/src/ui-kit/Text/Text.tsx +5 -7
  325. package/mobile/src/utils/groupBy.ts +10 -0
  326. package/package.json +2 -2
  327. package/src/common.css +50 -0
  328. package/src/components/Blocks.ts +4 -2
  329. package/src/components/Carousel/Carousel.fixture.tsx +22 -4
  330. package/src/components/CarouselRecommendationCard/CarouselRecommendationCard.example.json +19 -0
  331. package/src/components/CarouselRecommendationCard/CarouselRecommendationCard.fixture.tsx +47 -0
  332. package/src/components/CarouselRecommendationCard/CarouselRecommendationCard.tsx +62 -0
  333. package/src/components/CarouselRecommendationCard/CarouselRecommendationCard.ui.json +9 -0
  334. package/src/components/CarouselRecommendationCard/CarouselRecommendationCardContent.ts +45 -0
  335. package/src/components/Header/Header.tsx +6 -4
  336. package/src/components/Header/HeaderBurger.tsx +5 -7
  337. package/src/components/Header/HeaderSecondaryMenu.tsx +32 -5
  338. package/src/components/MiniGallery/MiniGallery.ui.json +1 -1
  339. package/src/components/ProductTile/ProductTile.example.json +3 -0
  340. package/src/components/ProductTile/ProductTile.fixture.tsx +11 -4
  341. package/src/components/ProductTile/ProductTile.tsx +13 -44
  342. package/src/components/ProductTile/ProductTile.ui.json +14 -1
  343. package/src/components/ProductTile/ProductTileContent.ts +26 -2
  344. package/src/components/ProductTile/renderAdditionalDescription.tsx +30 -0
  345. package/src/components/ProductTile/renderBenefit.tsx +39 -0
  346. package/src/components/ProductTile/renderImage.tsx +15 -0
  347. package/src/components/Recommendation/Recommendation.example.json +6 -5
  348. package/src/components/Recommendation/Recommendation.fixture.tsx +11 -10
  349. package/src/components/Recommendation/Recommendation.ui.json +8 -0
  350. package/src/components/Recommendation/RecommendationCard.tsx +1 -1
  351. package/src/components/TextBlock/TextBlock.tsx +49 -41
  352. package/src/content-page-repository/transformImg.ts +6 -14
  353. package/src/content-page-repository/transformMarkdown.ts +3 -3
  354. package/src/hooks/useCachedAsyncData.ts +37 -0
  355. package/src/hooks/useLocation.ts +48 -0
  356. package/src/hooks/useRegions.ts +16 -0
  357. package/src/services/sitemap/SitemapProps.ts +9 -0
  358. package/src/ui-kit/Location/Location.fixture.tsx +81 -0
  359. package/src/ui-kit/Location/Location.tsx +168 -0
  360. package/src/ui-kit/Location/SearchBar.tsx +30 -0
  361. package/src/ui-kit/MarkdownText/MarkdownText.tsx +8 -0
  362. package/src/ui-kit/MarkdownText/MarkdownTextProps.ts +6 -0
  363. package/src/ui-kit/SwipeListControl/SwipeListContainer.tsx +8 -4
  364. package/src/ui-kit/Text/Text.tsx +5 -7
  365. package/src/utils/groupBy.ts +10 -0
  366. package/bundle/hooks/useGeolocation.d.ts +0 -1
  367. package/dist/hooks/useGeolocation.d.ts +0 -1
  368. package/dist/hooks/useGeolocation.js +0 -21
  369. package/dist/hooks/useGeolocation.js.map +0 -1
  370. package/lib/hooks/useGeolocation.d.ts +0 -1
  371. package/lib/hooks/useGeolocation.js +0 -18
  372. package/lib/hooks/useGeolocation.js.map +0 -1
  373. package/mobile/bundle/hooks/useGeolocation.d.ts +0 -1
  374. package/mobile/dist/hooks/useGeolocation.d.ts +0 -1
  375. package/mobile/dist/hooks/useGeolocation.js +0 -21
  376. package/mobile/dist/hooks/useGeolocation.js.map +0 -1
  377. package/mobile/lib/hooks/useGeolocation.d.ts +0 -1
  378. package/mobile/lib/hooks/useGeolocation.js +0 -18
  379. package/mobile/lib/hooks/useGeolocation.js.map +0 -1
  380. package/mobile/src/hooks/useGeolocation.ts +0 -22
  381. package/src/hooks/useGeolocation.ts +0 -22
@@ -3,51 +3,43 @@ import type { UniBlockProps } from '../../model/JSXBlock';
3
3
  import type { Picture } from '../../model/Picture';
4
4
  import { BlockWrapper } from '../../ui-kit/BlockWrapper';
5
5
  import { Img } from '../../ui-kit/Img/Img';
6
+ import { Paragraph } from '../../ui-kit/Paragraph/Paragraph';
7
+ import { Text } from '../../ui-kit/Text/Text';
6
8
  import type { TextBlockContent, TextBlockVersion } from './TextBlockContent';
7
9
 
8
10
  export interface TextBlockProps extends TextBlockContent, UniBlockProps {}
9
11
 
10
- const textBlockStyleMaps: Record<
11
- TextBlockVersion,
12
- { background: string; icon: string; title: string; description: string }
13
- > = {
14
- primary: {
15
- background: 'bg-white',
16
- icon: 'bg-primary-main text-white',
17
- title: 'text-primary-text',
18
- description: 'text-secondary-text',
19
- },
20
- secondary: {
21
- background: 'bg-primary-main',
22
- icon: 'bg-white text-primary-main',
23
- title: 'text-white',
24
- description: 'text-white',
25
- },
26
- 'secondary-light': {
27
- background: 'bg-primary-main/10',
28
- icon: 'bg-primary-main text-white',
29
- title: 'text-primary-text',
30
- description: 'text-secondary-text',
31
- },
12
+ const textBlockBack: Record<TextBlockVersion, string> = {
13
+ primary: 'bg-white',
14
+ secondary: 'bg-primary-main',
15
+ 'secondary-light': 'bg-primary-main/10',
32
16
  };
33
17
 
34
18
  export const TextBlock = JSX<TextBlockProps>(
35
- ({ title, description, blockVersion = 'primary', iconVersion, image, className, ...rest }) => {
36
- const textBlockStyleMap = textBlockStyleMaps[blockVersion];
19
+ ({
20
+ className = '',
21
+ title,
22
+ description,
23
+ blockVersion = 'primary',
24
+ iconVersion,
25
+ image,
26
+ ...rest
27
+ }) => {
28
+ const isSecondaryBlock = blockVersion === 'secondary';
37
29
 
38
30
  return (
39
31
  <BlockWrapper
40
- className={`font-sans px-9 py-4 flex ${textBlockStyleMap.background} ${className || ''}`}
32
+ className={`px-9 py-4 flex gap-3 ${textBlockBack[blockVersion]} ${className}`}
41
33
  {...rest}
42
34
  >
43
- {iconVersion === 'small' ? renderIcon(textBlockStyleMap.icon) : null}
35
+ {iconVersion === 'small' ? (
36
+ <div className="mt-1">{renderIcon(isSecondaryBlock)}</div>
37
+ ) : null}
44
38
  {iconVersion === 'big' ? renderImage(image) : null}
45
- <div className="py-0.5">
46
- {title ? (
47
- <div className={`text-l font-medium mb-1 ${textBlockStyleMap.title}`}>{title}</div>
48
- ) : null}
39
+ <div>
40
+ {title ? renderTitle(title, isSecondaryBlock) : null}
49
41
  {description ? (
50
- <div className={`text-s ${textBlockStyleMap.description}`}>{description}</div>
42
+ <div className="mt-1">{renderDescription(description, isSecondaryBlock)}</div>
51
43
  ) : null}
52
44
  </div>
53
45
  </BlockWrapper>
@@ -55,14 +47,30 @@ export const TextBlock = JSX<TextBlockProps>(
55
47
  },
56
48
  );
57
49
 
58
- function renderIcon(className: string) {
59
- return (
60
- <div className="pt-1.5 pl-1 pr-4">
61
- <div className={`rounded-full h-4 w-4 text-center text-xs-light ${className}`}>i</div>
62
- </div>
63
- );
64
- }
50
+ const renderIcon = (isSecondaryBlock: boolean) => (
51
+ <div
52
+ className={`rounded-full h-4 w-4 text-center text-xs-light ${
53
+ isSecondaryBlock ? 'bg-white text-primary-main' : 'bg-primary-main text-white'
54
+ }`}
55
+ >
56
+ i
57
+ </div>
58
+ );
65
59
 
66
- function renderImage(image?: Picture) {
67
- return image?.src ? <Img className="pt-0.5 pr-3" image={image} /> : null;
68
- }
60
+ const renderImage = (image?: Picture) => (image?.src ? <Img image={image} /> : null);
61
+
62
+ const renderTitle = (title: string, isSecondaryBlock: boolean) => (
63
+ <Text
64
+ size="text-l"
65
+ font="font-medium"
66
+ color={isSecondaryBlock ? 'text-white' : 'text-primary-text'}
67
+ >
68
+ {title}
69
+ </Text>
70
+ );
71
+
72
+ const renderDescription = (description: string, isSecondaryBlock: boolean) => (
73
+ <Paragraph size="text-s" color={isSecondaryBlock ? 'text-white' : 'text-secondary-text'}>
74
+ {description}
75
+ </Paragraph>
76
+ );
@@ -1,13 +1,13 @@
1
1
  import fs from 'fs';
2
2
  import path from 'path';
3
- import util from 'util';
4
- import sharp from 'sharp';
5
3
  import type { ResizeOptions, Sharp } from 'sharp';
4
+ import sharp from 'sharp';
5
+ import util from 'util';
6
6
  import type { ImageSize } from '../model/ImageSize';
7
- import type { TransformationOptions } from './TransformationOptions';
8
7
  import type { ImgAlignment, ImgSource, Picture } from '../model/Picture';
9
- import { transformSrc } from './transformSrc';
10
8
  import { isPictureSizeEmpty } from '../utils/isPictureSizeEmpty';
9
+ import type { TransformationOptions } from './TransformationOptions';
10
+ import { transformSrc } from './transformSrc';
11
11
 
12
12
  const mkdir = util.promisify(fs.mkdir);
13
13
 
@@ -126,20 +126,12 @@ function getCompositionResizeSize(
126
126
  const { width, height } = size;
127
127
  const { width: containerWidth, height: containerHeight } = containerSize;
128
128
 
129
- let widthRatio = 0;
130
- let heightRatio = 0;
131
-
132
129
  if (!(width || height)) {
133
130
  return undefined;
134
131
  }
135
132
 
136
- if (width) {
137
- widthRatio = containerWidth / width;
138
- }
139
-
140
- if (height) {
141
- heightRatio = containerHeight / height;
142
- }
133
+ const widthRatio = width ? containerWidth / width : 0;
134
+ const heightRatio = height ? containerHeight / height : 0;
143
135
 
144
136
  return widthRatio > heightRatio
145
137
  ? { width: Math.min(Number(width), containerWidth) }
@@ -1,6 +1,6 @@
1
- import { unified } from 'unified';
2
- import remarkParse from 'remark-parse';
3
1
  import remarkHtml from 'remark-html';
2
+ import remarkParse from 'remark-parse';
3
+ import { unified } from 'unified';
4
4
 
5
5
  export async function transformMarkdown(markdown: string | null | undefined): Promise<string> {
6
6
  if (!markdown) {
@@ -9,5 +9,5 @@ export async function transformMarkdown(markdown: string | null | undefined): Pr
9
9
 
10
10
  const result = await unified().use(remarkParse).use(remarkHtml).process(markdown);
11
11
 
12
- return result.toString('utf-8');
12
+ return result.toString('utf-8').replaceAll(/<h(\d)>([^<]*)<\/h\d>/g, '<p class="h$1">$2</p>');
13
13
  }
@@ -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
+ }
@@ -20,10 +20,19 @@ export interface DispositionItem extends LinkProps {
20
20
  icon?: Picture;
21
21
  }
22
22
 
23
+ /**
24
+ * @title Представительства за рубежом
25
+ * @required ["text", "href"]
26
+ */
27
+ export interface ForeignOffice extends LinkProps {
28
+ icon?: Picture;
29
+ }
30
+
23
31
  export interface SitemapDataProps {
24
32
  topItems?: TopMenuItem[];
25
33
  dispositions?: DispositionItem[];
26
34
  logo?: LogoType;
35
+ foreignOffices?: ForeignOffice[];
27
36
  defaultLocation?: string;
28
37
  officesLink?: string;
29
38
  }
@@ -0,0 +1,81 @@
1
+ import { Picture } from '../../model/Picture';
2
+ import type { ForeignOffice } from '../../services/sitemap/SitemapProps';
3
+ import '../../setup-fixture';
4
+ import { Location } from './Location';
5
+
6
+ const belarus: Picture = {
7
+ src: 'belarus.png',
8
+ format: 'webp',
9
+ size: {
10
+ width: 24,
11
+ height: 24,
12
+ },
13
+ };
14
+
15
+ const kazakhstan: Picture = {
16
+ src: 'kazakhstan.png',
17
+ format: 'webp',
18
+ size: {
19
+ width: 24,
20
+ height: 24,
21
+ },
22
+ };
23
+
24
+ const armenia: Picture = {
25
+ src: 'armenia.png',
26
+ format: 'webp',
27
+ size: {
28
+ width: 24,
29
+ height: 24,
30
+ },
31
+ };
32
+
33
+ const china: Picture = {
34
+ src: 'china.png',
35
+ format: 'webp',
36
+ size: {
37
+ width: 24,
38
+ height: 24,
39
+ },
40
+ };
41
+
42
+ const FOREIGN_OFFICES: ForeignOffice[] = [
43
+ {
44
+ text: 'Республика Беларусь',
45
+ href: '#',
46
+ icon: belarus,
47
+ },
48
+ {
49
+ text: 'Республика Казахстан',
50
+ href: '#',
51
+ icon: kazakhstan,
52
+ },
53
+ {
54
+ text: 'Республика Армения',
55
+ href: '#',
56
+ icon: armenia,
57
+ },
58
+ {
59
+ text: 'Китайская Народная Республика',
60
+ href: '#',
61
+ icon: china,
62
+ },
63
+ ];
64
+
65
+ const close = () => ({});
66
+ const onChangeLocation = () => ({});
67
+
68
+ const currentLocation = {
69
+ name: 'Москва',
70
+ };
71
+
72
+ export default {
73
+ default: (
74
+ <Location
75
+ close={close}
76
+ onChangeLocation={onChangeLocation}
77
+ currentLocation={currentLocation}
78
+ foreignOffices={FOREIGN_OFFICES}
79
+ />
80
+ ),
81
+ };
@@ -0,0 +1,168 @@
1
+ import { JSX } from '@redneckz/uni-jsx';
2
+ import { useCallback } from '@redneckz/uni-jsx/lib/hooks';
3
+ import { useLink } from '../../hooks/useLink';
4
+ import type { Region } from '../../hooks/useRegions';
5
+ import { useRegions } from '../../hooks/useRegions';
6
+ import { useSearch } from '../../hooks/useSearch';
7
+ import type { UniBlockProps } from '../../model/JSXBlock';
8
+ import type { ForeignOffice } from '../../services/sitemap/SitemapProps';
9
+ import { Text } from '../../ui-kit/Text/Text';
10
+ import { groupBy } from '../../utils/groupBy';
11
+ import { Img } from '../Img/Img';
12
+ import { SearchBar } from './SearchBar';
13
+
14
+ const SEARCH_TERM_MIN_LENGTH = 3;
15
+
16
+ interface RegionLinkProps {
17
+ onChangeLocation?: (region: Region) => void;
18
+ }
19
+
20
+ interface CloseButtonProps {
21
+ close?: () => void;
22
+ }
23
+
24
+ interface CurrentLocationProps {
25
+ currentLocation?: Region;
26
+ }
27
+
28
+ interface ForeignOfficeProps {
29
+ foreignOffices?: ForeignOffice[];
30
+ }
31
+
32
+ export type LocationProps = ForeignOfficeProps &
33
+ CloseButtonProps &
34
+ RegionLinkProps &
35
+ CurrentLocationProps &
36
+ UniBlockProps;
37
+
38
+ export const Location = JSX<LocationProps>(
39
+ ({ currentLocation, onChangeLocation, close, foreignOffices }) => {
40
+ const { term, setTerm } = useSearch();
41
+
42
+ const handleSearch = useCallback((_: string) => setTerm(_), []);
43
+
44
+ const regions: Region[] = cleanUpRegions(useRegions()).sort((a, b) =>
45
+ a.name.localeCompare(b.name),
46
+ );
47
+ const regionsGroupByLetter: Map<string, Region[]> = groupBy(regions, regionFirstLetter);
48
+
49
+ return (
50
+ <div className="absolute h-full w-full inset-0 bg-white text-l-light z-50">
51
+ <CloseButton close={close} />
52
+ <div className="container py-12">
53
+ <CurrentLocation currentLocation={currentLocation} />
54
+ <SearchBar onSearch={handleSearch} searchTerm={term} className="mb-7" />
55
+
56
+ {term && term.length >= SEARCH_TERM_MIN_LENGTH ? (
57
+ <div>
58
+ {regions
59
+ .filter((region) => region.name?.startsWith(term))
60
+ .map(renderRegion({ onChangeLocation, close }))}
61
+ </div>
62
+ ) : (
63
+ <div className="columns-5">
64
+ {Array.from(regionsGroupByLetter.entries()).map(
65
+ renderRegionGroup({ onChangeLocation, close }),
66
+ )}
67
+ </div>
68
+ )}
69
+
70
+ <ForeignOffices foreignOffices={foreignOffices} />
71
+ </div>
72
+ </div>
73
+ );
74
+ },
75
+ );
76
+
77
+ const regionFirstLetter = (region: Region) => region.name?.charAt(0) || '';
78
+
79
+ const cleanUpRegions = (regions: Region[]) =>
80
+ regions.map((region) => ({
81
+ ...region,
82
+ name: region.name?.replace(/республика|область|край'/gi, '').trim() || '',
83
+ }));
84
+
85
+ const CurrentLocation = JSX<CurrentLocationProps>(({ currentLocation }) =>
86
+ currentLocation ? (
87
+ <div className="mb-4">
88
+ <Text size="text-l" font="font-light">
89
+ Сейчас выбран:&nbsp;
90
+ </Text>
91
+ <button className="cursor-pointer" onClick={close}>
92
+ <Text color="text-green">{currentLocation.name}</Text>
93
+ </button>
94
+ </div>
95
+ ) : null,
96
+ );
97
+
98
+ const CloseButton = JSX<CloseButtonProps>(({ close }) => (
99
+ <button
100
+ className="visible peer-placeholder-shown:invisible absolute top-6 right-6 w-6 h-6 p-1 bg-transparent cursor-pointer border-none"
101
+ onClick={(e) => {
102
+ e.preventDefault();
103
+ close && close();
104
+ }}
105
+ >
106
+ <Img image="CloseIcon" width="24" height="24" />
107
+ </button>
108
+ ));
109
+
110
+ const renderRegionGroup =
111
+ ({ onChangeLocation, close }: RegionLinkProps & CloseButtonProps) =>
112
+ ([letter, regions]: [string, Region[]]) =>
113
+ (
114
+ <div key={letter} className="break-inside-avoid mb-7 w-[224px]">
115
+ <div className="mb-2.5">
116
+ <Text size="text-h6">{letter}</Text>
117
+ </div>
118
+ {regions.map(renderRegion({ onChangeLocation, close }))}
119
+ </div>
120
+ );
121
+
122
+ const renderRegion =
123
+ ({ onChangeLocation, close }: RegionLinkProps & CloseButtonProps) =>
124
+ (region: Region) =>
125
+ (
126
+ <div key={region.id} className="mb-1">
127
+ <button
128
+ className="cursor-pointer hover:text-primary-hover"
129
+ onClick={() => {
130
+ onChangeLocation && onChangeLocation(region);
131
+ close && close();
132
+ }}
133
+ >
134
+ {region.name}
135
+ </button>
136
+ </div>
137
+ );
138
+
139
+ const ForeignOffices = JSX<ForeignOfficeProps>(({ foreignOffices }) =>
140
+ foreignOffices?.length ? (
141
+ <div className="border-t border-main-divider mt-7 pt-7">
142
+ <div className="mb-4">
143
+ <Text size="text-m-light" color="text-secondary-text">
144
+ Представительства за рубежом:
145
+ </Text>
146
+ </div>
147
+ <div className="flex gap-10">
148
+ {foreignOffices.map((office, i: number) => (
149
+ <ForeignOffice key={String(i)} {...office} />
150
+ ))}
151
+ </div>
152
+ </div>
153
+ ) : null,
154
+ );
155
+
156
+ const ForeignOffice = JSX<ForeignOffice>(({ icon, ...rest }) => {
157
+ const link = useLink();
158
+ const { text, target, href, onClick } = link(rest);
159
+
160
+ return (
161
+ <div className="flex gap-x-3">
162
+ <Img image={icon} />
163
+ <a className="hover:text-primary-hover" href={href} target={target} onClick={onClick}>
164
+ {text}
165
+ </a>
166
+ </div>
167
+ );
168
+ });
@@ -0,0 +1,30 @@
1
+ import { JSX } from '@redneckz/uni-jsx';
2
+
3
+ export interface SearchBarInnerProps {
4
+ className?: string;
5
+ searchTerm?: string;
6
+ onSearch: (_: string) => void;
7
+ }
8
+
9
+ export const SearchBar = JSX<SearchBarInnerProps>(({ className, searchTerm, onSearch }) => {
10
+ return (
11
+ <form className={`font-sans relative ${className}`}>
12
+ <div className="absolute rounded h-full flex items-center justify-center pl-4 max-w-[170px] gap-3.5 pointer-events-none">
13
+ {searchTerm ? null : (
14
+ <label htmlFor="search-bar-input" className={`text-secondary-text `}>
15
+ Поиск по филиалам
16
+ </label>
17
+ )}
18
+ </div>
19
+ <input
20
+ id="search-bar-input"
21
+ className={`h-12 pl-4 w-full peer text-l text-black border border-solid rounded-md box-border
22
+ outline-none border-main-stroke hover:border-primary-hover active:border-primary-text focus:border-primary-text`}
23
+ value={searchTerm}
24
+ onChange={(e) => onSearch(e.target.value as string)}
25
+ type="text"
26
+ name="location-search-bar-input"
27
+ />
28
+ </form>
29
+ );
30
+ });
@@ -0,0 +1,8 @@
1
+ import { JSX } from '@redneckz/uni-jsx';
2
+ import type { MarkdownTextProps } from './MarkdownTextProps';
3
+
4
+ export const MarkdownText = JSX<MarkdownTextProps>((props) => {
5
+ const { md = '' } = props;
6
+
7
+ return <div className="md-container" dangerouslySetInnerHTML={{ __html: md }} />;
8
+ });
@@ -0,0 +1,6 @@
1
+ type Markdown = string;
2
+
3
+ export interface MarkdownTextProps {
4
+ /** @title Текст */
5
+ md?: Markdown;
6
+ }
@@ -29,7 +29,7 @@ export const SwipeListContainer = JSX<SwipeListContainerProps>(
29
29
  className = '',
30
30
  containerRef,
31
31
  activeIndex,
32
- visibleItemCount,
32
+ visibleItemCount = 0,
33
33
  gap = 0,
34
34
  padding = 0,
35
35
  snapAlign = 'snap-center',
@@ -54,11 +54,15 @@ export const SwipeListContainer = JSX<SwipeListContainerProps>(
54
54
  },
55
55
  [onVisibleItemsChange, onVisibleIndicesChange],
56
56
  );
57
+ const additionPadding = visibleItemCount > 0 ? gap * Number(visibleItemCount) - 1 : 0;
57
58
 
58
59
  return (
59
60
  <div
60
61
  className={`box-border overflow-auto flex horizontal-list no-scrollbar ${className}`}
61
- style={{ ...getContainerStyle(padding), gap: `${gap}px` }}
62
+ style={{
63
+ ...getContainerStyle(padding, additionPadding),
64
+ gap: `${gap}px`,
65
+ }}
62
66
  role="list"
63
67
  ref={containerRef}
64
68
  >
@@ -83,11 +87,11 @@ export const SwipeListContainer = JSX<SwipeListContainerProps>(
83
87
  );
84
88
 
85
89
  // Styles used to compensate outer container padding to get rid of clipping effect
86
- const getContainerStyle = (padding: number): Record<string, string> => ({
90
+ const getContainerStyle = (padding: number, additionalPadding = 0): Record<string, string> => ({
87
91
  marginLeft: `${-padding}px`,
88
92
  marginRight: `${-padding}px`,
89
93
  paddingLeft: `${padding}px`,
90
- paddingRight: `${padding}px`,
94
+ paddingRight: `${padding + additionalPadding}px`,
91
95
  });
92
96
 
93
97
  const getVisibleIndices = (itemsVisibilityList: ItemsVisibilityList) =>
@@ -8,10 +8,8 @@ interface TextProps {
8
8
  font?: FontWeight;
9
9
  }
10
10
 
11
- export const Text = JSX<TextProps>((props) => {
12
- const { size = '', color = '', align = '', font = '', children } = props;
13
-
14
- const textClasses = `font-sans ${size} ${color} ${align} ${font}`;
15
-
16
- return <span className={textClasses}>{children}</span>;
17
- });
11
+ export const Text = JSX<TextProps>(({ size, color, align, font, children }) => (
12
+ <span className={['font-sans', size, color, align, font].filter(Boolean).join(' ')}>
13
+ {children}
14
+ </span>
15
+ ));
@@ -0,0 +1,10 @@
1
+ export const groupBy = <K, V>(list: Array<V>, keyGetter: (input: V) => K): Map<K, Array<V>> => {
2
+ const map = new Map<K, Array<V>>();
3
+ list.forEach((item) => {
4
+ const key = keyGetter(item);
5
+ const collection = map.get(key);
6
+ map.set(key, [...(collection || []), item]);
7
+ });
8
+
9
+ return map;
10
+ };
@@ -1 +0,0 @@
1
- export declare function useGeolocation(defaultLocation: string): [string, () => void];
@@ -1 +0,0 @@
1
- export declare function useGeolocation(defaultLocation: string): [string, () => void];