@redneckz/wildless-cms-uni-blocks 0.6.29 → 0.6.31
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 +94 -73
- package/bundle/bundle.umd.min.js +1 -1
- package/bundle/components/Carousel/Carousel.d.ts +1 -1
- package/bundle/components/Carousel/CarouselContainer.d.ts +2 -1
- package/bundle/components/Carousel/CarouselContent.d.ts +9 -2
- package/bundle/components/Carousel/CarouselNavButtons.d.ts +11 -0
- package/bundle/components/CarouselCard/CarouselCard.d.ts +1 -1
- package/bundle/components/CarouselCard/CarouselCardContent.d.ts +5 -2
- package/bundle/components/CarouselCard/constants.d.ts +3 -0
- package/bundle/components/CarouselTariffsCard/CarouselTariffsCard.d.ts +5 -0
- package/bundle/components/CarouselTariffsCard/CarouselTariffsCardContent.d.ts +15 -0
- package/bundle/components/ComparisonTable/ComparisonTableRows.d.ts +2 -2
- package/bundle/components/ProductBlock/ProductBlockContent.d.ts +6 -0
- package/bundle/hooks/useCarouselControls.d.ts +13 -0
- package/bundle/icons/IconName.d.ts +4 -2
- package/bundle/ui-kit/Foldable/Foldable.d.ts +1 -1
- package/cosmos-static/icons/HeartIcon.svg +1 -0
- package/dist/components/Blocks.js +7 -5
- package/dist/components/Blocks.js.map +1 -1
- package/dist/components/Carousel/Carousel.d.ts +1 -1
- package/dist/components/Carousel/Carousel.js +6 -6
- package/dist/components/Carousel/Carousel.js.map +1 -1
- package/dist/components/Carousel/CarouselContainer.d.ts +2 -1
- package/dist/components/Carousel/CarouselContainer.js +1 -1
- package/dist/components/Carousel/CarouselContainer.js.map +1 -1
- package/dist/components/Carousel/CarouselContent.d.ts +9 -2
- package/dist/components/Carousel/CarouselContent.js +3 -0
- package/dist/components/Carousel/CarouselContent.js.map +1 -1
- package/dist/components/Carousel/CarouselNavButtons.d.ts +11 -0
- package/dist/components/Carousel/CarouselNavButtons.js +36 -0
- package/dist/components/Carousel/CarouselNavButtons.js.map +1 -0
- package/dist/components/CarouselCard/CarouselCard.d.ts +1 -1
- package/dist/components/CarouselCard/CarouselCard.js +2 -2
- package/dist/components/CarouselCard/CarouselCard.js.map +1 -1
- package/dist/components/CarouselCard/CarouselCardContent.d.ts +5 -2
- package/dist/components/CarouselCard/constants.d.ts +3 -0
- package/dist/components/CarouselCard/constants.js +11 -0
- package/dist/components/CarouselCard/constants.js.map +1 -0
- package/dist/components/CarouselTariffsCard/CarouselTariffsCard.d.ts +5 -0
- package/dist/components/CarouselTariffsCard/CarouselTariffsCard.js +29 -0
- package/dist/components/CarouselTariffsCard/CarouselTariffsCard.js.map +1 -0
- package/dist/components/CarouselTariffsCard/CarouselTariffsCardContent.d.ts +15 -0
- package/dist/components/CarouselTariffsCard/CarouselTariffsCardContent.js +2 -0
- package/dist/components/CarouselTariffsCard/CarouselTariffsCardContent.js.map +1 -0
- package/dist/components/ComparisonTable/ComparisonTableBody.js +2 -2
- package/dist/components/ComparisonTable/ComparisonTableBody.js.map +1 -1
- package/dist/components/ComparisonTable/ComparisonTableRows.d.ts +2 -2
- package/dist/components/ComparisonTable/ComparisonTableRows.js +1 -1
- package/dist/components/ComparisonTable/ComparisonTableRows.js.map +1 -1
- package/dist/components/MobileAppTile/MobileAppTile.js +1 -1
- package/dist/components/ProductBlock/ProductBlockContent.d.ts +6 -0
- package/dist/components/ProductBlock/ProductBlockInner.js +5 -3
- package/dist/components/ProductBlock/ProductBlockInner.js.map +1 -1
- package/dist/components/TariffsTable/TariffsTable.js +3 -3
- package/dist/components/TariffsTable/TariffsTable.js.map +1 -1
- package/dist/hooks/useCarouselControls.d.ts +13 -0
- package/{mobile/dist/hooks/useCarousel.js → dist/hooks/useCarouselControls.js} +6 -6
- package/dist/hooks/useCarouselControls.js.map +1 -0
- package/dist/icons/IconName.d.ts +4 -2
- package/dist/icons/IconName.js +3 -1
- package/dist/icons/IconName.js.map +1 -1
- package/dist/ui-kit/Button/ButtonInner.js +1 -1
- package/dist/ui-kit/Foldable/Foldable.d.ts +1 -1
- package/dist/ui-kit/InnerTable/InnerTableHeader.js +2 -2
- package/dist/ui-kit/InnerTable/InnerTableHeader.js.map +1 -1
- package/lib/common.css +1 -1
- package/lib/components/Blocks.js +7 -5
- package/lib/components/Blocks.js.map +1 -1
- package/lib/components/Carousel/Carousel.d.ts +1 -1
- package/lib/components/Carousel/Carousel.fixture.d.ts +1 -0
- package/lib/components/Carousel/Carousel.js +6 -6
- package/lib/components/Carousel/Carousel.js.map +1 -1
- package/lib/components/Carousel/CarouselContainer.d.ts +2 -1
- package/lib/components/Carousel/CarouselContainer.js +1 -1
- package/lib/components/Carousel/CarouselContainer.js.map +1 -1
- package/lib/components/Carousel/CarouselContent.d.ts +9 -2
- package/lib/components/Carousel/CarouselContent.js +3 -0
- package/lib/components/Carousel/CarouselContent.js.map +1 -1
- package/lib/components/Carousel/CarouselNavButtons.d.ts +11 -0
- package/lib/components/Carousel/CarouselNavButtons.js +34 -0
- package/lib/components/Carousel/CarouselNavButtons.js.map +1 -0
- package/lib/components/CarouselCard/CarouselCard.d.ts +1 -1
- package/lib/components/CarouselCard/CarouselCard.js +2 -2
- package/lib/components/CarouselCard/CarouselCard.js.map +1 -1
- package/lib/components/CarouselCard/CarouselCardContent.d.ts +5 -2
- package/lib/components/CarouselCard/constants.d.ts +3 -0
- package/lib/components/CarouselCard/constants.js +9 -0
- package/lib/components/CarouselCard/constants.js.map +1 -0
- package/lib/components/CarouselTariffsCard/CarouselTariffsCard.d.ts +5 -0
- package/lib/components/CarouselTariffsCard/CarouselTariffsCard.fixture.d.ts +9 -0
- package/lib/components/CarouselTariffsCard/CarouselTariffsCard.js +27 -0
- package/lib/components/CarouselTariffsCard/CarouselTariffsCard.js.map +1 -0
- package/lib/components/CarouselTariffsCard/CarouselTariffsCardContent.d.ts +15 -0
- package/lib/components/CarouselTariffsCard/CarouselTariffsCardContent.js +2 -0
- package/lib/components/CarouselTariffsCard/CarouselTariffsCardContent.js.map +1 -0
- package/lib/components/ComparisonTable/ComparisonTableBody.js +2 -2
- package/lib/components/ComparisonTable/ComparisonTableBody.js.map +1 -1
- package/lib/components/ComparisonTable/ComparisonTableRows.d.ts +2 -2
- package/lib/components/ComparisonTable/ComparisonTableRows.js +1 -1
- package/lib/components/ComparisonTable/ComparisonTableRows.js.map +1 -1
- package/lib/components/MobileAppTile/MobileAppTile.js +1 -1
- package/lib/components/ProductBlock/ProductBlockContent.d.ts +6 -0
- package/lib/components/ProductBlock/ProductBlockInner.js +5 -3
- package/lib/components/ProductBlock/ProductBlockInner.js.map +1 -1
- package/lib/components/TariffsTable/TariffsTable.js +3 -3
- package/lib/components/TariffsTable/TariffsTable.js.map +1 -1
- package/lib/hooks/useCarouselControls.d.ts +13 -0
- package/lib/hooks/{useCarousel.js → useCarouselControls.js} +4 -4
- package/lib/hooks/useCarouselControls.js.map +1 -0
- package/lib/icons/IconName.d.ts +4 -2
- package/lib/icons/IconName.js +3 -1
- package/lib/icons/IconName.js.map +1 -1
- package/lib/ui-kit/Button/ButtonInner.js +1 -1
- package/lib/ui-kit/Foldable/Foldable.d.ts +1 -1
- package/lib/ui-kit/InnerTable/InnerTableHeader.js +2 -2
- package/lib/ui-kit/InnerTable/InnerTableHeader.js.map +1 -1
- package/mobile/bundle/bundle.umd.js +2 -2
- package/mobile/bundle/bundle.umd.min.js +1 -1
- package/mobile/bundle/components/Carousel/Carousel.d.ts +1 -1
- package/mobile/bundle/components/Carousel/CarouselContainer.d.ts +2 -1
- package/mobile/bundle/components/Carousel/CarouselContent.d.ts +9 -2
- package/mobile/bundle/components/Carousel/CarouselNavButtons.d.ts +11 -0
- package/mobile/bundle/components/CarouselCard/CarouselCard.d.ts +1 -1
- package/mobile/bundle/components/CarouselCard/CarouselCardContent.d.ts +5 -2
- package/mobile/bundle/components/CarouselCard/constants.d.ts +3 -0
- package/mobile/bundle/components/CarouselTariffsCard/CarouselTariffsCard.d.ts +5 -0
- package/mobile/bundle/components/CarouselTariffsCard/CarouselTariffsCardContent.d.ts +15 -0
- package/mobile/bundle/components/ComparisonTable/ComparisonTableRows.d.ts +2 -2
- package/mobile/bundle/components/ProductBlock/ProductBlockContent.d.ts +6 -0
- package/mobile/bundle/hooks/useCarouselControls.d.ts +13 -0
- package/mobile/bundle/icons/IconName.d.ts +4 -2
- package/mobile/bundle/ui-kit/Foldable/Foldable.d.ts +1 -1
- package/mobile/dist/components/Carousel/Carousel.d.ts +1 -1
- package/mobile/dist/components/Carousel/Carousel.js +6 -6
- package/mobile/dist/components/Carousel/Carousel.js.map +1 -1
- package/mobile/dist/components/Carousel/CarouselContainer.d.ts +2 -1
- package/mobile/dist/components/Carousel/CarouselContainer.js +1 -1
- package/mobile/dist/components/Carousel/CarouselContainer.js.map +1 -1
- package/mobile/dist/components/Carousel/CarouselContent.d.ts +9 -2
- package/mobile/dist/components/Carousel/CarouselContent.js +3 -0
- package/mobile/dist/components/Carousel/CarouselContent.js.map +1 -1
- package/mobile/dist/components/Carousel/CarouselNavButtons.d.ts +11 -0
- package/mobile/dist/components/Carousel/CarouselNavButtons.js +36 -0
- package/mobile/dist/components/Carousel/CarouselNavButtons.js.map +1 -0
- package/mobile/dist/components/CarouselCard/CarouselCard.d.ts +1 -1
- package/mobile/dist/components/CarouselCard/CarouselCard.js +2 -2
- package/mobile/dist/components/CarouselCard/CarouselCard.js.map +1 -1
- package/mobile/dist/components/CarouselCard/CarouselCardContent.d.ts +5 -2
- package/mobile/dist/components/CarouselCard/constants.d.ts +3 -0
- package/mobile/dist/components/CarouselCard/constants.js +11 -0
- package/mobile/dist/components/CarouselCard/constants.js.map +1 -0
- package/mobile/dist/components/CarouselTariffsCard/CarouselTariffsCard.d.ts +5 -0
- package/mobile/dist/components/CarouselTariffsCard/CarouselTariffsCard.js +29 -0
- package/mobile/dist/components/CarouselTariffsCard/CarouselTariffsCard.js.map +1 -0
- package/mobile/dist/components/CarouselTariffsCard/CarouselTariffsCardContent.d.ts +15 -0
- package/mobile/dist/components/CarouselTariffsCard/CarouselTariffsCardContent.js +2 -0
- package/mobile/dist/components/CarouselTariffsCard/CarouselTariffsCardContent.js.map +1 -0
- package/mobile/dist/components/ComparisonTable/ComparisonTableBody.js +2 -2
- package/mobile/dist/components/ComparisonTable/ComparisonTableBody.js.map +1 -1
- package/mobile/dist/components/ComparisonTable/ComparisonTableRows.d.ts +2 -2
- package/mobile/dist/components/ComparisonTable/ComparisonTableRows.js +1 -1
- package/mobile/dist/components/ComparisonTable/ComparisonTableRows.js.map +1 -1
- package/mobile/dist/components/ProductBlock/ProductBlockContent.d.ts +6 -0
- package/mobile/dist/hooks/useCarouselControls.d.ts +13 -0
- package/{dist/hooks/useCarousel.js → mobile/dist/hooks/useCarouselControls.js} +6 -6
- package/mobile/dist/hooks/useCarouselControls.js.map +1 -0
- package/mobile/dist/icons/IconName.d.ts +4 -2
- package/mobile/dist/icons/IconName.js +3 -1
- package/mobile/dist/icons/IconName.js.map +1 -1
- package/mobile/dist/ui-kit/Button/ButtonInner.js +1 -1
- package/mobile/dist/ui-kit/Foldable/Foldable.d.ts +1 -1
- package/mobile/dist/ui-kit/InnerTable/InnerTableHeader.js +2 -2
- package/mobile/dist/ui-kit/InnerTable/InnerTableHeader.js.map +1 -1
- package/mobile/lib/components/Carousel/Carousel.d.ts +1 -1
- package/mobile/lib/components/Carousel/Carousel.js +6 -6
- package/mobile/lib/components/Carousel/Carousel.js.map +1 -1
- package/mobile/lib/components/Carousel/CarouselContainer.d.ts +2 -1
- package/mobile/lib/components/Carousel/CarouselContainer.js +1 -1
- package/mobile/lib/components/Carousel/CarouselContainer.js.map +1 -1
- package/mobile/lib/components/Carousel/CarouselContent.d.ts +9 -2
- package/mobile/lib/components/Carousel/CarouselContent.js +3 -0
- package/mobile/lib/components/Carousel/CarouselContent.js.map +1 -1
- package/mobile/lib/components/Carousel/CarouselNavButtons.d.ts +11 -0
- package/mobile/lib/components/Carousel/CarouselNavButtons.js +34 -0
- package/mobile/lib/components/Carousel/CarouselNavButtons.js.map +1 -0
- package/mobile/lib/components/CarouselCard/CarouselCard.d.ts +1 -1
- package/mobile/lib/components/CarouselCard/CarouselCard.js +2 -2
- package/mobile/lib/components/CarouselCard/CarouselCard.js.map +1 -1
- package/mobile/lib/components/CarouselCard/CarouselCardContent.d.ts +5 -2
- package/mobile/lib/components/CarouselCard/constants.d.ts +3 -0
- package/mobile/lib/components/CarouselCard/constants.js +9 -0
- package/mobile/lib/components/CarouselCard/constants.js.map +1 -0
- package/mobile/lib/components/CarouselTariffsCard/CarouselTariffsCard.d.ts +5 -0
- package/mobile/lib/components/CarouselTariffsCard/CarouselTariffsCard.js +27 -0
- package/mobile/lib/components/CarouselTariffsCard/CarouselTariffsCard.js.map +1 -0
- package/mobile/lib/components/CarouselTariffsCard/CarouselTariffsCardContent.d.ts +15 -0
- package/mobile/lib/components/CarouselTariffsCard/CarouselTariffsCardContent.js +2 -0
- package/mobile/lib/components/CarouselTariffsCard/CarouselTariffsCardContent.js.map +1 -0
- package/mobile/lib/components/ComparisonTable/ComparisonTableBody.js +2 -2
- package/mobile/lib/components/ComparisonTable/ComparisonTableBody.js.map +1 -1
- package/mobile/lib/components/ComparisonTable/ComparisonTableRows.d.ts +2 -2
- package/mobile/lib/components/ComparisonTable/ComparisonTableRows.js +1 -1
- package/mobile/lib/components/ComparisonTable/ComparisonTableRows.js.map +1 -1
- package/mobile/lib/components/ProductBlock/ProductBlockContent.d.ts +6 -0
- package/mobile/lib/hooks/useCarouselControls.d.ts +13 -0
- package/mobile/lib/hooks/{useCarousel.js → useCarouselControls.js} +4 -4
- package/mobile/lib/hooks/useCarouselControls.js.map +1 -0
- package/mobile/lib/icons/IconName.d.ts +4 -2
- package/mobile/lib/icons/IconName.js +3 -1
- package/mobile/lib/icons/IconName.js.map +1 -1
- package/mobile/lib/ui-kit/Button/ButtonInner.js +1 -1
- package/mobile/lib/ui-kit/Foldable/Foldable.d.ts +1 -1
- package/mobile/lib/ui-kit/InnerTable/InnerTableHeader.js +2 -2
- package/mobile/lib/ui-kit/InnerTable/InnerTableHeader.js.map +1 -1
- package/mobile/src/components/Carousel/Carousel.tsx +7 -8
- package/mobile/src/components/Carousel/CarouselContainer.tsx +3 -2
- package/mobile/src/components/Carousel/CarouselContent.ts +10 -2
- package/mobile/src/components/Carousel/CarouselNavButtons.tsx +51 -0
- package/mobile/src/components/CarouselCard/CarouselCard.tsx +4 -4
- package/mobile/src/components/CarouselCard/CarouselCardContent.ts +5 -2
- package/mobile/src/components/CarouselCard/constants.ts +11 -0
- package/mobile/src/components/CarouselTariffsCard/CarouselTariffsCard.example.json +24 -0
- package/mobile/src/components/CarouselTariffsCard/CarouselTariffsCard.tsx +93 -0
- package/mobile/src/components/CarouselTariffsCard/CarouselTariffsCard.ui.json +1 -0
- package/mobile/src/components/CarouselTariffsCard/CarouselTariffsCardContent.ts +16 -0
- package/mobile/src/components/ComparisonTable/ComparisonTableBody.tsx +2 -2
- package/mobile/src/components/ComparisonTable/ComparisonTableRows.tsx +3 -3
- package/mobile/src/components/ProductBlock/ProductBlockContent.ts +6 -0
- package/mobile/src/hooks/{useCarousel.ts → useCarouselControls.ts} +5 -9
- package/mobile/src/icons/HeartIcon.svg +3 -0
- package/mobile/src/icons/IconName.ts +5 -5
- package/mobile/src/ui-kit/Button/ButtonInner.tsx +1 -1
- package/mobile/src/ui-kit/Foldable/Foldable.tsx +1 -1
- package/mobile/src/ui-kit/InnerTable/InnerTableHeader.tsx +9 -2
- package/package.json +1 -1
- package/src/components/Blocks.ts +7 -5
- package/src/components/Carousel/Carousel.fixture.tsx +31 -3
- package/src/components/Carousel/Carousel.tsx +7 -8
- package/src/components/Carousel/CarouselContainer.tsx +3 -2
- package/src/components/Carousel/CarouselContent.ts +10 -2
- package/src/components/Carousel/CarouselNavButtons.tsx +51 -0
- package/src/components/CarouselCard/CarouselCard.fixture.tsx +3 -6
- package/src/components/CarouselCard/CarouselCard.tsx +4 -4
- package/src/components/CarouselCard/CarouselCardContent.ts +5 -2
- package/src/components/CarouselCard/constants.ts +11 -0
- package/src/components/CarouselTariffsCard/CarouselTariffsCard.example.json +24 -0
- package/src/components/CarouselTariffsCard/CarouselTariffsCard.fixture.tsx +64 -0
- package/src/components/CarouselTariffsCard/CarouselTariffsCard.tsx +93 -0
- package/src/components/CarouselTariffsCard/CarouselTariffsCard.ui.json +1 -0
- package/src/components/CarouselTariffsCard/CarouselTariffsCardContent.ts +16 -0
- package/src/components/ComparisonTable/ComparisonTableBody.tsx +2 -2
- package/src/components/ComparisonTable/ComparisonTableRows.tsx +3 -3
- package/src/components/MobileAppTile/MobileAppTile.tsx +1 -1
- package/src/components/ProductBlock/ProductBlock.fixture.tsx +1 -0
- package/src/components/ProductBlock/ProductBlockContent.ts +6 -0
- package/src/components/ProductBlock/ProductBlockInner.tsx +8 -3
- package/src/components/TariffsTable/TariffsTable.tsx +5 -7
- package/src/hooks/{useCarousel.ts → useCarouselControls.ts} +5 -9
- package/src/icons/HeartIcon.svg +3 -0
- package/src/icons/IconName.ts +327 -6
- package/src/model/.CarouselCardVersion.ts.icloud +0 -0
- package/src/ui-kit/Button/ButtonInner.tsx +1 -1
- package/src/ui-kit/Foldable/Foldable.tsx +1 -1
- package/src/ui-kit/InnerTable/InnerTableHeader.tsx +9 -2
- package/bundle/hooks/useCarousel.d.ts +0 -14
- package/dist/hooks/useCarousel.d.ts +0 -14
- package/dist/hooks/useCarousel.js.map +0 -1
- package/lib/hooks/useCarousel.d.ts +0 -14
- package/lib/hooks/useCarousel.js.map +0 -1
- package/mobile/bundle/hooks/useCarousel.d.ts +0 -14
- package/mobile/dist/hooks/useCarousel.d.ts +0 -14
- package/mobile/dist/hooks/useCarousel.js.map +0 -1
- package/mobile/lib/hooks/useCarousel.d.ts +0 -14
- package/mobile/lib/hooks/useCarousel.js.map +0 -1
package/bundle/bundle.umd.js
CHANGED
|
@@ -606,7 +606,7 @@
|
|
|
606
606
|
if (version === 'link') {
|
|
607
607
|
return '';
|
|
608
608
|
}
|
|
609
|
-
const withTextStyle = `gap-2 ${aboveText ? 'py-2.5 px-7' : 'py-4 px-
|
|
609
|
+
const withTextStyle = `gap-2 ${aboveText ? 'py-2.5 px-7' : 'py-4 px-4'}`;
|
|
610
610
|
return [
|
|
611
611
|
'group flex items-center justify-center',
|
|
612
612
|
isWithText(props) ? withTextStyle : 'h-12 w-12',
|
|
@@ -1242,6 +1242,85 @@
|
|
|
1242
1242
|
return (jsxs(BlockWrapper, { className: `p-[50px] flex flex-col items-center font-sans bg-white ${className}`, ...rest, children: [title ? jsx(Heading, { className: "max-w-[684px] pb-9", headingType: "h2", title: title }) : null, jsxs("form", { className: "w-[468px]", method: "POST", action: FORM_URL, children: [jsx(CurrencyInput, { name: AMOUNT_KEY, value: value, onChange: setValue, valid: value === '' || !isDisabled, placeholder: placeholder, label: label }), button?.text ? (jsx("button", { type: "submit", className: `w-full p-4 mt-6 ${buttonStyle} `, disabled: isDisabled, ...link(button), children: button.text })) : null] })] }));
|
|
1243
1243
|
});
|
|
1244
1244
|
|
|
1245
|
+
const useCarouselControls = ({ itemsCount, visibleItemCount = itemsCount, isCyclic, }) => {
|
|
1246
|
+
const [activeIndex, setActiveIndex] = useState(0);
|
|
1247
|
+
const inc = useCallback(() => setActiveIndex((_) => (isCyclic ? (_ + 1) % itemsCount : Math.min(_ + 1, itemsCount - 1))), [isCyclic, itemsCount]);
|
|
1248
|
+
const dec = useCallback(() => setActiveIndex((_) => (isCyclic ? (itemsCount + _ - 1) % itemsCount : Math.max(_ - 1, 0))), [isCyclic, itemsCount]);
|
|
1249
|
+
const isScrollAvailable = itemsCount > visibleItemCount;
|
|
1250
|
+
const isCyclicAndScrollAvailable = isCyclic && isScrollAvailable;
|
|
1251
|
+
const canInc = isCyclicAndScrollAvailable ||
|
|
1252
|
+
(isScrollAvailable && itemsCount - activeIndex > visibleItemCount);
|
|
1253
|
+
const canDec = isCyclicAndScrollAvailable || Boolean(isScrollAvailable && activeIndex > 0);
|
|
1254
|
+
return [
|
|
1255
|
+
activeIndex,
|
|
1256
|
+
{
|
|
1257
|
+
inc,
|
|
1258
|
+
dec,
|
|
1259
|
+
canInc,
|
|
1260
|
+
canDec,
|
|
1261
|
+
},
|
|
1262
|
+
];
|
|
1263
|
+
};
|
|
1264
|
+
|
|
1265
|
+
const CarouselContainer = JSX(({ children, activeItem, cardFullViewCount, cardWidth }) => {
|
|
1266
|
+
const cardFullViewStyles = cardFullViewCount === 1
|
|
1267
|
+
? `translateX(-${activeItem}00%)`
|
|
1268
|
+
: `translateX(-${activeItem * Number(cardWidth)}px)`;
|
|
1269
|
+
return (jsx("div", { className: "w-auto flex flex-1 duration-1000", style: { transform: `${cardFullViewStyles}` }, role: "list", children: children }));
|
|
1270
|
+
});
|
|
1271
|
+
|
|
1272
|
+
const Carousel = JSX(({ cardFullViewCount = 1, children, cardWidth = '1007', className = '', isBlur = true, isCyclic = false, block, ...rest }) => {
|
|
1273
|
+
const blurClasses = isBlur ? 'absolute top-0 bottom-0 w-[84px]' : '';
|
|
1274
|
+
const { blocks: childBlocks } = block || {};
|
|
1275
|
+
const childBlocksLength = childBlocks !== undefined ? childBlocks.length : 0;
|
|
1276
|
+
const isScrollAvailable = childBlocksLength > cardFullViewCount;
|
|
1277
|
+
const [activeIndex, controls] = useCarouselControls({
|
|
1278
|
+
itemsCount: childBlocksLength,
|
|
1279
|
+
visibleItemCount: cardFullViewCount,
|
|
1280
|
+
isCyclic,
|
|
1281
|
+
});
|
|
1282
|
+
const { inc, dec, canDec, canInc } = controls;
|
|
1283
|
+
return (jsxs(BlockWrapper, { className: `box-border h-full relative font-sans flex flex-col justify-center overflow-hidden ${className}`, ...rest, children: [jsx(CarouselContainer, { activeItem: activeIndex, cardFullViewCount: cardFullViewCount, cardWidth: cardWidth, children: children }), isScrollAvailable ? (jsx("div", { children: renderArrows({
|
|
1284
|
+
handler: [dec, inc],
|
|
1285
|
+
isShown: [canDec, canInc],
|
|
1286
|
+
btnClass: ['left-8', 'right-8'],
|
|
1287
|
+
className: 'top-1/2 z-10',
|
|
1288
|
+
}) })) : null, isScrollAvailable ? (jsxs("div", { children: [jsx("div", { className: `${blurClasses} left-0 bg-opacity-from-white` }), jsx("div", { className: `${blurClasses} right-0 bg-opacity-to-white` })] })) : null] }));
|
|
1289
|
+
});
|
|
1290
|
+
Carousel.childrenTypes = ['CarouselCard', 'CarouselTariffsCard'];
|
|
1291
|
+
|
|
1292
|
+
const BLOCK_CLASSES = 'absolute border border-solid border-main-stroke w-[100%] h-[100%]';
|
|
1293
|
+
const CARD_STYLE_MAP = {
|
|
1294
|
+
normal: 'min-w-[100%] justify-center items-center my-7 col-span-12',
|
|
1295
|
+
mini: 'justify-center items-center mx-4 my-9 col-span-4',
|
|
1296
|
+
};
|
|
1297
|
+
const CARD_WIDTH_MAP = {
|
|
1298
|
+
normal: 'w-[1007px]',
|
|
1299
|
+
mini: 'w-[350px]',
|
|
1300
|
+
};
|
|
1301
|
+
const CarouselCard = JSX(({ button, className = '', description, title, version = 'normal' }) => {
|
|
1302
|
+
return (jsx("section", { className: `flex ${CARD_STYLE_MAP[version]}`, children: jsxs("div", { className: `relative ${CARD_WIDTH_MAP[version]}`, children: [jsxs("div", { className: `relative bg-white py-6 px-10 z-10
|
|
1303
|
+
border border-solid border-green-light ${className}`, children: [jsx(Headline, { className: "!p-0", title: title, description: description, headlineVersion: "M", align: "center" }), button ? renderButton({ button, buttonClassName: 'mt-6 w-[158px]' }) : null] }), jsx("div", { className: `top-9 right-12 bg-green-dark ${BLOCK_CLASSES}` }), jsx("div", { className: `top-6 right-8 bg-green ${BLOCK_CLASSES}` }), jsx("div", { className: `top-3 right-4 bg-green-light ${BLOCK_CLASSES}` })] }) }));
|
|
1304
|
+
});
|
|
1305
|
+
|
|
1306
|
+
const CarouselTariffsCard = JSX(({ className = '', title, icon, isHighlighting, button, rows = [], ...rest }) => {
|
|
1307
|
+
const hitStyle = getHitStyle(Boolean(isHighlighting));
|
|
1308
|
+
const rowsNode = rows.map(renderCardInfo);
|
|
1309
|
+
const VISIBLE_ROWS_COUNT = 1;
|
|
1310
|
+
const [visibleRows, hiddenRows] = [
|
|
1311
|
+
rowsNode.slice(0, VISIBLE_ROWS_COUNT),
|
|
1312
|
+
rowsNode.slice(VISIBLE_ROWS_COUNT),
|
|
1313
|
+
];
|
|
1314
|
+
return (jsxs(BlockWrapper, { className: `font-sans bg-white p-[50px] p-8 border border-main-stroke relative w-[322px] min-w-[322px] -ml-[1px] ${hitStyle} ${className}`, ...rest, children: [isHighlighting ? renderHitIcon() : null, icon?.src ? jsx(ImgInner, { className: "flex justify-center", image: icon }) : null, 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, rows?.length ? (jsx(Foldable, { renderFoldableSection: ({ isUnfolded }) => (jsxs("div", { children: [visibleRows, jsx(FoldableSection, { isUnfolded: isUnfolded, children: hiddenRows })] })), renderFoldButton: rows.length > 1 ? renderFoldButton$1 : null })) : null] }));
|
|
1315
|
+
});
|
|
1316
|
+
const getHitStyle = (isHighlighting) => isHighlighting ? 'mt-9 pt-[71px]' : 'mt-[70px] pt-9';
|
|
1317
|
+
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 })] }));
|
|
1318
|
+
const renderCardInfo = (cell) => (jsxs("div", { className: "py-5 border-b border-main-divider flex flex-col gap-1", 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", children: cell.description }) : null] }));
|
|
1319
|
+
const renderHitIcon = () => {
|
|
1320
|
+
const POSITION_STYLE = 'absolute -top-7 -right-4';
|
|
1321
|
+
return (jsxs("div", { className: `h-[60px] w-[60px] bg-white flex flex-col items-center justify-center shadow-[0_4px_25px_rgba(0,0,0,0.07)] ${POSITION_STYLE}`, children: [jsx(Icon, { iconVersion: "black", name: "HeartIcon", width: "23", height: "22", asSVG: true }), jsx("div", { className: "text-center", children: "\u0425\u0438\u0442" })] }));
|
|
1322
|
+
};
|
|
1323
|
+
|
|
1245
1324
|
const cardStyleMap$1 = {
|
|
1246
1325
|
black: 'bg-black',
|
|
1247
1326
|
white: 'bg-white',
|
|
@@ -1267,26 +1346,6 @@
|
|
|
1267
1346
|
}), jsx("div", { className: `${BLUR_BLOCK_CLASSES$2} left-0 bg-opacity-from-white` }), jsx("div", { className: `${BLUR_BLOCK_CLASSES$2} right-0 bg-opacity-to-white` })] }));
|
|
1268
1347
|
});
|
|
1269
1348
|
|
|
1270
|
-
const useCarouselControl = ({ itemsCount, visibleItemCount = itemsCount, isCyclic, }) => {
|
|
1271
|
-
const [activeIndex, setActiveIndex] = useState(0);
|
|
1272
|
-
const inc = useCallback(() => setActiveIndex((_) => (isCyclic ? (_ + 1) % itemsCount : Math.min(_ + 1, itemsCount - 1))), []);
|
|
1273
|
-
const dec = useCallback(() => setActiveIndex((_) => (isCyclic ? (itemsCount + _ - 1) % itemsCount : Math.max(_ - 1, 0))), []);
|
|
1274
|
-
const isScrollAvailable = itemsCount > visibleItemCount;
|
|
1275
|
-
const isCyclicAndScrollAvailable = isCyclic && isScrollAvailable;
|
|
1276
|
-
const canInc = isCyclicAndScrollAvailable ||
|
|
1277
|
-
(isScrollAvailable && itemsCount - activeIndex > visibleItemCount);
|
|
1278
|
-
const canDec = isCyclicAndScrollAvailable || Boolean(isScrollAvailable && activeIndex > 0);
|
|
1279
|
-
return [
|
|
1280
|
-
activeIndex,
|
|
1281
|
-
{
|
|
1282
|
-
inc,
|
|
1283
|
-
dec,
|
|
1284
|
-
canInc,
|
|
1285
|
-
canDec,
|
|
1286
|
-
},
|
|
1287
|
-
];
|
|
1288
|
-
};
|
|
1289
|
-
|
|
1290
1349
|
const GRADIENT = 'bg-gradient-to-r from-main-gradient-start to-main-gradient-end';
|
|
1291
1350
|
const BORDER_CLASSES$1 = 'border-main-stroke border-solid border';
|
|
1292
1351
|
const DIVIDER_CLASSES$1 = 'border-main-divider border border-t-0 border-x-0';
|
|
@@ -1339,7 +1398,7 @@
|
|
|
1339
1398
|
}))
|
|
1340
1399
|
.slice(0, isShowAllRow ? rowHeaders.length : visibleRowLength);
|
|
1341
1400
|
const isScrollAvailable = colData.length > COLS_LENGTH_FOR_SCROLL$1;
|
|
1342
|
-
const [activeIndex, controls] =
|
|
1401
|
+
const [activeIndex, controls] = useCarouselControls({
|
|
1343
1402
|
itemsCount: colData.length,
|
|
1344
1403
|
visibleItemCount: COLS_LENGTH_FOR_SCROLL$1,
|
|
1345
1404
|
});
|
|
@@ -2249,7 +2308,7 @@
|
|
|
2249
2308
|
return (jsxs(BlockWrapper, { className: `flex justify-between font-sans p-9 box-border relative min-h-[320px]
|
|
2250
2309
|
${getTileMinHeight(className)}
|
|
2251
2310
|
${VersionStyleMap[version]}
|
|
2252
|
-
${className}`, ...rest, children: [jsxs(BaseTile, { className: "z-10", title: title ? (jsx(Heading, { headingType: headingType, as: "h3", title: title, className: `whitespace-pre-wrap
|
|
2311
|
+
${className}`, ...rest, children: [jsxs(BaseTile, { className: "z-10", title: title ? (jsx(Heading, { headingType: headingType, as: "h3", title: title, className: `whitespace-pre-wrap mb-6 w-full
|
|
2253
2312
|
${textColorClass} ${AlignText[alignTitle]}` })) : null, buttons: buttons?.length ? (jsx(ButtonSection, { buttons: buttonsWithClass, className: "flex gap-4", ...rest })) : null, children: [renderDescription$1(description), jsxs("div", { className: "flex flex-1 items-center", children: [qr?.src ? (jsx("div", { className: `flex justify-center mr-5 bg-white rounded-md ${containerStyle}`, children: jsx(ImgInner, { className: "w-fit", image: qr }) })) : null, renderList$1(version, items)] })] }), image?.src ? (jsx("div", { className: "absolute right-0 bottom-0", children: jsx(ImgInner, { image: image }) })) : null] }));
|
|
2254
2313
|
});
|
|
2255
2314
|
const renderList$1 = (version, items) => {
|
|
@@ -2786,12 +2845,14 @@
|
|
|
2786
2845
|
|
|
2787
2846
|
const renderBenefit$1 = (version = 'primary', benefitsVersion = 'normal') => ({ icon, label, description }, i) => (jsx(BenefitItem, { icon: icon, label: label, description: description, version: version, benefitsVersion: benefitsVersion }, String(i)));
|
|
2788
2847
|
|
|
2789
|
-
const ProductBlockInner = JSX(({ className = '', title, headlineVersion = 'L', description, benefits, benefitsVersion, buttons, image, items, version = 'primary', isDotted = true, textBlockClassName = '', ...rest }) => {
|
|
2848
|
+
const ProductBlockInner = JSX(({ className = '', title, headlineVersion = 'L', description, benefitsCountOfRow = 3, benefits, benefitsVersion, buttons, image, items, version = 'primary', isDotted = true, textBlockClassName = '', ...rest }) => {
|
|
2790
2849
|
const benefitsCount = benefits?.filter((_) => _.label)?.length;
|
|
2791
|
-
const benefitsContainerStyles = getBenefitsContainerStyles(
|
|
2850
|
+
const benefitsContainerStyles = getBenefitsContainerStyles(benefitsCountOfRow);
|
|
2792
2851
|
return (jsxs("div", { className: `flex grow justify-between items-stretch h-full ${className}`, children: [jsxs("div", { className: `flex flex-col ${textBlockClassName}`, children: [jsx(Headline, { title: title, description: description, className: `!p-0 max-w-[600px]`, bgColorHeadline: version, headlineVersion: headlineVersion, align: "left", ...rest }), jsxs(BaseTile, { buttons: buttons?.length ? (jsx(ButtonSection, { buttons: buttons, className: "flex gap-4", ...rest })) : null, children: [benefitsCount ? (jsx("div", { className: benefitsContainerStyles, children: benefits.map(renderBenefit$1(version, benefitsVersion)) })) : null, items?.length ? (jsx(List, { className: "mt-5 text-h6", items: items, itemClassName: "mb-[7px]", version: version, isDotted: isDotted })) : null] })] }), image?.src && jsx(ImgInner, { className: "mt-[-50px]", image: image })] }));
|
|
2793
2852
|
});
|
|
2794
|
-
const getBenefitsContainerStyles = (
|
|
2853
|
+
const getBenefitsContainerStyles = (benefitsCountOfRow = 2) => `gap-6 mt-6 ${benefitsCountOfRow > 2
|
|
2854
|
+
? 'inline-grid grid-cols-[auto_auto_auto]'
|
|
2855
|
+
: 'inline-grid grid-cols-[auto_auto]'}`;
|
|
2795
2856
|
|
|
2796
2857
|
function renderBackwardButton(button, version, className) {
|
|
2797
2858
|
const { text, href, target, onClick } = button;
|
|
@@ -3355,7 +3416,7 @@
|
|
|
3355
3416
|
}) }));
|
|
3356
3417
|
});
|
|
3357
3418
|
|
|
3358
|
-
const InnerTableHeader = JSX(({ currencies, linkToPDF, activeTabIndex, setActiveTabIndex }) => (jsxs("div", { className: "flex justify-between w-full pt-2.5 pb-3", children: [currencies && currencies.length > 1 ? (jsx("div", { className: "flex bg-secondary-light p-1.5 rounded-md", children: currencies.map((currency, idx) => (jsx("div", { className: `rounded-md text-xl-light px-4 py-3 cursor-pointer ${idx === activeTabIndex ? 'bg-primary-main text-white' : 'text-secondary-text'}`, onClick: () => setActiveTabIndex(idx), children: currency || idx + 1 }, currency))) })) : null, linkToPDF ? (jsx(Button, { href: linkToPDF, version: "secondary", target: "_blank", appendLeft: jsx(
|
|
3419
|
+
const InnerTableHeader = JSX(({ currencies, linkToPDF, activeTabIndex, setActiveTabIndex }) => (jsxs("div", { className: "flex justify-between w-full pt-2.5 pb-3", children: [currencies && currencies.length > 1 ? (jsx("div", { className: "flex bg-secondary-light p-1.5 rounded-md", children: currencies.map((currency, idx) => (jsx("div", { className: `rounded-md text-xl-light px-4 py-3 cursor-pointer ${idx === activeTabIndex ? 'bg-primary-main text-white' : 'text-secondary-text'}`, onClick: () => setActiveTabIndex(idx), children: currency || idx + 1 }, currency))) })) : null, linkToPDF ? (jsx(Button, { href: linkToPDF, version: "secondary", target: "_blank", appendLeft: jsx(Icon, { name: "DocDownloadIcon", iconVersion: "color", className: "mr-0.5", width: "20", height: "20", asSVG: true }), text: "\u0421\u043A\u0430\u0447\u0430\u0442\u044C \u0432 PDF" })) : null] })));
|
|
3359
3420
|
|
|
3360
3421
|
const EMPTY_DATA = 'Данных нет';
|
|
3361
3422
|
const InnerTable = JSX(({ dataUrl, pdfUrl, onClick }) => {
|
|
@@ -3382,7 +3443,7 @@
|
|
|
3382
3443
|
data: colData.map((col) => col?.[i] || []),
|
|
3383
3444
|
}));
|
|
3384
3445
|
const columnsLength = colData.length;
|
|
3385
|
-
const [activeIndex, controls] =
|
|
3446
|
+
const [activeIndex, controls] = useCarouselControls({
|
|
3386
3447
|
itemsCount: colData.length,
|
|
3387
3448
|
visibleItemCount: COLS_LENGTH_FOR_SCROLL,
|
|
3388
3449
|
});
|
|
@@ -3483,47 +3544,6 @@
|
|
|
3483
3544
|
exclude: ['VerticalLayout'],
|
|
3484
3545
|
};
|
|
3485
3546
|
|
|
3486
|
-
const BLOCK_CLASSES = 'absolute border border-solid border-main-stroke w-[100%] h-[100%]';
|
|
3487
|
-
const CARD_STYLE_MAP = {
|
|
3488
|
-
normal: 'min-w-[100%] justify-center items-center my-7 col-span-12',
|
|
3489
|
-
mini: 'w-1/3 justify-center items-center mx-4 my-9 col-span-4',
|
|
3490
|
-
};
|
|
3491
|
-
const CARD_WIDTH_MAP = {
|
|
3492
|
-
normal: 'w-[1007px]',
|
|
3493
|
-
mini: 'w-[350px]',
|
|
3494
|
-
};
|
|
3495
|
-
const CarouselCard = JSX(({ button, className = '', description, title, version = 'normal' }) => {
|
|
3496
|
-
return (jsx("section", { className: `flex ${CARD_STYLE_MAP[version]}`, children: jsxs("div", { className: `relative ${CARD_WIDTH_MAP[version]}`, children: [jsxs("div", { className: `relative bg-white py-6 px-10 z-10
|
|
3497
|
-
border border-solid border-green-light ${className}`, children: [jsx(Headline, { className: "!p-0", title: title, description: description, headlineVersion: "M", align: "center" }), button ? renderButton({ button, buttonClassName: 'mt-6 w-[158px]' }) : null] }), jsx("div", { className: `top-9 right-12 bg-green-dark ${BLOCK_CLASSES}` }), jsx("div", { className: `top-6 right-8 bg-green ${BLOCK_CLASSES}` }), jsx("div", { className: `top-3 right-4 bg-green-light ${BLOCK_CLASSES}` })] }) }));
|
|
3498
|
-
});
|
|
3499
|
-
|
|
3500
|
-
const CarouselContainer = JSX(({ children, activeItem, cardFullViewCount, cardWidth }) => {
|
|
3501
|
-
const cardFullViewStyles = cardFullViewCount === 1
|
|
3502
|
-
? `translateX(-${activeItem}00%)`
|
|
3503
|
-
: `translateX(-${activeItem * cardWidth}px)`;
|
|
3504
|
-
return (jsx("div", { className: "w-auto flex flex-1 duration-1000", style: { transform: `${cardFullViewStyles}` }, role: "list", children: children }));
|
|
3505
|
-
});
|
|
3506
|
-
|
|
3507
|
-
const Carousel = JSX(({ cardFullViewCount = 1, children, cardWidth = 1007, className = '', isBlur = true, isCyclic = false, block, ...rest }) => {
|
|
3508
|
-
const blurClasses = isBlur ? 'absolute top-0 bottom-0 w-[84px]' : '';
|
|
3509
|
-
const { blocks: childBlocks } = block || {};
|
|
3510
|
-
const childBlocksLength = childBlocks !== undefined ? childBlocks.length : 0;
|
|
3511
|
-
const isScrollAvailable = childBlocksLength > cardFullViewCount;
|
|
3512
|
-
const [activeIndex, controls] = useCarouselControl({
|
|
3513
|
-
itemsCount: childBlocksLength,
|
|
3514
|
-
visibleItemCount: cardFullViewCount,
|
|
3515
|
-
isCyclic,
|
|
3516
|
-
});
|
|
3517
|
-
const { inc, dec, canDec, canInc } = controls;
|
|
3518
|
-
return (jsxs(BlockWrapper, { className: `box-border h-full relative font-sans flex flex-col justify-center overflow-hidden ${className}`, ...rest, children: [jsx(CarouselContainer, { activeItem: activeIndex, cardFullViewCount: cardFullViewCount, cardWidth: cardWidth, children: children }), isScrollAvailable ? (jsx("div", { children: renderArrows({
|
|
3519
|
-
handler: [dec, inc],
|
|
3520
|
-
isShown: [canDec, canInc],
|
|
3521
|
-
btnClass: ['left-8', 'right-8'],
|
|
3522
|
-
className: 'top-1/2 z-10',
|
|
3523
|
-
}) })) : null, isScrollAvailable ? (jsxs("div", { children: [jsx("div", { className: `${blurClasses} left-0 bg-opacity-from-white` }), jsx("div", { className: `${blurClasses} right-0 bg-opacity-to-white` })] })) : null] }));
|
|
3524
|
-
});
|
|
3525
|
-
Carousel.childrenTypes = ['CarouselCard'];
|
|
3526
|
-
|
|
3527
3547
|
const Blocks = {
|
|
3528
3548
|
Accordion,
|
|
3529
3549
|
AccordionItem,
|
|
@@ -3532,10 +3552,13 @@
|
|
|
3532
3552
|
Bonus,
|
|
3533
3553
|
BonusBenefitsBlock,
|
|
3534
3554
|
CardTransfer,
|
|
3535
|
-
ComparisonTable,
|
|
3536
3555
|
Calculator,
|
|
3556
|
+
Carousel,
|
|
3557
|
+
CarouselCard,
|
|
3558
|
+
CarouselTariffsCard,
|
|
3537
3559
|
Catalog,
|
|
3538
3560
|
ContactsBlock,
|
|
3561
|
+
ComparisonTable,
|
|
3539
3562
|
ErrorBlock,
|
|
3540
3563
|
ExchangeRateTile,
|
|
3541
3564
|
Footer,
|
|
@@ -3568,8 +3591,6 @@
|
|
|
3568
3591
|
TextBlock,
|
|
3569
3592
|
Tile,
|
|
3570
3593
|
VerticalLayout,
|
|
3571
|
-
CarouselCard,
|
|
3572
|
-
Carousel,
|
|
3573
3594
|
};
|
|
3574
3595
|
|
|
3575
3596
|
function style2className(style) {
|
|
@@ -3677,7 +3698,7 @@
|
|
|
3677
3698
|
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" }) }));
|
|
3678
3699
|
}
|
|
3679
3700
|
|
|
3680
|
-
const packageVersion = "0.6.
|
|
3701
|
+
const packageVersion = "0.6.31";
|
|
3681
3702
|
|
|
3682
3703
|
exports.Blocks = Blocks;
|
|
3683
3704
|
exports.ContentPage = ContentPage;
|