@redneckz/wildless-cms-uni-blocks 0.3.71 → 0.3.73
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 +29 -20
- package/bundle/bundle.umd.min.js +1 -1
- package/dist/components/BenefitsBlock/BenefitsBlock.js +21 -3
- package/dist/components/BenefitsBlock/BenefitsBlock.js.map +1 -1
- package/dist/components/BenefitsBlock/BenefitsBlockContent.d.ts +39 -12
- package/dist/components/Bonus/BonusContent.d.ts +1 -1
- package/dist/components/ComparisonTable/TableCell.mobile.js +1 -3
- package/dist/components/ComparisonTable/TableCell.mobile.js.map +1 -1
- package/dist/components/ContentPage/ContentPageContext.d.ts +2 -1
- package/dist/components/Headline/Headline.js +2 -2
- package/dist/components/Headline/Headline.js.map +1 -1
- package/dist/components/Headline/Headline.mobile.js +1 -1
- package/dist/components/Headline/Headline.mobile.js.map +1 -1
- package/dist/components/Headline/HeadlineContent.d.ts +2 -1
- package/dist/components/Insurance/Insurance.js.map +1 -1
- package/dist/components/Insurance/InsuranceContent.d.ts +16 -2
- package/dist/components/LinkDocs/LinkDocs.js +3 -12
- package/dist/components/LinkDocs/LinkDocs.js.map +1 -1
- package/dist/components/LinkDocs/LinkDocs.mobile.js +3 -3
- package/dist/components/LinkDocs/LinkDocs.mobile.js.map +1 -1
- package/dist/components/LinkDocs/LinkDocsContent.d.ts +1 -1
- package/dist/components/LinkDocs/LinkDocsHorizontalList.js +1 -1
- package/dist/components/LinkDocs/LinkDocsHorizontalList.js.map +1 -1
- package/dist/components/LinkDocs/LinkDocsVerticalList.js +1 -1
- package/dist/components/LinkDocs/LinkDocsVerticalList.js.map +1 -1
- package/dist/components/LinkDocs/linkDocsContentExample.js +1 -1
- package/dist/components/LinkDocs/linkDocsContentExample.js.map +1 -1
- package/dist/components/PictureText/PictureText.js +1 -1
- package/dist/components/PictureText/PictureText.js.map +1 -1
- package/dist/components/PictureText/PictureTextContent.d.ts +9 -2
- package/dist/components/ProductBlock/ProductBlockContent.d.ts +10 -3
- package/dist/components/ProductBlock/renderBenefit.js +1 -1
- package/dist/components/ProductBlock/renderBenefit.js.map +1 -1
- package/dist/components/ProductTile/ProductTile.js.map +1 -1
- package/dist/components/ProductTile/ProductTileContent.d.ts +6 -1
- package/dist/react/IntersectionObserverTag.d.ts +2 -3
- package/dist/react/IntersectionObserverTag.js.map +1 -1
- package/lib/common.css +1 -1
- package/lib/components/BenefitsBlock/BenefitsBlock.fixture.d.ts +2 -1
- package/lib/components/BenefitsBlock/BenefitsBlock.js +21 -3
- package/lib/components/BenefitsBlock/BenefitsBlock.js.map +1 -1
- package/lib/components/BenefitsBlock/BenefitsBlockContent.d.ts +39 -12
- package/lib/components/Bonus/BonusContent.d.ts +1 -1
- package/lib/components/ComparisonTable/TableCell.mobile.js +1 -3
- package/lib/components/ComparisonTable/TableCell.mobile.js.map +1 -1
- package/lib/components/ContentPage/ContentPageContext.d.ts +2 -1
- package/lib/components/Headline/Headline.js +2 -2
- package/lib/components/Headline/Headline.js.map +1 -1
- package/lib/components/Headline/Headline.mobile.js +1 -1
- package/lib/components/Headline/Headline.mobile.js.map +1 -1
- package/lib/components/Headline/HeadlineContent.d.ts +2 -1
- package/lib/components/Insurance/Insurance.js.map +1 -1
- package/lib/components/Insurance/InsuranceContent.d.ts +16 -2
- package/lib/components/LinkDocs/LinkDocs.js +3 -12
- package/lib/components/LinkDocs/LinkDocs.js.map +1 -1
- package/lib/components/LinkDocs/LinkDocs.mobile.js +3 -3
- package/lib/components/LinkDocs/LinkDocs.mobile.js.map +1 -1
- package/lib/components/LinkDocs/LinkDocsContent.d.ts +1 -1
- package/lib/components/LinkDocs/LinkDocsHorizontalList.js +1 -1
- package/lib/components/LinkDocs/LinkDocsHorizontalList.js.map +1 -1
- package/lib/components/LinkDocs/LinkDocsVerticalList.js +1 -1
- package/lib/components/LinkDocs/LinkDocsVerticalList.js.map +1 -1
- package/lib/components/LinkDocs/linkDocsContentExample.js +1 -1
- package/lib/components/LinkDocs/linkDocsContentExample.js.map +1 -1
- package/lib/components/PictureText/PictureText.js +1 -1
- package/lib/components/PictureText/PictureText.js.map +1 -1
- package/lib/components/PictureText/PictureTextContent.d.ts +9 -2
- package/lib/components/ProductBlock/ProductBlockContent.d.ts +10 -3
- package/lib/components/ProductBlock/renderBenefit.js +1 -1
- package/lib/components/ProductBlock/renderBenefit.js.map +1 -1
- package/lib/components/ProductTile/ProductTile.js.map +1 -1
- package/lib/components/ProductTile/ProductTileContent.d.ts +6 -1
- package/lib/react/IntersectionObserverTag.d.ts +2 -3
- package/lib/react/IntersectionObserverTag.js.map +1 -1
- package/mobile/bundle/bundle.umd.js +6 -8
- package/mobile/bundle/bundle.umd.min.js +1 -1
- package/mobile/dist/components/BenefitsBlock/BenefitsBlock.js +21 -3
- package/mobile/dist/components/BenefitsBlock/BenefitsBlock.js.map +1 -1
- package/mobile/dist/components/BenefitsBlock/BenefitsBlockContent.d.ts +39 -12
- package/mobile/dist/components/Bonus/BonusContent.d.ts +1 -1
- package/mobile/dist/components/ComparisonTable/TableCell.js +1 -3
- package/mobile/dist/components/ComparisonTable/TableCell.js.map +1 -1
- package/mobile/dist/components/ContentPage/ContentPageContext.d.ts +2 -1
- package/mobile/dist/components/Headline/Headline.js +1 -1
- package/mobile/dist/components/Headline/Headline.js.map +1 -1
- package/mobile/dist/components/Headline/HeadlineContent.d.ts +2 -1
- package/mobile/dist/components/Insurance/Insurance.js.map +1 -1
- package/mobile/dist/components/Insurance/InsuranceContent.d.ts +16 -2
- package/mobile/dist/components/LinkDocs/LinkDocs.js +3 -3
- package/mobile/dist/components/LinkDocs/LinkDocs.js.map +1 -1
- package/mobile/dist/components/LinkDocs/LinkDocsContent.d.ts +1 -1
- package/mobile/dist/components/LinkDocs/LinkDocsHorizontalList.js +1 -1
- package/mobile/dist/components/LinkDocs/LinkDocsHorizontalList.js.map +1 -1
- package/mobile/dist/components/LinkDocs/LinkDocsVerticalList.js +1 -1
- package/mobile/dist/components/LinkDocs/LinkDocsVerticalList.js.map +1 -1
- package/mobile/dist/components/LinkDocs/linkDocsContentExample.js +1 -1
- package/mobile/dist/components/LinkDocs/linkDocsContentExample.js.map +1 -1
- package/mobile/dist/components/PictureText/PictureText.js +1 -1
- package/mobile/dist/components/PictureText/PictureText.js.map +1 -1
- package/mobile/dist/components/PictureText/PictureTextContent.d.ts +9 -2
- package/mobile/dist/components/ProductBlock/ProductBlockContent.d.ts +10 -3
- package/mobile/dist/components/ProductTile/ProductTile.js.map +1 -1
- package/mobile/dist/components/ProductTile/ProductTileContent.d.ts +6 -1
- package/mobile/dist/react/IntersectionObserverTag.d.ts +2 -3
- package/mobile/dist/react/IntersectionObserverTag.js.map +1 -1
- package/mobile/lib/components/BenefitsBlock/BenefitsBlock.js +21 -3
- package/mobile/lib/components/BenefitsBlock/BenefitsBlock.js.map +1 -1
- package/mobile/lib/components/BenefitsBlock/BenefitsBlockContent.d.ts +39 -12
- package/mobile/lib/components/Bonus/BonusContent.d.ts +1 -1
- package/mobile/lib/components/ComparisonTable/TableCell.js +1 -3
- package/mobile/lib/components/ComparisonTable/TableCell.js.map +1 -1
- package/mobile/lib/components/ContentPage/ContentPageContext.d.ts +2 -1
- package/mobile/lib/components/Headline/Headline.js +1 -1
- package/mobile/lib/components/Headline/Headline.js.map +1 -1
- package/mobile/lib/components/Headline/HeadlineContent.d.ts +2 -1
- package/mobile/lib/components/Insurance/Insurance.js.map +1 -1
- package/mobile/lib/components/Insurance/InsuranceContent.d.ts +16 -2
- package/mobile/lib/components/LinkDocs/LinkDocs.js +3 -3
- package/mobile/lib/components/LinkDocs/LinkDocs.js.map +1 -1
- package/mobile/lib/components/LinkDocs/LinkDocsContent.d.ts +1 -1
- package/mobile/lib/components/LinkDocs/LinkDocsHorizontalList.js +1 -1
- package/mobile/lib/components/LinkDocs/LinkDocsHorizontalList.js.map +1 -1
- package/mobile/lib/components/LinkDocs/LinkDocsVerticalList.js +1 -1
- package/mobile/lib/components/LinkDocs/LinkDocsVerticalList.js.map +1 -1
- package/mobile/lib/components/LinkDocs/linkDocsContentExample.js +1 -1
- package/mobile/lib/components/LinkDocs/linkDocsContentExample.js.map +1 -1
- package/mobile/lib/components/PictureText/PictureText.js +1 -1
- package/mobile/lib/components/PictureText/PictureText.js.map +1 -1
- package/mobile/lib/components/PictureText/PictureTextContent.d.ts +9 -2
- package/mobile/lib/components/ProductBlock/ProductBlockContent.d.ts +10 -3
- package/mobile/lib/components/ProductTile/ProductTile.js.map +1 -1
- package/mobile/lib/components/ProductTile/ProductTileContent.d.ts +6 -1
- package/mobile/lib/react/IntersectionObserverTag.d.ts +2 -3
- package/mobile/lib/react/IntersectionObserverTag.js.map +1 -1
- package/mobile/src/components/BenefitsBlock/BenefitsBlock.example.json +9 -1
- package/mobile/src/components/BenefitsBlock/BenefitsBlock.tsx +48 -12
- package/mobile/src/components/BenefitsBlock/BenefitsBlockContent.ts +46 -16
- package/mobile/src/components/Bonus/BonusContent.ts +1 -1
- package/mobile/src/components/ComparisonTable/TableCell.tsx +8 -7
- package/mobile/src/components/ContentPage/ContentPage.page.json +1 -1
- package/mobile/src/components/ContentPage/ContentPageContext.tsx +5 -1
- package/mobile/src/components/Headline/Headline.tsx +3 -5
- package/mobile/src/components/Headline/HeadlineContent.ts +2 -1
- package/mobile/src/components/Insurance/Insurance.tsx +2 -3
- package/mobile/src/components/Insurance/InsuranceContent.ts +23 -9
- package/mobile/src/components/LinkDocs/LinkDocs.example.json +1 -1
- package/mobile/src/components/LinkDocs/LinkDocs.tsx +10 -12
- package/mobile/src/components/LinkDocs/LinkDocsContent.ts +1 -1
- package/mobile/src/components/LinkDocs/LinkDocsHorizontalList.tsx +1 -1
- package/mobile/src/components/LinkDocs/LinkDocsVerticalList.tsx +3 -1
- package/mobile/src/components/LinkDocs/linkDocsContentExample.ts +1 -1
- package/mobile/src/components/PictureText/PictureText.tsx +6 -7
- package/mobile/src/components/PictureText/PictureTextContent.ts +10 -2
- package/mobile/src/components/ProductBlock/ProductBlockContent.ts +11 -3
- package/mobile/src/components/ProductTile/ProductTile.tsx +1 -2
- package/mobile/src/components/ProductTile/ProductTileContent.ts +7 -1
- package/mobile/src/react/IntersectionObserverTag.tsx +3 -3
- package/package.json +1 -1
- package/src/components/BenefitsBlock/BenefitsBlock.example.json +9 -1
- package/src/components/BenefitsBlock/BenefitsBlock.fixture.tsx +72 -9
- package/src/components/BenefitsBlock/BenefitsBlock.tsx +48 -12
- package/src/components/BenefitsBlock/BenefitsBlockContent.ts +46 -16
- package/src/components/Bonus/Bonus.fixture.tsx +3 -3
- package/src/components/Bonus/BonusContent.ts +1 -1
- package/src/components/ComparisonTable/ComparisonTable.fixture.mobile.tsx +0 -9
- package/src/components/ComparisonTable/TableCell.mobile.tsx +8 -7
- package/src/components/ContentPage/ContentPage.page.json +1 -1
- package/src/components/ContentPage/ContentPageContext.tsx +5 -1
- package/src/components/Gallery/Gallery.fixture.mobile.tsx +0 -7
- package/src/components/Headline/Headline.mobile.tsx +3 -5
- package/src/components/Headline/Headline.tsx +8 -5
- package/src/components/Headline/HeadlineContent.ts +2 -1
- package/src/components/Insurance/Insurance.fixture.tsx +2 -2
- package/src/components/Insurance/Insurance.tsx +2 -3
- package/src/components/Insurance/InsuranceContent.ts +23 -9
- package/src/components/LinkDocs/LinkDocs.example.json +1 -1
- package/src/components/LinkDocs/LinkDocs.fixture.mobile.tsx +1 -6
- package/src/components/LinkDocs/LinkDocs.mobile.tsx +10 -12
- package/src/components/LinkDocs/LinkDocs.tsx +13 -34
- package/src/components/LinkDocs/LinkDocsContent.ts +1 -1
- package/src/components/LinkDocs/LinkDocsHorizontalList.tsx +1 -1
- package/src/components/LinkDocs/LinkDocsVerticalList.tsx +3 -1
- package/src/components/LinkDocs/linkDocsContentExample.ts +1 -1
- package/src/components/PictureText/PictureText.tsx +6 -7
- package/src/components/PictureText/PictureTextContent.ts +10 -2
- package/src/components/ProductBlock/ProductBlock.fixture.mobile.tsx +3 -3
- package/src/components/ProductBlock/ProductBlock.fixture.tsx +2 -3
- package/src/components/ProductBlock/ProductBlockContent.ts +11 -3
- package/src/components/ProductBlock/renderBenefit.tsx +3 -3
- package/src/components/ProductTile/ProductTile.tsx +1 -2
- package/src/components/ProductTile/ProductTileContent.ts +7 -1
- package/src/react/IntersectionObserverTag.tsx +3 -3
|
@@ -11,7 +11,7 @@ export interface LinkDocsHorizontalListProps extends LinkDocsVerticalListProps {
|
|
|
11
11
|
export const LinkDocsHorizontalList = JSX<LinkDocsHorizontalListProps>(
|
|
12
12
|
({ context, hasBorder = true, documents, icon }) => {
|
|
13
13
|
return (
|
|
14
|
-
<SwipeListControl context={context} className="text-m-sm text-primary-main">
|
|
14
|
+
<SwipeListControl context={context} className="text-m-sm text-primary-main mt-5">
|
|
15
15
|
{documents?.length
|
|
16
16
|
? documents.map((doc, i) => (
|
|
17
17
|
<LinkDocsListItem
|
|
@@ -13,7 +13,9 @@ export const LinkDocsVerticalList = JSX<LinkDocsVerticalListProps>(
|
|
|
13
13
|
({ hasBorder = true, documents, icon }) => {
|
|
14
14
|
return (
|
|
15
15
|
<div
|
|
16
|
-
className={`text-m-sm text-primary-main flex flex-col
|
|
16
|
+
className={`text-m-sm text-primary-main flex flex-col mt-5 ${
|
|
17
|
+
hasBorder ? 'gap-3.5' : 'gap-2'
|
|
18
|
+
}`}
|
|
17
19
|
role="list"
|
|
18
20
|
>
|
|
19
21
|
{documents?.length
|
|
@@ -2,7 +2,7 @@ import type { LinkDocsContent } from './LinkDocsContent';
|
|
|
2
2
|
|
|
3
3
|
export const linkDocsContentExample: LinkDocsContent = {
|
|
4
4
|
title: 'Дополнительные документы',
|
|
5
|
-
|
|
5
|
+
description: 'Ответы на часто задаваемые вопросы',
|
|
6
6
|
documents: [
|
|
7
7
|
{ text: 'target self', href: '/abc1/cooldoc.doc', target: '_self' },
|
|
8
8
|
{ text: 'target blank', href: '/abc2/wtf.rtf', target: '_blank' },
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import { JSX } from '@redneckz/uni-jsx';
|
|
2
2
|
import type { UniBlockProps } from '../../types';
|
|
3
|
-
import type { PictureTextContent } from './PictureTextContent';
|
|
3
|
+
import type { PictureTextContent, PictureTextBenefit } from './PictureTextContent';
|
|
4
4
|
|
|
5
5
|
import { BlockVersion } from '../../model/BlockVersion';
|
|
6
6
|
import { Heading } from '../../ui-kit/Heading/Heading';
|
|
7
7
|
import { Img } from '../../ui-kit/Img/Img';
|
|
8
|
-
import { Benefit } from '../BenefitsBlock/BenefitsBlockContent';
|
|
9
8
|
|
|
10
9
|
export interface PictureTextProps extends PictureTextContent, UniBlockProps {}
|
|
11
10
|
|
|
@@ -43,7 +42,7 @@ export const PictureText = JSX<PictureTextProps>(
|
|
|
43
42
|
},
|
|
44
43
|
);
|
|
45
44
|
|
|
46
|
-
function renderBenefit(benefit:
|
|
45
|
+
function renderBenefit(benefit: PictureTextBenefit, i: number, version: string) {
|
|
47
46
|
return (
|
|
48
47
|
<div key={String(i)} className="flex flex-row mb-8">
|
|
49
48
|
{benefit.icon ? (
|
|
@@ -56,7 +55,7 @@ function renderBenefit(benefit: Benefit, i: number, version: string) {
|
|
|
56
55
|
/>
|
|
57
56
|
) : null}
|
|
58
57
|
<div className="flex gap-1 flex-col h-full ml-5 max-w-[490px]">
|
|
59
|
-
{benefit
|
|
58
|
+
{benefit?.label ? (
|
|
60
59
|
<div
|
|
61
60
|
className={`font-medium text-xl m-0 ${
|
|
62
61
|
version === 'primary' ? 'text-primary-text' : ''
|
|
@@ -64,14 +63,14 @@ function renderBenefit(benefit: Benefit, i: number, version: string) {
|
|
|
64
63
|
>
|
|
65
64
|
{benefit.label}
|
|
66
65
|
</div>
|
|
67
|
-
)}
|
|
68
|
-
{benefit
|
|
66
|
+
) : null}
|
|
67
|
+
{benefit?.description ? (
|
|
69
68
|
<div
|
|
70
69
|
className={`font-normal text-sm ${version === 'primary' ? 'text-secondary-text' : ''}`}
|
|
71
70
|
>
|
|
72
71
|
{benefit.description}
|
|
73
72
|
</div>
|
|
74
|
-
)}
|
|
73
|
+
) : null}
|
|
75
74
|
</div>
|
|
76
75
|
</div>
|
|
77
76
|
);
|
|
@@ -1,17 +1,25 @@
|
|
|
1
1
|
import { BlockVersion } from '../../model/BlockVersion';
|
|
2
2
|
import type { HeadingContent } from '../../ui-kit/Heading/HeadingContent';
|
|
3
3
|
import type { ImageContent } from '../../ui-kit/Img/ImgProps';
|
|
4
|
-
import type {
|
|
4
|
+
import type { Picture } from '../../model/Picture';
|
|
5
5
|
|
|
6
6
|
export type TitleWithImageContent = HeadingContent & ImageContent;
|
|
7
7
|
|
|
8
|
+
export interface PictureTextBenefit {
|
|
9
|
+
icon?: Picture;
|
|
10
|
+
/** @title Название */
|
|
11
|
+
label?: string;
|
|
12
|
+
/** @title Описание */
|
|
13
|
+
description?: string;
|
|
14
|
+
}
|
|
15
|
+
|
|
8
16
|
/**
|
|
9
17
|
* @title Картинка с текстом
|
|
10
18
|
*/
|
|
11
19
|
export interface PictureTextContent extends TitleWithImageContent {
|
|
12
20
|
version?: BlockVersion;
|
|
13
21
|
/** @title Список преимуществ */
|
|
14
|
-
benefits?:
|
|
22
|
+
benefits?: PictureTextBenefit[];
|
|
15
23
|
/**
|
|
16
24
|
* @title Картинка справа/текст слева
|
|
17
25
|
* @default false
|
|
@@ -6,10 +6,18 @@ import type { DescriptionContent } from '../../ui-kit/Description/DescriptionCon
|
|
|
6
6
|
import type { HeadingContent, HeadingTypeContent } from '../../ui-kit/Heading/HeadingContent';
|
|
7
7
|
import type { ImageContent } from '../../ui-kit/Img/ImgProps';
|
|
8
8
|
import type { ListContent } from '../../ui-kit/List/ListContent';
|
|
9
|
-
import
|
|
9
|
+
import { Picture } from '../../model/Picture';
|
|
10
|
+
|
|
11
|
+
export interface ProductBlockBenefit {
|
|
12
|
+
icon?: Picture;
|
|
13
|
+
/** @title Название */
|
|
14
|
+
label?: string;
|
|
15
|
+
/** @title Описание */
|
|
16
|
+
description?: string;
|
|
17
|
+
}
|
|
10
18
|
|
|
11
19
|
export type BenefitItemProps = {
|
|
12
|
-
benefit:
|
|
20
|
+
benefit: ProductBlockBenefit;
|
|
13
21
|
version?: BlockVersion;
|
|
14
22
|
benefitsVersion?: IconVersion;
|
|
15
23
|
};
|
|
@@ -25,7 +33,7 @@ export type ProductBlockInnerContent = HeadingContent &
|
|
|
25
33
|
* @minItems 2
|
|
26
34
|
* @maxItems 3
|
|
27
35
|
*/
|
|
28
|
-
benefits?:
|
|
36
|
+
benefits?: ProductBlockBenefit[];
|
|
29
37
|
benefitsVersion?: IconVersion;
|
|
30
38
|
version?: BlockVersion;
|
|
31
39
|
/**
|
|
@@ -8,8 +8,7 @@ import { Img } from '../../ui-kit/Img/Img';
|
|
|
8
8
|
import { BaseTile } from '../BaseTile/BaseTile';
|
|
9
9
|
import { getTileMinHeight } from '../BaseTile/getTileMinHeight';
|
|
10
10
|
import { getTileRightPadding } from '../BaseTile/getTileRightPadding';
|
|
11
|
-
import type { TextBenefit } from '
|
|
12
|
-
import type { ProductTileContent } from './ProductTileContent';
|
|
11
|
+
import type { ProductTileContent, TextBenefit } from './ProductTileContent';
|
|
13
12
|
|
|
14
13
|
export interface ProductTileProps extends ProductTileContent, UniBlockProps {}
|
|
15
14
|
|
|
@@ -3,7 +3,13 @@ import type { ButtonContent } from '../../ui-kit/Button/ButtonProps';
|
|
|
3
3
|
import type { DescriptionContent } from '../../ui-kit/Description/DescriptionContent';
|
|
4
4
|
import type { HeadingContent, HeadingTypeContent } from '../../ui-kit/Heading/HeadingContent';
|
|
5
5
|
import type { ImageContent } from '../../ui-kit/Img/ImgProps';
|
|
6
|
-
|
|
6
|
+
|
|
7
|
+
export interface TextBenefit {
|
|
8
|
+
/** @title Название */
|
|
9
|
+
label?: string;
|
|
10
|
+
/** @title Описание */
|
|
11
|
+
description?: string;
|
|
12
|
+
}
|
|
7
13
|
|
|
8
14
|
/**
|
|
9
15
|
* @title Продуктовая плитка
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { useCallback, useRef } from 'react';
|
|
2
|
+
import { IntersectionObserverComponent } from '../components/ContentPage/ContentPageContext';
|
|
3
3
|
|
|
4
|
-
export const IntersectionObserverTag:
|
|
4
|
+
export const IntersectionObserverTag: IntersectionObserverComponent = (props) => {
|
|
5
5
|
const { Tag, observerCallback, observerOptions, children, ...rest } = props;
|
|
6
6
|
|
|
7
7
|
const intersectionObserver = useRef<IntersectionObserver>();
|
package/package.json
CHANGED
|
@@ -1,14 +1,22 @@
|
|
|
1
1
|
{
|
|
2
2
|
"title": "Преимущества",
|
|
3
|
-
"
|
|
3
|
+
"benefitList": [
|
|
4
4
|
{
|
|
5
5
|
"label": "Преимущество №1",
|
|
6
|
+
"description": {
|
|
7
|
+
"name": "Описание 1",
|
|
8
|
+
"benefitType": "description"
|
|
9
|
+
},
|
|
6
10
|
"icon": {
|
|
7
11
|
"icon": "ClockIcon"
|
|
8
12
|
}
|
|
9
13
|
},
|
|
10
14
|
{
|
|
11
15
|
"label": "Преимущество №2",
|
|
16
|
+
"description": {
|
|
17
|
+
"name": "Описание 2",
|
|
18
|
+
"benefitType": "description"
|
|
19
|
+
},
|
|
12
20
|
"icon": {
|
|
13
21
|
"icon": "SignDocsIcon"
|
|
14
22
|
}
|
|
@@ -2,35 +2,98 @@ import { context } from '../../react/setup-fixture';
|
|
|
2
2
|
|
|
3
3
|
import { BenefitsBlock } from './BenefitsBlock';
|
|
4
4
|
|
|
5
|
+
const itemsList = [
|
|
6
|
+
'Комиссия за выдачу',
|
|
7
|
+
'кредита не взимается',
|
|
8
|
+
'Допускается полное или',
|
|
9
|
+
'частичное погашение кредита',
|
|
10
|
+
];
|
|
11
|
+
|
|
5
12
|
export default {
|
|
6
|
-
|
|
13
|
+
description: (
|
|
14
|
+
<div className="container grid grid-cols-12">
|
|
15
|
+
<BenefitsBlock
|
|
16
|
+
context={context}
|
|
17
|
+
className="col-span-12"
|
|
18
|
+
title="Преимущества кредита"
|
|
19
|
+
benefitList={[
|
|
20
|
+
{
|
|
21
|
+
label: 'Без комиссии',
|
|
22
|
+
description: {
|
|
23
|
+
name: 'Комиссия за выдачу кредита не взимается. Допускается полное или частичное погашение кредита',
|
|
24
|
+
benefitType: 'text',
|
|
25
|
+
},
|
|
26
|
+
icon: { icon: 'ClockIcon' },
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
label: 'Оформление по паспорту',
|
|
30
|
+
description: {
|
|
31
|
+
name: 'Обеспечение не требуется. Кредит можно получить на любые цели',
|
|
32
|
+
benefitType: 'text',
|
|
33
|
+
},
|
|
34
|
+
icon: { icon: 'SignDocsIcon' },
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
label: 'Без залога и поручительства',
|
|
38
|
+
description: {
|
|
39
|
+
name: 'Единовременное перечисление суммы кредита в полном объёме на текущий счет в Банке',
|
|
40
|
+
benefitType: 'text',
|
|
41
|
+
},
|
|
42
|
+
icon: { icon: 'ComfortableCompIcon' },
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
label: 'Деньги за 3 дня',
|
|
46
|
+
description: {
|
|
47
|
+
name: 'Рассмотрение заявки с момента предоставления полного комплекта документов',
|
|
48
|
+
benefitType: 'text',
|
|
49
|
+
},
|
|
50
|
+
icon: { icon: 'ActualBalanceIcon' },
|
|
51
|
+
},
|
|
52
|
+
]}
|
|
53
|
+
/>
|
|
54
|
+
</div>
|
|
55
|
+
),
|
|
56
|
+
list: (
|
|
7
57
|
<div className="container grid grid-cols-12">
|
|
8
58
|
<BenefitsBlock
|
|
9
59
|
context={context}
|
|
10
60
|
className="col-span-12"
|
|
11
61
|
title="Преимущества кредита"
|
|
12
|
-
|
|
62
|
+
benefitList={[
|
|
13
63
|
{
|
|
14
64
|
label: 'Без комиссии',
|
|
15
|
-
description:
|
|
16
|
-
'Комиссия за выдачу кредита не взимается. Допускается полное или частичное погашение кредита',
|
|
17
65
|
icon: { icon: 'ClockIcon' },
|
|
66
|
+
description: {
|
|
67
|
+
bullets: true,
|
|
68
|
+
items: itemsList,
|
|
69
|
+
benefitType: 'list',
|
|
70
|
+
},
|
|
18
71
|
},
|
|
19
72
|
{
|
|
20
73
|
label: 'Оформление по паспорту',
|
|
21
|
-
description:
|
|
74
|
+
description: {
|
|
75
|
+
bullets: true,
|
|
76
|
+
items: itemsList,
|
|
77
|
+
benefitType: 'list',
|
|
78
|
+
},
|
|
22
79
|
icon: { icon: 'SignDocsIcon' },
|
|
23
80
|
},
|
|
24
81
|
{
|
|
25
82
|
label: 'Без залога и поручительства',
|
|
26
|
-
description:
|
|
27
|
-
|
|
83
|
+
description: {
|
|
84
|
+
bullets: true,
|
|
85
|
+
items: itemsList,
|
|
86
|
+
benefitType: 'list',
|
|
87
|
+
},
|
|
28
88
|
icon: { icon: 'ComfortableCompIcon' },
|
|
29
89
|
},
|
|
30
90
|
{
|
|
31
91
|
label: 'Деньги за 3 дня',
|
|
32
|
-
description:
|
|
33
|
-
|
|
92
|
+
description: {
|
|
93
|
+
bullets: true,
|
|
94
|
+
items: itemsList,
|
|
95
|
+
benefitType: 'list',
|
|
96
|
+
},
|
|
34
97
|
icon: { icon: 'ActualBalanceIcon' },
|
|
35
98
|
},
|
|
36
99
|
]}
|
|
@@ -2,34 +2,45 @@ import { JSX } from '@redneckz/uni-jsx';
|
|
|
2
2
|
import type { UniBlockProps } from '../../types';
|
|
3
3
|
import { Heading } from '../../ui-kit/Heading/Heading';
|
|
4
4
|
import { Img } from '../../ui-kit/Img/Img';
|
|
5
|
-
import type {
|
|
5
|
+
import type { BenefitItem, BenefitsBlockContent } from './BenefitsBlockContent';
|
|
6
|
+
import { DescriptionType, ListBenefitDef, TextBenefitDef } from './BenefitsBlockContent';
|
|
6
7
|
|
|
7
8
|
export interface BenefitsBlockProps extends BenefitsBlockContent, UniBlockProps {}
|
|
8
9
|
|
|
9
10
|
export const BenefitsBlock = JSX<BenefitsBlockProps>(
|
|
10
|
-
({ className = '', title,
|
|
11
|
+
({ className = '', headingType = 'h2', title, benefitList, anchor = null }) => {
|
|
11
12
|
return (
|
|
12
13
|
<section
|
|
13
14
|
className={`font-sans text-primary-text bg-white p-12 flex flex-col items-center ${className}`}
|
|
14
15
|
id={anchor}
|
|
15
16
|
>
|
|
16
17
|
{title ? (
|
|
17
|
-
<Heading
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
18
|
+
<Heading
|
|
19
|
+
headingType={headingType}
|
|
20
|
+
as="h2"
|
|
21
|
+
className="max-w-[47rem] text-center"
|
|
22
|
+
title={title}
|
|
23
|
+
/>
|
|
21
24
|
) : null}
|
|
25
|
+
{benefitList?.length ? renderBenefits(benefitList) : null}
|
|
22
26
|
</section>
|
|
23
27
|
);
|
|
24
28
|
},
|
|
25
29
|
);
|
|
26
30
|
|
|
27
|
-
const
|
|
31
|
+
const renderBenefits = (benefits: BenefitItem[]) => {
|
|
32
|
+
return (
|
|
33
|
+
<div className="flex flex-wrap justify-center gap-x-20 mt-9">{benefits.map(renderStep)}</div>
|
|
34
|
+
);
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
const renderStep = (benefit: BenefitItem, i: number) => {
|
|
38
|
+
const description = benefit?.description || undefined;
|
|
28
39
|
return (
|
|
29
|
-
<div key={String(i)} className="flex items-center
|
|
40
|
+
<div key={String(i)} className="flex items-center basis-1/2 max-w-[500px] mb-[46px]">
|
|
30
41
|
{benefit?.icon ? (
|
|
31
42
|
<Img
|
|
32
|
-
className="h-[70px] w-[70px] min-w-[70px] min-h-[70px]"
|
|
43
|
+
className="h-[70px] w-[70px] min-w-[70px] min-h-[70px] mr-5"
|
|
33
44
|
image={benefit.icon}
|
|
34
45
|
width="70"
|
|
35
46
|
height="70"
|
|
@@ -37,10 +48,35 @@ const renderStep = (benefit: Benefit, i: number) => {
|
|
|
37
48
|
) : null}
|
|
38
49
|
<div>
|
|
39
50
|
{benefit?.label ? <h3 className="font-medium text-xl m-0">{benefit.label}</h3> : null}
|
|
40
|
-
{
|
|
41
|
-
<div className="font-normal text-sm mt-2">{benefit.description}</div>
|
|
42
|
-
) : null}
|
|
51
|
+
{renderDescription(description)}
|
|
43
52
|
</div>
|
|
44
53
|
</div>
|
|
45
54
|
);
|
|
46
55
|
};
|
|
56
|
+
|
|
57
|
+
const renderDescription = (description?: DescriptionType) => {
|
|
58
|
+
const benefitType = description ? description?.benefitType : null;
|
|
59
|
+
if (!benefitType) {
|
|
60
|
+
return null;
|
|
61
|
+
}
|
|
62
|
+
return description ? (
|
|
63
|
+
<div className="font-light text-base text-secondary-text mt-2">
|
|
64
|
+
{benefitType === 'list'
|
|
65
|
+
? renderListBenefit(description as ListBenefitDef)
|
|
66
|
+
: renderTextBenefit(description as TextBenefitDef)}
|
|
67
|
+
</div>
|
|
68
|
+
) : null;
|
|
69
|
+
};
|
|
70
|
+
|
|
71
|
+
const renderTextBenefit = (description?: TextBenefitDef) => (description ? description.name : null);
|
|
72
|
+
|
|
73
|
+
const renderListBenefit = (description?: ListBenefitDef) => {
|
|
74
|
+
const listStyleType = description?.bullets ? 'list-disc pl-6' : '';
|
|
75
|
+
return description?.items && description.items.length > 0 ? (
|
|
76
|
+
<ul className={listStyleType}>
|
|
77
|
+
{description.items.map((_, i) => (
|
|
78
|
+
<li key={`benefitListItem-${i}`}>{_}</li>
|
|
79
|
+
))}
|
|
80
|
+
</ul>
|
|
81
|
+
) : null;
|
|
82
|
+
};
|
|
@@ -1,28 +1,58 @@
|
|
|
1
1
|
import type { Picture } from '../../model/Picture';
|
|
2
|
+
import type { HeadingContent, HeadingTypeContent } from '../../ui-kit/Heading/HeadingContent';
|
|
3
|
+
import type { EmptyOption } from '../../model/EmptyOptionType';
|
|
2
4
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
5
|
+
/**
|
|
6
|
+
* @title Пункты описания
|
|
7
|
+
* @default {"benefitType": "text"}
|
|
8
|
+
*/
|
|
9
|
+
export type TextBenefitDef = {
|
|
10
|
+
/**
|
|
11
|
+
* @title Описание
|
|
12
|
+
*/
|
|
13
|
+
name?: string;
|
|
14
|
+
benefitType?: 'text';
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* @title Список
|
|
19
|
+
* @default {"benefitType": "list"}
|
|
20
|
+
*/
|
|
21
|
+
export type ListBenefitDef = {
|
|
22
|
+
/** @title Буллиты */
|
|
23
|
+
bullets?: boolean;
|
|
24
|
+
/**
|
|
25
|
+
* @title Пункты
|
|
26
|
+
* @example ["Пункт 1"]
|
|
27
|
+
*/
|
|
28
|
+
items?: string[];
|
|
29
|
+
benefitType?: 'list';
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* @title Вид контента
|
|
34
|
+
*/
|
|
35
|
+
export type DescriptionType = EmptyOption | TextBenefitDef | ListBenefitDef;
|
|
9
36
|
|
|
10
37
|
/**
|
|
11
38
|
* @title Преимущество
|
|
12
39
|
*/
|
|
13
|
-
export interface
|
|
40
|
+
export interface BenefitItem {
|
|
41
|
+
/** @title Название */
|
|
42
|
+
label?: string;
|
|
43
|
+
/** @title Описание */
|
|
44
|
+
description?: DescriptionType;
|
|
14
45
|
icon?: Picture;
|
|
15
46
|
}
|
|
16
47
|
|
|
17
48
|
/**
|
|
18
49
|
* @title Блок преимущества
|
|
19
50
|
*/
|
|
20
|
-
export
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
}
|
|
51
|
+
export type BenefitsBlockContent = HeadingContent &
|
|
52
|
+
HeadingTypeContent & {
|
|
53
|
+
/**
|
|
54
|
+
* @title Список преимуществ
|
|
55
|
+
* @maxItems 6
|
|
56
|
+
*/
|
|
57
|
+
benefitList?: BenefitItem[];
|
|
58
|
+
};
|
|
@@ -11,20 +11,20 @@ export const BONUS: BonusContent = {
|
|
|
11
11
|
name: '5 баллов за каждые 100 ₽',
|
|
12
12
|
description:
|
|
13
13
|
'Повышенное начисление баллов за операции оплаты товаров и услуг в сети АЗС Роснефть',
|
|
14
|
-
bonusCount: 5,
|
|
14
|
+
bonusCount: '5',
|
|
15
15
|
bonusName: 'баллов',
|
|
16
16
|
},
|
|
17
17
|
{
|
|
18
18
|
name: '1 балл за каждые 100 ₽',
|
|
19
19
|
description: 'За остальные операции оплаты товаров и услуг',
|
|
20
|
-
bonusCount: 1,
|
|
20
|
+
bonusCount: '1',
|
|
21
21
|
bonusName: 'балл',
|
|
22
22
|
},
|
|
23
23
|
{
|
|
24
24
|
name: '300 приветственных баллов',
|
|
25
25
|
description:
|
|
26
26
|
'За операции оплаты товаров и услуг на общую сумму 1 000 рублей и более в течение первых двух месяцев после получения карты',
|
|
27
|
-
bonusCount: 300,
|
|
27
|
+
bonusCount: '300',
|
|
28
28
|
bonusName: 'баллов',
|
|
29
29
|
},
|
|
30
30
|
],
|
|
@@ -21,15 +21,6 @@ const image2: Picture = {
|
|
|
21
21
|
},
|
|
22
22
|
};
|
|
23
23
|
|
|
24
|
-
const image3: Picture = {
|
|
25
|
-
src: 'card-3.png',
|
|
26
|
-
format: 'webp',
|
|
27
|
-
size: {
|
|
28
|
-
width: 100,
|
|
29
|
-
height: 63,
|
|
30
|
-
},
|
|
31
|
-
};
|
|
32
|
-
|
|
33
24
|
const rowHeaders = [
|
|
34
25
|
{ title: 'Начисление процентов на остаток по счету' },
|
|
35
26
|
{ title: 'Начисление процентов на остаток по счету' },
|
|
@@ -22,11 +22,6 @@ export const TableCell = JSX<TableCellProps>(({ cell, rowHeader, isFillGradient
|
|
|
22
22
|
);
|
|
23
23
|
});
|
|
24
24
|
|
|
25
|
-
const labelStyle = (isFillGradient = false): string =>
|
|
26
|
-
`text-right ${isFillGradient ? 'text-white' : ''}`;
|
|
27
|
-
const descriptionStyle = (isFillGradient = false): string =>
|
|
28
|
-
`text-right ${isFillGradient ? 'text-white/80' : 'text-secondary-text'}`;
|
|
29
|
-
|
|
30
25
|
const renderCellInner =
|
|
31
26
|
(isFillGradient: boolean, rowHeader?: string) =>
|
|
32
27
|
({ label, description }: CellData, i: number) =>
|
|
@@ -36,9 +31,15 @@ const renderCellInner =
|
|
|
36
31
|
{rowHeader}
|
|
37
32
|
</div>
|
|
38
33
|
<div className="basis-1/2">
|
|
39
|
-
{label ?
|
|
34
|
+
{label ? (
|
|
35
|
+
<div className={`text-right ${isFillGradient ? 'text-white' : ''}`}>{label}</div>
|
|
36
|
+
) : null}
|
|
40
37
|
{description ? (
|
|
41
|
-
<div
|
|
38
|
+
<div
|
|
39
|
+
className={`text-right ${isFillGradient ? 'text-white/80' : 'text-secondary-text'}`}
|
|
40
|
+
>
|
|
41
|
+
{description}
|
|
42
|
+
</div>
|
|
42
43
|
) : null}
|
|
43
44
|
</div>
|
|
44
45
|
</div>
|
|
@@ -1457,7 +1457,7 @@
|
|
|
1457
1457
|
"anchor": "documents",
|
|
1458
1458
|
"content": {
|
|
1459
1459
|
"title": "Дополнительные документы",
|
|
1460
|
-
"
|
|
1460
|
+
"description": "Ответы на часто задаваемые вопросы",
|
|
1461
1461
|
"icon": {
|
|
1462
1462
|
"icon": "DocIcon"
|
|
1463
1463
|
},
|
|
@@ -42,6 +42,10 @@ export interface IntersectionObserverTagProps {
|
|
|
42
42
|
observerOptions?: IntersectionObserverInit;
|
|
43
43
|
}
|
|
44
44
|
|
|
45
|
+
export type IntersectionObserverComponent = (
|
|
46
|
+
props: IntersectionObserverTagProps & Record<string, any>,
|
|
47
|
+
) => VNode;
|
|
48
|
+
|
|
45
49
|
export interface ContentPageContext {
|
|
46
50
|
useRouter: () => Router;
|
|
47
51
|
useState: SetStateHook;
|
|
@@ -50,5 +54,5 @@ export interface ContentPageContext {
|
|
|
50
54
|
useLikeService: () => LikeService;
|
|
51
55
|
useSearch: () => Search;
|
|
52
56
|
handlerDecorator?: HandlerDecorator;
|
|
53
|
-
IntersectionObserverTag:
|
|
57
|
+
IntersectionObserverTag: IntersectionObserverComponent;
|
|
54
58
|
}
|
|
@@ -17,13 +17,6 @@ const image: Picture = {
|
|
|
17
17
|
title: 'money',
|
|
18
18
|
};
|
|
19
19
|
|
|
20
|
-
const buttonPrimary: ButtonCommonProps = {
|
|
21
|
-
href: '/credit-cards',
|
|
22
|
-
text: 'Подробнее',
|
|
23
|
-
target: '_blank',
|
|
24
|
-
version: 'secondary',
|
|
25
|
-
icon: { icon: 'BankIcon' },
|
|
26
|
-
};
|
|
27
20
|
const link: ButtonCommonProps = {
|
|
28
21
|
href: '/credit-cards',
|
|
29
22
|
text: 'Подробнее',
|
|
@@ -19,7 +19,7 @@ export const Headline = JSX<HeadlineProps>(
|
|
|
19
19
|
}) => {
|
|
20
20
|
const STYLE_MAPS = HEADLINE_BLOCK_STYLE_MAPS[bgColorHeadline];
|
|
21
21
|
return (
|
|
22
|
-
<section className={`px-4 py-6 ${STYLE_MAPS.background} ${className}`}>
|
|
22
|
+
<section className={`px-4 py-6 flex flex-col gap-2.5 ${STYLE_MAPS.background} ${className}`}>
|
|
23
23
|
{title ? (
|
|
24
24
|
<Heading
|
|
25
25
|
headingType="h2"
|
|
@@ -29,15 +29,13 @@ export const Headline = JSX<HeadlineProps>(
|
|
|
29
29
|
) : null}
|
|
30
30
|
{description ? (
|
|
31
31
|
<p
|
|
32
|
-
className={`font-normal text-m-md ${STYLE_MAPS.description} ${ALIGN_TEXT[align]}
|
|
33
|
-
title ? 'mt-2.5' : ''
|
|
34
|
-
}`}
|
|
32
|
+
className={`font-normal text-m-md ${STYLE_MAPS.description} ${ALIGN_TEXT[align]} `}
|
|
35
33
|
>
|
|
36
34
|
{description}
|
|
37
35
|
</p>
|
|
38
36
|
) : null}
|
|
39
37
|
{image?.src && (
|
|
40
|
-
<div className="mt-5 mx-auto flex justify-center">
|
|
38
|
+
<div className="mt-2.5 mx-auto flex justify-center">
|
|
41
39
|
<Img image={image} />
|
|
42
40
|
</div>
|
|
43
41
|
)}
|