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

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 (184) hide show
  1. package/bundle/blocks.schema.json +1 -1
  2. package/bundle/bundle.umd.js +32 -16
  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/Header/HeaderTop.d.ts +2 -0
  7. package/bundle/components/ProductTile/ProductTileContent.d.ts +2 -0
  8. package/bundle/model/LogoType.d.ts +5 -0
  9. package/bundle/services/sitemap/SitemapProps.d.ts +2 -4
  10. package/bundle/ui-kit/Logo/Logo.d.ts +2 -5
  11. package/bundle/ui-kit/Logo/Logo.mobile.d.ts +2 -0
  12. package/bundle/ui-kit/Logo/renderImage.d.ts +6 -0
  13. package/bundle/ui-kit/Logo/renderTitle.d.ts +3 -0
  14. package/dist/components/Blocks.js +2 -0
  15. package/dist/components/Blocks.js.map +1 -1
  16. package/dist/components/ButtonBlock/ButtonBlock.d.ts +6 -0
  17. package/dist/components/ButtonBlock/ButtonBlock.js +11 -0
  18. package/dist/components/ButtonBlock/ButtonBlock.js.map +1 -0
  19. package/dist/components/ButtonBlock/ButtonBlockContent.d.ts +8 -0
  20. package/dist/components/ButtonBlock/ButtonBlockContent.js +2 -0
  21. package/dist/components/ButtonBlock/ButtonBlockContent.js.map +1 -0
  22. package/dist/components/Calculator/constants.js +1 -1
  23. package/dist/components/Header/Header.mobile.js +2 -2
  24. package/dist/components/Header/Header.mobile.js.map +1 -1
  25. package/dist/components/Header/HeaderTop.d.ts +2 -0
  26. package/dist/components/Header/HeaderTop.js +1 -1
  27. package/dist/components/Header/HeaderTop.js.map +1 -1
  28. package/dist/components/ProductTile/ProductTile.js +8 -2
  29. package/dist/components/ProductTile/ProductTile.js.map +1 -1
  30. package/dist/components/ProductTile/ProductTileContent.d.ts +2 -0
  31. package/dist/model/LogoType.d.ts +5 -0
  32. package/dist/model/LogoType.js +2 -0
  33. package/dist/model/LogoType.js.map +1 -0
  34. package/dist/services/sitemap/SitemapProps.d.ts +2 -4
  35. package/dist/ui-kit/Logo/Logo.d.ts +2 -5
  36. package/dist/ui-kit/Logo/Logo.js +3 -21
  37. package/dist/ui-kit/Logo/Logo.js.map +1 -1
  38. package/dist/ui-kit/Logo/Logo.mobile.d.ts +2 -0
  39. package/dist/ui-kit/Logo/Logo.mobile.js +4 -15
  40. package/dist/ui-kit/Logo/Logo.mobile.js.map +1 -1
  41. package/dist/ui-kit/Logo/renderImage.d.ts +6 -0
  42. package/dist/ui-kit/Logo/renderImage.js +20 -0
  43. package/dist/ui-kit/Logo/renderImage.js.map +1 -0
  44. package/dist/ui-kit/Logo/renderTitle.d.ts +3 -0
  45. package/dist/ui-kit/Logo/renderTitle.js +12 -0
  46. package/dist/ui-kit/Logo/renderTitle.js.map +1 -0
  47. package/lib/common.css +1 -1
  48. package/lib/components/Blocks.js +2 -0
  49. package/lib/components/Blocks.js.map +1 -1
  50. package/lib/components/ButtonBlock/ButtonBlock.d.ts +6 -0
  51. package/lib/components/ButtonBlock/ButtonBlock.fixture.d.ts +6 -0
  52. package/lib/components/ButtonBlock/ButtonBlock.js +9 -0
  53. package/lib/components/ButtonBlock/ButtonBlock.js.map +1 -0
  54. package/lib/components/ButtonBlock/ButtonBlockContent.d.ts +8 -0
  55. package/lib/components/ButtonBlock/ButtonBlockContent.js +2 -0
  56. package/lib/components/ButtonBlock/ButtonBlockContent.js.map +1 -0
  57. package/lib/components/Calculator/constants.js +1 -1
  58. package/lib/components/Header/Header.mobile.js +2 -2
  59. package/lib/components/Header/Header.mobile.js.map +1 -1
  60. package/lib/components/Header/HeaderTop.d.ts +2 -0
  61. package/lib/components/Header/HeaderTop.js +1 -1
  62. package/lib/components/Header/HeaderTop.js.map +1 -1
  63. package/lib/components/ProductTile/ProductTile.fixture.d.ts +1 -0
  64. package/lib/components/ProductTile/ProductTile.js +8 -2
  65. package/lib/components/ProductTile/ProductTile.js.map +1 -1
  66. package/lib/components/ProductTile/ProductTileContent.d.ts +2 -0
  67. package/lib/model/LogoType.d.ts +5 -0
  68. package/lib/model/LogoType.js +2 -0
  69. package/lib/model/LogoType.js.map +1 -0
  70. package/lib/services/sitemap/SitemapProps.d.ts +2 -4
  71. package/lib/ui-kit/Logo/Logo.d.ts +2 -5
  72. package/lib/ui-kit/Logo/Logo.js +4 -22
  73. package/lib/ui-kit/Logo/Logo.js.map +1 -1
  74. package/lib/ui-kit/Logo/Logo.mobile.d.ts +2 -0
  75. package/lib/ui-kit/Logo/Logo.mobile.js +5 -16
  76. package/lib/ui-kit/Logo/Logo.mobile.js.map +1 -1
  77. package/lib/ui-kit/Logo/renderImage.d.ts +5 -0
  78. package/lib/ui-kit/Logo/renderImage.js +17 -0
  79. package/lib/ui-kit/Logo/renderImage.js.map +1 -0
  80. package/lib/ui-kit/Logo/renderTitle.d.ts +2 -0
  81. package/lib/ui-kit/Logo/renderTitle.js +9 -0
  82. package/lib/ui-kit/Logo/renderTitle.js.map +1 -0
  83. package/mobile/bundle/bundle.umd.js +18 -7
  84. package/mobile/bundle/bundle.umd.min.js +1 -1
  85. package/mobile/bundle/components/ButtonBlock/ButtonBlock.d.ts +6 -0
  86. package/mobile/bundle/components/ButtonBlock/ButtonBlockContent.d.ts +8 -0
  87. package/mobile/bundle/components/Header/HeaderTop.d.ts +2 -0
  88. package/mobile/bundle/components/ProductTile/ProductTileContent.d.ts +2 -0
  89. package/mobile/bundle/model/LogoType.d.ts +5 -0
  90. package/mobile/bundle/services/sitemap/SitemapProps.d.ts +2 -4
  91. package/mobile/bundle/ui-kit/Logo/Logo.d.ts +2 -0
  92. package/mobile/bundle/ui-kit/Logo/renderImage.d.ts +6 -0
  93. package/mobile/bundle/ui-kit/Logo/renderTitle.d.ts +3 -0
  94. package/mobile/dist/components/ButtonBlock/ButtonBlock.d.ts +6 -0
  95. package/mobile/dist/components/ButtonBlock/ButtonBlock.js +11 -0
  96. package/mobile/dist/components/ButtonBlock/ButtonBlock.js.map +1 -0
  97. package/mobile/dist/components/ButtonBlock/ButtonBlockContent.d.ts +8 -0
  98. package/mobile/dist/components/ButtonBlock/ButtonBlockContent.js +2 -0
  99. package/mobile/dist/components/ButtonBlock/ButtonBlockContent.js.map +1 -0
  100. package/mobile/dist/components/Calculator/constants.js +1 -1
  101. package/mobile/dist/components/Header/Header.js +2 -2
  102. package/mobile/dist/components/Header/Header.js.map +1 -1
  103. package/mobile/dist/components/Header/HeaderTop.d.ts +2 -0
  104. package/mobile/dist/components/Header/HeaderTop.js +1 -1
  105. package/mobile/dist/components/Header/HeaderTop.js.map +1 -1
  106. package/mobile/dist/components/ProductTile/ProductTile.js +8 -2
  107. package/mobile/dist/components/ProductTile/ProductTile.js.map +1 -1
  108. package/mobile/dist/components/ProductTile/ProductTileContent.d.ts +2 -0
  109. package/mobile/dist/model/LogoType.d.ts +5 -0
  110. package/mobile/dist/model/LogoType.js +2 -0
  111. package/mobile/dist/model/LogoType.js.map +1 -0
  112. package/mobile/dist/services/sitemap/SitemapProps.d.ts +2 -4
  113. package/mobile/dist/ui-kit/Logo/Logo.d.ts +2 -0
  114. package/mobile/dist/ui-kit/Logo/Logo.js +4 -15
  115. package/mobile/dist/ui-kit/Logo/Logo.js.map +1 -1
  116. package/mobile/dist/ui-kit/Logo/renderImage.d.ts +6 -0
  117. package/mobile/dist/ui-kit/Logo/renderImage.js +20 -0
  118. package/mobile/dist/ui-kit/Logo/renderImage.js.map +1 -0
  119. package/mobile/dist/ui-kit/Logo/renderTitle.d.ts +3 -0
  120. package/mobile/dist/ui-kit/Logo/renderTitle.js +12 -0
  121. package/mobile/dist/ui-kit/Logo/renderTitle.js.map +1 -0
  122. package/mobile/lib/components/ButtonBlock/ButtonBlock.d.ts +6 -0
  123. package/mobile/lib/components/ButtonBlock/ButtonBlock.js +9 -0
  124. package/mobile/lib/components/ButtonBlock/ButtonBlock.js.map +1 -0
  125. package/mobile/lib/components/ButtonBlock/ButtonBlockContent.d.ts +8 -0
  126. package/mobile/lib/components/ButtonBlock/ButtonBlockContent.js +2 -0
  127. package/mobile/lib/components/ButtonBlock/ButtonBlockContent.js.map +1 -0
  128. package/mobile/lib/components/Calculator/constants.js +1 -1
  129. package/mobile/lib/components/Header/Header.js +2 -2
  130. package/mobile/lib/components/Header/Header.js.map +1 -1
  131. package/mobile/lib/components/Header/HeaderTop.d.ts +2 -0
  132. package/mobile/lib/components/Header/HeaderTop.js +1 -1
  133. package/mobile/lib/components/Header/HeaderTop.js.map +1 -1
  134. package/mobile/lib/components/ProductTile/ProductTile.js +8 -2
  135. package/mobile/lib/components/ProductTile/ProductTile.js.map +1 -1
  136. package/mobile/lib/components/ProductTile/ProductTileContent.d.ts +2 -0
  137. package/mobile/lib/model/LogoType.d.ts +5 -0
  138. package/mobile/lib/model/LogoType.js +2 -0
  139. package/mobile/lib/model/LogoType.js.map +1 -0
  140. package/mobile/lib/services/sitemap/SitemapProps.d.ts +2 -4
  141. package/mobile/lib/ui-kit/Logo/Logo.d.ts +2 -0
  142. package/mobile/lib/ui-kit/Logo/Logo.js +5 -16
  143. package/mobile/lib/ui-kit/Logo/Logo.js.map +1 -1
  144. package/mobile/lib/ui-kit/Logo/renderImage.d.ts +6 -0
  145. package/mobile/lib/ui-kit/Logo/renderImage.js +17 -0
  146. package/mobile/lib/ui-kit/Logo/renderImage.js.map +1 -0
  147. package/mobile/lib/ui-kit/Logo/renderTitle.d.ts +3 -0
  148. package/mobile/lib/ui-kit/Logo/renderTitle.js +9 -0
  149. package/mobile/lib/ui-kit/Logo/renderTitle.js.map +1 -0
  150. package/mobile/src/components/ButtonBlock/ButtonBlock.example.json +10 -0
  151. package/mobile/src/components/ButtonBlock/ButtonBlock.tsx +17 -0
  152. package/mobile/src/components/ButtonBlock/ButtonBlock.ui.json +12 -0
  153. package/mobile/src/components/ButtonBlock/ButtonBlockContent.ts +9 -0
  154. package/mobile/src/components/Calculator/constants.ts +1 -1
  155. package/mobile/src/components/Header/Header.tsx +2 -2
  156. package/mobile/src/components/Header/HeaderTop.tsx +4 -2
  157. package/mobile/src/components/ProductTile/ProductTile.example.json +2 -1
  158. package/mobile/src/components/ProductTile/ProductTile.tsx +34 -18
  159. package/mobile/src/components/ProductTile/ProductTileContent.ts +2 -0
  160. package/mobile/src/model/LogoType.ts +6 -0
  161. package/mobile/src/services/sitemap/SitemapProps.ts +2 -4
  162. package/mobile/src/ui-kit/Logo/Logo.tsx +16 -31
  163. package/mobile/src/ui-kit/Logo/renderImage.tsx +40 -0
  164. package/mobile/src/ui-kit/Logo/renderTitle.tsx +15 -0
  165. package/package.json +1 -1
  166. package/src/components/Blocks.ts +2 -0
  167. package/src/components/ButtonBlock/ButtonBlock.example.json +10 -0
  168. package/src/components/ButtonBlock/ButtonBlock.fixture.tsx +18 -0
  169. package/src/components/ButtonBlock/ButtonBlock.tsx +17 -0
  170. package/src/components/ButtonBlock/ButtonBlock.ui.json +12 -0
  171. package/src/components/ButtonBlock/ButtonBlockContent.ts +9 -0
  172. package/src/components/Calculator/constants.ts +1 -1
  173. package/src/components/Header/Header.mobile.tsx +2 -2
  174. package/src/components/Header/HeaderTop.tsx +4 -2
  175. package/src/components/ProductTile/ProductTile.example.json +2 -1
  176. package/src/components/ProductTile/ProductTile.fixture.tsx +13 -0
  177. package/src/components/ProductTile/ProductTile.tsx +34 -18
  178. package/src/components/ProductTile/ProductTileContent.ts +2 -0
  179. package/src/model/LogoType.ts +6 -0
  180. package/src/services/sitemap/SitemapProps.ts +2 -4
  181. package/src/ui-kit/Logo/Logo.mobile.tsx +16 -31
  182. package/src/ui-kit/Logo/Logo.tsx +6 -43
  183. package/src/ui-kit/Logo/renderImage.tsx +40 -0
  184. package/src/ui-kit/Logo/renderTitle.tsx +15 -0
