@redneckz/wildless-cms-uni-blocks 0.3.13 → 0.3.14
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 +44 -7
- package/bundle/bundle.umd.min.js +1 -1
- package/dist/components/Blocks.d.ts +1 -0
- package/dist/components/Blocks.js +2 -0
- package/dist/components/Blocks.js.map +1 -1
- package/dist/components/ContentPage/ContentPageHead.js +1 -1
- package/dist/components/ContentPage/ContentPageHead.js.map +1 -1
- package/dist/components/Headline/Headline.js +3 -8
- package/dist/components/Headline/Headline.js.map +1 -1
- package/dist/components/Headline/Headline.mobile.js +3 -2
- package/dist/components/Headline/Headline.mobile.js.map +1 -1
- package/dist/components/Headline/HeadlineContent.d.ts +2 -2
- package/dist/components/Headline/constants.d.ts +4 -0
- package/dist/components/Headline/constants.js +13 -0
- package/dist/components/Headline/constants.js.map +1 -0
- package/dist/components/ProductBlock/ProductBlockInner.js +1 -1
- package/dist/components/ProductBlock/ProductBlockInner.js.map +1 -1
- package/dist/components/ProductBlock/ProductBlockInner.mobile.js +1 -1
- package/dist/components/ProductBlock/ProductBlockInner.mobile.js.map +1 -1
- package/dist/components/Recommendation/Recommendation.d.ts +5 -0
- package/dist/components/Recommendation/Recommendation.js +34 -0
- package/dist/components/Recommendation/Recommendation.js.map +1 -0
- package/dist/components/Recommendation/RecommendationCard.d.ts +7 -0
- package/dist/components/Recommendation/RecommendationCard.js +13 -0
- package/dist/components/Recommendation/RecommendationCard.js.map +1 -0
- package/dist/components/Recommendation/RecommendationContent.d.ts +14 -0
- package/dist/components/Recommendation/RecommendationContent.js +2 -0
- package/dist/components/Recommendation/RecommendationContent.js.map +1 -0
- package/dist/model/BlockVersion.d.ts +6 -1
- package/dist/ui-kit/Description/Description.js +1 -1
- package/lib/common.css +1 -1
- package/lib/components/Blocks.d.ts +1 -0
- package/lib/components/Blocks.js +2 -0
- package/lib/components/Blocks.js.map +1 -1
- package/lib/components/ContentPage/ContentPageHead.js +1 -1
- package/lib/components/ContentPage/ContentPageHead.js.map +1 -1
- package/lib/components/Headline/Headline.fixture.d.ts +4 -2
- package/lib/components/Headline/Headline.fixture.mobile.d.ts +2 -3
- package/lib/components/Headline/Headline.js +3 -8
- package/lib/components/Headline/Headline.js.map +1 -1
- package/lib/components/Headline/Headline.mobile.js +3 -2
- package/lib/components/Headline/Headline.mobile.js.map +1 -1
- package/lib/components/Headline/HeadlineContent.d.ts +2 -2
- package/lib/components/Headline/constants.d.ts +4 -0
- package/lib/components/Headline/constants.js +11 -0
- package/lib/components/Headline/constants.js.map +1 -0
- package/lib/components/ProductBlock/ProductBlockInner.js +1 -1
- package/lib/components/ProductBlock/ProductBlockInner.js.map +1 -1
- package/lib/components/ProductBlock/ProductBlockInner.mobile.js +1 -1
- package/lib/components/ProductBlock/ProductBlockInner.mobile.js.map +1 -1
- package/lib/components/Recommendation/Recommendation.d.ts +5 -0
- package/lib/components/Recommendation/Recommendation.fixture.d.ts +6 -0
- package/lib/components/Recommendation/Recommendation.js +32 -0
- package/lib/components/Recommendation/Recommendation.js.map +1 -0
- package/lib/components/Recommendation/RecommendationCard.d.ts +7 -0
- package/lib/components/Recommendation/RecommendationCard.js +11 -0
- package/lib/components/Recommendation/RecommendationCard.js.map +1 -0
- package/lib/components/Recommendation/RecommendationContent.d.ts +14 -0
- package/lib/components/Recommendation/RecommendationContent.js +2 -0
- package/lib/components/Recommendation/RecommendationContent.js.map +1 -0
- package/lib/model/BlockVersion.d.ts +6 -1
- package/lib/ui-kit/Description/Description.js +1 -1
- package/mobile/bundle/bundle.umd.js +16 -5
- package/mobile/bundle/bundle.umd.min.js +1 -1
- package/mobile/dist/components/ContentPage/ContentPageHead.js +1 -1
- package/mobile/dist/components/ContentPage/ContentPageHead.js.map +1 -1
- package/mobile/dist/components/Headline/Headline.js +3 -2
- package/mobile/dist/components/Headline/Headline.js.map +1 -1
- package/mobile/dist/components/Headline/HeadlineContent.d.ts +2 -2
- package/mobile/dist/components/Headline/constants.d.ts +4 -0
- package/mobile/dist/components/Headline/constants.js +13 -0
- package/mobile/dist/components/Headline/constants.js.map +1 -0
- package/mobile/dist/components/ProductBlock/ProductBlockInner.js +1 -1
- package/mobile/dist/components/ProductBlock/ProductBlockInner.js.map +1 -1
- package/mobile/dist/components/Recommendation/Recommendation.d.ts +5 -0
- package/mobile/dist/components/Recommendation/Recommendation.js +34 -0
- package/mobile/dist/components/Recommendation/Recommendation.js.map +1 -0
- package/mobile/dist/components/Recommendation/RecommendationCard.d.ts +7 -0
- package/mobile/dist/components/Recommendation/RecommendationCard.js +13 -0
- package/mobile/dist/components/Recommendation/RecommendationCard.js.map +1 -0
- package/mobile/dist/components/Recommendation/RecommendationContent.d.ts +14 -0
- package/mobile/dist/components/Recommendation/RecommendationContent.js +2 -0
- package/mobile/dist/components/Recommendation/RecommendationContent.js.map +1 -0
- package/mobile/dist/model/BlockVersion.d.ts +6 -1
- package/mobile/dist/ui-kit/Description/Description.js +1 -1
- package/mobile/lib/components/ContentPage/ContentPageHead.js +1 -1
- package/mobile/lib/components/ContentPage/ContentPageHead.js.map +1 -1
- package/mobile/lib/components/Headline/Headline.js +3 -2
- package/mobile/lib/components/Headline/Headline.js.map +1 -1
- package/mobile/lib/components/Headline/HeadlineContent.d.ts +2 -2
- package/mobile/lib/components/Headline/constants.d.ts +4 -0
- package/mobile/lib/components/Headline/constants.js +11 -0
- package/mobile/lib/components/Headline/constants.js.map +1 -0
- package/mobile/lib/components/ProductBlock/ProductBlockInner.js +1 -1
- package/mobile/lib/components/ProductBlock/ProductBlockInner.js.map +1 -1
- package/mobile/lib/components/Recommendation/Recommendation.d.ts +5 -0
- package/mobile/lib/components/Recommendation/Recommendation.js +32 -0
- package/mobile/lib/components/Recommendation/Recommendation.js.map +1 -0
- package/mobile/lib/components/Recommendation/RecommendationCard.d.ts +7 -0
- package/mobile/lib/components/Recommendation/RecommendationCard.js +11 -0
- package/mobile/lib/components/Recommendation/RecommendationCard.js.map +1 -0
- package/mobile/lib/components/Recommendation/RecommendationContent.d.ts +14 -0
- package/mobile/lib/components/Recommendation/RecommendationContent.js +2 -0
- package/mobile/lib/components/Recommendation/RecommendationContent.js.map +1 -0
- package/mobile/lib/model/BlockVersion.d.ts +6 -1
- package/mobile/lib/ui-kit/Description/Description.js +1 -1
- package/mobile/src/components/ContentPage/ContentPage.page.json +74 -0
- package/mobile/src/components/ContentPage/ContentPageHead.tsx +1 -1
- package/mobile/src/components/Headline/Headline.example.json +1 -1
- package/mobile/src/components/Headline/Headline.tsx +20 -4
- package/mobile/src/components/Headline/HeadlineContent.ts +2 -3
- package/mobile/src/components/Headline/constants.ts +14 -0
- package/mobile/src/components/ProductBlock/ProductBlockInner.tsx +3 -1
- package/mobile/src/components/Recommendation/Recommendation.example.json +38 -0
- package/mobile/src/components/Recommendation/Recommendation.tsx +105 -0
- package/mobile/src/components/Recommendation/RecommendationCard.tsx +33 -0
- package/mobile/src/components/Recommendation/RecommendationContent.ts +19 -0
- package/mobile/src/model/BlockVersion.ts +7 -1
- package/mobile/src/ui-kit/Description/Description.tsx +1 -1
- package/package.json +1 -1
- package/src/components/Blocks.ts +2 -0
- package/src/components/ContentPage/ContentPage.page.json +74 -0
- package/src/components/ContentPage/ContentPageHead.tsx +1 -1
- package/src/components/Headline/Headline.example.json +1 -1
- package/src/components/Headline/Headline.fixture.mobile.tsx +39 -15
- package/src/components/Headline/Headline.fixture.tsx +20 -17
- package/src/components/Headline/Headline.mobile.tsx +20 -4
- package/src/components/Headline/Headline.tsx +9 -12
- package/src/components/Headline/HeadlineContent.ts +2 -3
- package/src/components/Headline/constants.ts +14 -0
- package/src/components/ProductBlock/ProductBlockInner.mobile.tsx +3 -1
- package/src/components/ProductBlock/ProductBlockInner.tsx +1 -1
- package/src/components/Recommendation/Recommendation.example.json +38 -0
- package/src/components/Recommendation/Recommendation.fixture.tsx +73 -0
- package/src/components/Recommendation/Recommendation.tsx +105 -0
- package/src/components/Recommendation/RecommendationCard.tsx +33 -0
- package/src/components/Recommendation/RecommendationContent.ts +19 -0
- package/src/model/BlockVersion.ts +7 -1
- package/src/ui-kit/Description/Description.tsx +1 -1
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @title Цвет
|
|
2
|
+
* @title Цвет блока
|
|
3
3
|
* @enumNames ["Основная", "Второстепенная"]
|
|
4
4
|
*/
|
|
5
5
|
export declare type BlockVersion = 'primary' | 'secondary';
|
|
6
|
+
/**
|
|
7
|
+
* @title Цвет блока
|
|
8
|
+
* @enumNames ["Прозрачная", Основная", "Второстепенная"]
|
|
9
|
+
*/
|
|
10
|
+
export declare type BlockVersionWithTransparent = 'transparent' | 'primary' | 'secondary';
|
|
@@ -4,6 +4,6 @@ const jsx_runtime_1 = require("@redneckz/uni-jsx/jsx-runtime");
|
|
|
4
4
|
const uni_jsx_1 = require("@redneckz/uni-jsx");
|
|
5
5
|
exports.Description = (0, uni_jsx_1.JSX)((props) => {
|
|
6
6
|
const { className = '', description } = props;
|
|
7
|
-
return (0, jsx_runtime_1.jsx)("div", { className: `font-normal text-
|
|
7
|
+
return (0, jsx_runtime_1.jsx)("div", { className: `font-normal text-base ${className}`, children: description });
|
|
8
8
|
});
|
|
9
9
|
//# sourceMappingURL=Description.js.map
|
|
@@ -7,7 +7,7 @@ export const ContentPageHead = JSX(({ HeadComponent, data, children }) => {
|
|
|
7
7
|
});
|
|
8
8
|
function renderOpenGraph(og) {
|
|
9
9
|
return og
|
|
10
|
-
? Object.entries(og).map(([key, value]) => (_jsx("meta", {
|
|
10
|
+
? Object.entries(og).map(([key, value]) => (_jsx("meta", { property: `og:${key}`, content: value }, key)))
|
|
11
11
|
: null;
|
|
12
12
|
}
|
|
13
13
|
function renderTwitter(twitter) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ContentPageHead.js","sourceRoot":"","sources":["../../../src/components/ContentPage/ContentPageHead.tsx"],"names":[],"mappings":";AAA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,EAAE,CAAC,CACvC,eAAgB,QAAQ,EAAE,MAAM,GAAG,EAAE,EAAE,OAAO,EAAE,KAAK,IAA1C,GAAG,CAA2C,CAC1D,CAAC;QACJ,CAAC,CAAC,IAAI,CAAC;AACX,CAAC;AAED,SAAS,aAAa,CAAC,OAA2C;IAChE,OAAO,OAAO;QACZ,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,EAAE,KAAK,CAAC,EAAE,EAAE,CAAC,CAC5C,eAAgB,IAAI,EAAE,WAAW,GAAG,EAAE,EAAE,OAAO,EAAE,KAAK,IAA3C,GAAG,CAA4C,CAC3D,CAAC;QACJ,CAAC,CAAC,IAAI,CAAC;AACX,CAAC"}
|
|
@@ -2,7 +2,8 @@ import { jsx as _jsx, jsxs as _jsxs } from "@redneckz/uni-jsx/jsx-runtime";
|
|
|
2
2
|
import { JSX } from '@redneckz/uni-jsx';
|
|
3
3
|
import { Heading } from '../../ui-kit/Heading/Heading.js';
|
|
4
4
|
import { Img } from '../../ui-kit/Img/Img.js';
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
import { ALIGN_TEXT, BACKGROUND_COLOR } from './constants.js';
|
|
6
|
+
export const Headline = JSX(({ bgColorHeadline = 'transparent', className = '', title, description, image, align = 'left', }) => {
|
|
7
|
+
return (_jsxs("section", { className: `px-4 py-6 ${BACKGROUND_COLOR[bgColorHeadline]} ${className}`, children: [title && (_jsx(Heading, { headingType: "h2", className: `text-primary-text ${ALIGN_TEXT[align]}`, title: title })), description && (_jsx("p", { className: `font-normal text-m-md ${ALIGN_TEXT[align]} ${title ? 'mt-2.5' : ''}`, children: description })), image?.src && (_jsx("div", { className: "mt-5 mx-auto flex justify-center", children: _jsx(Img, { image: image }) }))] }));
|
|
7
8
|
});
|
|
8
9
|
//# sourceMappingURL=Headline.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Headline.js","sourceRoot":"","sources":["../../../src/components/Headline/Headline.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAGxC,OAAO,EAAE,OAAO,EAAE,MAAM,8BAA8B,CAAC;AACvD,OAAO,EAAE,GAAG,EAAE,MAAM,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"Headline.js","sourceRoot":"","sources":["../../../src/components/Headline/Headline.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAGxC,OAAO,EAAE,OAAO,EAAE,MAAM,8BAA8B,CAAC;AACvD,OAAO,EAAE,GAAG,EAAE,MAAM,sBAAsB,CAAC;AAC3C,OAAO,EAAE,UAAU,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAK3D,MAAM,CAAC,MAAM,QAAQ,GAAG,GAAG,CACzB,CAAC,EACC,eAAe,GAAG,aAAa,EAC/B,SAAS,GAAG,EAAE,EACd,KAAK,EACL,WAAW,EACX,KAAK,EACL,KAAK,GAAG,MAAM,GACf,EAAE,EAAE;IACH,OAAO,CACL,mBAAS,SAAS,EAAE,aAAa,gBAAgB,CAAC,eAAe,CAAC,IAAI,SAAS,EAAE,aAC9E,KAAK,IAAI,CACR,KAAC,OAAO,IACN,WAAW,EAAC,IAAI,EAChB,SAAS,EAAE,qBAAqB,UAAU,CAAC,KAAK,CAAC,EAAE,EACnD,KAAK,EAAE,KAAK,GACZ,CACH,EACA,WAAW,IAAI,CACd,YAAG,SAAS,EAAE,yBAAyB,UAAU,CAAC,KAAK,CAAC,IAAI,KAAK,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,EAAE,YAChF,WAAW,GACV,CACL,EACA,KAAK,EAAE,GAAG,IAAI,CACb,cAAK,SAAS,EAAC,kCAAkC,YAC/C,KAAC,GAAG,IAAC,KAAK,EAAE,KAAK,GAAI,GACjB,CACP,IACO,CACX,CAAC;AACJ,CAAC,CACF,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { BlockVersionWithTransparent } from '../../model/BlockVersion';
|
|
2
2
|
import type { DescriptionContent } from '../../ui-kit/Description/DescriptionContent';
|
|
3
3
|
import type { HeadingContent } from '../../ui-kit/Heading/HeadingContent';
|
|
4
4
|
import type { ImageContent } from '../../ui-kit/Img/ImgProps';
|
|
@@ -8,5 +8,5 @@ import type { AlignType } from '../BaseTile/BaseTileProps';
|
|
|
8
8
|
*/
|
|
9
9
|
export declare type HeadlineContent = HeadingContent & DescriptionContent & ImageContent & {
|
|
10
10
|
align?: AlignType;
|
|
11
|
-
|
|
11
|
+
bgColorHeadline?: BlockVersionWithTransparent;
|
|
12
12
|
};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { AlignType } from '../BaseTile/BaseTileProps';
|
|
2
|
+
import type { BlockVersionWithTransparent } from '../../model/BlockVersion';
|
|
3
|
+
export declare const ALIGN_TEXT: Record<AlignType, string>;
|
|
4
|
+
export declare const BACKGROUND_COLOR: Record<BlockVersionWithTransparent, string>;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export const ALIGN_TEXT = {
|
|
2
|
+
left: 'text-left',
|
|
3
|
+
center: 'text-center',
|
|
4
|
+
right: 'text-right',
|
|
5
|
+
};
|
|
6
|
+
export const BACKGROUND_COLOR = {
|
|
7
|
+
transparent: 'bg-transparent',
|
|
8
|
+
primary: 'bg-white',
|
|
9
|
+
secondary: 'bg-primary-main',
|
|
10
|
+
};
|
|
11
|
+
//# sourceMappingURL=constants.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../src/components/Headline/constants.ts"],"names":[],"mappings":"AAGA,MAAM,CAAC,MAAM,UAAU,GAA8B;IACnD,IAAI,EAAE,WAAW;IACjB,MAAM,EAAE,aAAa;IACrB,KAAK,EAAE,YAAY;CACpB,CAAC;AAEF,MAAM,CAAC,MAAM,gBAAgB,GAAgD;IAC3E,WAAW,EAAE,gBAAgB;IAC7B,OAAO,EAAE,UAAU;IACnB,SAAS,EAAE,iBAAiB;CAC7B,CAAC"}
|
|
@@ -8,7 +8,7 @@ import { List } from '../../ui-kit/List/List.js';
|
|
|
8
8
|
import { BaseTile } from '../BaseTile/BaseTile.js';
|
|
9
9
|
import { renderBenefit } from './renderBenefit.js';
|
|
10
10
|
export const ProductBlockInner = JSX(({ className = '', context, title, headingType = 'h2', description, benefits, buttons, image, items, version = 'primary', }) => {
|
|
11
|
-
return (_jsxs("div", { className: `w-full text-primary-text ${className}`, children: [_jsx("div", { children: _jsxs(BaseTile, { context: context, title: title && (_jsx(Heading, { headingType: headingType, title: title, className: "whitespace-pre-wrap max-w-[600px]" })), buttons: buttons?.length ? (_jsx(ButtonSection, { context: context, buttons: buttons, className: "flex flex-col mt-5 gap-2.5" })) : null, children: [description ? _jsx(Description, { className: "mt-3", description: description }) : null, benefits?.filter((items) => items.label)?.length ? (_jsx("div", { className: "mt-3", children: benefits.map((_, i) => renderBenefit(_, i, version)) })) : null, items?.length ? _jsx(List, { className: "mt-3", items: items }) : null] }) }), renderImage(image)] }));
|
|
11
|
+
return (_jsxs("div", { className: `w-full text-primary-text ${className}`, children: [_jsx("div", { children: _jsxs(BaseTile, { context: context, title: title && (_jsx(Heading, { headingType: headingType, title: title, className: "whitespace-pre-wrap max-w-[600px]" })), buttons: buttons?.length ? (_jsx(ButtonSection, { context: context, buttons: buttons, className: "flex flex-col mt-5 gap-2.5" })) : null, children: [description ? (_jsx(Description, { className: "mt-3 text-m-md", description: description })) : null, benefits?.filter((items) => items.label)?.length ? (_jsx("div", { className: "mt-3", children: benefits.map((_, i) => renderBenefit(_, i, version)) })) : null, items?.length ? _jsx(List, { className: "mt-3", items: items }) : null] }) }), renderImage(image)] }));
|
|
12
12
|
});
|
|
13
13
|
function renderImage(image) {
|
|
14
14
|
return image?.src ? (_jsx("div", { className: "mt-5", children: _jsx(Img, { image: { className: 'block', ...image } }) })) : null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ProductBlockInner.js","sourceRoot":"","sources":["../../../src/components/ProductBlock/ProductBlockInner.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAExC,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,IAAI,EAAE,MAAM,wBAAwB,CAAC;AAC9C,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAEhD,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAIhD,MAAM,CAAC,MAAM,iBAAiB,GAAG,GAAG,CAClC,CAAC,EACC,SAAS,GAAG,EAAE,EACd,OAAO,EACP,KAAK,EACL,WAAW,GAAG,IAAI,EAClB,WAAW,EACX,QAAQ,EACR,OAAO,EACP,KAAK,EACL,KAAK,EACL,OAAO,GAAG,SAAS,GACpB,EAAE,EAAE;IACH,OAAO,CACL,eAAK,SAAS,EAAE,4BAA4B,SAAS,EAAE,aACrD,wBACE,MAAC,QAAQ,IACP,OAAO,EAAE,OAAO,EAChB,KAAK,EACH,KAAK,IAAI,CACP,KAAC,OAAO,IACN,WAAW,EAAE,WAAW,EACxB,KAAK,EAAE,KAAK,EACZ,SAAS,EAAC,mCAAmC,GAC7C,CACH,EAEH,OAAO,EACL,OAAO,EAAE,MAAM,CAAC,CAAC,CAAC,CAChB,KAAC,aAAa,IACZ,OAAO,EAAE,OAAO,EAChB,OAAO,EAAE,OAAO,EAChB,SAAS,EAAC,4BAA4B,GACtC,CACH,CAAC,CAAC,CAAC,IAAI,aAGT,WAAW,CAAC,CAAC,CAAC,KAAC,WAAW,IAAC,SAAS,EAAC,
|
|
1
|
+
{"version":3,"file":"ProductBlockInner.js","sourceRoot":"","sources":["../../../src/components/ProductBlock/ProductBlockInner.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAExC,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,IAAI,EAAE,MAAM,wBAAwB,CAAC;AAC9C,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAEhD,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAIhD,MAAM,CAAC,MAAM,iBAAiB,GAAG,GAAG,CAClC,CAAC,EACC,SAAS,GAAG,EAAE,EACd,OAAO,EACP,KAAK,EACL,WAAW,GAAG,IAAI,EAClB,WAAW,EACX,QAAQ,EACR,OAAO,EACP,KAAK,EACL,KAAK,EACL,OAAO,GAAG,SAAS,GACpB,EAAE,EAAE;IACH,OAAO,CACL,eAAK,SAAS,EAAE,4BAA4B,SAAS,EAAE,aACrD,wBACE,MAAC,QAAQ,IACP,OAAO,EAAE,OAAO,EAChB,KAAK,EACH,KAAK,IAAI,CACP,KAAC,OAAO,IACN,WAAW,EAAE,WAAW,EACxB,KAAK,EAAE,KAAK,EACZ,SAAS,EAAC,mCAAmC,GAC7C,CACH,EAEH,OAAO,EACL,OAAO,EAAE,MAAM,CAAC,CAAC,CAAC,CAChB,KAAC,aAAa,IACZ,OAAO,EAAE,OAAO,EAChB,OAAO,EAAE,OAAO,EAChB,SAAS,EAAC,4BAA4B,GACtC,CACH,CAAC,CAAC,CAAC,IAAI,aAGT,WAAW,CAAC,CAAC,CAAC,CACb,KAAC,WAAW,IAAC,SAAS,EAAC,gBAAgB,EAAC,WAAW,EAAE,WAAW,GAAI,CACrE,CAAC,CAAC,CAAC,IAAI,EACP,QAAQ,EAAE,MAAM,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC,CAClD,cAAK,SAAS,EAAC,MAAM,YAAE,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,aAAa,CAAC,CAAC,EAAE,CAAC,EAAE,OAAO,CAAC,CAAC,GAAO,CACnF,CAAC,CAAC,CAAC,IAAI,EACP,KAAK,EAAE,MAAM,CAAC,CAAC,CAAC,KAAC,IAAI,IAAC,SAAS,EAAC,MAAM,EAAC,KAAK,EAAE,KAAK,GAAI,CAAC,CAAC,CAAC,IAAI,IACtD,GACP,EACL,WAAW,CAAC,KAAK,CAAC,IACf,CACP,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,SAAS,WAAW,CAAC,KAAK;IACxB,OAAO,KAAK,EAAE,GAAG,CAAC,CAAC,CAAC,CAClB,cAAK,SAAS,EAAC,MAAM,YACnB,KAAC,GAAG,IAAC,KAAK,EAAE,EAAE,SAAS,EAAE,OAAO,EAAE,GAAG,KAAK,EAAE,GAAI,GAC5C,CACP,CAAC,CAAC,CAAC,IAAI,CAAC;AACX,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { UniBlockProps } from '../../types';
|
|
2
|
+
import type { RecommendationContent } from './RecommendationContent';
|
|
3
|
+
export interface RecommendationProps extends RecommendationContent, UniBlockProps {
|
|
4
|
+
}
|
|
5
|
+
export declare const Recommendation: (props: import("@redneckz/uni-jsx").PropsWithChildren<RecommendationProps, any>, context?: any) => any;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "@redneckz/uni-jsx/jsx-runtime";
|
|
2
|
+
import { JSX } from '@redneckz/uni-jsx';
|
|
3
|
+
import { ArrowButton } from '../../ui-kit/Button/ArrowButton.js';
|
|
4
|
+
import { Heading } from '../../ui-kit/Heading/Heading.js';
|
|
5
|
+
import { RecommendationCard } from './RecommendationCard.js';
|
|
6
|
+
const BLUR_BLOCK_CLASSES = 'absolute top-0 bottom-0 w-[84px]';
|
|
7
|
+
const CARD_FULL_VIEW_COUNT = 2;
|
|
8
|
+
const CARD_SHIFT = 525;
|
|
9
|
+
export const Recommendation = JSX(({ context, recommendations = [], className = '', title, version }) => {
|
|
10
|
+
const [activeCardIndex, setActiveCardIndex] = context.useState(0);
|
|
11
|
+
const blockClassName = version === 'secondary' ? 'bg-primary-main text-white' : 'bg-white text-primary-text';
|
|
12
|
+
const cardClassName = version === 'secondary' ? 'border-main-divider' : 'border-main-stroke';
|
|
13
|
+
return (_jsxs("section", { className: `relative font-sans p-[50px] overflow-hidden ${blockClassName} ${className}`, children: [title ? _jsx(Heading, { headingType: "h3", className: "mb-8", title: title }) : null, _jsx("div", { className: "flex duration-1000 gap-4", style: { transform: `translateX(-${activeCardIndex * CARD_SHIFT}px)` }, role: "list", children: recommendations?.length
|
|
14
|
+
? recommendations.map(renderRecommendationCard({ context, version, className: cardClassName }))
|
|
15
|
+
: null }), renderNavButtons({
|
|
16
|
+
cardsCount: recommendations.length,
|
|
17
|
+
activeCardIndex,
|
|
18
|
+
setActiveCardIndex,
|
|
19
|
+
}), _jsx("div", { className: `${BLUR_BLOCK_CLASSES} left-0 ${version === 'secondary' ? 'bg-opacity-from-main' : 'bg-opacity-from-white'}` }), _jsx("div", { className: `${BLUR_BLOCK_CLASSES} right-0 ${version === 'secondary' ? 'bg-opacity-to-main' : 'bg-opacity-to-white'}` })] }));
|
|
20
|
+
});
|
|
21
|
+
const renderRecommendationCard = ({ context, version, className }) => (card, i) => {
|
|
22
|
+
return (_jsx(RecommendationCard, { context: context, ...card, version: version, className: className }, String(i)));
|
|
23
|
+
};
|
|
24
|
+
const renderNavButtons = ({ cardsCount, activeCardIndex, setActiveCardIndex, }) => {
|
|
25
|
+
const handleNextClick = () => setActiveCardIndex(activeCardIndex + 1);
|
|
26
|
+
const handlePrevClick = () => setActiveCardIndex(activeCardIndex - 1);
|
|
27
|
+
const isUseSlider = cardsCount > CARD_FULL_VIEW_COUNT;
|
|
28
|
+
const showNextButton = isUseSlider && cardsCount - activeCardIndex > CARD_FULL_VIEW_COUNT;
|
|
29
|
+
const showPrevButton = isUseSlider && activeCardIndex > 0;
|
|
30
|
+
return (_jsxs("div", { children: [showPrevButton && (_jsx(ArrowButton, { className: "absolute top-1/2 left-8 rotate-180 z-10 mt-6", onClick: handlePrevClick, ariaLabel: "\u041F\u0440\u043E\u043B\u0438\u0441\u0442\u0430\u0442\u044C \u0432\u043B\u0435\u0432\u043E" })), showNextButton && (_jsx(ArrowButton, { className: "absolute top-1/2 right-8 z-10 mt-6", onClick: handleNextClick, ariaLabel: "\u041F\u0440\u043E\u043B\u0438\u0441\u0442\u0430\u0442\u044C \u0432\u043F\u0440\u0430\u0432\u043E" }))] }));
|
|
31
|
+
};
|
|
32
|
+
//# sourceMappingURL=Recommendation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Recommendation.js","sourceRoot":"","sources":["../../../src/components/Recommendation/Recommendation.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAExC,OAAO,EAAE,WAAW,EAAE,MAAM,iCAAiC,CAAC;AAC9D,OAAO,EAAE,OAAO,EAAE,MAAM,8BAA8B,CAAC;AACvD,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAG1D,MAAM,kBAAkB,GAAG,kCAAkC,CAAC;AAC9D,MAAM,oBAAoB,GAAG,CAAC,CAAC;AAC/B,MAAM,UAAU,GAAG,GAAG,CAAC;AAIvB,MAAM,CAAC,MAAM,cAAc,GAAG,GAAG,CAC/B,CAAC,EAAE,OAAO,EAAE,eAAe,GAAG,EAAE,EAAE,SAAS,GAAG,EAAE,EAAE,KAAK,E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F,MAAM,wBAAwB,GAC5B,CAAC,EAAE,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,EAAE,EAAE,CACpC,CAAC,IAA+B,EAAE,CAAS,EAAE,EAAE;IAC7C,OAAO,CACL,KAAC,kBAAkB,IAEjB,OAAO,EAAE,OAAO,KACZ,IAAI,EACR,OAAO,EAAE,OAAO,EAChB,SAAS,EAAE,SAAS,IAJf,MAAM,CAAC,CAAC,CAAC,CAKd,CACH,CAAC;AACJ,CAAC,CAAC;AAEJ,MAAM,gBAAgB,GAAG,CAAC,EACxB,UAAU,EACV,eAAe,EACf,kBAAkB,GAKnB,EAAE,EAAE;IACH,MAAM,eAAe,GAAG,GAAG,EAAE,CAAC,kBAAkB,CAAC,eAAe,GAAG,CAAC,CAAC,CAAC;IACtE,MAAM,eAAe,GAAG,GAAG,EAAE,CAAC,kBAAkB,CAAC,eAAe,GAAG,CAAC,CAAC,CAAC;IACtE,MAAM,WAAW,GAAG,UAAU,GAAG,oBAAoB,CAAC;IACtD,MAAM,cAAc,GAAG,WAAW,IAAI,UAAU,GAAG,eAAe,GAAG,oBAAoB,CAAC;IAC1F,MAAM,cAAc,GAAG,WAAW,IAAI,eAAe,GAAG,CAAC,CAAC;IAE1D,OAAO,CACL,0BACG,cAAc,IAAI,CACjB,KAAC,WAAW,IACV,SAAS,EAAC,8CAA8C,EACxD,OAAO,EAAE,eAAe,EACxB,SAAS,EAAC,6FAAkB,GAC5B,CACH,EACA,cAAc,IAAI,CACjB,KAAC,WAAW,IACV,SAAS,EAAC,oCAAoC,EAC9C,OAAO,EAAE,eAAe,EACxB,SAAS,EAAC,mGAAmB,GAC7B,CACH,IACG,CACP,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { BlockVersion } from '../../model/BlockVersion';
|
|
2
|
+
import type { UniBlockProps } from '../../types';
|
|
3
|
+
import type { RecommendationCardContent } from './RecommendationContent';
|
|
4
|
+
export interface RecommendationCardProps extends RecommendationCardContent, UniBlockProps {
|
|
5
|
+
version?: BlockVersion;
|
|
6
|
+
}
|
|
7
|
+
export declare const RecommendationCard: (props: import("@redneckz/uni-jsx").PropsWithChildren<RecommendationCardProps, any>, context?: any) => any;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "@redneckz/uni-jsx/jsx-runtime";
|
|
2
|
+
import { JSX } from '@redneckz/uni-jsx';
|
|
3
|
+
import { Description } from '../../ui-kit/Description/Description.js';
|
|
4
|
+
import { Heading } from '../../ui-kit/Heading/Heading.js';
|
|
5
|
+
import { Img } from '../../ui-kit/Img/Img.js';
|
|
6
|
+
import { List } from '../../ui-kit/List/List.js';
|
|
7
|
+
import { BaseTile } from '../BaseTile/BaseTile.js';
|
|
8
|
+
export const RecommendationCard = JSX(({ context, className = '', title, description, items, image, version }) => {
|
|
9
|
+
return (_jsx("section", { className: `border border-solid box-border rounded-md p-7 min-w-[515px] max-w-[515px] ${className}`, role: "listitem", children: _jsxs(BaseTile, { context: context, title: title && _jsx(Heading, { headingType: "h4", title: title, className: "mb-4" }), image: image?.src && _jsx(Img, { className: "mt-auto ml-7", image: image }), children: [description ? _jsx(Description, { description: description }) : null, items?.length ? _jsx(List, { items: items, version: version }) : null] }) }));
|
|
10
|
+
});
|
|
11
|
+
//# sourceMappingURL=RecommendationCard.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RecommendationCard.js","sourceRoot":"","sources":["../../../src/components/Recommendation/RecommendationCard.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAGxC,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,IAAI,EAAE,MAAM,wBAAwB,CAAC;AAC9C,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAOhD,MAAM,CAAC,MAAM,kBAAkB,GAAG,GAAG,CACnC,CAAC,EAAE,OAAO,EAAE,SAAS,GAAG,EAAE,EAAE,KAAK,EAAE,WAAW,EAAE,KAAK,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE,EAAE;IACzE,OAAO,CACL,kBACE,SAAS,EAAE,6EAA6E,SAAS,EAAE,EACnG,IAAI,EAAC,UAAU,YAEf,MAAC,QAAQ,IACP,OAAO,EAAE,OAAO,EAChB,KAAK,EAAE,KAAK,IAAI,KAAC,OAAO,IAAC,WAAW,EAAC,IAAI,EAAC,KAAK,EAAE,KAAK,EAAE,SAAS,EAAC,MAAM,GAAG,EAC3E,KAAK,EAAE,KAAK,EAAE,GAAG,IAAI,KAAC,GAAG,IAAC,SAAS,EAAC,cAAc,EAAC,KAAK,EAAE,KAAK,GAAI,aAElE,WAAW,CAAC,CAAC,CAAC,KAAC,WAAW,IAAC,WAAW,EAAE,WAAW,GAAI,CAAC,CAAC,CAAC,IAAI,EAC9D,KAAK,EAAE,MAAM,CAAC,CAAC,CAAC,KAAC,IAAI,IAAC,KAAK,EAAE,KAAK,EAAE,OAAO,EAAE,OAAO,GAAI,CAAC,CAAC,CAAC,IAAI,IACvD,GACH,CACX,CAAC;AACJ,CAAC,CACF,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { BlockVersion } from '../../model/BlockVersion';
|
|
2
|
+
import type { DescriptionContent } from '../../ui-kit/Description/DescriptionContent';
|
|
3
|
+
import type { HeadingContent } from '../../ui-kit/Heading/HeadingContent';
|
|
4
|
+
import type { ImageContent } from '../../ui-kit/Img/ImgProps';
|
|
5
|
+
import type { ListContent } from '../../ui-kit/List/ListContent';
|
|
6
|
+
export declare type RecommendationCardContent = HeadingContent & DescriptionContent & ListContent & ImageContent;
|
|
7
|
+
/**
|
|
8
|
+
* @title Рекомендации
|
|
9
|
+
*/
|
|
10
|
+
export interface RecommendationContent extends HeadingContent {
|
|
11
|
+
/** @title Карточки */
|
|
12
|
+
recommendations?: RecommendationCardContent[];
|
|
13
|
+
version?: BlockVersion;
|
|
14
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RecommendationContent.js","sourceRoot":"","sources":["../../../src/components/Recommendation/RecommendationContent.ts"],"names":[],"mappings":""}
|
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @title Цвет
|
|
2
|
+
* @title Цвет блока
|
|
3
3
|
* @enumNames ["Основная", "Второстепенная"]
|
|
4
4
|
*/
|
|
5
5
|
export declare type BlockVersion = 'primary' | 'secondary';
|
|
6
|
+
/**
|
|
7
|
+
* @title Цвет блока
|
|
8
|
+
* @enumNames ["Прозрачная", Основная", "Второстепенная"]
|
|
9
|
+
*/
|
|
10
|
+
export declare type BlockVersionWithTransparent = 'transparent' | 'primary' | 'secondary';
|
|
@@ -2,6 +2,6 @@ import { jsx as _jsx } from "@redneckz/uni-jsx/jsx-runtime";
|
|
|
2
2
|
import { JSX } from '@redneckz/uni-jsx';
|
|
3
3
|
export const Description = JSX((props) => {
|
|
4
4
|
const { className = '', description } = props;
|
|
5
|
-
return _jsx("div", { className: `font-normal text-
|
|
5
|
+
return _jsx("div", { className: `font-normal text-base ${className}`, children: description });
|
|
6
6
|
});
|
|
7
7
|
//# sourceMappingURL=Description.js.map
|
|
@@ -1882,6 +1882,80 @@
|
|
|
1882
1882
|
"type": "CreditCalculator",
|
|
1883
1883
|
"style": ["col-span-12"]
|
|
1884
1884
|
},
|
|
1885
|
+
{
|
|
1886
|
+
"type": "Recommendation",
|
|
1887
|
+
"style": ["col-span-12"],
|
|
1888
|
+
"content": {
|
|
1889
|
+
"title": "С этим продуктом приобретают",
|
|
1890
|
+
"recommendations": [
|
|
1891
|
+
{
|
|
1892
|
+
"title": "Кредиты",
|
|
1893
|
+
"items": ["до 10 000 000 ₽", "до 10 лет"],
|
|
1894
|
+
"image": {
|
|
1895
|
+
"src": "chair.png",
|
|
1896
|
+
"alt": "Варианты потребительского кредита",
|
|
1897
|
+
"format": "webp",
|
|
1898
|
+
"size": {
|
|
1899
|
+
"width": 180,
|
|
1900
|
+
"height": 180
|
|
1901
|
+
}
|
|
1902
|
+
}
|
|
1903
|
+
},
|
|
1904
|
+
{
|
|
1905
|
+
"title": "Кредитные карты",
|
|
1906
|
+
"description": "Льготный период 120 дней",
|
|
1907
|
+
"image": {
|
|
1908
|
+
"src": "credit-card-1.png",
|
|
1909
|
+
"alt": "Варианты потребительского кредита",
|
|
1910
|
+
"format": "webp",
|
|
1911
|
+
"size": {
|
|
1912
|
+
"width": 180,
|
|
1913
|
+
"height": 180
|
|
1914
|
+
}
|
|
1915
|
+
}
|
|
1916
|
+
},
|
|
1917
|
+
{
|
|
1918
|
+
"title": "Кредитные карты",
|
|
1919
|
+
"description": "Льготный период 120 дней",
|
|
1920
|
+
"image": {
|
|
1921
|
+
"src": "credit-card-1.png",
|
|
1922
|
+
"alt": "Варианты потребительского кредита",
|
|
1923
|
+
"format": "webp",
|
|
1924
|
+
"size": {
|
|
1925
|
+
"width": 180,
|
|
1926
|
+
"height": 180
|
|
1927
|
+
}
|
|
1928
|
+
}
|
|
1929
|
+
},
|
|
1930
|
+
{
|
|
1931
|
+
"title": "Кредитные карты",
|
|
1932
|
+
"description": "Льготный период 120 дней",
|
|
1933
|
+
"image": {
|
|
1934
|
+
"src": "credit-card-1.png",
|
|
1935
|
+
"alt": "Варианты потребительского кредита",
|
|
1936
|
+
"format": "webp",
|
|
1937
|
+
"size": {
|
|
1938
|
+
"width": 180,
|
|
1939
|
+
"height": 180
|
|
1940
|
+
}
|
|
1941
|
+
}
|
|
1942
|
+
},
|
|
1943
|
+
{
|
|
1944
|
+
"title": "Кредитные карты",
|
|
1945
|
+
"description": "Льготный период 120 дней",
|
|
1946
|
+
"image": {
|
|
1947
|
+
"src": "credit-card-1.png",
|
|
1948
|
+
"alt": "Варианты потребительского кредита",
|
|
1949
|
+
"format": "webp",
|
|
1950
|
+
"size": {
|
|
1951
|
+
"width": 180,
|
|
1952
|
+
"height": 180
|
|
1953
|
+
}
|
|
1954
|
+
}
|
|
1955
|
+
}
|
|
1956
|
+
]
|
|
1957
|
+
}
|
|
1958
|
+
},
|
|
1885
1959
|
{
|
|
1886
1960
|
"type": "Footer",
|
|
1887
1961
|
"style": ["col-span-12"],
|
|
@@ -28,7 +28,7 @@ export const ContentPageHead = JSX<ContentPageHeadProps>(({ HeadComponent, data,
|
|
|
28
28
|
function renderOpenGraph(og: Record<string, string> | undefined) {
|
|
29
29
|
return og
|
|
30
30
|
? Object.entries(og).map(([key, value]) => (
|
|
31
|
-
<meta key={key}
|
|
31
|
+
<meta key={key} property={`og:${key}`} content={value} />
|
|
32
32
|
))
|
|
33
33
|
: null;
|
|
34
34
|
}
|
|
@@ -3,17 +3,33 @@ import { JSX } from '@redneckz/uni-jsx';
|
|
|
3
3
|
import type { UniBlockProps } from '../../types';
|
|
4
4
|
import { Heading } from '../../ui-kit/Heading/Heading';
|
|
5
5
|
import { Img } from '../../ui-kit/Img/Img';
|
|
6
|
+
import { ALIGN_TEXT, BACKGROUND_COLOR } from './constants';
|
|
6
7
|
import type { HeadlineContent } from './HeadlineContent';
|
|
7
8
|
|
|
8
9
|
export interface HeadlineProps extends UniBlockProps, HeadlineContent {}
|
|
9
10
|
|
|
10
11
|
export const Headline = JSX<HeadlineProps>(
|
|
11
|
-
({
|
|
12
|
+
({
|
|
13
|
+
bgColorHeadline = 'transparent',
|
|
14
|
+
className = '',
|
|
15
|
+
title,
|
|
16
|
+
description,
|
|
17
|
+
image,
|
|
18
|
+
align = 'left',
|
|
19
|
+
}) => {
|
|
12
20
|
return (
|
|
13
|
-
<section className={`px-4 py-6 ${
|
|
14
|
-
{title &&
|
|
21
|
+
<section className={`px-4 py-6 ${BACKGROUND_COLOR[bgColorHeadline]} ${className}`}>
|
|
22
|
+
{title && (
|
|
23
|
+
<Heading
|
|
24
|
+
headingType="h2"
|
|
25
|
+
className={`text-primary-text ${ALIGN_TEXT[align]}`}
|
|
26
|
+
title={title}
|
|
27
|
+
/>
|
|
28
|
+
)}
|
|
15
29
|
{description && (
|
|
16
|
-
<p className={`font-normal text-m-md ${title ? 'mt-2.5' : ''}`}>
|
|
30
|
+
<p className={`font-normal text-m-md ${ALIGN_TEXT[align]} ${title ? 'mt-2.5' : ''}`}>
|
|
31
|
+
{description}
|
|
32
|
+
</p>
|
|
17
33
|
)}
|
|
18
34
|
{image?.src && (
|
|
19
35
|
<div className="mt-5 mx-auto flex justify-center">
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { BlockVersionWithTransparent } from '../../model/BlockVersion';
|
|
2
2
|
import type { DescriptionContent } from '../../ui-kit/Description/DescriptionContent';
|
|
3
3
|
import type { HeadingContent } from '../../ui-kit/Heading/HeadingContent';
|
|
4
4
|
import type { ImageContent } from '../../ui-kit/Img/ImgProps';
|
|
@@ -11,6 +11,5 @@ export type HeadlineContent = HeadingContent &
|
|
|
11
11
|
DescriptionContent &
|
|
12
12
|
ImageContent & {
|
|
13
13
|
align?: AlignType;
|
|
14
|
-
|
|
15
|
-
bgColor?: BgColorVersion;
|
|
14
|
+
bgColorHeadline?: BlockVersionWithTransparent;
|
|
16
15
|
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { AlignType } from '../BaseTile/BaseTileProps';
|
|
2
|
+
import type { BlockVersionWithTransparent } from '../../model/BlockVersion';
|
|
3
|
+
|
|
4
|
+
export const ALIGN_TEXT: Record<AlignType, string> = {
|
|
5
|
+
left: 'text-left',
|
|
6
|
+
center: 'text-center',
|
|
7
|
+
right: 'text-right',
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
export const BACKGROUND_COLOR: Record<BlockVersionWithTransparent, string> = {
|
|
11
|
+
transparent: 'bg-transparent',
|
|
12
|
+
primary: 'bg-white',
|
|
13
|
+
secondary: 'bg-primary-main',
|
|
14
|
+
};
|
|
@@ -48,7 +48,9 @@ export const ProductBlockInner = JSX<ProductBlockInnerProps>(
|
|
|
48
48
|
) : null
|
|
49
49
|
}
|
|
50
50
|
>
|
|
51
|
-
{description ?
|
|
51
|
+
{description ? (
|
|
52
|
+
<Description className="mt-3 text-m-md" description={description} />
|
|
53
|
+
) : null}
|
|
52
54
|
{benefits?.filter((items) => items.label)?.length ? (
|
|
53
55
|
<div className="mt-3">{benefits.map((_, i) => renderBenefit(_, i, version))}</div>
|
|
54
56
|
) : null}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
{
|
|
2
|
+
"title": "Блок рекомендаций",
|
|
3
|
+
"recommendations": [
|
|
4
|
+
{
|
|
5
|
+
"image": {
|
|
6
|
+
"format": "webp",
|
|
7
|
+
"size": {
|
|
8
|
+
"width": 180,
|
|
9
|
+
"height": 180
|
|
10
|
+
}
|
|
11
|
+
},
|
|
12
|
+
"title": "Заголовок 1",
|
|
13
|
+
"description": "Описание 1"
|
|
14
|
+
},
|
|
15
|
+
{
|
|
16
|
+
"image": {
|
|
17
|
+
"format": "webp",
|
|
18
|
+
"size": {
|
|
19
|
+
"width": 180,
|
|
20
|
+
"height": 180
|
|
21
|
+
}
|
|
22
|
+
},
|
|
23
|
+
"title": "Заголовок 2",
|
|
24
|
+
"description": "Описание 2"
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
"image": {
|
|
28
|
+
"format": "webp",
|
|
29
|
+
"size": {
|
|
30
|
+
"width": 180,
|
|
31
|
+
"height": 180
|
|
32
|
+
}
|
|
33
|
+
},
|
|
34
|
+
"title": "Заголовок 3",
|
|
35
|
+
"description": "Описание 3"
|
|
36
|
+
}
|
|
37
|
+
]
|
|
38
|
+
}
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
import { JSX } from '@redneckz/uni-jsx';
|
|
2
|
+
import type { UniBlockProps } from '../../types';
|
|
3
|
+
import { ArrowButton } from '../../ui-kit/Button/ArrowButton';
|
|
4
|
+
import { Heading } from '../../ui-kit/Heading/Heading';
|
|
5
|
+
import { RecommendationCard } from './RecommendationCard';
|
|
6
|
+
import type { RecommendationCardContent, RecommendationContent } from './RecommendationContent';
|
|
7
|
+
|
|
8
|
+
const BLUR_BLOCK_CLASSES = 'absolute top-0 bottom-0 w-[84px]';
|
|
9
|
+
const CARD_FULL_VIEW_COUNT = 2;
|
|
10
|
+
const CARD_SHIFT = 525;
|
|
11
|
+
|
|
12
|
+
export interface RecommendationProps extends RecommendationContent, UniBlockProps {}
|
|
13
|
+
|
|
14
|
+
export const Recommendation = JSX<RecommendationProps>(
|
|
15
|
+
({ context, recommendations = [], className = '', title, version }) => {
|
|
16
|
+
const [activeCardIndex, setActiveCardIndex] = context.useState(0);
|
|
17
|
+
|
|
18
|
+
const blockClassName =
|
|
19
|
+
version === 'secondary' ? 'bg-primary-main text-white' : 'bg-white text-primary-text';
|
|
20
|
+
const cardClassName = version === 'secondary' ? 'border-main-divider' : 'border-main-stroke';
|
|
21
|
+
|
|
22
|
+
return (
|
|
23
|
+
<section
|
|
24
|
+
className={`relative font-sans p-[50px] overflow-hidden ${blockClassName} ${className}`}
|
|
25
|
+
>
|
|
26
|
+
{title ? <Heading headingType="h3" className="mb-8" title={title} /> : null}
|
|
27
|
+
<div
|
|
28
|
+
className="flex duration-1000 gap-4"
|
|
29
|
+
style={{ transform: `translateX(-${activeCardIndex * CARD_SHIFT}px)` }}
|
|
30
|
+
role="list"
|
|
31
|
+
>
|
|
32
|
+
{recommendations?.length
|
|
33
|
+
? recommendations.map(
|
|
34
|
+
renderRecommendationCard({ context, version, className: cardClassName }),
|
|
35
|
+
)
|
|
36
|
+
: null}
|
|
37
|
+
</div>
|
|
38
|
+
{renderNavButtons({
|
|
39
|
+
cardsCount: recommendations.length,
|
|
40
|
+
activeCardIndex,
|
|
41
|
+
setActiveCardIndex,
|
|
42
|
+
})}
|
|
43
|
+
<div
|
|
44
|
+
className={`${BLUR_BLOCK_CLASSES} left-0 ${
|
|
45
|
+
version === 'secondary' ? 'bg-opacity-from-main' : 'bg-opacity-from-white'
|
|
46
|
+
}`}
|
|
47
|
+
/>
|
|
48
|
+
<div
|
|
49
|
+
className={`${BLUR_BLOCK_CLASSES} right-0 ${
|
|
50
|
+
version === 'secondary' ? 'bg-opacity-to-main' : 'bg-opacity-to-white'
|
|
51
|
+
}`}
|
|
52
|
+
/>
|
|
53
|
+
</section>
|
|
54
|
+
);
|
|
55
|
+
},
|
|
56
|
+
);
|
|
57
|
+
|
|
58
|
+
const renderRecommendationCard =
|
|
59
|
+
({ context, version, className }) =>
|
|
60
|
+
(card: RecommendationCardContent, i: number) => {
|
|
61
|
+
return (
|
|
62
|
+
<RecommendationCard
|
|
63
|
+
key={String(i)}
|
|
64
|
+
context={context}
|
|
65
|
+
{...card}
|
|
66
|
+
version={version}
|
|
67
|
+
className={className}
|
|
68
|
+
/>
|
|
69
|
+
);
|
|
70
|
+
};
|
|
71
|
+
|
|
72
|
+
const renderNavButtons = ({
|
|
73
|
+
cardsCount,
|
|
74
|
+
activeCardIndex,
|
|
75
|
+
setActiveCardIndex,
|
|
76
|
+
}: {
|
|
77
|
+
cardsCount: number;
|
|
78
|
+
activeCardIndex: number;
|
|
79
|
+
setActiveCardIndex: (number) => void;
|
|
80
|
+
}) => {
|
|
81
|
+
const handleNextClick = () => setActiveCardIndex(activeCardIndex + 1);
|
|
82
|
+
const handlePrevClick = () => setActiveCardIndex(activeCardIndex - 1);
|
|
83
|
+
const isUseSlider = cardsCount > CARD_FULL_VIEW_COUNT;
|
|
84
|
+
const showNextButton = isUseSlider && cardsCount - activeCardIndex > CARD_FULL_VIEW_COUNT;
|
|
85
|
+
const showPrevButton = isUseSlider && activeCardIndex > 0;
|
|
86
|
+
|
|
87
|
+
return (
|
|
88
|
+
<div>
|
|
89
|
+
{showPrevButton && (
|
|
90
|
+
<ArrowButton
|
|
91
|
+
className="absolute top-1/2 left-8 rotate-180 z-10 mt-6"
|
|
92
|
+
onClick={handlePrevClick}
|
|
93
|
+
ariaLabel="Пролистать влево"
|
|
94
|
+
/>
|
|
95
|
+
)}
|
|
96
|
+
{showNextButton && (
|
|
97
|
+
<ArrowButton
|
|
98
|
+
className="absolute top-1/2 right-8 z-10 mt-6"
|
|
99
|
+
onClick={handleNextClick}
|
|
100
|
+
ariaLabel="Пролистать вправо"
|
|
101
|
+
/>
|
|
102
|
+
)}
|
|
103
|
+
</div>
|
|
104
|
+
);
|
|
105
|
+
};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { JSX } from '@redneckz/uni-jsx';
|
|
2
|
+
import type { BlockVersion } from '../../model/BlockVersion';
|
|
3
|
+
import type { UniBlockProps } from '../../types';
|
|
4
|
+
import { Description } from '../../ui-kit/Description/Description';
|
|
5
|
+
import { Heading } from '../../ui-kit/Heading/Heading';
|
|
6
|
+
import { Img } from '../../ui-kit/Img/Img';
|
|
7
|
+
import { List } from '../../ui-kit/List/List';
|
|
8
|
+
import { BaseTile } from '../BaseTile/BaseTile';
|
|
9
|
+
import type { RecommendationCardContent } from './RecommendationContent';
|
|
10
|
+
|
|
11
|
+
export interface RecommendationCardProps extends RecommendationCardContent, UniBlockProps {
|
|
12
|
+
version?: BlockVersion;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export const RecommendationCard = JSX<RecommendationCardProps>(
|
|
16
|
+
({ context, className = '', title, description, items, image, version }) => {
|
|
17
|
+
return (
|
|
18
|
+
<section
|
|
19
|
+
className={`border border-solid box-border rounded-md p-7 min-w-[515px] max-w-[515px] ${className}`}
|
|
20
|
+
role="listitem"
|
|
21
|
+
>
|
|
22
|
+
<BaseTile
|
|
23
|
+
context={context}
|
|
24
|
+
title={title && <Heading headingType="h4" title={title} className="mb-4" />}
|
|
25
|
+
image={image?.src && <Img className="mt-auto ml-7" image={image} />}
|
|
26
|
+
>
|
|
27
|
+
{description ? <Description description={description} /> : null}
|
|
28
|
+
{items?.length ? <List items={items} version={version} /> : null}
|
|
29
|
+
</BaseTile>
|
|
30
|
+
</section>
|
|
31
|
+
);
|
|
32
|
+
},
|
|
33
|
+
);
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { BlockVersion } from '../../model/BlockVersion';
|
|
2
|
+
import type { DescriptionContent } from '../../ui-kit/Description/DescriptionContent';
|
|
3
|
+
import type { HeadingContent } from '../../ui-kit/Heading/HeadingContent';
|
|
4
|
+
import type { ImageContent } from '../../ui-kit/Img/ImgProps';
|
|
5
|
+
import type { ListContent } from '../../ui-kit/List/ListContent';
|
|
6
|
+
|
|
7
|
+
export type RecommendationCardContent = HeadingContent &
|
|
8
|
+
DescriptionContent &
|
|
9
|
+
ListContent &
|
|
10
|
+
ImageContent;
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* @title Рекомендации
|
|
14
|
+
*/
|
|
15
|
+
export interface RecommendationContent extends HeadingContent {
|
|
16
|
+
/** @title Карточки */
|
|
17
|
+
recommendations?: RecommendationCardContent[];
|
|
18
|
+
version?: BlockVersion;
|
|
19
|
+
}
|