@redneckz/wildless-cms-uni-blocks 0.3.72 → 0.3.74
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bundle/blocks.schema.json +1 -1
- package/bundle/bundle.umd.js +32 -11
- 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/Insurance/Insurance.js +7 -4
- package/dist/components/Insurance/Insurance.js.map +1 -1
- package/dist/components/Insurance/InsuranceContent.d.ts +19 -2
- 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/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/Insurance/Insurance.js +7 -4
- package/lib/components/Insurance/Insurance.js.map +1 -1
- package/lib/components/Insurance/InsuranceContent.d.ts +19 -2
- 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/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/Insurance/Insurance.js +7 -4
- package/mobile/dist/components/Insurance/Insurance.js.map +1 -1
- package/mobile/dist/components/Insurance/InsuranceContent.d.ts +19 -2
- 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/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/Insurance/Insurance.js +7 -4
- package/mobile/lib/components/Insurance/Insurance.js.map +1 -1
- package/mobile/lib/components/Insurance/InsuranceContent.d.ts +19 -2
- 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/src/components/BenefitsBlock/BenefitsBlock.example.json +9 -1
- package/mobile/src/components/BenefitsBlock/BenefitsBlock.tsx +50 -12
- package/mobile/src/components/BenefitsBlock/BenefitsBlockContent.ts +46 -16
- package/mobile/src/components/Bonus/BonusContent.ts +1 -1
- package/mobile/src/components/Insurance/Insurance.example.json +9 -1
- package/mobile/src/components/Insurance/Insurance.tsx +22 -18
- package/mobile/src/components/Insurance/InsuranceContent.ts +26 -9
- 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/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 +50 -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/Insurance/Insurance.example.json +9 -1
- package/src/components/Insurance/Insurance.fixture.tsx +2 -2
- package/src/components/Insurance/Insurance.tsx +22 -18
- package/src/components/Insurance/InsuranceContent.ts +26 -9
- 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
|
@@ -4,12 +4,15 @@ import { Heading } from '../../ui-kit/Heading/Heading.js';
|
|
|
4
4
|
import { Img } from '../../ui-kit/Img/Img.js';
|
|
5
5
|
import { addSpacesBetweenNumbers } from '../../utils/addSpacesBetweenNumbers.js';
|
|
6
6
|
export const Insurance = JSX(({ className = '', title, description, image, benefits, sum, monthLimit }) => {
|
|
7
|
-
return (_jsxs("section", { className: `px-[100px] py-[50px] bg-white text-primary-text ${className}`, children: [title ? _jsx(Heading, { headingType: "h3", title: title, className: "text-center" }) : null, description ? _jsx("div", { className: "text-center text-md mt-3", children: description }) : null, _jsx("div", { children: _jsxs("div", { className: "mt-5 mx-auto flex justify-center gap-[
|
|
8
|
-
? renderValueBlock('Ежемесячный лимит:', monthLimit, Boolean(sum))
|
|
9
|
-
: null] })] })] }) })] }));
|
|
7
|
+
return (_jsxs("section", { className: `px-[100px] py-[50px] bg-white text-primary-text font-sans ${className}`, children: [title ? _jsx(Heading, { headingType: "h3", title: title, className: "text-center" }) : null, description ? _jsx("div", { className: "text-center text-md mt-3", children: description }) : null, _jsx("div", { children: _jsxs("div", { className: "mt-5 mx-auto flex justify-center gap-[122px] mt-[30px]", children: [image?.src ? _jsx(Img, { image: image }) : null, _jsxs("div", { className: "w-[558px] m-auto", children: [benefits ? (_jsx("div", { className: "flex flex-col gap-4", children: benefits.map(renderBenefit) })) : null, renderInsuranceSumMonth(sum, monthLimit)] })] }) })] }));
|
|
10
8
|
});
|
|
11
9
|
function renderBenefit(benefit, i) {
|
|
12
|
-
return (_jsxs("div", { className: "flex items-center gap-
|
|
10
|
+
return (_jsxs("div", { className: "flex items-center gap-4", children: [benefit?.icon ? (_jsx(Img, { className: "w-12 h-12 min-w-12 p-3 rounded-full bg-secondary-light", image: benefit.icon, asSVG: true })) : null, _jsxs("div", { children: [benefit?.label ? _jsx("div", { className: "text-title-2xs font-normal", children: benefit.label }) : null, benefit?.description ? (_jsx("div", { className: "mt-0.5 font-light text-secondary-text font-light", children: benefit.description })) : null] })] }, String(i)));
|
|
11
|
+
}
|
|
12
|
+
function renderInsuranceSumMonth(sum, monthLimit) {
|
|
13
|
+
return sum || monthLimit ? (_jsxs("div", { className: "bg-secondary-light h-15 flex mt-7 gap-6 px-5 py-4", children: [Number.isFinite(sum) ? renderValueBlock('Страховая сумма:', sum, Boolean(monthLimit)) : null, Number.isFinite(monthLimit)
|
|
14
|
+
? renderValueBlock('Ежемесячный лимит:', monthLimit, Boolean(sum))
|
|
15
|
+
: null] })) : null;
|
|
13
16
|
}
|
|
14
17
|
function renderValueBlock(title, sum, isAnotherBlock) {
|
|
15
18
|
const widthStyle = isAnotherBlock ? 'w-fit' : 'w-full';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Insurance.js","sourceRoot":"","sources":["../../../src/components/Insurance/Insurance.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAExC,OAAO,EAAE,OAAO,EAAE,MAAM,8BAA8B,CAAC;AACvD,OAAO,EAAE,GAAG,EAAE,MAAM,sBAAsB,CAAC;AAC3C,OAAO,EAAE,uBAAuB,EAAE,MAAM,qCAAqC,CAAC;
|
|
1
|
+
{"version":3,"file":"Insurance.js","sourceRoot":"","sources":["../../../src/components/Insurance/Insurance.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAExC,OAAO,EAAE,OAAO,EAAE,MAAM,8BAA8B,CAAC;AACvD,OAAO,EAAE,GAAG,EAAE,MAAM,sBAAsB,CAAC;AAC3C,OAAO,EAAE,uBAAuB,EAAE,MAAM,qCAAqC,CAAC;AAK9E,MAAM,CAAC,MAAM,SAAS,GAAG,GAAG,CAC1B,CAAC,EAAE,SAAS,GAAG,EAAE,EAAE,KAAK,EAAE,WAAW,EAAE,KAAK,EAAE,QAAQ,EAAE,GAAG,EAAE,UAAU,EAAE,EAAE,EAAE;IAC3E,OAAO,CACL,mBAAS,SAAS,EAAE,6DAA6D,SAAS,EAAE,aACzF,KAAK,CAAC,CAAC,CAAC,KAAC,OAAO,IAAC,WAAW,EAAC,IAAI,EAAC,KAA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,IAAI,UAAU,CAAC,CAAC,CAAC,CACzB,eAAK,SAAS,EAAC,mDAAmD,aAC/D,MAAM,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,gBAAgB,CAAC,kBAAkB,EAAE,GAAG,EAAE,OAAO,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,EAC5F,MAAM,CAAC,QAAQ,CAAC,UAAU,CAAC;gBAC1B,CAAC,CAAC,gBAAgB,CAAC,oBAAoB,EAAE,UAAU,EAAE,OAAO,CAAC,GAAG,CAAC,CAAC;gBAClE,CAAC,CAAC,IAAI,IACJ,CACP,CAAC,CAAC,CAAC,IAAI,CAAC;AACX,CAAC;AAED,SAAS,gBAAgB,CAAC,KAAK,EAAE,GAAG,EAAE,cAAc;IAClD,MAAM,UAAU,GAAG,cAAc,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,QAAQ,CAAC;IACvD,OAAO,CACL,eAAK,SAAS,EAAE,kDAAkD,UAAU,EAAE,aAC5E,eAAM,SAAS,EAAC,+BAA+B,YAAE,KAAK,GAAQ,EAC9D,gBAAM,SAAS,EAAC,kCAAkC,aAAE,uBAAuB,CAAC,GAAG,CAAC,eAAU,IACtF,CACP,CAAC;AACJ,CAAC"}
|
|
@@ -1,10 +1,27 @@
|
|
|
1
1
|
import type { Picture } from '../../model/Picture';
|
|
2
|
-
import type { BenefitsBlockContent } from '../BenefitsBlock/BenefitsBlockContent';
|
|
3
2
|
import type { InsuranceProps } from '../../model/Insurance';
|
|
4
|
-
|
|
3
|
+
/**
|
|
4
|
+
* @title Преимущество
|
|
5
|
+
*/
|
|
6
|
+
export interface InsuranceBenefit {
|
|
7
|
+
/** @title Название */
|
|
8
|
+
label?: string;
|
|
9
|
+
/** @title Описание */
|
|
10
|
+
description?: string;
|
|
11
|
+
icon?: Picture;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* @title Страховка
|
|
15
|
+
*/
|
|
16
|
+
export declare type InsuranceContent = InsuranceProps & {
|
|
5
17
|
/** @title Заголовок */
|
|
6
18
|
title?: string;
|
|
7
19
|
/** @title Описание */
|
|
8
20
|
description?: string;
|
|
9
21
|
image?: Picture;
|
|
22
|
+
/**
|
|
23
|
+
* @title Список преимуществ
|
|
24
|
+
* @maxItems 6
|
|
25
|
+
*/
|
|
26
|
+
benefits?: InsuranceBenefit[];
|
|
10
27
|
};
|
|
@@ -10,6 +10,6 @@ export const PictureText = JSX(({ className = '', title, image, benefits, versio
|
|
|
10
10
|
return (_jsxs("section", { className: `relative font-sans p-14 ${pictureTextStyleMap[version]} ${className}`, id: anchor, children: [_jsx(Heading, { headingType: "h2", className: "text-center", title: title }), _jsxs("div", { className: 'flex justify-center mt-9', children: [image?.src && _jsx(Img, { className: directionRight ? 'order-2 ml-6' : 'mr-6', image: image }), benefits?.length ? (_jsx("div", { className: "flex flex-col", children: benefits.map((_, i) => renderBenefit(_, i, version)) })) : null] })] }));
|
|
11
11
|
});
|
|
12
12
|
function renderBenefit(benefit, i, version) {
|
|
13
|
-
return (_jsxs("div", { className: "flex flex-row mb-8", children: [benefit.icon ? (_jsx(Img, { className: "w-[48px] h-[48px] bg-main rounded-full box-border p-[12px]", image: benefit.icon, width: "48", height: "48", asSVG: true })) : null, _jsxs("div", { className: "flex gap-1 flex-col h-full ml-5 max-w-[490px]", children: [benefit
|
|
13
|
+
return (_jsxs("div", { className: "flex flex-row mb-8", children: [benefit.icon ? (_jsx(Img, { className: "w-[48px] h-[48px] bg-main rounded-full box-border p-[12px]", image: benefit.icon, width: "48", height: "48", asSVG: true })) : null, _jsxs("div", { className: "flex gap-1 flex-col h-full ml-5 max-w-[490px]", children: [benefit?.label ? (_jsx("div", { className: `font-medium text-xl m-0 ${version === 'primary' ? 'text-primary-text' : ''}`, children: benefit.label })) : null, benefit?.description ? (_jsx("div", { className: `font-normal text-sm ${version === 'primary' ? 'text-secondary-text' : ''}`, children: benefit.description })) : null] })] }, String(i)));
|
|
14
14
|
}
|
|
15
15
|
//# sourceMappingURL=PictureText.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PictureText.js","sourceRoot":"","sources":["../../../src/components/PictureText/PictureText.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAKxC,OAAO,EAAE,OAAO,EAAE,MAAM,8BAA8B,CAAC;AACvD,OAAO,EAAE,GAAG,EAAE,MAAM,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"PictureText.js","sourceRoot":"","sources":["../../../src/components/PictureText/PictureText.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAKxC,OAAO,EAAE,OAAO,EAAE,MAAM,8BAA8B,CAAC;AACvD,OAAO,EAAE,GAAG,EAAE,MAAM,sBAAsB,CAAC;AAI3C,MAAM,mBAAmB,GAAiC;IACxD,OAAO,EAAE,4BAA4B;IACrC,SAAS,EAAE,4BAA4B;CACxC,CAAC;AAEF,MAAM,CAAC,MAAM,WAAW,GAAG,GAAG,CAC5B,CAAC,EACC,SAAS,GAAG,EAAE,EACd,KAAK,EACL,KAAK,EACL,QAAQ,EACR,OAAO,GAAG,SAAS,EACnB,cAAc,GAAG,KAAK,EACtB,MAAM,GAAG,IAAI,GACd,EAAE,EAAE;IACH,OAAO,CACL,mBACE,SAAS,EAAE,2BAA2B,mBAAmB,CAAC,OAAO,CAAC,IAAI,SAAS,EAAE,EACjF,EAAE,EAAE,MAAM,aAEV,KAAC,OAAO,IAAC,WAAW,EAAC,IAAI,EAAC,SAAS,EAAC,aAAa,EAAC,KAAK,EAAE,KAAK,GAAI,EAClE,eAAK,SAAS,EAAE,0BAA0B,aACvC,KAAK,EAAE,GAAG,IAAI,KAAC,GAAG,IAAC,SAAS,EAAE,cAAc,CAAC,CAAC,CAAC,cAAc,CAAC,CAAC,CAAC,MAAM,EAAE,KAAK,EAAE,KAAK,GAAI,EACxF,QAAQ,EAAE,MAAM,CAAC,CAAC,CAAC,CAClB,cAAK,SAAS,EAAC,eAAe,YAC3B,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,aAAa,CAAC,CAAC,EAAE,CAAC,EAAE,OAAO,CAAC,CAAC,GACjD,CACP,CAAC,CAAC,CAAC,IAAI,IACJ,IACE,CACX,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,SAAS,aAAa,CAAC,OAA2B,EAAE,CAAS,EAAE,OAAe;IAC5E,OAAO,CACL,eAAqB,SAAS,EAAC,oBAAoB,aAChD,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CACd,KAAC,GAAG,IACF,SAAS,EAAC,4DAA4D,EACtE,KAAK,EAAE,OAAO,CAAC,IAAI,EACnB,KAAK,EAAC,IAAI,EACV,MAAM,EAAC,IAAI,EACX,KAAK,SACL,CACH,CAAC,CAAC,CAAC,IAAI,EACR,eAAK,SAAS,EAAC,+CAA+C,aAC3D,OAAO,EAAE,KAAK,CAAC,CAAC,CAAC,CAChB,cACE,SAAS,EAAE,2BACT,OAAO,KAAK,SAAS,CAAC,CAAC,CAAC,mBAAmB,CAAC,CAAC,CAAC,EAChD,EAAE,YAED,OAAO,CAAC,KAAK,GACV,CACP,CAAC,CAAC,CAAC,IAAI,EACP,OAAO,EAAE,WAAW,CAAC,CAAC,CAAC,CACtB,cACE,SAAS,EAAE,uBAAuB,OAAO,KAAK,SAAS,CAAC,CAAC,CAAC,qBAAqB,CAAC,CAAC,CAAC,EAAE,EAAE,YAErF,OAAO,CAAC,WAAW,GAChB,CACP,CAAC,CAAC,CAAC,IAAI,IACJ,KA3BE,MAAM,CAAC,CAAC,CAAC,CA4Bb,CACP,CAAC;AACJ,CAAC"}
|
|
@@ -1,15 +1,22 @@
|
|
|
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
|
export declare type TitleWithImageContent = HeadingContent & ImageContent;
|
|
6
|
+
export interface PictureTextBenefit {
|
|
7
|
+
icon?: Picture;
|
|
8
|
+
/** @title Название */
|
|
9
|
+
label?: string;
|
|
10
|
+
/** @title Описание */
|
|
11
|
+
description?: string;
|
|
12
|
+
}
|
|
6
13
|
/**
|
|
7
14
|
* @title Картинка с текстом
|
|
8
15
|
*/
|
|
9
16
|
export interface PictureTextContent extends TitleWithImageContent {
|
|
10
17
|
version?: BlockVersion;
|
|
11
18
|
/** @title Список преимуществ */
|
|
12
|
-
benefits?:
|
|
19
|
+
benefits?: PictureTextBenefit[];
|
|
13
20
|
/**
|
|
14
21
|
* @title Картинка справа/текст слева
|
|
15
22
|
* @default false
|
|
@@ -6,9 +6,16 @@ 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
|
+
export interface ProductBlockBenefit {
|
|
11
|
+
icon?: Picture;
|
|
12
|
+
/** @title Название */
|
|
13
|
+
label?: string;
|
|
14
|
+
/** @title Описание */
|
|
15
|
+
description?: string;
|
|
16
|
+
}
|
|
10
17
|
export declare type BenefitItemProps = {
|
|
11
|
-
benefit:
|
|
18
|
+
benefit: ProductBlockBenefit;
|
|
12
19
|
version?: BlockVersion;
|
|
13
20
|
benefitsVersion?: IconVersion;
|
|
14
21
|
};
|
|
@@ -18,7 +25,7 @@ export declare type ProductBlockInnerContent = HeadingContent & HeadingTypeConte
|
|
|
18
25
|
* @minItems 2
|
|
19
26
|
* @maxItems 3
|
|
20
27
|
*/
|
|
21
|
-
benefits?:
|
|
28
|
+
benefits?: ProductBlockBenefit[];
|
|
22
29
|
benefitsVersion?: IconVersion;
|
|
23
30
|
version?: BlockVersion;
|
|
24
31
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ProductTile.js","sourceRoot":"","sources":["../../../src/components/ProductTile/ProductTile.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAGxC,OAAO,EAAE,aAAa,EAAE,MAAM,mCAAmC,CAAC;AAClE,OAAO,EAAE,WAAW,EAAE,MAAM,sCAAsC,CAAC;AACnE,OAAO,EAAE,OAAO,EAAE,MAAM,8BAA8B,CAAC;AACvD,OAAO,EAAE,GAAG,EAAE,MAAM,sBAAsB,CAAC;AAC3C,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAChD,OAAO,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AAChE,OAAO,EAAE,mBAAmB,EAAE,MAAM,iCAAiC,CAAC;
|
|
1
|
+
{"version":3,"file":"ProductTile.js","sourceRoot":"","sources":["../../../src/components/ProductTile/ProductTile.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAGxC,OAAO,EAAE,aAAa,EAAE,MAAM,mCAAmC,CAAC;AAClE,OAAO,EAAE,WAAW,EAAE,MAAM,sCAAsC,CAAC;AACnE,OAAO,EAAE,OAAO,EAAE,MAAM,8BAA8B,CAAC;AACvD,OAAO,EAAE,GAAG,EAAE,MAAM,sBAAsB,CAAC;AAC3C,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAChD,OAAO,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AAChE,OAAO,EAAE,mBAAmB,EAAE,MAAM,iCAAiC,CAAC;AAKtE,MAAM,mBAAmB,GAAiC;IACxD,OAAO,EAAE,4BAA4B;IACrC,SAAS,EAAE,4BAA4B;C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YAAY,GAAiC;QACjD,OAAO,EAAE,qBAAqB;QAC9B,SAAS,EAAE,YAAY;KACxB,CAAC;IACF,OAAO,cAAK,SAAS,EAAE,kBAAkB,YAAY,CAAC,OAAO,CAAC,EAAE,YAAG,qBAAqB,GAAO,CAAC;AAClG,CAAC"}
|
|
@@ -3,7 +3,12 @@ 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
|
+
export interface TextBenefit {
|
|
7
|
+
/** @title Название */
|
|
8
|
+
label?: string;
|
|
9
|
+
/** @title Описание */
|
|
10
|
+
description?: string;
|
|
11
|
+
}
|
|
7
12
|
/**
|
|
8
13
|
* @title Продуктовая плитка
|
|
9
14
|
*/
|
|
@@ -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,34 +2,47 @@ 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[]) => {
|
|
28
32
|
return (
|
|
29
|
-
<div
|
|
33
|
+
<div className="flex flex-wrap w-full justify-center gap-x-20 mt-9">
|
|
34
|
+
{benefits.map(renderStep)}
|
|
35
|
+
</div>
|
|
36
|
+
);
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
const renderStep = (benefit: BenefitItem, i: number) => {
|
|
40
|
+
const description = benefit?.description || undefined;
|
|
41
|
+
return (
|
|
42
|
+
<div key={String(i)} className="flex items-center basis-1/2 max-w-[500px] mb-[46px]">
|
|
30
43
|
{benefit?.icon ? (
|
|
31
44
|
<Img
|
|
32
|
-
className="h-[70px] w-[70px] min-w-[70px] min-h-[70px]"
|
|
45
|
+
className="h-[70px] w-[70px] min-w-[70px] min-h-[70px] mr-5"
|
|
33
46
|
image={benefit.icon}
|
|
34
47
|
width="70"
|
|
35
48
|
height="70"
|
|
@@ -37,10 +50,35 @@ const renderStep = (benefit: Benefit, i: number) => {
|
|
|
37
50
|
) : null}
|
|
38
51
|
<div>
|
|
39
52
|
{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}
|
|
53
|
+
{renderDescription(description)}
|
|
43
54
|
</div>
|
|
44
55
|
</div>
|
|
45
56
|
);
|
|
46
57
|
};
|
|
58
|
+
|
|
59
|
+
const renderDescription = (description?: DescriptionType) => {
|
|
60
|
+
const benefitType = description ? description?.benefitType : null;
|
|
61
|
+
if (!benefitType) {
|
|
62
|
+
return null;
|
|
63
|
+
}
|
|
64
|
+
return description ? (
|
|
65
|
+
<div className="font-light text-base text-secondary-text mt-2">
|
|
66
|
+
{benefitType === 'list'
|
|
67
|
+
? renderListBenefit(description as ListBenefitDef)
|
|
68
|
+
: renderTextBenefit(description as TextBenefitDef)}
|
|
69
|
+
</div>
|
|
70
|
+
) : null;
|
|
71
|
+
};
|
|
72
|
+
|
|
73
|
+
const renderTextBenefit = (description?: TextBenefitDef) => (description ? description.name : null);
|
|
74
|
+
|
|
75
|
+
const renderListBenefit = (description?: ListBenefitDef) => {
|
|
76
|
+
const listStyleType = description?.bullets ? 'list-disc pl-6' : '';
|
|
77
|
+
return description?.items && description.items.length > 0 ? (
|
|
78
|
+
<ul className={listStyleType}>
|
|
79
|
+
{description.items.map((_, i) => (
|
|
80
|
+
<li key={`benefitListItem-${i}`}>{_}</li>
|
|
81
|
+
))}
|
|
82
|
+
</ul>
|
|
83
|
+
) : null;
|
|
84
|
+
};
|
|
@@ -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
|
+
};
|
|
@@ -3,31 +3,24 @@ import type { UniBlockProps } from '../../types';
|
|
|
3
3
|
import { Heading } from '../../ui-kit/Heading/Heading';
|
|
4
4
|
import { Img } from '../../ui-kit/Img/Img';
|
|
5
5
|
import { addSpacesBetweenNumbers } from '../../utils/addSpacesBetweenNumbers';
|
|
6
|
-
import type {
|
|
7
|
-
import type { InsuranceContent } from './InsuranceContent';
|
|
6
|
+
import type { InsuranceBenefit, InsuranceContent } from './InsuranceContent';
|
|
8
7
|
|
|
9
8
|
export interface InsuranceProps extends InsuranceContent, UniBlockProps {}
|
|
10
9
|
|
|
11
10
|
export const Insurance = JSX<InsuranceProps>(
|
|
12
11
|
({ className = '', title, description, image, benefits, sum, monthLimit }) => {
|
|
13
12
|
return (
|
|
14
|
-
<section className={`px-[100px] py-[50px] bg-white text-primary-text ${className}`}>
|
|
13
|
+
<section className={`px-[100px] py-[50px] bg-white text-primary-text font-sans ${className}`}>
|
|
15
14
|
{title ? <Heading headingType="h3" title={title} className="text-center" /> : null}
|
|
16
15
|
{description ? <div className="text-center text-md mt-3">{description}</div> : null}
|
|
17
16
|
<div>
|
|
18
|
-
<div className="mt-5 mx-auto flex justify-center gap-[
|
|
17
|
+
<div className="mt-5 mx-auto flex justify-center gap-[122px] mt-[30px]">
|
|
19
18
|
{image?.src ? <Img image={image} /> : null}
|
|
20
19
|
<div className="w-[558px] m-auto">
|
|
21
20
|
{benefits ? (
|
|
22
21
|
<div className="flex flex-col gap-4">{benefits.map(renderBenefit)}</div>
|
|
23
22
|
) : null}
|
|
24
|
-
|
|
25
|
-
<div className="bg-secondary-light h-15 flex mt-7 gap-6 px-5 py-4">
|
|
26
|
-
{sum ? renderValueBlock('Страховая сумма:', sum, Boolean(monthLimit)) : null}
|
|
27
|
-
{monthLimit
|
|
28
|
-
? renderValueBlock('Ежемесячный лимит:', monthLimit, Boolean(sum))
|
|
29
|
-
: null}
|
|
30
|
-
</div>
|
|
23
|
+
{renderInsuranceSumMonth(sum, monthLimit)}
|
|
31
24
|
</div>
|
|
32
25
|
</div>
|
|
33
26
|
</div>
|
|
@@ -36,28 +29,39 @@ export const Insurance = JSX<InsuranceProps>(
|
|
|
36
29
|
},
|
|
37
30
|
);
|
|
38
31
|
|
|
39
|
-
function renderBenefit(benefit:
|
|
32
|
+
function renderBenefit(benefit: InsuranceBenefit, i: number) {
|
|
40
33
|
return (
|
|
41
|
-
<div key={String(i)} className="flex items-center gap-
|
|
34
|
+
<div key={String(i)} className="flex items-center gap-4">
|
|
42
35
|
{benefit?.icon ? (
|
|
43
36
|
<Img
|
|
44
|
-
className="w-
|
|
37
|
+
className="w-12 h-12 min-w-12 p-3 rounded-full bg-secondary-light"
|
|
45
38
|
image={benefit.icon}
|
|
46
|
-
width="24"
|
|
47
|
-
height="24"
|
|
48
39
|
asSVG
|
|
49
40
|
/>
|
|
50
41
|
) : null}
|
|
51
42
|
<div>
|
|
52
|
-
{benefit?.label ? <div className="text-title-2xs">{benefit.label}</div> : null}
|
|
43
|
+
{benefit?.label ? <div className="text-title-2xs font-normal">{benefit.label}</div> : null}
|
|
53
44
|
{benefit?.description ? (
|
|
54
|
-
<div className="mt-
|
|
45
|
+
<div className="mt-0.5 font-light text-secondary-text font-light">
|
|
46
|
+
{benefit.description}
|
|
47
|
+
</div>
|
|
55
48
|
) : null}
|
|
56
49
|
</div>
|
|
57
50
|
</div>
|
|
58
51
|
);
|
|
59
52
|
}
|
|
60
53
|
|
|
54
|
+
function renderInsuranceSumMonth(sum, monthLimit) {
|
|
55
|
+
return sum || monthLimit ? (
|
|
56
|
+
<div className="bg-secondary-light h-15 flex mt-7 gap-6 px-5 py-4">
|
|
57
|
+
{Number.isFinite(sum) ? renderValueBlock('Страховая сумма:', sum, Boolean(monthLimit)) : null}
|
|
58
|
+
{Number.isFinite(monthLimit)
|
|
59
|
+
? renderValueBlock('Ежемесячный лимит:', monthLimit, Boolean(sum))
|
|
60
|
+
: null}
|
|
61
|
+
</div>
|
|
62
|
+
) : null;
|
|
63
|
+
}
|
|
64
|
+
|
|
61
65
|
function renderValueBlock(title, sum, isAnotherBlock) {
|
|
62
66
|
const widthStyle = isAnotherBlock ? 'w-fit' : 'w-full';
|
|
63
67
|
return (
|
|
@@ -1,12 +1,29 @@
|
|
|
1
1
|
import type { Picture } from '../../model/Picture';
|
|
2
|
-
import type { BenefitsBlockContent } from '../BenefitsBlock/BenefitsBlockContent';
|
|
3
2
|
import type { InsuranceProps } from '../../model/Insurance';
|
|
4
3
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
4
|
+
/**
|
|
5
|
+
* @title Преимущество
|
|
6
|
+
*/
|
|
7
|
+
export interface InsuranceBenefit {
|
|
8
|
+
/** @title Название */
|
|
9
|
+
label?: string;
|
|
10
|
+
/** @title Описание */
|
|
11
|
+
description?: string;
|
|
12
|
+
icon?: Picture;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* @title Страховка
|
|
17
|
+
*/
|
|
18
|
+
export type InsuranceContent = InsuranceProps & {
|
|
19
|
+
/** @title Заголовок */
|
|
20
|
+
title?: string;
|
|
21
|
+
/** @title Описание */
|
|
22
|
+
description?: string;
|
|
23
|
+
image?: Picture;
|
|
24
|
+
/**
|
|
25
|
+
* @title Список преимуществ
|
|
26
|
+
* @maxItems 6
|
|
27
|
+
*/
|
|
28
|
+
benefits?: InsuranceBenefit[];
|
|
29
|
+
};
|
|
@@ -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
|
|