@redneckz/wildless-cms-uni-blocks 0.2.44 → 0.2.47

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 (319) hide show
  1. package/dist/BenefitsBlock.d.ts +2 -8
  2. package/dist/BenefitsBlock.js +4 -26
  3. package/dist/BenefitsBlock.js.map +1 -1
  4. package/dist/Blocks.d.ts +3 -0
  5. package/dist/Blocks.js +11 -5
  6. package/dist/Blocks.js.map +1 -1
  7. package/dist/ContentPage.d.ts +3 -4
  8. package/dist/ContentPage.js +5 -5
  9. package/dist/ContentPage.js.map +1 -1
  10. package/dist/ContentPageContext.d.ts +6 -3
  11. package/dist/ExchangeRateTile.d.ts +7 -0
  12. package/dist/ExchangeRateTile.js +32 -0
  13. package/dist/ExchangeRateTile.js.map +1 -0
  14. package/dist/Footer/Contacts.d.ts +2 -2
  15. package/dist/Footer/Footer.d.ts +2 -4
  16. package/dist/Footer/Footer.js +2 -2
  17. package/dist/Footer/Footer.js.map +1 -1
  18. package/dist/Footer/FooterLink.d.ts +2 -2
  19. package/dist/Footer/Sitemap.d.ts +2 -2
  20. package/dist/Footer/Sitemap.js +2 -1
  21. package/dist/Footer/Sitemap.js.map +1 -1
  22. package/dist/Footer/SocialMedia.d.ts +2 -2
  23. package/dist/Footer/SocialMedia.js +6 -6
  24. package/dist/Footer/SocialMedia.js.map +1 -1
  25. package/dist/Footer/index.d.ts +2 -0
  26. package/dist/Footer/index.js +5 -0
  27. package/dist/Footer/index.js.map +1 -0
  28. package/dist/Header/Header.d.ts +2 -2
  29. package/dist/Header/Header.js +4 -3
  30. package/dist/Header/Header.js.map +1 -1
  31. package/dist/Header/HeaderSecondaryMenu.js +1 -1
  32. package/dist/Header/HeaderSecondaryMenu.js.map +1 -1
  33. package/dist/Header/HeaderSecondaryMenuButton.d.ts +1 -0
  34. package/dist/Header/HeaderSecondaryMenuButton.js +1 -1
  35. package/dist/Header/HeaderSecondaryMenuButton.js.map +1 -1
  36. package/dist/Icons/ActualBalanceIcon.d.ts +1 -1
  37. package/dist/Icons/CalendarIcon.d.ts +1 -1
  38. package/dist/Icons/ClockIcon.d.ts +1 -1
  39. package/dist/Icons/ComfortableCompIcon.d.ts +1 -1
  40. package/dist/Icons/DollarIcon.d.ts +1 -0
  41. package/dist/Icons/DollarIcon.js +6 -0
  42. package/dist/Icons/DollarIcon.js.map +1 -0
  43. package/dist/Icons/EmptyWalletIcon.d.ts +1 -1
  44. package/dist/Icons/EuroIcon.d.ts +1 -0
  45. package/dist/Icons/EuroIcon.js +6 -0
  46. package/dist/Icons/EuroIcon.js.map +1 -0
  47. package/dist/Icons/GridIcon.d.ts +1 -1
  48. package/dist/Icons/LoupeIcon.d.ts +1 -1
  49. package/dist/Icons/NewDocIcon.d.ts +1 -1
  50. package/dist/Icons/OkIcon.d.ts +1 -1
  51. package/dist/Icons/PassSendIcon.d.ts +1 -1
  52. package/dist/Icons/PercentageSquareIcon.d.ts +1 -1
  53. package/dist/Icons/ProfileIcon.d.ts +1 -1
  54. package/dist/Icons/SignDocsIcon.d.ts +1 -1
  55. package/dist/Icons/TelegramIcon.d.ts +1 -1
  56. package/dist/Icons/VKIcon.d.ts +1 -1
  57. package/dist/Icons/index.d.ts +17 -16
  58. package/dist/Icons/index.js +26 -22
  59. package/dist/Icons/index.js.map +1 -1
  60. package/dist/Img.js +1 -1
  61. package/dist/Img.js.map +1 -1
  62. package/dist/LikeControl.d.ts +2 -2
  63. package/dist/LikeControl.js +1 -1
  64. package/dist/LikeControl.js.map +1 -1
  65. package/dist/MobileAppTile.d.ts +8 -0
  66. package/dist/MobileAppTile.js +9 -0
  67. package/dist/MobileAppTile.js.map +1 -0
  68. package/dist/Placeholder.d.ts +3 -1
  69. package/dist/Placeholder.js +9 -2
  70. package/dist/Placeholder.js.map +1 -1
  71. package/dist/ProductBlock.d.ts +3 -9
  72. package/dist/ProductBlock.js +1 -1
  73. package/dist/ProductBlock.js.map +1 -1
  74. package/dist/ProductBlockInner.d.ts +2 -8
  75. package/dist/ProductBlockInner.js +4 -26
  76. package/dist/ProductBlockInner.js.map +1 -1
  77. package/dist/ProductGallery.d.ts +3 -5
  78. package/dist/ProductGallery.js +3 -3
  79. package/dist/ProductGallery.js.map +1 -1
  80. package/dist/ProjectSettings.d.ts +18 -0
  81. package/dist/ProjectSettings.js +30 -0
  82. package/dist/ProjectSettings.js.map +1 -0
  83. package/dist/StepsBlock.d.ts +9 -4
  84. package/dist/StepsBlock.js +4 -26
  85. package/dist/StepsBlock.js.map +1 -1
  86. package/dist/Tile.d.ts +2 -2
  87. package/dist/Tile.js +15 -7
  88. package/dist/Tile.js.map +1 -1
  89. package/dist/index.d.ts +5 -3
  90. package/dist/index.js +7 -5
  91. package/dist/index.js.map +1 -1
  92. package/dist/types.d.ts +6 -1
  93. package/dist/ui-kit/Button.d.ts +1 -0
  94. package/dist/ui-kit/Button.js +4 -4
  95. package/dist/ui-kit/Button.js.map +1 -1
  96. package/dist/ui-kit/LikeButton.d.ts +1 -0
  97. package/dist/ui-kit/LikeButton.js +1 -1
  98. package/dist/ui-kit/LikeButton.js.map +1 -1
  99. package/dist/ui-kit/SearchBar.d.ts +2 -2
  100. package/dist/ui-kit/SearchBar.js.map +1 -1
  101. package/dist/ui-kit/TopItem.d.ts +1 -0
  102. package/dist/ui-kit/TopItem.js +2 -2
  103. package/dist/ui-kit/TopItem.js.map +1 -1
  104. package/dist/useLink.d.ts +1 -0
  105. package/dist/useLink.js +1 -0
  106. package/dist/useLink.js.map +1 -1
  107. package/dist/useSitemap.d.ts +3 -0
  108. package/dist/useSitemap.js +16 -0
  109. package/dist/useSitemap.js.map +1 -0
  110. package/dist/utils/url.d.ts +4 -4
  111. package/fonts/ubuntu/ubuntu.css +51 -32
  112. package/lib/BenefitsBlock.d.ts +2 -8
  113. package/lib/BenefitsBlock.js +4 -3
  114. package/lib/BenefitsBlock.js.map +1 -1
  115. package/lib/Blocks.d.ts +3 -0
  116. package/lib/Blocks.js +9 -3
  117. package/lib/Blocks.js.map +1 -1
  118. package/lib/ContentPage.d.ts +3 -4
  119. package/lib/ContentPage.js +5 -5
  120. package/lib/ContentPage.js.map +1 -1
  121. package/lib/ContentPageContext.d.ts +6 -3
  122. package/lib/ExchangeRateTile.d.ts +7 -0
  123. package/lib/ExchangeRateTile.js +30 -0
  124. package/lib/ExchangeRateTile.js.map +1 -0
  125. package/lib/Footer/Contacts.d.ts +2 -2
  126. package/lib/Footer/Footer.d.ts +2 -4
  127. package/lib/Footer/Footer.js +2 -2
  128. package/lib/Footer/Footer.js.map +1 -1
  129. package/lib/Footer/FooterLink.d.ts +2 -2
  130. package/lib/Footer/Sitemap.d.ts +2 -2
  131. package/lib/Footer/Sitemap.js +2 -1
  132. package/lib/Footer/Sitemap.js.map +1 -1
  133. package/lib/Footer/SocialMedia.d.ts +2 -2
  134. package/lib/Footer/SocialMedia.js +6 -6
  135. package/lib/Footer/SocialMedia.js.map +1 -1
  136. package/lib/Footer/index.d.ts +2 -0
  137. package/lib/Footer/index.js +2 -0
  138. package/lib/Footer/index.js.map +1 -0
  139. package/lib/Header/Header.d.ts +2 -2
  140. package/lib/Header/Header.js +4 -3
  141. package/lib/Header/Header.js.map +1 -1
  142. package/lib/Header/HeaderSecondaryMenu.js +1 -1
  143. package/lib/Header/HeaderSecondaryMenu.js.map +1 -1
  144. package/lib/Header/HeaderSecondaryMenuButton.d.ts +1 -0
  145. package/lib/Header/HeaderSecondaryMenuButton.js +1 -1
  146. package/lib/Header/HeaderSecondaryMenuButton.js.map +1 -1
  147. package/lib/Icons/ActualBalanceIcon.d.ts +1 -1
  148. package/lib/Icons/CalendarIcon.d.ts +1 -1
  149. package/lib/Icons/ClockIcon.d.ts +1 -1
  150. package/lib/Icons/ComfortableCompIcon.d.ts +1 -1
  151. package/lib/Icons/DollarIcon.d.ts +1 -0
  152. package/lib/Icons/DollarIcon.js +3 -0
  153. package/lib/Icons/DollarIcon.js.map +1 -0
  154. package/lib/Icons/EmptyWalletIcon.d.ts +1 -1
  155. package/lib/Icons/EuroIcon.d.ts +1 -0
  156. package/lib/Icons/EuroIcon.js +3 -0
  157. package/lib/Icons/EuroIcon.js.map +1 -0
  158. package/lib/Icons/GridIcon.d.ts +1 -1
  159. package/lib/Icons/LoupeIcon.d.ts +1 -1
  160. package/lib/Icons/NewDocIcon.d.ts +1 -1
  161. package/lib/Icons/OkIcon.d.ts +1 -1
  162. package/lib/Icons/PassSendIcon.d.ts +1 -1
  163. package/lib/Icons/PercentageSquareIcon.d.ts +1 -1
  164. package/lib/Icons/ProfileIcon.d.ts +1 -1
  165. package/lib/Icons/SignDocsIcon.d.ts +1 -1
  166. package/lib/Icons/TelegramIcon.d.ts +1 -1
  167. package/lib/Icons/VKIcon.d.ts +1 -1
  168. package/lib/Icons/index.d.ts +17 -16
  169. package/lib/Icons/index.js +17 -16
  170. package/lib/Icons/index.js.map +1 -1
  171. package/lib/Img.js +1 -1
  172. package/lib/Img.js.map +1 -1
  173. package/lib/LikeControl.d.ts +2 -2
  174. package/lib/LikeControl.js +1 -1
  175. package/lib/LikeControl.js.map +1 -1
  176. package/lib/MobileAppTile.d.ts +8 -0
  177. package/lib/MobileAppTile.js +7 -0
  178. package/lib/MobileAppTile.js.map +1 -0
  179. package/lib/Placeholder.d.ts +3 -1
  180. package/lib/Placeholder.js +9 -2
  181. package/lib/Placeholder.js.map +1 -1
  182. package/lib/ProductBlock.d.ts +3 -9
  183. package/lib/ProductBlock.js +1 -1
  184. package/lib/ProductBlock.js.map +1 -1
  185. package/lib/ProductBlockInner.d.ts +2 -8
  186. package/lib/ProductBlockInner.js +4 -3
  187. package/lib/ProductBlockInner.js.map +1 -1
  188. package/lib/ProductGallery.d.ts +3 -5
  189. package/lib/ProductGallery.js +3 -3
  190. package/lib/ProductGallery.js.map +1 -1
  191. package/lib/ProjectSettings.d.ts +18 -0
  192. package/lib/ProjectSettings.js +28 -0
  193. package/lib/ProjectSettings.js.map +1 -0
  194. package/lib/StepsBlock.d.ts +9 -4
  195. package/lib/StepsBlock.js +4 -3
  196. package/lib/StepsBlock.js.map +1 -1
  197. package/lib/Tile.d.ts +2 -2
  198. package/lib/Tile.js +15 -7
  199. package/lib/Tile.js.map +1 -1
  200. package/lib/common.css +1 -1
  201. package/lib/index.d.ts +5 -3
  202. package/lib/index.js +3 -2
  203. package/lib/index.js.map +1 -1
  204. package/lib/types.d.ts +6 -1
  205. package/lib/ui-kit/Button.d.ts +1 -0
  206. package/lib/ui-kit/Button.js +4 -4
  207. package/lib/ui-kit/Button.js.map +1 -1
  208. package/lib/ui-kit/LikeButton.d.ts +1 -0
  209. package/lib/ui-kit/LikeButton.js +1 -1
  210. package/lib/ui-kit/LikeButton.js.map +1 -1
  211. package/lib/ui-kit/SearchBar.d.ts +2 -2
  212. package/lib/ui-kit/SearchBar.js.map +1 -1
  213. package/lib/ui-kit/TopItem.d.ts +1 -0
  214. package/lib/ui-kit/TopItem.js +2 -2
  215. package/lib/ui-kit/TopItem.js.map +1 -1
  216. package/lib/useLink.d.ts +1 -0
  217. package/lib/useLink.js +1 -0
  218. package/lib/useLink.js.map +1 -1
  219. package/lib/useSitemap.d.ts +3 -0
  220. package/lib/useSitemap.js +13 -0
  221. package/lib/useSitemap.js.map +1 -0
  222. package/lib/utils/url.d.ts +4 -4
  223. package/package.json +43 -19
  224. package/src/BenefitsBlock.fixture.tsx +34 -0
  225. package/src/BenefitsBlock.tsx +45 -0
  226. package/src/Blocks.ts +23 -0
  227. package/src/ContentPage.fixture.tsx +38 -0
  228. package/src/ContentPage.page.json +540 -0
  229. package/src/ContentPage.tsx +83 -0
  230. package/src/ContentPageContext.tsx +34 -0
  231. package/src/ContentPageHead.tsx +26 -0
  232. package/src/ExchangeRateTile.fixture.tsx +11 -0
  233. package/src/ExchangeRateTile.tsx +80 -0
  234. package/src/Footer/Contacts.tsx +71 -0
  235. package/src/Footer/Footer.fixture.tsx +265 -0
  236. package/src/Footer/Footer.tsx +46 -0
  237. package/src/Footer/FooterLink.ts +6 -0
  238. package/src/Footer/HorizontalNavigation.tsx +46 -0
  239. package/src/Footer/Sitemap.tsx +55 -0
  240. package/src/Footer/SocialMedia.tsx +46 -0
  241. package/src/Footer/TextInformation.tsx +50 -0
  242. package/src/Footer/index.ts +2 -0
  243. package/src/Header/Header.fixture.tsx +21 -0
  244. package/src/Header/Header.tsx +55 -0
  245. package/src/Header/HeaderContent.ts +6 -0
  246. package/src/Header/HeaderSecondaryMenu.tsx +42 -0
  247. package/src/Header/HeaderSecondaryMenuButton.tsx +21 -0
  248. package/src/Header/index.ts +3 -0
  249. package/src/Header/isSubItemActive.ts +9 -0
  250. package/src/Header/isTopItemActive.ts +13 -0
  251. package/src/Icons/ActualBalanceIcon.tsx +202 -0
  252. package/src/Icons/CalendarIcon.tsx +19 -0
  253. package/src/Icons/ClockIcon.tsx +212 -0
  254. package/src/Icons/ComfortableCompIcon.tsx +379 -0
  255. package/src/Icons/DollarIcon.tsx +12 -0
  256. package/src/Icons/EmptyWalletIcon.tsx +25 -0
  257. package/src/Icons/EuroIcon.tsx +12 -0
  258. package/src/Icons/GridIcon.tsx +9 -0
  259. package/src/Icons/LoupeIcon.tsx +11 -0
  260. package/src/Icons/NewDocIcon.tsx +262 -0
  261. package/src/Icons/OkIcon.tsx +8 -0
  262. package/src/Icons/PassSendIcon.tsx +250 -0
  263. package/src/Icons/PercentageSquareIcon.tsx +18 -0
  264. package/src/Icons/ProfileIcon.tsx +18 -0
  265. package/src/Icons/SignDocsIcon.tsx +295 -0
  266. package/src/Icons/TelegramIcon.tsx +8 -0
  267. package/src/Icons/VKIcon.tsx +10 -0
  268. package/src/Icons/index.ts +17 -0
  269. package/src/Img.tsx +22 -0
  270. package/src/LikeControl.fixture.tsx +5 -0
  271. package/src/LikeControl.tsx +23 -0
  272. package/src/MobileAppTile.fixture.tsx +15 -0
  273. package/src/MobileAppTile.tsx +34 -0
  274. package/src/Placeholder.fixture.tsx +5 -0
  275. package/src/Placeholder.tsx +33 -0
  276. package/src/ProductBlock.fixture.tsx +95 -0
  277. package/src/ProductBlock.tsx +15 -0
  278. package/src/ProductBlockInner.tsx +110 -0
  279. package/src/ProductGallery.fixture.tsx +138 -0
  280. package/src/ProductGallery.tsx +90 -0
  281. package/src/ProjectSettings.ts +38 -0
  282. package/src/StepsBlock.fixture.tsx +23 -0
  283. package/src/StepsBlock.tsx +51 -0
  284. package/src/Tile.fixture.tsx +124 -0
  285. package/src/Tile.tsx +89 -0
  286. package/src/api/LikeAPI.ts +141 -0
  287. package/src/common.css +39 -0
  288. package/src/content-page-repository/ContentPageRepository.ts +38 -0
  289. package/src/content-page-repository/TransformationOptions.ts +4 -0
  290. package/src/content-page-repository/index.ts +1 -0
  291. package/src/content-page-repository/mapJSON.spec.ts +28 -0
  292. package/src/content-page-repository/mapJSON.ts +23 -0
  293. package/src/content-page-repository/transformContentPage.ts +26 -0
  294. package/src/content-page-repository/transformMarkdown.ts +10 -0
  295. package/src/content-page-repository/transformPicture.ts +61 -0
  296. package/src/cosmos.decorator.tsx +19 -0
  297. package/src/index.ts +19 -0
  298. package/src/mergeTopItems.spec.ts +20 -0
  299. package/src/mergeTopItems.ts +13 -0
  300. package/src/setup-fixture.ts +49 -0
  301. package/src/types.ts +109 -0
  302. package/src/ui-kit/BlockItem.fixture.tsx +5 -0
  303. package/src/ui-kit/BlockItem.tsx +36 -0
  304. package/src/ui-kit/Breadcrumb.tsx +26 -0
  305. package/src/ui-kit/Button.fixture.tsx +113 -0
  306. package/src/ui-kit/Button.tsx +66 -0
  307. package/src/ui-kit/HeaderItem.fixture.tsx +8 -0
  308. package/src/ui-kit/HeaderItem.tsx +25 -0
  309. package/src/ui-kit/LikeButton.fixture.tsx +6 -0
  310. package/src/ui-kit/LikeButton.tsx +41 -0
  311. package/src/ui-kit/Logo.fixture.tsx +5 -0
  312. package/src/ui-kit/Logo.tsx +35 -0
  313. package/src/ui-kit/SVG.tsx +32 -0
  314. package/src/ui-kit/SearchBar.tsx +33 -0
  315. package/src/ui-kit/TopItem.fixture.tsx +8 -0
  316. package/src/ui-kit/TopItem.tsx +37 -0
  317. package/src/useLink.ts +28 -0
  318. package/src/useSitemap.ts +17 -0
  319. package/src/utils/url.ts +22 -0