@@ -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
  };
@@ -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
  /**
@@ -22,10 +23,7 @@ export interface DispositionItem extends LinkProps {
22
23
  export interface SitemapDataProps {
23
24
  topItems?: TopMenuItem[];
24
25
  dispositions?: DispositionItem[];
25
- logo?: {
26
- image?: Picture;
27
- title?: string;
28
- };
26
+ logo?: LogoType;
29
27
  defaultLocation?: string;
30
28
  officesLink?: string;
31
29
  }
@@ -1,6 +1,7 @@
1
1
  import { JSX } from '@redneckz/uni-jsx';
2
- import type { BgColorVersion } from '../../model/BgColorVersion';
3
- import { Img } from '../Img/Img';
2
+ import type { LogoType } from '../../model/LogoType';
3
+ import { renderImage } from './renderImage';
4
+ import { renderTitle } from './renderTitle';
4
5
 
5
6
  export interface LogoProps {
6
7
  className: string;
@@ -8,44 +9,28 @@ export interface LogoProps {
8
9
  targetBlank: boolean;
9
10
  bgColor?: string;
10
11
  showTitle?: boolean;
12
+ logo?: LogoType;
11
13
  }
12
14
 
13
- const ICON_VERSION_MAP: Record<BgColorVersion, string> = {
14
- 'bg-white': 'color',
15
- transparent: 'white',
16
- };
17
-
18
- const SVG_COLOR: Record<BgColorVersion, string> = {
19
- 'bg-white': 'text-primary-main',
20
- transparent: 'text-white',
21
- };
22
-
23
- const TEXT_COLOR: Record<BgColorVersion, string> = {
24
- 'bg-white': 'text-black',
25
- transparent: 'text-white',
26
- };
27
-
28
15
  export const Logo = JSX<Partial<LogoProps>>(
29
- ({ className = '', href, children, targetBlank, bgColor = 'bg-white', showTitle = true }) => {
16
+ ({
17
+ bgColor = 'bg-white',
18
+ children,
19
+ className = '',
20
+ href,
21
+ logo,
22
+ showTitle = true,
23
+ targetBlank,
24
+ }) => {
30
25
  return (
31
26
  <a
32
27
  className={`inline-flex items-center font-sans no-underline ${className}`}
33
28
  href={href || 'https://rshb.ru/'}
34
29
  target={targetBlank ? '_blank' : '_self'}
35
- aria-label="Россельхозбанк"
30
+ aria-label={logo?.title || 'Россельхозбанк'}
36
31
  >
37
- <Img
38
- image={{ icon: 'LogoIcon', iconVersion: ICON_VERSION_MAP[bgColor] }}
39
- className={`${SVG_COLOR[bgColor]}`}
40
- width="34"
41
- height="34"
42
- asSVG
43
- />
44
- {showTitle ? (
45
- <span className={`${TEXT_COLOR[bgColor]} text-s font-medium ml-2.5`}>
46
- {children || 'Россельхозбанк'}
47
- </span>
48
- ) : null}
32
+ {renderImage(bgColor, logo?.image, { width: '34', height: '34' })}
33
+ {showTitle ? renderTitle(children || logo?.title, bgColor, 'text-s') : null}
49
34
  </a>
50
35
  );
51
36
  },
@@ -0,0 +1,40 @@
1
+ import { BgColorVersion } from '../../model/BgColorVersion';
2
+ import type { Picture } from '../../model/Picture';
3
+ import { Img } from '../Img/Img';
4
+
5
+ const ICON_VERSION_MAP: Record<BgColorVersion, string> = {
6
+ 'bg-white': 'color',
7
+ transparent: 'white',
8
+ };
9
+
10
+ const SVG_COLOR: Record<BgColorVersion, string> = {
11
+ 'bg-white': 'text-primary-main',
12
+ transparent: 'text-white',
13
+ };
14
+
15
+ export const renderImage = (
16
+ bgColor: string,
17
+ image?: Picture,
18
+ size?: { width: string; height: string },
19
+ ) => {
20
+ return image?.src ? (
21
+ <Img
22
+ image={image}
23
+ className={SVG_COLOR[bgColor]}
24
+ width={size?.width}
25
+ height={size?.height}
26
+ asSVG
27
+ />
28
+ ) : (
29
+ <Img
30
+ image={{
31
+ icon: image?.icon || 'LogoIcon',
32
+ iconVersion: ICON_VERSION_MAP[bgColor],
33
+ }}
34
+ className={SVG_COLOR[bgColor]}
35
+ width={size?.width}
36
+ height={size?.height}
37
+ asSVG
38
+ />
39
+ );
40
+ };
@@ -0,0 +1,15 @@
1
+ import type { BgColorVersion } from '../../model/BgColorVersion';
2
+ import type { VNode } from '../../model/VNode';
3
+
4
+ const TEXT_COLOR: Record<BgColorVersion, string> = {
5
+ 'bg-white': 'text-primary-text',
6
+ transparent: 'text-white',
7
+ };
8
+
9
+ export const renderTitle = (title: VNode, bgColor: string, className?: string) => {
10
+ return (
11
+ <span className={`${TEXT_COLOR[bgColor]} ml-2.5 font-medium ${className || ''}`}>
12
+ {title || 'Россельхозбанк'}
13
+ </span>
14
+ );
15
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@redneckz/wildless-cms-uni-blocks",
3
- "version": "0.6.40",
3
+ "version": "0.6.41",
4
4
  "private": false,
5
5
  "license": "MIT",
6
6
  "author": "ЦК",
@@ -5,6 +5,7 @@ import { BenefitsBlock } from './BenefitsBlock/BenefitsBlock';
5
5
  import { Bonus } from './Bonus/Bonus';
6
6
  import { BonusBenefitsBlock } from './BonusBenefitsBlock/BonusBenefitsBlock';
7
7
  import { BusinessBlock } from './BusinessBlock/BusinessBlock';
8
+ import { ButtonBlock } from './ButtonBlock/ButtonBlock';
8
9
  import { Calculator } from './Calculator/Calculator';
9
10
  import { CardTransfer } from './CardTransfer/CardTransfer';
10
11
  import { Carousel } from './Carousel/Carousel';
@@ -58,6 +59,7 @@ export const Blocks: BlocksRegistry = {
58
59
  AccordionItem,
59
60
  BenefitsBlock,
60
61
  BusinessBlock,
62
+ ButtonBlock,
61
63
  Bonus,
62
64
  BonusBenefitsBlock,
63
65
  CardTransfer,
@@ -0,0 +1,10 @@
1
+ {
2
+ "content": {
3
+ "button": {
4
+ "href": "/credit-cards",
5
+ "text": "Подробнее",
6
+ "target": "_blank",
7
+ "version": "primary"
8
+ }
9
+ }
10
+ }
@@ -0,0 +1,18 @@
1
+ import '../../setup-fixture';
2
+ import type { ButtonWithIconProps } from '../../ui-kit/Button/ButtonProps';
3
+ import { ButtonBlock } from './ButtonBlock';
4
+
5
+ const button: ButtonWithIconProps = {
6
+ href: '/credit-cards',
7
+ text: 'Подробнее',
8
+ target: '_blank',
9
+ version: 'primary',
10
+ };
11
+
12
+ export default {
13
+ default: (
14
+ <div className="container grid grid-cols-12 p-4">
15
+ <ButtonBlock className="col-span-12" button={button} />
16
+ </div>
17
+ ),
18
+ };
@@ -0,0 +1,17 @@
1
+ import { JSX } from '@redneckz/uni-jsx';
2
+ import type { UniBlockProps } from '../../model/JSXBlock';
3
+ import { BlockWrapper } from '../../ui-kit/BlockWrapper';
4
+ import { renderButton } from '../../ui-kit/Button/ButtonSection';
5
+ import type { ButtonBlockContent } from './ButtonBlockContent';
6
+
7
+ interface ButtonBlockProps extends ButtonBlockContent, UniBlockProps {}
8
+
9
+ export const ButtonBlock = JSX<ButtonBlockProps>((props) => {
10
+ const { className, button, ...rest } = props;
11
+
12
+ return (
13
+ <BlockWrapper className={className} {...rest}>
14
+ {button ? renderButton({ button }) : null}
15
+ </BlockWrapper>
16
+ );
17
+ });
@@ -0,0 +1,12 @@
1
+ {
2
+ "content": {
3
+ "button": {
4
+ "icon": {
5
+ "ui:field": "icon"
6
+ },
7
+ "iconRight": {
8
+ "ui:field": "icon"
9
+ }
10
+ }
11
+ }
12
+ }
@@ -0,0 +1,9 @@
1
+ import type { ButtonWithIconProps } from '../../ui-kit/Button/ButtonProps';
2
+
3
+ /**
4
+ * @title Блок Кнопка
5
+ */
6
+ export interface ButtonBlockContent {
7
+ /** @title Кнопка */
8
+ button?: ButtonWithIconProps;
9
+ }
@@ -18,7 +18,7 @@ export const DEFAULT_CREDIT_CALCULATOR_PARAMS: CreditCalculatorSourceBookParams
18
18
  maxSum: DEFAULT_MAX_SUM,
