@redneckz/wildless-cms-uni-blocks 0.3.5 → 0.3.8
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/bundle.umd.js +54 -32
- package/bundle/bundle.umd.min.js +1 -1
- package/dist/components/BaseTile/BaseTile.js +1 -1
- package/dist/components/BaseTile/BaseTile.js.map +1 -1
- package/dist/components/Blocks.d.ts +0 -1
- package/dist/components/Blocks.js +0 -2
- package/dist/components/Blocks.js.map +1 -1
- package/dist/components/Blocks.mobile.d.ts +1 -1
- package/dist/components/Blocks.mobile.js +2 -2
- package/dist/components/Blocks.mobile.js.map +1 -1
- package/dist/components/ContentPage/ContentPageHead.js +13 -4
- package/dist/components/ContentPage/ContentPageHead.js.map +1 -1
- package/dist/components/ExchangeRateTile/ExchangeRateTile.js +1 -1
- package/dist/components/ExchangeRateTile/ExchangeRateTile.js.map +1 -1
- package/dist/components/Gallery/GalleryCardInner.js +15 -5
- package/dist/components/Gallery/GalleryCardInner.js.map +1 -1
- package/dist/components/Header/Header.mobile.js +1 -1
- package/dist/components/Header/Header.mobile.js.map +1 -1
- package/dist/components/Header/HeaderBurger.js +1 -1
- package/dist/components/Header/HeaderBurger.js.map +1 -1
- package/dist/components/Header/HeaderTop.js +1 -1
- package/dist/components/Header/HeaderTop.js.map +1 -1
- package/dist/components/LinkDocs/LinkDocsListItem.js +1 -1
- package/dist/components/LinkDocs/LinkDocsListItem.js.map +1 -1
- package/dist/components/LinkDocs/LinkDocsListItem.mobile.js +1 -1
- package/dist/components/LinkDocs/LinkDocsListItem.mobile.js.map +1 -1
- package/dist/components/ProductBlock/ProductBlockInner.js +1 -1
- package/dist/components/ProductBlock/ProductBlockInner.js.map +1 -1
- package/dist/components/ProductBlock/ProductBlockInner.mobile.js +4 -1
- package/dist/components/ProductBlock/ProductBlockInner.mobile.js.map +1 -1
- package/dist/components/ProductBlock/renderBenefit.mobile.js +1 -1
- package/dist/components/ProductBlock/renderBenefit.mobile.js.map +1 -1
- package/dist/components/ProductGallery/ProductGallery.mobile.js +3 -14
- package/dist/components/ProductGallery/ProductGallery.mobile.js.map +1 -1
- package/dist/components/ProductGallery/ProductGalleryBlock.mobile.js +1 -1
- package/dist/components/StepsBlock/StepsBlock.mobile.js +2 -2
- package/dist/components/StepsBlock/StepsBlock.mobile.js.map +1 -1
- package/dist/components/Tile/Tile.js +5 -1
- package/dist/components/Tile/Tile.js.map +1 -1
- package/dist/types.d.ts +10 -5
- package/dist/ui-kit/BlockItem/BlockItem.js +3 -3
- package/dist/ui-kit/BlockItem/BlockItem.js.map +1 -1
- package/dist/ui-kit/Description/Description.js +1 -1
- package/dist/ui-kit/Heading/Heading.js +1 -1
- package/dist/ui-kit/Heading/Heading.js.map +1 -1
- package/dist/ui-kit/Heading/Heading.mobile.js +1 -1
- package/dist/ui-kit/Heading/Heading.mobile.js.map +1 -1
- package/dist/ui-kit/List/ListItem.js +2 -2
- package/dist/ui-kit/List/ListItem.js.map +1 -1
- package/dist/ui-kit/SwipeListControl/SwipeListControlDots.js +1 -1
- package/dist/ui-kit/SwipeListControl/SwipeListControlDots.js.map +1 -1
- package/dist/ui-kit/SwipeListControl/SwipeListControlItem.js +1 -1
- package/dist/ui-kit/SwipeListControl/SwipeListControlItem.js.map +1 -1
- package/lib/common.css +1 -1
- package/lib/components/BaseTile/BaseTile.js +1 -1
- package/lib/components/BaseTile/BaseTile.js.map +1 -1
- package/lib/components/Blocks.d.ts +0 -1
- package/lib/components/Blocks.js +0 -2
- package/lib/components/Blocks.js.map +1 -1
- package/lib/components/Blocks.mobile.d.ts +1 -1
- package/lib/components/Blocks.mobile.js +2 -2
- package/lib/components/Blocks.mobile.js.map +1 -1
- package/lib/components/ContentPage/ContentPageHead.js +13 -4
- package/lib/components/ContentPage/ContentPageHead.js.map +1 -1
- package/lib/components/ExchangeRateTile/ExchangeRateTile.js +1 -1
- package/lib/components/ExchangeRateTile/ExchangeRateTile.js.map +1 -1
- package/lib/components/Gallery/GalleryCardInner.js +15 -5
- package/lib/components/Gallery/GalleryCardInner.js.map +1 -1
- package/lib/components/Header/Header.mobile.js +1 -1
- package/lib/components/Header/Header.mobile.js.map +1 -1
- package/lib/components/Header/HeaderBurger.js +1 -1
- package/lib/components/Header/HeaderBurger.js.map +1 -1
- package/lib/components/Header/HeaderTop.js +1 -1
- package/lib/components/Header/HeaderTop.js.map +1 -1
- package/lib/components/LinkDocs/LinkDocsListItem.js +1 -1
- package/lib/components/LinkDocs/LinkDocsListItem.js.map +1 -1
- package/lib/components/LinkDocs/LinkDocsListItem.mobile.js +1 -1
- package/lib/components/LinkDocs/LinkDocsListItem.mobile.js.map +1 -1
- package/lib/components/ProductBlock/ProductBlockInner.js +1 -1
- package/lib/components/ProductBlock/ProductBlockInner.js.map +1 -1
- package/lib/components/ProductBlock/ProductBlockInner.mobile.js +4 -1
- package/lib/components/ProductBlock/ProductBlockInner.mobile.js.map +1 -1
- package/lib/components/ProductBlock/renderBenefit.mobile.js +1 -1
- package/lib/components/ProductBlock/renderBenefit.mobile.js.map +1 -1
- package/lib/components/ProductGallery/ProductGallery.fixture.mobile.d.ts +1 -0
- package/lib/components/ProductGallery/ProductGallery.mobile.js +4 -15
- package/lib/components/ProductGallery/ProductGallery.mobile.js.map +1 -1
- package/lib/components/ProductGallery/ProductGalleryBlock.mobile.js +1 -1
- package/lib/components/StepsBlock/StepsBlock.mobile.js +2 -2
- package/lib/components/StepsBlock/StepsBlock.mobile.js.map +1 -1
- package/lib/components/Tile/Tile.js +5 -1
- package/lib/components/Tile/Tile.js.map +1 -1
- package/lib/types.d.ts +10 -5
- package/lib/ui-kit/BlockItem/BlockItem.js +3 -3
- package/lib/ui-kit/BlockItem/BlockItem.js.map +1 -1
- package/lib/ui-kit/Description/Description.js +1 -1
- package/lib/ui-kit/Heading/Heading.js +1 -1
- package/lib/ui-kit/Heading/Heading.js.map +1 -1
- package/lib/ui-kit/Heading/Heading.mobile.js +1 -1
- package/lib/ui-kit/Heading/Heading.mobile.js.map +1 -1
- package/lib/ui-kit/List/ListItem.js +2 -2
- package/lib/ui-kit/List/ListItem.js.map +1 -1
- package/lib/ui-kit/SwipeListControl/SwipeListControlDots.js +1 -1
- package/lib/ui-kit/SwipeListControl/SwipeListControlDots.js.map +1 -1
- package/lib/ui-kit/SwipeListControl/SwipeListControlItem.js +1 -1
- package/lib/ui-kit/SwipeListControl/SwipeListControlItem.js.map +1 -1
- package/mobile/bundle/bundle.umd.js +73 -59
- package/mobile/bundle/bundle.umd.min.js +1 -1
- package/mobile/dist/components/BaseTile/BaseTile.js +1 -1
- package/mobile/dist/components/BaseTile/BaseTile.js.map +1 -1
- package/mobile/dist/components/Blocks.d.ts +1 -1
- package/mobile/dist/components/Blocks.js +2 -2
- package/mobile/dist/components/Blocks.js.map +1 -1
- package/mobile/dist/components/ContentPage/ContentPageHead.js +13 -4
- package/mobile/dist/components/ContentPage/ContentPageHead.js.map +1 -1
- package/mobile/dist/components/ExchangeRateTile/ExchangeRateTile.js +1 -1
- package/mobile/dist/components/ExchangeRateTile/ExchangeRateTile.js.map +1 -1
- package/mobile/dist/components/Gallery/GalleryCardInner.js +15 -5
- package/mobile/dist/components/Gallery/GalleryCardInner.js.map +1 -1
- package/mobile/dist/components/Header/Header.js +1 -1
- package/mobile/dist/components/Header/Header.js.map +1 -1
- package/mobile/dist/components/Header/HeaderBurger.js +1 -1
- package/mobile/dist/components/Header/HeaderBurger.js.map +1 -1
- package/mobile/dist/components/Header/HeaderTop.js +1 -1
- package/mobile/dist/components/Header/HeaderTop.js.map +1 -1
- package/mobile/dist/components/LinkDocs/LinkDocsListItem.js +1 -1
- package/mobile/dist/components/LinkDocs/LinkDocsListItem.js.map +1 -1
- package/mobile/dist/components/ProductBlock/ProductBlockInner.js +4 -1
- package/mobile/dist/components/ProductBlock/ProductBlockInner.js.map +1 -1
- package/mobile/dist/components/ProductBlock/renderBenefit.js +1 -1
- package/mobile/dist/components/ProductBlock/renderBenefit.js.map +1 -1
- package/mobile/dist/components/ProductGallery/ProductGallery.js +3 -14
- package/mobile/dist/components/ProductGallery/ProductGallery.js.map +1 -1
- package/mobile/dist/components/ProductGallery/ProductGalleryBlock.js +1 -1
- package/mobile/dist/components/StepsBlock/StepsBlock.js +2 -2
- package/mobile/dist/components/StepsBlock/StepsBlock.js.map +1 -1
- package/mobile/dist/components/Tile/Tile.js +5 -1
- package/mobile/dist/components/Tile/Tile.js.map +1 -1
- package/mobile/dist/types.d.ts +10 -5
- package/mobile/dist/ui-kit/BlockItem/BlockItem.js +3 -3
- package/mobile/dist/ui-kit/BlockItem/BlockItem.js.map +1 -1
- package/mobile/dist/ui-kit/Description/Description.js +1 -1
- package/mobile/dist/ui-kit/Heading/Heading.js +1 -1
- package/mobile/dist/ui-kit/Heading/Heading.js.map +1 -1
- package/mobile/dist/ui-kit/List/ListItem.js +2 -2
- package/mobile/dist/ui-kit/List/ListItem.js.map +1 -1
- package/mobile/dist/ui-kit/SwipeListControl/SwipeListControlDots.js +1 -1
- package/mobile/dist/ui-kit/SwipeListControl/SwipeListControlDots.js.map +1 -1
- package/mobile/dist/ui-kit/SwipeListControl/SwipeListControlItem.js +1 -1
- package/mobile/dist/ui-kit/SwipeListControl/SwipeListControlItem.js.map +1 -1
- package/mobile/lib/components/BaseTile/BaseTile.js +1 -1
- package/mobile/lib/components/BaseTile/BaseTile.js.map +1 -1
- package/mobile/lib/components/Blocks.d.ts +1 -1
- package/mobile/lib/components/Blocks.js +2 -2
- package/mobile/lib/components/Blocks.js.map +1 -1
- package/mobile/lib/components/ContentPage/ContentPageHead.js +13 -4
- package/mobile/lib/components/ContentPage/ContentPageHead.js.map +1 -1
- package/mobile/lib/components/ExchangeRateTile/ExchangeRateTile.js +1 -1
- package/mobile/lib/components/ExchangeRateTile/ExchangeRateTile.js.map +1 -1
- package/mobile/lib/components/Gallery/GalleryCardInner.js +15 -5
- package/mobile/lib/components/Gallery/GalleryCardInner.js.map +1 -1
- package/mobile/lib/components/Header/Header.js +1 -1
- package/mobile/lib/components/Header/Header.js.map +1 -1
- package/mobile/lib/components/Header/HeaderBurger.js +1 -1
- package/mobile/lib/components/Header/HeaderBurger.js.map +1 -1
- package/mobile/lib/components/Header/HeaderTop.js +1 -1
- package/mobile/lib/components/Header/HeaderTop.js.map +1 -1
- package/mobile/lib/components/LinkDocs/LinkDocsListItem.js +1 -1
- package/mobile/lib/components/LinkDocs/LinkDocsListItem.js.map +1 -1
- package/mobile/lib/components/ProductBlock/ProductBlockInner.js +4 -1
- package/mobile/lib/components/ProductBlock/ProductBlockInner.js.map +1 -1
- package/mobile/lib/components/ProductBlock/renderBenefit.js +1 -1
- package/mobile/lib/components/ProductBlock/renderBenefit.js.map +1 -1
- package/mobile/lib/components/ProductGallery/ProductGallery.js +4 -15
- package/mobile/lib/components/ProductGallery/ProductGallery.js.map +1 -1
- package/mobile/lib/components/ProductGallery/ProductGalleryBlock.js +1 -1
- package/mobile/lib/components/StepsBlock/StepsBlock.js +2 -2
- package/mobile/lib/components/StepsBlock/StepsBlock.js.map +1 -1
- package/mobile/lib/components/Tile/Tile.js +5 -1
- package/mobile/lib/components/Tile/Tile.js.map +1 -1
- package/mobile/lib/types.d.ts +10 -5
- package/mobile/lib/ui-kit/BlockItem/BlockItem.js +3 -3
- package/mobile/lib/ui-kit/BlockItem/BlockItem.js.map +1 -1
- package/mobile/lib/ui-kit/Description/Description.js +1 -1
- package/mobile/lib/ui-kit/Heading/Heading.js +1 -1
- package/mobile/lib/ui-kit/Heading/Heading.js.map +1 -1
- package/mobile/lib/ui-kit/List/ListItem.js +2 -2
- package/mobile/lib/ui-kit/List/ListItem.js.map +1 -1
- package/mobile/lib/ui-kit/SwipeListControl/SwipeListControlDots.js +1 -1
- package/mobile/lib/ui-kit/SwipeListControl/SwipeListControlDots.js.map +1 -1
- package/mobile/lib/ui-kit/SwipeListControl/SwipeListControlItem.js +1 -1
- package/mobile/lib/ui-kit/SwipeListControl/SwipeListControlItem.js.map +1 -1
- package/mobile/src/components/BaseTile/BaseTile.tsx +2 -2
- package/mobile/src/components/Blocks.ts +2 -2
- package/mobile/src/components/ContentPage/ContentPage.page.json +17 -4
- package/mobile/src/components/ContentPage/ContentPageHead.tsx +22 -6
- package/mobile/src/components/ExchangeRateTile/ExchangeRateTile.tsx +1 -1
- package/mobile/src/components/Gallery/GalleryCardInner.tsx +23 -15
- package/mobile/src/components/Header/Header.tsx +1 -1
- package/mobile/src/components/Header/HeaderBurger.tsx +2 -2
- package/mobile/src/components/Header/HeaderTop.tsx +6 -2
- package/mobile/src/components/LinkDocs/LinkDocsListItem.tsx +1 -1
- package/mobile/src/components/ProductBlock/ProductBlock.example.json +2 -1
- package/mobile/src/components/ProductBlock/ProductBlockInner.tsx +17 -11
- package/mobile/src/components/ProductBlock/renderBenefit.tsx +2 -2
- package/mobile/src/components/ProductGallery/ProductGallery.tsx +12 -49
- package/mobile/src/components/ProductGallery/ProductGalleryBlock.tsx +1 -1
- package/mobile/src/components/StepsBlock/StepsBlock.tsx +2 -2
- package/mobile/src/components/Tile/Tile.tsx +7 -4
- package/mobile/src/types.ts +10 -5
- package/mobile/src/ui-kit/BlockItem/BlockItem.tsx +4 -4
- package/mobile/src/ui-kit/Description/Description.tsx +1 -1
- package/mobile/src/ui-kit/Heading/Heading.tsx +1 -1
- package/mobile/src/ui-kit/List/ListItem.tsx +3 -3
- package/mobile/src/ui-kit/SwipeListControl/SwipeListControlDots.tsx +1 -1
- package/mobile/src/ui-kit/SwipeListControl/SwipeListControlItem.tsx +5 -1
- package/package.json +1 -1
- package/src/components/BaseTile/BaseTile.tsx +2 -2
- package/src/components/Blocks.mobile.ts +2 -2
- package/src/components/Blocks.ts +0 -2
- package/src/components/ComparisonTable/ComparisonTable.fixture.tsx +0 -1
- package/src/components/ContentPage/ContentPage.page.json +17 -4
- package/src/components/ContentPage/ContentPageHead.tsx +22 -6
- package/src/components/ExchangeRateTile/ExchangeRateTile.tsx +1 -1
- package/src/components/Gallery/Gallery.fixture.mobile.tsx +1 -1
- package/src/components/Gallery/GalleryCardInner.tsx +23 -15
- package/src/components/Header/Header.mobile.tsx +1 -1
- package/src/components/Header/HeaderBurger.tsx +2 -2
- package/src/components/Header/HeaderTop.tsx +6 -2
- package/src/components/LinkDocs/LinkDocsListItem.mobile.tsx +1 -1
- package/src/components/LinkDocs/LinkDocsListItem.tsx +1 -1
- package/src/components/ProductBlock/ProductBlock.example.json +2 -1
- package/src/components/ProductBlock/ProductBlock.fixture.mobile.tsx +2 -2
- package/src/components/ProductBlock/ProductBlockInner.mobile.tsx +17 -11
- package/src/components/ProductBlock/ProductBlockInner.tsx +2 -2
- package/src/components/ProductBlock/renderBenefit.mobile.tsx +2 -2
- package/src/components/ProductGallery/ProductGallery.fixture.mobile.tsx +98 -0
- package/src/components/ProductGallery/ProductGallery.fixture.tsx +2 -2
- package/src/components/ProductGallery/ProductGallery.mobile.tsx +12 -49
- package/src/components/ProductGallery/ProductGalleryBlock.mobile.tsx +1 -1
- package/src/components/StepsBlock/StepsBlock.mobile.tsx +2 -2
- package/src/components/Tile/Tile.tsx +7 -4
- package/src/types.ts +10 -5
- package/src/ui-kit/BlockItem/BlockItem.tsx +4 -4
- package/src/ui-kit/Description/Description.tsx +1 -1
- package/src/ui-kit/Heading/Heading.fixture.mobile.tsx +0 -1
- package/src/ui-kit/Heading/Heading.mobile.tsx +1 -1
- package/src/ui-kit/Heading/Heading.tsx +3 -1
- package/src/ui-kit/List/ListItem.tsx +3 -3
- package/src/ui-kit/SwipeListControl/SwipeListControlDots.tsx +1 -1
- package/src/ui-kit/SwipeListControl/SwipeListControlItem.tsx +5 -1
|
@@ -200,7 +200,7 @@
|
|
|
200
200
|
return;
|
|
201
201
|
}
|
|
202
202
|
const Tag = headingType;
|
|
203
|
-
return (jsx(Tag, { className: `font-sans font-medium ${HeadingClass[headingType]} ${className || ''}`, children: title }));
|
|
203
|
+
return (jsx(Tag, { className: `font-sans font-medium m-0 ${HeadingClass[headingType]} ${className || ''}`, children: title }));
|
|
204
204
|
});
|
|
205
205
|
|
|
206
206
|
const projectSettings = new (class {
|
|
@@ -306,7 +306,7 @@
|
|
|
306
306
|
};
|
|
307
307
|
|
|
308
308
|
const SwipeListControlItem = JSX(({ className = '', children, ...rest }) => {
|
|
309
|
-
return (jsx("div", { className: `snap-center snap-always min-w-full ${className}`, role: "listitem", ...rest, children: children }));
|
|
309
|
+
return (jsx("div", { className: `snap-center snap-always min-w-full box-border ${className}`, role: "listitem", ...rest, children: children }));
|
|
310
310
|
});
|
|
311
311
|
|
|
312
312
|
// styles used to compensate outer container padding to get rid of clipping effect
|
|
@@ -339,7 +339,7 @@
|
|
|
339
339
|
const BASE_DOT_OPACITY = 0.3;
|
|
340
340
|
const ACTIVE_DOT_OPACITY_CHANGE = 0.7;
|
|
341
341
|
const SwipeListControlDots = JSX(({ children, activeIndex, indexFraction, showDots }) => {
|
|
342
|
-
return showDots && children?.length ? (jsx("div", { className: "flex gap-2 mx-auto mt-
|
|
342
|
+
return showDots && children?.length ? (jsx("div", { className: "flex gap-2 mx-auto mt-5 w-fit", children: children?.map((_, idx) => (jsx("div", { className: `${DOT_STYLES}`, style: getDotStyles(idx, activeIndex, indexFraction), "aria-hidden": true }, String(idx)))) })) : null;
|
|
343
343
|
});
|
|
344
344
|
const getDotStyles = (currentIdx, activeIndex, indexFraction) => {
|
|
345
345
|
if (currentIdx < activeIndex || currentIdx > activeIndex + 1)
|
|
@@ -397,7 +397,7 @@
|
|
|
397
397
|
return index !== -1 ? href.substring(index + 1) : '';
|
|
398
398
|
};
|
|
399
399
|
|
|
400
|
-
const LinkDocsListItem = JSX(({ className = '', doc, icon }) => (jsx(LinkDocsListItemBase, { className: `flex h-full ${className}`, iconClassName: "mr-3 min-w-6 min-h-6", doc: doc, icon: icon })));
|
|
400
|
+
const LinkDocsListItem = JSX(({ className = '', doc, icon }) => (jsx(LinkDocsListItemBase, { className: `flex h-full box-border ${className}`, iconClassName: "mr-3 min-w-6 min-h-6", doc: doc, icon: icon })));
|
|
401
401
|
|
|
402
402
|
const LinkDocsHorizontalList = JSX(({ context, hasBorder = true, documents, icon }) => {
|
|
403
403
|
return (jsx(SwipeListControl, { context: context, className: "text-m-sm text-primary-main", children: documents?.length
|
|
@@ -422,7 +422,7 @@
|
|
|
422
422
|
return (jsxs("div", { className: "flex flex-row mb-8", children: [benefit.icon && (jsx(Icon, { className: "w-[48px] h-[48px] bg-main rounded-full box-border p-[12px]", name: benefit.icon, width: "48", height: "48", asSVG: true })), jsxs("div", { className: "flex gap-1 flex-col h-full ml-5 max-w-[490px]", children: [benefit.label && (jsx("div", { className: "font-medium text-primary-text text-xl m-0", children: benefit.label })), benefit.description && (jsx("div", { className: "font-normal text-sm text-secondary-text", children: benefit.description }))] })] }, String(i)));
|
|
423
423
|
}
|
|
424
424
|
|
|
425
|
-
const LIST_STYLE_CLASSES$1 = 'rounded-full inline-block mr-3';
|
|
425
|
+
const LIST_STYLE_CLASSES$1 = 'rounded-full inline-block mr-3 mt-2';
|
|
426
426
|
const TEXT_STYLE_MAP$1 = {
|
|
427
427
|
primary: 'text-primary-text',
|
|
428
428
|
secondary: 'text-white',
|
|
@@ -434,7 +434,7 @@
|
|
|
434
434
|
gray: 'bg-secondary-text',
|
|
435
435
|
};
|
|
436
436
|
const ListItem = JSX(({ className = '', isDotted = true, children, version = 'primary' }) => {
|
|
437
|
-
return (jsxs("div", { className: `font-sans flex items-
|
|
437
|
+
return (jsxs("div", { className: `font-sans flex items-start ${className}`, role: "listitem", children: [isDotted && jsx("div", { className: getListStyle$1(version) }), jsx("span", { className: `text-m-md ${TEXT_STYLE_MAP$1[version]}`, children: children })] }));
|
|
438
438
|
});
|
|
439
439
|
const getListStyle$1 = (version) => {
|
|
440
440
|
const size = version === 'gray' ? 'w-[6px] h-[6px] min-w-[6px] min-h-[6px]' : 'w-2 h-2 min-w-2 min-h-2';
|
|
@@ -470,12 +470,12 @@
|
|
|
470
470
|
};
|
|
471
471
|
const TextBlock = JSX(({ title, description, blockVersion = 'primary', iconVersion, image, className = '', items, isDotted = true, }) => {
|
|
472
472
|
const textBlockStyleMap = textBlockStyleMaps[blockVersion];
|
|
473
|
-
return (jsxs("section", { className: `font-sans px-4 py-[18px] flex flex-col ${textBlockStyleMap.background} ${className}`, children: [iconVersion === 'small' ? renderIcon(textBlockStyleMap.icon) : null, iconVersion === 'big' ? renderImage(image) : null, jsxs("div", { className: "py-0.5", children: [title ? (jsx("div", { className: `font-medium text-base mb-1 ${textBlockStyleMap.title}`, children: title })) : null, description ? (jsx("div", { className: `text-sm ${textBlockStyleMap.description}`, children: description })) : null, items?.length ? (jsx(List, { items: items, isDotted: isDotted, version: "gray", className: "mt-1 text-m-sm text-secondary-text" })) : null] })] }));
|
|
473
|
+
return (jsxs("section", { className: `font-sans px-4 py-[18px] flex flex-col ${textBlockStyleMap.background} ${className}`, children: [iconVersion === 'small' ? renderIcon(textBlockStyleMap.icon) : null, iconVersion === 'big' ? renderImage$1(image) : null, jsxs("div", { className: "py-0.5", children: [title ? (jsx("div", { className: `font-medium text-base mb-1 ${textBlockStyleMap.title}`, children: title })) : null, description ? (jsx("div", { className: `text-sm ${textBlockStyleMap.description}`, children: description })) : null, items?.length ? (jsx(List, { items: items, isDotted: isDotted, version: "gray", className: "mt-1 text-m-sm text-secondary-text" })) : null] })] }));
|
|
474
474
|
});
|
|
475
475
|
function renderIcon(className) {
|
|
476
476
|
return (jsx("div", { className: "mb-3", children: jsx("div", { className: `rounded-full h-4 w-4 text-center text-xs ${className}`, children: "i" }) }));
|
|
477
477
|
}
|
|
478
|
-
function renderImage(image) {
|
|
478
|
+
function renderImage$1(image) {
|
|
479
479
|
return image?.src ? jsx(Img, { className: "pb-3 mr-auto", image: image }) : null;
|
|
480
480
|
}
|
|
481
481
|
|
|
@@ -580,11 +580,11 @@
|
|
|
580
580
|
|
|
581
581
|
const Description = JSX((props) => {
|
|
582
582
|
const { className, description } = props;
|
|
583
|
-
return jsx("div", { className: `font-normal text-
|
|
583
|
+
return jsx("div", { className: `font-normal text-m-md ${className || ''}`, children: description });
|
|
584
584
|
});
|
|
585
585
|
|
|
586
586
|
const BaseTile = JSX(({ className = '', title, children, buttons, image }) => {
|
|
587
|
-
return (jsxs("div", { className: `font-sans flex flex-col grow h-full items-start ${className}`, children: [title, jsxs("div", { className:
|
|
587
|
+
return (jsxs("div", { className: `font-sans flex flex-col grow h-full items-start ${className}`, children: [title, jsxs("div", { className: "flex grow w-full justify-between", children: [jsxs("div", { className: "flex flex-col justify-between w-full", children: [jsx("div", { children: children }), jsx("div", { children: buttons })] }), image] })] }));
|
|
588
588
|
});
|
|
589
589
|
|
|
590
590
|
const getColSpan = (className) => {
|
|
@@ -638,8 +638,12 @@
|
|
|
638
638
|
};
|
|
639
639
|
const Tile = JSX((props) => {
|
|
640
640
|
const { context, title, description, items, children, buttons, image, className = '', version = 'primary', role, } = props;
|
|
641
|
-
return (jsx("section", { className: `font-sans p-9 box-border ${className} ${tileStyleMap[version]} ${getTileRightPadding(className)} ${getTileMinHeight(className)} `, role: role, children: jsxs(BaseTile, { context: context, title: title && (jsx(Heading, { headingType: getTileHeadingType(className), title: title, className: `whitespace-pre-wrap max-w-[600px] ${
|
|
641
|
+
return (jsx("section", { className: `font-sans p-9 box-border ${className} ${tileStyleMap[version]} ${getTileRightPadding(className)} ${getTileMinHeight(className)} `, role: role, children: jsxs(BaseTile, { context: context, title: title && (jsx(Heading, { headingType: getTileHeadingType(className), title: title, className: `whitespace-pre-wrap max-w-[600px] ${title ? 'mb-3' : ''}
|
|
642
|
+
${version === 'primary' ? 'text-primary-text' : ''}` })), buttons: buttons?.length ? (jsx(ButtonSection, { context: context, buttons: buttons, className: "flex mt-9 gap-3" })) : null, image: image?.src && jsx(Img, { className: "mt-auto ml-7", image: image }), children: [description && jsx(Description, { className: "mt-4 max-w-[600px]", description: description }), children, renderList(items, version)] }) }));
|
|
642
643
|
});
|
|
644
|
+
function renderList(items, version) {
|
|
645
|
+
return items?.length ? jsx(List, { items: items, version: version }) : null;
|
|
646
|
+
}
|
|
643
647
|
|
|
644
648
|
const productTileStyleMap = {
|
|
645
649
|
primary: 'bg-white text-primary-text',
|
|
@@ -671,12 +675,12 @@
|
|
|
671
675
|
}
|
|
672
676
|
function renderCard$1(card, key) {
|
|
673
677
|
return (jsxs("div", { className: `box-border horizontal-list-item border-solid border rounded-md border-main-stroke p-4 flex flex-col
|
|
674
|
-
${blockStyle[card.version ?? 'primary']}`, role: "listitem", children: [jsxs("div", { children: [card.image?.src ? (jsx("div", { className: "flex justify-center", children: jsx(Img, { className: "mb-6", image: card.image }) })) : null, card.title ? jsx("h4", { className: `font-medium text-m-title-xs m-0`, children: card.title }) : null, card.description ? renderDescription(card) : null, card.items?.length ? renderItems(card.items) : null] }), card?.button?.href ? jsx(Button, { className: "mt-3", ...card.button }) : null] }, key));
|
|
678
|
+
${blockStyle[card.version ?? 'primary']}`, role: "listitem", children: [jsxs("div", { children: [card.image?.src ? (jsx("div", { className: "flex justify-center", children: jsx(Img, { className: "mb-6", image: card.image }) })) : null, card.title ? jsx("h4", { className: `font-medium text-m-title-xs m-0`, children: card.title }) : null, card.description ? renderDescription(card) : null, card.items?.length ? renderItems$1(card.items) : null] }), card?.button?.href ? jsx(Button, { className: "mt-3", ...card.button }) : null] }, key));
|
|
675
679
|
}
|
|
676
680
|
function renderDescription(card) {
|
|
677
681
|
return (jsx("div", { className: `text-secondary-text mt-2 ${card.version === 'secondary' ? 'text-white opacity-80' : ''}`, children: card.description }));
|
|
678
682
|
}
|
|
679
|
-
function renderItems(items) {
|
|
683
|
+
function renderItems$1(items) {
|
|
680
684
|
return (jsx("section", { className: "mt-3", children: items.map((item) => (jsxs("div", { children: [jsx("span", { className: "text-m-md font-medium", children: item.title }), jsx("span", { className: "text-m-sm text-secondary-text pl-2", children: item.text })] }))) }));
|
|
681
685
|
}
|
|
682
686
|
|
|
@@ -717,9 +721,9 @@
|
|
|
717
721
|
mini: 276,
|
|
718
722
|
};
|
|
719
723
|
|
|
720
|
-
const LIST_STYLE_CLASSES = 'rounded-full inline-block mr-3';
|
|
724
|
+
const LIST_STYLE_CLASSES = 'rounded-full inline-block mr-3 mt-2';
|
|
721
725
|
const TEXT_STYLE_MAP = {
|
|
722
|
-
primary: 'text-
|
|
726
|
+
primary: 'text-secondary-text',
|
|
723
727
|
secondary: 'text-white',
|
|
724
728
|
gray: 'text-secondary-text',
|
|
725
729
|
};
|
|
@@ -729,7 +733,7 @@
|
|
|
729
733
|
gray: 'bg-secondary-text',
|
|
730
734
|
};
|
|
731
735
|
const BlockItem = JSX(({ className = '', isDotted = true, text, children, version = 'primary' }) => {
|
|
732
|
-
return (jsxs("div", { className: `font-sans flex items-
|
|
736
|
+
return (jsxs("div", { className: `font-sans flex items-start ${className}`, role: "listitem", children: [isDotted && jsx("div", { className: getListStyle(version) }), "!!!!!", jsx("span", { className: TEXT_STYLE_MAP[version], children: text || children })] }));
|
|
733
737
|
});
|
|
734
738
|
const getListStyle = (version) => {
|
|
735
739
|
const size = version === 'gray' ? 'w-[6px] h-[6px] min-w-[6px] min-h-[6px]' : 'w-2 h-2 min-w-2 min-h-2';
|
|
@@ -737,16 +741,26 @@
|
|
|
737
741
|
};
|
|
738
742
|
|
|
739
743
|
const GalleryCardInner = JSX(({ title, description, image, items, button, version }) => {
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
.map((item, i) => renderItem(item.text, i, version)) })) : null] }), button?.text && jsx(Button, { className: "mt-6", ...button })] }));
|
|
744
|
+
const titleStyleClasses = getTitleStyle(version, description, items);
|
|
745
|
+
return (jsxs("div", { children: [jsxs("div", { children: [image?.src ? (jsx("div", { className: "flex justify-center", children: jsx(Img, { className: "mb-6", image: image }) })) : null, title ? renderCardTitle(title, titleStyleClasses) : null, description ? (jsx("div", { className: `font-normal text-sm ${title ? 'mt-2' : ''}`, children: description })) : null, items?.length ? renderItems(items, version) : null] }), button?.text && jsx(Button, { className: "mt-6", ...button })] }));
|
|
743
746
|
});
|
|
744
|
-
function renderCardTitle(title,
|
|
745
|
-
return
|
|
747
|
+
function renderCardTitle(title, className) {
|
|
748
|
+
return jsx("div", { className: `font-medium text-xl m-0 ${className}`, children: title });
|
|
749
|
+
}
|
|
750
|
+
function renderItems(items, version) {
|
|
751
|
+
return (jsx("section", { className: `max-w-[308px] mt-2`, role: "list", children: items
|
|
752
|
+
.filter((item) => item?.text)
|
|
753
|
+
.map((item, i) => renderItem(item.text, i, version)) }));
|
|
746
754
|
}
|
|
747
755
|
function renderItem(item, i, version) {
|
|
748
756
|
return (jsx(BlockItem, { version: version ?? 'primary', children: jsx("span", { className: "text-sm", children: item }) }, String(i)));
|
|
749
757
|
}
|
|
758
|
+
function getTitleStyle(version, description, items) {
|
|
759
|
+
return `font-medium text-xl m-0
|
|
760
|
+
${version !== 'secondary' ? 'text-primary-text' : ''}
|
|
761
|
+
${!description && !items?.length ? 'text-center' : ''}
|
|
762
|
+
`;
|
|
763
|
+
}
|
|
750
764
|
|
|
751
765
|
const GalleryContainer = JSX(({ context, title, description, cards = [], version = 'normal', activeCardIndex }) => {
|
|
752
766
|
return (jsxs("div", { children: [jsx("div", { className: "absolute top-0 left-0 bottom-0 w-[84px] bg-gradient-to-r from-white to-transparent" }), jsxs("div", { className: "flex flex-col items-center mb-8", children: [title ? jsx(Heading, { headingType: "h2", className: "text-center", title: title }) : null, description ? (jsx("div", { className: "font-normal text-base max-w-[600px] mt-2.5", children: description })) : null] }), jsx("div", { className: `flex ${cards?.length <= galleryLengthForScrollMap[version] ? 'justify-center' : ''} duration-1000`, style: { transform: `translateX(-${activeCardIndex * cardWidthMap[version]}px)` }, role: "list", children: cards?.map((card, i) => renderCard({ card, version, context }, i)) })] }));
|
|
@@ -838,7 +852,7 @@
|
|
|
838
852
|
];
|
|
839
853
|
const ExchangeRateTile = JSX(({ className = '', context, title = 'Курсы обмена валют' }) => {
|
|
840
854
|
const { data } = context.useAsyncData(CBR_EXCHANGE_RATE_URL, fetchExchangeRate);
|
|
841
|
-
return (jsx("section", { className: `bg-white text-primary-text font-sans p-9 box-border ${className} ${getTileRightPadding(className)} ${getTileMinHeight(className)} `, children: jsx(BaseTile, { context: context, title: title && (jsx(Heading, { headingType: getTileHeadingType(className), title: title, className: `whitespace-pre-wrap max-w-[600px]` })), buttons: buttons?.length ? (jsx(ButtonSection, { context: context, buttons: buttons, className: "flex mt-9 gap-3" })) : null, children: jsxs("table", { children: [jsx("thead", { children: jsxs("tr", { children: [jsx(CurrencyTH, { children: "\u0412\u0430\u043B\u044E\u0442\u0430" }), jsx(CurrencyTH, { className: "pl-11", children: "\u041A\u0443\u0440\u0441" })] }) }), jsx("tbody", { children: CURRENCY_CODES.map(renderCurrencyRow(data)) })] }) }) }));
|
|
855
|
+
return (jsx("section", { className: `bg-white text-primary-text font-sans p-9 box-border ${className} ${getTileRightPadding(className)} ${getTileMinHeight(className)} `, children: jsx(BaseTile, { context: context, title: title && (jsx(Heading, { headingType: getTileHeadingType(className), title: title, className: `whitespace-pre-wrap max-w-[600px] ${title ? 'mb-3' : ''}` })), buttons: buttons?.length ? (jsx(ButtonSection, { context: context, buttons: buttons, className: "flex mt-9 gap-3" })) : null, children: jsxs("table", { children: [jsx("thead", { children: jsxs("tr", { children: [jsx(CurrencyTH, { children: "\u0412\u0430\u043B\u044E\u0442\u0430" }), jsx(CurrencyTH, { className: "pl-11", children: "\u041A\u0443\u0440\u0441" })] }) }), jsx("tbody", { children: CURRENCY_CODES.map(renderCurrencyRow(data)) })] }) }) }));
|
|
842
856
|
});
|
|
843
857
|
const CurrencyTH = JSX(({ className = '', children }) => (jsx("th", { className: `text-left font-normal text-sm text-secondary-text ${className}`, children: children })));
|
|
844
858
|
const CurrencyTD = JSX(({ className = '', children }) => (jsx("td", { className: `text-left font-normal text-base text-primary-text ${className}`, children: children })));
|
|
@@ -1029,14 +1043,14 @@
|
|
|
1029
1043
|
|
|
1030
1044
|
const HeaderBurger = JSX(({ context, burgerSubMenu, onClick, defaultLocation = '', children }) => {
|
|
1031
1045
|
const [city, getCity] = context.useGeolocation(defaultLocation);
|
|
1032
|
-
return (jsxs("div", { className: "absolute top-0 left-0 w-full h-full bg-white p-4", children: [jsx("button", { className: "absolute top-4 right-4", onClick: onClick, children: jsx(Icon, { name: "CloseIcon", width: "24", height: "24", asSVG: true }) }), jsxs(Button, { onClick: getCity, className: "flex items-center text-sm text-secondary-text mb-4", children: [jsx(Icon, { name: "GeolocationIcon", width: "24", height: "24", className: "box-border mr-2", asSVG: true }), city] }), children, jsx("div", { className: "mb-7", children: burgerSubMenu?.map(renderBurgerSubMenuItem) }), jsx(SearchBar, { context: context, className: "grow" })] }));
|
|
1046
|
+
return (jsxs("div", { className: "absolute top-0 left-0 w-full h-full bg-white p-4 box-border z-20", children: [jsx("button", { className: "absolute top-4 right-4 border-none bg-transparent", onClick: onClick, children: jsx(Icon, { name: "CloseIcon", width: "24", height: "24", asSVG: true }) }), jsxs(Button, { onClick: getCity, className: "flex items-center text-sm text-secondary-text mb-4", children: [jsx(Icon, { name: "GeolocationIcon", width: "24", height: "24", className: "box-border mr-2", asSVG: true }), city] }), children, jsx("div", { className: "mb-7", children: burgerSubMenu?.map(renderBurgerSubMenuItem) }), jsx(SearchBar, { context: context, className: "grow" })] }));
|
|
1033
1047
|
});
|
|
1034
1048
|
const renderBurgerSubMenuItem = (menu, i) => {
|
|
1035
1049
|
const { icon, href, text } = menu;
|
|
1036
1050
|
return (jsxs(Button, { href: href, className: "flex text-sm mb-4", children: [icon ? jsx(Icon, { className: "pr-1", name: icon, width: "24", height: "24", asSVG: true }) : null, jsx("span", { className: "pl-0.5 font-medium", children: text })] }, `headerSubMenu-${i}`));
|
|
1037
1051
|
};
|
|
1038
1052
|
|
|
1039
|
-
const HeaderTop = JSX(({ onClick, bgColor }) => (jsxs("div", { className: "flex items-center justify-between border-0 border-b border-main-divider h-[50px]", children: [jsxs("div", { className: "flex items-center", children: [jsx("button", { className: "pr-4", onClick: onClick, "aria-label": "\u041E\u0442\u043A\u0440\u044B\u0442\u044C \u043C\u0435\u043D\u044E", children: jsx(Icon, { name: bgColor === 'bg-white' ? 'BurgerIcon' : 'BurgerIconWhite', width: "24", height: "24", asSVG: true }) }), jsx(Logo, { bgColor: bgColor })] }), jsx("button", { className: `${bgColor === 'bg-white' ? 'text-primary-main' : 'text-white'} text-sm`, children: "\u0412\u043E\u0439\u0442\u0438" })] })));
|
|
1053
|
+
const HeaderTop = JSX(({ onClick, bgColor }) => (jsxs("div", { className: "flex items-center justify-between border-0 border-b border-main-divider h-[50px]", children: [jsxs("div", { className: "flex items-center", children: [jsx("button", { className: "pr-4 border-0 bg-transparent", onClick: onClick, "aria-label": "\u041E\u0442\u043A\u0440\u044B\u0442\u044C \u043C\u0435\u043D\u044E", children: jsx(Icon, { name: bgColor === 'bg-white' ? 'BurgerIcon' : 'BurgerIconWhite', width: "24", height: "24", asSVG: true }) }), jsx(Logo, { bgColor: bgColor })] }), jsx("button", { className: `${bgColor === 'bg-white' ? 'text-primary-main' : 'text-white'} text-sm border-0 bg-transparent`, children: "\u0412\u043E\u0439\u0442\u0438" })] })));
|
|
1040
1054
|
|
|
1041
1055
|
const Header = JSX(({ className = '', defaultLocation, bgColor = 'bg-white', context, topItems, burgerSubMenu }) => {
|
|
1042
1056
|
const router = context.useRouter();
|
|
@@ -1048,7 +1062,7 @@
|
|
|
1048
1062
|
const activeSubItem = findActiveSubItem(router)(subItems);
|
|
1049
1063
|
const [burgerMenuShow, setBurgerMenuShow] = context.useState(false);
|
|
1050
1064
|
const toggleBurgerMenu = () => setBurgerMenuShow(!burgerMenuShow);
|
|
1051
|
-
return (jsxs("header", { className: `${bgColor} ${className}`, children: [jsxs("div", { className: "container px-4 py-0", children: [jsx(HeaderTop, { onClick: toggleBurgerMenu, bgColor: bgColor }), jsx("nav", { className: "flex items-center m-0 p-0 overflow-y-hidden w-full h-[50px]", children: jsx("div", { className: "flex", children: subItems?.map((_, i) => renderSubItem({
|
|
1065
|
+
return (jsxs("header", { className: `${bgColor} ${className}`, children: [jsxs("div", { className: "container px-4 py-0 box-border", children: [jsx(HeaderTop, { onClick: toggleBurgerMenu, bgColor: bgColor }), jsx("nav", { className: "flex items-center m-0 p-0 overflow-y-hidden w-full h-[50px]", children: jsx("div", { className: "flex", children: subItems?.map((_, i) => renderSubItem({
|
|
1052
1066
|
...useLink({ router, handlerDecorator }, _),
|
|
1053
1067
|
active: _ === activeSubItem,
|
|
1054
1068
|
bgColor,
|
|
@@ -1056,16 +1070,6 @@
|
|
|
1056
1070
|
});
|
|
1057
1071
|
const renderSubItem = (item, i) => (jsx(HeaderItem, { className: "mr-8 whitespace-nowrap text-sm", ...item }, String(i)));
|
|
1058
1072
|
|
|
1059
|
-
const GOLDEN_RATIO = 1.618;
|
|
1060
|
-
const Placeholder = JSX(({ className, context, title, description = 'Блок в разработке...' }) => {
|
|
1061
|
-
return (jsx("section", { className: `bg-white text-primary-text font-sans p-9 box-border ${className} ${getTileRightPadding(className)} ${getTileMinHeight(className)} `, children: jsxs(BaseTile, { context: context, title: title ? (jsx(Heading, { headingType: getTileHeadingType(className), title: title, className: `whitespace-pre-wrap max-w-[600px]` })) : null, children: [description ? (jsx(Description, { className: "mt-4 max-w-[600px]", description: description })) : null, jsx("figure", { className: "m-0 min-w-[600px]", children: renderShimmer() })] }) }));
|
|
1062
|
-
});
|
|
1063
|
-
const renderShimmer = (size = 3) => goldenSequence(100, size)
|
|
1064
|
-
.map((_) => Math.floor(_))
|
|
1065
|
-
.map(renderShimmerItem);
|
|
1066
|
-
const renderShimmerItem = (width = 100, index) => (jsx("div", { style: { width: `${width}%` }, className: "h-4 mt-2 bg-secondary-light" }, String(index)));
|
|
1067
|
-
const goldenSequence = (first, size) => [first].concat(size > 0 ? goldenSequence(first / GOLDEN_RATIO, size - 1) : []);
|
|
1068
|
-
|
|
1069
1073
|
const benefitTitleStyleMap = {
|
|
1070
1074
|
primary: 'text-primary-text',
|
|
1071
1075
|
secondary: 'text-white',
|
|
@@ -1075,12 +1079,15 @@
|
|
|
1075
1079
|
secondary: 'text-white',
|
|
1076
1080
|
};
|
|
1077
1081
|
function renderBenefit(benefit, i, version) {
|
|
1078
|
-
return (jsxs("div", { className: "flex gap-3 items-center mb-2.5 last:mb-0", children: [benefit.icon && (jsx(Icon, { className: "w-
|
|
1082
|
+
return (jsxs("div", { className: "flex gap-3 items-center mb-2.5 last:mb-0", children: [benefit.icon && (jsx(Icon, { className: "w-6 h-6 rounded-full box-border", name: benefit.icon, width: "24", height: "24", asSVG: true })), jsx("div", { className: `font-medium text-m-title-xs m-0 ${benefitTitleStyleMap[version]}`, children: benefit.label }), benefit.description && (jsx("div", { className: `font-normal text-m-sm ${benefitDescStyleMap[version]}`, children: benefit.description }))] }, String(i)));
|
|
1079
1083
|
}
|
|
1080
1084
|
|
|
1081
1085
|
const ProductBlockInner = JSX(({ className = '', context, title, headingType = 'h2', description, benefits, buttons, image, items, version = 'primary', }) => {
|
|
1082
|
-
return (jsxs("div", { className:
|
|
1086
|
+
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] ${title ? 'mb-3' : ''}` })), buttons: buttons?.length ? (jsx(ButtonSection, { context: context, buttons: buttons, className: "flex flex-col mt-5 gap-2.5" })) : null, children: [description && jsx(Description, { description: description }), benefits?.length ? (jsx("div", { className: "mt-5", children: benefits.map((_, i) => renderBenefit(_, i, version)) })) : null, items?.length ? jsx(List, { items: items }) : null] }) }), renderImage(image)] }));
|
|
1083
1087
|
});
|
|
1088
|
+
function renderImage(image) {
|
|
1089
|
+
return image?.src ? (jsx("div", { className: "mt-5", children: jsx(Img, { image: { className: 'block', ...image } }) })) : null;
|
|
1090
|
+
}
|
|
1084
1091
|
|
|
1085
1092
|
const ProductBlock = JSX(
|
|
1086
1093
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
@@ -1090,25 +1097,13 @@
|
|
|
1090
1097
|
});
|
|
1091
1098
|
|
|
1092
1099
|
const ProductGalleryBlock = JSX(({ block, headingType, context }) => {
|
|
1093
|
-
return (jsx("section", { className: "flex grow-0 shrink-0 basis-full px-4
|
|
1100
|
+
return (jsx("section", { className: "flex grow-0 shrink-0 basis-full px-4 pt-6", role: "listitem", children: jsx("div", { className: "flex grow", children: jsx(ProductBlockInner, { context: context, headingType: headingType || 'h2', ...block }) }) }));
|
|
1094
1101
|
});
|
|
1095
1102
|
|
|
1096
|
-
const ProductGallery = JSX(({ className, context,
|
|
1103
|
+
const ProductGallery = JSX(({ className, context, slides = [] }) => {
|
|
1097
1104
|
const galleryBlocks = slides.map((s) => s.productBlock);
|
|
1098
|
-
|
|
1099
|
-
return (jsxs("section", { className: `font-sans bg-white overflow-hidden w-100 ${className || ''}`, children: [jsx("div", { className: `flex duration-1000`, style: { transform: `translateX(-${activeSlideIndex}00%)` }, role: "list", children: galleryBlocks.map((block, i) => (jsx(ProductGalleryBlock, { block: block, context: context }, String(i)))) }), jsx("div", { className: "flex px-4 py-6", children: slides.map((_, i) => renderNavButton({
|
|
1100
|
-
slide: _.productBlock,
|
|
1101
|
-
i,
|
|
1102
|
-
activeSlideIndex,
|
|
1103
|
-
onClick: () => setActiveSlideIndex(i),
|
|
1104
|
-
duration,
|
|
1105
|
-
})) })] }));
|
|
1105
|
+
return (jsx("section", { className: `font-sans bg-white overflow-hidden w-100 pb-6 ${className || ''}`, children: jsx(SwipeListControl, { context: context, children: galleryBlocks.map((block, i) => (jsx(ProductGalleryBlock, { block: block, context: context }, String(i)))) }) }));
|
|
1106
1106
|
});
|
|
1107
|
-
function renderNavButton({ slide, i, activeSlideIndex, onClick, duration }) {
|
|
1108
|
-
const isActiveBtn = i === activeSlideIndex;
|
|
1109
|
-
const progressBarClassName = isActiveBtn ? 'animate-slide bg-primary-main' : 'bg-main-divider';
|
|
1110
|
-
return (jsx("button", { type: "button", onClick: onClick, "aria-label": slide?.title, className: `relative overflow-hidden border-0 bg-inherit cursor-pointer pl-0 mr-1.5 pt-4 pb-5 last:mr-0 grow basis-0`, children: jsx("div", { className: `absolute bottom-0 left-0 w-full h-[3px] ${progressBarClassName}`, style: { animationDuration: `${duration}s`, animationFillMode: 'forwards' } }) }, String(i)));
|
|
1111
|
-
}
|
|
1112
1107
|
|
|
1113
1108
|
const StepsBlock = JSX(({ className, title, description, steps, size = 'normal' }) => {
|
|
1114
1109
|
return (jsxs("section", { className: `box-border font-sans text-primary-text bg-white px-4 py-6 flex flex-col ${className || ''}`, children: [title && jsx(Heading, { headingType: "h3", className: "text-center", title: title }), description && jsx("p", { className: `text-m-md text-center ${title && 'mt-2'}`, children: description }), steps?.length ? (jsx("div", { className: `box-border py-0.5 mb-0.5 mt-5`, children: jsx("div", { className: "flex flex-col justify-between gap-x-[101px]", children: steps.map((step, i) => renderStepTitle({ step, size, i, length: steps.length })) }) })) : null] }));
|
|
@@ -1117,7 +1112,7 @@
|
|
|
1117
1112
|
const { step, size, i, length } = params;
|
|
1118
1113
|
const isLastStep = length - 1 === i;
|
|
1119
1114
|
const margin = size === 'normal' ? 'ml-[34px]' : 'ml-[24px]';
|
|
1120
|
-
return (jsx("div", { children: jsxs("div", { className: "flex flex-row text-center relative", children: [jsxs("div", { children: [renderIconArea(step, size, i), !isLastStep && jsx("div", { className: `min-h-8 h-full w-[2px] bg-secondary-light ${margin}` })] }), jsxs("div", { className: "flex flex-col justify-
|
|
1115
|
+
return (jsx("div", { children: jsxs("div", { className: "flex flex-row text-center relative", children: [jsxs("div", { children: [renderIconArea(step, size, i), !isLastStep && jsx("div", { className: `min-h-8 h-full w-[2px] bg-secondary-light ${margin}` })] }), jsxs("div", { className: "flex flex-col justify-start relative", children: [step.label && (jsx("div", { className: "font-medium text-m-title-xs m-0 text-left", children: step.label })), step.description && (jsx("div", { className: `font-normal text-sm text-secondary-text text-left ${step.label ? 'mt-1' : ''}`, children: step.description }))] })] }, String(i)) }, String(i)));
|
|
1121
1116
|
};
|
|
1122
1117
|
const renderIconArea = (step, size, i) => {
|
|
1123
1118
|
const iconAreaSize = size === 'normal'
|
|
@@ -1125,18 +1120,18 @@
|
|
|
1125
1120
|
: 'h-[50px] w-[50px] min-w-[50px] min-h-[50px]';
|
|
1126
1121
|
const iconSize = size === 'normal' ? '38' : '27';
|
|
1127
1122
|
const iconTextSize = size === 'normal' ? 'text-m-title' : 'text-m-title-xs';
|
|
1128
|
-
return (jsx("div", { className: `${iconAreaSize} bg-secondary-light rounded-full z-10 mr-3 flex justify-center content-center`, children: jsx("span", { className: `font-medium text-secondary-text self-center ${iconTextSize}`, children: (step.icon && jsx(Icon, { name: step.icon, width: iconSize, height: iconSize
|
|
1123
|
+
return (jsx("div", { className: `${iconAreaSize} bg-secondary-light rounded-full z-10 mr-3 flex justify-center content-center`, children: jsx("span", { className: `font-medium text-secondary-text self-center ${iconTextSize}`, children: (step.icon && jsx(Icon, { name: step.icon, width: iconSize, height: iconSize })) || i + 1 }) }));
|
|
1129
1124
|
};
|
|
1130
1125
|
|
|
1131
1126
|
const Blocks = {
|
|
1132
1127
|
Accordion,
|
|
1133
1128
|
ExchangeRateTile,
|
|
1134
1129
|
Footer,
|
|
1130
|
+
Gallery,
|
|
1135
1131
|
Header,
|
|
1136
1132
|
Headline,
|
|
1137
1133
|
LinkDocs,
|
|
1138
1134
|
MobileAppTile,
|
|
1139
|
-
Placeholder,
|
|
1140
1135
|
ProductBlock,
|
|
1141
1136
|
ProductGallery,
|
|
1142
1137
|
StepsBlock,
|
|
@@ -1159,6 +1154,16 @@
|
|
|
1159
1154
|
return (jsxs("div", { className: `border-main border-2 border-solid bg-white flex w-[125px] items-center justify-center gap-3 p-2 font-sans ${className || ''}`, children: [jsx(LikeButton, { onClick: likeService.like, ariaLabel: "\u041F\u043E\u0441\u0442\u0430\u0432\u0438\u0442\u044C \u043E\u0442\u043C\u0435\u0442\u043A\u0443 \u00AB\u043B\u0430\u0439\u043A\u00BB" }), jsx(LikeButton, { onClick: likeService.dislike, className: "rotate-180", ariaLabel: "\u041F\u043E\u0441\u0442\u0430\u0432\u0438\u0442\u044C \u043E\u0442\u043C\u0435\u0442\u043A\u0443 \u00AB\u0434\u0438\u0437\u043B\u0430\u0439\u043A\u00BB" }), jsx("span", { className: "select-none", children: likeService.likeCount })] }));
|
|
1160
1155
|
});
|
|
1161
1156
|
|
|
1157
|
+
const GOLDEN_RATIO = 1.618;
|
|
1158
|
+
const Placeholder = JSX(({ className, context, title, description = 'Блок в разработке...' }) => {
|
|
1159
|
+
return (jsx("section", { className: `bg-white text-primary-text font-sans p-9 box-border ${className} ${getTileRightPadding(className)} ${getTileMinHeight(className)} `, children: jsxs(BaseTile, { context: context, title: title ? (jsx(Heading, { headingType: getTileHeadingType(className), title: title, className: `whitespace-pre-wrap max-w-[600px]` })) : null, children: [description ? (jsx(Description, { className: "mt-4 max-w-[600px]", description: description })) : null, jsx("figure", { className: "m-0 min-w-[600px]", children: renderShimmer() })] }) }));
|
|
1160
|
+
});
|
|
1161
|
+
const renderShimmer = (size = 3) => goldenSequence(100, size)
|
|
1162
|
+
.map((_) => Math.floor(_))
|
|
1163
|
+
.map(renderShimmerItem);
|
|
1164
|
+
const renderShimmerItem = (width = 100, index) => (jsx("div", { style: { width: `${width}%` }, className: "h-4 mt-2 bg-secondary-light" }, String(index)));
|
|
1165
|
+
const goldenSequence = (first, size) => [first].concat(size > 0 ? goldenSequence(first / GOLDEN_RATIO, size - 1) : []);
|
|
1166
|
+
|
|
1162
1167
|
const defaultBlockDecorator = ({ blockClassName, block, render }) => render({ blockClassName, block });
|
|
1163
1168
|
const ContentPage = JSX(({ className, context, blocksRegistry, data: { style: pageStyle, blocks, slots = {}, likeControl, colorPalette = 'pc' }, blockDecorator = defaultBlockDecorator, }) => {
|
|
1164
1169
|
const { header } = slots;
|
|
@@ -1184,11 +1189,20 @@
|
|
|
1184
1189
|
}
|
|
1185
1190
|
|
|
1186
1191
|
const ContentPageHead = JSX(({ HeadComponent, data, children }) => {
|
|
1187
|
-
const { title,
|
|
1188
|
-
|
|
1189
|
-
|
|
1190
|
-
: null, children] }));
|
|
1192
|
+
const { title, main, og, twitter, jsonLd } = data;
|
|
1193
|
+
const { description, keywords, canonical, robots } = main || {};
|
|
1194
|
+
return (jsxs(HeadComponent, { children: [jsx("title", { children: title }), jsx("meta", { name: "viewport", content: "width=device-width, initial-scale=1" }), description && jsx("meta", { name: "description", content: description }), keywords && jsx("meta", { name: "keywords", content: keywords.join(',') }), robots && jsx("meta", { name: "robots", content: robots.join(',') }), renderOpenGraph(og), renderTwitter(twitter), canonical && jsx("link", { rel: "canonical", href: canonical }), jsonLd && jsx("script", { type: "application/ld+json", children: jsonLd }), children] }));
|
|
1191
1195
|
});
|
|
1196
|
+
function renderOpenGraph(og) {
|
|
1197
|
+
return og
|
|
1198
|
+
? Object.entries(og).map(([key, value]) => (jsx("meta", { name: `og:${key}`, content: value }, key)))
|
|
1199
|
+
: null;
|
|
1200
|
+
}
|
|
1201
|
+
function renderTwitter(twitter) {
|
|
1202
|
+
return twitter
|
|
1203
|
+
? Object.entries(twitter).map(([key, value]) => (jsx("meta", { name: `twitter:${key}`, content: value }, key)))
|
|
1204
|
+
: null;
|
|
1205
|
+
}
|
|
1192
1206
|
|
|
1193
1207
|
function isBlockInRegistry(blockType, registry) {
|
|
1194
1208
|
return (blockType || '') in registry;
|