@@ -0,0 +1,110 @@
1
+ import { JSX } from '@redneckz/uni-jsx';
2
+ import { EmptyWalletIcon, PercentageSquareIcon, CalendarIcon } from './Icons/index';
3
+ import { Img } from './Img';
4
+ import type { Picture, UniBlockProps, Benefit } from './types';
5
+ import { BlockItem } from './ui-kit/BlockItem';
6
+ import type { ButtonProps } from './ui-kit/Button';
7
+ import { Button } from './ui-kit/Button';
8
+ import { Breadcrumb, BreadcrumbProps } from './ui-kit/Breadcrumb';
9
+ import { useLink } from './useLink';
10
+
11
+ const ICONS = { EmptyWalletIcon, PercentageSquareIcon, CalendarIcon };
12
+
13
+ export interface ProductBlockInnerContent {
14
+ title?: string;
15
+ description?: string;
16
+ breadcrumbs?: BreadcrumbProps[];
17
+ image?: Picture;
18
+ benefits?: Benefit[];
19
+ items?: string[];
20
+ buttons?: ButtonProps[];
21
+ }
22
+
23
+ export interface ProductBlockInnerProps extends ProductBlockInnerContent, UniBlockProps {}
24
+
25
+ export const ProductBlockInner = JSX<ProductBlockInnerProps>(
26
+ ({ className, context, title, description, breadcrumbs, benefits, buttons, image, items }) => {
27
+ const router = context.useRouter();
28
+ const { handlerDecorator } = context;
29
+
30
+ return (
31
+ <div className={`font-sans flex justify-between items-stretch ${className || ''}`}>
32
+ <div className="flex flex-col">
33
+ {breadcrumbs?.length ? (
34
+ <div className="text-xs mb-6">
35
+ {join(<span className="text-secondary-text mx-2">/</span>)(
36
+ breadcrumbs.map((breadcrumb, i) => (
37
+ <Breadcrumb
38
+ key={String(i)}
39
+ {...useLink(
40
+ { router, handlerDecorator },
41
+ { className: 'text-secondary-text', ...breadcrumb },
42
+ )}
43
+ />
44
+ )),
45
+ )}
46
+ </div>
47
+ ) : null}
48
+ {title && (
49
+ <h1 className="font-medium text-title-lg m-0 whitespace-pre-wrap max-w-[600px]">
50
+ {title}
51
+ </h1>
52
+ )}
53
+ {description && (
54
+ <div className="font-normal text-base max-w-[600px] mt-4">{description}</div>
55
+ )}
56
+ {benefits?.length ? (
57
+ <div className="flex gap-6 mt-7">{benefits.map(renderBenefit)}</div>
58
+ ) : null}
59
+ {items?.length ? (
60
+ <section className="space-y-2.5 mt-5" role="list">
61
+ {items.map((_, i) => (
62
+ <BlockItem key={String(i)} text={_} />
63
+ ))}
64
+ </section>
65
+ ) : null}
66
+ {buttons?.length ? (
67
+ <div className="flex mt-auto gap-4">
68
+ {buttons.map((button, index) =>
69
+ renderButton(useLink({ router, handlerDecorator }, button), index),
70
+ )}
71
+ </div>
72
+ ) : null}
73
+ </div>
74
+ {image?.src && <Img image={image} className="mt-auto" />}
75
+ </div>
76
+ );
77
+ },
78
+ );
79
+
80
+ function renderBenefit(benefit: Benefit, i: number) {
81
+ return (
82
+ <div key={String(i)} className="flex gap-4 items-center">
83
+ {benefit.icon && (
84
+ <div className="w-[50px] h-[50px] min-w-[50px] min-h-[50px] bg-main rounded-full p-[10px] box-border">
85
+ {ICONS[benefit.icon as keyof typeof ICONS]?.()}
86
+ </div>
87
+ )}
88
+ <div className="flex gap-1 flex-col h-full">
89
+ <h4 className="font-medium text-xl m-0">{benefit.label}</h4>
90
+ {benefit.description && (
91
+ <div className="font-normal text-sm text-secondary-text">{benefit.description}</div>
92
+ )}
93
+ </div>
94
+ </div>
95
+ );
96
+ }
97
+
98
+ function renderButton(button: ButtonProps, i: number) {
99
+ return button?.text ? (
100
+ <Button key={String(i)} {...button} className="mt-8" version={button.version} />
101
+ ) : null;
102
+ }
103
+
104
+ function join<E>(sep: E): (list: E[]) => E[] {
105
+ return (list) =>
106
+ list.reduce(
107
+ (acc, el, i) => (acc.length ? acc.concat({ ...sep, key: i }, el) : [el]),
108
+ [] as E[],
109
+ );
110
+ }
@@ -0,0 +1,138 @@
1
+ import { context } from './setup-fixture';
2
+
3
+ import { ProductGallery } from './ProductGallery';
4
+ import { Picture } from './types';
5
+
6
+ const moneyImage: Picture = {
7
+ src: 'money-1.png',
8
+ format: 'webp',
9
+ size: {
10
+ width: 300,
11
+ height: 300,
12
+ },
13
+ };
14
+
15
+ const worker: Picture = {
16
+ src: 'worker.png',
17
+ format: 'webp',
18
+ size: {
19
+ width: 300,
20
+ height: 300,
21
+ },
22
+ };
23
+
24
+ const creditCard: Picture = {
25
+ src: 'credit-card-1.png',
26
+ format: 'webp',
27
+ size: {
28
+ width: 300,
29
+ height: 300,
30
+ },
31
+ };
32
+
33
+ export default (
34
+ <ProductGallery
35
+ context={context}
36
+ slides={[
37
+ {
38
+ nav: {
39
+ title: 'Деньги на любые цели',
40
+ desc: 'Ставка от 12,5% годовых на срок до 5 лет',
41
+ },
42
+ productBlock: {
43
+ title: 'Ставка от 12,5% годовых на срок до 5 лет!»',
44
+ description:
45
+ 'Кредит наличными без залога и поручительства. Потребительский кредит на любые цели. Нужен только паспорт.',
46
+ items: [
47
+ 'Потребительский кредит по специальной процентной ставке',
48
+ 'Получите деньги без залога и поручительства',
49
+ 'Кредитный лимит до 5 млн рублей',
50
+ ],
51
+ buttons: [
52
+ {
53
+ href: 'https://rshb.ru',
54
+ text: 'Подробнее',
55
+ target: '_blank',
56
+ version: 'primary',
57
+ },
58
+ ],
59
+ image: moneyImage,
60
+ },
61
+ },
62
+ {
63
+ nav: {
64
+ title: 'Для людей в возрасте',
65
+ desc: 'Ставка от 12,5% годовых на срок до 3 лет',
66
+ },
67
+ productBlock: {
68
+ title: 'Ставка от 12,5% годовых на срок до 3 лет!»',
69
+ description:
70
+ 'Кредит наличными без залога и поручительства. Потребительский кредит на любые цели. Нужен только паспорт.',
71
+ items: [
72
+ 'Потребительский кредит по специальной процентной ставке',
73
+ 'Получите деньги без залога и поручительства',
74
+ 'Кредитный лимит до 5 млн рублей',
75
+ ],
76
+ buttons: [
77
+ {
78
+ href: 'https://rshb.ru',
79
+ text: 'Подробнее',
80
+ target: '_blank',
81
+ version: 'primary',
82
+ },
83
+ ],
84
+ image: worker,
85
+ },
86
+ },
87
+ {
88
+ nav: {
89
+ title: 'Выгодно покупать',
90
+ desc: 'Дополнительные бонусные баллы за покупки',
91
+ },
92
+ productBlock: {
93
+ title: 'Дополнительные бонусные баллы за покупки!»',
94
+ description:
95
+ 'Кредит наличными без залога и поручительства. Потребительский кредит на любые цели. Нужен только паспорт.',
96
+ items: [
97
+ 'Потребительский кредит по специальной процентной ставке',
98
+ 'Получите деньги без залога и поручительства',
99
+ 'Кредитный лимит до 5 млн рублей',
100
+ ],
101
+ buttons: [
102
+ {
103
+ href: 'https://rshb.ru',
104
+ text: 'Подробнее',
105
+ target: '_blank',
106
+ version: 'primary',
107
+ },
108
+ ],
109
+ image: creditCard,
110
+ },
111
+ },
112
+ {
113
+ nav: {
114
+ title: 'Карты Unionpay',
115
+ desc: 'Кэшбэк до 20% у партнеров',
116
+ },
117
+ productBlock: {
118
+ title: 'Карты Unionpay»',
119
+ description: 'Кэшбэк до 20% у партнеров',
120
+ items: [
121
+ 'Потребительский кредит по специальной процентной ставке',
122
+ 'Получите деньги без залога и поручительства',
123
+ 'Кредитный лимит до 5 млн рублей',
124
+ ],
125
+ buttons: [
126
+ {
127
+ href: 'https://rshb.ru',
128
+ text: 'Подробнее',
129
+ target: '_blank',
130
+ version: 'primary',
131
+ },
132
+ ],
133
+ image: creditCard,
134
+ },
135
+ },
136
+ ]}
137
+ />
138
+ );
@@ -0,0 +1,90 @@
1
+ import { JSX } from '@redneckz/uni-jsx';
2
+ import type { ProductBlockInnerContent } from './ProductBlockInner';
3
+ import { ProductBlockInner } from './ProductBlockInner';
4
+ import type { UniBlockProps } from './types';
5
+
6
+ interface ProductGalleryNav {
7
+ title: string;
8
+ desc: string;
9
+ }
10
+
11
+ export interface ProductSlideContent {
12
+ nav: ProductGalleryNav;
13
+ productBlock: ProductBlockInnerContent;
14
+ }
15
+
16
+ export interface ProductGalleryContent {
17
+ duration?: number;
18
+ slides?: ProductSlideContent[];
19
+ }
20
+
21
+ export interface ProductGalleryProps extends ProductGalleryContent, UniBlockProps {}
22
+
23
+ export const ProductGallery = JSX<ProductGalleryProps>(
24
+ ({ className, context, duration = 0, slides = [] }) => {
25
+ const galleryNav = slides.map((s) => s.nav);
26
+ const galleryBlocks = slides.map((s) => s.productBlock);
27
+ const [activeSlideIndex, setActiveSlideIndex] = context.useState(0);
28
+
29
+ return (
30
+ <section className={`font-sans bg-white overflow-hidden w-100 ${className || ''}`}>
31
+ <div
32
+ className={`flex transition duration-1000`}
33
+ style={{ transform: `translateX(-${activeSlideIndex}00%)` }}
34
+ role="list"
35
+ >
36
+ {galleryBlocks.map((_, i) => renderProductBlock(_, i, context))}
37
+ </div>
38
+
39
+ <div
40
+ className={`border-0 border-t border-solid border-main-divider grid grid-cols-${galleryNav.length}`}
41
+ >
42
+ {galleryNav.map((slide, i) =>
43
+ renderNavButton({
44
+ slide,
45
+ i,
46
+ activeSlideIndex,
47
+ onClick: () => setActiveSlideIndex(i),
48
+ duration,
49
+ }),
50
+ )}
51
+ </div>
52
+ </section>
53
+ );
54
+ },
55
+ );
56
+
57
+ function renderProductBlock(block: ProductBlockInnerContent, i: number, context) {
58
+ return (
59
+ <section key={String(i)} className="grow-0 shrink-0 basis-full" role="listitem">
60
+ <div className="p-11 pr-[7.5rem] ">
61
+ <ProductBlockInner context={context} {...block} />
62
+ </div>
63
+ </section>
64
+ );
65
+ }
66
+
67
+ function renderNavButton({ slide, i, activeSlideIndex, onClick, duration }) {
68
+ const isActiveBtn = i === activeSlideIndex;
69
+ const progressBarClassName = isActiveBtn ? 'animate-slide' : '';
70
+ const btnTitleClassName = isActiveBtn ? 'text-primary-text' : 'text-secondary-text';
71
+ return (
72
+ <button
73
+ type="button"
74
+ key={String(i)}
75
+ onClick={onClick}
76
+ className={`group relative overflow-hidden border-0 bg-inherit cursor-pointer text-left px-0 py-4`}
77
+ >
78
+ <div className="border-0 border-r border-solid border-main-divider px-6">
79
+ <div className={`text-sm font-medium group-hover:text-primary-text ${btnTitleClassName}`}>
80
+ {slide?.title}
81
+ </div>
82
+ <div className="text-xs text-secondary-text">{slide.desc}</div>
83
+ </div>
84
+ <div
85
+ className={`absolute bottom-0 left-0 w-full h-[3px] bg-primary-main -translate-x-full ${progressBarClassName}`}
86
+ style={{ animationDuration: `${duration}s` }}
87
+ ></div>
88
+ </button>
89
+ );
90
+ }
@@ -0,0 +1,38 @@
1
+ export interface ProjectSettings {
2
+ TEST_BRANCH?: string;
3
+ RC_BRANCH?: string;
4
+ PROD_BRANCH: string;
5
+ FORCED_DRAFT_FLOW: boolean;
6
+ ENABLE_ASSIST?: boolean;
7
+ SITEMAP?: string;
8
+ }
9
+
10
+ export const projectSettings = new (class implements ProjectSettings {
11
+ _: ProjectSettings = {
12
+ PROD_BRANCH: 'master',
13
+ FORCED_DRAFT_FLOW: false,
14
+ };
15
+
16
+ setup(_: ProjectSettings) {
17
+ this._ = _;
18
+ }
19
+
20
+ get TEST_BRANCH() {
21
+ return this._.TEST_BRANCH;
22
+ }
23
+ get RC_BRANCH() {
24
+ return this._.RC_BRANCH;
25
+ }
26
+ get PROD_BRANCH() {
27
+ return this._.PROD_BRANCH;
28
+ }
29
+ get FORCED_DRAFT_FLOW() {
30
+ return this._.FORCED_DRAFT_FLOW;
31
+ }
32
+ get ENABLE_ASSIST() {
33
+ return this._.ENABLE_ASSIST;
34
+ }
35
+ get SITEMAP() {
36
+ return this._.SITEMAP;
37
+ }
38
+ })();
@@ -0,0 +1,23 @@
1
+ import { context } from './setup-fixture';
2
+ import { StepsBlock } from './StepsBlock';
3
+
4
+ export default (
5
+ <StepsBlock
6
+ context={context}
7
+ title="Рассчитайте условия на онлайн-калькуляторе и оставьте заявку на потребительский кредит"
8
+ steps={[
9
+ {
10
+ label: 'Заявка на кредит',
11
+ description: 'Оставьте онлайн-заявку на потребительский кредит',
12
+ },
13
+ {
14
+ label: 'В случае одобрения',
15
+ description: 'Менеджер свяжется с вами и согласует встречу',
16
+ },
17
+ {
18
+ label: 'Получение наличных',
19
+ description: 'Получите наличные в отделении банка',
20
+ },
21
+ ]}
22
+ />
23
+ );
@@ -0,0 +1,51 @@
1
+ import { JSX } from '@redneckz/uni-jsx';
2
+ import { NewDocIcon, PassSendIcon, ActualBalanceIcon } from './Icons/index';
3
+ import type { UniBlockProps } from './types';
4
+
5
+ const ICONS = { NewDocIcon, PassSendIcon, ActualBalanceIcon };
6
+ export interface Step {
7
+ label: string;
8
+ description?: string;
9
+ icon?: keyof typeof ICONS;
10
+ }
11
+
12
+ export interface StepsBlockContent {
13
+ title?: string;
14
+ steps?: Step[];
15
+ }
16
+
17
+ export interface StepsBlockProps extends StepsBlockContent, UniBlockProps {}
18
+
19
+ export const StepsBlock = JSX<StepsBlockProps>(({ className, title, steps }) => {
20
+ return (
21
+ <section
22
+ className={`font-sans text-primary-text bg-white px-12 py-12 flex flex-col items-center ${
23
+ className || ''
24
+ }`}
25
+ >
26
+ <h2 className="font-medium text-title m-0 max-w-[47rem] text-center">{title}</h2>
27
+ {steps?.length ? <div className="flex mt-9">{steps.map(renderStep)}</div> : null}
28
+ </section>
29
+ );
30
+ });
31
+
32
+ const renderStep = (step: Step, i: number) => {
33
+ return (
34
+ <div
35
+ key={String(i)}
36
+ className="flex flex-col items-center text-center px-12 relative after:content-[''] last:after:content-none after:bg-secondary-light after:absolute after:top-[50px] after:h-0.5 after:w-full after:right-[-50%]"
37
+ >
38
+ <div className="h-[100px] w-[100px] min-w-[100px] min-h-[100px] bg-secondary-light rounded-full p-[26px] box-border z-10">
39
+ {(step.icon && ICONS[step.icon]?.({ width: 48, height: 48 })) || (
40
+ <span className="font-medium text-title-sm text-secondary-text">{i + 1}</span>
41
+ )}
42
+ </div>
43
+ <div className="max-w-min">
44
+ <h5 className="font-medium text-xl m-0 mt-4 whitespace-nowrap px-3">{step.label}</h5>
45
+ {step.description && (
46
+ <div className="font-normal text-sm text-secondary-text mt-2">{step.description}</div>
47
+ )}
48
+ </div>
49
+ </div>
50
+ );
51
+ };
@@ -0,0 +1,124 @@
1
+ import { context } from './setup-fixture';
2
+
3
+ import { Tile } from './Tile';
4
+ import { Picture } from './types';
5
+
6
+ const image: Picture = {
7
+ src: 'money-1.png',
8
+ format: 'webp',
9
+ };
10
+
11
+ const image2: Picture = {
12
+ src: 'credit-card-1.png',
13
+ format: 'webp',
14
+ };
15
+
16
+ const image3: Picture = {
17
+ src: 'column-1.png',
18
+ format: 'webp',
19
+ };
20
+
21
+ const image4: Picture = {
22
+ src: 'globe-1.png',
23
+ format: 'webp',
24
+ };
25
+
26
+ export default {
27
+ credit: (
28
+ <div className="grid grid-cols-12">
29
+ <Tile
30
+ context={context}
31
+ className="col-span-8"
32
+ title="Кредиты"
33
+ items={[
34
+ 'Кредитный лимит до 10 млн ₽',
35
+ 'Кредиты наличными на любые цели',
36
+ 'Получите деньги без залога и поручителей',
37
+ ]}
38
+ button={{
39
+ text: 'Подробнее',
40
+ href: '/credit-cards',
41
+ version: 'secondary',
42
+ }}
43
+ image={image}
44
+ />
45
+ </div>
46
+ ),
47
+ mortgage: (
48
+ <div className="grid grid-cols-12">
49
+ <Tile
50
+ context={context}
51
+ version="secondary"
52
+ className="col-span-4"
53
+ title="Ипотека"
54
+ description={
55
+ 'Широкий выбор ипотечных программ с государственной поддержкой. Специальные предложения от 12,2 %'
56
+ }
57
+ button={{
58
+ href: 'https://rshb.ru',
59
+ text: 'Подробнее',
60
+ target: '_blank',
61
+ version: 'secondary',
62
+ }}
63
+ />
64
+ </div>
65
+ ),
66
+ 'credit-card': (
67
+ <div className="grid grid-cols-12">
68
+ <Tile
69
+ context={context}
70
+ className="col-span-6"
71
+ title="Банковские пластиковые карты"
72
+ items={['Счета в разных валютах', 'Бесплатное обслуживание', 'Кэшбэк до 15% от покупок']}
73
+ button={{
74
+ href: 'https://rshb.ru',
75
+ text: 'Подробнее',
76
+ target: '_blank',
77
+ version: 'secondary',
78
+ }}
79
+ image={image2}
80
+ />
81
+ </div>
82
+ ),
83
+ premium: (
84
+ <div className="grid grid-cols-12">
85
+ <Tile
86
+ context={context}
87
+ className="col-span-6"
88
+ title="Премиальные продукты"
89
+ description={
90
+ 'Выделенные зоны обслуживания и персональный финансовый консультант. Полный спектр премиальных продуктов, подчеркивающих ваш статус'
91
+ }
92
+ button={{
93
+ href: 'https://rshb.ru',
94
+ text: 'Подробнее',
95
+ target: '_blank',
96
+ version: 'secondary',
97
+ }}
98
+ image={image3}
99
+ />
100
+ </div>
101
+ ),
102
+ ecosystem: (
103
+ <div className="grid grid-cols-12">
104
+ <Tile
105
+ context={context}
106
+ className="col-span-12 pr-28"
107
+ title="Экосистема «СВОЕ», созданная для людей"
108
+ items={[
109
+ 'Качественные фермерские продукты напрямую от производителей',
110
+ 'Самая большая база сельских туров по России',
111
+ 'Площадки для создания комфортной жизни за городом',
112
+ 'Подробная база вакансий для жителей сельской местности',
113
+ ]}
114
+ button={{
115
+ href: 'https://rshb.ru',
116
+ text: 'Подробнее',
117
+ target: '_blank',
118
+ version: 'secondary',
119
+ }}
120
+ image={image4}
121
+ />
122
+ </div>
123
+ ),
124
+ };
package/src/Tile.tsx ADDED
@@ -0,0 +1,89 @@
1
+ import { JSX } from '@redneckz/uni-jsx';
2
+ import { Img } from './Img';
3
+ import type { BlockVersion, Picture, UniBlockProps } from './types';
4
+ import { BlockItem } from './ui-kit/BlockItem';
5
+ import type { ButtonProps } from './ui-kit/Button';
6
+ import { Button } from './ui-kit/Button';
7
+ import { useLink } from './useLink';
8
+
9
+ export interface TileContent {
10
+ title?: string;
11
+ description?: string;
12
+ image?: Picture;
13
+ items?: string[];
14
+ button?: ButtonProps;
15
+ version?: BlockVersion;
16
+ }
17
+
18
+ export interface TileProps extends TileContent, UniBlockProps {}
19
+
20
+ const tileStyleMap: Record<BlockVersion, string> = {
21
+ primary: 'bg-white text-primary-text',
22
+ secondary: 'bg-primary-main text-white',
23
+ };
24
+
25
+ const TITLE_CLASSES = 'font-medium m-0 whitespace-pre-wrap max-w-[600px]';
26
+
27
+ export const Tile = JSX<TileProps>(
28
+ ({
29
+ className,
30
+ context,
31
+ title,
32
+ description,
33
+ children,
34
+ button,
35
+ image,
36
+ items,
37
+ version = 'primary',
38
+ }) => {
39
+ const router = context.useRouter();
40
+ const { handlerDecorator } = context;
41
+ return (
42
+ <section
43
+ className={`flex flex-col font-sans p-9 ${className || ''} ${tileStyleMap[version]}`}
44
+ >
45
+ {title && renderTitle(title, className)}
46
+ <div className="grow flex justify-between mt-6">
47
+ <div className="flex flex-col justify-between items-start">
48
+ {description || children ? (
49
+ <div className="font-normal text-base max-w-[600px]">{description || children}</div>
50
+ ) : (
51
+ renderItems(items, version)
52
+ )}
53
+ {button?.text && (
54
+ <Button
55
+ className="mt-6"
56
+ {...useLink({ router, handlerDecorator }, button)}
57
+ version="secondary"
58
+ />
59
+ )}
60
+ </div>
61
+ {image?.src && <Img className="mt-auto h-[220px] w-[220px]" image={image} />}
62
+ </div>
63
+ </section>
64
+ );
65
+ },
66
+ );
67
+
68
+ function renderTitle(title: string, className: string = '') {
69
+ const colSpanPrefix = 'col-span-';
70
+ const colSpanStr = className.split(/\s+/).find((_) => _.startsWith(colSpanPrefix));
71
+ const colSpan = colSpanStr ? parseInt(colSpanStr.substring(colSpanPrefix.length), 10) : 12;
72
+ if (colSpan <= 4) {
73
+ return <h3 className={`${TITLE_CLASSES} text-title-xs`}>{title}</h3>;
74
+ } else if (colSpan <= 8) {
75
+ return <h3 className={`${TITLE_CLASSES} text-title-sm`}>{title}</h3>;
76
+ } else {
77
+ return <h2 className={`${TITLE_CLASSES} text-title`}>{title}</h2>;
78
+ }
79
+ }
80
+
81
+ function renderItems(items?: string[], version?: BlockVersion) {
82
+ return items?.length ? (
83
+ <section className="max-w-[600px]" role="list">
84
+ {items.map((_, i) => (
85
+ <BlockItem key={String(i)} className={i ? 'mt-2.5' : ''} text={_} version={version} />
86
+ ))}
87
+ </section>
88
+ ) : null;
89
+ }