@redneckz/wildless-cms-uni-blocks 0.6.50 → 0.7.1
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 +71 -19
- package/bundle/bundle.umd.min.js +1 -1
- package/bundle/components/CarouselTariffsCard/CarouselTariffsCard.d.ts +1 -1
- package/bundle/components/CarouselTariffsCard/CarouselTariffsCardContent.d.ts +1 -1
- package/bundle/components/LinkDocs/LinkDocsContent.d.ts +4 -0
- package/bundle/components/SwipeListControlBlock/SwipeListControlBlock.d.ts +6 -0
- package/bundle/components/SwipeListControlBlock/SwipeListControlBlockContent.d.ts +5 -0
- package/bundle/ui-kit/SwipeListControl/SwipeListContainer.d.ts +2 -1
- package/bundle/ui-kit/SwipeListControl/SwipeListControlDots.d.ts +2 -0
- package/bundle/ui-kit/SwipeListControl/SwipeListControlProps.d.ts +7 -0
- package/bundle/utils/style.d.ts +1 -0
- package/dist/components/Blocks.js +2 -0
- package/dist/components/Blocks.js.map +1 -1
- package/dist/components/CarouselCard/CarouselCard.js +2 -2
- package/dist/components/CarouselCard/CarouselCard.js.map +1 -1
- package/dist/components/CarouselProgramsCard/CarouselProgramsCard.js +1 -1
- package/dist/components/CarouselProgramsCard/CarouselProgramsCard.js.map +1 -1
- package/dist/components/CarouselTariffsCard/CarouselTariffsCard.d.ts +1 -1
- package/dist/components/CarouselTariffsCard/CarouselTariffsCard.js +12 -9
- package/dist/components/CarouselTariffsCard/CarouselTariffsCard.js.map +1 -1
- package/dist/components/CarouselTariffsCard/CarouselTariffsCardContent.d.ts +1 -1
- package/dist/components/LinkDocs/LinkDocsContent.d.ts +4 -0
- package/dist/components/SwipeListControlBlock/SwipeListControlBlock.d.ts +6 -0
- package/dist/components/SwipeListControlBlock/SwipeListControlBlock.js +14 -0
- package/dist/components/SwipeListControlBlock/SwipeListControlBlock.js.map +1 -0
- package/dist/components/SwipeListControlBlock/SwipeListControlBlockContent.d.ts +5 -0
- package/dist/components/SwipeListControlBlock/SwipeListControlBlockContent.js +2 -0
- package/dist/components/SwipeListControlBlock/SwipeListControlBlockContent.js.map +1 -0
- package/dist/ui-kit/BlockWrapper.js +1 -1
- package/dist/ui-kit/BlockWrapper.js.map +1 -1
- package/dist/ui-kit/SwipeListControl/SwipeListContainer.d.ts +2 -1
- package/dist/ui-kit/SwipeListControl/SwipeListContainer.js +8 -5
- package/dist/ui-kit/SwipeListControl/SwipeListContainer.js.map +1 -1
- package/dist/ui-kit/SwipeListControl/SwipeListControl.js +3 -2
- package/dist/ui-kit/SwipeListControl/SwipeListControl.js.map +1 -1
- package/dist/ui-kit/SwipeListControl/SwipeListControlDots.d.ts +2 -0
- package/dist/ui-kit/SwipeListControl/SwipeListControlDots.js +12 -3
- package/dist/ui-kit/SwipeListControl/SwipeListControlDots.js.map +1 -1
- package/dist/ui-kit/SwipeListControl/SwipeListControlProps.d.ts +7 -0
- package/dist/utils/style.d.ts +1 -0
- package/dist/utils/style.js +5 -0
- package/dist/utils/style.js.map +1 -0
- package/lib/common.css +1 -1
- package/lib/components/Blocks.js +2 -0
- package/lib/components/Blocks.js.map +1 -1
- package/lib/components/CarouselCard/CarouselCard.js +2 -2
- package/lib/components/CarouselCard/CarouselCard.js.map +1 -1
- package/lib/components/CarouselProgramsCard/CarouselProgramsCard.js +1 -1
- package/lib/components/CarouselProgramsCard/CarouselProgramsCard.js.map +1 -1
- package/lib/components/CarouselTariffsCard/CarouselTariffsCard.d.ts +1 -1
- package/lib/components/CarouselTariffsCard/CarouselTariffsCard.js +12 -9
- package/lib/components/CarouselTariffsCard/CarouselTariffsCard.js.map +1 -1
- package/lib/components/CarouselTariffsCard/CarouselTariffsCardContent.d.ts +1 -1
- package/lib/components/LinkDocs/LinkDocsContent.d.ts +4 -0
- package/lib/components/SwipeListControlBlock/SwipeListControlBlock.d.ts +6 -0
- package/lib/components/SwipeListControlBlock/SwipeListControlBlock.fixture.d.ts +5 -0
- package/lib/components/SwipeListControlBlock/SwipeListControlBlock.js +12 -0
- package/lib/components/SwipeListControlBlock/SwipeListControlBlock.js.map +1 -0
- package/lib/components/SwipeListControlBlock/SwipeListControlBlockContent.d.ts +5 -0
- package/lib/components/SwipeListControlBlock/SwipeListControlBlockContent.js +2 -0
- package/lib/components/SwipeListControlBlock/SwipeListControlBlockContent.js.map +1 -0
- package/lib/ui-kit/BlockWrapper.js +1 -1
- package/lib/ui-kit/BlockWrapper.js.map +1 -1
- package/lib/ui-kit/SwipeListControl/SwipeListContainer.d.ts +2 -1
- package/lib/ui-kit/SwipeListControl/SwipeListContainer.js +8 -5
- package/lib/ui-kit/SwipeListControl/SwipeListContainer.js.map +1 -1
- package/lib/ui-kit/SwipeListControl/SwipeListControl.fixture.mobile.d.ts +1 -0
- package/lib/ui-kit/SwipeListControl/SwipeListControl.js +3 -2
- package/lib/ui-kit/SwipeListControl/SwipeListControl.js.map +1 -1
- package/lib/ui-kit/SwipeListControl/SwipeListControlDots.d.ts +2 -0
- package/lib/ui-kit/SwipeListControl/SwipeListControlDots.js +12 -3
- package/lib/ui-kit/SwipeListControl/SwipeListControlDots.js.map +1 -1
- package/lib/ui-kit/SwipeListControl/SwipeListControlProps.d.ts +7 -0
- package/lib/utils/style.d.ts +1 -0
- package/lib/utils/style.js +2 -0
- package/lib/utils/style.js.map +1 -0
- package/mobile/bundle/bundle.umd.js +25 -12
- package/mobile/bundle/bundle.umd.min.js +1 -1
- package/mobile/bundle/components/CarouselTariffsCard/CarouselTariffsCard.d.ts +1 -1
- package/mobile/bundle/components/CarouselTariffsCard/CarouselTariffsCardContent.d.ts +1 -1
- package/mobile/bundle/components/LinkDocs/LinkDocsContent.d.ts +4 -0
- package/mobile/bundle/components/SwipeListControlBlock/SwipeListControlBlock.d.ts +6 -0
- package/mobile/bundle/components/SwipeListControlBlock/SwipeListControlBlockContent.d.ts +5 -0
- package/mobile/bundle/ui-kit/SwipeListControl/SwipeListContainer.d.ts +2 -1
- package/mobile/bundle/ui-kit/SwipeListControl/SwipeListControlDots.d.ts +2 -0
- package/mobile/bundle/ui-kit/SwipeListControl/SwipeListControlProps.d.ts +7 -0
- package/mobile/bundle/utils/style.d.ts +1 -0
- package/mobile/dist/components/CarouselCard/CarouselCard.js +2 -2
- package/mobile/dist/components/CarouselCard/CarouselCard.js.map +1 -1
- package/mobile/dist/components/CarouselProgramsCard/CarouselProgramsCard.js +1 -1
- package/mobile/dist/components/CarouselProgramsCard/CarouselProgramsCard.js.map +1 -1
- package/mobile/dist/components/CarouselTariffsCard/CarouselTariffsCard.d.ts +1 -1
- package/mobile/dist/components/CarouselTariffsCard/CarouselTariffsCard.js +12 -9
- package/mobile/dist/components/CarouselTariffsCard/CarouselTariffsCard.js.map +1 -1
- package/mobile/dist/components/CarouselTariffsCard/CarouselTariffsCardContent.d.ts +1 -1
- package/mobile/dist/components/LinkDocs/LinkDocsContent.d.ts +4 -0
- package/mobile/dist/components/SwipeListControlBlock/SwipeListControlBlock.d.ts +6 -0
- package/mobile/dist/components/SwipeListControlBlock/SwipeListControlBlock.js +14 -0
- package/mobile/dist/components/SwipeListControlBlock/SwipeListControlBlock.js.map +1 -0
- package/mobile/dist/components/SwipeListControlBlock/SwipeListControlBlockContent.d.ts +5 -0
- package/mobile/dist/components/SwipeListControlBlock/SwipeListControlBlockContent.js +2 -0
- package/mobile/dist/components/SwipeListControlBlock/SwipeListControlBlockContent.js.map +1 -0
- package/mobile/dist/ui-kit/BlockWrapper.js +1 -1
- package/mobile/dist/ui-kit/BlockWrapper.js.map +1 -1
- package/mobile/dist/ui-kit/SwipeListControl/SwipeListContainer.d.ts +2 -1
- package/mobile/dist/ui-kit/SwipeListControl/SwipeListContainer.js +8 -5
- package/mobile/dist/ui-kit/SwipeListControl/SwipeListContainer.js.map +1 -1
- package/mobile/dist/ui-kit/SwipeListControl/SwipeListControl.js +3 -2
- package/mobile/dist/ui-kit/SwipeListControl/SwipeListControl.js.map +1 -1
- package/mobile/dist/ui-kit/SwipeListControl/SwipeListControlDots.d.ts +2 -0
- package/mobile/dist/ui-kit/SwipeListControl/SwipeListControlDots.js +12 -3
- package/mobile/dist/ui-kit/SwipeListControl/SwipeListControlDots.js.map +1 -1
- package/mobile/dist/ui-kit/SwipeListControl/SwipeListControlProps.d.ts +7 -0
- package/mobile/dist/utils/style.d.ts +1 -0
- package/mobile/dist/utils/style.js +5 -0
- package/mobile/dist/utils/style.js.map +1 -0
- package/mobile/lib/components/CarouselCard/CarouselCard.js +2 -2
- package/mobile/lib/components/CarouselCard/CarouselCard.js.map +1 -1
- package/mobile/lib/components/CarouselProgramsCard/CarouselProgramsCard.js +1 -1
- package/mobile/lib/components/CarouselProgramsCard/CarouselProgramsCard.js.map +1 -1
- package/mobile/lib/components/CarouselTariffsCard/CarouselTariffsCard.d.ts +1 -1
- package/mobile/lib/components/CarouselTariffsCard/CarouselTariffsCard.js +12 -9
- package/mobile/lib/components/CarouselTariffsCard/CarouselTariffsCard.js.map +1 -1
- package/mobile/lib/components/CarouselTariffsCard/CarouselTariffsCardContent.d.ts +1 -1
- package/mobile/lib/components/LinkDocs/LinkDocsContent.d.ts +4 -0
- package/mobile/lib/components/SwipeListControlBlock/SwipeListControlBlock.d.ts +6 -0
- package/mobile/lib/components/SwipeListControlBlock/SwipeListControlBlock.js +12 -0
- package/mobile/lib/components/SwipeListControlBlock/SwipeListControlBlock.js.map +1 -0
- package/mobile/lib/components/SwipeListControlBlock/SwipeListControlBlockContent.d.ts +5 -0
- package/mobile/lib/components/SwipeListControlBlock/SwipeListControlBlockContent.js +2 -0
- package/mobile/lib/components/SwipeListControlBlock/SwipeListControlBlockContent.js.map +1 -0
- package/mobile/lib/ui-kit/BlockWrapper.js +1 -1
- package/mobile/lib/ui-kit/BlockWrapper.js.map +1 -1
- package/mobile/lib/ui-kit/SwipeListControl/SwipeListContainer.d.ts +2 -1
- package/mobile/lib/ui-kit/SwipeListControl/SwipeListContainer.js +8 -5
- package/mobile/lib/ui-kit/SwipeListControl/SwipeListContainer.js.map +1 -1
- package/mobile/lib/ui-kit/SwipeListControl/SwipeListControl.js +3 -2
- package/mobile/lib/ui-kit/SwipeListControl/SwipeListControl.js.map +1 -1
- package/mobile/lib/ui-kit/SwipeListControl/SwipeListControlDots.d.ts +2 -0
- package/mobile/lib/ui-kit/SwipeListControl/SwipeListControlDots.js +12 -3
- package/mobile/lib/ui-kit/SwipeListControl/SwipeListControlDots.js.map +1 -1
- package/mobile/lib/ui-kit/SwipeListControl/SwipeListControlProps.d.ts +7 -0
- package/mobile/lib/utils/style.d.ts +1 -0
- package/mobile/lib/utils/style.js +2 -0
- package/mobile/lib/utils/style.js.map +1 -0
- package/mobile/src/common.css +11 -0
- package/mobile/src/components/Carousel/Carousel.ui.json +8 -0
- package/mobile/src/components/CarouselCard/CarouselCard.tsx +11 -5
- package/mobile/src/components/CarouselProgramsCard/CarouselProgramsCard.tsx +1 -1
- package/mobile/src/components/CarouselTariffsCard/CarouselTariffsCard.example.json +11 -3
- package/mobile/src/components/CarouselTariffsCard/CarouselTariffsCard.tsx +29 -17
- package/mobile/src/components/CarouselTariffsCard/CarouselTariffsCardContent.ts +1 -1
- package/mobile/src/components/LinkDocs/LinkDocsContent.ts +4 -0
- package/mobile/src/components/SwipeListControlBlock/SwipeListControlBlock.example.json +18 -0
- package/mobile/src/components/SwipeListControlBlock/SwipeListControlBlock.tsx +23 -0
- package/mobile/src/components/SwipeListControlBlock/SwipeListControlBlock.ui.json +1 -0
- package/mobile/src/components/SwipeListControlBlock/SwipeListControlBlockContent.ts +6 -0
- package/mobile/src/ui-kit/BlockWrapper.tsx +1 -1
- package/mobile/src/ui-kit/SwipeListControl/SwipeListContainer.tsx +19 -10
- package/mobile/src/ui-kit/SwipeListControl/SwipeListControl.tsx +6 -2
- package/mobile/src/ui-kit/SwipeListControl/SwipeListControlDots.tsx +20 -4
- package/mobile/src/ui-kit/SwipeListControl/SwipeListControlProps.ts +8 -0
- package/mobile/src/utils/style.ts +2 -0
- package/package.json +2 -2
- package/src/common.css +11 -0
- package/src/components/Blocks.ts +2 -0
- package/src/components/Carousel/Carousel.ui.json +8 -0
- package/src/components/CarouselCard/CarouselCard.tsx +11 -5
- package/src/components/CarouselProgramsCard/CarouselProgramsCard.tsx +1 -1
- package/src/components/CarouselTariffsCard/CarouselTariffsCard.example.json +11 -3
- package/src/components/CarouselTariffsCard/CarouselTariffsCard.fixture.tsx +3 -3
- package/src/components/CarouselTariffsCard/CarouselTariffsCard.tsx +29 -17
- package/src/components/CarouselTariffsCard/CarouselTariffsCardContent.ts +1 -1
- package/src/components/LinkDocs/LinkDocsContent.ts +4 -0
- package/src/components/SwipeListControlBlock/SwipeListControlBlock.example.json +18 -0
- package/src/components/SwipeListControlBlock/SwipeListControlBlock.fixture.tsx +27 -0
- package/src/components/SwipeListControlBlock/SwipeListControlBlock.tsx +23 -0
- package/src/components/SwipeListControlBlock/SwipeListControlBlock.ui.json +1 -0
- package/src/components/SwipeListControlBlock/SwipeListControlBlockContent.ts +6 -0
- package/src/icons/IconName.ts +333 -6
- package/src/ui-kit/BlockWrapper.tsx +1 -1
- package/src/ui-kit/SwipeListControl/SwipeListContainer.tsx +19 -10
- package/src/ui-kit/SwipeListControl/SwipeListControl.fixture.mobile.tsx +6 -1
- package/src/ui-kit/SwipeListControl/SwipeListControl.tsx +6 -2
- package/src/ui-kit/SwipeListControl/SwipeListControlDots.tsx +20 -4
- package/src/ui-kit/SwipeListControl/SwipeListControlProps.ts +8 -0
- package/src/utils/style.ts +2 -0
package/bundle/bundle.umd.js
CHANGED
|
@@ -393,7 +393,7 @@
|
|
|
393
393
|
return ref;
|
|
394
394
|
}
|
|
395
395
|
|
|
396
|
-
const BlockWrapper = JSX(({ className, block, tag = 'section', role, children }) => {
|
|
396
|
+
const BlockWrapper = JSX(({ className = '', block, tag = 'section', role, children }) => {
|
|
397
397
|
const Tag = tag;
|
|
398
398
|
const ref = useBlockIntersectionObserver(block);
|
|
399
399
|
const [isVisible, setVisible] = useState(true);
|
|
@@ -1447,6 +1447,8 @@
|
|
|
1447
1447
|
return Array.isArray(children) ? children.map(mapper) : mapper(children, 0);
|
|
1448
1448
|
};
|
|
1449
1449
|
|
|
1450
|
+
const style = (...atoms) => atoms.filter(Boolean).join(' ');
|
|
1451
|
+
|
|
1450
1452
|
const SwipeListItem = JSX(({ className = '', style, idx, activeIndex, observerOptions, children, onIntersection }) => {
|
|
1451
1453
|
const observerCallback = useCallback((entries) => {
|
|
1452
1454
|
if (entries.length && onIntersection) {
|
|
@@ -1458,7 +1460,7 @@
|
|
|
1458
1460
|
});
|
|
1459
1461
|
|
|
1460
1462
|
const childStyleMap = ['min-w-[100%]', 'min-w-[50%]', 'min-w-[33.33%]', 'min-w-[25%]'];
|
|
1461
|
-
const SwipeListContainer = JSX(({ className = '', containerRef, activeIndex, visibleItemCount = 0, gap = 0, padding = 0, snapAlign = 'snap-center', children, onVisibleItemsChange, onVisibleIndicesChange, }) => {
|
|
1463
|
+
const SwipeListContainer = JSX(({ className = '', containerRef, activeIndex, visibleItemCount = 0, gap = 0, padding = 0, listType = 'horizontal-list', snapAlign = 'snap-center', children, onVisibleItemsChange, onVisibleIndicesChange, }) => {
|
|
1462
1464
|
const observerOptions = {
|
|
1463
1465
|
sensitivity: 1,
|
|
1464
1466
|
rootRef: containerRef,
|
|
@@ -1472,10 +1474,12 @@
|
|
|
1472
1474
|
onVisibleIndicesChange && onVisibleIndicesChange(getVisibleIndices(itemsVisibilityList));
|
|
1473
1475
|
}, [onVisibleItemsChange, onVisibleIndicesChange]);
|
|
1474
1476
|
const additionPadding = visibleItemCount > 0 ? gap * Number(visibleItemCount) - 1 : 0;
|
|
1475
|
-
|
|
1476
|
-
|
|
1477
|
-
|
|
1478
|
-
|
|
1477
|
+
const isHorizontalList = listType === 'horizontal-list';
|
|
1478
|
+
const containerStyle = {
|
|
1479
|
+
...(isHorizontalList ? getContainerStyle(padding, additionPadding) : {}),
|
|
1480
|
+
gap: `${gap}px`,
|
|
1481
|
+
};
|
|
1482
|
+
return (jsx("div", { className: style('box-border overflow-auto no-scrollbar', listType, className), style: containerStyle, role: "list", ref: containerRef, children: mapChildren((child, idx) => (jsx(SwipeListItem, { className: style(snapAlign, visibleItemCount ? childStyleMap[visibleItemCount - 1] : '', listType === 'vertical-list' ? 'h-full' : ''), style: isHorizontalList ? getContainerStyle(padding / 4) : {}, activeIndex: activeIndex, idx: idx, observerOptions: observerOptions, onIntersection: handleIntersection, children: child }, String(idx))))(children) }));
|
|
1479
1483
|
});
|
|
1480
1484
|
// Styles used to compensate outer container padding to get rid of clipping effect
|
|
1481
1485
|
const getContainerStyle = (padding, additionalPadding = 0) => ({
|
|
@@ -1582,10 +1586,10 @@
|
|
|
1582
1586
|
|
|
1583
1587
|
const BLOCK_CLASSES = 'absolute border border-solid border-gray w-full h-full';
|
|
1584
1588
|
const CARD_WIDTH_MAP = {
|
|
1585
|
-
normal: 'min-w-[
|
|
1589
|
+
normal: 'min-w-[970px]',
|
|
1586
1590
|
mini: 'min-w-[355px]',
|
|
1587
1591
|
};
|
|
1588
|
-
const CarouselCard = JSX(({ className = '', button, description, title, version = 'normal' }) => (jsx("section", { className: `flex pb-9 pl-12 ${CARD_WIDTH_MAP[version]} ${className}`, children: jsxs("div", { className: "relative w-full", children: [jsx("div", { className: `${BLOCK_CLASSES} z-10 top-9 right-12 bg-green-dark` }), jsx("div", { className: `${BLOCK_CLASSES} z-10 top-6 right-8 bg-green` }), jsx("div", { className: `${BLOCK_CLASSES} z-10 top-3 right-4 bg-green-light` }), jsxs("div", { className: "relative bg-white z-10
|
|
1592
|
+
const CarouselCard = JSX(({ className = '', button, description, title, version = 'normal' }) => (jsx("section", { className: `flex pb-9 pl-12 border-box ${CARD_WIDTH_MAP[version]} ${className}`, children: jsxs("div", { className: "relative w-full", children: [jsx("div", { className: `${BLOCK_CLASSES} z-10 top-9 right-12 bg-green-dark` }), jsx("div", { className: `${BLOCK_CLASSES} z-10 top-6 right-8 bg-green` }), jsx("div", { className: `${BLOCK_CLASSES} z-10 top-3 right-4 bg-green-light` }), jsxs("div", { className: "relative bg-white z-10 p-10 border border-solid border-green-light", children: [jsx(Headline, { className: "!p-0", title: title, description: description, headlineVersion: "L", align: "text-left" }), button ? jsx("div", { className: "mt-14", children: renderButton({ button }) }) : null] })] }) })));
|
|
1589
1593
|
|
|
1590
1594
|
const cardStyleMap$2 = {
|
|
1591
1595
|
black: 'bg-black',
|
|
@@ -1700,7 +1704,7 @@
|
|
|
1700
1704
|
const renderAdditionalDescription$2 = (additionalDescription, version = 'primary') => additionalDescription ? (jsx("div", { className: "mt-auto", children: jsx(Text, { size: "text-m", font: "font-light", color: descriptionStyleMap[version], children: additionalDescription }) })) : null;
|
|
1701
1705
|
const renderItems$2 = (items, isDotted, version = 'primary') => items?.length ? (jsx(List, { className: `max-w-[308px] mt-2 text-s ${version === 'primary' ? '!text-secondary-text' : ''}`, itemClassName: "text-left", items: items.filter((item) => item?.text).map((item) => item.text), isDotted: isDotted, version: version })) : null;
|
|
1702
1706
|
|
|
1703
|
-
const CarouselProgramsCard = JSX(({ className = '', title, icon, list = [], version = 'primary', ...rest }) => (jsxs(BlockWrapper, { className: `font-sans border border-gray flex min-w-[536px] ${VersionStyleMap[version]} ${className}`, ...rest, children: [jsxs("div", { className: "w-[200px] min-w-[200px] self-
|
|
1707
|
+
const CarouselProgramsCard = JSX(({ className = '', title, icon, list = [], version = 'primary', ...rest }) => (jsxs(BlockWrapper, { className: `font-sans border border-gray flex min-w-[536px] ${VersionStyleMap[version]} ${className}`, ...rest, children: [jsxs("div", { className: "w-[200px] min-w-[200px] self-center", children: [icon?.icon ? jsx(ImgInner, { image: getIconWithVersion(icon), asSVG: true }) : null, icon?.src ? jsx(ImgInner, { image: icon }) : null] }), jsxs("div", { className: "p-8 pl-3 w-full", children: [title ? jsx(Heading, { className: " mb-3.5", headingType: "h5", title: title }) : null, list.length ? jsx("div", { className: "flex flex-col gap-3", children: list?.map(renderList$2) }) : null] })] })));
|
|
1704
1708
|
const renderList$2 = (_, i) => (jsxs("div", { className: "break-words", children: [_.title ? jsx("div", { className: `text-h6`, children: _.title }) : null, _.description ? jsx("span", { className: "text-l-light mt-1", children: _.description }) : null] }, String(i)));
|
|
1705
1709
|
|
|
1706
1710
|
const ICONS_MAP = [
|
|
@@ -1761,19 +1765,20 @@
|
|
|
1761
1765
|
});
|
|
1762
1766
|
const getOmitVersion = (version) => version === 'gray' ? 'primary' : version;
|
|
1763
1767
|
|
|
1764
|
-
const
|
|
1765
|
-
const CarouselTariffsCard = JSX(({ className = '', title, icon, isHighlighting, button,
|
|
1766
|
-
const
|
|
1767
|
-
const
|
|
1768
|
-
const
|
|
1769
|
-
return (jsxs(BlockWrapper, { className: `font-sans relative bg-white border border-gray min-w-[322px] p-8
|
|
1768
|
+
const VISIBLE_CELLS_COUNT = 1;
|
|
1769
|
+
const CarouselTariffsCard = JSX(({ className = '', title, icon, isHighlighting, button, cardCells = [], ...rest }) => {
|
|
1770
|
+
const cellsNode = cardCells.map(renderCardInfo);
|
|
1771
|
+
const visibleCells = cellsNode.slice(0, VISIBLE_CELLS_COUNT);
|
|
1772
|
+
const hiddenCells = cellsNode.slice(VISIBLE_CELLS_COUNT);
|
|
1773
|
+
return (jsxs(BlockWrapper, { className: `font-sans relative bg-white border border-gray min-w-[322px] p-8 flex flex-col
|
|
1770
1774
|
${getHitStyle(isHighlighting)}
|
|
1771
|
-
${className}`, ...rest, children: [isHighlighting ? renderHitIcon() : null,
|
|
1775
|
+
${className}`, ...rest, children: [isHighlighting ? renderHitIcon() : null, renderIconBlock(icon), title ? (jsx(Heading, { className: "text-primary-text text-center pt-2", headingType: "h5", title: title })) : null, button ? jsx(Button, { className: "w-full mt-4", ...button }) : null, cardCells.length ? (jsx(Foldable, { renderFoldableSection: ({ isUnfolded }) => (jsxs("div", { children: [visibleCells, jsx(FoldableSection, { isUnfolded: isUnfolded, children: hiddenCells })] })), renderFoldButton: cardCells.length > 1 ? renderFoldButton$1 : null })) : null] }));
|
|
1772
1776
|
});
|
|
1773
|
-
const
|
|
1777
|
+
const renderIconBlock = (icon) => (jsxs("div", { className: "w-[267px] min-w-[267px] self-center", children: [icon?.src ? jsx(ImgInner, { image: icon }) : null, icon?.icon ? jsx(ImgInner, { image: getIconWithVersion(icon), asSVG: true }) : null] }));
|
|
1778
|
+
const getHitStyle = (isHighlighting) => isHighlighting ? 'mt-9 pt-[70px]' : 'mt-[70px] pt-7';
|
|
1774
1779
|
const renderFoldButton$1 = ({ isUnfolded, onToggle }) => (jsxs("button", { className: "w-full cursor-pointer text-primary-main pt-5 flex justify-between items-center", onClick: onToggle, children: [jsx("div", { children: isUnfolded ? 'Скрыть' : 'Подробнее о тарифе' }), jsx(Icon, { className: "text-primary-text", name: isUnfolded ? 'ArrowUpIcon' : 'ArrowDownIcon', width: "16", height: "16", asSVG: true })] }));
|
|
1775
1780
|
const renderCardInfo = (cell, i) => (jsxs("div", { className: "py-5 border-b border-main-divider", children: [cell?.title ? (jsx("div", { className: "text-secondary-text text-m-light opacity-80", children: cell.title })) : null, cell?.description ? (jsx("div", { className: "text-primary-text text-h6 mt-1", children: cell.description })) : null] }, String(i)));
|
|
1776
|
-
const renderHitIcon = () => (jsxs("div", { className: "absolute -top-7 -right-4 h-[60px] w-[60px] bg-white flex flex-col items-center justify-center shadow-[0_4px_25px_rgba(0,0,0,0.07)]", children: [jsx(Icon, { iconVersion: "black", name: "HeartIcon", width: "23", height: "22", asSVG: true }), jsx("
|
|
1781
|
+
const renderHitIcon = () => (jsxs("div", { className: "absolute -top-7 -right-4 h-[60px] w-[60px] bg-white flex flex-col items-center justify-center rounded-md shadow-[0_4px_25px_rgba(0,0,0,0.07)]", children: [jsx(Icon, { iconVersion: "black", name: "HeartIcon", width: "23", height: "22", asSVG: true }), jsx(Paragraph, { size: "text-s", font: "font-normal", align: "text-center", color: "text-primary-text", children: "\u0425\u0418\u0422" })] }));
|
|
1777
1782
|
|
|
1778
1783
|
const cardStyleMap$1 = {
|
|
1779
1784
|
black: 'bg-black',
|
|
@@ -3654,6 +3659,52 @@
|
|
|
3654
3659
|
const renderStepIcon = (styleMap, version) => ({ icon }, i) => (jsx("div", { className: "flex flex-col items-center text-center", children: jsx("div", { className: `h-[100px] w-[100px] min-w-[100px] min-h-[100px] rounded-full p-[26px] box-border z-10 flex justify-center items-center
|
|
3655
3660
|
${styleMap.iconBackground} ${styleMap.title}`, children: checkIsIconRenderable(icon) ? (jsx(ImgInner, { image: getIconWithVersion(icon || {}, version), width: "48", height: "48", asSVG: true })) : (jsx("span", { className: `text-h4 ${styleMap.iconText}`, children: i + 1 })) }) }, String(i)));
|
|
3656
3661
|
|
|
3662
|
+
const containerStyles = {
|
|
3663
|
+
'horizontal-list': 'mx-auto mt-5 w-fit',
|
|
3664
|
+
'vertical-list': 'absolute flex-col justify-center h-full top-0 left-4',
|
|
3665
|
+
};
|
|
3666
|
+
const activeDotStyles = {
|
|
3667
|
+
'horizontal-list': 'w-6',
|
|
3668
|
+
'vertical-list': 'h-6',
|
|
3669
|
+
};
|
|
3670
|
+
const dotStyle = 'cursor-pointer bg-primary-main rounded-full transition-width duration-300';
|
|
3671
|
+
const inactiveDotStyle = 'w-2 h-2 opacity-30';
|
|
3672
|
+
const SwipeListControlDots = JSX(({ containerRef, activeIndex, dotCount = 0, listType = 'horizontal-list' }) => {
|
|
3673
|
+
const handleClick = (idx) => {
|
|
3674
|
+
if (idx !== activeIndex && containerRef?.current) {
|
|
3675
|
+
containerRef.current.children[idx]?.scrollIntoView({
|
|
3676
|
+
behavior: 'smooth',
|
|
3677
|
+
block: 'nearest',
|
|
3678
|
+
});
|
|
3679
|
+
}
|
|
3680
|
+
};
|
|
3681
|
+
return dotCount ? (jsx("div", { className: `flex gap-2 ${containerStyles[listType]}`, children: new Array(dotCount).fill(null).map((_, idx) => (jsx("div", { className: `${dotStyle} ${idx === activeIndex ? activeDotStyles[listType] : inactiveDotStyle}`, role: "button", "aria-hidden": true, onClick: () => handleClick(idx) }, String(idx)))) })) : null;
|
|
3682
|
+
});
|
|
3683
|
+
|
|
3684
|
+
const DEFAULT_GAP = 14;
|
|
3685
|
+
/*
|
|
3686
|
+
Horizontal padding used on a container above SwipeListControl.
|
|
3687
|
+
Same value used on a SwipeListControlChildren container to compensate it
|
|
3688
|
+
and get rid of a clipping effect caused by overflow: hidden.
|
|
3689
|
+
*/
|
|
3690
|
+
const DEFAULT_PADDING = 16;
|
|
3691
|
+
const SwipeListControl = JSX(({ className = '', gap = DEFAULT_GAP, padding = DEFAULT_PADDING, showDots = true, children, onVisibleIndicesChange, listType = 'horizontal-list', }) => {
|
|
3692
|
+
const itemCount = Array.isArray(children) ? children.length : 0;
|
|
3693
|
+
const [containerRef, scroll] = useSwipeListScroll({
|
|
3694
|
+
itemCount,
|
|
3695
|
+
onVisibleIndicesChange,
|
|
3696
|
+
});
|
|
3697
|
+
const [activeIndex] = scroll.visibleIndicesRange;
|
|
3698
|
+
return (jsxs("div", { className: style(className, listType === 'vertical-list' ? 'relative h-full' : ''), children: [jsx(SwipeListContainer, { containerRef: containerRef, activeIndex: activeIndex, visibleItemCount: 1, gap: gap, padding: padding, onVisibleIndicesChange: scroll.handleVisibleIndicesChange, listType: listType, children: children }), showDots ? (jsx(SwipeListControlDots, { containerRef: containerRef, activeIndex: activeIndex, dotCount: itemCount, listType: listType })) : null] }));
|
|
3699
|
+
});
|
|
3700
|
+
|
|
3701
|
+
const SwipeListControlBlock = JSX(({ gap, listType, padding, showDots, options, ...rest }) => {
|
|
3702
|
+
return (jsx(BlockWrapper, { ...rest, children: jsx(SwipeListControl, { gap: gap, listType: listType, padding: padding, showDots: showDots, children: renderChildren({ ...rest, options }) }) }));
|
|
3703
|
+
});
|
|
3704
|
+
SwipeListControlBlock.childrenTypes = {
|
|
3705
|
+
exclude: ['SwipeListControlBlock'],
|
|
3706
|
+
};
|
|
3707
|
+
|
|
3657
3708
|
const LINK_CLASSES = 'h-12 flex-1 flex items-center justify-center cursor-pointer';
|
|
3658
3709
|
const ACTIVE_LINK_CLASSES = 'bg-primary-main';
|
|
3659
3710
|
const INACTIVE_LINK_CLASSES = 'group bg-white';
|
|
@@ -4017,6 +4068,7 @@
|
|
|
4017
4068
|
RollupItem,
|
|
4018
4069
|
SafeDepositRental,
|
|
4019
4070
|
StepsBlock,
|
|
4071
|
+
SwipeListControlBlock,
|
|
4020
4072
|
Tabs,
|
|
4021
4073
|
TariffsTable,
|
|
4022
4074
|
TextBlock,
|
|
@@ -4150,7 +4202,7 @@
|
|
|
4150
4202
|
return (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" }) }));
|
|
4151
4203
|
}
|
|
4152
4204
|
|
|
4153
|
-
const packageVersion = "0.
|
|
4205
|
+
const packageVersion = "0.7.1";
|
|
4154
4206
|
|
|
4155
4207
|
exports.Blocks = Blocks;
|
|
4156
4208
|
exports.ContentPage = ContentPage;
|