@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.
- package/bundle/blocks.schema.json +1 -1
- package/bundle/bundle.umd.js +32 -16
- package/bundle/bundle.umd.min.js +1 -1
- package/bundle/components/ButtonBlock/ButtonBlock.d.ts +6 -0
- package/bundle/components/ButtonBlock/ButtonBlockContent.d.ts +8 -0
- package/bundle/components/Header/HeaderTop.d.ts +2 -0
- package/bundle/components/ProductTile/ProductTileContent.d.ts +2 -0
- package/bundle/model/LogoType.d.ts +5 -0
- package/bundle/services/sitemap/SitemapProps.d.ts +2 -4
- package/bundle/ui-kit/Logo/Logo.d.ts +2 -5
- package/bundle/ui-kit/Logo/Logo.mobile.d.ts +2 -0
- package/bundle/ui-kit/Logo/renderImage.d.ts +6 -0
- package/bundle/ui-kit/Logo/renderTitle.d.ts +3 -0
- package/dist/components/Blocks.js +2 -0
- package/dist/components/Blocks.js.map +1 -1
- package/dist/components/ButtonBlock/ButtonBlock.d.ts +6 -0
- package/dist/components/ButtonBlock/ButtonBlock.js +11 -0
- package/dist/components/ButtonBlock/ButtonBlock.js.map +1 -0
- package/dist/components/ButtonBlock/ButtonBlockContent.d.ts +8 -0
- package/dist/components/ButtonBlock/ButtonBlockContent.js +2 -0
- package/dist/components/ButtonBlock/ButtonBlockContent.js.map +1 -0
- package/dist/components/Calculator/constants.js +1 -1
- package/dist/components/Header/Header.mobile.js +2 -2
- package/dist/components/Header/Header.mobile.js.map +1 -1
- package/dist/components/Header/HeaderTop.d.ts +2 -0
- package/dist/components/Header/HeaderTop.js +1 -1
- package/dist/components/Header/HeaderTop.js.map +1 -1
- package/dist/components/ProductTile/ProductTile.js +8 -2
- package/dist/components/ProductTile/ProductTile.js.map +1 -1
- package/dist/components/ProductTile/ProductTileContent.d.ts +2 -0
- package/dist/model/LogoType.d.ts +5 -0
- package/dist/model/LogoType.js +2 -0
- package/dist/model/LogoType.js.map +1 -0
- package/dist/services/sitemap/SitemapProps.d.ts +2 -4
- package/dist/ui-kit/Logo/Logo.d.ts +2 -5
- package/dist/ui-kit/Logo/Logo.js +3 -21
- package/dist/ui-kit/Logo/Logo.js.map +1 -1
- package/dist/ui-kit/Logo/Logo.mobile.d.ts +2 -0
- package/dist/ui-kit/Logo/Logo.mobile.js +4 -15
- package/dist/ui-kit/Logo/Logo.mobile.js.map +1 -1
- package/dist/ui-kit/Logo/renderImage.d.ts +6 -0
- package/dist/ui-kit/Logo/renderImage.js +20 -0
- package/dist/ui-kit/Logo/renderImage.js.map +1 -0
- package/dist/ui-kit/Logo/renderTitle.d.ts +3 -0
- package/dist/ui-kit/Logo/renderTitle.js +12 -0
- package/dist/ui-kit/Logo/renderTitle.js.map +1 -0
- package/lib/common.css +1 -1
- package/lib/components/Blocks.js +2 -0
- package/lib/components/Blocks.js.map +1 -1
- package/lib/components/ButtonBlock/ButtonBlock.d.ts +6 -0
- package/lib/components/ButtonBlock/ButtonBlock.fixture.d.ts +6 -0
- package/lib/components/ButtonBlock/ButtonBlock.js +9 -0
- package/lib/components/ButtonBlock/ButtonBlock.js.map +1 -0
- package/lib/components/ButtonBlock/ButtonBlockContent.d.ts +8 -0
- package/lib/components/ButtonBlock/ButtonBlockContent.js +2 -0
- package/lib/components/ButtonBlock/ButtonBlockContent.js.map +1 -0
- package/lib/components/Calculator/constants.js +1 -1
- package/lib/components/Header/Header.mobile.js +2 -2
- package/lib/components/Header/Header.mobile.js.map +1 -1
- package/lib/components/Header/HeaderTop.d.ts +2 -0
- package/lib/components/Header/HeaderTop.js +1 -1
- package/lib/components/Header/HeaderTop.js.map +1 -1
- package/lib/components/ProductTile/ProductTile.fixture.d.ts +1 -0
- package/lib/components/ProductTile/ProductTile.js +8 -2
- package/lib/components/ProductTile/ProductTile.js.map +1 -1
- package/lib/components/ProductTile/ProductTileContent.d.ts +2 -0
- package/lib/model/LogoType.d.ts +5 -0
- package/lib/model/LogoType.js +2 -0
- package/lib/model/LogoType.js.map +1 -0
- package/lib/services/sitemap/SitemapProps.d.ts +2 -4
- package/lib/ui-kit/Logo/Logo.d.ts +2 -5
- package/lib/ui-kit/Logo/Logo.js +4 -22
- package/lib/ui-kit/Logo/Logo.js.map +1 -1
- package/lib/ui-kit/Logo/Logo.mobile.d.ts +2 -0
- package/lib/ui-kit/Logo/Logo.mobile.js +5 -16
- package/lib/ui-kit/Logo/Logo.mobile.js.map +1 -1
- package/lib/ui-kit/Logo/renderImage.d.ts +5 -0
- package/lib/ui-kit/Logo/renderImage.js +17 -0
- package/lib/ui-kit/Logo/renderImage.js.map +1 -0
- package/lib/ui-kit/Logo/renderTitle.d.ts +2 -0
- package/lib/ui-kit/Logo/renderTitle.js +9 -0
- package/lib/ui-kit/Logo/renderTitle.js.map +1 -0
- package/mobile/bundle/bundle.umd.js +18 -7
- package/mobile/bundle/bundle.umd.min.js +1 -1
- package/mobile/bundle/components/ButtonBlock/ButtonBlock.d.ts +6 -0
- package/mobile/bundle/components/ButtonBlock/ButtonBlockContent.d.ts +8 -0
- package/mobile/bundle/components/Header/HeaderTop.d.ts +2 -0
- package/mobile/bundle/components/ProductTile/ProductTileContent.d.ts +2 -0
- package/mobile/bundle/model/LogoType.d.ts +5 -0
- package/mobile/bundle/services/sitemap/SitemapProps.d.ts +2 -4
- package/mobile/bundle/ui-kit/Logo/Logo.d.ts +2 -0
- package/mobile/bundle/ui-kit/Logo/renderImage.d.ts +6 -0
- package/mobile/bundle/ui-kit/Logo/renderTitle.d.ts +3 -0
- package/mobile/dist/components/ButtonBlock/ButtonBlock.d.ts +6 -0
- package/mobile/dist/components/ButtonBlock/ButtonBlock.js +11 -0
- package/mobile/dist/components/ButtonBlock/ButtonBlock.js.map +1 -0
- package/mobile/dist/components/ButtonBlock/ButtonBlockContent.d.ts +8 -0
- package/mobile/dist/components/ButtonBlock/ButtonBlockContent.js +2 -0
- package/mobile/dist/components/ButtonBlock/ButtonBlockContent.js.map +1 -0
- package/mobile/dist/components/Calculator/constants.js +1 -1
- package/mobile/dist/components/Header/Header.js +2 -2
- package/mobile/dist/components/Header/Header.js.map +1 -1
- package/mobile/dist/components/Header/HeaderTop.d.ts +2 -0
- package/mobile/dist/components/Header/HeaderTop.js +1 -1
- package/mobile/dist/components/Header/HeaderTop.js.map +1 -1
- package/mobile/dist/components/ProductTile/ProductTile.js +8 -2
- package/mobile/dist/components/ProductTile/ProductTile.js.map +1 -1
- package/mobile/dist/components/ProductTile/ProductTileContent.d.ts +2 -0
- package/mobile/dist/model/LogoType.d.ts +5 -0
- package/mobile/dist/model/LogoType.js +2 -0
- package/mobile/dist/model/LogoType.js.map +1 -0
- package/mobile/dist/services/sitemap/SitemapProps.d.ts +2 -4
- package/mobile/dist/ui-kit/Logo/Logo.d.ts +2 -0
- package/mobile/dist/ui-kit/Logo/Logo.js +4 -15
- package/mobile/dist/ui-kit/Logo/Logo.js.map +1 -1
- package/mobile/dist/ui-kit/Logo/renderImage.d.ts +6 -0
- package/mobile/dist/ui-kit/Logo/renderImage.js +20 -0
- package/mobile/dist/ui-kit/Logo/renderImage.js.map +1 -0
- package/mobile/dist/ui-kit/Logo/renderTitle.d.ts +3 -0
- package/mobile/dist/ui-kit/Logo/renderTitle.js +12 -0
- package/mobile/dist/ui-kit/Logo/renderTitle.js.map +1 -0
- package/mobile/lib/components/ButtonBlock/ButtonBlock.d.ts +6 -0
- package/mobile/lib/components/ButtonBlock/ButtonBlock.js +9 -0
- package/mobile/lib/components/ButtonBlock/ButtonBlock.js.map +1 -0
- package/mobile/lib/components/ButtonBlock/ButtonBlockContent.d.ts +8 -0
- package/mobile/lib/components/ButtonBlock/ButtonBlockContent.js +2 -0
- package/mobile/lib/components/ButtonBlock/ButtonBlockContent.js.map +1 -0
- package/mobile/lib/components/Calculator/constants.js +1 -1
- package/mobile/lib/components/Header/Header.js +2 -2
- package/mobile/lib/components/Header/Header.js.map +1 -1
- package/mobile/lib/components/Header/HeaderTop.d.ts +2 -0
- package/mobile/lib/components/Header/HeaderTop.js +1 -1
- package/mobile/lib/components/Header/HeaderTop.js.map +1 -1
- package/mobile/lib/components/ProductTile/ProductTile.js +8 -2
- package/mobile/lib/components/ProductTile/ProductTile.js.map +1 -1
- package/mobile/lib/components/ProductTile/ProductTileContent.d.ts +2 -0
- package/mobile/lib/model/LogoType.d.ts +5 -0
- package/mobile/lib/model/LogoType.js +2 -0
- package/mobile/lib/model/LogoType.js.map +1 -0
- package/mobile/lib/services/sitemap/SitemapProps.d.ts +2 -4
- package/mobile/lib/ui-kit/Logo/Logo.d.ts +2 -0
- package/mobile/lib/ui-kit/Logo/Logo.js +5 -16
- package/mobile/lib/ui-kit/Logo/Logo.js.map +1 -1
- package/mobile/lib/ui-kit/Logo/renderImage.d.ts +6 -0
- package/mobile/lib/ui-kit/Logo/renderImage.js +17 -0
- package/mobile/lib/ui-kit/Logo/renderImage.js.map +1 -0
- package/mobile/lib/ui-kit/Logo/renderTitle.d.ts +3 -0
- package/mobile/lib/ui-kit/Logo/renderTitle.js +9 -0
- package/mobile/lib/ui-kit/Logo/renderTitle.js.map +1 -0
- package/mobile/src/components/ButtonBlock/ButtonBlock.example.json +10 -0
- package/mobile/src/components/ButtonBlock/ButtonBlock.tsx +17 -0
- package/mobile/src/components/ButtonBlock/ButtonBlock.ui.json +12 -0
- package/mobile/src/components/ButtonBlock/ButtonBlockContent.ts +9 -0
- package/mobile/src/components/Calculator/constants.ts +1 -1
- package/mobile/src/components/Header/Header.tsx +2 -2
- package/mobile/src/components/Header/HeaderTop.tsx +4 -2
- package/mobile/src/components/ProductTile/ProductTile.example.json +2 -1
- package/mobile/src/components/ProductTile/ProductTile.tsx +34 -18
- package/mobile/src/components/ProductTile/ProductTileContent.ts +2 -0
- package/mobile/src/model/LogoType.ts +6 -0
- package/mobile/src/services/sitemap/SitemapProps.ts +2 -4
- package/mobile/src/ui-kit/Logo/Logo.tsx +16 -31
- package/mobile/src/ui-kit/Logo/renderImage.tsx +40 -0
- package/mobile/src/ui-kit/Logo/renderTitle.tsx +15 -0
- package/package.json +1 -1
- package/src/components/Blocks.ts +2 -0
- package/src/components/ButtonBlock/ButtonBlock.example.json +10 -0
- package/src/components/ButtonBlock/ButtonBlock.fixture.tsx +18 -0
- package/src/components/ButtonBlock/ButtonBlock.tsx +17 -0
- package/src/components/ButtonBlock/ButtonBlock.ui.json +12 -0
- package/src/components/ButtonBlock/ButtonBlockContent.ts +9 -0
- package/src/components/Calculator/constants.ts +1 -1
- package/src/components/Header/Header.mobile.tsx +2 -2
- package/src/components/Header/HeaderTop.tsx +4 -2
- package/src/components/ProductTile/ProductTile.example.json +2 -1
- package/src/components/ProductTile/ProductTile.fixture.tsx +13 -0
- package/src/components/ProductTile/ProductTile.tsx +34 -18
- package/src/components/ProductTile/ProductTileContent.ts +2 -0
- package/src/model/LogoType.ts +6 -0
- package/src/services/sitemap/SitemapProps.ts +2 -4
- package/src/ui-kit/Logo/Logo.mobile.tsx +16 -31
- package/src/ui-kit/Logo/Logo.tsx +6 -43
- package/src/ui-kit/Logo/renderImage.tsx +40 -0
- 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
|
|
30
|
-
${
|
|
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
|
-
<
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
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
|
+
}
|
|
@@ -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 {
|
|
3
|
-
import {
|
|
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
|
-
({
|
|
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
|
-
|
|
38
|
-
|
|
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
package/src/components/Blocks.ts
CHANGED
|
@@ -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,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
|
+
});
|
|
@@ -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:
|
|
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={`${
|
|
@@ -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
|
|
30
|
-
${
|
|
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
|
-
<
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
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
|
+
}
|
|
@@ -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 {
|
|
3
|
-
import {
|
|
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
|
-
({
|
|
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
|
-
|
|
38
|
-
|
|
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
|
},
|
package/src/ui-kit/Logo/Logo.tsx
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { JSX } from '@redneckz/uni-jsx';
|
|
2
|
-
import type {
|
|
3
|
-
import
|
|
4
|
-
import
|
|
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
|
|
51
|
-
|
|
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
|
-
};
|