@redneckz/wildless-cms-uni-blocks 0.2.93 → 0.2.97
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 +134 -78
- package/bundle/bundle.umd.min.js +1 -1
- package/dist/components/Accordion/AccordionBlocks.d.ts +1 -2
- package/dist/components/Accordion/AccordionBlocks.js +2 -2
- package/dist/components/Accordion/AccordionBlocks.js.map +1 -1
- package/dist/components/Accordion/AccordionItem.js +3 -6
- package/dist/components/Accordion/AccordionItem.js.map +1 -1
- package/dist/components/BaseTile/BaseTile.js +9 -4
- package/dist/components/BaseTile/BaseTile.js.map +1 -1
- package/dist/components/ComparisonTable/ComparisonTableContent.d.ts +2 -3
- 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/toMobilePage.js +13 -2
- package/dist/components/ContentPage/toMobilePage.js.map +1 -1
- package/dist/components/CreditCalculator/CreditCalculator.js +3 -3
- package/dist/components/CreditCalculator/CreditCalculator.js.map +1 -1
- package/dist/components/Footer/Footer.js +1 -1
- package/dist/components/Footer/Footer.js.map +1 -1
- package/dist/components/Footer/Sitemap.js +1 -1
- package/dist/components/Footer/Sitemap.js.map +1 -1
- package/dist/components/Gallery/Gallery.mobile.js +1 -1
- package/dist/components/Gallery/Gallery.mobile.js.map +1 -1
- package/dist/components/Gallery/GalleryCardInner.d.ts +2 -0
- package/dist/components/Gallery/GalleryCardInner.js +19 -0
- package/dist/components/Gallery/GalleryCardInner.js.map +1 -0
- package/dist/components/Gallery/GalleryContainer.d.ts +13 -0
- package/dist/components/Gallery/GalleryContainer.js +16 -0
- package/dist/components/Gallery/GalleryContainer.js.map +1 -0
- package/dist/components/Gallery/GalleryContent.d.ts +8 -2
- package/dist/components/Gallery/GalleryInner.d.ts +1 -1
- package/dist/components/Gallery/GalleryInner.js +8 -36
- package/dist/components/Gallery/GalleryInner.js.map +1 -1
- package/dist/components/Gallery/constants.d.ts +6 -0
- package/dist/components/Gallery/constants.js +19 -0
- package/dist/components/Gallery/constants.js.map +1 -0
- package/dist/components/Header/Header.js +3 -3
- package/dist/components/Header/Header.js.map +1 -1
- package/dist/components/LinkDocs/LinkDocs.js +3 -3
- package/dist/components/LinkDocs/LinkDocs.js.map +1 -1
- package/dist/components/LinkDocs/LinkDocsContent.d.ts +3 -3
- package/dist/components/ProductBlock/ProductBlock.d.ts +1 -1
- package/dist/components/ProductBlock/ProductBlock.js +12 -4
- package/dist/components/ProductBlock/ProductBlock.js.map +1 -1
- package/dist/components/ProductBlock/ProductBlockContent.d.ts +13 -2
- package/dist/components/ProductBlock/ProductBlockInner.js +16 -4
- package/dist/components/ProductBlock/ProductBlockInner.js.map +1 -1
- package/dist/components/ProductTile/ProductTileContent.d.ts +2 -2
- package/dist/components/TariffsTable/TariffsTableContent.d.ts +5 -1
- package/dist/components/TextBlock/TextBlockContent.d.ts +1 -0
- package/dist/components/Tile/TileContent.d.ts +1 -1
- package/dist/model/ButtonVersion.d.ts +1 -0
- package/dist/model/LinkProps.d.ts +2 -1
- package/dist/types.d.ts +8 -0
- package/dist/ui-kit/BlockItem/BlockItem.js +4 -4
- package/dist/ui-kit/BlockItem/BlockItem.js.map +1 -1
- package/dist/ui-kit/Button/ButtonProps.d.ts +6 -1
- package/dist/ui-kit/Checkbox/Checkbox.js +2 -2
- package/dist/ui-kit/Checkbox/Checkbox.js.map +1 -1
- package/dist/ui-kit/Icon/Icon.js +1 -1
- package/dist/ui-kit/Icon/Icon.js.map +1 -1
- package/dist/ui-kit/Icon/IconProps.d.ts +49 -41
- package/dist/ui-kit/Icon/IconProps.js +45 -41
- package/dist/ui-kit/Icon/IconProps.js.map +1 -1
- package/dist/ui-kit/Img.js +9 -3
- package/dist/ui-kit/Img.js.map +1 -1
- package/dist/ui-kit/InputRange/InputRange.js +2 -1
- package/dist/ui-kit/InputRange/InputRange.js.map +1 -1
- package/dist/ui-kit/SearchBar.js +1 -1
- package/dist/ui-kit/SearchBar.js.map +1 -1
- package/lib/common.css +1 -1
- package/lib/components/Accordion/AccordionBlocks.d.ts +1 -2
- package/lib/components/Accordion/AccordionBlocks.js +1 -2
- package/lib/components/Accordion/AccordionBlocks.js.map +1 -1
- package/lib/components/Accordion/AccordionItem.js +1 -1
- package/lib/components/Accordion/AccordionItem.js.map +1 -1
- package/lib/components/BaseTile/BaseTile.js +9 -4
- package/lib/components/BaseTile/BaseTile.js.map +1 -1
- package/lib/components/ComparisonTable/ComparisonTableContent.d.ts +2 -3
- 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/toMobilePage.js +13 -2
- package/lib/components/ContentPage/toMobilePage.js.map +1 -1
- package/lib/components/CreditCalculator/CreditCalculator.js +3 -3
- package/lib/components/CreditCalculator/CreditCalculator.js.map +1 -1
- package/lib/components/Footer/Footer.js +1 -1
- package/lib/components/Footer/Footer.js.map +1 -1
- package/lib/components/Footer/Sitemap.js +1 -1
- package/lib/components/Footer/Sitemap.js.map +1 -1
- package/lib/components/Gallery/Gallery.mobile.js +1 -1
- package/lib/components/Gallery/Gallery.mobile.js.map +1 -1
- package/lib/components/Gallery/GalleryCardInner.d.ts +2 -0
- package/lib/components/Gallery/GalleryCardInner.js +17 -0
- package/lib/components/Gallery/GalleryCardInner.js.map +1 -0
- package/lib/components/Gallery/GalleryContainer.d.ts +13 -0
- package/lib/components/Gallery/GalleryContainer.js +14 -0
- package/lib/components/Gallery/GalleryContainer.js.map +1 -0
- package/lib/components/Gallery/GalleryContent.d.ts +8 -2
- package/lib/components/Gallery/GalleryInner.d.ts +1 -1
- package/lib/components/Gallery/GalleryInner.js +6 -34
- package/lib/components/Gallery/GalleryInner.js.map +1 -1
- package/lib/components/Gallery/constants.d.ts +6 -0
- package/lib/components/Gallery/constants.js +17 -0
- package/lib/components/Gallery/constants.js.map +1 -0
- package/lib/components/Header/Header.js +3 -3
- package/lib/components/Header/Header.js.map +1 -1
- package/lib/components/LinkDocs/LinkDocs.fixture.d.ts +3 -3
- package/lib/components/LinkDocs/LinkDocs.js +3 -3
- package/lib/components/LinkDocs/LinkDocs.js.map +1 -1
- package/lib/components/LinkDocs/LinkDocsContent.d.ts +3 -3
- package/lib/components/ProductBlock/ProductBlock.d.ts +1 -1
- package/lib/components/ProductBlock/ProductBlock.fixture.d.ts +1 -0
- package/lib/components/ProductBlock/ProductBlock.js +12 -4
- package/lib/components/ProductBlock/ProductBlock.js.map +1 -1
- package/lib/components/ProductBlock/ProductBlockContent.d.ts +13 -2
- package/lib/components/ProductBlock/ProductBlockInner.js +16 -4
- package/lib/components/ProductBlock/ProductBlockInner.js.map +1 -1
- package/lib/components/ProductTile/ProductTileContent.d.ts +2 -2
- package/lib/components/TariffsTable/TariffsTableContent.d.ts +5 -1
- package/lib/components/TextBlock/TextBlockContent.d.ts +1 -0
- package/lib/components/Tile/TileContent.d.ts +1 -1
- package/lib/model/ButtonVersion.d.ts +1 -0
- package/lib/model/LinkProps.d.ts +2 -1
- package/lib/types.d.ts +8 -0
- package/lib/ui-kit/BlockItem/BlockItem.js +4 -4
- package/lib/ui-kit/BlockItem/BlockItem.js.map +1 -1
- package/lib/ui-kit/Button/ButtonProps.d.ts +6 -1
- package/lib/ui-kit/Checkbox/Checkbox.js +2 -2
- package/lib/ui-kit/Checkbox/Checkbox.js.map +1 -1
- package/lib/ui-kit/Icon/Icon.js +1 -1
- package/lib/ui-kit/Icon/Icon.js.map +1 -1
- package/lib/ui-kit/Icon/IconProps.d.ts +49 -41
- package/lib/ui-kit/Icon/IconProps.js +45 -41
- package/lib/ui-kit/Icon/IconProps.js.map +1 -1
- package/lib/ui-kit/Img.js +9 -3
- package/lib/ui-kit/Img.js.map +1 -1
- package/lib/ui-kit/InputRange/InputRange.js +2 -1
- package/lib/ui-kit/InputRange/InputRange.js.map +1 -1
- package/lib/ui-kit/SearchBar.js +1 -1
- package/lib/ui-kit/SearchBar.js.map +1 -1
- package/package.json +6 -4
- package/src/components/Accordion/Accordion.example.json +4 -4
- package/src/components/Accordion/Accordion.fixture.tsx +5 -1
- package/src/components/Accordion/AccordionBlocks.tsx +1 -3
- package/src/components/Accordion/AccordionItem.tsx +1 -1
- package/src/components/BaseTile/BaseTile.tsx +14 -5
- package/src/components/BenefitsBlock/BenefitsBlock.fixture.tsx +31 -28
- package/src/components/ComparisonTable/ComparisonTable.example.json +1 -1
- package/src/components/ComparisonTable/ComparisonTable.fixture.tsx +43 -53
- package/src/components/ComparisonTable/ComparisonTableContent.ts +2 -3
- package/src/components/ContentPage/ContentPage.page.json +31 -49
- package/src/components/ContentPage/ContentPage.tsx +71 -36
- package/src/components/ContentPage/toMobilePage.ts +19 -2
- package/src/components/CreditCalculator/CreditCalculator.fixture.tsx +9 -1
- package/src/components/CreditCalculator/CreditCalculator.tsx +11 -8
- package/src/components/ExchangeRateTile/ExchangeRateTile.fixture.tsx +1 -1
- package/src/components/Footer/Footer.fixture.tsx +265 -258
- package/src/components/Footer/Footer.tsx +3 -3
- package/src/components/Footer/Sitemap.tsx +1 -1
- package/src/components/Gallery/Gallery.fixture.tsx +52 -48
- package/src/components/Gallery/Gallery.mobile.tsx +1 -3
- package/src/components/Gallery/GalleryCardInner.tsx +53 -0
- package/src/components/Gallery/GalleryContainer.tsx +58 -0
- package/src/components/Gallery/GalleryContent.ts +8 -2
- package/src/components/Gallery/GalleryInner.tsx +15 -94
- package/src/components/Gallery/constants.ts +22 -0
- package/src/components/Header/Header.tsx +14 -12
- package/src/components/Headline/Headline.fixture.tsx +25 -3
- package/src/components/LikeControl/LikeControl.fixture.tsx +5 -1
- package/src/components/LinkDocs/LinkDocs.example.json +26 -0
- package/src/components/LinkDocs/LinkDocs.fixture.tsx +23 -6
- package/src/components/LinkDocs/LinkDocs.tsx +3 -3
- package/src/components/LinkDocs/LinkDocsContent.ts +3 -3
- package/src/components/MiniGallery/MiniGallery.fixture.tsx +12 -22
- package/src/components/MobileAppTile/MobileAppTile.fixture.tsx +3 -1
- package/src/components/PictureText/PictureText.example.json +1 -1
- package/src/components/PictureText/PictureText.fixture.tsx +5 -1
- package/src/components/Placeholder/Placeholder.fixture.tsx +5 -1
- package/src/components/ProductBlock/ProductBlock.example.json +1 -1
- package/src/components/ProductBlock/ProductBlock.fixture.tsx +141 -77
- package/src/components/ProductBlock/ProductBlock.tsx +20 -7
- package/src/components/ProductBlock/ProductBlockContent.ts +14 -2
- package/src/components/ProductBlock/ProductBlockInner.tsx +39 -7
- package/src/components/ProductGallery/ProductGallery.fixture.tsx +96 -93
- package/src/components/ProductTile/ProductTile.example.json +1 -1
- package/src/components/ProductTile/ProductTile.fixture.tsx +4 -4
- package/src/components/ProductTile/ProductTileContent.ts +2 -2
- package/src/components/PromoTile/PromoTile.fixture.tsx +1 -1
- package/src/components/StepsBlock/StepsBlock.fixture.tsx +21 -18
- package/src/components/TariffsTable/TariffsTable.fixture.tsx +5 -16
- package/src/components/TariffsTable/TariffsTableContent.ts +5 -1
- package/src/components/TextBlock/TextBlock.fixture.tsx +62 -45
- package/src/components/TextBlock/TextBlockContent.ts +1 -0
- package/src/components/Tile/Tile.example.json +1 -1
- package/src/components/Tile/Tile.fixture.tsx +11 -8
- package/src/components/Tile/TileContent.ts +1 -1
- package/src/icons/AppleIcon.svg +1 -1
- package/src/icons/CalendarWhiteIcon.svg +17 -0
- package/src/icons/EmptyWalletWhiteIcon.svg +16 -0
- package/src/icons/GridIcon.svg +2 -2
- package/src/icons/PercentageSquareWhiteIcon.svg +16 -0
- package/src/icons/PlayMarketIcon.svg +1 -1
- package/src/model/ButtonVersion.ts +1 -0
- package/src/model/LinkProps.ts +2 -1
- package/src/setup-fixture.ts +1 -2
- package/src/types.ts +11 -1
- package/src/ui-kit/BlockItem/BlockItem.tsx +4 -4
- package/src/ui-kit/Button/ButtonProps.ts +6 -1
- package/src/ui-kit/Checkbox/Checkbox.tsx +7 -3
- package/src/ui-kit/Icon/Icon.tsx +1 -1
- package/src/ui-kit/Icon/IconProps.ts +8 -0
- package/src/ui-kit/Img.tsx +23 -10
- package/src/ui-kit/InputRange/InputRange.tsx +7 -6
- package/src/ui-kit/SearchBar.tsx +3 -4
package/bundle/bundle.umd.js
CHANGED
|
@@ -231,7 +231,7 @@
|
|
|
231
231
|
}
|
|
232
232
|
})();
|
|
233
233
|
|
|
234
|
-
const Icon = JSX(({ className, name, alt = `Icon ${name}`, title = alt, asSVG, ...imgProps }) => {
|
|
234
|
+
const Icon = JSX(({ className = '', name, alt = `Icon ${name}`, title = alt, asSVG, ...imgProps }) => {
|
|
235
235
|
const href = `${projectSettings.CDN || ''}icons/${name}.svg`;
|
|
236
236
|
if (asSVG) {
|
|
237
237
|
return (jsxs("svg", { className: className, ...imgProps, "aria-hidden": "true", children: [title ? jsx("title", { children: title }) : null, alt ? jsx("desc", { children: alt }) : null, jsx("use", { href: `${href}#icon`, xlinkHref: `${href}#icon` })] }));
|
|
@@ -303,12 +303,12 @@
|
|
|
303
303
|
}
|
|
304
304
|
|
|
305
305
|
const listStyleMap = {
|
|
306
|
-
primary: 'bg-
|
|
307
|
-
secondary: 'bg-
|
|
306
|
+
primary: 'bg-secondary-text w-[6px] h-[6px] min-w-[6px] min-h-[6px] mt-2.5 rounded-full',
|
|
307
|
+
secondary: 'bg-white w-[6px] h-[6px] min-w-[6px] min-h-[6px] mt-2.5 rounded-full',
|
|
308
308
|
};
|
|
309
309
|
const textStyleMap = {
|
|
310
|
-
primary: 'text-
|
|
311
|
-
secondary: '
|
|
310
|
+
primary: 'text-secondary-text',
|
|
311
|
+
secondary: '',
|
|
312
312
|
};
|
|
313
313
|
const BlockItem = JSX(({ className, isDotted = true, text, children, version = 'primary' }) => {
|
|
314
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 })] }));
|
|
@@ -336,9 +336,15 @@
|
|
|
336
336
|
return (jsxs("div", { className: buttonInnerClasses, children: [appendLeft ? appendLeft : null, !withoutText ? (jsxs("div", { children: [jsx("div", { className: "text-xxs text-left", children: aboveText }), jsx("div", { className: "text-sm font-medium text-left", children: text })] })) : null] }));
|
|
337
337
|
});
|
|
338
338
|
|
|
339
|
-
const Img = JSX(({ className, image
|
|
340
|
-
|
|
341
|
-
|
|
339
|
+
const Img = JSX(({ className, image: { size, ...image } }) => {
|
|
340
|
+
const style = {
|
|
341
|
+
width: size?.width ? `${size?.width}px` : '100%',
|
|
342
|
+
height: size?.height ? `${size?.height}px` : '100%',
|
|
343
|
+
};
|
|
344
|
+
return (jsxs("picture", { className: `flex-none ${className || ''}`, children: [image.sources?.length
|
|
345
|
+
? image.sources.map(({ src, format }, index) => (jsx("source", { srcSet: src, type: formatToMimeType(format) }, `${index}_${src}`)))
|
|
346
|
+
: null, jsx("img", { src: image.src, alt: image.alt || image.title, title: image.title, style: style, ...size })] }));
|
|
347
|
+
});
|
|
342
348
|
function formatToMimeType(format) {
|
|
343
349
|
return format ? `image/${String(format)}` : undefined;
|
|
344
350
|
}
|
|
@@ -349,6 +355,11 @@
|
|
|
349
355
|
return colSpanStr ? parseInt(colSpanStr.substring(colSpanPrefix.length), 10) : 12;
|
|
350
356
|
};
|
|
351
357
|
|
|
358
|
+
const alignFlex = {
|
|
359
|
+
left: 'justify-between',
|
|
360
|
+
center: 'justify-center',
|
|
361
|
+
right: 'justify-end',
|
|
362
|
+
};
|
|
352
363
|
const alignBlock = {
|
|
353
364
|
left: 'items-start',
|
|
354
365
|
center: 'items-center',
|
|
@@ -359,11 +370,11 @@
|
|
|
359
370
|
center: 'text-center',
|
|
360
371
|
right: 'text-right',
|
|
361
372
|
};
|
|
362
|
-
const TITLE_CLASSES = 'font-medium m-0
|
|
373
|
+
const TITLE_CLASSES = 'font-medium m-0 whitespace-pre-wrap max-w-[600px]';
|
|
363
374
|
const BaseTile = JSX(({ className, context, title, titleSize, description, children, buttons, image, items, version = 'primary', align = 'left', }) => {
|
|
364
375
|
const router = context.useRouter();
|
|
365
376
|
const { handlerDecorator } = context;
|
|
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:
|
|
377
|
+
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 w-full ${alignFlex[align]}`, children: [jsxs("div", { className: `flex flex-col justify-between ${alignBlock[align]}`, children: [jsxs("div", { children: [description ? (jsx("div", { className: `font-normal text-base mt-4 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 })] })] }));
|
|
367
378
|
});
|
|
368
379
|
function getTitleSizeByClassName(className = '') {
|
|
369
380
|
const colSpan = getColSpan(className);
|
|
@@ -380,10 +391,10 @@
|
|
|
380
391
|
function renderItems$1(items = [], version) {
|
|
381
392
|
return (jsx("section", { className: "max-w-[600px] mt-5", role: "list", children: items.map((_, i) => (jsx(BlockItem, { className: i ? 'mt-2.5' : '', text: _, version: version }, String(i)))) }));
|
|
382
393
|
}
|
|
383
|
-
function renderButton$1({ icon, ...button }, i) {
|
|
394
|
+
function renderButton$1({ icon, asSVG, ...button }, i) {
|
|
384
395
|
if (!button?.text)
|
|
385
396
|
return;
|
|
386
|
-
return icon ? (jsx(Button, { appendLeft: jsx(Icon, { name: icon, width: "24", height: "24" }), ...button }, String(i))) : (jsx(Button, { ...button }, String(i)));
|
|
397
|
+
return icon ? (jsx(Button, { appendLeft: jsx(Icon, { name: icon, asSVG: true, width: "24", height: "24" }), ...button }, String(i))) : (jsx(Button, { ...button }, String(i)));
|
|
387
398
|
}
|
|
388
399
|
|
|
389
400
|
const Headline = JSX(({ bgColor = 'bg-white', className, ...props }) => {
|
|
@@ -397,18 +408,18 @@
|
|
|
397
408
|
};
|
|
398
409
|
const titleMarginsStyleMap = {
|
|
399
410
|
double: 'mb-8',
|
|
400
|
-
single: '',
|
|
411
|
+
single: 'mb-[26px]',
|
|
401
412
|
};
|
|
402
413
|
const linkColumnsModeStyleMap = {
|
|
403
414
|
double: 'gap-x-5 gap-y-[26px] flex-wrap',
|
|
404
415
|
single: 'gap-3.5 flex-col',
|
|
405
416
|
};
|
|
406
|
-
const LinkDocs = JSX(({ className, title, align, documents, icon, columnsMode = '
|
|
417
|
+
const LinkDocs = JSX(({ className, title, align, documents, icon, columnsMode = 'double' }) => {
|
|
407
418
|
const containerClasses = linkColumnsModeStyleMap[columnsMode];
|
|
408
419
|
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
420
|
? documents.map(({ text, fileSize, ...linkProps }, i) => (jsxs("a", { className: `group flex text-sm align-middle h-fit
|
|
410
421
|
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-
|
|
422
|
+
${columnsMode === 'double' ? 'basis-[calc(50%-20px)]' : ''}`, role: "listitem", ...linkProps, children: [icon && jsx(Icon, { className: "mr-2.5 h-fit", 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))))
|
|
412
423
|
: null })] }));
|
|
413
424
|
});
|
|
414
425
|
const getExtFromHref = (href) => {
|
|
@@ -486,9 +497,9 @@
|
|
|
486
497
|
: `${contentBlock.scrollHeight}px`;
|
|
487
498
|
};
|
|
488
499
|
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
|
|
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(block, i, context)) : null })) : null] }));
|
|
500
|
+
${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] }));
|
|
490
501
|
});
|
|
491
|
-
const renderBlock = (block, i, context) => {
|
|
502
|
+
const renderBlock$1 = (block, i, context) => {
|
|
492
503
|
const type = block?.accordionBlockType;
|
|
493
504
|
if (!type || !(type in AccordionBlocks)) {
|
|
494
505
|
return null;
|
|
@@ -607,9 +618,9 @@
|
|
|
607
618
|
fill: 'white',
|
|
608
619
|
},
|
|
609
620
|
];
|
|
610
|
-
const Checkbox = JSX(({ text, checked, onChange, className }) => (jsx("div", { className: className, children: jsxs("label", { className: "flex items-center cursor-pointer relative", children: [jsx("input", { className: `peer appearance-none w-5 h-5 border-solid border
|
|
621
|
+
const Checkbox = JSX(({ text, checked, onChange, className }) => (jsx("div", { className: className, children: jsxs("label", { className: "flex items-center cursor-pointer relative", children: [jsx("input", { className: `peer appearance-none w-5 h-5 border-solid border ${checked ? 'border-black' : 'border-main-stroke'} rounded checked:bg-primary-main checked:border-primary-main m-0`, type: "checkbox", onChange: (e) => {
|
|
611
622
|
onChange(e.target.checked);
|
|
612
|
-
}, checked: checked }), jsx(SVG, { paths: CHECK_PATHS, className: "hidden absolute left-
|
|
623
|
+
}, checked: checked }), jsx(SVG, { paths: CHECK_PATHS, className: "hidden absolute left-1 ml-px peer-checked:block", width: "11", height: "9", fill: "white", viewBox: "0 0 11 9" }), text ? (jsx("span", { className: "font-sans ml-3 text-sm leading-5 cursor-pointer", children: text })) : null] }) })));
|
|
613
624
|
|
|
614
625
|
const addSpacesBetweenNumbers = (number) => new Intl.NumberFormat('ru-RU', { maximumSignificantDigits: 3 }).format(number);
|
|
615
626
|
|
|
@@ -631,7 +642,8 @@
|
|
|
631
642
|
if (value > max)
|
|
632
643
|
onChange(max);
|
|
633
644
|
};
|
|
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
|
|
645
|
+
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 border-solid border-main-stroke rounded-md
|
|
646
|
+
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 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 my-3", children: items.map((item, i) => (jsx("span", { className: "text-xs leading-[14px] text-secondary-text pl-4", children: item }, String(i)))) })] }));
|
|
635
647
|
});
|
|
636
648
|
|
|
637
649
|
const clamp = (value, min, max) => Math.max(min, Math.min(value, max));
|
|
@@ -690,7 +702,7 @@
|
|
|
690
702
|
const STEP_MONEY = 1000;
|
|
691
703
|
const STEP_MONTHS = 1;
|
|
692
704
|
const DEFAULT_PAYMENT_TYPE = 'annuity';
|
|
693
|
-
const borderStyle = 'border-solid border-
|
|
705
|
+
const borderStyle = 'border-solid border-[3px] border-primary-main rounded-md';
|
|
694
706
|
const CreditCalculator = JSX(({ context, className, directoryName }) => {
|
|
695
707
|
const [moneyValue, setMoneyValue] = context.useState(undefined);
|
|
696
708
|
const [monthsValue, setMonthsValue] = context.useState(undefined);
|
|
@@ -720,10 +732,10 @@
|
|
|
720
732
|
function handleButtonClick(value) {
|
|
721
733
|
setMonthsValue(clamp(value * MONTHS_IN_YEAR, minMonths, maxMonths));
|
|
722
734
|
}
|
|
723
|
-
return (jsx("section", { className: `font-sans text-primary-text bg-white p-4 ${className}`, children: jsxs("div", { className: `box-border p-
|
|
735
|
+
return (jsx("section", { className: `font-sans text-primary-text bg-white p-4 w-[847px] ${className || ''}`, children: jsxs("div", { className: `box-border p-[49px] pr-[53px] flex flex-col justify-between ${borderStyle}`, children: [jsxs("div", { className: "flex justify-between ", children: [jsxs("div", { className: "grow mr-[42px] w-[465px]", 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: [
|
|
724
736
|
`От ${addSpacesBetweenNumbers(minSum)} рублей`,
|
|
725
737
|
`До ${addSpacesBetweenNumbers(maxSum)} рублей`,
|
|
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-
|
|
738
|
+
], min: minSum, max: maxSum, step: STEP_MONEY, value: moneyValue || defaultSum, onChange: setMoneyValue }), jsx(InputRange, { className: "mt-[23px]", 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: "mt-3 mb-7", 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: "basis-[226px] shrink-0 box-border h-fit p-9 bg-primary-main rounded-md text-white", children: [jsx("div", { className: "text-base mb-[18px]", 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" })] })] }) }));
|
|
727
739
|
});
|
|
728
740
|
function renderButton(number, i, handleClick) {
|
|
729
741
|
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)));
|
|
@@ -805,7 +817,7 @@
|
|
|
805
817
|
const SearchBar = JSX(({ className, context }) => {
|
|
806
818
|
const { term, setTerm } = context.useSearch();
|
|
807
819
|
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' : ''}
|
|
820
|
+
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' : 'border-main-divider'} h-12 pl-12 w-full font-sans font-normal text-base text-black border border-solid 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", className: "absolute font-sans font-normal cursor-pointer text-sm bg-primary-main 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", onClick: (e) => {
|
|
809
821
|
e.preventDefault();
|
|
810
822
|
console.log('click');
|
|
811
823
|
}, children: "\u041D\u0430\u0439\u0442\u0438" }))] }));
|
|
@@ -873,7 +885,7 @@
|
|
|
873
885
|
});
|
|
874
886
|
const renderColumn = (c, index, { router, handlerDecorator }) => {
|
|
875
887
|
const { text, href, items, target } = c;
|
|
876
|
-
return (jsxs("div", { className: "flex flex-col
|
|
888
|
+
return (jsxs("div", { className: "flex flex-col gap-[14px]", children: [jsx("a", { className: "block font-sans font-medium text-base text-primary-text no-underline", href: href, target: target || '_self', children: text || `Раздел ${index}` }), items?.map((_, i) => (jsx(ColumnItem, { ...useLink({ router, handlerDecorator }, _) }, String(i))))] }, String(index)));
|
|
877
889
|
};
|
|
878
890
|
const ColumnItem = JSX(({ text, href, target, index }) => (jsx("a", { className: "block font-sans font-normal text-base text-secondary-text hover:text-primary-main no-underline", href: href, target: target || '_self', children: text || `Раздел ${index}` })));
|
|
879
891
|
|
|
@@ -910,9 +922,17 @@
|
|
|
910
922
|
const LEFT_COL_WIDTH_FULL_HD = 'w-[280px]';
|
|
911
923
|
const LEFT_COL_WIDTH_SMALL_DESKTOP = 'xl:w-[220px]';
|
|
912
924
|
const Footer$1 = JSX(({ className, documents, relatedEnterprises, contacts, socialMedia, topItems, context }) => {
|
|
913
|
-
return (jsxs("footer", { className:
|
|
925
|
+
return (jsxs("footer", { className: `px-9 py-10 bg-white ${className || ''}`, children: [jsxs("div", { className: "flex items-stretch gap-[54px] pb-8 xl:gap-8", children: [jsx(Logo, { className: `${LEFT_COL_WIDTH_FULL_HD} ${LEFT_COL_WIDTH_SMALL_DESKTOP}` }), jsx(SearchBar, { context: context, className: "grow" })] }), jsxs("div", { className: "flex items-stretch gap-[54px] xl:gap-8", children: [jsx(Contacts, { className: `${LEFT_COL_WIDTH_FULL_HD} shrink-0 overflow-hidden ${LEFT_COL_WIDTH_SMALL_DESKTOP}`, items: contacts, context: context, hasButton: true }), jsx(Sitemap, { className: "pt-[3px]", context: context, items: topItems })] }), jsx(SocialMedia, { media: socialMedia, context: context }), jsx(HorizontalNavigation, { links: relatedEnterprises, context: context }), jsx(TextInformation, { links: documents, context: context })] }));
|
|
914
926
|
});
|
|
915
927
|
|
|
928
|
+
const cardVersionMap = {
|
|
929
|
+
primary: 'text-secondary-text',
|
|
930
|
+
secondary: '',
|
|
931
|
+
};
|
|
932
|
+
const galleryLengthForScrollMap = {
|
|
933
|
+
normal: 3,
|
|
934
|
+
mini: 4,
|
|
935
|
+
};
|
|
916
936
|
const cardStyleMap = {
|
|
917
937
|
normal: 'min-w-[364px] w-[364px]',
|
|
918
938
|
mini: 'min-w-[260px] w-[260px]',
|
|
@@ -921,34 +941,36 @@
|
|
|
921
941
|
normal: 380,
|
|
922
942
|
mini: 276,
|
|
923
943
|
};
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
944
|
+
|
|
945
|
+
const GalleryCardInner = JSX(({ title, description, image, items, button, version }) => {
|
|
946
|
+
const cardVersionClasses = cardVersionMap[version ?? 'primary'];
|
|
947
|
+
return (jsxs("div", { children: [jsxs("div", { children: [image?.src ? (jsx("div", { className: "flex justify-center", children: jsx(Img, { className: "mb-6", image: image }) })) : null, title && renderCardTitle(title, description, items), description && (jsx("div", { className: `font-normal text-sm mt-2 ${cardVersionClasses}`, children: description })), items?.length ? (jsx("section", { className: `max-w-[308px] mt-2 ${cardVersionClasses}`, role: "list", children: items.map((item, i) => renderItem(item, i, version)) })) : null] }), button?.href && jsx(Button, { className: "mt-6", ...button })] }));
|
|
948
|
+
});
|
|
949
|
+
function renderCardTitle(title, description, items) {
|
|
950
|
+
return (jsx("div", { className: `font-medium text-xl m-0 ${!description && !items?.length ? 'text-center' : ''}`, children: title }));
|
|
951
|
+
}
|
|
952
|
+
function renderItem(item, i, version) {
|
|
953
|
+
return (jsx(BlockItem, { version: version ?? 'primary', children: jsx("span", { className: "text-sm", children: item }) }, String(i)));
|
|
954
|
+
}
|
|
955
|
+
|
|
956
|
+
const GalleryContainer = JSX(({ context, title, description, cards = [], version = 'normal', activeCardIndex }) => {
|
|
957
|
+
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(Title, { className: "font-medium m-0 text-center", children: 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$1({ card, version, context }, i)) })] }));
|
|
958
|
+
});
|
|
959
|
+
function renderCard$1({ card, version, context }, i) {
|
|
960
|
+
return (jsx(Tile, { context: context, className: `box-border border-solid border rounded-md border-main-divider p-7 mx-2 flex flex-col justify-between
|
|
961
|
+
items-stretch ${cardStyleMap[version]} w-full col-span-4`, version: card.version, children: jsx(GalleryCardInner, { ...card }) }, String(i)));
|
|
962
|
+
}
|
|
963
|
+
|
|
964
|
+
const GalleryInner = JSX(({ context, cards = [], className, version = 'normal', ...rest }) => {
|
|
929
965
|
const [activeCardIndex, setActiveCardIndex] = context.useState(0);
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
}
|
|
933
|
-
function handlePrevClick() {
|
|
934
|
-
setActiveCardIndex(activeCardIndex - 1);
|
|
935
|
-
}
|
|
966
|
+
const handleNextClick = () => setActiveCardIndex(activeCardIndex + 1);
|
|
967
|
+
const handlePrevClick = () => setActiveCardIndex(activeCardIndex - 1);
|
|
936
968
|
const isGalleryScrollAvailable = cards?.length > galleryLengthForScrollMap[version];
|
|
937
969
|
const showNextButton = isGalleryScrollAvailable &&
|
|
938
970
|
cards?.length - activeCardIndex > galleryLengthForScrollMap[version];
|
|
939
971
|
const showPrevButton = isGalleryScrollAvailable && activeCardIndex > 0;
|
|
940
|
-
return (jsxs("section", { className: `relative font-sans text-primary-text bg-white p-
|
|
941
|
-
// Need to place all cards at the center if count of cards less than 4
|
|
942
|
-
className: `flex ${cards?.length <= galleryLengthForScrollMap[version] ? 'justify-center' : ''} duration-1000`,
|
|
943
|
-
// All cards has same width
|
|
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" })] }));
|
|
972
|
+
return (jsxs("section", { className: `relative font-sans text-primary-text bg-white p-[50px] overflow-hidden ${className}`, children: [jsx(GalleryContainer, { context: context, cards: cards, version: version, activeCardIndex: activeCardIndex, ...rest }), 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" })] }));
|
|
945
973
|
});
|
|
946
|
-
function renderCard$1(card, i, version) {
|
|
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)));
|
|
948
|
-
}
|
|
949
|
-
function renderItem(item, i) {
|
|
950
|
-
return (jsx(BlockItem, { children: jsx("span", { className: "text-sm text-secondary-text", children: item }) }, String(i)));
|
|
951
|
-
}
|
|
952
974
|
|
|
953
975
|
const Gallery$1 = JSX((props) => jsx(GalleryInner, { ...props, version: "normal" }));
|
|
954
976
|
|
|
@@ -990,7 +1012,7 @@
|
|
|
990
1012
|
const activeSubItem = subItems?.find(isSubItemActive(router));
|
|
991
1013
|
const topMenu = mergedItems.map((_, i) => (jsx(TopItem, { active: _ === activeTopItem, ...useLink({ router, handlerDecorator }, _), ariaLabel: _.text }, String(i))));
|
|
992
1014
|
const subMenu = subItems?.map((_) => (jsx(HeaderItem, { className: "mr-8", active: _ === activeSubItem, ...useLink({ router, handlerDecorator }, _) }, _.href)));
|
|
993
|
-
return (
|
|
1015
|
+
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 })] }) }));
|
|
994
1016
|
});
|
|
995
1017
|
|
|
996
1018
|
const MiniGallery = JSX((props) => (jsx(GalleryInner, { ...props, version: "mini" })));
|
|
@@ -1009,13 +1031,6 @@
|
|
|
1009
1031
|
const renderShimmerItem = (width = 100, index) => (jsx("div", { style: { width: `${width}%` }, className: "h-4 mt-2 bg-secondary-light" }, String(index)));
|
|
1010
1032
|
const goldenSequence = (first, size) => [first].concat(size > 0 ? goldenSequence(first / GOLDEN_RATIO, size - 1) : []);
|
|
1011
1033
|
|
|
1012
|
-
const ProductBlockInner = JSX(({ className, context, title, titleSize, description, benefits, buttons, image, items }) => {
|
|
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 })] }));
|
|
1014
|
-
});
|
|
1015
|
-
function renderBenefit(benefit, 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", 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)));
|
|
1017
|
-
}
|
|
1018
|
-
|
|
1019
1034
|
const Breadcrumb = JSX(({ text, href, target, onClick, className, children }) => {
|
|
1020
1035
|
if (href) {
|
|
1021
1036
|
return (jsx("a", { className: `no-underline ${className || ''}`, href: href, target: target, onClick: onClick, children: jsx("span", { className: `${className || ''}`, children: text || children }) }));
|
|
@@ -1029,11 +1044,38 @@
|
|
|
1029
1044
|
return (list) => list.reduce((acc, el, i) => (acc.length ? acc.concat({ ...sep, key: i }, el) : [el]), []);
|
|
1030
1045
|
}
|
|
1031
1046
|
|
|
1047
|
+
const benefitIconBgStyleMap = {
|
|
1048
|
+
primary: 'bg-main',
|
|
1049
|
+
secondary: 'bg-white/30',
|
|
1050
|
+
};
|
|
1051
|
+
const benefitTitleStyleMap = {
|
|
1052
|
+
primary: 'text-primary-text',
|
|
1053
|
+
secondary: 'text-white',
|
|
1054
|
+
};
|
|
1055
|
+
const benefitDescStyleMap = {
|
|
1056
|
+
primary: 'text-secondary-text',
|
|
1057
|
+
secondary: 'text-white',
|
|
1058
|
+
};
|
|
1059
|
+
const ProductBlockInner = JSX(({ className, context, title, titleSize, description, benefits, buttons, image, items, version = 'primary', }) => {
|
|
1060
|
+
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, version: version, children: benefits?.length ? (jsx("div", { className: "flex gap-6 mt-6 mb-3.5", children: benefits.map((_, i) => renderBenefit(_, i, version)) })) : null }) }), image?.src && jsx(Img, { className: "mt-auto", image: image })] }));
|
|
1061
|
+
});
|
|
1062
|
+
function renderBenefit(benefit, i, version) {
|
|
1063
|
+
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] rounded-full p-[10px] box-border ${benefitIconBgStyleMap[version]}`, 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-xl m-0 ${benefitTitleStyleMap[version]}`, children: benefit.label }), benefit.description && (jsx("div", { className: `font-normal text-sm ${benefitDescStyleMap[version]}`, children: benefit.description }))] })] }, String(i)));
|
|
1064
|
+
}
|
|
1065
|
+
|
|
1066
|
+
const productBlockStyleMap = {
|
|
1067
|
+
primary: 'bg-white text-primary-text',
|
|
1068
|
+
secondary: 'bg-primary-main text-white',
|
|
1069
|
+
};
|
|
1070
|
+
const breadcrumbsStyleMap = {
|
|
1071
|
+
primary: 'text-secondary-text',
|
|
1072
|
+
secondary: 'text-white/80',
|
|
1073
|
+
};
|
|
1032
1074
|
const ProductBlock$1 = JSX((props) => {
|
|
1033
|
-
const { context, className, breadcrumbs } = props;
|
|
1075
|
+
const { context, className, breadcrumbs, version = 'primary' } = props;
|
|
1034
1076
|
const router = context.useRouter();
|
|
1035
1077
|
const { handlerDecorator } = context;
|
|
1036
|
-
return (jsxs("section", { className: `font-sans
|
|
1078
|
+
return (jsxs("section", { className: `font-sans pt-10 pl-[50px] pb-[50px] pr-[7.5rem] box-border min-h-[420px] ${className || ''} ${productBlockStyleMap[version]}`, children: [breadcrumbs?.length ? (jsx("div", { className: "text-xs mb-6", children: joinList(jsx("span", { className: `mx-2 ${breadcrumbsStyleMap[version]}`, children: "/" }))(breadcrumbs.map((breadcrumb, i) => (jsx(Breadcrumb, { ...useLink({ router, handlerDecorator }, { className: breadcrumbsStyleMap[version], ...breadcrumb }) }, String(i))))) })) : null, jsx(ProductBlockInner, { ...props })] }));
|
|
1037
1079
|
});
|
|
1038
1080
|
|
|
1039
1081
|
const ProductGallery = JSX(({ className, context, duration = 0, slides = [] }) => {
|
|
@@ -1172,24 +1214,27 @@
|
|
|
1172
1214
|
});
|
|
1173
1215
|
|
|
1174
1216
|
const defaultBlockDecorator = ({ blockClassName, block, render }) => render({ blockClassName, block });
|
|
1175
|
-
const ContentPage = JSX(({ className, context, blocksRegistry, data: { style: pageStyle, blocks, likeControl, colorPalette = 'pc' }, blockDecorator = defaultBlockDecorator, }) => {
|
|
1176
|
-
|
|
1177
|
-
|
|
1178
|
-
const { type } = block;
|
|
1179
|
-
if (!(type in blocksRegistry)) {
|
|
1180
|
-
console.warn(`No block with "${type}" is registered`);
|
|
1181
|
-
}
|
|
1182
|
-
const BlockComponent = blocksRegistry[type] || Placeholder;
|
|
1183
|
-
return blockDecorator({
|
|
1184
|
-
blockClassName: style2className(block.style),
|
|
1185
|
-
block,
|
|
1186
|
-
render: (props) => {
|
|
1187
|
-
const { version, content, blocks } = props.block;
|
|
1188
|
-
return (jsx(BlockComponent, { className: props.blockClassName, version: version, context: context, ...content, children: blocks?.length ? blocks.map(renderBlock) : null }, `${type}-${i}`));
|
|
1189
|
-
},
|
|
1190
|
-
}, `block-${i}`);
|
|
1191
|
-
}
|
|
1217
|
+
const ContentPage = JSX(({ className, context, blocksRegistry, data: { style: pageStyle, blocks, slots = {}, likeControl, colorPalette = 'pc' }, blockDecorator = defaultBlockDecorator, }) => {
|
|
1218
|
+
const { header } = slots;
|
|
1219
|
+
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 }) }))] }));
|
|
1192
1220
|
});
|
|
1221
|
+
function renderBlock({ block, blockDecorator, blocksRegistry, context }, i) {
|
|
1222
|
+
const { type } = block;
|
|
1223
|
+
if (!(type in blocksRegistry)) {
|
|
1224
|
+
console.warn(`No block with "${type}" is registered`);
|
|
1225
|
+
}
|
|
1226
|
+
const BlockComponent = blocksRegistry[type] || Placeholder;
|
|
1227
|
+
return blockDecorator({
|
|
1228
|
+
blockClassName: style2className(block.style),
|
|
1229
|
+
block,
|
|
1230
|
+
render: (props) => {
|
|
1231
|
+
const { version, content, blocks } = props.block;
|
|
1232
|
+
return (jsx(BlockComponent, { className: props.blockClassName, version: version, context: context, ...content, children: blocks?.length
|
|
1233
|
+
? blocks.map((block, i) => renderBlock({ block, blockDecorator, blocksRegistry, context }, i))
|
|
1234
|
+
: null }, `${type}-${i}`));
|
|
1235
|
+
},
|
|
1236
|
+
}, `block-${i}`);
|
|
1237
|
+
}
|
|
1193
1238
|
function style2className(style) {
|
|
1194
1239
|
return style ? style.join(' ') : '';
|
|
1195
1240
|
}
|
|
@@ -1202,12 +1247,23 @@
|
|
|
1202
1247
|
});
|
|
1203
1248
|
|
|
1204
1249
|
function toMobilePage(contentPage) {
|
|
1205
|
-
const
|
|
1250
|
+
const { blocks, slots } = contentPage;
|
|
1206
1251
|
return {
|
|
1207
1252
|
...contentPage,
|
|
1208
|
-
blocks,
|
|
1253
|
+
blocks: getMobileBlocks(blocks),
|
|
1254
|
+
slots: slots &&
|
|
1255
|
+
Object.keys(slots).reduce((res, key) => ({
|
|
1256
|
+
...res,
|
|
1257
|
+
[key]: {
|
|
1258
|
+
...slots[key],
|
|
1259
|
+
blocks: getMobileBlocks(slots[key].blocks),
|
|
1260
|
+
},
|
|
1261
|
+
}), {}),
|
|
1209
1262
|
};
|
|
1210
1263
|
}
|
|
1264
|
+
function getMobileBlocks(blocks) {
|
|
1265
|
+
return blocks?.filter(({ mobile }) => !mobile?.hidden).map(toMobileBlock);
|
|
1266
|
+
}
|
|
1211
1267
|
function toMobileBlock(block) {
|
|
1212
1268
|
const { mobile } = block;
|
|
1213
1269
|
if (mobile) {
|
|
@@ -1227,7 +1283,7 @@
|
|
|
1227
1283
|
return (jsxs("section", { className: `relative font-sans text-primary-text bg-white p-4 overflow-hidden ${className}`, children: [jsxs("div", { className: "flex flex-col items-center mb-8", children: [jsx(Title, { className: "font-medium m-0 text-centers", children: title }), description ? (jsx("div", { className: "font-normal text-base max-w-[600px] mt-3", children: description })) : null] }), jsx("div", { className: "horizontal-list no-scrollbar", role: "list", children: cards?.map(renderCard) })] }));
|
|
1228
1284
|
});
|
|
1229
1285
|
function renderCard(card, key) {
|
|
1230
|
-
return (jsxs("div", { className: "box-border horizontal-list-item border-solid border rounded-md border-main-divider p-4 mx-1 flex flex-col justify-between items-stretch", 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 ? renderItems(card.items) : null] }), card
|
|
1286
|
+
return (jsxs("div", { className: "box-border horizontal-list-item border-solid border rounded-md border-main-divider p-4 mx-1 flex flex-col justify-between items-stretch", 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 ? renderItems(card.items) : null] }), card?.button?.href ? jsx(Button, { className: "mt-6", ...card.button }) : null] }, key));
|
|
1231
1287
|
}
|
|
1232
1288
|
function renderItems(items = []) {
|
|
1233
1289
|
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)))) }));
|