@redneckz/wildless-cms-uni-blocks 0.3.29 → 0.3.32
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/bundle/blocks.schema.json +1 -1
- package/bundle/bundle.umd.js +70 -55
- package/bundle/bundle.umd.min.js +1 -1
- package/dist/components/Accordion/Accordion.js +2 -6
- package/dist/components/Accordion/Accordion.js.map +1 -1
- package/dist/components/Accordion/AccordionContent.d.ts +3 -3
- package/dist/components/Accordion/AccordionItem.js +4 -11
- package/dist/components/Accordion/AccordionItem.js.map +1 -1
- package/dist/components/Accordion/AccordionItem.mobile.js +6 -3
- package/dist/components/Accordion/AccordionItem.mobile.js.map +1 -1
- package/dist/components/Accordion/AccordionItemInner.js +2 -2
- package/dist/components/Accordion/AccordionItemInner.js.map +1 -1
- package/dist/components/Accordion/AccordionItemInner.mobile.js +2 -3
- package/dist/components/Accordion/AccordionItemInner.mobile.js.map +1 -1
- package/dist/components/Footer/MediaButton.js +1 -1
- package/dist/components/Footer/MediaButton.js.map +1 -1
- package/dist/components/Header/Header.js +1 -1
- package/dist/components/Header/Header.js.map +1 -1
- package/dist/components/MobileAppTile/MobileAppTile.js +1 -1
- package/dist/components/MobileAppTile/MobileAppTile.js.map +1 -1
- package/dist/components/OtherProducts/OtherProductsContent.d.ts +3 -12
- package/dist/components/PictureText/PictureText.js +8 -4
- package/dist/components/PictureText/PictureText.js.map +1 -1
- package/dist/components/PictureText/PictureTextContent.d.ts +7 -0
- package/dist/components/ProductGalleryGreen/ProductGalleryGreen.js +31 -15
- package/dist/components/ProductGalleryGreen/ProductGalleryGreen.js.map +1 -1
- package/dist/components/ProductGalleryGreen/ProductGalleryGreenContent.d.ts +2 -0
- package/dist/components/Recommendation/Recommendation.js +1 -1
- package/dist/components/Recommendation/RecommendationCard.js +1 -1
- package/dist/components/Recommendation/RecommendationCard.js.map +1 -1
- package/dist/components/StepsBlock/StepsBlock.js +8 -2
- package/dist/components/StepsBlock/StepsBlock.js.map +1 -1
- package/dist/components/StepsBlock/StepsBlock.mobile.js +10 -4
- package/dist/components/StepsBlock/StepsBlock.mobile.js.map +1 -1
- package/dist/components/StepsBlock/StepsBlockContent.d.ts +3 -2
- package/dist/components/TextBlock/TextBlockContent.d.ts +1 -1
- package/dist/ui-kit/BlocksList/EmbeddableBlocks.mobile.d.ts +8 -0
- package/dist/ui-kit/BlocksList/EmbeddableBlocks.mobile.js +17 -0
- package/dist/ui-kit/BlocksList/EmbeddableBlocks.mobile.js.map +1 -0
- package/dist/ui-kit/BlocksList/renderBlocksList.d.ts +2 -4
- package/dist/ui-kit/BlocksList/renderBlocksList.js +3 -3
- package/dist/ui-kit/BlocksList/renderBlocksList.js.map +1 -1
- package/dist/ui-kit/Button/ButtonInner.js +1 -1
- package/dist/ui-kit/Button/ButtonInner.js.map +1 -1
- package/dist/ui-kit/Heading/Heading.js +1 -1
- package/dist/ui-kit/Heading/Heading.js.map +1 -1
- package/dist/ui-kit/SwipeListControl/SwipeListControlDots.js +1 -1
- package/dist/ui-kit/SwipeListControl/SwipeListControlDots.js.map +1 -1
- package/dist/ui-kit/SwipeListControl/utils/getScrollPoints.js +7 -1
- package/dist/ui-kit/SwipeListControl/utils/getScrollPoints.js.map +1 -1
- package/dist/ui-kit/Tabs/Tabs.js +1 -1
- package/dist/ui-kit/Tabs/Tabs.js.map +1 -1
- package/lib/common.css +1 -1
- package/lib/components/Accordion/Accordion.js +2 -6
- package/lib/components/Accordion/Accordion.js.map +1 -1
- package/lib/components/Accordion/AccordionContent.d.ts +3 -3
- package/lib/components/Accordion/AccordionItem.js +4 -11
- package/lib/components/Accordion/AccordionItem.js.map +1 -1
- package/lib/components/Accordion/AccordionItem.mobile.js +6 -3
- package/lib/components/Accordion/AccordionItem.mobile.js.map +1 -1
- package/lib/components/Accordion/AccordionItemInner.js +2 -2
- package/lib/components/Accordion/AccordionItemInner.js.map +1 -1
- package/lib/components/Accordion/AccordionItemInner.mobile.js +2 -3
- package/lib/components/Accordion/AccordionItemInner.mobile.js.map +1 -1
- package/lib/components/Footer/MediaButton.js +1 -1
- package/lib/components/Footer/MediaButton.js.map +1 -1
- package/lib/components/Header/Header.js +1 -1
- package/lib/components/Header/Header.js.map +1 -1
- package/lib/components/MobileAppTile/MobileAppTile.js +1 -1
- package/lib/components/MobileAppTile/MobileAppTile.js.map +1 -1
- package/lib/components/OtherProducts/OtherProductsContent.d.ts +3 -12
- package/lib/components/PictureText/PictureText.js +8 -4
- package/lib/components/PictureText/PictureText.js.map +1 -1
- package/lib/components/PictureText/PictureTextContent.d.ts +7 -0
- package/lib/components/ProductGalleryGreen/ProductGalleryGreen.fixture.d.ts +1 -0
- package/lib/components/ProductGalleryGreen/ProductGalleryGreen.js +31 -15
- package/lib/components/ProductGalleryGreen/ProductGalleryGreen.js.map +1 -1
- package/lib/components/ProductGalleryGreen/ProductGalleryGreenContent.d.ts +2 -0
- package/lib/components/Recommendation/Recommendation.js +1 -1
- package/lib/components/Recommendation/RecommendationCard.js +1 -1
- package/lib/components/Recommendation/RecommendationCard.js.map +1 -1
- package/lib/components/StepsBlock/StepsBlock.fixture.d.ts +1 -0
- package/lib/components/StepsBlock/StepsBlock.js +8 -2
- package/lib/components/StepsBlock/StepsBlock.js.map +1 -1
- package/lib/components/StepsBlock/StepsBlock.mobile.js +10 -4
- package/lib/components/StepsBlock/StepsBlock.mobile.js.map +1 -1
- package/lib/components/StepsBlock/StepsBlockContent.d.ts +3 -2
- package/lib/components/TextBlock/TextBlockContent.d.ts +1 -1
- package/lib/ui-kit/BlocksList/EmbeddableBlocks.mobile.d.ts +8 -0
- package/lib/ui-kit/BlocksList/EmbeddableBlocks.mobile.js +15 -0
- package/lib/ui-kit/BlocksList/EmbeddableBlocks.mobile.js.map +1 -0
- package/lib/ui-kit/BlocksList/renderBlocksList.d.ts +2 -4
- package/lib/ui-kit/BlocksList/renderBlocksList.js +3 -3
- package/lib/ui-kit/BlocksList/renderBlocksList.js.map +1 -1
- package/lib/ui-kit/Button/ButtonInner.js +1 -1
- package/lib/ui-kit/Button/ButtonInner.js.map +1 -1
- package/lib/ui-kit/Heading/Heading.js +1 -1
- package/lib/ui-kit/Heading/Heading.js.map +1 -1
- package/lib/ui-kit/SwipeListControl/SwipeListControl.fixture.mobile.d.ts +3 -0
- package/lib/ui-kit/SwipeListControl/SwipeListControlDots.js +1 -1
- package/lib/ui-kit/SwipeListControl/SwipeListControlDots.js.map +1 -1
- package/lib/ui-kit/SwipeListControl/utils/getScrollPoints.d.ts +4 -1
- package/lib/ui-kit/SwipeListControl/utils/getScrollPoints.js +7 -1
- package/lib/ui-kit/SwipeListControl/utils/getScrollPoints.js.map +1 -1
- package/lib/ui-kit/Tabs/Tabs.js +1 -1
- package/lib/ui-kit/Tabs/Tabs.js.map +1 -1
- package/mobile/bundle/bundle.umd.js +87 -189
- package/mobile/bundle/bundle.umd.min.js +1 -1
- package/mobile/dist/components/Accordion/AccordionContent.d.ts +3 -3
- package/mobile/dist/components/Accordion/AccordionItem.js +6 -3
- package/mobile/dist/components/Accordion/AccordionItem.js.map +1 -1
- package/mobile/dist/components/Accordion/AccordionItemInner.js +2 -3
- package/mobile/dist/components/Accordion/AccordionItemInner.js.map +1 -1
- package/mobile/dist/components/Footer/MediaButton.js +1 -1
- package/mobile/dist/components/Footer/MediaButton.js.map +1 -1
- package/mobile/dist/components/OtherProducts/OtherProductsContent.d.ts +3 -12
- package/mobile/dist/components/PictureText/PictureText.js +8 -4
- package/mobile/dist/components/PictureText/PictureText.js.map +1 -1
- package/mobile/dist/components/PictureText/PictureTextContent.d.ts +7 -0
- package/mobile/dist/components/ProductGalleryGreen/ProductGalleryGreen.js +31 -15
- package/mobile/dist/components/ProductGalleryGreen/ProductGalleryGreen.js.map +1 -1
- package/mobile/dist/components/ProductGalleryGreen/ProductGalleryGreenContent.d.ts +2 -0
- package/mobile/dist/components/Recommendation/Recommendation.js +1 -1
- package/mobile/dist/components/Recommendation/RecommendationCard.js +1 -1
- package/mobile/dist/components/Recommendation/RecommendationCard.js.map +1 -1
- package/mobile/dist/components/StepsBlock/StepsBlock.js +10 -4
- package/mobile/dist/components/StepsBlock/StepsBlock.js.map +1 -1
- package/mobile/dist/components/StepsBlock/StepsBlockContent.d.ts +3 -2
- package/mobile/dist/components/TextBlock/TextBlockContent.d.ts +1 -1
- package/mobile/dist/ui-kit/BlocksList/EmbeddableBlocks.d.ts +0 -4
- package/mobile/dist/ui-kit/BlocksList/EmbeddableBlocks.js +0 -8
- package/mobile/dist/ui-kit/BlocksList/EmbeddableBlocks.js.map +1 -1
- package/mobile/dist/ui-kit/BlocksList/renderBlocksList.d.ts +2 -4
- package/mobile/dist/ui-kit/BlocksList/renderBlocksList.js +3 -3
- package/mobile/dist/ui-kit/BlocksList/renderBlocksList.js.map +1 -1
- package/mobile/dist/ui-kit/Button/ButtonInner.js +1 -1
- package/mobile/dist/ui-kit/Button/ButtonInner.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/utils/getScrollPoints.js +7 -1
- package/mobile/dist/ui-kit/SwipeListControl/utils/getScrollPoints.js.map +1 -1
- package/mobile/dist/ui-kit/Tabs/Tabs.js +1 -1
- package/mobile/dist/ui-kit/Tabs/Tabs.js.map +1 -1
- package/mobile/lib/components/Accordion/AccordionContent.d.ts +3 -3
- package/mobile/lib/components/Accordion/AccordionItem.js +6 -3
- package/mobile/lib/components/Accordion/AccordionItem.js.map +1 -1
- package/mobile/lib/components/Accordion/AccordionItemInner.js +2 -3
- package/mobile/lib/components/Accordion/AccordionItemInner.js.map +1 -1
- package/mobile/lib/components/Footer/MediaButton.js +1 -1
- package/mobile/lib/components/Footer/MediaButton.js.map +1 -1
- package/mobile/lib/components/OtherProducts/OtherProductsContent.d.ts +3 -12
- package/mobile/lib/components/PictureText/PictureText.js +8 -4
- package/mobile/lib/components/PictureText/PictureText.js.map +1 -1
- package/mobile/lib/components/PictureText/PictureTextContent.d.ts +7 -0
- package/mobile/lib/components/ProductGalleryGreen/ProductGalleryGreen.js +31 -15
- package/mobile/lib/components/ProductGalleryGreen/ProductGalleryGreen.js.map +1 -1
- package/mobile/lib/components/ProductGalleryGreen/ProductGalleryGreenContent.d.ts +2 -0
- package/mobile/lib/components/Recommendation/Recommendation.js +1 -1
- package/mobile/lib/components/Recommendation/RecommendationCard.js +1 -1
- package/mobile/lib/components/Recommendation/RecommendationCard.js.map +1 -1
- package/mobile/lib/components/StepsBlock/StepsBlock.js +10 -4
- package/mobile/lib/components/StepsBlock/StepsBlock.js.map +1 -1
- package/mobile/lib/components/StepsBlock/StepsBlockContent.d.ts +3 -2
- package/mobile/lib/components/TextBlock/TextBlockContent.d.ts +1 -1
- package/mobile/lib/ui-kit/BlocksList/EmbeddableBlocks.d.ts +0 -4
- package/mobile/lib/ui-kit/BlocksList/EmbeddableBlocks.js +0 -8
- package/mobile/lib/ui-kit/BlocksList/EmbeddableBlocks.js.map +1 -1
- package/mobile/lib/ui-kit/BlocksList/renderBlocksList.d.ts +2 -4
- package/mobile/lib/ui-kit/BlocksList/renderBlocksList.js +3 -3
- package/mobile/lib/ui-kit/BlocksList/renderBlocksList.js.map +1 -1
- package/mobile/lib/ui-kit/Button/ButtonInner.js +1 -1
- package/mobile/lib/ui-kit/Button/ButtonInner.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/utils/getScrollPoints.js +7 -1
- package/mobile/lib/ui-kit/SwipeListControl/utils/getScrollPoints.js.map +1 -1
- package/mobile/lib/ui-kit/Tabs/Tabs.js +1 -1
- package/mobile/lib/ui-kit/Tabs/Tabs.js.map +1 -1
- package/mobile/src/components/Accordion/Accordion.example.json +3 -0
- package/mobile/src/components/Accordion/AccordionContent.ts +4 -5
- package/mobile/src/components/Accordion/AccordionItem.tsx +32 -27
- package/mobile/src/components/Accordion/AccordionItemInner.tsx +8 -11
- package/mobile/src/components/Footer/MediaButton.tsx +1 -1
- package/mobile/src/components/Header/Header.example.json +3 -0
- package/mobile/src/components/OtherProducts/OtherProductsContent.ts +3 -12
- package/mobile/src/components/PictureText/PictureText.example.json +2 -0
- package/mobile/src/components/PictureText/PictureText.tsx +33 -7
- package/mobile/src/components/PictureText/PictureTextContent.ts +7 -0
- package/mobile/src/components/ProductGalleryGreen/ProductGalleryGreen.example.json +2 -1
- package/mobile/src/components/ProductGalleryGreen/ProductGalleryGreen.tsx +40 -17
- package/mobile/src/components/ProductGalleryGreen/ProductGalleryGreenContent.ts +2 -0
- package/mobile/src/components/Recommendation/Recommendation.tsx +1 -1
- package/mobile/src/components/Recommendation/RecommendationCard.tsx +1 -1
- package/mobile/src/components/StepsBlock/StepsBlock.tsx +14 -5
- package/mobile/src/components/StepsBlock/StepsBlockContent.ts +3 -2
- package/mobile/src/components/TextBlock/TextBlockContent.ts +1 -1
- package/mobile/src/ui-kit/BlocksList/EmbeddableBlocks.tsx +0 -8
- package/mobile/src/ui-kit/BlocksList/renderBlocksList.tsx +4 -12
- package/mobile/src/ui-kit/Button/ButtonInner.tsx +2 -2
- package/mobile/src/ui-kit/SwipeListControl/SwipeListControlDots.tsx +1 -1
- package/mobile/src/ui-kit/SwipeListControl/utils/getScrollPoints.spec.ts +18 -0
- package/mobile/src/ui-kit/SwipeListControl/utils/getScrollPoints.ts +10 -2
- package/mobile/src/ui-kit/Tabs/Tabs.tsx +1 -1
- package/package.json +2 -3
- package/src/components/Accordion/Accordion.example.json +3 -0
- package/src/components/Accordion/Accordion.fixture.mobile.tsx +1 -0
- package/src/components/Accordion/Accordion.fixture.tsx +2 -0
- package/src/components/Accordion/Accordion.tsx +4 -17
- package/src/components/Accordion/AccordionContent.ts +4 -5
- package/src/components/Accordion/AccordionItem.mobile.tsx +32 -27
- package/src/components/Accordion/AccordionItem.tsx +23 -49
- package/src/components/Accordion/AccordionItemInner.mobile.tsx +8 -11
- package/src/components/Accordion/AccordionItemInner.tsx +8 -10
- package/src/components/Footer/MediaButton.tsx +1 -1
- package/src/components/Header/Header.example.json +3 -0
- package/src/components/Header/Header.tsx +8 -1
- package/src/components/MobileAppTile/MobileAppTile.tsx +3 -3
- package/src/components/OtherProducts/OtherProducts.fixture.tsx +61 -6
- package/src/components/OtherProducts/OtherProductsContent.ts +3 -12
- package/src/components/PictureText/PictureText.example.json +2 -0
- package/src/components/PictureText/PictureText.tsx +33 -7
- package/src/components/PictureText/PictureTextContent.ts +7 -0
- package/src/components/ProductGalleryGreen/ProductGalleryGreen.example.json +2 -1
- package/src/components/ProductGalleryGreen/ProductGalleryGreen.fixture.tsx +74 -1
- package/src/components/ProductGalleryGreen/ProductGalleryGreen.tsx +40 -17
- package/src/components/ProductGalleryGreen/ProductGalleryGreenContent.ts +2 -0
- package/src/components/Recommendation/Recommendation.tsx +1 -1
- package/src/components/Recommendation/RecommendationCard.tsx +1 -1
- package/src/components/StepsBlock/StepsBlock.fixture.tsx +14 -0
- package/src/components/StepsBlock/StepsBlock.mobile.tsx +14 -5
- package/src/components/StepsBlock/StepsBlock.tsx +13 -6
- package/src/components/StepsBlock/StepsBlockContent.ts +3 -2
- package/src/components/TextBlock/TextBlockContent.ts +1 -1
- package/src/ui-kit/BlocksList/EmbeddableBlocks.mobile.tsx +15 -0
- package/src/ui-kit/BlocksList/renderBlocksList.tsx +4 -12
- package/src/ui-kit/Button/ButtonInner.tsx +2 -2
- package/src/ui-kit/Heading/Heading.tsx +1 -3
- package/src/ui-kit/SwipeListControl/SwipeListControl.fixture.mobile.tsx +24 -6
- package/src/ui-kit/SwipeListControl/SwipeListControlDots.tsx +1 -1
- package/src/ui-kit/SwipeListControl/utils/getScrollPoints.spec.ts +18 -0
- package/src/ui-kit/SwipeListControl/utils/getScrollPoints.ts +10 -2
- package/src/ui-kit/Tabs/Tabs.tsx +1 -1
|
@@ -477,7 +477,7 @@
|
|
|
477
477
|
}
|
|
478
478
|
const contentContainer = e.currentTarget.parentElement
|
|
479
479
|
?.previousElementSibling;
|
|
480
|
-
contentContainer?.children[idx]?.scrollIntoView({ behavior: 'smooth' });
|
|
480
|
+
contentContainer?.children[idx]?.scrollIntoView({ behavior: 'smooth', block: 'nearest' });
|
|
481
481
|
};
|
|
482
482
|
return showDots && children?.length ? (jsx("div", { className: "flex gap-2 mx-auto mt-5 w-fit", children: children?.map((_, idx) => (jsx("div", { onClick: handleClick(idx), className: `${DOT_STYLES}`, style: getDotStyles(idx, activeIndex, indexFraction), "aria-hidden": true }, String(idx)))) })) : null;
|
|
483
483
|
});
|
|
@@ -535,8 +535,14 @@
|
|
|
535
535
|
Returns array of tuples consisting of [start, end] boundary scrollLeft values.
|
|
536
536
|
*/
|
|
537
537
|
const getScrollPoints = ({ gap, padding, clientWidth, scrollWidth, childElementCount, itemWidth, }) => {
|
|
538
|
-
const scrollItemWidth = itemWidth + gap;
|
|
539
538
|
const scrollableDistance = scrollWidth - clientWidth;
|
|
539
|
+
if (childElementCount === 2) {
|
|
540
|
+
return [
|
|
541
|
+
[0, scrollableDistance],
|
|
542
|
+
[scrollableDistance, scrollWidth],
|
|
543
|
+
];
|
|
544
|
+
}
|
|
545
|
+
const scrollItemWidth = itemWidth + gap;
|
|
540
546
|
const edgeScrollDistance = clientWidth - gap - padding;
|
|
541
547
|
const lastScrollableIdx = childElementCount - 2;
|
|
542
548
|
const scrollPoints = new Array(childElementCount)
|
|
@@ -621,13 +627,6 @@
|
|
|
621
627
|
return (jsxs("section", { className: `font-sans text-primary-text py-6 px-4 bg-white overflow-x-hidden ${className}`, children: [title ? (jsx(Heading, { headingType: "h2", className: `text-center ${subtitle ? 'mb-2' : 'mb-5'}`, title: title })) : null, subtitle ? (jsx("h3", { className: "mt-0 font-normal mb-5 text-center text-m-md", children: subtitle })) : null, orientation === 'vertical' ? (jsx(LinkDocsVerticalList, { hasBorder: hasBorder, documents: documents, icon: icon })) : (jsx(LinkDocsHorizontalList, { context: context, hasBorder: hasBorder, documents: documents, icon: icon }))] }));
|
|
622
628
|
});
|
|
623
629
|
|
|
624
|
-
const PictureText = JSX(({ className = '', title, image, benefits, anchor = null }) => {
|
|
625
|
-
return (jsxs("section", { className: `relative font-sans text-primary-text bg-white p-14 ${className}`, id: anchor, children: [jsx(Heading, { headingType: "h2", className: "text-center", title: title }), jsxs("div", { className: 'flex justify-center mt-9', children: [image?.src && jsx(Img, { className: "mr-6", image: image }), benefits?.length ? (jsx("div", { className: "flex flex-col", children: benefits.map(renderBenefit$1) })) : null] })] }));
|
|
626
|
-
});
|
|
627
|
-
function renderBenefit$1(benefit, i) {
|
|
628
|
-
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)));
|
|
629
|
-
}
|
|
630
|
-
|
|
631
630
|
const isURL = (href) => href?.includes('//');
|
|
632
631
|
const withoutQuery = (href) => (href || '').replace(/\/?\?.*/, '');
|
|
633
632
|
const getOrigin = (href) => {
|
|
@@ -695,7 +694,7 @@
|
|
|
695
694
|
|
|
696
695
|
const ButtonInner = JSX((props) => {
|
|
697
696
|
const { text, aboveText, appendLeft } = props;
|
|
698
|
-
return (jsxs("div", { className: getButtonStyle(props), children: [appendLeft ? appendLeft : null, isWithText(props) ? (jsxs("div", { children: [jsx("div", { className: "text-m-2xs text-left", children: aboveText }), jsx("div", { className: "text-m-button
|
|
697
|
+
return (jsxs("div", { className: getButtonStyle(props), children: [appendLeft ? appendLeft : null, isWithText(props) ? (jsxs("div", { children: [jsx("div", { className: "text-m-2xs font-light text-left", children: aboveText }), jsx("div", { className: "text-m-button text-left", children: text })] })) : null] }));
|
|
699
698
|
});
|
|
700
699
|
const getButtonStyle = (props) => {
|
|
701
700
|
const { version, aboveText, rounded } = props;
|
|
@@ -733,9 +732,9 @@
|
|
|
733
732
|
const ButtonSection = JSX(({ context, className = '', buttons }) => {
|
|
734
733
|
const { handlerDecorator } = context;
|
|
735
734
|
const router = context.useRouter();
|
|
736
|
-
return buttons?.length ? (jsx("div", { className: `${className}`, children: buttons.map((button, index) => renderButton$
|
|
735
|
+
return buttons?.length ? (jsx("div", { className: `${className}`, children: buttons.map((button, index) => renderButton$2(useLink({ router, handlerDecorator }, button), index)) })) : null;
|
|
737
736
|
});
|
|
738
|
-
function renderButton$
|
|
737
|
+
function renderButton$2({ icon, ...button }, i) {
|
|
739
738
|
if (!button?.text)
|
|
740
739
|
return;
|
|
741
740
|
return icon ? (jsx(Button, { appendLeft: jsx(Icon, { name: icon, width: "24", height: "24", asSVG: true }), ...button }, String(i))) : (jsx(Button, { ...button }, String(i)));
|
|
@@ -840,82 +839,6 @@
|
|
|
840
839
|
return image?.src ? jsx(Img, { className: "pb-3 mr-auto", image: image }) : null;
|
|
841
840
|
}
|
|
842
841
|
|
|
843
|
-
const getColSpan = (className) => {
|
|
844
|
-
const colSpanPrefix = 'col-span-';
|
|
845
|
-
const colSpanStr = className.split(/\s+/).find((_) => _.startsWith(colSpanPrefix));
|
|
846
|
-
return colSpanStr ? parseInt(colSpanStr.substring(colSpanPrefix.length), 10) : 12;
|
|
847
|
-
};
|
|
848
|
-
|
|
849
|
-
function getTileHeadingType(className = '') {
|
|
850
|
-
const colSpan = getColSpan(className);
|
|
851
|
-
if (colSpan <= 4) {
|
|
852
|
-
return 'h4';
|
|
853
|
-
}
|
|
854
|
-
else if (colSpan <= 8) {
|
|
855
|
-
return 'h3';
|
|
856
|
-
}
|
|
857
|
-
else {
|
|
858
|
-
return 'h2';
|
|
859
|
-
}
|
|
860
|
-
}
|
|
861
|
-
|
|
862
|
-
function getTileMinHeight(className = '') {
|
|
863
|
-
const colSpan = getColSpan(className);
|
|
864
|
-
if (colSpan <= 6) {
|
|
865
|
-
return 'min-h-[300px]';
|
|
866
|
-
}
|
|
867
|
-
else if (colSpan <= 8) {
|
|
868
|
-
return 'min-h-[320px]';
|
|
869
|
-
}
|
|
870
|
-
else {
|
|
871
|
-
return 'min-h-[360px]';
|
|
872
|
-
}
|
|
873
|
-
}
|
|
874
|
-
|
|
875
|
-
function getTileRightPadding(className = '') {
|
|
876
|
-
const colSpan = getColSpan(className);
|
|
877
|
-
if (colSpan <= 6) {
|
|
878
|
-
return 'pr-9';
|
|
879
|
-
}
|
|
880
|
-
else if (colSpan <= 8) {
|
|
881
|
-
return 'pr-[4.75rem]';
|
|
882
|
-
}
|
|
883
|
-
else {
|
|
884
|
-
return 'pr-[9.4rem]';
|
|
885
|
-
}
|
|
886
|
-
}
|
|
887
|
-
|
|
888
|
-
const tileStyleMap = {
|
|
889
|
-
primary: 'bg-white text-primary-text',
|
|
890
|
-
secondary: 'bg-primary-main text-white',
|
|
891
|
-
};
|
|
892
|
-
const Tile = JSX((props) => {
|
|
893
|
-
const { context, title, description, items, children, buttons, image, className = '', version = 'primary', role, anchor = null, } = props;
|
|
894
|
-
return (jsx("section", { className: `overflow-hidden font-sans p-9 box-border ${className} ${tileStyleMap[version]} ${getTileRightPadding(className)} ${getTileMinHeight(className)} `, role: role, id: anchor, children: jsxs(BaseTile, { context: context, title: title && (jsx(Heading, { headingType: getTileHeadingType(className), title: title, className: `whitespace-pre-wrap max-w-[600px] ${title ? 'mb-3' : ''}
|
|
895
|
-
${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$1(items, version)] }) }));
|
|
896
|
-
});
|
|
897
|
-
function renderList$1(items, version) {
|
|
898
|
-
return items?.length ? (jsx(List, { items: items, itemClassName: "mt-2.5 first:mt-0", version: version })) : null;
|
|
899
|
-
}
|
|
900
|
-
|
|
901
|
-
const productTileStyleMap = {
|
|
902
|
-
primary: 'bg-white text-primary-text',
|
|
903
|
-
secondary: 'bg-primary-main text-white',
|
|
904
|
-
};
|
|
905
|
-
const ProductTile = JSX(({ context, className = '', title, description, benefits, buttons, image, version = 'primary', anchor = null, }) => {
|
|
906
|
-
return (jsx("section", { className: `bg-white text-primary-text font-sans p-9 box-border ${className} ${productTileStyleMap[version]} ${getTileRightPadding(className)} ${getTileMinHeight(className)} `, id: anchor, children: jsxs(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, image: image?.src && jsx(Img, { className: "mt-auto ml-7", image: image }), children: [description && jsx(Description, { className: "mt-4 max-w-[600px]", description: description }), jsxs("div", { className: "flex mt-5 mb-1", children: [benefits?.length ? (jsx("div", { className: "mr-8", children: benefits.map(renderBenefitLabel) })) : null, benefits?.length ? (jsx("div", { className: "pt-1", children: benefits.map((_, i) => renderBenefitDescription(_, i, version)) })) : null] })] }) }));
|
|
907
|
-
});
|
|
908
|
-
function renderBenefitLabel(benefit, i) {
|
|
909
|
-
return (jsx("div", { className: `text-xl font-medium ${i ? 'mt-2.5' : ''}`, children: benefit.label }, String(i)));
|
|
910
|
-
}
|
|
911
|
-
function renderBenefitDescription(benefit, i, version = 'primary') {
|
|
912
|
-
const labelStyleMap = {
|
|
913
|
-
primary: 'text-secondary-text',
|
|
914
|
-
secondary: 'text-white',
|
|
915
|
-
};
|
|
916
|
-
return (jsx("div", { className: `text-sm ${i ? 'mt-4' : ''} ${labelStyleMap[version]}`, children: benefit.description }, String(i)));
|
|
917
|
-
}
|
|
918
|
-
|
|
919
842
|
const blockStyle = {
|
|
920
843
|
primary: 'bg-white',
|
|
921
844
|
secondary: 'bg-primary-main text-white',
|
|
@@ -924,100 +847,22 @@
|
|
|
924
847
|
return (jsxs("section", { className: `relative font-sans text-primary-text bg-white px-4 py-6 overflow-hidden ${className}`, children: [jsxs("div", { className: "flex flex-col items-center mb-5", children: [title ? (jsx(Heading, { headingType: "h3", className: `text-center ${description ? 'mb-2' : 'mb-5'}`, title: title })) : null, description ? (jsx("div", { className: "font-normal text-m-md max-w-[600px] text-center mb-5", children: description })) : null] }), renderCardsLayout(orientation, cards, context)] }));
|
|
925
848
|
});
|
|
926
849
|
function renderCardsLayout(orientation, cards, context) {
|
|
927
|
-
return orientation === 'horizontal' ? (jsx(SwipeListControl, { context: context, children: cards?.map(renderCard
|
|
850
|
+
return orientation === 'horizontal' ? (jsx(SwipeListControl, { context: context, children: cards?.map(renderCard) })) : (jsx("div", { className: "grid gap-[14px]", children: cards?.map(renderCard) }));
|
|
928
851
|
}
|
|
929
|
-
function renderCard
|
|
852
|
+
function renderCard(card, key) {
|
|
930
853
|
return (jsxs("div", { className: `h-full justify-between box-border horizontal-list-item border-solid border rounded-md border-main-stroke p-4 flex flex-col
|
|
931
|
-
${blockStyle[card.version ?? 'primary']}`, children: [jsxs("div", { children: [card.image?.src ? (jsx("div", { className: "flex justify-center", children: jsx(Img, { className: "mb-3.5", image: card.image }) })) : null, card.title ? jsx("h3", { className: `font-medium text-m-title-xs m-0`, children: card.title }) : null, card.description ? renderDescription(card) : null, card.items?.length ? renderItems
|
|
854
|
+
${blockStyle[card.version ?? 'primary']}`, children: [jsxs("div", { children: [card.image?.src ? (jsx("div", { className: "flex justify-center", children: jsx(Img, { className: "mb-3.5", image: card.image }) })) : null, card.title ? jsx("h3", { className: `font-medium text-m-title-xs m-0`, children: card.title }) : null, card.description ? renderDescription(card) : null, card.items?.length ? renderItems(card.items, card.version) : null] }), card?.button?.text ? renderButton$1(card.button) : null] }, key));
|
|
932
855
|
}
|
|
933
|
-
function renderButton$
|
|
856
|
+
function renderButton$1(button) {
|
|
934
857
|
return (jsx(Button, { className: "mt-3", appendLeft: button?.icon && jsx(Icon, { name: button?.icon, width: "24px", height: "24px", asSVG: true }), ...button }));
|
|
935
858
|
}
|
|
936
859
|
function renderDescription(card) {
|
|
937
860
|
return (jsx("div", { className: `text-secondary-text mt-1 text-m-sm ${card.version === 'secondary' ? 'text-white opacity-80' : ''}`, children: card.description }));
|
|
938
861
|
}
|
|
939
|
-
function renderItems$1(items, version = 'primary') {
|
|
940
|
-
return (jsx("section", { className: "mt-3", children: items.map((item, i) => (jsxs("div", { children: [jsx("span", { className: "text-m-md font-medium", children: item.title }), jsx("span", { className: `text-m-sm pl-2 ${version === 'primary' ? 'text-secondary-text' : ''}`, children: item.text })] }, String(i)))) }));
|
|
941
|
-
}
|
|
942
|
-
|
|
943
|
-
const SVG = JSX(({ className, viewBox, fill = 'none', width, height, paths, ...commonOptions }) => {
|
|
944
|
-
return (jsx("svg", { xmlns: "http://www.w3.org/2000/svg", className: className, viewBox: viewBox, fill: fill, width: width, height: height, children: paths.map(({ d, fill, ...options }, i) => (jsx("path", { d: d, fill: fill || 'currentColor', ...commonOptions, ...options }, i))) }));
|
|
945
|
-
});
|
|
946
|
-
|
|
947
|
-
const ARROW_PATHS = [
|
|
948
|
-
{
|
|
949
|
-
d: 'm9 12 4-4-4-4',
|
|
950
|
-
stroke: 'currentColor',
|
|
951
|
-
strokeWidth: '2',
|
|
952
|
-
strokeLinecap: 'round',
|
|
953
|
-
fill: 'none',
|
|
954
|
-
},
|
|
955
|
-
{
|
|
956
|
-
d: 'M2 9a1 1 0 0 1 0-2v2Zm6-2a1 1 0 0 1 0 2V7ZM2 7h6v2H2V7Z',
|
|
957
|
-
},
|
|
958
|
-
];
|
|
959
|
-
const ArrowButton = JSX(({ className, disabled, ...rest }) => (jsx(Button, { rounded: true, className: `shadow-[0_4px_25px_rgba(0,0,0,0.07)] w-12 h-12 min-h-12 max-h-12 flex items-center justify-center ${disabled
|
|
960
|
-
? 'bg-secondary-light text-secondary-text'
|
|
961
|
-
: 'bg-white text-primary-text hover:text-primary-main'} ${className || ''}`, disabled: disabled, ...rest, children: jsx(SVG, { paths: ARROW_PATHS, viewBox: "0 0 16 16", fill: "none", width: "16", height: "16" }) })));
|
|
962
|
-
|
|
963
|
-
const cardVersionMap = {
|
|
964
|
-
primary: 'bg-white text-secondary-text',
|
|
965
|
-
secondary: 'bg-primary-main text-white',
|
|
966
|
-
};
|
|
967
|
-
const galleryLengthForScrollMap = {
|
|
968
|
-
normal: 3,
|
|
969
|
-
mini: 4,
|
|
970
|
-
};
|
|
971
|
-
const cardStyleMap = {
|
|
972
|
-
normal: 'min-w-[364px] w-[364px]',
|
|
973
|
-
mini: 'min-w-[260px] w-[260px]',
|
|
974
|
-
};
|
|
975
|
-
const cardWidthMap = {
|
|
976
|
-
normal: 380,
|
|
977
|
-
mini: 276,
|
|
978
|
-
};
|
|
979
|
-
|
|
980
|
-
const GalleryCardInner = JSX(({ title, description, image, items, button, version }) => {
|
|
981
|
-
const titleStyleClasses = getTitleStyle(version, description, items);
|
|
982
|
-
return (jsxs("div", { className: "h-full flex flex-col justify-between", 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 ? renderButton$1(button) : null] }));
|
|
983
|
-
});
|
|
984
|
-
function renderButton$1(button) {
|
|
985
|
-
return (jsx(Button, { className: "mt-6 w-full", appendLeft: button.icon && jsx(Icon, { name: button.icon, width: "24px", height: "24px", asSVG: true }), ...button }));
|
|
986
|
-
}
|
|
987
|
-
function renderCardTitle(title, className) {
|
|
988
|
-
return jsx("div", { className: `font-medium text-xl m-0 ${className}`, children: title });
|
|
989
|
-
}
|
|
990
862
|
function renderItems(items, version = 'primary') {
|
|
991
|
-
return (jsx(
|
|
992
|
-
}
|
|
993
|
-
function getTitleStyle(version, description, items) {
|
|
994
|
-
return `font-medium text-xl m-0
|
|
995
|
-
${version !== 'secondary' ? 'text-primary-text' : ''}
|
|
996
|
-
${!description && !items?.length ? 'text-center' : ''}
|
|
997
|
-
`;
|
|
998
|
-
}
|
|
999
|
-
|
|
1000
|
-
const GalleryContainer = JSX(({ context, title, description, cards = [], version = 'normal', activeCardIndex }) => {
|
|
1001
|
-
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)) })] }));
|
|
1002
|
-
});
|
|
1003
|
-
function renderCard({ card, version }, i) {
|
|
1004
|
-
return (jsx("section", { className: `box-border border-solid border rounded-md border-main-divider p-7 mx-2 flex flex-col justify-between
|
|
1005
|
-
items-stretch ${cardStyleMap[version]} ${cardVersionMap[card.version ?? 'primary']} w-full col-span-4`, role: "listitem", children: jsx(GalleryCardInner, { ...card }) }, String(i)));
|
|
863
|
+
return (jsx("section", { className: "mt-3", children: items.map((item, i) => (jsxs("div", { children: [jsx("span", { className: "text-m-md font-medium", children: item.title }), jsx("span", { className: `text-m-sm pl-2 ${version === 'primary' ? 'text-secondary-text' : ''}`, children: item.text })] }, String(i)))) }));
|
|
1006
864
|
}
|
|
1007
865
|
|
|
1008
|
-
const GalleryInner = JSX(({ context, cards = [], className = '', version = 'normal', anchor = null, ...rest }) => {
|
|
1009
|
-
const [activeCardIndex, setActiveCardIndex] = context.useState(0);
|
|
1010
|
-
const handleNextClick = () => setActiveCardIndex(activeCardIndex + 1);
|
|
1011
|
-
const handlePrevClick = () => setActiveCardIndex(activeCardIndex - 1);
|
|
1012
|
-
const isGalleryScrollAvailable = cards?.length > galleryLengthForScrollMap[version];
|
|
1013
|
-
const showNextButton = isGalleryScrollAvailable &&
|
|
1014
|
-
cards?.length - activeCardIndex > galleryLengthForScrollMap[version];
|
|
1015
|
-
const showPrevButton = isGalleryScrollAvailable && activeCardIndex > 0;
|
|
1016
|
-
return (jsxs("section", { className: `relative font-sans text-primary-text bg-white p-[50px] overflow-hidden ${className}`, id: anchor, children: [jsx(GalleryContainer, { context: context, cards: cards, version: version, activeCardIndex: activeCardIndex, ...rest }), showPrevButton && (jsx(ArrowButton, { className: "absolute top-1/2 left-8 rotate-180 z-10 mt-[25px]", onClick: handlePrevClick, ariaLabel: "\u041F\u0440\u043E\u043B\u0438\u0441\u0442\u0430\u0442\u044C \u0432\u043B\u0435\u0432\u043E", "data-block-control": "scroll-left" })), showNextButton && (jsx(ArrowButton, { className: "absolute top-1/2 right-8 z-10 mt-[25px]", onClick: handleNextClick, ariaLabel: "\u041F\u0440\u043E\u043B\u0438\u0441\u0442\u0430\u0442\u044C \u0432\u043F\u0440\u0430\u0432\u043E", "data-block-control": "scroll-right" })), jsx("div", { className: "absolute top-0 left-0 bottom-0 w-[84px] bg-opacity-from-white" }), jsx("div", { className: "absolute top-0 right-0 bottom-0 w-[100px] bg-opacity-to-white" })] }));
|
|
1017
|
-
});
|
|
1018
|
-
|
|
1019
|
-
const MiniGallery = JSX((props) => (jsx(GalleryInner, { ...props, version: "mini" })));
|
|
1020
|
-
|
|
1021
866
|
const LinkList = JSX(({ className = '', documents, anchor = null }) => {
|
|
1022
867
|
return (jsx("section", { className: `font-sans bg-white mt-[10px] ${className}`, id: anchor, children: jsx("ul", { className: "flex flex-col text-sm text-secondary-text p-0", children: documents?.length ? renderLinkListItem(documents) : null }) }));
|
|
1023
868
|
});
|
|
@@ -1032,30 +877,25 @@
|
|
|
1032
877
|
Headline,
|
|
1033
878
|
LinkDocs,
|
|
1034
879
|
TextBlock,
|
|
1035
|
-
PictureText,
|
|
1036
880
|
ProductBlock,
|
|
1037
|
-
Tile,
|
|
1038
|
-
ProductTile,
|
|
1039
881
|
Gallery,
|
|
1040
|
-
MiniGallery,
|
|
1041
882
|
LinkList,
|
|
1042
883
|
};
|
|
1043
884
|
|
|
1044
|
-
const renderBlocksList = ({ blocks, context, className, columns
|
|
1045
|
-
const renderBlock$1 = ({ context, columns, className
|
|
885
|
+
const renderBlocksList = ({ blocks, context, className, columns }) => blocks?.length ? blocks.map(renderBlock$1({ context, className, columns })) : null;
|
|
886
|
+
const renderBlock$1 = ({ context, columns, className }) => (block, i) => {
|
|
1046
887
|
const type = block?.blockListType;
|
|
1047
888
|
if (!type || !(type in EmbeddableBlocks)) {
|
|
1048
889
|
return null;
|
|
1049
890
|
}
|
|
1050
891
|
const columnsCountClass = columns === 2 ? 'w-1/2' : '';
|
|
1051
892
|
const EmbeddedBlock = EmbeddableBlocks[type];
|
|
1052
|
-
return (jsx("div", { className: `${className} ${columnsCountClass}`, children: jsx(EmbeddedBlock, { context: context, ...block,
|
|
893
|
+
return (jsx("div", { className: `${className} ${columnsCountClass}`, children: jsx(EmbeddedBlock, { context: context, ...block, className: "!p-0" }) }, `block_${i}`));
|
|
1053
894
|
};
|
|
1054
895
|
|
|
1055
|
-
const AccordionItemInner = JSX(({ blocks, context
|
|
896
|
+
const AccordionItemInner = JSX(({ blocks, context }) => {
|
|
1056
897
|
const className = 'mb-5 last:mb-0 first:mt-2';
|
|
1057
|
-
|
|
1058
|
-
return (jsx("div", { className: "transition-all duration-300 max-h-0 overflow-hidden group-last:last:pb-0", children: renderBlocksList({ context, className, columns, blocks, version }) }));
|
|
898
|
+
return (jsx("div", { className: "transition-all duration-300 max-h-0 overflow-hidden group-last:last:pb-0", children: renderBlocksList({ context, className, blocks }) }));
|
|
1059
899
|
});
|
|
1060
900
|
|
|
1061
901
|
const useActiveHandler = ({ context, blocks, initialState = false }) => {
|
|
@@ -1076,15 +916,18 @@
|
|
|
1076
916
|
return { isActive, hasContent, icon, handleToggle };
|
|
1077
917
|
};
|
|
1078
918
|
|
|
1079
|
-
const AccordionItem = JSX(({ label, blocks, bordered, context }) => {
|
|
919
|
+
const AccordionItem = JSX(({ label, labelIcon, blocks, bordered, context }) => {
|
|
1080
920
|
const { hasContent, icon, handleToggle } = useActiveHandler({
|
|
1081
921
|
context,
|
|
1082
922
|
blocks,
|
|
1083
923
|
});
|
|
1084
|
-
return (jsxs("li", { className: `${bordered
|
|
924
|
+
return (jsxs("li", { className: `${borderedLiClass(bordered)} border-solid border-main-divider`, children: [jsxs("button", { className: `border-none bg-transparent flex justify-between text-left w-full font-sans text-primary-text
|
|
1085
925
|
${bordered ? '' : 'py-[14px] px-0'}
|
|
1086
|
-
${hasContent ? 'group cursor-pointer' : ''}`, onClick: handleToggle, children: [
|
|
926
|
+
${hasContent ? 'group cursor-pointer' : ''}`, onClick: handleToggle, children: [jsxs("span", { className: `text-m-title-xs pr-2.5 font-medium flex ${hasContent ? 'group-hover:text-primary-main' : ''}`, children: [labelIcon ? (jsx(Icon, { name: labelIcon, width: "24", height: "24", asSVG: true, className: "mr-3" })) : null, label] }), hasContent ? jsx(Icon, { name: icon, width: "24", height: "24", asSVG: true }) : null] }), hasContent ? jsx(AccordionItemInner, { blocks: blocks, context: context }) : null] }));
|
|
1087
927
|
});
|
|
928
|
+
function borderedLiClass(bordered) {
|
|
929
|
+
return bordered ? 'border p-4 rounded mb-4' : 'border-0 border-b last:border-b-0';
|
|
930
|
+
}
|
|
1088
931
|
|
|
1089
932
|
const Accordion = JSX(({ title, description, accordionItems, context, className = '', bordered }) => {
|
|
1090
933
|
return (jsxs("section", { className: `py-6 px-4 font-sans bg-white text-primary-text ${className}`, children: [title ? jsx(Heading, { headingType: "h3", className: "mb-2 text-center", title: title }) : null, description ? jsx("div", { className: "mb-5 text-m-md text-center", children: description }) : null, accordionItems?.length ? (jsx("ul", { className: "list-none m-0 p-0", children: accordionItems.map((item, i) => (jsx(AccordionItem, { ...item, context: context, bordered: bordered }, `AccordionItem${i}`))) })) : null] }));
|
|
@@ -1179,6 +1022,25 @@
|
|
|
1179
1022
|
}
|
|
1180
1023
|
const EXCHANGE_RATES_URL = '/api/v1/exchangerates.json';
|
|
1181
1024
|
|
|
1025
|
+
const getColSpan = (className) => {
|
|
1026
|
+
const colSpanPrefix = 'col-span-';
|
|
1027
|
+
const colSpanStr = className.split(/\s+/).find((_) => _.startsWith(colSpanPrefix));
|
|
1028
|
+
return colSpanStr ? parseInt(colSpanStr.substring(colSpanPrefix.length), 10) : 12;
|
|
1029
|
+
};
|
|
1030
|
+
|
|
1031
|
+
function getTileHeadingType(className = '') {
|
|
1032
|
+
const colSpan = getColSpan(className);
|
|
1033
|
+
if (colSpan <= 4) {
|
|
1034
|
+
return 'h4';
|
|
1035
|
+
}
|
|
1036
|
+
else if (colSpan <= 8) {
|
|
1037
|
+
return 'h3';
|
|
1038
|
+
}
|
|
1039
|
+
else {
|
|
1040
|
+
return 'h2';
|
|
1041
|
+
}
|
|
1042
|
+
}
|
|
1043
|
+
|
|
1182
1044
|
const currencyNumberFormat = new Intl.NumberFormat('ru', { style: 'currency', currency: 'RUB' });
|
|
1183
1045
|
const formatCurrency = (value) => (value ? currencyNumberFormat.format(value) : '');
|
|
1184
1046
|
|
|
@@ -1242,6 +1104,10 @@
|
|
|
1242
1104
|
return (jsx("section", { className: `bg-white text-primary-text font-sans p-9 box-border ${className}`, id: anchor, children: jsx(BaseTile, { context: context, title: jsx(Heading, { headingType: getTileHeadingType(className), title: title, className: "whitespace-pre-wrap" }), children: jsxs("div", { className: "flex", children: [jsxs("div", { className: "mr-[43px] pt-4", children: [exchangeCurrencyItems ? (jsx(CurrencyTable, { className: "mb-[31px]", exchangeCurrencyItems: exchangeCurrencyItems })) : null, jsx(CurrentLocation, { ...DEFAULT_LOCATION })] }), exchangeCurrencyItems?.length ? (jsx(ExchangeCurrencyCalculator, { className: "grow", exchangeCurrencyItems: exchangeCurrencyItems, codes: EXCHANGE_CODES })) : null] }) }) }));
|
|
1243
1105
|
});
|
|
1244
1106
|
|
|
1107
|
+
const SVG = JSX(({ className, viewBox, fill = 'none', width, height, paths, ...commonOptions }) => {
|
|
1108
|
+
return (jsx("svg", { xmlns: "http://www.w3.org/2000/svg", className: className, viewBox: viewBox, fill: fill, width: width, height: height, children: paths.map(({ d, fill, ...options }, i) => (jsx("path", { d: d, fill: fill || 'currentColor', ...commonOptions, ...options }, i))) }));
|
|
1109
|
+
});
|
|
1110
|
+
|
|
1245
1111
|
const LOGO_PATHS = [
|
|
1246
1112
|
'm13.72 25.51 4.42-4.33v-2.95l-4.42 4.32v2.96Zm0-10.98 4.42-4.35V7.41l-4.42 4.31v2.8Zm0 3.63 4.42-4.33v-2.78l-4.42 4.32v2.8ZM12.46 7.44l-.6-.56V0h-.66v6.22l-.58-.57V0h-.67v5l-.59-.58V0H8.7v6.56l4.44 4.33V0h-.67v7.44Zm1.26 14.35 4.42-4.33v-2.78L13.72 19v2.8Zm-5.03-.61 4.44 4.33v-2.96l-4.44-4.32v2.95Zm8.79-16.76-.59.58V0h-.66v5.66l-.6.56V0h-.66v6.87l-.58.57V0h-.67v10.9l4.42-4.34V0h-.66v4.42Zm-8.79 5.76 4.44 4.35v-2.8L8.69 7.4v2.77Zm0 3.65 4.44 4.33v-2.8l-4.44-4.3v2.77Zm0 3.63 4.44 4.33V19l-4.44-4.31v2.78Zm26.37 2.29H24.3a2.25 2.25 0 0 0 .36-1.22 2.32 2.32 0 0 0-2.33-2.31 2.32 2.32 0 0 0-2.31 2.31c0 .5.16.96.43 1.34a.74.74 0 0 0-.33.61c0 .26.14.49.33.62a2.32 2.32 0 0 0-.43 1.34 2.31 2.31 0 0 0 2.31 2.31 2.32 2.32 0 0 0 2.33-2.31c0-.45-.13-.87-.36-1.22h8.01v.49h-.8v.68h.8v.7h-.8v1.3h.8v-.58h1.17v.58h.79v-1.3h-.79v-.7h.79v-.68h-.79v-.5h1.58a.56.56 0 0 0 .56-.56v-.34a.57.57 0 0 0-.56-.56Zm-11.53 2.7a1.2 1.2 0 0 1-2.4 0c0-.24.08-.47.2-.66l.34-.56a.97.97 0 0 1-.34-.75c0-.3.13-.56.33-.74l-.32-.56a1.13 1.13 0 0 1-.2-.66 1.2 1.2 0 0 1 2.4 0c0 .49-.56 1.65-.56 1.65v.62c-.01.01.55 1.17.55 1.66ZM4.67 18.34v2.89c0 2.75 1.2 4.53 1.9 5.21l4.58 4.5c1.28 1.25 1.5 1.66 1.79 2.37v-3.2c0-2.84-1.44-3.94-2.19-4.67-1.73-1.68-2.89-2.8-3.82-3.73a8.98 8.98 0 0 1-2.26-3.37Zm6.08 14.24c-1.73-1.7-2.89-2.8-3.82-3.73a10 10 0 0 1-2.25-2.98v2.49a7.87 7.87 0 0 0 1.89 5.24l4.58 4.47c1.28 1.25 1.5 1.85 1.79 2.55v-3.37c0-2.85-1.45-3.95-2.19-4.67Z',
|
|
1247
1113
|
'M19.88 5.34c-.32 0-.64 0-.96.02V6.7a18.5 18.5 0 1 1 .95 36.94A18.5 18.5 0 0 1 1.35 25.17c0-5.67 2.55-10.73 6.58-14.13V9.32A19.78 19.78 0 0 0 0 25.17C0 36.12 8.9 45 19.88 45a19.85 19.85 0 0 0 19.86-19.83c0-10.95-8.9-19.83-19.87-19.83Z',
|
|
@@ -1312,7 +1178,7 @@
|
|
|
1312
1178
|
const { icon, width, height, label } = ICONS_MAP.find(({ origins }) => origins.some((_) => href?.includes(_))) || {};
|
|
1313
1179
|
if (!icon)
|
|
1314
1180
|
return null;
|
|
1315
|
-
return (jsx("a", { className: "flex items-center justify-center border border-solid border-main-divider rounded-full no-underline outline-none w-[
|
|
1181
|
+
return (jsx("a", { className: "flex items-center justify-center border border-solid border-main-divider rounded-full no-underline outline-none w-[40px] h-[40px] box-border hover:text-primary-main", href: href, "aria-label": label, target: "_blank", rel: "noopener noreferrer", children: Icon && (jsx(Icon, { name: icon, width: width, height: height, asSVG: true, className: "block", color: "none" })) }));
|
|
1316
1182
|
});
|
|
1317
1183
|
|
|
1318
1184
|
const SocialMedia = JSX(({ className, media, context }) => {
|
|
@@ -1444,6 +1310,32 @@
|
|
|
1444
1310
|
});
|
|
1445
1311
|
const renderSubItem = (item, i) => (jsx(HeaderItem, { className: "mr-8 whitespace-nowrap text-sm", ...item }, String(i)));
|
|
1446
1312
|
|
|
1313
|
+
function getTileMinHeight(className = '') {
|
|
1314
|
+
const colSpan = getColSpan(className);
|
|
1315
|
+
if (colSpan <= 6) {
|
|
1316
|
+
return 'min-h-[300px]';
|
|
1317
|
+
}
|
|
1318
|
+
else if (colSpan <= 8) {
|
|
1319
|
+
return 'min-h-[320px]';
|
|
1320
|
+
}
|
|
1321
|
+
else {
|
|
1322
|
+
return 'min-h-[360px]';
|
|
1323
|
+
}
|
|
1324
|
+
}
|
|
1325
|
+
|
|
1326
|
+
function getTileRightPadding(className = '') {
|
|
1327
|
+
const colSpan = getColSpan(className);
|
|
1328
|
+
if (colSpan <= 6) {
|
|
1329
|
+
return 'pr-9';
|
|
1330
|
+
}
|
|
1331
|
+
else if (colSpan <= 8) {
|
|
1332
|
+
return 'pr-[4.75rem]';
|
|
1333
|
+
}
|
|
1334
|
+
else {
|
|
1335
|
+
return 'pr-[9.4rem]';
|
|
1336
|
+
}
|
|
1337
|
+
}
|
|
1338
|
+
|
|
1447
1339
|
const GOLDEN_RATIO = 1.618;
|
|
1448
1340
|
const Placeholder = JSX(({ className, context, title, description = 'Блок в разработке...', anchor = null }) => {
|
|
1449
1341
|
return (jsx("section", { className: `bg-white text-primary-text font-sans p-9 box-border ${className} ${getTileRightPadding(className)} ${getTileMinHeight(className)} `, id: anchor, 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() })] }) }));
|
|
@@ -1463,6 +1355,14 @@
|
|
|
1463
1355
|
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)))) }) }));
|
|
1464
1356
|
});
|
|
1465
1357
|
|
|
1358
|
+
const STEPS_SIZE_MAP = {
|
|
1359
|
+
normal: 'h-[70px] w-[70px] min-w-[70px] min-h-[70px]',
|
|
1360
|
+
small: 'h-[50px] w-[50px] min-w-[50px] min-h-[50px]',
|
|
1361
|
+
};
|
|
1362
|
+
const STEPS_TILE_DESCRIPTION_HEIGHT_MAP = {
|
|
1363
|
+
normal: 'min-h-[70px]',
|
|
1364
|
+
small: 'min-h-[50px]',
|
|
1365
|
+
};
|
|
1466
1366
|
const STEPS_BLOCK_STYLE_MAPS = {
|
|
1467
1367
|
primary: {
|
|
1468
1368
|
background: 'bg-white',
|
|
@@ -1490,14 +1390,12 @@
|
|
|
1490
1390
|
const isLastStep = length - 1 === i;
|
|
1491
1391
|
const margin = size === 'normal' ? 'ml-[34px]' : 'ml-[24px]';
|
|
1492
1392
|
const style = styleMaps(version);
|
|
1493
|
-
return (jsx("div", { children: jsxs("div", { className: "flex flex-row text-center relative", children: [jsxs("div", { className: "overflow-hidden", children: [renderIconArea(params), !isLastStep && (jsx("div", { className: `min-h-8 h-full w-[2px] ${style.iconConnector} ${margin}` }))] }), jsxs("div", { className:
|
|
1393
|
+
return (jsx("div", { children: jsxs("div", { className: "flex flex-row text-center relative", children: [jsxs("div", { className: "overflow-hidden", children: [renderIconArea(params), !isLastStep && (jsx("div", { className: `min-h-8 h-full w-[2px] ${style.iconConnector} ${margin}` }))] }), jsxs("div", { className: `flex flex-col justify-center h-fit ${STEPS_TILE_DESCRIPTION_HEIGHT_MAP[size]}`, 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 ${style.description} text-left ${step.label ? 'mt-1' : ''}`, children: step.description }))] })] }, String(i)) }, String(i)));
|
|
1494
1394
|
};
|
|
1495
1395
|
const renderIconArea = (params) => {
|
|
1496
1396
|
const { step, size, i, version } = params;
|
|
1497
1397
|
const style = styleMaps(version);
|
|
1498
|
-
const iconAreaSize = size
|
|
1499
|
-
? 'h-[70px] w-[70px] min-w-[70px] min-h-[70px]'
|
|
1500
|
-
: 'h-[50px] w-[50px] min-w-[50px] min-h-[50px]';
|
|
1398
|
+
const iconAreaSize = STEPS_SIZE_MAP[size];
|
|
1501
1399
|
const iconSize = size === 'normal' ? '38' : '27';
|
|
1502
1400
|
const iconTextSize = size === 'normal' ? 'text-m-title' : 'text-m-title-xs';
|
|
1503
1401
|
return (jsx("div", { className: `${iconAreaSize} ${style.iconBackground} rounded-full z-10 mr-3 flex justify-center content-center`, children: jsx("span", { className: `font-medium flex self-center ${style.title} ${iconTextSize}`, children: (step.icon && jsx(Icon, { name: step.icon, width: iconSize, height: iconSize, asSVG: true })) || i + 1 }) }));
|