@redneckz/wildless-cms-uni-blocks 0.3.59 → 0.3.61
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 +34 -14
- package/bundle/bundle.umd.min.js +1 -1
- package/dist/components/Blocks.d.ts +1 -0
- package/dist/components/Blocks.js +2 -0
- package/dist/components/Blocks.js.map +1 -1
- package/dist/components/GroupBlock/GroupBlock.js +1 -1
- package/dist/components/GroupBlock/GroupBlock.js.map +1 -1
- package/dist/components/GroupBlock/GroupBlockTabs.js +4 -4
- package/dist/components/GroupBlock/GroupBlockTabs.js.map +1 -1
- package/dist/components/Header/Header.js +2 -2
- package/dist/components/Header/Header.js.map +1 -1
- package/dist/components/Header/HeaderContent.d.ts +9 -0
- package/dist/components/Insurance/Insurance.d.ts +5 -0
- package/dist/components/Insurance/Insurance.js +22 -0
- package/dist/components/Insurance/Insurance.js.map +1 -0
- package/dist/components/Insurance/InsuranceContent.d.ts +13 -0
- package/dist/components/Insurance/InsuranceContent.js +2 -0
- package/dist/components/Insurance/InsuranceContent.js.map +1 -0
- package/dist/ui-kit/Icon/Icon.js +1 -1
- package/dist/ui-kit/Icon/Icon.js.map +1 -1
- package/dist/ui-kit/Logo/Logo.d.ts +5 -0
- package/dist/ui-kit/Logo/Logo.js +7 -2
- package/dist/ui-kit/Logo/Logo.js.map +1 -1
- package/lib/common.css +1 -1
- package/lib/components/Blocks.d.ts +1 -0
- package/lib/components/Blocks.js +2 -0
- package/lib/components/Blocks.js.map +1 -1
- package/lib/components/GroupBlock/GroupBlock.js +1 -1
- package/lib/components/GroupBlock/GroupBlock.js.map +1 -1
- package/lib/components/GroupBlock/GroupBlockTabs.js +4 -4
- package/lib/components/GroupBlock/GroupBlockTabs.js.map +1 -1
- package/lib/components/Header/Header.js +2 -2
- package/lib/components/Header/Header.js.map +1 -1
- package/lib/components/Header/HeaderContent.d.ts +9 -0
- package/lib/components/Insurance/Insurance.d.ts +5 -0
- package/lib/components/Insurance/Insurance.fixture.d.ts +4 -0
- package/lib/components/Insurance/Insurance.js +20 -0
- package/lib/components/Insurance/Insurance.js.map +1 -0
- package/lib/components/Insurance/InsuranceContent.d.ts +13 -0
- package/lib/components/Insurance/InsuranceContent.js +2 -0
- package/lib/components/Insurance/InsuranceContent.js.map +1 -0
- package/lib/ui-kit/Icon/Icon.js +1 -1
- package/lib/ui-kit/Icon/Icon.js.map +1 -1
- package/lib/ui-kit/Logo/Logo.d.ts +5 -0
- package/lib/ui-kit/Logo/Logo.js +7 -2
- package/lib/ui-kit/Logo/Logo.js.map +1 -1
- package/mobile/bundle/bundle.umd.js +1 -1
- package/mobile/bundle/bundle.umd.min.js +1 -1
- package/mobile/dist/components/GroupBlock/GroupBlock.js +1 -1
- package/mobile/dist/components/GroupBlock/GroupBlock.js.map +1 -1
- package/mobile/dist/components/GroupBlock/GroupBlockTabs.js +4 -4
- package/mobile/dist/components/GroupBlock/GroupBlockTabs.js.map +1 -1
- package/mobile/dist/components/Header/HeaderContent.d.ts +9 -0
- package/mobile/dist/components/Insurance/Insurance.d.ts +5 -0
- package/mobile/dist/components/Insurance/Insurance.js +22 -0
- package/mobile/dist/components/Insurance/Insurance.js.map +1 -0
- package/mobile/dist/components/Insurance/InsuranceContent.d.ts +13 -0
- package/mobile/dist/components/Insurance/InsuranceContent.js +2 -0
- package/mobile/dist/components/Insurance/InsuranceContent.js.map +1 -0
- package/mobile/dist/ui-kit/Icon/Icon.js +1 -1
- package/mobile/dist/ui-kit/Icon/Icon.js.map +1 -1
- package/mobile/lib/components/GroupBlock/GroupBlock.js +1 -1
- package/mobile/lib/components/GroupBlock/GroupBlock.js.map +1 -1
- package/mobile/lib/components/GroupBlock/GroupBlockTabs.js +4 -4
- package/mobile/lib/components/GroupBlock/GroupBlockTabs.js.map +1 -1
- package/mobile/lib/components/Header/HeaderContent.d.ts +9 -0
- package/mobile/lib/components/Insurance/Insurance.d.ts +5 -0
- package/mobile/lib/components/Insurance/Insurance.js +20 -0
- package/mobile/lib/components/Insurance/Insurance.js.map +1 -0
- package/mobile/lib/components/Insurance/InsuranceContent.d.ts +13 -0
- package/mobile/lib/components/Insurance/InsuranceContent.js +2 -0
- package/mobile/lib/components/Insurance/InsuranceContent.js.map +1 -0
- package/mobile/lib/ui-kit/Icon/Icon.js +1 -1
- package/mobile/lib/ui-kit/Icon/Icon.js.map +1 -1
- package/mobile/src/components/ContentPage/ContentPage.page.json +39 -0
- package/mobile/src/components/GroupBlock/GroupBlock.tsx +1 -3
- package/mobile/src/components/GroupBlock/GroupBlockTabs.tsx +4 -4
- package/mobile/src/components/Header/Header.example.json +5 -1
- package/mobile/src/components/Header/HeaderContent.ts +9 -0
- package/mobile/src/components/Insurance/Insurance.tsx +68 -0
- package/mobile/src/components/Insurance/InsuranceContent.ts +14 -0
- package/mobile/src/components/Insurance/Insuranse.example.json +36 -0
- package/mobile/src/ui-kit/Icon/Icon.tsx +1 -1
- package/package.json +1 -1
- package/src/components/Blocks.ts +2 -0
- package/src/components/ContentPage/ContentPage.page.json +39 -0
- package/src/components/GroupBlock/GroupBlock.tsx +1 -3
- package/src/components/GroupBlock/GroupBlockTabs.tsx +4 -4
- package/src/components/Header/Header.example.json +5 -1
- package/src/components/Header/Header.tsx +2 -1
- package/src/components/Header/HeaderContent.ts +9 -0
- package/src/components/Insurance/Insurance.fixture.tsx +65 -0
- package/src/components/Insurance/Insurance.tsx +68 -0
- package/src/components/Insurance/InsuranceContent.ts +14 -0
- package/src/components/Insurance/Insuranse.example.json +36 -0
- package/src/ui-kit/Icon/Icon.tsx +1 -1
- package/src/ui-kit/Logo/Logo.tsx +31 -12
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { JSX } from '@redneckz/uni-jsx';
|
|
2
|
+
import type { UniBlockProps } from '../../types';
|
|
3
|
+
import type { InsuranceContent } from './InsuranceContent';
|
|
4
|
+
import type { Benefit } from '../BenefitsBlock/BenefitsBlockContent';
|
|
5
|
+
import { Heading } from '../../ui-kit/Heading/Heading';
|
|
6
|
+
import { Img } from '../../ui-kit/Img/Img';
|
|
7
|
+
import { addSpacesBetweenNumbers } from '../../utils/addSpacesBetweenNumbers';
|
|
8
|
+
|
|
9
|
+
export interface InsuranceProps extends InsuranceContent, UniBlockProps {}
|
|
10
|
+
|
|
11
|
+
export const Insurance = JSX<InsuranceProps>(
|
|
12
|
+
({ className = '', title, description, image, benefits, insuranceSum, monthLimit }) => {
|
|
13
|
+
return (
|
|
14
|
+
<section className={`px-[100px] py-[50px] bg-white text-primary-text ${className}`}>
|
|
15
|
+
{title ? <Heading headingType="h3" title={title} className="text-center" /> : null}
|
|
16
|
+
{description ? <div className="text-center text-md mt-3">{description}</div> : null}
|
|
17
|
+
<div>
|
|
18
|
+
<div className="mt-5 mx-auto flex justify-center gap-[120px] mt-[30px]">
|
|
19
|
+
{image?.src ? <Img image={image} /> : null}
|
|
20
|
+
<div className="w-[558px] m-auto">
|
|
21
|
+
{benefits ? (
|
|
22
|
+
<div className="flex flex-col gap-4">{benefits.map(renderBenefit)}</div>
|
|
23
|
+
) : null}
|
|
24
|
+
|
|
25
|
+
<div className="bg-secondary-light h-15 flex mt-7 gap-6 px-5 py-4">
|
|
26
|
+
{insuranceSum
|
|
27
|
+
? renderValueBlock('Страховая сумма:', insuranceSum, Boolean(monthLimit))
|
|
28
|
+
: null}
|
|
29
|
+
{monthLimit
|
|
30
|
+
? renderValueBlock('Ежемесячный лимит:', monthLimit, Boolean(insuranceSum))
|
|
31
|
+
: null}
|
|
32
|
+
</div>
|
|
33
|
+
</div>
|
|
34
|
+
</div>
|
|
35
|
+
</div>
|
|
36
|
+
</section>
|
|
37
|
+
);
|
|
38
|
+
},
|
|
39
|
+
);
|
|
40
|
+
|
|
41
|
+
function renderBenefit(benefit: Benefit, i: number) {
|
|
42
|
+
return (
|
|
43
|
+
<div key={String(i)} className="flex items-center gap-5">
|
|
44
|
+
{benefit?.icon ? (
|
|
45
|
+
<Img
|
|
46
|
+
className="w-[50px] h-[50px] min-w-[50px] p-3 rounded-full bg-secondary-light"
|
|
47
|
+
image={benefit.icon}
|
|
48
|
+
width="24"
|
|
49
|
+
height="24"
|
|
50
|
+
asSVG
|
|
51
|
+
/>
|
|
52
|
+
) : null}
|
|
53
|
+
<div className="flex">
|
|
54
|
+
<div className="text-title-2xs">{benefit.label}</div>
|
|
55
|
+
</div>
|
|
56
|
+
</div>
|
|
57
|
+
);
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
function renderValueBlock(title, sum, isAnotherBlock) {
|
|
61
|
+
const widthStyle = isAnotherBlock ? 'w-fit' : 'w-full';
|
|
62
|
+
return (
|
|
63
|
+
<div className={`flex justify-between items-center gap-2 w-full ${widthStyle}`}>
|
|
64
|
+
<span className="text-secondary-text text-base">{title}</span>
|
|
65
|
+
<span className="text-primary-main text-title-2xs">{addSpacesBetweenNumbers(sum)} ₽</span>
|
|
66
|
+
</div>
|
|
67
|
+
);
|
|
68
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { Picture } from '../../model/Picture';
|
|
2
|
+
import type { BenefitsBlockContent } from '../BenefitsBlock/BenefitsBlockContent';
|
|
3
|
+
|
|
4
|
+
export type InsuranceContent = BenefitsBlockContent & {
|
|
5
|
+
/** @title Заголовок */
|
|
6
|
+
title?: string;
|
|
7
|
+
/** @title Описание */
|
|
8
|
+
description?: string;
|
|
9
|
+
/** @title Ежемесячный лимит */
|
|
10
|
+
monthLimit?: number;
|
|
11
|
+
/** @title Страховая сумма */
|
|
12
|
+
insuranceSum?: number;
|
|
13
|
+
image?: Picture;
|
|
14
|
+
};
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
{
|
|
2
|
+
"title": "Страховые риски и продукты",
|
|
3
|
+
"description": "Описание",
|
|
4
|
+
"insurance": 500000,
|
|
5
|
+
"limit": null,
|
|
6
|
+
"image": {
|
|
7
|
+
"src": "insurance.png",
|
|
8
|
+
"title": "страхование",
|
|
9
|
+
"format": "webp",
|
|
10
|
+
"alt": "страхование",
|
|
11
|
+
"size": {
|
|
12
|
+
"width": 400,
|
|
13
|
+
"height": 300
|
|
14
|
+
},
|
|
15
|
+
"sources": [
|
|
16
|
+
{
|
|
17
|
+
"src": "insurance.png 1x, insurance-2x.png 2x",
|
|
18
|
+
"format": "png"
|
|
19
|
+
}
|
|
20
|
+
]
|
|
21
|
+
},
|
|
22
|
+
"benefits": [
|
|
23
|
+
{
|
|
24
|
+
"label": "Пункт 1",
|
|
25
|
+
"icon": {
|
|
26
|
+
"icon": "ShieldTickIcon"
|
|
27
|
+
}
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
"label": "Пункт 2",
|
|
31
|
+
"icon": {
|
|
32
|
+
"icon": "ShieldTickIcon"
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
]
|
|
36
|
+
}
|
package/src/ui-kit/Icon/Icon.tsx
CHANGED
|
@@ -14,7 +14,7 @@ export const Icon = JSX<IconProps>(
|
|
|
14
14
|
...imgProps
|
|
15
15
|
}) => {
|
|
16
16
|
const href = `${projectSettings.CDN || ''}icons/${name}.svg`;
|
|
17
|
-
const svgUseStyle = iconVersion === 'white' ? 'text-black invert' : '';
|
|
17
|
+
const svgUseStyle = iconVersion === 'white' ? 'text-black invert' : 'text-primary-main';
|
|
18
18
|
|
|
19
19
|
if (asSVG) {
|
|
20
20
|
return (
|
package/src/ui-kit/Logo/Logo.tsx
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { JSX } from '@redneckz/uni-jsx';
|
|
2
2
|
import { BgColorVersion } from '../../model/BgColorVersion';
|
|
3
3
|
import { SVG } from '../SVG';
|
|
4
|
+
import { Img } from '../Img/Img';
|
|
5
|
+
import type { Picture } from '../../model/Picture';
|
|
4
6
|
|
|
5
7
|
export interface LogoProps {
|
|
6
8
|
className: string;
|
|
@@ -8,6 +10,10 @@ export interface LogoProps {
|
|
|
8
10
|
targetBlank: boolean;
|
|
9
11
|
bgColor?: string;
|
|
10
12
|
hideTitle?: boolean;
|
|
13
|
+
logo?: {
|
|
14
|
+
image?: Picture;
|
|
15
|
+
title?: string;
|
|
16
|
+
};
|
|
11
17
|
}
|
|
12
18
|
|
|
13
19
|
const LOGO_PATHS = [
|
|
@@ -27,25 +33,38 @@ const TEXT_COLOR: Record<BgColorVersion, string> = {
|
|
|
27
33
|
};
|
|
28
34
|
|
|
29
35
|
export const Logo = JSX<Partial<LogoProps>>(
|
|
30
|
-
({
|
|
36
|
+
({
|
|
37
|
+
className = '',
|
|
38
|
+
href,
|
|
39
|
+
logo,
|
|
40
|
+
children = logo?.title,
|
|
41
|
+
targetBlank,
|
|
42
|
+
bgColor = 'bg-white',
|
|
43
|
+
hideTitle,
|
|
44
|
+
}) => {
|
|
31
45
|
return (
|
|
32
46
|
<a
|
|
33
|
-
className={`inline-flex items-center font-sans no-underline ${className
|
|
47
|
+
className={`inline-flex items-center font-sans no-underline ${className}`}
|
|
34
48
|
href={href || 'https://rshb.ru/'}
|
|
35
49
|
target={targetBlank ? '_blank' : '_self'}
|
|
36
|
-
aria-label=
|
|
50
|
+
aria-label={logo?.title || 'Россельхозбанк'}
|
|
37
51
|
>
|
|
38
|
-
|
|
39
|
-
className={
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
</span>
|
|
52
|
+
{logo?.image?.src ? (
|
|
53
|
+
<Img image={logo.image} className={SVG_COLOR[bgColor]} width="40" height="45" asSVG />
|
|
54
|
+
) : (
|
|
55
|
+
<SVG
|
|
56
|
+
className={`${SVG_COLOR[bgColor]} w-10`}
|
|
57
|
+
viewBox="0 0 40 45"
|
|
58
|
+
paths={LOGO_PATHS.map((d) => ({ d }))}
|
|
59
|
+
/>
|
|
47
60
|
)}
|
|
61
|
+
{hideTitle ? null : renderTitle(children, bgColor, logo?.title)}
|
|
48
62
|
</a>
|
|
49
63
|
);
|
|
50
64
|
},
|
|
51
65
|
);
|
|
66
|
+
|
|
67
|
+
const renderTitle = (children, bgColor, title) => {
|
|
68
|
+
const text = children || title || 'Россельхозбанк';
|
|
69
|
+
return <span className={`${TEXT_COLOR[bgColor]} font-medium ml-2.5`}>{text}</span>;
|
|
70
|
+
};
|