@redneckz/wildless-cms-uni-blocks 0.3.13 → 0.3.16
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 +57 -7
- 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/ContentPage/ContentPageHead.js +1 -1
- package/dist/components/ContentPage/ContentPageHead.js.map +1 -1
- package/dist/components/Footer/Footer.mobile.js +1 -1
- package/dist/components/Footer/Footer.mobile.js.map +1 -1
- package/dist/components/Headline/Headline.js +4 -8
- package/dist/components/Headline/Headline.js.map +1 -1
- package/dist/components/Headline/Headline.mobile.js +4 -2
- package/dist/components/Headline/Headline.mobile.js.map +1 -1
- package/dist/components/Headline/HeadlineContent.d.ts +2 -2
- package/dist/components/Headline/constants.d.ts +10 -0
- package/dist/components/Headline/constants.js +25 -0
- package/dist/components/Headline/constants.js.map +1 -0
- package/dist/components/ProductBlock/ProductBlockInner.js +1 -1
- package/dist/components/ProductBlock/ProductBlockInner.js.map +1 -1
- package/dist/components/ProductBlock/ProductBlockInner.mobile.js +1 -1
- package/dist/components/ProductBlock/ProductBlockInner.mobile.js.map +1 -1
- package/dist/components/Recommendation/Recommendation.d.ts +5 -0
- package/dist/components/Recommendation/Recommendation.js +34 -0
- package/dist/components/Recommendation/Recommendation.js.map +1 -0
- package/dist/components/Recommendation/RecommendationCard.d.ts +7 -0
- package/dist/components/Recommendation/RecommendationCard.js +13 -0
- package/dist/components/Recommendation/RecommendationCard.js.map +1 -0
- package/dist/components/Recommendation/RecommendationContent.d.ts +14 -0
- package/dist/components/Recommendation/RecommendationContent.js +2 -0
- package/dist/components/Recommendation/RecommendationContent.js.map +1 -0
- package/dist/components/StepsBlock/StepsBlock.mobile.js +28 -6
- package/dist/components/StepsBlock/StepsBlock.mobile.js.map +1 -1
- package/dist/components/StepsBlock/StepsBlockContent.d.ts +2 -0
- package/dist/model/BlockVersion.d.ts +6 -1
- package/dist/ui-kit/Description/Description.js +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/ContentPage/ContentPageHead.js +1 -1
- package/lib/components/ContentPage/ContentPageHead.js.map +1 -1
- package/lib/components/Footer/Footer.mobile.js +1 -1
- package/lib/components/Footer/Footer.mobile.js.map +1 -1
- package/lib/components/Headline/Headline.fixture.d.ts +4 -2
- package/lib/components/Headline/Headline.fixture.mobile.d.ts +2 -3
- package/lib/components/Headline/Headline.js +4 -8
- package/lib/components/Headline/Headline.js.map +1 -1
- package/lib/components/Headline/Headline.mobile.js +4 -2
- package/lib/components/Headline/Headline.mobile.js.map +1 -1
- package/lib/components/Headline/HeadlineContent.d.ts +2 -2
- package/lib/components/Headline/constants.d.ts +10 -0
- package/lib/components/Headline/constants.js +23 -0
- package/lib/components/Headline/constants.js.map +1 -0
- package/lib/components/ProductBlock/ProductBlockInner.js +1 -1
- package/lib/components/ProductBlock/ProductBlockInner.js.map +1 -1
- package/lib/components/ProductBlock/ProductBlockInner.mobile.js +1 -1
- package/lib/components/ProductBlock/ProductBlockInner.mobile.js.map +1 -1
- package/lib/components/Recommendation/Recommendation.d.ts +5 -0
- package/lib/components/Recommendation/Recommendation.fixture.d.ts +6 -0
- package/lib/components/Recommendation/Recommendation.js +32 -0
- package/lib/components/Recommendation/Recommendation.js.map +1 -0
- package/lib/components/Recommendation/RecommendationCard.d.ts +7 -0
- package/lib/components/Recommendation/RecommendationCard.js +11 -0
- package/lib/components/Recommendation/RecommendationCard.js.map +1 -0
- package/lib/components/Recommendation/RecommendationContent.d.ts +14 -0
- package/lib/components/Recommendation/RecommendationContent.js +2 -0
- package/lib/components/Recommendation/RecommendationContent.js.map +1 -0
- package/lib/components/StepsBlock/StepsBlock.fixture.mobile.d.ts +1 -4
- package/lib/components/StepsBlock/StepsBlock.mobile.js +28 -6
- package/lib/components/StepsBlock/StepsBlock.mobile.js.map +1 -1
- package/lib/components/StepsBlock/StepsBlockContent.d.ts +2 -0
- package/lib/model/BlockVersion.d.ts +6 -1
- package/lib/ui-kit/Description/Description.js +1 -1
- package/mobile/bundle/bundle.umd.js +69 -23
- package/mobile/bundle/bundle.umd.min.js +1 -1
- package/mobile/dist/components/ContentPage/ContentPageHead.js +1 -1
- package/mobile/dist/components/ContentPage/ContentPageHead.js.map +1 -1
- package/mobile/dist/components/Footer/Footer.js +1 -1
- package/mobile/dist/components/Footer/Footer.js.map +1 -1
- package/mobile/dist/components/Headline/Headline.js +4 -2
- package/mobile/dist/components/Headline/Headline.js.map +1 -1
- package/mobile/dist/components/Headline/HeadlineContent.d.ts +2 -2
- package/mobile/dist/components/Headline/constants.d.ts +10 -0
- package/mobile/dist/components/Headline/constants.js +25 -0
- package/mobile/dist/components/Headline/constants.js.map +1 -0
- package/mobile/dist/components/ProductBlock/ProductBlockInner.js +1 -1
- package/mobile/dist/components/ProductBlock/ProductBlockInner.js.map +1 -1
- package/mobile/dist/components/Recommendation/Recommendation.d.ts +5 -0
- package/mobile/dist/components/Recommendation/Recommendation.js +34 -0
- package/mobile/dist/components/Recommendation/Recommendation.js.map +1 -0
- package/mobile/dist/components/Recommendation/RecommendationCard.d.ts +7 -0
- package/mobile/dist/components/Recommendation/RecommendationCard.js +13 -0
- package/mobile/dist/components/Recommendation/RecommendationCard.js.map +1 -0
- package/mobile/dist/components/Recommendation/RecommendationContent.d.ts +14 -0
- package/mobile/dist/components/Recommendation/RecommendationContent.js +2 -0
- package/mobile/dist/components/Recommendation/RecommendationContent.js.map +1 -0
- package/mobile/dist/components/StepsBlock/StepsBlock.js +28 -6
- package/mobile/dist/components/StepsBlock/StepsBlock.js.map +1 -1
- package/mobile/dist/components/StepsBlock/StepsBlockContent.d.ts +2 -0
- package/mobile/dist/model/BlockVersion.d.ts +6 -1
- package/mobile/dist/ui-kit/Description/Description.js +1 -1
- package/mobile/lib/components/ContentPage/ContentPageHead.js +1 -1
- package/mobile/lib/components/ContentPage/ContentPageHead.js.map +1 -1
- package/mobile/lib/components/Footer/Footer.js +1 -1
- package/mobile/lib/components/Footer/Footer.js.map +1 -1
- package/mobile/lib/components/Headline/Headline.js +4 -2
- package/mobile/lib/components/Headline/Headline.js.map +1 -1
- package/mobile/lib/components/Headline/HeadlineContent.d.ts +2 -2
- package/mobile/lib/components/Headline/constants.d.ts +10 -0
- package/mobile/lib/components/Headline/constants.js +23 -0
- package/mobile/lib/components/Headline/constants.js.map +1 -0
- package/mobile/lib/components/ProductBlock/ProductBlockInner.js +1 -1
- package/mobile/lib/components/ProductBlock/ProductBlockInner.js.map +1 -1
- package/mobile/lib/components/Recommendation/Recommendation.d.ts +5 -0
- package/mobile/lib/components/Recommendation/Recommendation.js +32 -0
- package/mobile/lib/components/Recommendation/Recommendation.js.map +1 -0
- package/mobile/lib/components/Recommendation/RecommendationCard.d.ts +7 -0
- package/mobile/lib/components/Recommendation/RecommendationCard.js +11 -0
- package/mobile/lib/components/Recommendation/RecommendationCard.js.map +1 -0
- package/mobile/lib/components/Recommendation/RecommendationContent.d.ts +14 -0
- package/mobile/lib/components/Recommendation/RecommendationContent.js +2 -0
- package/mobile/lib/components/Recommendation/RecommendationContent.js.map +1 -0
- package/mobile/lib/components/StepsBlock/StepsBlock.js +28 -6
- package/mobile/lib/components/StepsBlock/StepsBlock.js.map +1 -1
- package/mobile/lib/components/StepsBlock/StepsBlockContent.d.ts +2 -0
- package/mobile/lib/model/BlockVersion.d.ts +6 -1
- package/mobile/lib/ui-kit/Description/Description.js +1 -1
- package/mobile/src/components/ContentPage/ContentPage.page.json +74 -0
- package/mobile/src/components/ContentPage/ContentPageHead.tsx +1 -1
- package/mobile/src/components/Footer/Footer.tsx +2 -2
- package/mobile/src/components/Headline/Headline.example.json +1 -1
- package/mobile/src/components/Headline/Headline.tsx +25 -4
- package/mobile/src/components/Headline/HeadlineContent.ts +2 -3
- package/mobile/src/components/Headline/constants.ts +32 -0
- package/mobile/src/components/ProductBlock/ProductBlockInner.tsx +3 -1
- package/mobile/src/components/Recommendation/Recommendation.example.json +38 -0
- package/mobile/src/components/Recommendation/Recommendation.tsx +105 -0
- package/mobile/src/components/Recommendation/RecommendationCard.tsx +33 -0
- package/mobile/src/components/Recommendation/RecommendationContent.ts +19 -0
- package/mobile/src/components/StepsBlock/StepsBlock.tsx +60 -19
- package/mobile/src/components/StepsBlock/StepsBlockContent.ts +2 -1
- package/mobile/src/model/BlockVersion.ts +7 -1
- package/mobile/src/ui-kit/Description/Description.tsx +1 -1
- package/package.json +1 -1
- package/src/components/Blocks.ts +2 -0
- package/src/components/ContentPage/ContentPage.page.json +74 -0
- package/src/components/ContentPage/ContentPageHead.tsx +1 -1
- package/src/components/Footer/Footer.mobile.tsx +2 -2
- package/src/components/Headline/Headline.example.json +1 -1
- package/src/components/Headline/Headline.fixture.mobile.tsx +39 -15
- package/src/components/Headline/Headline.fixture.tsx +20 -17
- package/src/components/Headline/Headline.mobile.tsx +25 -4
- package/src/components/Headline/Headline.tsx +10 -12
- package/src/components/Headline/HeadlineContent.ts +2 -3
- package/src/components/Headline/constants.ts +32 -0
- package/src/components/ProductBlock/ProductBlockInner.mobile.tsx +3 -1
- package/src/components/ProductBlock/ProductBlockInner.tsx +1 -1
- package/src/components/Recommendation/Recommendation.example.json +38 -0
- package/src/components/Recommendation/Recommendation.fixture.tsx +73 -0
- package/src/components/Recommendation/Recommendation.tsx +105 -0
- package/src/components/Recommendation/RecommendationCard.tsx +33 -0
- package/src/components/Recommendation/RecommendationContent.ts +19 -0
- package/src/components/StepsBlock/StepsBlock.fixture.mobile.tsx +127 -72
- package/src/components/StepsBlock/StepsBlock.mobile.tsx +60 -19
- package/src/components/StepsBlock/StepsBlockContent.ts +2 -1
- package/src/model/BlockVersion.ts +7 -1
- package/src/ui-kit/Description/Description.tsx +1 -1
|
@@ -8,7 +8,7 @@ export const HEADLINE: HeadlineContent = {
|
|
|
8
8
|
title: 'Своя кредитная карта',
|
|
9
9
|
description: 'Карта работает в 180 странах мира. Бесплатное снятие наличных в любых банкоматах.',
|
|
10
10
|
align: 'center',
|
|
11
|
-
|
|
11
|
+
bgColorHeadline: 'transparent',
|
|
12
12
|
};
|
|
13
13
|
|
|
14
14
|
const image: Picture = {
|
|
@@ -20,47 +20,71 @@ const image: Picture = {
|
|
|
20
20
|
},
|
|
21
21
|
};
|
|
22
22
|
|
|
23
|
+
const defaultProps: HeadlineContent = {
|
|
24
|
+
title: 'Копите в нескольких валютах',
|
|
25
|
+
description:
|
|
26
|
+
'Откройте мультивалютный вклад, чтобы распределить свои вложения. Это до 4 счетов в разных валютах внутри одного вклада',
|
|
27
|
+
image: image,
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
const primaryProps: HeadlineContent = {
|
|
31
|
+
...defaultProps,
|
|
32
|
+
bgColorHeadline: 'primary',
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
const secondaryProps: HeadlineContent = {
|
|
36
|
+
...defaultProps,
|
|
37
|
+
bgColorHeadline: 'secondary',
|
|
38
|
+
};
|
|
39
|
+
|
|
23
40
|
export default {
|
|
24
41
|
default: (
|
|
25
42
|
<div className="container grid grid-cols-12">
|
|
26
|
-
<Headline
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
title="Копите в нескольких валютах"
|
|
30
|
-
description="Откройте мультивалютный вклад, чтобы распределить свои вложения. Это до 4 счетов в разных валютах внутри одного вклада"
|
|
31
|
-
image={image}
|
|
32
|
-
/>
|
|
43
|
+
<Headline className="col-span-12" context={context} {...defaultProps} align="left" />
|
|
44
|
+
<Headline className="col-span-12" context={context} {...defaultProps} align="center" />
|
|
45
|
+
<Headline className="col-span-12" context={context} {...defaultProps} align="right" />
|
|
33
46
|
</div>
|
|
34
47
|
),
|
|
35
|
-
|
|
48
|
+
|
|
49
|
+
primary: (
|
|
36
50
|
<div className="container grid grid-cols-12">
|
|
51
|
+
<Headline className="col-span-12" context={context} {...primaryProps} align="left" />
|
|
52
|
+
<Headline className="col-span-12" context={context} {...primaryProps} align="center" />
|
|
53
|
+
<Headline className="col-span-12" context={context} {...primaryProps} align="right" />
|
|
37
54
|
<Headline
|
|
38
55
|
className="col-span-12"
|
|
39
56
|
context={context}
|
|
40
57
|
title="Копите в нескольких валютах"
|
|
41
58
|
image={image}
|
|
59
|
+
bgColorHeadline="primary"
|
|
42
60
|
/>
|
|
43
|
-
</div>
|
|
44
|
-
),
|
|
45
|
-
'desc-img': (
|
|
46
|
-
<div className="container grid grid-cols-12">
|
|
47
61
|
<Headline
|
|
48
62
|
className="col-span-12"
|
|
49
63
|
context={context}
|
|
50
64
|
description="Откройте мультивалютный вклад, чтобы распределить свои вложения. Это до 4 счетов в разных валютах внутри одного вклада"
|
|
51
65
|
image={image}
|
|
66
|
+
bgColorHeadline="primary"
|
|
52
67
|
/>
|
|
53
68
|
</div>
|
|
54
69
|
),
|
|
55
|
-
|
|
70
|
+
secondary: (
|
|
56
71
|
<div className="container grid grid-cols-12">
|
|
72
|
+
<Headline className="col-span-12" context={context} {...secondaryProps} align="left" />
|
|
73
|
+
<Headline className="col-span-12" context={context} {...secondaryProps} align="center" />
|
|
74
|
+
<Headline className="col-span-12" context={context} {...secondaryProps} align="right" />
|
|
57
75
|
<Headline
|
|
58
76
|
className="col-span-12"
|
|
59
77
|
context={context}
|
|
60
78
|
title="Копите в нескольких валютах"
|
|
79
|
+
image={image}
|
|
80
|
+
bgColorHeadline="secondary"
|
|
81
|
+
/>
|
|
82
|
+
<Headline
|
|
83
|
+
className="col-span-12"
|
|
84
|
+
context={context}
|
|
61
85
|
description="Откройте мультивалютный вклад, чтобы распределить свои вложения. Это до 4 счетов в разных валютах внутри одного вклада"
|
|
62
|
-
bgColor="bg-white"
|
|
63
86
|
image={image}
|
|
87
|
+
bgColorHeadline="secondary"
|
|
64
88
|
/>
|
|
65
89
|
</div>
|
|
66
90
|
),
|
|
@@ -7,35 +7,38 @@ export const HEADLINE: HeadlineContent = {
|
|
|
7
7
|
title: 'Своя кредитная карта',
|
|
8
8
|
description: 'Карта работает в 180 странах мира. Бесплатное снятие наличных в любых банкоматах.',
|
|
9
9
|
align: 'center',
|
|
10
|
-
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
export const HEADLINE_PRIMARY: HeadlineContent = {
|
|
13
|
+
...HEADLINE,
|
|
14
|
+
bgColorHeadline: 'primary',
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
export const HEADLINE_SECONDARY: HeadlineContent = {
|
|
18
|
+
...HEADLINE,
|
|
19
|
+
bgColorHeadline: 'secondary',
|
|
11
20
|
};
|
|
12
21
|
|
|
13
22
|
export default {
|
|
14
23
|
default: (
|
|
15
24
|
<div className="container grid grid-cols-12">
|
|
16
25
|
<Headline className="col-span-12" context={context} {...HEADLINE} />
|
|
26
|
+
<Headline className="col-span-12" context={context} {...HEADLINE} align="left" />
|
|
27
|
+
<Headline className="col-span-12" context={context} {...HEADLINE} align="right" />
|
|
17
28
|
</div>
|
|
18
29
|
),
|
|
19
|
-
|
|
30
|
+
primary: (
|
|
20
31
|
<div className="container grid grid-cols-12">
|
|
21
|
-
<Headline
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
{...HEADLINE}
|
|
25
|
-
align="left"
|
|
26
|
-
bgColor="bg-white"
|
|
27
|
-
/>
|
|
32
|
+
<Headline className="col-span-12" context={context} {...HEADLINE_PRIMARY} />
|
|
33
|
+
<Headline className="col-span-12" context={context} {...HEADLINE_PRIMARY} align="left" />
|
|
34
|
+
<Headline className="col-span-12" context={context} {...HEADLINE_PRIMARY} align="right" />
|
|
28
35
|
</div>
|
|
29
36
|
),
|
|
30
|
-
|
|
37
|
+
secondary: (
|
|
31
38
|
<div className="container grid grid-cols-12">
|
|
32
|
-
<Headline
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
{...HEADLINE}
|
|
36
|
-
align="right"
|
|
37
|
-
bgColor="transparent"
|
|
38
|
-
/>
|
|
39
|
+
<Headline className="col-span-12" context={context} {...HEADLINE_SECONDARY} />
|
|
40
|
+
<Headline className="col-span-12" context={context} {...HEADLINE_SECONDARY} align="left" />
|
|
41
|
+
<Headline className="col-span-12" context={context} {...HEADLINE_SECONDARY} align="right" />
|
|
39
42
|
</div>
|
|
40
43
|
),
|
|
41
44
|
};
|
|
@@ -3,17 +3,38 @@ import { JSX } from '@redneckz/uni-jsx';
|
|
|
3
3
|
import type { UniBlockProps } from '../../types';
|
|
4
4
|
import { Heading } from '../../ui-kit/Heading/Heading';
|
|
5
5
|
import { Img } from '../../ui-kit/Img/Img';
|
|
6
|
+
import { ALIGN_TEXT, HEADLINE_BLOCK_STYLE_MAPS } from './constants';
|
|
6
7
|
import type { HeadlineContent } from './HeadlineContent';
|
|
7
8
|
|
|
8
9
|
export interface HeadlineProps extends UniBlockProps, HeadlineContent {}
|
|
9
10
|
|
|
10
11
|
export const Headline = JSX<HeadlineProps>(
|
|
11
|
-
({
|
|
12
|
+
({
|
|
13
|
+
bgColorHeadline = 'transparent',
|
|
14
|
+
className = '',
|
|
15
|
+
title,
|
|
16
|
+
description,
|
|
17
|
+
image,
|
|
18
|
+
align = 'left',
|
|
19
|
+
}) => {
|
|
20
|
+
const STYLE_MAPS = HEADLINE_BLOCK_STYLE_MAPS[bgColorHeadline];
|
|
12
21
|
return (
|
|
13
|
-
<section className={`px-4 py-6 ${
|
|
14
|
-
{title &&
|
|
22
|
+
<section className={`px-4 py-6 ${STYLE_MAPS.background} ${className}`}>
|
|
23
|
+
{title && (
|
|
24
|
+
<Heading
|
|
25
|
+
headingType="h2"
|
|
26
|
+
className={`${STYLE_MAPS.text} ${ALIGN_TEXT[align]}`}
|
|
27
|
+
title={title}
|
|
28
|
+
/>
|
|
29
|
+
)}
|
|
15
30
|
{description && (
|
|
16
|
-
<p
|
|
31
|
+
<p
|
|
32
|
+
className={`font-normal text-m-md ${STYLE_MAPS.description} ${ALIGN_TEXT[align]} ${
|
|
33
|
+
title ? 'mt-2.5' : ''
|
|
34
|
+
}`}
|
|
35
|
+
>
|
|
36
|
+
{description}
|
|
37
|
+
</p>
|
|
17
38
|
)}
|
|
18
39
|
{image?.src && (
|
|
19
40
|
<div className="mt-5 mx-auto flex justify-center">
|
|
@@ -2,27 +2,25 @@ import { JSX } from '@redneckz/uni-jsx';
|
|
|
2
2
|
|
|
3
3
|
import type { UniBlockProps } from '../../types';
|
|
4
4
|
import { Heading } from '../../ui-kit/Heading/Heading';
|
|
5
|
-
import {
|
|
5
|
+
import { ALIGN_TEXT, HEADLINE_BLOCK_STYLE_MAPS } from './constants';
|
|
6
6
|
import type { HeadlineContent } from './HeadlineContent';
|
|
7
7
|
|
|
8
8
|
export interface HeadlineProps extends UniBlockProps, HeadlineContent {}
|
|
9
9
|
|
|
10
|
-
const alignText: Record<AlignType, string> = {
|
|
11
|
-
left: 'text-left',
|
|
12
|
-
center: 'text-center',
|
|
13
|
-
right: 'text-right',
|
|
14
|
-
};
|
|
15
|
-
|
|
16
10
|
export const Headline = JSX<HeadlineProps>(
|
|
17
|
-
({
|
|
18
|
-
const
|
|
11
|
+
({ bgColorHeadline = 'transparent', align = 'left', className = '', title, description }) => {
|
|
12
|
+
const STYLE_MAPS = HEADLINE_BLOCK_STYLE_MAPS[bgColorHeadline];
|
|
19
13
|
return (
|
|
20
|
-
<section className={`p-[50px] ${
|
|
14
|
+
<section className={`p-[50px] ${STYLE_MAPS.background} ${className}`}>
|
|
21
15
|
{title && (
|
|
22
|
-
<Heading
|
|
16
|
+
<Heading
|
|
17
|
+
headingType="h2"
|
|
18
|
+
className={`text-primary-text ${ALIGN_TEXT[align]}`}
|
|
19
|
+
title={title}
|
|
20
|
+
/>
|
|
23
21
|
)}
|
|
24
22
|
{description && (
|
|
25
|
-
<p className={`font-normal text-base mt-4 ${
|
|
23
|
+
<p className={`font-normal text-base mt-4 ${ALIGN_TEXT[align]}`}>{description}</p>
|
|
26
24
|
)}
|
|
27
25
|
</section>
|
|
28
26
|
);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { BlockVersionWithTransparent } from '../../model/BlockVersion';
|
|
2
2
|
import type { DescriptionContent } from '../../ui-kit/Description/DescriptionContent';
|
|
3
3
|
import type { HeadingContent } from '../../ui-kit/Heading/HeadingContent';
|
|
4
4
|
import type { ImageContent } from '../../ui-kit/Img/ImgProps';
|
|
@@ -11,6 +11,5 @@ export type HeadlineContent = HeadingContent &
|
|
|
11
11
|
DescriptionContent &
|
|
12
12
|
ImageContent & {
|
|
13
13
|
align?: AlignType;
|
|
14
|
-
|
|
15
|
-
bgColor?: BgColorVersion;
|
|
14
|
+
bgColorHeadline?: BlockVersionWithTransparent;
|
|
16
15
|
};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import type { AlignType } from '../BaseTile/BaseTileProps';
|
|
2
|
+
import type { BlockVersionWithTransparent } from '../../model/BlockVersion';
|
|
3
|
+
|
|
4
|
+
export const ALIGN_TEXT: Record<AlignType, string> = {
|
|
5
|
+
left: 'text-left',
|
|
6
|
+
center: 'text-center',
|
|
7
|
+
right: 'text-right',
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
type StyleType = {
|
|
11
|
+
background: string;
|
|
12
|
+
text: string;
|
|
13
|
+
description: string;
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
export const HEADLINE_BLOCK_STYLE_MAPS: Record<BlockVersionWithTransparent, StyleType> = {
|
|
17
|
+
transparent: {
|
|
18
|
+
background: 'bg-transparent',
|
|
19
|
+
text: 'text-primary-text',
|
|
20
|
+
description: 'text-primary-text',
|
|
21
|
+
},
|
|
22
|
+
primary: {
|
|
23
|
+
background: 'bg-white',
|
|
24
|
+
text: 'text-primary-text',
|
|
25
|
+
description: 'text-primary-text',
|
|
26
|
+
},
|
|
27
|
+
secondary: {
|
|
28
|
+
background: 'bg-primary-main',
|
|
29
|
+
text: 'text-white',
|
|
30
|
+
description: 'text-white/80',
|
|
31
|
+
},
|
|
32
|
+
};
|
|
@@ -48,7 +48,9 @@ export const ProductBlockInner = JSX<ProductBlockInnerProps>(
|
|
|
48
48
|
) : null
|
|
49
49
|
}
|
|
50
50
|
>
|
|
51
|
-
{description ?
|
|
51
|
+
{description ? (
|
|
52
|
+
<Description className="mt-3 text-m-md" description={description} />
|
|
53
|
+
) : null}
|
|
52
54
|
{benefits?.filter((items) => items.label)?.length ? (
|
|
53
55
|
<div className="mt-3">{benefits.map((_, i) => renderBenefit(_, i, version))}</div>
|
|
54
56
|
) : null}
|
|
@@ -45,7 +45,7 @@ export const ProductBlockInner = JSX<ProductBlockInnerProps>(
|
|
|
45
45
|
}
|
|
46
46
|
>
|
|
47
47
|
{description && (
|
|
48
|
-
<Description className="
|
|
48
|
+
<Description className="mt-4 max-w-[600px]" description={description} />
|
|
49
49
|
)}
|
|
50
50
|
{benefits?.filter((items) => items.label)?.length ? (
|
|
51
51
|
<div className="flex gap-6 mt-6">
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
{
|
|
2
|
+
"title": "Блок рекомендаций",
|
|
3
|
+
"recommendations": [
|
|
4
|
+
{
|
|
5
|
+
"image": {
|
|
6
|
+
"format": "webp",
|
|
7
|
+
"size": {
|
|
8
|
+
"width": 180,
|
|
9
|
+
"height": 180
|
|
10
|
+
}
|
|
11
|
+
},
|
|
12
|
+
"title": "Заголовок 1",
|
|
13
|
+
"description": "Описание 1"
|
|
14
|
+
},
|
|
15
|
+
{
|
|
16
|
+
"image": {
|
|
17
|
+
"format": "webp",
|
|
18
|
+
"size": {
|
|
19
|
+
"width": 180,
|
|
20
|
+
"height": 180
|
|
21
|
+
}
|
|
22
|
+
},
|
|
23
|
+
"title": "Заголовок 2",
|
|
24
|
+
"description": "Описание 2"
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
"image": {
|
|
28
|
+
"format": "webp",
|
|
29
|
+
"size": {
|
|
30
|
+
"width": 180,
|
|
31
|
+
"height": 180
|
|
32
|
+
}
|
|
33
|
+
},
|
|
34
|
+
"title": "Заголовок 3",
|
|
35
|
+
"description": "Описание 3"
|
|
36
|
+
}
|
|
37
|
+
]
|
|
38
|
+
}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import type { Picture } from '../../model/Picture';
|
|
2
|
+
import { context } from '../../setup-fixture';
|
|
3
|
+
import { Recommendation, RecommendationProps } from './Recommendation';
|
|
4
|
+
|
|
5
|
+
const creditCard: Picture = {
|
|
6
|
+
src: 'credit-card-1.png',
|
|
7
|
+
format: 'webp',
|
|
8
|
+
size: {
|
|
9
|
+
width: 180,
|
|
10
|
+
height: 180,
|
|
11
|
+
},
|
|
12
|
+
title: 'credit-card-1',
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
const chair: Picture = {
|
|
16
|
+
src: 'chair.png',
|
|
17
|
+
format: 'webp',
|
|
18
|
+
size: {
|
|
19
|
+
width: 180,
|
|
20
|
+
height: 180,
|
|
21
|
+
},
|
|
22
|
+
title: 'chair',
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
export const defaultProps: RecommendationProps = {
|
|
26
|
+
context,
|
|
27
|
+
title: 'С этим продуктом приобретают',
|
|
28
|
+
recommendations: [
|
|
29
|
+
{
|
|
30
|
+
title: 'Кредиты',
|
|
31
|
+
items: ['до 10 000 000 ₽', 'до 10 лет'],
|
|
32
|
+
image: chair,
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
title: 'Кредитные карты',
|
|
36
|
+
description: 'Льготный период 120 дней',
|
|
37
|
+
image: creditCard,
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
title: 'Кредитные карты',
|
|
41
|
+
description: 'Льготный период 120 дней',
|
|
42
|
+
image: creditCard,
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
title: 'Кредитные карты',
|
|
46
|
+
description: 'Льготный период 120 дней',
|
|
47
|
+
image: creditCard,
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
title: 'Кредитные карты',
|
|
51
|
+
description: 'Льготный период 120 дней',
|
|
52
|
+
image: creditCard,
|
|
53
|
+
},
|
|
54
|
+
],
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
export default {
|
|
58
|
+
default: (
|
|
59
|
+
<div>
|
|
60
|
+
<div className="container grid grid-cols-12" data-theme="pc">
|
|
61
|
+
<Recommendation className="col-span-12 mb-1" version="secondary" {...defaultProps} />
|
|
62
|
+
</div>
|
|
63
|
+
|
|
64
|
+
<div className="container grid grid-cols-12" data-theme="bc">
|
|
65
|
+
<Recommendation className="col-span-12 mb-1" version="secondary" {...defaultProps} />
|
|
66
|
+
</div>
|
|
67
|
+
|
|
68
|
+
<div className="container grid grid-cols-12 mb-1">
|
|
69
|
+
<Recommendation className="col-span-12" {...defaultProps} />
|
|
70
|
+
</div>
|
|
71
|
+
</div>
|
|
72
|
+
),
|
|
73
|
+
};
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
import { JSX } from '@redneckz/uni-jsx';
|
|
2
|
+
import type { UniBlockProps } from '../../types';
|
|
3
|
+
import { ArrowButton } from '../../ui-kit/Button/ArrowButton';
|
|
4
|
+
import { Heading } from '../../ui-kit/Heading/Heading';
|
|
5
|
+
import { RecommendationCard } from './RecommendationCard';
|
|
6
|
+
import type { RecommendationCardContent, RecommendationContent } from './RecommendationContent';
|
|
7
|
+
|
|
8
|
+
const BLUR_BLOCK_CLASSES = 'absolute top-0 bottom-0 w-[84px]';
|
|
9
|
+
const CARD_FULL_VIEW_COUNT = 2;
|
|
10
|
+
const CARD_SHIFT = 525;
|
|
11
|
+
|
|
12
|
+
export interface RecommendationProps extends RecommendationContent, UniBlockProps {}
|
|
13
|
+
|
|
14
|
+
export const Recommendation = JSX<RecommendationProps>(
|
|
15
|
+
({ context, recommendations = [], className = '', title, version }) => {
|
|
16
|
+
const [activeCardIndex, setActiveCardIndex] = context.useState(0);
|
|
17
|
+
|
|
18
|
+
const blockClassName =
|
|
19
|
+
version === 'secondary' ? 'bg-primary-main text-white' : 'bg-white text-primary-text';
|
|
20
|
+
const cardClassName = version === 'secondary' ? 'border-main-divider' : 'border-main-stroke';
|
|
21
|
+
|
|
22
|
+
return (
|
|
23
|
+
<section
|
|
24
|
+
className={`relative font-sans p-[50px] overflow-hidden ${blockClassName} ${className}`}
|
|
25
|
+
>
|
|
26
|
+
{title ? <Heading headingType="h3" className="mb-8" title={title} /> : null}
|
|
27
|
+
<div
|
|
28
|
+
className="flex duration-1000 gap-4"
|
|
29
|
+
style={{ transform: `translateX(-${activeCardIndex * CARD_SHIFT}px)` }}
|
|
30
|
+
role="list"
|
|
31
|
+
>
|
|
32
|
+
{recommendations?.length
|
|
33
|
+
? recommendations.map(
|
|
34
|
+
renderRecommendationCard({ context, version, className: cardClassName }),
|
|
35
|
+
)
|
|
36
|
+
: null}
|
|
37
|
+
</div>
|
|
38
|
+
{renderNavButtons({
|
|
39
|
+
cardsCount: recommendations.length,
|
|
40
|
+
activeCardIndex,
|
|
41
|
+
setActiveCardIndex,
|
|
42
|
+
})}
|
|
43
|
+
<div
|
|
44
|
+
className={`${BLUR_BLOCK_CLASSES} left-0 ${
|
|
45
|
+
version === 'secondary' ? 'bg-opacity-from-main' : 'bg-opacity-from-white'
|
|
46
|
+
}`}
|
|
47
|
+
/>
|
|
48
|
+
<div
|
|
49
|
+
className={`${BLUR_BLOCK_CLASSES} right-0 ${
|
|
50
|
+
version === 'secondary' ? 'bg-opacity-to-main' : 'bg-opacity-to-white'
|
|
51
|
+
}`}
|
|
52
|
+
/>
|
|
53
|
+
</section>
|
|
54
|
+
);
|
|
55
|
+
},
|
|
56
|
+
);
|
|
57
|
+
|
|
58
|
+
const renderRecommendationCard =
|
|
59
|
+
({ context, version, className }) =>
|
|
60
|
+
(card: RecommendationCardContent, i: number) => {
|
|
61
|
+
return (
|
|
62
|
+
<RecommendationCard
|
|
63
|
+
key={String(i)}
|
|
64
|
+
context={context}
|
|
65
|
+
{...card}
|
|
66
|
+
version={version}
|
|
67
|
+
className={className}
|
|
68
|
+
/>
|
|
69
|
+
);
|
|
70
|
+
};
|
|
71
|
+
|
|
72
|
+
const renderNavButtons = ({
|
|
73
|
+
cardsCount,
|
|
74
|
+
activeCardIndex,
|
|
75
|
+
setActiveCardIndex,
|
|
76
|
+
}: {
|
|
77
|
+
cardsCount: number;
|
|
78
|
+
activeCardIndex: number;
|
|
79
|
+
setActiveCardIndex: (number) => void;
|
|
80
|
+
}) => {
|
|
81
|
+
const handleNextClick = () => setActiveCardIndex(activeCardIndex + 1);
|
|
82
|
+
const handlePrevClick = () => setActiveCardIndex(activeCardIndex - 1);
|
|
83
|
+
const isUseSlider = cardsCount > CARD_FULL_VIEW_COUNT;
|
|
84
|
+
const showNextButton = isUseSlider && cardsCount - activeCardIndex > CARD_FULL_VIEW_COUNT;
|
|
85
|
+
const showPrevButton = isUseSlider && activeCardIndex > 0;
|
|
86
|
+
|
|
87
|
+
return (
|
|
88
|
+
<div>
|
|
89
|
+
{showPrevButton && (
|
|
90
|
+
<ArrowButton
|
|
91
|
+
className="absolute top-1/2 left-8 rotate-180 z-10 mt-6"
|
|
92
|
+
onClick={handlePrevClick}
|
|
93
|
+
ariaLabel="Пролистать влево"
|
|
94
|
+
/>
|
|
95
|
+
)}
|
|
96
|
+
{showNextButton && (
|
|
97
|
+
<ArrowButton
|
|
98
|
+
className="absolute top-1/2 right-8 z-10 mt-6"
|
|
99
|
+
onClick={handleNextClick}
|
|
100
|
+
ariaLabel="Пролистать вправо"
|
|
101
|
+
/>
|
|
102
|
+
)}
|
|
103
|
+
</div>
|
|
104
|
+
);
|
|
105
|
+
};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { JSX } from '@redneckz/uni-jsx';
|
|
2
|
+
import type { BlockVersion } from '../../model/BlockVersion';
|
|
3
|
+
import type { UniBlockProps } from '../../types';
|
|
4
|
+
import { Description } from '../../ui-kit/Description/Description';
|
|
5
|
+
import { Heading } from '../../ui-kit/Heading/Heading';
|
|
6
|
+
import { Img } from '../../ui-kit/Img/Img';
|
|
7
|
+
import { List } from '../../ui-kit/List/List';
|
|
8
|
+
import { BaseTile } from '../BaseTile/BaseTile';
|
|
9
|
+
import type { RecommendationCardContent } from './RecommendationContent';
|
|
10
|
+
|
|
11
|
+
export interface RecommendationCardProps extends RecommendationCardContent, UniBlockProps {
|
|
12
|
+
version?: BlockVersion;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export const RecommendationCard = JSX<RecommendationCardProps>(
|
|
16
|
+
({ context, className = '', title, description, items, image, version }) => {
|
|
17
|
+
return (
|
|
18
|
+
<section
|
|
19
|
+
className={`border border-solid box-border rounded-md p-7 min-w-[515px] max-w-[515px] ${className}`}
|
|
20
|
+
role="listitem"
|
|
21
|
+
>
|
|
22
|
+
<BaseTile
|
|
23
|
+
context={context}
|
|
24
|
+
title={title && <Heading headingType="h4" title={title} className="mb-4" />}
|
|
25
|
+
image={image?.src && <Img className="mt-auto ml-7" image={image} />}
|
|
26
|
+
>
|
|
27
|
+
{description ? <Description description={description} /> : null}
|
|
28
|
+
{items?.length ? <List items={items} version={version} /> : null}
|
|
29
|
+
</BaseTile>
|
|
30
|
+
</section>
|
|
31
|
+
);
|
|
32
|
+
},
|
|
33
|
+
);
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { BlockVersion } from '../../model/BlockVersion';
|
|
2
|
+
import type { DescriptionContent } from '../../ui-kit/Description/DescriptionContent';
|
|
3
|
+
import type { HeadingContent } from '../../ui-kit/Heading/HeadingContent';
|
|
4
|
+
import type { ImageContent } from '../../ui-kit/Img/ImgProps';
|
|
5
|
+
import type { ListContent } from '../../ui-kit/List/ListContent';
|
|
6
|
+
|
|
7
|
+
export type RecommendationCardContent = HeadingContent &
|
|
8
|
+
DescriptionContent &
|
|
9
|
+
ListContent &
|
|
10
|
+
ImageContent;
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* @title Рекомендации
|
|
14
|
+
*/
|
|
15
|
+
export interface RecommendationContent extends HeadingContent {
|
|
16
|
+
/** @title Карточки */
|
|
17
|
+
recommendations?: RecommendationCardContent[];
|
|
18
|
+
version?: BlockVersion;
|
|
19
|
+
}
|