19
19
  minMonths: DEFAULT_MIN_MONTHS,
20
20
  maxMonths: DEFAULT_MAX_MONTHS,
21
- rateBottomRange: 10,
21
+ rateBottomRange: 12,
22
22
  rateTopRange: 7,
23
23
  isSalaryClient: true,
24
24
  isStateEmployee: true,
@@ -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,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={`${
@@ -29,6 +29,7 @@
29
29
  "text": "Кнопка",
30
30
  "version": "primary"
31
31
  }
32
- ]
32
+ ],
33
+ "isImageOnRightSide": true
33
34
  }
34
35
  }
@@ -200,4 +200,17 @@ export default {
200
200
  />
201
201
  </div>
202
202
  ),
203
+ 'credit-card-reverse': (
204
+ <div className="container grid grid-cols-12">
205
+ <ProductTile
206
+ className="col-span-8"
207
+ title="Кредит под залог недвижимости"
208
+ description={'Без переоформления залогой недвижимости на банк'}
209
+ benefits={benefits}
210
+ buttons={buttons2}
211
+ image={building}
212
+ isImageOnRightSide={false}
213
+ />
214
+ </div>
215
+ ),
203
216
  };
@@ -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
  };
@@ -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
  /**
@@ -22,10 +23,7 @@ export interface DispositionItem extends LinkProps {
22
23
  export interface SitemapDataProps {
23
24
  topItems?: TopMenuItem[];
24
25
  dispositions?: DispositionItem[];
25
- logo?: {
26
- image?: Picture;
27
- title?: string;
28
- };
26
+ logo?: LogoType;
29
27
  defaultLocation?: string;
30
28
  officesLink?: string;
31
29
  }
@@ -1,6 +1,7 @@
1
1
  import { JSX } from '@redneckz/uni-jsx';
2
- import type { BgColorVersion } from '../../model/BgColorVersion';
3
- import { Img } from '../Img/Img';
2
+ import type { LogoType } from '../../model/LogoType';
3
+ import { renderImage } from './renderImage';
4
+ import { renderTitle } from './renderTitle';
4
5
 
5
6
  export interface LogoProps {
6
7
  className: string;
@@ -8,44 +9,28 @@ export interface LogoProps {
8
9
  targetBlank: boolean;
9
10
  bgColor?: string;
10
11
  showTitle?: boolean;
12
+ logo?: LogoType;
11
13
  }
12
14
 
13
- const ICON_VERSION_MAP: Record<BgColorVersion, string> = {
14
- 'bg-white': 'color',
15
- transparent: 'white',
16
- };
17
-
18
- const SVG_COLOR: Record<BgColorVersion, string> = {
19
- 'bg-white': 'text-primary-main',
20
- transparent: 'text-white',
21
- };
22
-
23
- const TEXT_COLOR: Record<BgColorVersion, string> = {
24
- 'bg-white': 'text-black',
25
- transparent: 'text-white',
26
- };
27
-
28
15
  export const Logo = JSX<Partial<LogoProps>>(
29
- ({ className = '', href, children, targetBlank, bgColor = 'bg-white', showTitle = true }) => {
16
+ ({
17
+ bgColor = 'bg-white',
18
+ children,
19
+ className = '',
20
+ href,
21
+ logo,
22
+ showTitle = true,
23
+ targetBlank,
24
+ }) => {
30
25
  return (
31
26
  <a
32
27
  className={`inline-flex items-center font-sans no-underline ${className}`}
33
28
  href={href || 'https://rshb.ru/'}
34
29
  target={targetBlank ? '_blank' : '_self'}
35
- aria-label="Россельхозбанк"
30
+ aria-label={logo?.title || 'Россельхозбанк'}
36
31
  >
37
- <Img
38
- image={{ icon: 'LogoIcon', iconVersion: ICON_VERSION_MAP[bgColor] }}
39
- className={`${SVG_COLOR[bgColor]}`}
40
- width="34"
41
- height="34"
42
- asSVG
43
- />
44
- {showTitle ? (
45
- <span className={`${TEXT_COLOR[bgColor]} text-s font-medium ml-2.5`}>
46
- {children || 'Россельхозбанк'}
47
- </span>
48
- ) : null}
32
+ {renderImage(bgColor, logo?.image, { width: '34', height: '34' })}
33
+ {showTitle ? renderTitle(children || logo?.title, bgColor, 'text-s') : null}
49
34
  </a>
50
35
  );
51
36
  },
@@ -1,8 +1,7 @@
1
1
  import { JSX } from '@redneckz/uni-jsx';
2
- import type { BgColorVersion } from '../../model/BgColorVersion';
3
- import type { Picture } from '../../model/Picture';
4
- import type { VNode } from '../../model/VNode';
5
- import { Img } from '../Img/Img';
2
+ import type { LogoType } from '../../model/LogoType';
3
+ import { renderImage } from './renderImage';
4
+ import { renderTitle } from './renderTitle';
6
5
 
7
6
  export interface LogoProps {
8
7
  className: string;
@@ -10,26 +9,9 @@ export interface LogoProps {
10
9
  targetBlank: boolean;
11
10
  bgColor?: string;
12
11
  showTitle?: boolean;
13
- logo?: {
14
- image?: Picture;
15
- title?: string;
16
- };
12
+ logo?: LogoType;
17
13
  }
18
14
 
19
- const ICON_VERSION_MAP: Record<BgColorVersion, string> = {
20
- 'bg-white': 'color',
21
- transparent: 'white',
22
- };
23
-
24
- const SVG_COLOR: Record<BgColorVersion, string> = {
25
- 'bg-white': 'text-primary-main',
26
- transparent: 'text-white',
27
- };
28
- const TEXT_COLOR: Record<BgColorVersion, string> = {
29
- 'bg-white': 'text-primary-text',
30
- transparent: 'text-white',
31
- };
32
-
33
15
  export const Logo = JSX<Partial<LogoProps>>(
34
16
  ({
35
17
  className = '',
@@ -47,28 +29,9 @@ export const Logo = JSX<Partial<LogoProps>>(
47
29
  target={targetBlank ? '_blank' : '_self'}
48
30
  aria-label={logo?.title || 'Россельхозбанк'}
49
31
  >
50
- {logo?.image?.src ? (
51
- <Img image={logo.image} className={SVG_COLOR[bgColor]} width="40" height="45" asSVG />
52
- ) : (
53
- <Img
54
- image={{
55
- icon: logo?.image?.icon || 'LogoIcon',
56
- iconVersion: ICON_VERSION_MAP[bgColor],
57
- }}
58
- className={`${SVG_COLOR[bgColor]} w-10`}
59
- width="40"
60
- height="45"
61
- asSVG
62
- />
63
- )}
64
- {showTitle ? renderTitle(children, bgColor, logo?.title) : null}
32
+ {renderImage(bgColor, logo?.image, { width: '40', height: '45' })}
33
+ {showTitle ? renderTitle(children || logo?.title, bgColor) : null}
65
34
  </a>
66
35
  );
67
36
  },
68
37
  );
69
-
70
- const renderTitle = (children: VNode, bgColor: string, title?: string) => {
71
- const text = children || title || 'Россельхозбанк';
72
-
73
- return <span className={`${TEXT_COLOR[bgColor]} font-medium ml-2.5`}>{text}</span>;
74
- };