@redneckz/wildless-cms-uni-blocks 0.2.91 → 0.2.94
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bundle/blocks.schema.json +1 -1
- package/bundle/bundle.umd.js +156 -80
- package/bundle/bundle.umd.min.js +1 -1
- package/dist/api/LikeAPI.js +1 -0
- package/dist/api/LikeAPI.js.map +1 -1
- package/dist/components/Accordion/AccordionContent.d.ts +38 -14
- package/dist/components/Accordion/AccordionItem.js +8 -6
- package/dist/components/Accordion/AccordionItem.js.map +1 -1
- package/dist/components/BaseTile/BaseTile.js +1 -1
- package/dist/components/BaseTile/BaseTile.js.map +1 -1
- package/dist/components/BlockContent.d.ts +2 -1
- package/dist/components/Blocks.d.ts +1 -0
- package/dist/components/Blocks.js +2 -0
- package/dist/components/Blocks.js.map +1 -1
- package/dist/components/ComparisonTable/ComparisonTable.js +12 -10
- package/dist/components/ComparisonTable/ComparisonTable.js.map +1 -1
- package/dist/components/ComparisonTable/ComparisonTableContent.d.ts +0 -18
- package/dist/components/ComparisonTable/HeaderCell.js +1 -1
- package/dist/components/ComparisonTable/HeaderCell.js.map +1 -1
- package/dist/components/ComparisonTable/TableCarouselContainer.d.ts +3 -0
- package/dist/components/ComparisonTable/TableCarouselContainer.js +5 -2
- package/dist/components/ComparisonTable/TableCarouselContainer.js.map +1 -1
- package/dist/components/ComparisonTable/TableRow.js +1 -1
- package/dist/components/ComparisonTable/TableRow.js.map +1 -1
- package/dist/components/ContentPage/ContentPage.d.ts +9 -1
- package/dist/components/ContentPage/ContentPage.js +20 -17
- package/dist/components/ContentPage/ContentPage.js.map +1 -1
- package/dist/components/ContentPage/ContentPageHead.d.ts +1 -1
- package/dist/components/ContentPage/toMobilePage.js +13 -2
- package/dist/components/ContentPage/toMobilePage.js.map +1 -1
- package/dist/components/CreditCalculator/CreditCalculator.js +1 -1
- package/dist/components/CreditCalculator/CreditCalculator.js.map +1 -1
- package/dist/components/Footer/Contacts.js +1 -1
- package/dist/components/Footer/Contacts.js.map +1 -1
- package/dist/components/Footer/FooterContent.d.ts +1 -2
- package/dist/components/Footer/HorizontalNavigation.js +1 -1
- package/dist/components/Footer/SocialMedia.js +1 -2
- package/dist/components/Footer/SocialMedia.js.map +1 -1
- package/dist/components/Gallery/GalleryInner.js +2 -2
- package/dist/components/Gallery/GalleryInner.js.map +1 -1
- package/dist/components/Header/Header.js +3 -3
- package/dist/components/Header/Header.js.map +1 -1
- package/dist/components/LinkDocs/LinkDocs.js +5 -5
- package/dist/components/LinkDocs/LinkDocs.js.map +1 -1
- package/dist/components/MiniGallery/MiniGalleryContent.d.ts +1 -2
- package/dist/components/MobileBlocks.js +0 -3
- package/dist/components/MobileBlocks.js.map +1 -1
- package/dist/components/PictureText/PictureTextContent.d.ts +1 -3
- package/dist/components/Placeholder/Placeholder.js.map +1 -1
- package/dist/components/ProductBlock/ProductBlock.js +1 -1
- package/dist/components/ProductBlock/ProductBlock.js.map +1 -1
- package/dist/components/ProductBlock/ProductBlock.mobile.js +3 -1
- package/dist/components/ProductBlock/ProductBlock.mobile.js.map +1 -1
- package/dist/components/ProductBlock/ProductBlockInner.js +2 -5
- package/dist/components/ProductBlock/ProductBlockInner.js.map +1 -1
- package/dist/components/ProductGallery/ProductGallery.js +2 -2
- package/dist/components/ProductGallery/ProductGallery.js.map +1 -1
- package/dist/components/PromoTile/PromoTile.d.ts +1 -1
- package/dist/components/PromoTile/PromoTile.js +1 -1
- package/dist/components/PromoTile/PromoTile.js.map +1 -1
- package/dist/components/TariffsTable/TariffsTable.d.ts +5 -0
- package/dist/components/TariffsTable/TariffsTable.js +25 -0
- package/dist/components/TariffsTable/TariffsTable.js.map +1 -0
- package/dist/components/TariffsTable/TariffsTableCell.d.ts +6 -0
- package/dist/components/TariffsTable/TariffsTableCell.js +18 -0
- package/dist/components/TariffsTable/TariffsTableCell.js.map +1 -0
- package/dist/components/TariffsTable/TariffsTableContent.d.ts +55 -0
- package/dist/components/TariffsTable/TariffsTableContent.js +2 -0
- package/dist/components/TariffsTable/TariffsTableContent.js.map +1 -0
- package/dist/components/TariffsTable/TariffsTableRow.d.ts +8 -0
- package/dist/components/TariffsTable/TariffsTableRow.js +13 -0
- package/dist/components/TariffsTable/TariffsTableRow.js.map +1 -0
- package/dist/components/TariffsTable/constants.d.ts +4 -0
- package/dist/components/TariffsTable/constants.js +7 -0
- package/dist/components/TariffsTable/constants.js.map +1 -0
- package/dist/components/TextBlock/TextBlock.d.ts +1 -1
- package/dist/components/TextBlock/TextBlock.js +1 -1
- package/dist/components/TextBlock/TextBlock.js.map +1 -1
- package/dist/components/TextBlock/TextBlockContent.d.ts +1 -2
- package/dist/components/Tile/Tile.d.ts +1 -1
- package/dist/components/Tile/Tile.js +14 -2
- package/dist/components/Tile/Tile.js.map +1 -1
- package/dist/content-page-repository/ContentPageRepository.js +1 -0
- package/dist/content-page-repository/ContentPageRepository.js.map +1 -1
- package/dist/hooks/useComparisonTableScroll.d.ts +12 -0
- package/dist/hooks/useComparisonTableScroll.js +12 -0
- package/dist/hooks/useComparisonTableScroll.js.map +1 -0
- package/dist/hooks/useLink.js +1 -1
- package/dist/hooks/useLink.js.map +1 -1
- package/dist/model/TableVersion.d.ts +1 -0
- package/dist/model/TableVersion.js +2 -0
- package/dist/model/TableVersion.js.map +1 -0
- package/dist/types.d.ts +8 -0
- package/dist/ui-kit/BlockItem/BlockItem.d.ts +1 -9
- package/dist/ui-kit/BlockItem/BlockItem.js +5 -5
- package/dist/ui-kit/BlockItem/BlockItem.js.map +1 -1
- package/dist/ui-kit/BlockItem/BlockItemProps.d.ts +20 -0
- package/dist/ui-kit/BlockItem/BlockItemProps.js +2 -0
- package/dist/ui-kit/BlockItem/BlockItemProps.js.map +1 -0
- package/dist/ui-kit/Icon/IconProps.d.ts +57 -25
- package/dist/ui-kit/Icon/IconProps.js +39 -23
- package/dist/ui-kit/Icon/IconProps.js.map +1 -1
- package/dist/ui-kit/InputRange/InputRange.js +1 -1
- package/dist/ui-kit/InputRange/InputRange.js.map +1 -1
- package/dist/ui-kit/SearchBar.js +2 -1
- package/dist/ui-kit/SearchBar.js.map +1 -1
- package/lib/api/LikeAPI.js +1 -0
- package/lib/api/LikeAPI.js.map +1 -1
- package/lib/common.css +1 -1
- package/lib/components/Accordion/Accordion.fixture.d.ts +1 -4
- package/lib/components/Accordion/AccordionContent.d.ts +38 -14
- package/lib/components/Accordion/AccordionItem.js +8 -6
- package/lib/components/Accordion/AccordionItem.js.map +1 -1
- package/lib/components/BaseTile/BaseTile.js +1 -1
- package/lib/components/BaseTile/BaseTile.js.map +1 -1
- package/lib/components/BlockContent.d.ts +2 -1
- package/lib/components/Blocks.d.ts +1 -0
- package/lib/components/Blocks.js +2 -0
- package/lib/components/Blocks.js.map +1 -1
- package/lib/components/ComparisonTable/ComparisonTable.js +12 -10
- package/lib/components/ComparisonTable/ComparisonTable.js.map +1 -1
- package/lib/components/ComparisonTable/ComparisonTableContent.d.ts +0 -18
- package/lib/components/ComparisonTable/HeaderCell.js +1 -1
- package/lib/components/ComparisonTable/HeaderCell.js.map +1 -1
- package/lib/components/ComparisonTable/TableCarouselContainer.d.ts +3 -0
- package/lib/components/ComparisonTable/TableCarouselContainer.js +5 -2
- package/lib/components/ComparisonTable/TableCarouselContainer.js.map +1 -1
- package/lib/components/ComparisonTable/TableRow.js +2 -2
- package/lib/components/ComparisonTable/TableRow.js.map +1 -1
- package/lib/components/ContentPage/ContentPage.d.ts +9 -1
- package/lib/components/ContentPage/ContentPage.js +20 -17
- package/lib/components/ContentPage/ContentPage.js.map +1 -1
- package/lib/components/ContentPage/ContentPageHead.d.ts +1 -1
- package/lib/components/ContentPage/toMobilePage.js +13 -2
- package/lib/components/ContentPage/toMobilePage.js.map +1 -1
- package/lib/components/CreditCalculator/CreditCalculator.js +1 -1
- package/lib/components/CreditCalculator/CreditCalculator.js.map +1 -1
- package/lib/components/Footer/Contacts.js +1 -1
- package/lib/components/Footer/Contacts.js.map +1 -1
- package/lib/components/Footer/FooterContent.d.ts +1 -2
- package/lib/components/Footer/HorizontalNavigation.js +1 -1
- package/lib/components/Footer/SocialMedia.js +1 -2
- package/lib/components/Footer/SocialMedia.js.map +1 -1
- package/lib/components/Gallery/GalleryInner.js +2 -2
- package/lib/components/Gallery/GalleryInner.js.map +1 -1
- package/lib/components/Header/Header.js +3 -3
- package/lib/components/Header/Header.js.map +1 -1
- package/lib/components/Headline/Headline.fixture.d.ts +3 -2
- package/lib/components/LinkDocs/LinkDocs.fixture.d.ts +7 -7
- package/lib/components/LinkDocs/LinkDocs.js +5 -5
- package/lib/components/LinkDocs/LinkDocs.js.map +1 -1
- package/lib/components/MiniGallery/MiniGalleryContent.d.ts +1 -2
- package/lib/components/MobileBlocks.js +0 -3
- package/lib/components/MobileBlocks.js.map +1 -1
- package/lib/components/PictureText/PictureText.fixture.d.ts +2 -0
- package/lib/components/PictureText/PictureTextContent.d.ts +1 -3
- package/lib/components/Placeholder/Placeholder.js.map +1 -1
- package/lib/components/ProductBlock/ProductBlock.js +1 -1
- package/lib/components/ProductBlock/ProductBlock.js.map +1 -1
- package/lib/components/ProductBlock/ProductBlock.mobile.js +3 -1
- package/lib/components/ProductBlock/ProductBlock.mobile.js.map +1 -1
- package/lib/components/ProductBlock/ProductBlockInner.js +2 -5
- package/lib/components/ProductBlock/ProductBlockInner.js.map +1 -1
- package/lib/components/ProductGallery/ProductGallery.js +2 -2
- package/lib/components/ProductGallery/ProductGallery.js.map +1 -1
- package/lib/components/PromoTile/PromoTile.d.ts +1 -1
- package/lib/components/PromoTile/PromoTile.js +1 -1
- package/lib/components/PromoTile/PromoTile.js.map +1 -1
- package/lib/components/TariffsTable/TariffsTable.d.ts +5 -0
- package/lib/components/TariffsTable/TariffsTable.fixture.d.ts +7 -0
- package/lib/components/TariffsTable/TariffsTable.js +23 -0
- package/lib/components/TariffsTable/TariffsTable.js.map +1 -0
- package/lib/components/TariffsTable/TariffsTableCell.d.ts +6 -0
- package/lib/components/TariffsTable/TariffsTableCell.js +16 -0
- package/lib/components/TariffsTable/TariffsTableCell.js.map +1 -0
- package/lib/components/TariffsTable/TariffsTableContent.d.ts +55 -0
- package/lib/components/TariffsTable/TariffsTableContent.js +2 -0
- package/lib/components/TariffsTable/TariffsTableContent.js.map +1 -0
- package/lib/components/TariffsTable/TariffsTableRow.d.ts +8 -0
- package/lib/components/TariffsTable/TariffsTableRow.js +11 -0
- package/lib/components/TariffsTable/TariffsTableRow.js.map +1 -0
- package/lib/components/TariffsTable/constants.d.ts +4 -0
- package/lib/components/TariffsTable/constants.js +5 -0
- package/lib/components/TariffsTable/constants.js.map +1 -0
- package/lib/components/TextBlock/TextBlock.d.ts +1 -1
- package/lib/components/TextBlock/TextBlock.fixture.d.ts +2 -0
- package/lib/components/TextBlock/TextBlock.js +1 -1
- package/lib/components/TextBlock/TextBlock.js.map +1 -1
- package/lib/components/TextBlock/TextBlockContent.d.ts +1 -2
- package/lib/components/Tile/Tile.d.ts +1 -1
- package/lib/components/Tile/Tile.js +14 -2
- package/lib/components/Tile/Tile.js.map +1 -1
- package/lib/content-page-repository/ContentPageRepository.js +1 -0
- package/lib/content-page-repository/ContentPageRepository.js.map +1 -1
- package/lib/hooks/useComparisonTableScroll.d.ts +12 -0
- package/lib/hooks/useComparisonTableScroll.js +9 -0
- package/lib/hooks/useComparisonTableScroll.js.map +1 -0
- package/lib/hooks/useLink.js +1 -1
- package/lib/hooks/useLink.js.map +1 -1
- package/lib/model/TableVersion.d.ts +1 -0
- package/lib/model/TableVersion.js +2 -0
- package/lib/model/TableVersion.js.map +1 -0
- package/lib/types.d.ts +8 -0
- package/lib/ui-kit/BlockItem/BlockItem.d.ts +1 -9
- package/lib/ui-kit/BlockItem/BlockItem.fixture.d.ts +6 -1
- package/lib/ui-kit/BlockItem/BlockItem.js +5 -5
- package/lib/ui-kit/BlockItem/BlockItem.js.map +1 -1
- package/lib/ui-kit/BlockItem/BlockItemProps.d.ts +20 -0
- package/lib/ui-kit/BlockItem/BlockItemProps.js +2 -0
- package/lib/ui-kit/BlockItem/BlockItemProps.js.map +1 -0
- package/lib/ui-kit/Icon/IconProps.d.ts +57 -25
- package/lib/ui-kit/Icon/IconProps.js +39 -23
- package/lib/ui-kit/Icon/IconProps.js.map +1 -1
- package/lib/ui-kit/InputRange/InputRange.js +1 -1
- package/lib/ui-kit/InputRange/InputRange.js.map +1 -1
- package/lib/ui-kit/SearchBar.js +2 -1
- package/lib/ui-kit/SearchBar.js.map +1 -1
- package/package.json +19 -9
- package/src/api/LikeAPI.ts +1 -0
- package/src/components/Accordion/Accordion.example.json +18 -42
- package/src/components/Accordion/Accordion.fixture.tsx +29 -119
- package/src/components/Accordion/AccordionContent.ts +47 -18
- package/src/components/Accordion/AccordionItem.tsx +13 -9
- package/src/components/BaseTile/BaseTile.tsx +6 -3
- package/src/components/BlockContent.ts +2 -0
- package/src/components/Blocks.ts +2 -0
- package/src/components/ComparisonTable/ComparisonTable.tsx +17 -14
- package/src/components/ComparisonTable/ComparisonTableContent.ts +0 -19
- package/src/components/ComparisonTable/HeaderCell.tsx +3 -3
- package/src/components/ComparisonTable/TableCarouselContainer.tsx +11 -4
- package/src/components/ComparisonTable/TableRow.tsx +2 -2
- package/src/components/ContentPage/ContentPage.fixture.tsx +3 -3
- package/src/components/ContentPage/ContentPage.page.json +426 -22
- package/src/components/ContentPage/ContentPage.tsx +71 -36
- package/src/components/ContentPage/ContentPageHead.tsx +1 -1
- package/src/components/ContentPage/toMobilePage.ts +19 -2
- package/src/components/CreditCalculator/CreditCalculator.tsx +1 -1
- package/src/components/Footer/Contacts.tsx +1 -1
- package/src/components/Footer/FooterContent.ts +1 -1
- package/src/components/Footer/HorizontalNavigation.tsx +1 -1
- package/src/components/Footer/SocialMedia.tsx +5 -6
- package/src/components/Gallery/GalleryInner.tsx +2 -1
- package/src/components/Header/Header.tsx +14 -12
- package/src/components/Headline/Headline.fixture.tsx +11 -34
- package/src/components/LinkDocs/LinkDocs.example.json +26 -0
- package/src/components/LinkDocs/LinkDocs.fixture.tsx +13 -13
- package/src/components/LinkDocs/LinkDocs.tsx +9 -8
- package/src/components/MiniGallery/MiniGalleryContent.ts +1 -1
- package/src/components/MobileBlocks.ts +0 -3
- package/src/components/PictureText/PictureText.fixture.tsx +20 -20
- package/src/components/PictureText/PictureTextContent.ts +1 -3
- package/src/components/Placeholder/Placeholder.tsx +2 -2
- package/src/components/ProductBlock/ProductBlock.fixture.tsx +1 -0
- package/src/components/ProductBlock/ProductBlock.mobile.tsx +1 -0
- package/src/components/ProductBlock/ProductBlock.tsx +3 -1
- package/src/components/ProductBlock/ProductBlockInner.tsx +9 -12
- package/src/components/ProductGallery/ProductGallery.example.json +1 -1
- package/src/components/ProductGallery/ProductGallery.fixture.tsx +7 -13
- package/src/components/ProductGallery/ProductGallery.tsx +7 -5
- package/src/components/PromoTile/PromoTile.tsx +3 -3
- package/src/components/TariffsTable/TariffsTable.example.json +87 -0
- package/src/components/TariffsTable/TariffsTable.fixture.tsx +195 -0
- package/src/components/TariffsTable/TariffsTable.tsx +74 -0
- package/src/components/TariffsTable/TariffsTableCell.tsx +64 -0
- package/src/components/TariffsTable/TariffsTableContent.ts +61 -0
- package/src/components/TariffsTable/TariffsTableRow.tsx +46 -0
- package/src/components/TariffsTable/constants.ts +4 -0
- package/src/components/TextBlock/TextBlock.example.json +9 -2
- package/src/components/TextBlock/TextBlock.fixture.tsx +20 -64
- package/src/components/TextBlock/TextBlock.tsx +2 -2
- package/src/components/TextBlock/TextBlockContent.ts +1 -2
- package/src/components/Tile/Tile.example.json +5 -2
- package/src/components/Tile/Tile.tsx +16 -5
- package/src/content-page-repository/ContentPageRepository.ts +1 -0
- package/src/hooks/useComparisonTableScroll.ts +21 -0
- package/src/hooks/useLink.ts +1 -1
- package/src/model/TableVersion.ts +1 -0
- package/src/types.ts +11 -1
- package/src/ui-kit/BlockItem/BlockItem.fixture.tsx +8 -1
- package/src/ui-kit/BlockItem/BlockItem.tsx +7 -18
- package/src/ui-kit/BlockItem/BlockItemProps.ts +22 -0
- package/src/ui-kit/Icon/IconProps.ts +34 -2
- package/src/ui-kit/InputRange/InputRange.tsx +2 -2
- package/src/ui-kit/SearchBar.tsx +16 -6
package/bundle/bundle.umd.js
CHANGED
|
@@ -71,6 +71,7 @@
|
|
|
71
71
|
|
|
72
72
|
const AUTH_PREFIX = 'guest';
|
|
73
73
|
const STORAGE_KEY = 'likesToken';
|
|
74
|
+
// eslint-disable-next-line max-lines-per-function
|
|
74
75
|
function LikeAPI(projectId, baseURL = '') {
|
|
75
76
|
async function getLikeCount(...nodeIds) {
|
|
76
77
|
if (!nodeIds.length) {
|
|
@@ -283,7 +284,7 @@
|
|
|
283
284
|
toRelativeHref: toRelativeHref
|
|
284
285
|
});
|
|
285
286
|
|
|
286
|
-
const defaultHandlerDecorator = (handler
|
|
287
|
+
const defaultHandlerDecorator = (handler) => handler;
|
|
287
288
|
function useLink({ router, handlerDecorator = defaultHandlerDecorator, }, link) {
|
|
288
289
|
const href = adjustHref(link.href, router);
|
|
289
290
|
return {
|
|
@@ -302,15 +303,15 @@
|
|
|
302
303
|
}
|
|
303
304
|
|
|
304
305
|
const listStyleMap = {
|
|
305
|
-
primary: 'bg-primary-main',
|
|
306
|
-
secondary: 'bg-
|
|
306
|
+
primary: 'bg-primary-main w-[8px] h-[8px] min-w-[8px] min-h-[8px] mt-2 rounded-full',
|
|
307
|
+
secondary: 'bg-secondary-text w-[6px] h-[6px] min-w-[6px] min-h-[6px] mt-2.5 rounded-full',
|
|
307
308
|
};
|
|
308
309
|
const textStyleMap = {
|
|
309
310
|
primary: 'text-primary-text',
|
|
310
|
-
secondary: 'text-
|
|
311
|
+
secondary: 'text-secondary-text',
|
|
311
312
|
};
|
|
312
|
-
const BlockItem = JSX(({ className, text, children, version = 'primary' }) => {
|
|
313
|
-
return (jsxs("div", { className: `inline-block flex ${className || ''}`, role: "listitem", children: [jsx("div", { className: `inline-block
|
|
313
|
+
const BlockItem = JSX(({ className, isDotted = true, text, children, version = 'primary' }) => {
|
|
314
|
+
return (jsxs("div", { className: `inline-block flex ${className || ''}`, role: "listitem", children: [isDotted && jsx("div", { className: `inline-block mr-3 ${listStyleMap[version]}` }), jsx("span", { className: `text-base font-normal font-sans mr-3 ${textStyleMap[version]}`, children: text || children })] }));
|
|
314
315
|
});
|
|
315
316
|
|
|
316
317
|
const buttonStyleMap = {
|
|
@@ -362,7 +363,7 @@
|
|
|
362
363
|
const BaseTile = JSX(({ className, context, title, titleSize, description, children, buttons, image, items, version = 'primary', align = 'left', }) => {
|
|
363
364
|
const router = context.useRouter();
|
|
364
365
|
const { handlerDecorator } = context;
|
|
365
|
-
return (jsxs("div", { className: `font-sans flex flex-col grow h-full ${alignBlock[align]}`, children: [title && (jsx(Title, { size: titleSize || getTitleSizeByClassName(className), className: TITLE_CLASSES
|
|
366
|
+
return (jsxs("div", { className: `font-sans flex flex-col grow h-full ${alignBlock[align]}`, children: [title && (jsx(Title, { size: titleSize || getTitleSizeByClassName(className), className: `${TITLE_CLASSES} ${version === 'primary' ? 'text-primary-text' : ''}`, children: title })), jsxs("div", { className: "flex grow justify-between w-full", children: [jsxs("div", { className: `flex flex-col justify-between ${alignBlock[align]}`, children: [jsxs("div", { children: [description ? (jsx("div", { className: `font-normal text-base max-w-[600px] ${alignText[align]}`, children: description })) : null, children, items?.length ? renderItems$1(items, version) : null] }), buttons?.length ? (jsx("div", { className: "flex mt-9 gap-3", children: buttons.map((button, index) => renderButton$1(useLink({ router, handlerDecorator }, button), index)) })) : null] }), image?.src && jsx(Img, { className: "mt-auto ml-7", image: image })] })] }));
|
|
366
367
|
});
|
|
367
368
|
function getTitleSizeByClassName(className = '') {
|
|
368
369
|
const colSpan = getColSpan(className);
|
|
@@ -396,7 +397,7 @@
|
|
|
396
397
|
};
|
|
397
398
|
const titleMarginsStyleMap = {
|
|
398
399
|
double: 'mb-8',
|
|
399
|
-
single: '',
|
|
400
|
+
single: 'mb-[26px]',
|
|
400
401
|
};
|
|
401
402
|
const linkColumnsModeStyleMap = {
|
|
402
403
|
double: 'gap-x-5 gap-y-[26px] flex-wrap',
|
|
@@ -404,10 +405,10 @@
|
|
|
404
405
|
};
|
|
405
406
|
const LinkDocs = JSX(({ className, title, align, documents, icon, columnsMode = 'double' }) => {
|
|
406
407
|
const containerClasses = linkColumnsModeStyleMap[columnsMode];
|
|
407
|
-
return (jsxs("section", { className: `font-sans p-[50px] bg-white ${className}`, children: [title && (jsx(Title, { className: `font-medium
|
|
408
|
-
? documents.map(({ text, fileSize, ...linkProps }) => (jsxs("a", { className: `group flex
|
|
409
|
-
|
|
410
|
-
|
|
408
|
+
return (jsxs("section", { className: `font-sans p-[50px] bg-white ${className}`, children: [title && (jsx(Title, { className: `font-medium mt-0 ${titleMarginsStyleMap[columnsMode]} ${titleAlignStyleMap[align ?? 'center']}`, children: title })), jsx("div", { className: `flex ${containerClasses}`, role: "list", children: documents?.length
|
|
409
|
+
? documents.map(({ text, fileSize, ...linkProps }, i) => (jsxs("a", { className: `group flex text-sm align-middle h-fit
|
|
410
|
+
text-primary-text no-underline hover:text-primary-main
|
|
411
|
+
${columnsMode === 'double' ? 'basis-[calc(50%-20px)]' : ''}`, role: "listitem", ...linkProps, children: [icon && jsx(Icon, { className: "mr-2.5", name: icon, width: "24px", height: "24px" }), jsxs("span", { className: "self-center", children: [text, jsx("span", { className: "text-secondary-text group-hover:text-primary-main", children: linkProps?.href && formatSuffix(getExtFromHref(linkProps.href), fileSize) })] })] }, String(i))))
|
|
411
412
|
: null })] }));
|
|
412
413
|
});
|
|
413
414
|
const getExtFromHref = (href) => {
|
|
@@ -457,7 +458,7 @@
|
|
|
457
458
|
return (jsxs("section", { className: `font-sans px-9 py-4 flex ${textBlockStyleMap.background} ${className || ''}`, children: [iconVersion && iconVersion === 'small' ? renderIcon(textBlockStyleMap.icon) : null, iconVersion && 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 })), description && (jsx("div", { className: `text-sm ${textBlockStyleMap.description}`, children: description }))] })] }));
|
|
458
459
|
});
|
|
459
460
|
function renderIcon(className) {
|
|
460
|
-
return (jsx("div", { className: `pt-1.5 pr-4`, children: jsx("div", { className: `rounded-full h-4 w-4 text-center text-xs ${className}`, children: "i" }) }));
|
|
461
|
+
return (jsx("div", { className: `pt-1.5 pl-1 pr-4`, children: jsx("div", { className: `rounded-full h-4 w-4 text-center text-xs ${className}`, children: "i" }) }));
|
|
461
462
|
}
|
|
462
463
|
function renderImage(image) {
|
|
463
464
|
return image?.src ? jsx(Img, { className: "pt-0.5 pr-3", image: image }) : null;
|
|
@@ -475,8 +476,9 @@
|
|
|
475
476
|
const hasContent = blocks?.length;
|
|
476
477
|
const icon = isActive ? 'MinusIcon' : 'PlusIcon';
|
|
477
478
|
const handleToggle = (e) => {
|
|
478
|
-
if (!hasContent)
|
|
479
|
-
return
|
|
479
|
+
if (!hasContent) {
|
|
480
|
+
return;
|
|
481
|
+
}
|
|
480
482
|
setIsActive(!isActive);
|
|
481
483
|
const contentBlock = getContentBlock(e);
|
|
482
484
|
contentBlock.style.maxHeight = contentBlock.style.maxHeight
|
|
@@ -484,16 +486,17 @@
|
|
|
484
486
|
: `${contentBlock.scrollHeight}px`;
|
|
485
487
|
};
|
|
486
488
|
return (jsxs("li", { className: "border-0 border-b border-solid border-main-divider last:border-b-0", children: [jsxs("button", { className: `border-none bg-transparent px-0 py-5 flex justify-between text-left w-full font-sans text-primary-text
|
|
487
|
-
${hasContent ? 'group cursor-pointer' : ''}`, onClick: handleToggle, children: [jsx("span", { className: `m-0 text-xl pr-2.5 font-medium ${hasContent ? 'group-hover:text-primary-main' : ''}`, children: label }), hasContent ? jsx(Icon, { name: icon, width: "24", height: "24" }) : null] }), hasContent ? (jsx("div", { className: `${isActive ? 'pb-5' : ''} text-sm transition-all duration-300 max-h-0 overflow-hidden group-last:last:pb-0 `, children: blocks?.length ? blocks.map((block, i) => renderBlock(block, i, context)) : null })) : null] }));
|
|
489
|
+
${hasContent ? 'group cursor-pointer' : ''}`, onClick: handleToggle, children: [jsx("span", { className: `m-0 text-xl pr-2.5 font-medium ${hasContent ? 'group-hover:text-primary-main' : ''}`, children: label }), hasContent ? jsx(Icon, { name: icon, width: "24", height: "24" }) : null] }), hasContent ? (jsx("div", { className: `${isActive ? 'pb-5' : ''} text-sm transition-all duration-300 max-h-0 overflow-hidden group-last:last:pb-0 `, children: blocks?.length ? blocks.map((block, i) => renderBlock$1(block, i, context)) : null })) : null] }));
|
|
488
490
|
});
|
|
489
|
-
const renderBlock = (block, i, context) => {
|
|
490
|
-
|
|
491
|
+
const renderBlock$1 = (block, i, context) => {
|
|
492
|
+
const type = block?.accordionBlockType;
|
|
493
|
+
if (!type || !(type in AccordionBlocks)) {
|
|
491
494
|
return null;
|
|
492
495
|
}
|
|
493
|
-
const AccordionBlock = AccordionBlocks[
|
|
494
|
-
return (jsx("div", { className: "mb-5 last:mb-0", children: jsx(AccordionBlock, { context: context, ...block
|
|
496
|
+
const AccordionBlock = AccordionBlocks[type];
|
|
497
|
+
return (jsx("div", { className: "mb-5 last:mb-0", children: jsx(AccordionBlock, { context: context, ...block }) }, `block_${i}`));
|
|
495
498
|
};
|
|
496
|
-
const getContentBlock = (
|
|
499
|
+
const getContentBlock = ({ target }) => target.tagName === 'BUTTON' ? target.nextSibling : target.parentNode.nextSibling;
|
|
497
500
|
|
|
498
501
|
const Accordion = JSX(({ title, accordionItems, context, className }) => {
|
|
499
502
|
return (jsxs("section", { className: `p-[50px] font-sans bg-white text-primary-text ${className || ''}`, children: [title ? jsx(Title, { className: "m-0 mb-2.5", children: title }) : null, accordionItems?.length ? (jsx("ul", { className: "list-none m-0 p-0", children: accordionItems.map((item, i) => (jsx(AccordionItem, { ...item, context: context }, `AccordionItem${i}`))) })) : null] }));
|
|
@@ -506,6 +509,15 @@
|
|
|
506
509
|
return (jsxs("div", { className: "flex items-center p-10 gap-5 max-w-[580px]", children: [benefit.icon && (jsx(Icon, { className: "h-[70px] w-[70px] min-w-[70px] min-h-[70px]", name: benefit.icon, width: "70", height: "70" })), jsxs("div", { children: [jsx("h3", { className: "font-medium text-xl m-0", children: benefit.label }), benefit.description && (jsx("div", { className: "font-normal text-sm mt-2", children: benefit.description }))] })] }, String(i)));
|
|
507
510
|
};
|
|
508
511
|
|
|
512
|
+
const useComparisonTableScroll = ({ colData, colsLengthForScroll, activeCardIndex, setActiveCardIndex, }) => {
|
|
513
|
+
const nextClick = () => setActiveCardIndex(activeCardIndex + 1);
|
|
514
|
+
const prevClick = () => setActiveCardIndex(activeCardIndex - 1);
|
|
515
|
+
const isScrollAvailable = colData?.length && colData.length > colsLengthForScroll;
|
|
516
|
+
const showNextButton = isScrollAvailable && colData?.length - activeCardIndex > colsLengthForScroll;
|
|
517
|
+
const showPrevButton = isScrollAvailable && activeCardIndex > 0;
|
|
518
|
+
return { nextClick, prevClick, isScrollAvailable, showNextButton, showPrevButton };
|
|
519
|
+
};
|
|
520
|
+
|
|
509
521
|
const SVG = JSX(({ className, viewBox, fill = 'none', width, height, paths, ...commonOptions }) => {
|
|
510
522
|
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))) }));
|
|
511
523
|
});
|
|
@@ -526,27 +538,31 @@
|
|
|
526
538
|
? 'bg-secondary-light text-secondary-text'
|
|
527
539
|
: '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" }) })));
|
|
528
540
|
|
|
529
|
-
const TableRowContainer = JSX(({ children }) => (jsx("div", { className: "self-start flex flex-col", role: "row", children: jsx("div", { className: "flex", children: children }) })));
|
|
530
|
-
|
|
531
541
|
const GRADIENT = 'bg-gradient-to-r from-main-gradient-start to-main-gradient-end';
|
|
532
542
|
const BORDER_CLASSES = 'border-main-stroke border-solid border';
|
|
533
|
-
const DIVIDER_CLASSES = 'border-main-divider border border-t-0 border-x-0';
|
|
534
|
-
const FIRST_CELL_CLASSES = 'w-[200px] mr-6';
|
|
535
|
-
const COLS_LENGTH_FOR_SCROLL = 2;
|
|
536
|
-
const COLUMN_WIDTH = 4 * 80 + 4 * 4; // w-80 + gap-4 = 336px
|
|
543
|
+
const DIVIDER_CLASSES$1 = 'border-main-divider border border-t-0 border-x-0';
|
|
544
|
+
const FIRST_CELL_CLASSES$1 = 'w-[200px] mr-6';
|
|
545
|
+
const COLS_LENGTH_FOR_SCROLL$1 = 2;
|
|
546
|
+
const COLUMN_WIDTH$1 = 4 * 80 + 4 * 4; // w-80 + gap-4 = 336px
|
|
537
547
|
|
|
538
|
-
const
|
|
548
|
+
const HeaderCell = JSX(({ icon, image, title, link }) => (jsxs("div", { className: `w-80 box-border flex flex-col items-center rounded-t-md border-b-0 px-7 pt-7 pb-[46px] ${BORDER_CLASSES} ${GRADIENT}`, role: "columnheader", scope: "col", children: [icon && !image?.src && (jsx(Icon, { className: "h-[63px] w-[63px] min-w-[63px] min-h-[63px] mb-4", name: icon, width: "63", height: "63" })), image?.src && jsx(Img, { className: "mb-[18px]", image: image }), title && (jsx(Title, { size: "S", className: "font-medium m-0 text-center text-white", children: title })), link?.text && (jsx("div", { className: "mt-auto w-full", children: jsx(Button, { href: link.href, target: link.target, className: "mt-4 w-full text-primary-main bg-white hover:bg-secondary-hover active:bg-secondary-active", children: jsx("div", { className: "font-medium text-xs py-[11px]", children: link.text }) }) }))] })));
|
|
539
549
|
|
|
540
|
-
const
|
|
550
|
+
const carouselContainerClassesMap = {
|
|
551
|
+
comparison: 'flex gap-4 duration-1000',
|
|
552
|
+
tariff: 'flex flex-grow duration-1000',
|
|
553
|
+
};
|
|
554
|
+
const TableCarouselContainer = JSX(({ children, activeCardIndex, columnWidth, version = 'comparison' }) => (jsx("div", { className: "flex flex-1 overflow-hidden", children: jsx("div", { className: carouselContainerClassesMap[version], style: { transform: `translateX(-${activeCardIndex * columnWidth}px)` }, children: children }) })));
|
|
541
555
|
|
|
542
556
|
const TableCell = JSX(({ cell, isFirstRow, isLastRow, isFillGradient }) => {
|
|
543
557
|
const cellWrapperClasses = `w-80 box-border flex flex-col ${BORDER_CLASSES} ${!isLastRow ? 'border-y-0' : 'border-t-0 rounded-b-md'} ${isFillGradient ? GRADIENT : ''}`;
|
|
544
|
-
const cellClasses = `mx-7 h-full ${DIVIDER_CLASSES} ${isFillGradient && isFirstRow ? 'border-t' : ''} ${!isLastRow ? 'border-solid' : ''}`;
|
|
545
|
-
return (jsx("div", { className: cellWrapperClasses, role: "cell", children: jsx("div", { className: cellClasses, children: cell.map((item, i) => renderCellInner(item, i, isFillGradient)) }) }));
|
|
558
|
+
const cellClasses = `mx-7 h-full ${DIVIDER_CLASSES$1} ${isFillGradient && isFirstRow ? 'border-t' : ''} ${!isLastRow ? 'border-solid' : ''}`;
|
|
559
|
+
return (jsx("div", { className: cellWrapperClasses, role: "cell", children: jsx("div", { className: cellClasses, children: cell.map((item, i) => renderCellInner$1(item, i, isFillGradient)) }) }));
|
|
546
560
|
});
|
|
547
|
-
const renderCellInner = ({ label, description }, i, isFillGradient) => (jsxs("div", { className: "first:pt-7 pt-6 last:pb-7", children: [label && (jsx("h5", { className: `text-xl font-medium m-0 ${isFillGradient ? 'text-white' : ''}`, children: label })), description && (jsx("div", { className: `text-sm opacity-80 ${isFillGradient ? 'text-white' : 'text-secondary-text'}`, children: description }))] }, String(i)));
|
|
561
|
+
const renderCellInner$1 = ({ label, description }, i, isFillGradient) => (jsxs("div", { className: "first:pt-7 pt-6 last:pb-7", children: [label && (jsx("h5", { className: `text-xl font-medium m-0 ${isFillGradient ? 'text-white' : ''}`, children: label })), description && (jsx("div", { className: `text-sm opacity-80 ${isFillGradient ? 'text-white' : 'text-secondary-text'}`, children: description }))] }, String(i)));
|
|
562
|
+
|
|
563
|
+
const TableRowContainer = JSX(({ children }) => (jsx("div", { className: "self-start flex flex-col", role: "row", children: jsx("div", { className: "flex", children: children }) })));
|
|
548
564
|
|
|
549
|
-
const TableRow = JSX(({ row: { header, data }, activeCardIndex, isColoredFirstColumn, isFirstRow, isLastRow }) => (jsxs(TableRowContainer, { children: [header?.title ? (jsx("div", { className: `text-sm py-7 ${DIVIDER_CLASSES} ${FIRST_CELL_CLASSES} ${!isLastRow ? 'border-solid' : ''}`, children: header.title })) : null, data?.length ? (jsx(TableCarouselContainer, { activeCardIndex: activeCardIndex, children: data.map((cell, i) => (jsx(TableCell, { cell: cell, isFirstRow: isFirstRow, isLastRow: isLastRow, isFillGradient: isColoredFirstColumn && i === 0 }, String(i)))) })) : null] })));
|
|
565
|
+
const TableRow = JSX(({ row: { header, data }, activeCardIndex, isColoredFirstColumn, isFirstRow, isLastRow }) => (jsxs(TableRowContainer, { children: [header?.title ? (jsx("div", { className: `text-sm py-7 ${DIVIDER_CLASSES$1} ${FIRST_CELL_CLASSES$1} ${!isLastRow ? 'border-solid' : ''}`, children: header.title })) : null, data?.length ? (jsx(TableCarouselContainer, { activeCardIndex: activeCardIndex, columnWidth: COLUMN_WIDTH$1, children: data.map((cell, i) => (jsx(TableCell, { cell: cell, isFirstRow: isFirstRow, isLastRow: isLastRow, isFillGradient: isColoredFirstColumn && i === 0 }, String(i)))) })) : null] })));
|
|
550
566
|
|
|
551
567
|
const ComparisonTable = JSX(({ className, context, title, rowHeaders, columns, visibleRowLength = 0, isColoredFirstColumn = false, }) => {
|
|
552
568
|
const router = context.useRouter();
|
|
@@ -561,13 +577,14 @@
|
|
|
561
577
|
data: colData.map((col) => col?.[i] || [{}]),
|
|
562
578
|
}))
|
|
563
579
|
.slice(0, isShowAllRow ? rowHeaders.length : visibleRowLength);
|
|
564
|
-
const nextClick
|
|
565
|
-
|
|
580
|
+
const { nextClick, prevClick, isScrollAvailable, showNextButton, showPrevButton } = useComparisonTableScroll({
|
|
581
|
+
colData,
|
|
582
|
+
colsLengthForScroll: COLS_LENGTH_FOR_SCROLL$1,
|
|
583
|
+
activeCardIndex,
|
|
584
|
+
setActiveCardIndex,
|
|
585
|
+
});
|
|
566
586
|
const showToggle = () => setIsShowAllRow(!isShowAllRow);
|
|
567
|
-
|
|
568
|
-
const showNextButton = isScrollAvailable && colData?.length - activeCardIndex > COLS_LENGTH_FOR_SCROLL;
|
|
569
|
-
const showPrevButton = isScrollAvailable && activeCardIndex > 0;
|
|
570
|
-
return (jsxs("section", { className: `bg-white font-sans py-[50px] pl-[50px] overflow-hidden text-primary-text relative ${className || ''}`, children: [jsx(Title, { className: "font-medium m-0 max-w-[47rem] text-center mb-9 mx-auto", children: title }), jsxs("div", { role: "table", children: [colHeaders?.length ? (jsxs(TableRowContainer, { children: [jsx("div", { className: FIRST_CELL_CLASSES, role: "columnheader", scope: "col" }), jsx(TableCarouselContainer, { activeCardIndex: activeCardIndex, children: colHeaders.map((header, i) => (jsx(HeaderCell, { ...header, link: header.link && useLink({ router, handlerDecorator }, header.link) }, String(i)))) })] })) : null, rowData?.length ? (jsxs("div", { className: "relative", children: [rowData.map((row, i, { length }) => (jsx(TableRow, { row: row, isFirstRow: i === 0, isLastRow: i + 1 === length, activeCardIndex: activeCardIndex, isColoredFirstColumn: isColoredFirstColumn }, String(i)))), isScrollAvailable ? (jsx("div", { children: jsxs("div", { className: "absolute top-7 right-7 z-10", children: [jsx(ArrowButton, { onClick: nextClick, disabled: !showNextButton, ariaLabel: "\u041F\u0440\u043E\u043B\u0438\u0441\u0442\u0430\u0442\u044C \u0432\u043F\u0440\u0430\u0432\u043E" }), jsx(ArrowButton, { className: "mt-4 rotate-180", onClick: prevClick, disabled: !showPrevButton, ariaLabel: "\u041F\u0440\u043E\u043B\u0438\u0441\u0442\u0430\u0442\u044C \u0432\u043B\u0435\u0432\u043E" })] }) })) : null] })) : null] }), isScrollAvailable ? (jsx("div", { className: "absolute top-0 right-0 bottom-0 w-[84px] bg-opacity-to-white" })) : null, visibleRowLength ? (jsx("div", { className: "pr-[50px]", children: jsxs("div", { className: "flex w-full", children: [jsx("div", { className: FIRST_CELL_CLASSES }), jsx("button", { onClick: showToggle, className: "mt-5 flex-1 border-main-stroke border-solid border text-primary-text bg-white hover:border-primary-main hover:text-primary-main", children: jsx("div", { className: "font-sans font-medium text-xs py-[11px]", children: !isShowAllRow ? 'Показать все параметры' : 'Скрыть' }) })] }) })) : null] }));
|
|
587
|
+
return (jsxs("section", { className: `bg-white font-sans py-[50px] pl-[50px] overflow-hidden text-primary-text relative ${className || ''}`, children: [jsx(Title, { className: "font-medium m-0 max-w-[47rem] text-center mb-9 mx-auto", children: title }), jsxs("div", { role: "table", children: [colHeaders?.length ? (jsxs(TableRowContainer, { children: [jsx("div", { className: FIRST_CELL_CLASSES$1, role: "columnheader", scope: "col" }), jsx(TableCarouselContainer, { activeCardIndex: activeCardIndex, columnWidth: COLUMN_WIDTH$1, children: colHeaders.map((header, i) => (jsx(HeaderCell, { ...header, link: header.link && useLink({ router, handlerDecorator }, header.link) }, String(i)))) })] })) : null, rowData?.length ? (jsxs("div", { className: "relative", children: [rowData.map((row, i, { length }) => (jsx(TableRow, { row: row, isFirstRow: i === 0, isLastRow: i + 1 === length, activeCardIndex: activeCardIndex, isColoredFirstColumn: isColoredFirstColumn }, String(i)))), isScrollAvailable ? (jsx("div", { children: jsxs("div", { className: "absolute top-7 right-7 z-10", children: [jsx(ArrowButton, { onClick: nextClick, disabled: !showNextButton, ariaLabel: "\u041F\u0440\u043E\u043B\u0438\u0441\u0442\u0430\u0442\u044C \u0432\u043F\u0440\u0430\u0432\u043E" }), jsx(ArrowButton, { className: "mt-4 rotate-180", onClick: prevClick, disabled: !showPrevButton, ariaLabel: "\u041F\u0440\u043E\u043B\u0438\u0441\u0442\u0430\u0442\u044C \u0432\u043B\u0435\u0432\u043E" })] }) })) : null] })) : null] }), isScrollAvailable ? (jsx("div", { className: "absolute top-0 right-0 bottom-0 w-[84px] bg-opacity-to-white" })) : null, visibleRowLength ? (jsx("div", { className: "pr-[50px]", children: jsxs("div", { className: "flex w-full", children: [jsx("div", { className: FIRST_CELL_CLASSES$1 }), jsx("button", { onClick: showToggle, className: "mt-5 flex-1 border-main-stroke border-solid border text-primary-text bg-white hover:border-primary-main hover:text-primary-main", children: jsx("div", { className: "font-sans font-medium text-xs py-[11px]", children: !isShowAllRow ? 'Показать все параметры' : 'Скрыть' }) })] }) })) : null] }));
|
|
571
588
|
});
|
|
572
589
|
|
|
573
590
|
function useCreditCalculatorData(useAsyncData, directoryName) {
|
|
@@ -614,7 +631,7 @@
|
|
|
614
631
|
if (value > max)
|
|
615
632
|
onChange(max);
|
|
616
633
|
};
|
|
617
|
-
return (jsxs("div", { className: className, children: [jsxs("
|
|
634
|
+
return (jsxs("div", { className: className, children: [jsxs("label", { className: "block relative", children: [title ? (jsx("span", { className: "absolute text-xs text-secondary-text top-1 mt-0.5 pl-4 ml-0.5", children: title })) : null, jsx("input", { className: `m-0 font-sans text-sm w-full h-12 border-2 border-solid border-main-divider rounded-md outline-none p-0 pl-4 m-0 box-border text-primary-text ${title ? 'pt-4' : ''}`, value: addSpacesBetweenNumbers(value), onChange: (e) => handleChange(e.target.value), onBlur: handleBlur }), jsx("div", { className: "absolute inset-x-0 mt-0.5 top-8 px-4", children: jsx("input", { className: "box-border w-full m-0 cursor-pointer slider", type: "range", min: min, max: max, step: step, value: value, onChange: (e) => handleChange(e.target.value), style: inputStyle }) })] }), jsx("div", { className: "flex justify-between mt-3 mb-4", children: items.map((item, i) => (jsx("span", { className: "text-xs text-secondary-text pl-4", children: item }, String(i)))) })] }));
|
|
618
635
|
});
|
|
619
636
|
|
|
620
637
|
const clamp = (value, min, max) => Math.max(min, Math.min(value, max));
|
|
@@ -706,7 +723,7 @@
|
|
|
706
723
|
return (jsx("section", { className: `font-sans text-primary-text bg-white p-4 ${className}`, children: jsxs("div", { className: `box-border p-12 flex flex-col justify-between ${borderStyle}`, children: [jsxs("div", { className: "flex justify-between", children: [jsxs("div", { className: "grow mr-11", children: [jsx(InputRange, { title: "\u0416\u0435\u043B\u0430\u0435\u043C\u0430\u044F \u0441\u0443\u043C\u043C\u0430 \u043A\u0440\u0435\u0434\u0438\u0442\u0430, \u20BD", items: [
|
|
707
724
|
`От ${addSpacesBetweenNumbers(minSum)} рублей`,
|
|
708
725
|
`До ${addSpacesBetweenNumbers(maxSum)} рублей`,
|
|
709
|
-
], min: minSum, max: maxSum, step: STEP_MONEY, value: moneyValue || defaultSum, onChange: setMoneyValue }), jsx(InputRange, { title: "\u0421\u0440\u043E\u043A \u043A\u0440\u0435\u0434\u0438\u0442\u0430, \u043C\u0435\u0441\u044F\u0446\u0435\u0432", items: ['Или выберите из предложенных вариантов ниже'], min: minMonths, max: maxMonths, step: STEP_MONTHS, value: monthsValue || defaultMonths, onChange: setMonthsValue }), jsx("div", { className: "flex mb-7", children: creditTermYears.map((number, i) => renderButton(number, i, handleButtonClick)) }), jsx(Checkbox, { text: "\u041F\u043E\u043B\u0443\u0447\u0430\u044E \u043F\u0435\u043D\u0441\u0438\u044E \u043D\u0430 \u043A\u0430\u0440\u0442\u0443 \u0420\u043E\u0441\u0441\u0435\u043B\u044C\u0445\u043E\u0437\u0431\u0430\u043D\u043A\u0430", checked: isAnnuityChecked, onChange: setIsAnnuityChecked }), jsx(Checkbox, { className: "mb-4", text: "\u041A\u043E\u043C\u043F\u043B\u0435\u043A\u0441\u043D\u0430\u044F \u0441\u0442\u0440\u0430\u0445\u043E\u0432\u0430\u044F \u0437\u0430\u0449\u0438\u0442\u0430", checked: isInsuranceChecked, onChange: setIsInsuranceChecked })] }), jsxs("div", { className: "p-9 bg-primary-main rounded-md text-white", children: [jsx("div", { className: "text-base mb-5", children: "\u041D\u0430\u0448\u0435 \u043F\u0440\u0435\u0434\u043B\u043E\u0436\u0435\u043D\u0438\u0435" }), jsx("div", { className: "text-sm opacity-60", children: "\u0415\u0436\u0435\u043C\u0435\u0441\u044F\u0447\u043D\u044B\u0439 \u043F\u043B\u0430\u0442\u0451\u0436" }), jsxs("div", { className: "text-lg mb-3", children: [addSpacesBetweenNumbers(Math.round(montlyPayment)), " \u20BD"] }), jsx("div", { className: "text-sm opacity-60", children: "\u0421\u0442\u0430\u0432\u043A\u0430" }), jsxs("div", { className: "text-lg", children: [rate, " %"] })] })] }), jsxs("div", { className: "flex items-center", children: [jsx(Button, { className: "mr-3", text: "\u041E\u0442\u043F\u0440\u0430\u0432\u0438\u0442\u044C \u0437\u0430\u044F\u0432\u043A\u0443", version: "primary", href: "#" }), jsx("div", { className: "w-80 text-xxs leading-4 text-secondary-text", "aria-label": "\u0421\u043E\u0433\u043B\u0430\u0448\u0435\u043D\u0438\u0435 \u043D\u0430 \u043E\u0431\u0440\u0430\u0431\u043E\u0442\u043A\u0443 \u043F\u0435\u0440\u0441\u043E\u043D\u0430\u043B\u044C\u043D\u044B\u0445 \u0434\u0430\u043D\u043D\u044B\u0445", children: "\u041E\u0442\u043F\u0440\u0430\u0432\u043B\u044F\u044F \u0437\u0430\u044F\u0432\u043A\u0443, \u0432\u044B \u0441\u043E\u0433\u043B\u0430\u0448\u0430\u0435\u0442\u0435\u0441\u044C \u043D\u0430 \u043E\u0431\u0440\u0430\u0431\u043E\u0442\u043A\u0443 \u043F\u0435\u0440\u0441\u043E\u043D\u0430\u043B\u044C\u043D\u044B\u0445 \u0434\u0430\u043D\u043D\u044B\u0445 \u0441\u043E\u043E\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043D\u043D\u043E \u0442\u0440\u0435\u0431\u043E\u0432\u0430\u043D\u0438\u044F\u043C \u0424\u0417\
|
|
726
|
+
], min: minSum, max: maxSum, step: STEP_MONEY, value: moneyValue || defaultSum, onChange: setMoneyValue }), jsx(InputRange, { title: "\u0421\u0440\u043E\u043A \u043A\u0440\u0435\u0434\u0438\u0442\u0430, \u043C\u0435\u0441\u044F\u0446\u0435\u0432", items: ['Или выберите из предложенных вариантов ниже'], min: minMonths, max: maxMonths, step: STEP_MONTHS, value: monthsValue || defaultMonths, onChange: setMonthsValue }), jsx("div", { className: "flex mb-7", children: creditTermYears.map((number, i) => renderButton(number, i, handleButtonClick)) }), jsx(Checkbox, { text: "\u041F\u043E\u043B\u0443\u0447\u0430\u044E \u043F\u0435\u043D\u0441\u0438\u044E \u043D\u0430 \u043A\u0430\u0440\u0442\u0443 \u0420\u043E\u0441\u0441\u0435\u043B\u044C\u0445\u043E\u0437\u0431\u0430\u043D\u043A\u0430", checked: isAnnuityChecked, onChange: setIsAnnuityChecked }), jsx(Checkbox, { className: "mb-4", text: "\u041A\u043E\u043C\u043F\u043B\u0435\u043A\u0441\u043D\u0430\u044F \u0441\u0442\u0440\u0430\u0445\u043E\u0432\u0430\u044F \u0437\u0430\u0449\u0438\u0442\u0430", checked: isInsuranceChecked, onChange: setIsInsuranceChecked })] }), jsxs("div", { className: "p-9 bg-primary-main rounded-md text-white", children: [jsx("div", { className: "text-base mb-5", children: "\u041D\u0430\u0448\u0435 \u043F\u0440\u0435\u0434\u043B\u043E\u0436\u0435\u043D\u0438\u0435" }), jsx("div", { className: "text-sm opacity-60", children: "\u0415\u0436\u0435\u043C\u0435\u0441\u044F\u0447\u043D\u044B\u0439 \u043F\u043B\u0430\u0442\u0451\u0436" }), jsxs("div", { className: "text-lg mb-3", children: [addSpacesBetweenNumbers(Math.round(montlyPayment)), " \u20BD"] }), jsx("div", { className: "text-sm opacity-60", children: "\u0421\u0442\u0430\u0432\u043A\u0430" }), jsxs("div", { className: "text-lg", children: [rate, " %"] })] })] }), jsxs("div", { className: "flex items-center", children: [jsx(Button, { className: "mr-3", text: "\u041E\u0442\u043F\u0440\u0430\u0432\u0438\u0442\u044C \u0437\u0430\u044F\u0432\u043A\u0443", version: "primary", href: "#" }), jsx("div", { className: "w-80 text-xxs leading-4 text-secondary-text", "aria-label": "\u0421\u043E\u0433\u043B\u0430\u0448\u0435\u043D\u0438\u0435 \u043D\u0430 \u043E\u0431\u0440\u0430\u0431\u043E\u0442\u043A\u0443 \u043F\u0435\u0440\u0441\u043E\u043D\u0430\u043B\u044C\u043D\u044B\u0445 \u0434\u0430\u043D\u043D\u044B\u0445", children: "\u041E\u0442\u043F\u0440\u0430\u0432\u043B\u044F\u044F \u0437\u0430\u044F\u0432\u043A\u0443, \u0432\u044B \u0441\u043E\u0433\u043B\u0430\u0448\u0430\u0435\u0442\u0435\u0441\u044C \u043D\u0430 \u043E\u0431\u0440\u0430\u0431\u043E\u0442\u043A\u0443 \u043F\u0435\u0440\u0441\u043E\u043D\u0430\u043B\u044C\u043D\u044B\u0445 \u0434\u0430\u043D\u043D\u044B\u0445 \u0441\u043E\u043E\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043D\u043D\u043E \u0442\u0440\u0435\u0431\u043E\u0432\u0430\u043D\u0438\u044F\u043C \u0424\u0417 \u00AB\u041E \u043F\u0435\u0440\u0441\u043E\u043D\u0430\u043B\u044C\u043D\u044B\u0445 \u0434\u0430\u043D\u043D\u044B\u0445\u00BB" })] })] }) }));
|
|
710
727
|
});
|
|
711
728
|
function renderButton(number, i, handleClick) {
|
|
712
729
|
return (jsx("button", { className: "bg-secondary-light rounded-3xl h-10 w-[75px] box-border mr-2 flex items-center justify-center cursor-pointer border-none", onClick: () => handleClick(number), children: jsxs("span", { className: "font-semibold text-sm", children: [number, " ", number === 1 ? 'год' : number > 4 ? 'лет' : 'года'] }) }, String(i)));
|
|
@@ -718,7 +735,7 @@
|
|
|
718
735
|
};
|
|
719
736
|
const Tile = JSX((props) => {
|
|
720
737
|
const { children, className, version = 'primary' } = props;
|
|
721
|
-
return (jsx("section", { className: `font-sans p-9
|
|
738
|
+
return (jsx("section", { className: `font-sans p-9 box-border ${className || ''} ${tileStyleMap[version]} ${getContainerPaddingRight(className)} ${getContainerMinHeight(className)} `, children: jsx(BaseTile, { ...props, children: children }) }));
|
|
722
739
|
});
|
|
723
740
|
function getContainerPaddingRight(className = '') {
|
|
724
741
|
const colSpan = getColSpan(className);
|
|
@@ -732,6 +749,18 @@
|
|
|
732
749
|
return 'pr-[9.4rem]';
|
|
733
750
|
}
|
|
734
751
|
}
|
|
752
|
+
function getContainerMinHeight(className = '') {
|
|
753
|
+
const colSpan = getColSpan(className);
|
|
754
|
+
if (colSpan <= 6) {
|
|
755
|
+
return 'min-h-[300px]';
|
|
756
|
+
}
|
|
757
|
+
else if (colSpan <= 8) {
|
|
758
|
+
return 'min-h-[320px]';
|
|
759
|
+
}
|
|
760
|
+
else {
|
|
761
|
+
return 'min-h-[360px]';
|
|
762
|
+
}
|
|
763
|
+
}
|
|
735
764
|
|
|
736
765
|
const CBR_EXCHANGE_RATE_URL = 'https://www.cbr-xml-daily.ru/daily_json.js';
|
|
737
766
|
const CURRENCY_CODES = ['USD', 'EUR'];
|
|
@@ -775,7 +804,8 @@
|
|
|
775
804
|
|
|
776
805
|
const SearchBar = JSX(({ className, context }) => {
|
|
777
806
|
const { term, setTerm } = context.useSearch();
|
|
778
|
-
|
|
807
|
+
const [inputHasFocus, setInputHasFocus] = context.useState(false);
|
|
808
|
+
return (jsxs("form", { className: `relative ${className || ''}`, children: [jsxs("div", { className: "absolute rounded h-full flex items-center justify-center pl-4 max-w-[170px] gap-3.5 pointer-events-none", children: [jsx("div", { className: "w-[24px] h-[24px]", children: jsx(Icon, { name: "LoupeIcon", width: "24", height: "24" }) }), !term && (jsx("label", { htmlFor: "search-bar-input", className: "font-sans font-normal text-base text-secondary-text", children: "\u041F\u043E\u0438\u0441\u043A \u043F\u043E \u0441\u0430\u0439\u0442\u0443" }))] }), jsx("input", { id: "search-bar-input", className: `${inputHasFocus ? 'border-primary-text' : ''} pr-32 h-12 pl-12 w-full font-sans font-normal text-base text-black border border-solid border-main-divider rounded h-full box-border outline-none pr-[6%]`, value: term, onChange: (e) => setTerm(e.target.value), onFocus: (e) => setInputHasFocus(true), onBlur: (e) => setInputHasFocus(false), type: "text", name: "search-bar-input" }), inputHasFocus && (jsx("button", { type: "submit", version: "primary", className: "absolute font-sans font-normal cursor-pointer text-sm hover:bg-primary-hover active:bg-primary-active border-none px-9 py-[9px] rounded top-1 right-1 outline-none text-secondary-text text-white bg-primary-main", onClick: (e) => {
|
|
779
809
|
e.preventDefault();
|
|
780
810
|
console.log('click');
|
|
781
811
|
}, children: "\u041D\u0430\u0439\u0442\u0438" }))] }));
|
|
@@ -804,14 +834,14 @@
|
|
|
804
834
|
return jsx("span", { children: text });
|
|
805
835
|
}
|
|
806
836
|
};
|
|
807
|
-
const formatTel = (s) => s.replaceAll(
|
|
837
|
+
const formatTel = (s) => s.replaceAll(/\D/g, '');
|
|
808
838
|
|
|
809
839
|
const HorizontalNavigation = JSX(({ className, links, context }) => {
|
|
810
840
|
const router = context.useRouter();
|
|
811
841
|
const { handlerDecorator } = context;
|
|
812
842
|
return (jsx("div", { className: `${className || ''}`, children: links?.length ? (jsx("div", { className: "flex justify-between items-center gap-5 py-5 border-solid border-x-0 border-y border-y-main-divider", children: links.map((_, i) => (jsx(HorizontalNavigationLink, { index: i, ...useLink({ router, handlerDecorator }, _) }, String(i)))) })) : null }));
|
|
813
843
|
});
|
|
814
|
-
const HorizontalNavigationLink = JSX(({ className, index, text, href, target, onClick }) => (jsx("a", { className: `font-sans font-normal text-sm text-secondary-text hover:text-primary-
|
|
844
|
+
const HorizontalNavigationLink = JSX(({ className, index, text, href, target, onClick }) => (jsx("a", { className: `font-sans font-normal text-sm text-secondary-text hover:text-primary-main inline-block no-underline max-w-[292px] ${className || ''}`, href: href, target: target, onClick: onClick, children: text || `Документ ${index}` })));
|
|
815
845
|
|
|
816
846
|
function useSitemap(useAsyncData) {
|
|
817
847
|
const { data } = useAsyncData(sitemapURL(), fetchSitemap);
|
|
@@ -867,7 +897,7 @@
|
|
|
867
897
|
const { icon, label, width, height } = ICONS_MAP.find(({ origins }) => origins.some((_) => href?.includes(_))) || {};
|
|
868
898
|
if (!icon)
|
|
869
899
|
return null;
|
|
870
|
-
return (jsx(
|
|
900
|
+
return (jsx("a", { className: "flex items-center justify-center border border-solid border-main-divider rounded-full no-underline outline-none w-[38px] h-[38px] hover:fill-primary-main", href: href, target: "_blank", rel: "noopener noreferrer", children: Icon && jsx(Icon, { name: icon, width: width, height: height, asSVG: true, className: "block" }) }));
|
|
871
901
|
});
|
|
872
902
|
|
|
873
903
|
const TextInformation = JSX(({ className, links, context }) => {
|
|
@@ -907,11 +937,11 @@
|
|
|
907
937
|
const showNextButton = isGalleryScrollAvailable &&
|
|
908
938
|
cards?.length - activeCardIndex > galleryLengthForScrollMap[version];
|
|
909
939
|
const showPrevButton = isGalleryScrollAvailable && activeCardIndex > 0;
|
|
910
|
-
return (jsxs("section", { className: `relative font-sans text-primary-text bg-white p-12 overflow-hidden ${className}`, children: [jsxs("div", { className: "flex flex-col items-center mb-8", children: [title ? jsx(Title, { className: "font-medium m-0 text-center", children: title }) : null, description ? (jsx("div", { className: "font-normal text-base max-w-[600px] mt-3", children: description })) : null] }), jsx("div", {
|
|
940
|
+
return (jsxs("section", { className: `relative font-sans text-primary-text bg-white p-12 py-[50px] overflow-hidden ${className}`, children: [jsxs("div", { className: "flex flex-col items-center mb-8", children: [title ? jsx(Title, { className: "font-medium m-0 text-center", children: title }) : null, description ? (jsx("div", { className: "font-normal text-base max-w-[600px] mt-3", children: description })) : null] }), jsx("div", {
|
|
911
941
|
// Need to place all cards at the center if count of cards less than 4
|
|
912
942
|
className: `flex ${cards?.length <= galleryLengthForScrollMap[version] ? 'justify-center' : ''} duration-1000`,
|
|
913
943
|
// All cards has same width
|
|
914
|
-
style: { transform: `translateX(-${activeCardIndex * cardWidthMap[version]}px)` }, role: "list", children: cards?.map((card, i) => renderCard$1(card, i, version)) }), showPrevButton && (jsx(ArrowButton, { className: "absolute top-1/2 left-8 rotate-180", onClick: handlePrevClick, ariaLabel: "\u041F\u0440\u043E\u043B\u0438\u0441\u0442\u0430\u0442\u044C \u0432\u043B\u0435\u0432\u043E" })), showNextButton && (jsx(ArrowButton, { className: "absolute top-1/2 right-1 z-10", onClick: handleNextClick, ariaLabel: "\u041F\u0440\u043E\u043B\u0438\u0441\u0442\u0430\u0442\u044C \u0432\u043F\u0440\u0430\u0432\u043E" })), jsx("div", { className: "absolute top-0 right-0 bottom-0 w-[84px] bg-opacity-to-white" })] }));
|
|
944
|
+
style: { transform: `translateX(-${activeCardIndex * cardWidthMap[version]}px)` }, role: "list", children: cards?.map((card, i) => renderCard$1(card, i, version)) }), jsx("div", { className: "absolute top-0 left-0 bottom-0 w-[84px] bg-gradient-to-r from-white to-transparent" }), showPrevButton && (jsx(ArrowButton, { className: "absolute top-1/2 left-8 rotate-180", onClick: handlePrevClick, ariaLabel: "\u041F\u0440\u043E\u043B\u0438\u0441\u0442\u0430\u0442\u044C \u0432\u043B\u0435\u0432\u043E" })), showNextButton && (jsx(ArrowButton, { className: "absolute top-1/2 right-1 z-10", onClick: handleNextClick, ariaLabel: "\u041F\u0440\u043E\u043B\u0438\u0441\u0442\u0430\u0442\u044C \u0432\u043F\u0440\u0430\u0432\u043E" })), jsx("div", { className: "absolute top-0 right-0 bottom-0 w-[84px] bg-opacity-to-white" })] }));
|
|
915
945
|
});
|
|
916
946
|
function renderCard$1(card, i, version) {
|
|
917
947
|
return (jsxs("div", { className: `box-border border-solid border rounded-md border-main-divider p-7 mx-2 flex flex-col justify-between items-stretch ${cardStyleMap[version]} w-full`, 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-xl m-0 ${!card.description && !card.items?.length ? 'text-center' : ''}`, children: card.title })) : null, card.description ? (jsx("div", { className: "font-normal text-sm text-secondary-text mt-2", children: card.description })) : null, card.items?.length ? (jsx("section", { className: "max-w-[308px] mt-2", role: "list", children: card.items.map(renderItem) })) : null] }), card.href ? (jsx(Button, { className: "mt-6", text: "\u041F\u043E\u0434\u0440\u043E\u0431\u043D\u0435\u0435", version: "secondary", href: card.href })) : null] }, String(i)));
|
|
@@ -960,7 +990,7 @@
|
|
|
960
990
|
const activeSubItem = subItems?.find(isSubItemActive(router));
|
|
961
991
|
const topMenu = mergedItems.map((_, i) => (jsx(TopItem, { active: _ === activeTopItem, ...useLink({ router, handlerDecorator }, _), ariaLabel: _.text }, String(i))));
|
|
962
992
|
const subMenu = subItems?.map((_) => (jsx(HeaderItem, { className: "mr-8", active: _ === activeSubItem, ...useLink({ router, handlerDecorator }, _) }, _.href)));
|
|
963
|
-
return (
|
|
993
|
+
return (jsx("header", { className: `pt-5 pb-8 px-20 bg-white ${className || ''}`, children: jsxs("div", { className: "container", children: [jsxs("div", { className: "flex items-center", children: [jsx(Logo, { className: "mr-8" }), topMenu, jsx(HeaderSecondaryMenu, { context: context, className: "ml-auto", defaultLocation: defaultLocation })] }), jsx("div", { className: "mt-5 h-[1px] bg-main-divider" }), jsx("nav", { className: "mt-5", children: subMenu })] }) }));
|
|
964
994
|
});
|
|
965
995
|
|
|
966
996
|
const MiniGallery = JSX((props) => (jsx(GalleryInner, { ...props, version: "mini" })));
|
|
@@ -980,12 +1010,10 @@
|
|
|
980
1010
|
const goldenSequence = (first, size) => [first].concat(size > 0 ? goldenSequence(first / GOLDEN_RATIO, size - 1) : []);
|
|
981
1011
|
|
|
982
1012
|
const ProductBlockInner = JSX(({ className, context, title, titleSize, description, benefits, buttons, image, items }) => {
|
|
983
|
-
return (jsxs("div", { className: `flex grow justify-between items-stretch ${className || ''}`, children: [
|
|
984
|
-
/* TODO Why <Title> is duplicated here? */
|
|
985
|
-
jsx(Title, { size: titleSize || 'XL', className: "font-medium m-0 mb-4 whitespace-pre-wrap max-w-[600px] text-primary-text", children: title })), jsx(BaseTile, { context: context, description: description, items: items, buttons: buttons, children: benefits?.length ? (jsx("div", { className: "flex gap-6 mt-6 mb-3.5", children: benefits.map(renderBenefit) })) : null })] }), image?.src && jsx(Img, { className: "mt-auto", image: image })] }));
|
|
1013
|
+
return (jsxs("div", { className: `flex grow justify-between items-stretch ${className || ''}`, children: [jsx("div", { className: 'flex flex-col', children: jsx(BaseTile, { context: context, title: title, titleSize: titleSize || 'XL', description: description, items: items, buttons: buttons, children: benefits?.length ? (jsx("div", { className: "flex gap-6 mt-6 mb-3.5", children: benefits.map(renderBenefit) })) : null }) }), image?.src && jsx(Img, { className: "mt-auto", image: image })] }));
|
|
986
1014
|
});
|
|
987
1015
|
function renderBenefit(benefit, i) {
|
|
988
|
-
return (jsxs("div", { className: "flex gap-4 items-center", children: [benefit.icon && (jsx(Icon, { className: "w-[50px] h-[50px] min-w-[50px] min-h-[50px] bg-main rounded-full p-[10px] box-border", name: benefit.icon, width: "24", height: "24" })), jsxs("div", { className: "flex gap-1 flex-col h-full", children: [jsx("h4", { 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)));
|
|
1016
|
+
return (jsxs("div", { className: "flex gap-4 items-center", children: [benefit.icon && (jsx(Icon, { className: "w-[50px] h-[50px] min-w-[50px] min-h-[50px] bg-main rounded-full p-[10px] box-border", name: benefit.icon, width: "24", height: "24" })), jsxs("div", { className: "flex gap-1 flex-col h-full max-w-[149px]", children: [jsx("h4", { 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)));
|
|
989
1017
|
}
|
|
990
1018
|
|
|
991
1019
|
const Breadcrumb = JSX(({ text, href, target, onClick, className, children }) => {
|
|
@@ -1005,14 +1033,14 @@
|
|
|
1005
1033
|
const { context, className, breadcrumbs } = props;
|
|
1006
1034
|
const router = context.useRouter();
|
|
1007
1035
|
const { handlerDecorator } = context;
|
|
1008
|
-
return (jsxs("section", { className: `font-sans bg-white pt-10 pl-[50px] pb-[50px] pr-[7.5rem] ${className || ''}`, children: [breadcrumbs?.length ? (jsx("div", { className: "text-xs mb-6", children: joinList(jsx("span", { className: "text-secondary-text mx-2", children: "/" }))(breadcrumbs.map((breadcrumb, i) => (jsx(Breadcrumb, { ...useLink({ router, handlerDecorator }, { className: 'text-secondary-text', ...breadcrumb }) }, String(i))))) })) : null, jsx(ProductBlockInner, { ...props })] }));
|
|
1036
|
+
return (jsxs("section", { className: `font-sans bg-white pt-10 pl-[50px] pb-[50px] pr-[7.5rem] box-border min-h-[420px] ${className || ''}`, children: [breadcrumbs?.length ? (jsx("div", { className: "text-xs mb-6", children: joinList(jsx("span", { className: "text-secondary-text mx-2", children: "/" }))(breadcrumbs.map((breadcrumb, i) => (jsx(Breadcrumb, { ...useLink({ router, handlerDecorator }, { className: 'text-secondary-text', ...breadcrumb }) }, String(i))))) })) : null, jsx(ProductBlockInner, { ...props })] }));
|
|
1009
1037
|
});
|
|
1010
1038
|
|
|
1011
1039
|
const ProductGallery = JSX(({ className, context, duration = 0, slides = [] }) => {
|
|
1012
1040
|
const galleryNav = slides.map((s) => s.nav);
|
|
1013
1041
|
const galleryBlocks = slides.map((s) => s.productBlock);
|
|
1014
1042
|
const [activeSlideIndex, setActiveSlideIndex] = context.useState(0);
|
|
1015
|
-
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((_, i) => renderProductBlock(_, i, context)) }), jsx("div", { className:
|
|
1043
|
+
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((_, i) => renderProductBlock(_, i, context)) }), jsx("div", { className: "flex", children: galleryNav.map((slide, i) => renderNavButton({
|
|
1016
1044
|
slide,
|
|
1017
1045
|
i,
|
|
1018
1046
|
activeSlideIndex,
|
|
@@ -1027,7 +1055,7 @@
|
|
|
1027
1055
|
const isActiveBtn = i === activeSlideIndex;
|
|
1028
1056
|
const progressBarClassName = isActiveBtn ? 'animate-slide' : '';
|
|
1029
1057
|
const btnTitleClassName = isActiveBtn ? 'text-primary-text' : 'text-secondary-text';
|
|
1030
|
-
return (jsxs("button", { type: "button", onClick: onClick, className: `group relative overflow-hidden border-0 bg-inherit cursor-pointer text-left px-0
|
|
1058
|
+
return (jsxs("button", { type: "button", onClick: onClick, className: `font-sans group relative overflow-hidden border-0 bg-inherit cursor-pointer text-left px-0 pt-4 pb-5 grow basis-0`, children: [jsxs("div", { className: "border-0 border-r border-solid border-main-divider px-6", children: [jsx("div", { className: `text-sm font-medium pb-1 group-hover:text-primary-text ${btnTitleClassName}`, children: slide?.title }), jsx("div", { className: "text-xs text-secondary-text pb-[2px]", children: slide.desc })] }), jsx("div", { className: `absolute bottom-0 left-0 w-full h-[3px] bg-primary-main -translate-x-full ${progressBarClassName}`, style: { animationDuration: `${duration}s`, animationFillMode: 'forwards' } })] }, String(i)));
|
|
1031
1059
|
}
|
|
1032
1060
|
|
|
1033
1061
|
const ProductTile = JSX((props) => {
|
|
@@ -1046,7 +1074,7 @@
|
|
|
1046
1074
|
}
|
|
1047
1075
|
|
|
1048
1076
|
const PromoTile = JSX(({ className, context, title = 'Акции и спецпредложения', date, description, buttons = [], version, }) => {
|
|
1049
|
-
return (jsx(Tile, { className: className, context: context, title: title, buttons: buttons, version: version, children: jsxs("div", { children: [date && jsx("div", { className: "text-sm mb-2", children: formatDate(date) }), jsx("div", { className: "text-base", children: description })] }) }));
|
|
1077
|
+
return (jsx(Tile, { className: className, context: context, title: title, buttons: buttons, version: version, children: jsxs("div", { className: "mt-1.5", children: [date && jsx("div", { className: "text-sm mb-2", children: formatDate(date) }), jsx("div", { className: "text-base", children: description })] }) }));
|
|
1050
1078
|
});
|
|
1051
1079
|
function formatDate(date) {
|
|
1052
1080
|
const dateObj = new Date(date);
|
|
@@ -1068,6 +1096,40 @@
|
|
|
1068
1096
|
return (jsx("div", { className: "flex flex-col items-center text-center relative w-[276px]", children: jsxs("div", { className: "max-w-min", children: [jsx("h5", { className: "font-medium text-xl m-0 mt-4 whitespace-nowrap px-3", children: step.label }), step.description && (jsx("div", { className: "font-normal text-sm text-secondary-text mt-2", children: step.description }))] }) }, String(i)));
|
|
1069
1097
|
};
|
|
1070
1098
|
|
|
1099
|
+
const DIVIDER_CLASSES = 'border-main-divider border border-t-0 border-x-0';
|
|
1100
|
+
const FIRST_CELL_CLASSES = 'w-[354px] flex-shrink-0';
|
|
1101
|
+
const COLS_LENGTH_FOR_SCROLL = 2;
|
|
1102
|
+
const COLUMN_WIDTH = 4 * 80 + 40; // w-80 + pl-10 = 360px
|
|
1103
|
+
|
|
1104
|
+
const TariffsTableCell = JSX(({ cell, isLastRow }) => {
|
|
1105
|
+
const cellWrapperClasses = `first:pl-0 pl-10 w-80 flex-grow flex flex-col border-solid border-main-divider border border-t-0 border-x-0 ${isLastRow ? 'border-t-0 rounded-b-md' : ''}`;
|
|
1106
|
+
const cellClasses = `h-full ${DIVIDER_CLASSES}`;
|
|
1107
|
+
return (jsx("div", { className: cellWrapperClasses, role: "cell", children: jsx("div", { className: cellClasses, children: cell.map((item, i) => renderCellInner(item, i)) }) }));
|
|
1108
|
+
});
|
|
1109
|
+
const renderCellInner = ({ label, description, list, image, buttons }, i) => (jsxs("div", { className: "first:pt-5 last:pb-5", children: [i > 0 && (jsx("div", { className: "border-main-divider border border-solid border-t-0 border-x-0 my-4" })), label && jsx("div", { className: "text-xl font-medium m-0", children: label }), description && jsx("div", { className: "text-sm text-secondary-text", children: description }), list?.items?.length ? (jsx("div", { className: "flex flex-col justify-between items-start", children: jsx("div", { role: "list", children: list.items.map((text, idx) => (jsx(BlockItem, { text: text, version: list.version ?? 'secondary', isDotted: list.isDotted ?? true }, String(idx)))) }) })) : null, image && jsx(Img, { image: image }), buttons?.length
|
|
1110
|
+
? buttons.map(({ icon, ...buttonProps }, idx) => (jsx(Button, { className: `${idx > 0 ? 'ml-3' : ''} w-12 h-12`, appendLeft: icon && jsx(Icon, { name: icon, width: "24px", height: "24px" }), ...buttonProps }, String(idx))))
|
|
1111
|
+
: null] }, String(i)));
|
|
1112
|
+
|
|
1113
|
+
const TariffsTableRow = JSX(({ row: { header, data }, activeCardIndex, isLastRow }) => {
|
|
1114
|
+
return (jsxs(TableRowContainer, { children: [jsx("div", { className: `text-sm py-5 ${FIRST_CELL_CLASSES} ${DIVIDER_CLASSES} ${!isLastRow ? 'border-solid' : ''}`, children: jsxs("div", { className: "flex items-center text-primary-text", children: [header?.icon && (jsx(Icon, { className: "pr-[14px]", name: header.icon, width: "24px", height: "24px" })), header?.title] }) }), data?.length ? (jsx(TableCarouselContainer, { activeCardIndex: activeCardIndex, columnWidth: COLUMN_WIDTH, version: "tariff", children: data.map((cell, i) => (jsx(TariffsTableCell, { cell: cell, isLastRow: isLastRow }, String(i)))) })) : null] }));
|
|
1115
|
+
});
|
|
1116
|
+
|
|
1117
|
+
const TariffsTable = JSX(({ className, context, title, rowHeaders, columns }) => {
|
|
1118
|
+
const [activeCardIndex, setActiveCardIndex] = context.useState(0);
|
|
1119
|
+
const colData = columns?.map(({ data }) => data) || [];
|
|
1120
|
+
const rowData = rowHeaders?.map((header, i) => ({
|
|
1121
|
+
header,
|
|
1122
|
+
data: colData.map((col) => col?.[i] || [{}]),
|
|
1123
|
+
}));
|
|
1124
|
+
const { nextClick, prevClick, isScrollAvailable, showNextButton, showPrevButton } = useComparisonTableScroll({
|
|
1125
|
+
colData,
|
|
1126
|
+
colsLengthForScroll: COLS_LENGTH_FOR_SCROLL,
|
|
1127
|
+
activeCardIndex,
|
|
1128
|
+
setActiveCardIndex,
|
|
1129
|
+
});
|
|
1130
|
+
return (jsxs("section", { className: `bg-white font-sans py-[50px] pl-[50px] overflow-hidden text-primary-text relative ${className || ''}`, children: [jsx(Title, { className: "font-medium m-0 max-w-[47rem] text-center mb-9 mx-auto", children: title }), jsxs("div", { role: "table", children: [rowData?.length ? (jsxs("div", { className: "relative", children: [rowData.map((row, i, { length }) => (jsx(TariffsTableRow, { row: row, isLastRow: i + 1 === length, activeCardIndex: activeCardIndex }, String(i)))), isScrollAvailable ? (jsx("div", { children: jsxs("div", { className: "absolute top-7 right-7 z-10", children: [jsx(ArrowButton, { onClick: nextClick, disabled: !showNextButton, ariaLabel: "\u041F\u0440\u043E\u043B\u0438\u0441\u0442\u0430\u0442\u044C \u0432\u043F\u0440\u0430\u0432\u043E" }), jsx(ArrowButton, { className: "mt-4 rotate-180", onClick: prevClick, disabled: !showPrevButton, ariaLabel: "\u041F\u0440\u043E\u043B\u0438\u0441\u0442\u0430\u0442\u044C \u0432\u043B\u0435\u0432\u043E" })] }) })) : null] })) : null, isScrollAvailable ? (jsx("div", { className: "absolute top-0 right-0 bottom-0 w-[84px] bg-opacity-to-white" })) : null] })] }));
|
|
1131
|
+
});
|
|
1132
|
+
|
|
1071
1133
|
const Blocks = {
|
|
1072
1134
|
Accordion,
|
|
1073
1135
|
BenefitsBlock,
|
|
@@ -1088,6 +1150,7 @@
|
|
|
1088
1150
|
ProductTile,
|
|
1089
1151
|
PromoTile,
|
|
1090
1152
|
StepsBlock,
|
|
1153
|
+
TariffsTable,
|
|
1091
1154
|
TextBlock,
|
|
1092
1155
|
Tile,
|
|
1093
1156
|
};
|
|
@@ -1109,24 +1172,27 @@
|
|
|
1109
1172
|
});
|
|
1110
1173
|
|
|
1111
1174
|
const defaultBlockDecorator = ({ blockClassName, block, render }) => render({ blockClassName, block });
|
|
1112
|
-
const ContentPage = JSX(({ className, context, blocksRegistry, data: { style: pageStyle, blocks, likeControl, colorPalette = 'pc' }, blockDecorator = defaultBlockDecorator, }) => {
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
const { type } = block;
|
|
1116
|
-
if (!(type in blocksRegistry)) {
|
|
1117
|
-
console.warn(`No block with "${type}" is registered`);
|
|
1118
|
-
}
|
|
1119
|
-
const BlockComponent = blocksRegistry[type] || Placeholder;
|
|
1120
|
-
return blockDecorator({
|
|
1121
|
-
blockClassName: style2className(block.style),
|
|
1122
|
-
block,
|
|
1123
|
-
render: (props) => {
|
|
1124
|
-
const { version, content, blocks } = props.block;
|
|
1125
|
-
return (jsx(BlockComponent, { className: props.blockClassName, version: version, context: context, ...content, children: blocks?.length ? blocks.map(renderBlock) : null }, `${type}-${i}`));
|
|
1126
|
-
},
|
|
1127
|
-
}, `block-${i}`);
|
|
1128
|
-
}
|
|
1175
|
+
const ContentPage = JSX(({ className, context, blocksRegistry, data: { style: pageStyle, blocks, slots = {}, likeControl, colorPalette = 'pc' }, blockDecorator = defaultBlockDecorator, }) => {
|
|
1176
|
+
const { header } = slots;
|
|
1177
|
+
return (jsxs("section", { className: `relative ${style2className(pageStyle)} ${className || ''}`, "data-theme": colorPalette, children: [header?.blocks?.length ? (jsx("div", { className: `${style2className(header?.style)}`, children: header.blocks.map((block, i) => renderBlock({ block, blockDecorator, blocksRegistry, context }, i)) })) : null, blocks?.length ? (jsx("div", { className: "container grid grid-cols-12 gap-1", children: blocks.map((block, i) => renderBlock({ block, blockDecorator, blocksRegistry, context }, i)) })) : null, likeControl && (jsx("div", { className: "flex items-end absolute bottom-0 right-0 h-full pointer-events-none", children: jsx(LikeControl, { className: "rounded-tl-lg sticky bottom-0 pointer-events-auto", context: context }) }))] }));
|
|
1129
1178
|
});
|
|
1179
|
+
function renderBlock({ block, blockDecorator, blocksRegistry, context }, i) {
|
|
1180
|
+
const { type } = block;
|
|
1181
|
+
if (!(type in blocksRegistry)) {
|
|
1182
|
+
console.warn(`No block with "${type}" is registered`);
|
|
1183
|
+
}
|
|
1184
|
+
const BlockComponent = blocksRegistry[type] || Placeholder;
|
|
1185
|
+
return blockDecorator({
|
|
1186
|
+
blockClassName: style2className(block.style),
|
|
1187
|
+
block,
|
|
1188
|
+
render: (props) => {
|
|
1189
|
+
const { version, content, blocks } = props.block;
|
|
1190
|
+
return (jsx(BlockComponent, { className: props.blockClassName, version: version, context: context, ...content, children: blocks?.length
|
|
1191
|
+
? blocks.map((block, i) => renderBlock({ block, blockDecorator, blocksRegistry, context }, i))
|
|
1192
|
+
: null }, `${type}-${i}`));
|
|
1193
|
+
},
|
|
1194
|
+
}, `block-${i}`);
|
|
1195
|
+
}
|
|
1130
1196
|
function style2className(style) {
|
|
1131
1197
|
return style ? style.join(' ') : '';
|
|
1132
1198
|
}
|
|
@@ -1139,12 +1205,23 @@
|
|
|
1139
1205
|
});
|
|
1140
1206
|
|
|
1141
1207
|
function toMobilePage(contentPage) {
|
|
1142
|
-
const
|
|
1208
|
+
const { blocks, slots } = contentPage;
|
|
1143
1209
|
return {
|
|
1144
1210
|
...contentPage,
|
|
1145
|
-
blocks,
|
|
1211
|
+
blocks: getMobileBlocks(blocks),
|
|
1212
|
+
slots: slots &&
|
|
1213
|
+
Object.keys(slots).reduce((res, key) => ({
|
|
1214
|
+
...res,
|
|
1215
|
+
[key]: {
|
|
1216
|
+
...slots[key],
|
|
1217
|
+
blocks: getMobileBlocks(slots[key].blocks),
|
|
1218
|
+
},
|
|
1219
|
+
}), {}),
|
|
1146
1220
|
};
|
|
1147
1221
|
}
|
|
1222
|
+
function getMobileBlocks(blocks) {
|
|
1223
|
+
return blocks?.filter(({ mobile }) => !mobile?.hidden).map(toMobileBlock);
|
|
1224
|
+
}
|
|
1148
1225
|
function toMobileBlock(block) {
|
|
1149
1226
|
const { mobile } = block;
|
|
1150
1227
|
if (mobile) {
|
|
@@ -1170,7 +1247,9 @@
|
|
|
1170
1247
|
return (jsx("section", { className: "max-w-[308px] mt-2", role: "list", children: items.map((item, i) => (jsx(BlockItem, { children: jsx("span", { className: "text-sm text-secondary-text", children: item }) }, String(i)))) }));
|
|
1171
1248
|
}
|
|
1172
1249
|
|
|
1173
|
-
const ProductBlock = JSX(
|
|
1250
|
+
const ProductBlock = JSX(
|
|
1251
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
1252
|
+
({ titleSize, image, benefits, ...props } /* Get rid of image and benefits */) => {
|
|
1174
1253
|
const { className } = props;
|
|
1175
1254
|
return (jsx("section", { className: `font-sans bg-white pt-10 pl-[50px] pb-[50px] pr-[7.5rem] ${className || ''}`, children: jsx(ProductBlockInner, { ...props, titleSize: "L" }) }));
|
|
1176
1255
|
});
|
|
@@ -1188,9 +1267,6 @@
|
|
|
1188
1267
|
ProductTile,
|
|
1189
1268
|
TextBlock,
|
|
1190
1269
|
Tile,
|
|
1191
|
-
// TODO StepsBlock,
|
|
1192
|
-
// TODO BenefitsBlock,
|
|
1193
|
-
// TODO ProductGallery
|
|
1194
1270
|
};
|
|
1195
1271
|
|
|
1196
1272
|
exports.Blocks = Blocks;
|