@redneckz/wildless-cms-uni-blocks 0.3.31 → 0.3.32
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/README.md +1 -1
- package/bundle/blocks.schema.json +1 -1
- package/bundle/bundle.umd.js +54 -28
- package/bundle/bundle.umd.min.js +1 -1
- package/dist/components/MobileAppTile/MobileAppTile.js +1 -1
- package/dist/components/MobileAppTile/MobileAppTile.js.map +1 -1
- package/dist/components/PictureText/PictureText.js +8 -4
- package/dist/components/PictureText/PictureText.js.map +1 -1
- package/dist/components/PictureText/PictureTextContent.d.ts +7 -0
- package/dist/components/ProductGalleryGreen/ProductGalleryGreen.js +31 -15
- package/dist/components/ProductGalleryGreen/ProductGalleryGreen.js.map +1 -1
- package/dist/components/ProductGalleryGreen/ProductGalleryGreenContent.d.ts +2 -0
- package/dist/components/Recommendation/Recommendation.js +1 -1
- package/dist/components/Recommendation/RecommendationCard.js +1 -1
- package/dist/components/Recommendation/RecommendationCard.js.map +1 -1
- package/dist/components/StepsBlock/StepsBlock.js +8 -2
- package/dist/components/StepsBlock/StepsBlock.js.map +1 -1
- package/dist/components/StepsBlock/StepsBlock.mobile.js +10 -4
- package/dist/components/StepsBlock/StepsBlock.mobile.js.map +1 -1
- package/dist/components/StepsBlock/StepsBlockContent.d.ts +3 -2
- package/dist/ui-kit/Button/ButtonInner.js +1 -1
- package/dist/ui-kit/Button/ButtonInner.js.map +1 -1
- package/dist/ui-kit/Heading/Heading.js +1 -1
- package/dist/ui-kit/Heading/Heading.js.map +1 -1
- package/lib/common.css +1 -1
- package/lib/components/MobileAppTile/MobileAppTile.js +1 -1
- package/lib/components/MobileAppTile/MobileAppTile.js.map +1 -1
- package/lib/components/PictureText/PictureText.js +8 -4
- package/lib/components/PictureText/PictureText.js.map +1 -1
- package/lib/components/PictureText/PictureTextContent.d.ts +7 -0
- package/lib/components/ProductGalleryGreen/ProductGalleryGreen.fixture.d.ts +1 -0
- package/lib/components/ProductGalleryGreen/ProductGalleryGreen.js +31 -15
- package/lib/components/ProductGalleryGreen/ProductGalleryGreen.js.map +1 -1
- package/lib/components/ProductGalleryGreen/ProductGalleryGreenContent.d.ts +2 -0
- package/lib/components/Recommendation/Recommendation.js +1 -1
- package/lib/components/Recommendation/RecommendationCard.js +1 -1
- package/lib/components/Recommendation/RecommendationCard.js.map +1 -1
- package/lib/components/StepsBlock/StepsBlock.fixture.d.ts +1 -0
- package/lib/components/StepsBlock/StepsBlock.js +8 -2
- package/lib/components/StepsBlock/StepsBlock.js.map +1 -1
- package/lib/components/StepsBlock/StepsBlock.mobile.js +10 -4
- package/lib/components/StepsBlock/StepsBlock.mobile.js.map +1 -1
- package/lib/components/StepsBlock/StepsBlockContent.d.ts +3 -2
- package/lib/ui-kit/Button/ButtonInner.js +1 -1
- package/lib/ui-kit/Button/ButtonInner.js.map +1 -1
- package/lib/ui-kit/Heading/Heading.js +1 -1
- package/lib/ui-kit/Heading/Heading.js.map +1 -1
- package/mobile/bundle/bundle.umd.js +11 -5
- package/mobile/bundle/bundle.umd.min.js +1 -1
- package/mobile/dist/components/PictureText/PictureText.js +8 -4
- package/mobile/dist/components/PictureText/PictureText.js.map +1 -1
- package/mobile/dist/components/PictureText/PictureTextContent.d.ts +7 -0
- package/mobile/dist/components/ProductGalleryGreen/ProductGalleryGreen.js +31 -15
- package/mobile/dist/components/ProductGalleryGreen/ProductGalleryGreen.js.map +1 -1
- package/mobile/dist/components/ProductGalleryGreen/ProductGalleryGreenContent.d.ts +2 -0
- package/mobile/dist/components/Recommendation/Recommendation.js +1 -1
- package/mobile/dist/components/Recommendation/RecommendationCard.js +1 -1
- package/mobile/dist/components/Recommendation/RecommendationCard.js.map +1 -1
- package/mobile/dist/components/StepsBlock/StepsBlock.js +10 -4
- package/mobile/dist/components/StepsBlock/StepsBlock.js.map +1 -1
- package/mobile/dist/components/StepsBlock/StepsBlockContent.d.ts +3 -2
- package/mobile/dist/ui-kit/Button/ButtonInner.js +1 -1
- package/mobile/dist/ui-kit/Button/ButtonInner.js.map +1 -1
- package/mobile/lib/components/PictureText/PictureText.js +8 -4
- package/mobile/lib/components/PictureText/PictureText.js.map +1 -1
- package/mobile/lib/components/PictureText/PictureTextContent.d.ts +7 -0
- package/mobile/lib/components/ProductGalleryGreen/ProductGalleryGreen.js +31 -15
- package/mobile/lib/components/ProductGalleryGreen/ProductGalleryGreen.js.map +1 -1
- package/mobile/lib/components/ProductGalleryGreen/ProductGalleryGreenContent.d.ts +2 -0
- package/mobile/lib/components/Recommendation/Recommendation.js +1 -1
- package/mobile/lib/components/Recommendation/RecommendationCard.js +1 -1
- package/mobile/lib/components/Recommendation/RecommendationCard.js.map +1 -1
- package/mobile/lib/components/StepsBlock/StepsBlock.js +10 -4
- package/mobile/lib/components/StepsBlock/StepsBlock.js.map +1 -1
- package/mobile/lib/components/StepsBlock/StepsBlockContent.d.ts +3 -2
- package/mobile/lib/ui-kit/Button/ButtonInner.js +1 -1
- package/mobile/lib/ui-kit/Button/ButtonInner.js.map +1 -1
- package/mobile/src/components/PictureText/PictureText.example.json +2 -0
- package/mobile/src/components/PictureText/PictureText.tsx +33 -7
- package/mobile/src/components/PictureText/PictureTextContent.ts +7 -0
- package/mobile/src/components/ProductGalleryGreen/ProductGalleryGreen.example.json +2 -1
- package/mobile/src/components/ProductGalleryGreen/ProductGalleryGreen.tsx +40 -17
- package/mobile/src/components/ProductGalleryGreen/ProductGalleryGreenContent.ts +2 -0
- package/mobile/src/components/Recommendation/Recommendation.tsx +1 -1
- package/mobile/src/components/Recommendation/RecommendationCard.tsx +1 -1
- package/mobile/src/components/StepsBlock/StepsBlock.tsx +14 -5
- package/mobile/src/components/StepsBlock/StepsBlockContent.ts +3 -2
- package/mobile/src/ui-kit/Button/ButtonInner.tsx +2 -2
- package/package.json +2 -3
- package/src/components/MobileAppTile/MobileAppTile.tsx +3 -3
- package/src/components/PictureText/PictureText.example.json +2 -0
- package/src/components/PictureText/PictureText.tsx +33 -7
- package/src/components/PictureText/PictureTextContent.ts +7 -0
- package/src/components/ProductGalleryGreen/ProductGalleryGreen.example.json +2 -1
- package/src/components/ProductGalleryGreen/ProductGalleryGreen.fixture.tsx +74 -1
- package/src/components/ProductGalleryGreen/ProductGalleryGreen.tsx +40 -17
- package/src/components/ProductGalleryGreen/ProductGalleryGreenContent.ts +2 -0
- package/src/components/Recommendation/Recommendation.tsx +1 -1
- package/src/components/Recommendation/RecommendationCard.tsx +1 -1
- package/src/components/StepsBlock/StepsBlock.fixture.tsx +14 -0
- package/src/components/StepsBlock/StepsBlock.mobile.tsx +14 -5
- package/src/components/StepsBlock/StepsBlock.tsx +13 -6
- package/src/components/StepsBlock/StepsBlockContent.ts +3 -2
- package/src/ui-kit/Button/ButtonInner.tsx +2 -2
- package/src/ui-kit/Heading/Heading.tsx +1 -3
|
@@ -2,6 +2,7 @@ import { JSX } from '@redneckz/uni-jsx';
|
|
|
2
2
|
import type { UniBlockProps } from '../../types';
|
|
3
3
|
import type { PictureTextContent } from './PictureTextContent';
|
|
4
4
|
|
|
5
|
+
import { BlockVersion } from '../../model/BlockVersion';
|
|
5
6
|
import { Heading } from '../../ui-kit/Heading/Heading';
|
|
6
7
|
import { Icon } from '../../ui-kit/Icon/Icon';
|
|
7
8
|
import { Img } from '../../ui-kit/Img/Img';
|
|
@@ -9,18 +10,33 @@ import { Benefit } from '../BenefitsBlock/BenefitsBlockContent';
|
|
|
9
10
|
|
|
10
11
|
export interface PictureTextProps extends PictureTextContent, UniBlockProps {}
|
|
11
12
|
|
|
13
|
+
const pictureTextStyleMap: Record<BlockVersion, string> = {
|
|
14
|
+
primary: 'bg-white text-primary-text',
|
|
15
|
+
secondary: 'bg-primary-main text-white',
|
|
16
|
+
};
|
|
17
|
+
|
|
12
18
|
export const PictureText = JSX<PictureTextProps>(
|
|
13
|
-
({
|
|
19
|
+
({
|
|
20
|
+
className = '',
|
|
21
|
+
title,
|
|
22
|
+
image,
|
|
23
|
+
benefits,
|
|
24
|
+
version = 'primary',
|
|
25
|
+
directionRight = false,
|
|
26
|
+
anchor = null,
|
|
27
|
+
}) => {
|
|
14
28
|
return (
|
|
15
29
|
<section
|
|
16
|
-
className={`relative font-sans
|
|
30
|
+
className={`relative font-sans p-14 ${pictureTextStyleMap[version]} ${className}`}
|
|
17
31
|
id={anchor}
|
|
18
32
|
>
|
|
19
33
|
<Heading headingType="h2" className="text-center" title={title} />
|
|
20
34
|
<div className={'flex justify-center mt-9'}>
|
|
21
|
-
{image?.src && <Img className=
|
|
35
|
+
{image?.src && <Img className={directionRight ? 'order-2 ml-6' : 'mr-6'} image={image} />}
|
|
22
36
|
{benefits?.length ? (
|
|
23
|
-
<div className="flex flex-col">
|
|
37
|
+
<div className="flex flex-col">
|
|
38
|
+
{benefits.map((_, i) => renderBenefit(_, i, version))}
|
|
39
|
+
</div>
|
|
24
40
|
) : null}
|
|
25
41
|
</div>
|
|
26
42
|
</section>
|
|
@@ -28,7 +44,7 @@ export const PictureText = JSX<PictureTextProps>(
|
|
|
28
44
|
},
|
|
29
45
|
);
|
|
30
46
|
|
|
31
|
-
function renderBenefit(benefit: Benefit, i: number) {
|
|
47
|
+
function renderBenefit(benefit: Benefit, i: number, version: string) {
|
|
32
48
|
return (
|
|
33
49
|
<div key={String(i)} className="flex flex-row mb-8">
|
|
34
50
|
{benefit.icon && (
|
|
@@ -42,10 +58,20 @@ function renderBenefit(benefit: Benefit, i: number) {
|
|
|
42
58
|
)}
|
|
43
59
|
<div className="flex gap-1 flex-col h-full ml-5 max-w-[490px]">
|
|
44
60
|
{benefit.label && (
|
|
45
|
-
<div
|
|
61
|
+
<div
|
|
62
|
+
className={`font-medium text-xl m-0 ${
|
|
63
|
+
version === 'primary' ? 'text-primary-text' : ''
|
|
64
|
+
}`}
|
|
65
|
+
>
|
|
66
|
+
{benefit.label}
|
|
67
|
+
</div>
|
|
46
68
|
)}
|
|
47
69
|
{benefit.description && (
|
|
48
|
-
<div
|
|
70
|
+
<div
|
|
71
|
+
className={`font-normal text-sm ${version === 'primary' ? 'text-secondary-text' : ''}`}
|
|
72
|
+
>
|
|
73
|
+
{benefit.description}
|
|
74
|
+
</div>
|
|
49
75
|
)}
|
|
50
76
|
</div>
|
|
51
77
|
</div>
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { BlockVersion } from '../../model/BlockVersion';
|
|
1
2
|
import type { HeadingContent } from '../../ui-kit/Heading/HeadingContent';
|
|
2
3
|
import type { ImageContent } from '../../ui-kit/Img/ImgProps';
|
|
3
4
|
import type { Benefit } from '../BenefitsBlock/BenefitsBlockContent';
|
|
@@ -8,6 +9,12 @@ export type TitleWithImageContent = HeadingContent & ImageContent;
|
|
|
8
9
|
* @title Картинка с текстом
|
|
9
10
|
*/
|
|
10
11
|
export interface PictureTextContent extends TitleWithImageContent {
|
|
12
|
+
version?: BlockVersion;
|
|
11
13
|
/** @title Список преимуществ */
|
|
12
14
|
benefits?: Benefit[];
|
|
15
|
+
/**
|
|
16
|
+
* @title Картинка справа/текст слева
|
|
17
|
+
* @default false
|
|
18
|
+
*/
|
|
19
|
+
directionRight?: boolean;
|
|
13
20
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { JSX } from '@redneckz/uni-jsx';
|
|
2
2
|
import type { UniBlockProps } from '../../types';
|
|
3
|
+
import type { BlockVersion } from '../../model/BlockVersion';
|
|
3
4
|
import { Icon } from '../../ui-kit/Icon/Icon';
|
|
4
5
|
import type { ProductBlockInnerContent } from '../ProductBlock/ProductBlockContent';
|
|
5
6
|
import { ProductBlockInner } from '../ProductBlock/ProductBlockInner';
|
|
@@ -7,23 +8,39 @@ import type { ProductGalleryGreenContent } from './ProductGalleryGreenContent';
|
|
|
7
8
|
|
|
8
9
|
export interface ProductGalleryProps extends ProductGalleryGreenContent, UniBlockProps {}
|
|
9
10
|
|
|
11
|
+
const productGalleryGreenStyleMap: Record<BlockVersion, string> = {
|
|
12
|
+
primary: 'bg-white text-primary-text',
|
|
13
|
+
secondary: 'bg-primary-main text-white',
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
const productBlockStyleMap: Record<BlockVersion, string> = {
|
|
17
|
+
primary: 'text-secondary-text',
|
|
18
|
+
secondary: 'text-white/80',
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
const productSlideStyleMap: Record<BlockVersion, string> = {
|
|
22
|
+
primary: 'bg-white text-primary-text',
|
|
23
|
+
secondary: 'bg-primary-main text-white',
|
|
24
|
+
};
|
|
25
|
+
|
|
10
26
|
export const ProductGalleryGreen = JSX<ProductGalleryProps>(
|
|
11
|
-
({ className = '', context, slides = [], anchor = null }) => {
|
|
27
|
+
({ className = '', context, slides = [], version = 'primary', duration = 0, anchor = null }) => {
|
|
12
28
|
const galleryNav = slides.map((s) => s.nav);
|
|
13
29
|
const galleryBlocks = slides.map((s) => s.productBlock);
|
|
14
30
|
const [activeSlideIndex, setActiveSlideIndex] = context.useState(0);
|
|
15
31
|
|
|
16
32
|
return (
|
|
17
33
|
<section
|
|
18
|
-
className={`box-border pt-[70px] relative font-sans overflow-hidden bg-primary-main w-100 ${className}`}
|
|
19
34
|
id={anchor}
|
|
35
|
+
className={`box-border pt-[70px] overflow-hidden relative font-sans w-100 ${className}
|
|
36
|
+
${productGalleryGreenStyleMap[version]}`}
|
|
20
37
|
>
|
|
21
38
|
<div
|
|
22
39
|
className="flex duration-1000 pb-14"
|
|
23
40
|
style={{ transform: `translateX(-${activeSlideIndex}00%)` }}
|
|
24
41
|
role="list"
|
|
25
42
|
>
|
|
26
|
-
{galleryBlocks.map((_, i) => renderProductBlock(_, i, context))}
|
|
43
|
+
{galleryBlocks.map((_, i) => renderProductBlock({ ..._, version }, i, context))}
|
|
27
44
|
</div>
|
|
28
45
|
|
|
29
46
|
<div className="flex items-center absolute bottom-6 left-0 right-0 px-9 box-border">
|
|
@@ -33,6 +50,8 @@ export const ProductGalleryGreen = JSX<ProductGalleryProps>(
|
|
|
33
50
|
i,
|
|
34
51
|
activeSlideIndex,
|
|
35
52
|
onClick: () => setActiveSlideIndex(i),
|
|
53
|
+
version,
|
|
54
|
+
duration,
|
|
36
55
|
}),
|
|
37
56
|
)}
|
|
38
57
|
</div>
|
|
@@ -42,6 +61,9 @@ export const ProductGalleryGreen = JSX<ProductGalleryProps>(
|
|
|
42
61
|
);
|
|
43
62
|
|
|
44
63
|
function renderProductBlock(block: ProductBlockInnerContent, i: number, context) {
|
|
64
|
+
const { version } = block;
|
|
65
|
+
const additionalClass = version ? productBlockStyleMap[version] : '';
|
|
66
|
+
|
|
45
67
|
return (
|
|
46
68
|
<section
|
|
47
69
|
key={String(i)}
|
|
@@ -55,10 +77,9 @@ function renderProductBlock(block: ProductBlockInnerContent, i: number, context)
|
|
|
55
77
|
</div>
|
|
56
78
|
) : null}
|
|
57
79
|
<ProductBlockInner
|
|
58
|
-
className=
|
|
80
|
+
className={`pl-2.5 pt-2.5 pb-1.5 pr-[6.25rem] z-[1] ${additionalClass}`}
|
|
59
81
|
context={context}
|
|
60
82
|
textBlockClassName="mb-[154px]"
|
|
61
|
-
version="secondary"
|
|
62
83
|
{...block}
|
|
63
84
|
/>
|
|
64
85
|
<Icon
|
|
@@ -72,32 +93,34 @@ function renderProductBlock(block: ProductBlockInnerContent, i: number, context)
|
|
|
72
93
|
);
|
|
73
94
|
}
|
|
74
95
|
|
|
75
|
-
function renderNavButton({ slide, i, activeSlideIndex, onClick }) {
|
|
96
|
+
function renderNavButton({ slide, i, activeSlideIndex, onClick, version, duration }) {
|
|
76
97
|
const isActiveBtn = i === activeSlideIndex;
|
|
77
98
|
const btnClassName = isActiveBtn
|
|
78
|
-
? 'bg-white shadow-dark-blue/42 h-[102px] w-[354px] min-w-[354px] max-w-[354px] p-0'
|
|
79
|
-
:
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
const
|
|
84
|
-
|
|
85
|
-
: 'text-m-base text-white';
|
|
86
|
-
|
|
99
|
+
? 'bg-white shadow-dark-blue/42 h-[102px] w-[354px] min-w-[354px] max-w-[354px] p-0 border-none'
|
|
100
|
+
: `min-w-[277px] px-0 pt-4 pb-[23px] hover:py-[26px] hover:py-[26px] ease-in duration-300
|
|
101
|
+
${productSlideStyleMap[version]}`;
|
|
102
|
+
const btnTitleClassName = isActiveBtn ? 'text-primary-text' : productBlockStyleMap[version];
|
|
103
|
+
const btnDescClassName = isActiveBtn ? 'text-secondary-text' : productBlockStyleMap[version];
|
|
104
|
+
const additionalBorder = version === 'secondary' ? 'border-white/50' : '';
|
|
105
|
+
const progressBarClassName = isActiveBtn ? 'animate-slide' : '';
|
|
87
106
|
return (
|
|
88
107
|
<button
|
|
89
108
|
type="button"
|
|
90
109
|
key={String(i)}
|
|
91
110
|
onClick={onClick}
|
|
92
111
|
aria-label={slide?.title}
|
|
93
|
-
className={`box-border font-sans group relative overflow-hidden border-
|
|
94
|
-
|
|
112
|
+
className={`box-border font-sans group relative overflow-hidden border-[1px] cursor-pointer text-left mx-1 grow basis-0 backdrop-blur-sm
|
|
113
|
+
${btnClassName} ${additionalBorder}
|
|
95
114
|
`}
|
|
96
115
|
>
|
|
97
116
|
<div className="border-0 px-6">
|
|
98
117
|
<div className={`font-medium ${btnTitleClassName}`}>{slide?.title}</div>
|
|
99
118
|
<div className={`text-secondary-text ${btnDescClassName}`}>{slide.description}</div>
|
|
100
119
|
</div>
|
|
120
|
+
<div
|
|
121
|
+
className={`absolute bottom-0 left-0 w-full h-[3px] bg-primary-main -translate-x-full ${progressBarClassName}`}
|
|
122
|
+
style={{ animationDuration: `${duration}s`, animationFillMode: 'forwards' }}
|
|
123
|
+
></div>
|
|
101
124
|
</button>
|
|
102
125
|
);
|
|
103
126
|
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { ProductBlockInnerContent } from '../ProductBlock/ProductBlockContent';
|
|
2
|
+
import type { BlockVersion } from '../../model/BlockVersion';
|
|
2
3
|
|
|
3
4
|
/** @title Кнопка под слайдом */
|
|
4
5
|
interface ProductGalleryNav {
|
|
@@ -29,4 +30,5 @@ export interface ProductGalleryGreenContent {
|
|
|
29
30
|
duration?: number;
|
|
30
31
|
/** @title Слайды */
|
|
31
32
|
slides?: ProductSlide[];
|
|
33
|
+
version?: BlockVersion;
|
|
32
34
|
}
|
|
@@ -24,7 +24,7 @@ export const Recommendation = JSX<RecommendationProps>(
|
|
|
24
24
|
className={`relative font-sans p-[50px] overflow-hidden ${blockClassName} ${className}`}
|
|
25
25
|
id={anchor}
|
|
26
26
|
>
|
|
27
|
-
{title ? <Heading headingType="
|
|
27
|
+
{title ? <Heading headingType="h2" className="mb-8" title={title} /> : null}
|
|
28
28
|
<div
|
|
29
29
|
className="flex duration-1000 gap-4"
|
|
30
30
|
style={{ transform: `translateX(-${activeCardIndex * CARD_SHIFT}px)` }}
|
|
@@ -25,7 +25,7 @@ export const RecommendationCard = JSX<RecommendationCardProps>(
|
|
|
25
25
|
image={image?.src && <Img className="mt-auto ml-7" image={image} />}
|
|
26
26
|
>
|
|
27
27
|
{description ? <Description description={description} /> : null}
|
|
28
|
-
{items?.length ? <List items={items} version={version} /> : null}
|
|
28
|
+
{items?.length ? <List className="text-m-base" items={items} version={version} /> : null}
|
|
29
29
|
</BaseTile>
|
|
30
30
|
</section>
|
|
31
31
|
);
|
|
@@ -16,6 +16,16 @@ type StyleType = {
|
|
|
16
16
|
iconConnector: string;
|
|
17
17
|
};
|
|
18
18
|
|
|
19
|
+
const STEPS_SIZE_MAP: Record<SizeVersion, string> = {
|
|
20
|
+
normal: 'h-[70px] w-[70px] min-w-[70px] min-h-[70px]',
|
|
21
|
+
small: 'h-[50px] w-[50px] min-w-[50px] min-h-[50px]',
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
const STEPS_TILE_DESCRIPTION_HEIGHT_MAP: Record<SizeVersion, string> = {
|
|
25
|
+
normal: 'min-h-[70px]',
|
|
26
|
+
small: 'min-h-[50px]',
|
|
27
|
+
};
|
|
28
|
+
|
|
19
29
|
const STEPS_BLOCK_STYLE_MAPS: Record<BlockVersion, StyleType> = {
|
|
20
30
|
primary: {
|
|
21
31
|
background: 'bg-white',
|
|
@@ -88,7 +98,9 @@ const renderStepTitle = (params: RenderStepTitleParams) => {
|
|
|
88
98
|
<div className={`min-h-8 h-full w-[2px] ${style.iconConnector} ${margin}`} />
|
|
89
99
|
)}
|
|
90
100
|
</div>
|
|
91
|
-
<div
|
|
101
|
+
<div
|
|
102
|
+
className={`flex flex-col justify-center h-fit ${STEPS_TILE_DESCRIPTION_HEIGHT_MAP[size]}`}
|
|
103
|
+
>
|
|
92
104
|
{step.label && (
|
|
93
105
|
<div className="font-medium text-m-title-xs m-0 text-left">{step.label}</div>
|
|
94
106
|
)}
|
|
@@ -110,10 +122,7 @@ const renderStepTitle = (params: RenderStepTitleParams) => {
|
|
|
110
122
|
const renderIconArea = (params: RenderStepTitleParams) => {
|
|
111
123
|
const { step, size, i, version } = params;
|
|
112
124
|
const style = styleMaps(version);
|
|
113
|
-
const iconAreaSize =
|
|
114
|
-
size === 'normal'
|
|
115
|
-
? 'h-[70px] w-[70px] min-w-[70px] min-h-[70px]'
|
|
116
|
-
: 'h-[50px] w-[50px] min-w-[50px] min-h-[50px]';
|
|
125
|
+
const iconAreaSize = STEPS_SIZE_MAP[size];
|
|
117
126
|
|
|
118
127
|
const iconSize = size === 'normal' ? '38' : '27';
|
|
119
128
|
const iconTextSize = size === 'normal' ? 'text-m-title' : 'text-m-title-xs';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { IconName } from '../../
|
|
1
|
+
import type { IconName } from '../../icons/IconName';
|
|
2
2
|
import type { SizeVersion } from '../../model/SizeVersion';
|
|
3
3
|
import type { BlockVersion } from '../../model/BlockVersion';
|
|
4
4
|
|
|
@@ -26,9 +26,10 @@ export interface StepsBlockContent {
|
|
|
26
26
|
/**
|
|
27
27
|
* @title Шаги
|
|
28
28
|
* @minItems 2
|
|
29
|
-
* @maxItems
|
|
29
|
+
* @maxItems 4
|
|
30
30
|
*/
|
|
31
31
|
steps?: Step[];
|
|
32
|
+
/** @title Размер шагов (моб.) */
|
|
32
33
|
size?: SizeVersion; // TODO: mobile content
|
|
33
34
|
version?: BlockVersion; // TODO: mobile content
|
|
34
35
|
}
|
|
@@ -13,8 +13,8 @@ export const ButtonInner = JSX<ButtonInnerProps>((props) => {
|
|
|
13
13
|
{appendLeft ? appendLeft : null}
|
|
14
14
|
{isWithText(props) ? (
|
|
15
15
|
<div>
|
|
16
|
-
<div className="text-m-2xs text-left">{aboveText}</div>
|
|
17
|
-
<div className="text-m-button
|
|
16
|
+
<div className="text-m-2xs font-light text-left">{aboveText}</div>
|
|
17
|
+
<div className="text-m-button text-left">{text}</div>
|
|
18
18
|
</div>
|
|
19
19
|
) : null}
|
|
20
20
|
</div>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@redneckz/wildless-cms-uni-blocks",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.32",
|
|
4
4
|
"private": false,
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "ЦК",
|
|
@@ -109,14 +109,13 @@
|
|
|
109
109
|
"clean:actual": "rimraf ./cypress/snapshots/actual || exit 0"
|
|
110
110
|
},
|
|
111
111
|
"peerDependencies": {
|
|
112
|
-
"cypress": "^10.
|
|
112
|
+
"cypress": "^10.6.0",
|
|
113
113
|
"cypress-visual-regression": "^1.7.0",
|
|
114
114
|
"react": ">=16.8.0",
|
|
115
115
|
"react-dom": ">=16.8.0"
|
|
116
116
|
},
|
|
117
117
|
"dependencies": {
|
|
118
118
|
"@redneckz/uni-jsx": "^0.1.6",
|
|
119
|
-
"cypress-visual-regression": "^1.7.0",
|
|
120
119
|
"glob": "^8.0.3",
|
|
121
120
|
"remark-html": "^15.0.1",
|
|
122
121
|
"remark-parse": "^10.0.1",
|
|
@@ -33,13 +33,13 @@ export const MobileAppTile = JSX<MobileAppTileProps>(
|
|
|
33
33
|
<Heading
|
|
34
34
|
headingType={getTileHeadingType(className)}
|
|
35
35
|
title={title}
|
|
36
|
-
className={`whitespace-pre-wrap max-w-[600px]`}
|
|
36
|
+
className={`whitespace-pre-wrap max-w-[600px] mb-7`}
|
|
37
37
|
/>
|
|
38
38
|
)
|
|
39
39
|
}
|
|
40
40
|
buttons={
|
|
41
41
|
buttons?.length ? (
|
|
42
|
-
<ButtonSection context={context} buttons={buttons} className="flex mt-
|
|
42
|
+
<ButtonSection context={context} buttons={buttons} className="flex mt-7 gap-4" />
|
|
43
43
|
) : null
|
|
44
44
|
}
|
|
45
45
|
>
|
|
@@ -56,7 +56,7 @@ export const MobileAppTile = JSX<MobileAppTileProps>(
|
|
|
56
56
|
/>
|
|
57
57
|
</a>
|
|
58
58
|
)}
|
|
59
|
-
<span className="font-
|
|
59
|
+
<span className="font-light text-secondary-text ml-4">
|
|
60
60
|
Наведите камеру телефона на QR-код и скачайте приложение
|
|
61
61
|
</span>
|
|
62
62
|
</div>
|
|
@@ -2,6 +2,7 @@ import { JSX } from '@redneckz/uni-jsx';
|
|
|
2
2
|
import type { UniBlockProps } from '../../types';
|
|
3
3
|
import type { PictureTextContent } from './PictureTextContent';
|
|
4
4
|
|
|
5
|
+
import { BlockVersion } from '../../model/BlockVersion';
|
|
5
6
|
import { Heading } from '../../ui-kit/Heading/Heading';
|
|
6
7
|
import { Icon } from '../../ui-kit/Icon/Icon';
|
|
7
8
|
import { Img } from '../../ui-kit/Img/Img';
|
|
@@ -9,18 +10,33 @@ import { Benefit } from '../BenefitsBlock/BenefitsBlockContent';
|
|
|
9
10
|
|
|
10
11
|
export interface PictureTextProps extends PictureTextContent, UniBlockProps {}
|
|
11
12
|
|
|
13
|
+
const pictureTextStyleMap: Record<BlockVersion, string> = {
|
|
14
|
+
primary: 'bg-white text-primary-text',
|
|
15
|
+
secondary: 'bg-primary-main text-white',
|
|
16
|
+
};
|
|
17
|
+
|
|
12
18
|
export const PictureText = JSX<PictureTextProps>(
|
|
13
|
-
({
|
|
19
|
+
({
|
|
20
|
+
className = '',
|
|
21
|
+
title,
|
|
22
|
+
image,
|
|
23
|
+
benefits,
|
|
24
|
+
version = 'primary',
|
|
25
|
+
directionRight = false,
|
|
26
|
+
anchor = null,
|
|
27
|
+
}) => {
|
|
14
28
|
return (
|
|
15
29
|
<section
|
|
16
|
-
className={`relative font-sans
|
|
30
|
+
className={`relative font-sans p-14 ${pictureTextStyleMap[version]} ${className}`}
|
|
17
31
|
id={anchor}
|
|
18
32
|
>
|
|
19
33
|
<Heading headingType="h2" className="text-center" title={title} />
|
|
20
34
|
<div className={'flex justify-center mt-9'}>
|
|
21
|
-
{image?.src && <Img className=
|
|
35
|
+
{image?.src && <Img className={directionRight ? 'order-2 ml-6' : 'mr-6'} image={image} />}
|
|
22
36
|
{benefits?.length ? (
|
|
23
|
-
<div className="flex flex-col">
|
|
37
|
+
<div className="flex flex-col">
|
|
38
|
+
{benefits.map((_, i) => renderBenefit(_, i, version))}
|
|
39
|
+
</div>
|
|
24
40
|
) : null}
|
|
25
41
|
</div>
|
|
26
42
|
</section>
|
|
@@ -28,7 +44,7 @@ export const PictureText = JSX<PictureTextProps>(
|
|
|
28
44
|
},
|
|
29
45
|
);
|
|
30
46
|
|
|
31
|
-
function renderBenefit(benefit: Benefit, i: number) {
|
|
47
|
+
function renderBenefit(benefit: Benefit, i: number, version: string) {
|
|
32
48
|
return (
|
|
33
49
|
<div key={String(i)} className="flex flex-row mb-8">
|
|
34
50
|
{benefit.icon && (
|
|
@@ -42,10 +58,20 @@ function renderBenefit(benefit: Benefit, i: number) {
|
|
|
42
58
|
)}
|
|
43
59
|
<div className="flex gap-1 flex-col h-full ml-5 max-w-[490px]">
|
|
44
60
|
{benefit.label && (
|
|
45
|
-
<div
|
|
61
|
+
<div
|
|
62
|
+
className={`font-medium text-xl m-0 ${
|
|
63
|
+
version === 'primary' ? 'text-primary-text' : ''
|
|
64
|
+
}`}
|
|
65
|
+
>
|
|
66
|
+
{benefit.label}
|
|
67
|
+
</div>
|
|
46
68
|
)}
|
|
47
69
|
{benefit.description && (
|
|
48
|
-
<div
|
|
70
|
+
<div
|
|
71
|
+
className={`font-normal text-sm ${version === 'primary' ? 'text-secondary-text' : ''}`}
|
|
72
|
+
>
|
|
73
|
+
{benefit.description}
|
|
74
|
+
</div>
|
|
49
75
|
)}
|
|
50
76
|
</div>
|
|
51
77
|
</div>
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { BlockVersion } from '../../model/BlockVersion';
|
|
1
2
|
import type { HeadingContent } from '../../ui-kit/Heading/HeadingContent';
|
|
2
3
|
import type { ImageContent } from '../../ui-kit/Img/ImgProps';
|
|
3
4
|
import type { Benefit } from '../BenefitsBlock/BenefitsBlockContent';
|
|
@@ -8,6 +9,12 @@ export type TitleWithImageContent = HeadingContent & ImageContent;
|
|
|
8
9
|
* @title Картинка с текстом
|
|
9
10
|
*/
|
|
10
11
|
export interface PictureTextContent extends TitleWithImageContent {
|
|
12
|
+
version?: BlockVersion;
|
|
11
13
|
/** @title Список преимуществ */
|
|
12
14
|
benefits?: Benefit[];
|
|
15
|
+
/**
|
|
16
|
+
* @title Картинка справа/текст слева
|
|
17
|
+
* @default false
|
|
18
|
+
*/
|
|
19
|
+
directionRight?: boolean;
|
|
13
20
|
}
|
|
@@ -38,6 +38,15 @@ const items = [
|
|
|
38
38
|
'Кредитный лимит до 5 млн рублей',
|
|
39
39
|
];
|
|
40
40
|
const buttons: ButtonWithIconProps[] = [
|
|
41
|
+
{
|
|
42
|
+
href: 'https://rshb.ru',
|
|
43
|
+
text: 'Подробнее',
|
|
44
|
+
target: '_blank',
|
|
45
|
+
version: 'primary',
|
|
46
|
+
},
|
|
47
|
+
];
|
|
48
|
+
|
|
49
|
+
const buttonsSecondary: ButtonWithIconProps[] = [
|
|
41
50
|
{
|
|
42
51
|
href: 'https://rshb.ru',
|
|
43
52
|
text: 'Подробнее',
|
|
@@ -60,7 +69,6 @@ export default {
|
|
|
60
69
|
},
|
|
61
70
|
productBlock: {
|
|
62
71
|
title: 'Кредит по одному документу',
|
|
63
|
-
// description: 'Кредит наличными без залога и поручительства, только по паспорту',
|
|
64
72
|
headingType: 'h2',
|
|
65
73
|
items,
|
|
66
74
|
buttons,
|
|
@@ -111,4 +119,69 @@ export default {
|
|
|
111
119
|
/>
|
|
112
120
|
</div>
|
|
113
121
|
),
|
|
122
|
+
primary: (
|
|
123
|
+
<div className="container grid grid-cols-12">
|
|
124
|
+
<ProductGalleryGreen
|
|
125
|
+
className="col-span-12"
|
|
126
|
+
context={context}
|
|
127
|
+
version={'secondary'}
|
|
128
|
+
slides={[
|
|
129
|
+
{
|
|
130
|
+
nav: {
|
|
131
|
+
title: 'Кредит по одному документу',
|
|
132
|
+
description: 'Ставка от 5,5% годовых',
|
|
133
|
+
},
|
|
134
|
+
productBlock: {
|
|
135
|
+
title: 'Кредит по одному документу',
|
|
136
|
+
// description: 'Кредит наличными без залога и поручительства, только по паспорту',
|
|
137
|
+
headingType: 'h2',
|
|
138
|
+
items,
|
|
139
|
+
buttons: buttonsSecondary,
|
|
140
|
+
image: percentImage,
|
|
141
|
+
backgroundText: '3,6',
|
|
142
|
+
},
|
|
143
|
+
},
|
|
144
|
+
{
|
|
145
|
+
nav: {
|
|
146
|
+
title: 'Для людей в возрасте',
|
|
147
|
+
description: 'Ставка до 7% годовых',
|
|
148
|
+
},
|
|
149
|
+
productBlock: {
|
|
150
|
+
title: 'Ставка от 12,5% годовых на срок до 3 лет!',
|
|
151
|
+
headingType: 'h2',
|
|
152
|
+
items,
|
|
153
|
+
buttons: buttonsSecondary,
|
|
154
|
+
image: worker,
|
|
155
|
+
},
|
|
156
|
+
},
|
|
157
|
+
{
|
|
158
|
+
nav: {
|
|
159
|
+
title: 'Выгодно покупать',
|
|
160
|
+
description: 'Ставка от 5% годовых',
|
|
161
|
+
},
|
|
162
|
+
productBlock: {
|
|
163
|
+
title: 'Дополнительные бонусные баллы за покупки!',
|
|
164
|
+
headingType: 'h2',
|
|
165
|
+
items,
|
|
166
|
+
buttons: buttonsSecondary,
|
|
167
|
+
image: creditCard,
|
|
168
|
+
},
|
|
169
|
+
},
|
|
170
|
+
{
|
|
171
|
+
nav: {
|
|
172
|
+
title: 'Карты Unionpay',
|
|
173
|
+
description: '120 дней льготный период',
|
|
174
|
+
},
|
|
175
|
+
productBlock: {
|
|
176
|
+
title: 'Карты Unionpay',
|
|
177
|
+
headingType: 'h2',
|
|
178
|
+
items,
|
|
179
|
+
buttons: buttonsSecondary,
|
|
180
|
+
image: creditCard,
|
|
181
|
+
},
|
|
182
|
+
},
|
|
183
|
+
]}
|
|
184
|
+
/>
|
|
185
|
+
</div>
|
|
186
|
+
),
|
|
114
187
|
};
|