@redneckz/wildless-cms-uni-blocks 0.14.534 → 0.14.535
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/bin/migration-scripts/0.14.530.js +38 -0
- package/bundle/blocks.schema.json +1 -1
- package/bundle/bundle.umd.js +85 -47
- package/bundle/bundle.umd.min.js +1 -1
- package/bundle/components/Carousel/CarouselContent.d.ts +2 -0
- package/bundle/components/Carousel/renderCarouselCards.d.ts +2 -1
- package/bundle/components/ProductBlock/ProductBlockContent.d.ts +2 -1
- package/bundle/ui-kit/SwipeListControl/NavButtonProp.d.ts +9 -0
- package/bundle/ui-kit/SwipeListControl/SwipeListControl.d.ts +2 -0
- package/bundle/ui-kit/SwipeListControl/SwipeListDots.d.ts +8 -3
- package/bundle/ui-kit/SwipeListControl/SwipeListScrollButtons.d.ts +1 -0
- package/bundle/ui-kit/SwipeListControl/renderDotButton.d.ts +3 -0
- package/bundle/ui-kit/SwipeListControl/renderNavButton.d.ts +3 -0
- package/dist/components/Carousel/Carousel.js +8 -3
- package/dist/components/Carousel/Carousel.js.map +1 -1
- package/dist/components/Carousel/CarouselContent.d.ts +2 -0
- package/dist/components/Carousel/renderCarouselCards.d.ts +2 -1
- package/dist/components/Carousel/renderCarouselCards.js +3 -1
- package/dist/components/Carousel/renderCarouselCards.js.map +1 -1
- package/dist/components/ProductBlock/ProductBlock.js +1 -1
- package/dist/components/ProductBlock/ProductBlock.js.map +1 -1
- package/dist/components/ProductBlock/ProductBlockContent.d.ts +2 -1
- package/dist/ui-kit/LinkButton/ButtonInner.js +2 -2
- package/dist/ui-kit/LinkButton/ButtonInner.js.map +1 -1
- package/dist/ui-kit/SwipeListControl/NavButtonProp.d.ts +9 -0
- package/dist/ui-kit/SwipeListControl/NavButtonProp.js +2 -0
- package/dist/ui-kit/SwipeListControl/NavButtonProp.js.map +1 -0
- package/dist/ui-kit/SwipeListControl/SwipeListControl.d.ts +2 -0
- package/dist/ui-kit/SwipeListControl/SwipeListControl.js +2 -2
- package/dist/ui-kit/SwipeListControl/SwipeListControl.js.map +1 -1
- package/dist/ui-kit/SwipeListControl/SwipeListDots.d.ts +8 -3
- package/dist/ui-kit/SwipeListControl/SwipeListDots.js +32 -16
- package/dist/ui-kit/SwipeListControl/SwipeListDots.js.map +1 -1
- package/dist/ui-kit/SwipeListControl/SwipeListScrollButtons.d.ts +1 -0
- package/dist/ui-kit/SwipeListControl/SwipeListScrollButtons.js +4 -3
- package/dist/ui-kit/SwipeListControl/SwipeListScrollButtons.js.map +1 -1
- package/dist/ui-kit/SwipeListControl/renderDotButton.d.ts +3 -0
- package/dist/ui-kit/SwipeListControl/renderDotButton.js +13 -0
- package/dist/ui-kit/SwipeListControl/renderDotButton.js.map +1 -0
- package/dist/ui-kit/SwipeListControl/renderNavButton.d.ts +3 -0
- package/dist/ui-kit/SwipeListControl/renderNavButton.js +17 -0
- package/dist/ui-kit/SwipeListControl/renderNavButton.js.map +1 -0
- package/dist/ui-kit/SwipeListControl/useSwipeListScroll.js +1 -1
- package/dist/ui-kit/SwipeListControl/useSwipeListScroll.js.map +1 -1
- package/lib/common.css +1 -1
- package/lib/components/Carousel/Carousel.fixture.d.ts +1 -0
- package/lib/components/Carousel/Carousel.fixture.mobile.d.ts +1 -0
- package/lib/components/Carousel/Carousel.js +8 -3
- package/lib/components/Carousel/Carousel.js.map +1 -1
- package/lib/components/Carousel/CarouselContent.d.ts +2 -0
- package/lib/components/Carousel/renderCarouselCards.d.ts +2 -1
- package/lib/components/Carousel/renderCarouselCards.js +3 -1
- package/lib/components/Carousel/renderCarouselCards.js.map +1 -1
- package/lib/components/ProductBlock/ProductBlock.js +1 -1
- package/lib/components/ProductBlock/ProductBlock.js.map +1 -1
- package/lib/components/ProductBlock/ProductBlockContent.d.ts +2 -1
- package/lib/ui-kit/LinkButton/ButtonInner.js +2 -2
- package/lib/ui-kit/LinkButton/ButtonInner.js.map +1 -1
- package/lib/ui-kit/SwipeListControl/NavButtonProp.d.ts +9 -0
- package/lib/ui-kit/SwipeListControl/NavButtonProp.js +2 -0
- package/lib/ui-kit/SwipeListControl/NavButtonProp.js.map +1 -0
- package/lib/ui-kit/SwipeListControl/SwipeListControl.d.ts +2 -0
- package/lib/ui-kit/SwipeListControl/SwipeListControl.js +2 -2
- package/lib/ui-kit/SwipeListControl/SwipeListControl.js.map +1 -1
- package/lib/ui-kit/SwipeListControl/SwipeListDots.d.ts +8 -3
- package/lib/ui-kit/SwipeListControl/SwipeListDots.js +32 -16
- package/lib/ui-kit/SwipeListControl/SwipeListDots.js.map +1 -1
- package/lib/ui-kit/SwipeListControl/SwipeListScrollButtons.d.ts +1 -0
- package/lib/ui-kit/SwipeListControl/SwipeListScrollButtons.js +4 -3
- package/lib/ui-kit/SwipeListControl/SwipeListScrollButtons.js.map +1 -1
- package/lib/ui-kit/SwipeListControl/renderDotButton.d.ts +2 -0
- package/lib/ui-kit/SwipeListControl/renderDotButton.js +10 -0
- package/lib/ui-kit/SwipeListControl/renderDotButton.js.map +1 -0
- package/lib/ui-kit/SwipeListControl/renderNavButton.d.ts +2 -0
- package/lib/ui-kit/SwipeListControl/renderNavButton.js +14 -0
- package/lib/ui-kit/SwipeListControl/renderNavButton.js.map +1 -0
- package/lib/ui-kit/SwipeListControl/useSwipeListScroll.js +1 -1
- package/lib/ui-kit/SwipeListControl/useSwipeListScroll.js.map +1 -1
- package/mobile/bundle/bundle.umd.js +85 -47
- package/mobile/bundle/bundle.umd.min.js +1 -1
- package/mobile/bundle/components/Carousel/CarouselContent.d.ts +2 -0
- package/mobile/bundle/components/Carousel/renderCarouselCards.d.ts +2 -1
- package/mobile/bundle/components/ProductBlock/ProductBlockContent.d.ts +2 -1
- package/mobile/bundle/ui-kit/SwipeListControl/NavButtonProp.d.ts +9 -0
- package/mobile/bundle/ui-kit/SwipeListControl/SwipeListControl.d.ts +2 -0
- package/mobile/bundle/ui-kit/SwipeListControl/SwipeListDots.d.ts +8 -3
- package/mobile/bundle/ui-kit/SwipeListControl/SwipeListScrollButtons.d.ts +1 -0
- package/mobile/bundle/ui-kit/SwipeListControl/renderDotButton.d.ts +3 -0
- package/mobile/bundle/ui-kit/SwipeListControl/renderNavButton.d.ts +3 -0
- package/mobile/dist/components/Carousel/Carousel.js +8 -3
- package/mobile/dist/components/Carousel/Carousel.js.map +1 -1
- package/mobile/dist/components/Carousel/CarouselContent.d.ts +2 -0
- package/mobile/dist/components/Carousel/renderCarouselCards.d.ts +2 -1
- package/mobile/dist/components/Carousel/renderCarouselCards.js +3 -1
- package/mobile/dist/components/Carousel/renderCarouselCards.js.map +1 -1
- package/mobile/dist/components/ProductBlock/ProductBlock.js +1 -1
- package/mobile/dist/components/ProductBlock/ProductBlock.js.map +1 -1
- package/mobile/dist/components/ProductBlock/ProductBlockContent.d.ts +2 -1
- package/mobile/dist/ui-kit/LinkButton/ButtonInner.js +2 -2
- package/mobile/dist/ui-kit/LinkButton/ButtonInner.js.map +1 -1
- package/mobile/dist/ui-kit/SwipeListControl/NavButtonProp.d.ts +9 -0
- package/mobile/dist/ui-kit/SwipeListControl/NavButtonProp.js +2 -0
- package/mobile/dist/ui-kit/SwipeListControl/NavButtonProp.js.map +1 -0
- package/mobile/dist/ui-kit/SwipeListControl/SwipeListControl.d.ts +2 -0
- package/mobile/dist/ui-kit/SwipeListControl/SwipeListControl.js +2 -2
- package/mobile/dist/ui-kit/SwipeListControl/SwipeListControl.js.map +1 -1
- package/mobile/dist/ui-kit/SwipeListControl/SwipeListDots.d.ts +8 -3
- package/mobile/dist/ui-kit/SwipeListControl/SwipeListDots.js +32 -16
- package/mobile/dist/ui-kit/SwipeListControl/SwipeListDots.js.map +1 -1
- package/mobile/dist/ui-kit/SwipeListControl/SwipeListScrollButtons.d.ts +1 -0
- package/mobile/dist/ui-kit/SwipeListControl/SwipeListScrollButtons.js +4 -3
- package/mobile/dist/ui-kit/SwipeListControl/SwipeListScrollButtons.js.map +1 -1
- package/mobile/dist/ui-kit/SwipeListControl/renderDotButton.d.ts +3 -0
- package/mobile/dist/ui-kit/SwipeListControl/renderDotButton.js +13 -0
- package/mobile/dist/ui-kit/SwipeListControl/renderDotButton.js.map +1 -0
- package/mobile/dist/ui-kit/SwipeListControl/renderNavButton.d.ts +3 -0
- package/mobile/dist/ui-kit/SwipeListControl/renderNavButton.js +17 -0
- package/mobile/dist/ui-kit/SwipeListControl/renderNavButton.js.map +1 -0
- package/mobile/dist/ui-kit/SwipeListControl/useSwipeListScroll.js +1 -1
- package/mobile/dist/ui-kit/SwipeListControl/useSwipeListScroll.js.map +1 -1
- package/mobile/lib/common.css +1 -1
- package/mobile/lib/components/Carousel/Carousel.js +8 -3
- package/mobile/lib/components/Carousel/Carousel.js.map +1 -1
- package/mobile/lib/components/Carousel/CarouselContent.d.ts +2 -0
- package/mobile/lib/components/Carousel/renderCarouselCards.d.ts +2 -1
- package/mobile/lib/components/Carousel/renderCarouselCards.js +3 -1
- package/mobile/lib/components/Carousel/renderCarouselCards.js.map +1 -1
- package/mobile/lib/components/ProductBlock/ProductBlock.js +1 -1
- package/mobile/lib/components/ProductBlock/ProductBlock.js.map +1 -1
- package/mobile/lib/components/ProductBlock/ProductBlockContent.d.ts +2 -1
- package/mobile/lib/ui-kit/LinkButton/ButtonInner.js +2 -2
- package/mobile/lib/ui-kit/LinkButton/ButtonInner.js.map +1 -1
- package/mobile/lib/ui-kit/SwipeListControl/NavButtonProp.d.ts +9 -0
- package/mobile/lib/ui-kit/SwipeListControl/NavButtonProp.js +2 -0
- package/mobile/lib/ui-kit/SwipeListControl/NavButtonProp.js.map +1 -0
- package/mobile/lib/ui-kit/SwipeListControl/SwipeListControl.d.ts +2 -0
- package/mobile/lib/ui-kit/SwipeListControl/SwipeListControl.js +2 -2
- package/mobile/lib/ui-kit/SwipeListControl/SwipeListControl.js.map +1 -1
- package/mobile/lib/ui-kit/SwipeListControl/SwipeListDots.d.ts +8 -3
- package/mobile/lib/ui-kit/SwipeListControl/SwipeListDots.js +32 -16
- package/mobile/lib/ui-kit/SwipeListControl/SwipeListDots.js.map +1 -1
- package/mobile/lib/ui-kit/SwipeListControl/SwipeListScrollButtons.d.ts +1 -0
- package/mobile/lib/ui-kit/SwipeListControl/SwipeListScrollButtons.js +4 -3
- package/mobile/lib/ui-kit/SwipeListControl/SwipeListScrollButtons.js.map +1 -1
- package/mobile/lib/ui-kit/SwipeListControl/renderDotButton.d.ts +3 -0
- package/mobile/lib/ui-kit/SwipeListControl/renderDotButton.js +10 -0
- package/mobile/lib/ui-kit/SwipeListControl/renderDotButton.js.map +1 -0
- package/mobile/lib/ui-kit/SwipeListControl/renderNavButton.d.ts +3 -0
- package/mobile/lib/ui-kit/SwipeListControl/renderNavButton.js +14 -0
- package/mobile/lib/ui-kit/SwipeListControl/renderNavButton.js.map +1 -0
- package/mobile/lib/ui-kit/SwipeListControl/useSwipeListScroll.js +1 -1
- package/mobile/lib/ui-kit/SwipeListControl/useSwipeListScroll.js.map +1 -1
- package/mobile/src/components/Carousel/Carousel.tsx +28 -17
- package/mobile/src/components/Carousel/CarouselContent.ts +2 -0
- package/mobile/src/components/Carousel/renderCarouselCards.tsx +8 -1
- package/mobile/src/components/ProductBlock/ProductBlock.tsx +7 -2
- package/mobile/src/components/ProductBlock/ProductBlockContent.ts +3 -1
- package/mobile/src/ui-kit/LinkButton/ButtonInner.tsx +2 -2
- package/mobile/src/ui-kit/SwipeListControl/NavButtonProp.ts +11 -0
- package/mobile/src/ui-kit/SwipeListControl/SwipeListControl.tsx +7 -1
- package/mobile/src/ui-kit/SwipeListControl/SwipeListDots.tsx +69 -46
- package/mobile/src/ui-kit/SwipeListControl/SwipeListScrollButtons.tsx +9 -5
- package/mobile/src/ui-kit/SwipeListControl/renderDotButton.tsx +29 -0
- package/mobile/src/ui-kit/SwipeListControl/renderNavButton.tsx +33 -0
- package/mobile/src/ui-kit/SwipeListControl/useSwipeListScroll.ts +1 -1
- package/package.json +2 -2
- package/src/components/Carousel/Carousel.fixture.mobile.tsx +57 -0
- package/src/components/Carousel/Carousel.fixture.tsx +56 -0
- package/src/components/Carousel/Carousel.tsx +28 -17
- package/src/components/Carousel/CarouselContent.ts +2 -0
- package/src/components/Carousel/renderCarouselCards.tsx +8 -1
- package/src/components/ProductBlock/ProductBlock.tsx +7 -2
- package/src/components/ProductBlock/ProductBlockContent.ts +3 -1
- package/src/components/ProductGallery/ProductGallery.fixture.tsx +17 -84
- package/src/ui-kit/LinkButton/ButtonInner.tsx +2 -2
- package/src/ui-kit/SwipeListControl/NavButtonProp.ts +11 -0
- package/src/ui-kit/SwipeListControl/SwipeListControl.tsx +7 -1
- package/src/ui-kit/SwipeListControl/SwipeListDots.tsx +69 -46
- package/src/ui-kit/SwipeListControl/SwipeListScrollButtons.tsx +9 -5
- package/src/ui-kit/SwipeListControl/renderDotButton.tsx +29 -0
- package/src/ui-kit/SwipeListControl/renderNavButton.tsx +33 -0
- package/src/ui-kit/SwipeListControl/useSwipeListScroll.ts +1 -1
package/bundle/bundle.umd.js
CHANGED
|
@@ -412,7 +412,7 @@
|
|
|
412
412
|
'': '',
|
|
413
413
|
};
|
|
414
414
|
/** @deprecated */
|
|
415
|
-
const buttonStyle = 'text-center font-sans select-none';
|
|
415
|
+
const buttonStyle$2 = 'text-center font-sans select-none';
|
|
416
416
|
/** @deprecated */
|
|
417
417
|
const iconStyleMap = {
|
|
418
418
|
primary: 'group-hover/btn:brightness-0 group-hover/btn:invert',
|
|
@@ -426,7 +426,7 @@
|
|
|
426
426
|
|
|
427
427
|
/** @deprecated */
|
|
428
428
|
const getRegularButtonClasses = ({ className, rounded, version, }) => [
|
|
429
|
-
buttonStyle,
|
|
429
|
+
buttonStyle$2,
|
|
430
430
|
'border border-transparent inline-block cursor-pointer no-underline focus:border-primary-text focus:border h-fit',
|
|
431
431
|
version ? buttonStyleMap$1[version] : '',
|
|
432
432
|
rounded ? 'rounded-full' : 'rounded-md',
|
|
@@ -527,9 +527,9 @@
|
|
|
527
527
|
const ButtonInner = JSX((props) => {
|
|
528
528
|
const { text, aboveText, appendLeft, appendRight, version = 'primary' } = props;
|
|
529
529
|
const iconHideStyle = isWithText(props) ? 'hidden lg:block' : '';
|
|
530
|
-
return (jsxs("div", { className: style(
|
|
530
|
+
return (jsxs("div", { className: style(buttonStyle$1(props), 'flex gap-xs'), children: [appendLeft ? (jsx("div", { className: style(iconHideStyle, iconStyleMap[version]), children: appendLeft })) : null, isWithText(props) ? (jsxs("div", { className: "whitespace-pre", children: [aboveText ? jsx("div", { className: "text-xs font-light text-left", children: aboveText }) : null, jsx("div", { className: `text-left ${aboveText ? 'text-s -mt-3xs' : 'text-l'}`, children: text })] })) : null, appendRight ? (jsx("div", { className: style(iconHideStyle, iconStyleMap[version]), children: appendRight })) : null] }));
|
|
531
531
|
});
|
|
532
|
-
const
|
|
532
|
+
const buttonStyle$1 = (props) => {
|
|
533
533
|
const { version, aboveText, rounded } = props;
|
|
534
534
|
if (version === 'link') {
|
|
535
535
|
return '';
|
|
@@ -544,7 +544,7 @@
|
|
|
544
544
|
/** @deprecated */
|
|
545
545
|
const getDisabledButtonClasses = ({ className, rounded, version, }) => [
|
|
546
546
|
'inline-block',
|
|
547
|
-
buttonStyle,
|
|
547
|
+
buttonStyle$2,
|
|
548
548
|
version ? buttonDisabledStyleMap[version] : '',
|
|
549
549
|
rounded ? 'rounded-full' : 'rounded-md',
|
|
550
550
|
className,
|
|
@@ -873,7 +873,7 @@
|
|
|
873
873
|
return OutputComponent;
|
|
874
874
|
}
|
|
875
875
|
|
|
876
|
-
const ProductBlock = UniBlock(({ className, padding, ...rest }) => (jsx(BlockWrapper, { className: style('overflow-hidden flex flex-col gap-3xl box-border', className), padding: "p-0", ...rest, children: jsx(BaseProductTile, { defaultPadding:
|
|
876
|
+
const ProductBlock = UniBlock(({ className, padding, defaultPadding, ...rest }) => (jsx(BlockWrapper, { className: style('overflow-hidden flex flex-col gap-3xl box-border', className), padding: "p-0", ...rest, children: jsx(BaseProductTile, { defaultPadding: defaultPadding || 'p-6xl', padding: padding, className: "grow h-full", ...rest }) })), { childrenTypes: ['UnitBlock'] });
|
|
877
877
|
|
|
878
878
|
const AdTile = JSX((props) => {
|
|
879
879
|
const { items } = (props.options?.page?.adSourceBook ?? {});
|
|
@@ -2123,46 +2123,25 @@
|
|
|
2123
2123
|
.filter(([_]) => _ && _.intersectionRatio >= 0.9)
|
|
2124
2124
|
.map(([, i]) => i);
|
|
2125
2125
|
|
|
2126
|
-
const containerStyles = {
|
|
2127
|
-
'horizontal-list': 'mx-auto mt-lg w-fit',
|
|
2128
|
-
'vertical-list': 'absolute flex-col justify-center h-full top-0 left-4',
|
|
2129
|
-
};
|
|
2130
2126
|
const activeDotStyles = {
|
|
2131
2127
|
'horizontal-list': 'w-6',
|
|
2132
2128
|
'vertical-list': 'h-6',
|
|
2133
2129
|
};
|
|
2134
2130
|
const dotStyle = 'cursor-pointer rounded-full transition-width duration-300 bg-primary-main group-data-secondary:bg-white';
|
|
2135
2131
|
const inactiveDotStyle = 'w-2 h-2 opacity-30';
|
|
2136
|
-
const
|
|
2137
|
-
const handleClick = (idx) => {
|
|
2138
|
-
if (idx !== activeIndex && containerRef?.current) {
|
|
2139
|
-
containerRef.current.children[idx]?.scrollIntoView({
|
|
2140
|
-
behavior: 'smooth',
|
|
2141
|
-
block: 'nearest',
|
|
2142
|
-
});
|
|
2143
|
-
}
|
|
2144
|
-
};
|
|
2145
|
-
return dotCount ? (jsx("div", { className: style('flex gap-xs', containerStyles[listType], version ? 'group' : '', className), "data-ver": version, children: Array.from({ length: dotCount })
|
|
2146
|
-
.fill(null)
|
|
2147
|
-
.map((_, idx) => (jsx("div", { className: `${dotStyle} ${idx === activeIndex ? activeDotStyles[listType] : inactiveDotStyle}`, role: "button", "aria-hidden": true, onClick: () => handleClick(idx) }, String(idx)))) })) : null;
|
|
2148
|
-
});
|
|
2132
|
+
const renderDotButton = ({ activeIndex, onClick, listType = 'horizontal-list' }) => (_, idx) => (jsx("div", { className: style(dotStyle, idx === activeIndex ? activeDotStyles[listType] : inactiveDotStyle), role: "button", "aria-hidden": true, onClick: () => onClick(idx) }, String(idx)));
|
|
2149
2133
|
|
|
2150
|
-
|
|
2151
|
-
|
|
2152
|
-
|
|
2153
|
-
|
|
2154
|
-
|
|
2155
|
-
|
|
2156
|
-
|
|
2157
|
-
|
|
2158
|
-
|
|
2159
|
-
|
|
2160
|
-
|
|
2161
|
-
const SwipeListScrollButtons = JSX(({ className, scroll, hasBlur, arrowsPadded }) => {
|
|
2162
|
-
const { canScrollLeft, canScrollRight, scrollLeft, scrollRight } = scroll;
|
|
2163
|
-
return (jsxs("div", { className: style(className), children: [hasBlur ? renderBlur(scroll) : null, canScrollLeft ? (jsx(ScrollLeftButton, { className: style(scrollButtonStyle$2, arrowsPadded ? 'left-1' : 'left-0'), onClick: scrollLeft })) : null, canScrollRight ? (jsx(ScrollRightButton, { className: style(scrollButtonStyle$2, arrowsPadded ? 'right-1' : 'right-0'), onClick: scrollRight })) : null] }));
|
|
2164
|
-
});
|
|
2165
|
-
const renderBlur = (scroll) => (jsxs("div", { children: [scroll.canScrollLeft ? (jsx("div", { className: style(blurBaseStyle, 'left-0 bg-opacity-from-white group-data-secondary:bg-none') })) : null, scroll.canScrollRight ? (jsx("div", { className: style(blurBaseStyle, 'right-0 bg-opacity-to-white group-data-secondary:bg-none') })) : null] }));
|
|
2134
|
+
const renderNavButton$3 = ({ activeIndex, onClick }) => (nav, i) => {
|
|
2135
|
+
const isActive = i === activeIndex;
|
|
2136
|
+
const btnClassName = isActive
|
|
2137
|
+
? 'min-w-[350px] bg-white shadow-dark-blue border-none p-6'
|
|
2138
|
+
: 'min-w-72 ease-in duration-300 bg-white/10 px-xl py-lg hover:backdrop-blur';
|
|
2139
|
+
const btnTitleClassName = isActive
|
|
2140
|
+
? 'text-primary-text text-h6 py-xs'
|
|
2141
|
+
: 'text-l pb-2xs text-secondary-text group-data-secondary:text-white';
|
|
2142
|
+
const btnDescClassName = isActive ? 'text-l' : 'text-m group-data-secondary:text-white/80';
|
|
2143
|
+
return (jsxs("button", { type: "button", onClick: () => onClick(i), "aria-label": nav?.title, className: style('max-h-28 mt-xs ml-xs relative px-xl box-border overflow-hidden text-left grow basis-0 border border-gray group-data-secondary:border-white/50 whitespace-nowrap', btnClassName), children: [jsx("div", { className: btnTitleClassName, children: nav?.title }), jsx("div", { className: style('text-secondary-text font-light', btnDescClassName), children: nav?.description })] }, String(i)));
|
|
2144
|
+
};
|
|
2166
2145
|
|
|
2167
2146
|
const areArraysEqual = (as, bs) => as === bs || Boolean(as && bs && as?.length === bs?.length && as.every((_, i) => _ === bs[i]));
|
|
2168
2147
|
|
|
@@ -2192,7 +2171,7 @@
|
|
|
2192
2171
|
const handleVisibleIndicesChange = useCallback((indices) => {
|
|
2193
2172
|
setVisibleIndices((prevIndices) => areArraysEqual(prevIndices, indices) ? prevIndices : indices);
|
|
2194
2173
|
onVisibleIndicesChange && onVisibleIndicesChange(indices);
|
|
2195
|
-
}, [
|
|
2174
|
+
}, [onVisibleIndicesChange]);
|
|
2196
2175
|
const [minIndex, maxIndex] = visibleIndices.length
|
|
2197
2176
|
? [minBy()(visibleIndices), maxBy()(visibleIndices)]
|
|
2198
2177
|
: [-1, -1];
|
|
@@ -2243,6 +2222,58 @@
|
|
|
2243
2222
|
];
|
|
2244
2223
|
};
|
|
2245
2224
|
|
|
2225
|
+
const containerStyles = {
|
|
2226
|
+
'horizontal-list': 'mx-auto mt-lg w-fit',
|
|
2227
|
+
'vertical-list': 'absolute flex-col justify-center h-full top-0 left-4',
|
|
2228
|
+
};
|
|
2229
|
+
const SwipeListDots = JSX(({ className = '', activeIndex = 0, dotCount = 0, listType = 'horizontal-list', version, navButtons = [], containerRef, containerScroll, }) => {
|
|
2230
|
+
const isMobileMode = useMobileMode();
|
|
2231
|
+
const [navRef, navScroll] = useSwipeListScroll({
|
|
2232
|
+
itemCount: navButtons.length,
|
|
2233
|
+
});
|
|
2234
|
+
const scrollOption = getOptions(Boolean(navButtons?.length));
|
|
2235
|
+
useEffect(() => {
|
|
2236
|
+
if (navButtons?.length && activeIndex >= 0 && navRef?.current) {
|
|
2237
|
+
navScroll.scrollTo(activeIndex, scrollOption);
|
|
2238
|
+
}
|
|
2239
|
+
}, [activeIndex]);
|
|
2240
|
+
const onChangeActiveIndex = useCallback((idx) => {
|
|
2241
|
+
if (idx !== activeIndex && containerRef?.current) {
|
|
2242
|
+
containerScroll?.scrollTo(idx, scrollOption);
|
|
2243
|
+
}
|
|
2244
|
+
}, [containerRef?.current]);
|
|
2245
|
+
if (navButtons?.length && !isMobileMode) {
|
|
2246
|
+
return (jsx(SwipeListContainer, { containerRef: navRef, snapAlign: "snap-start", itemClassName: "h-36 flex items-stretch w-screen", gap: 8, children: navButtons.map(renderNavButton$3({ activeIndex, onClick: onChangeActiveIndex })) }));
|
|
2247
|
+
}
|
|
2248
|
+
else if (dotCount) {
|
|
2249
|
+
return (jsx("div", { className: style('flex gap-xs', containerStyles[listType], version ? 'group' : '', className, { 'pb-xl': navButtons?.length && isMobileMode }), "data-ver": version, children: Array.from({ length: dotCount })
|
|
2250
|
+
.fill(null)
|
|
2251
|
+
.map(renderDotButton({ activeIndex, onClick: onChangeActiveIndex, listType })) }));
|
|
2252
|
+
}
|
|
2253
|
+
return null;
|
|
2254
|
+
});
|
|
2255
|
+
const getOptions = (isAuto = false) => ({
|
|
2256
|
+
behavior: isAuto ? 'auto' : 'smooth',
|
|
2257
|
+
});
|
|
2258
|
+
|
|
2259
|
+
/** @deprecated */
|
|
2260
|
+
const ArrowButton = JSX(({ className, disabled, ...rest }) => (jsx(LinkButton, { rounded: true, className: style('group/btn w-12 h-12 min-h-12 max-h-12 flex items-center justify-center shadow-main-black', disabled
|
|
2261
|
+
? 'bg-secondary-light text-secondary-text'
|
|
2262
|
+
: 'bg-white text-primary-text hover:text-primary-main', className || ''), disabled: disabled, ...rest, children: jsx(Img, { className: "w-4 h-4 min-w-4 min-h-4 rounded-full box-border", image: { icon: 'ArrowLeftIcon', iconVersion: 'black' }, imageClassName: "group-hover/btn:text-primary-main", width: "16", height: "16" }) })));
|
|
2263
|
+
/** @deprecated */
|
|
2264
|
+
const ScrollLeftButton = JSX((props) => (jsx(ArrowButton, { ...props, ariaLabel: "\u041F\u0440\u043E\u043B\u0438\u0441\u0442\u0430\u0442\u044C \u0432\u043B\u0435\u0432\u043E", "data-block-control": "scroll-left" })));
|
|
2265
|
+
/** @deprecated */
|
|
2266
|
+
const ScrollRightButton = JSX((props) => (jsx(ArrowButton, { ...props, className: `${props.className || ''} rotate-180`, ariaLabel: "\u041F\u0440\u043E\u043B\u0438\u0441\u0442\u0430\u0442\u044C \u0432\u043F\u0440\u0430\u0432\u043E", "data-block-control": "scroll-right" })));
|
|
2267
|
+
|
|
2268
|
+
const blurBaseStyle = 'absolute top-0 bottom-0 z-40 hidden @lg:block w-20 pointer-events-none';
|
|
2269
|
+
const SwipeListScrollButtons = JSX(({ className, scroll, hasBlur, arrowsPadded, isBottom }) => {
|
|
2270
|
+
const { canScrollLeft, canScrollRight, scrollLeft, scrollRight } = scroll;
|
|
2271
|
+
const isArrowPadded = arrowsPadded && !isBottom;
|
|
2272
|
+
return (jsxs("div", { className: className, children: [hasBlur ? renderBlur(scroll) : null, canScrollLeft ? (jsx(ScrollLeftButton, { className: style(buttonStyle(isBottom), isArrowPadded ? 'left-1' : 'left-0'), onClick: scrollLeft })) : null, canScrollRight ? (jsx(ScrollRightButton, { className: style(buttonStyle(isBottom), isArrowPadded ? 'right-1' : 'right-0'), onClick: scrollRight })) : null] }));
|
|
2273
|
+
});
|
|
2274
|
+
const renderBlur = (scroll) => (jsxs("div", { children: [scroll.canScrollLeft ? (jsx("div", { className: style(blurBaseStyle, 'left-0 bg-opacity-from-white group-data-secondary:bg-none') })) : null, scroll.canScrollRight ? (jsx("div", { className: style(blurBaseStyle, 'right-0 bg-opacity-to-white group-data-secondary:bg-none') })) : null] }));
|
|
2275
|
+
const buttonStyle = (isBottom = false) => style('absolute z-40', isBottom ? 'bottom-[56px]' : 'top-[calc(50%-24px)]');
|
|
2276
|
+
|
|
2246
2277
|
const DEFAULT_GAP = 14;
|
|
2247
2278
|
/*
|
|
2248
2279
|
Horizontal padding used on a container above SwipeListControl.
|
|
@@ -2250,14 +2281,14 @@
|
|
|
2250
2281
|
and get rid of a clipping effect caused by overflow: hidden.
|
|
2251
2282
|
*/
|
|
2252
2283
|
const DEFAULT_PADDING = 16;
|
|
2253
|
-
const SwipeListControl = JSX(({ className, version, gap = DEFAULT_GAP, padding = DEFAULT_PADDING, visibleItemCount = 1, listType = 'horizontal-list', snapAlign, minHeight, showArrows, hasBlur, arrowsPadded, showDots, children, onVisibleIndicesChange, }) => {
|
|
2284
|
+
const SwipeListControl = JSX(({ className, version, gap = DEFAULT_GAP, padding = DEFAULT_PADDING, visibleItemCount = 1, listType = 'horizontal-list', snapAlign, minHeight, showArrows, hasBlur, arrowsPadded, showDots, children, onVisibleIndicesChange, navButtons, }) => {
|
|
2254
2285
|
const itemCount = Array.isArray(children) ? children.length : 0;
|
|
2255
2286
|
const [containerRef, scroll] = useSwipeListScroll({
|
|
2256
2287
|
itemCount,
|
|
2257
2288
|
onVisibleIndicesChange,
|
|
2258
2289
|
});
|
|
2259
2290
|
const [activeIndex] = scroll.visibleIndicesRange;
|
|
2260
|
-
return (jsxs("div", { className: style(className, listType === 'vertical-list' ? 'relative h-full' : ''), children: [jsx(SwipeListContainer, { containerRef: containerRef, activeIndex: activeIndex, visibleItemCount: visibleItemCount, gap: gap, padding: padding, listType: listType, snapAlign: snapAlign, minHeight: minHeight, onVisibleIndicesChange: scroll.handleVisibleIndicesChange, children: children }), jsx(SwipeListScrollButtons, { className: style(!showArrows && 'hidden lg:block'), scroll: scroll, hasBlur: hasBlur, arrowsPadded: arrowsPadded }), jsx(SwipeListDots, { className: style(!showDots && 'lg:hidden'),
|
|
2291
|
+
return (jsxs("div", { className: style(className, listType === 'vertical-list' ? 'relative h-full' : ''), children: [jsx(SwipeListContainer, { containerRef: containerRef, activeIndex: activeIndex, visibleItemCount: visibleItemCount, gap: gap, padding: padding, listType: listType, snapAlign: snapAlign, minHeight: minHeight, onVisibleIndicesChange: scroll.handleVisibleIndicesChange, children: children }), jsx(SwipeListScrollButtons, { className: style(!showArrows && 'hidden lg:block'), scroll: scroll, hasBlur: hasBlur, arrowsPadded: arrowsPadded, isBottom: Boolean(navButtons?.length) }), jsx(SwipeListDots, { className: style(!showDots && 'lg:hidden'), activeIndex: activeIndex, dotCount: itemCount, listType: listType, version: version, navButtons: navButtons, containerRef: containerRef, containerScroll: scroll })] }));
|
|
2261
2292
|
});
|
|
2262
2293
|
|
|
2263
2294
|
const renderCarouselBlocks = ({ blocksToRender, ...rest }) => (jsx(SwipeListControl, { visibleItemCount: 0, gap: 0, arrowsPadded: true, children: renderBlocksList(blocksToRender, {
|
|
@@ -3456,9 +3487,10 @@
|
|
|
3456
3487
|
normal: 'lg:min-w-80 xl:min-w-96',
|
|
3457
3488
|
big: 'lg:min-w-[515px]',
|
|
3458
3489
|
};
|
|
3459
|
-
const renderCarouselCards = ({ noCardBorder, cardSize = 'normal', ...rest }) => {
|
|
3490
|
+
const renderCarouselCards = ({ noCardBorder, cardSize = 'normal', isNavButtons = false, ...rest }) => {
|
|
3460
3491
|
const { blocks: childBlocks } = rest.block || {};
|
|
3461
3492
|
const someCardsHighlighted = childBlocks?.some(isCardHighlighted);
|
|
3493
|
+
const defaultPadding = isNavButtons ? { defaultPadding: 'p-6xl pb-m' } : {};
|
|
3462
3494
|
return renderChildren({
|
|
3463
3495
|
...rest,
|
|
3464
3496
|
renderProps: (block, options, blockIndex) => (jsxs("div", { className: cardWrapperStyle(block, { someCardsHighlighted }), children: [renderBlock$1(block, options, {
|
|
@@ -3467,6 +3499,7 @@
|
|
|
3467
3499
|
showBorder: !noCardBorder,
|
|
3468
3500
|
cardSize,
|
|
3469
3501
|
}),
|
|
3502
|
+
...defaultPadding,
|
|
3470
3503
|
blockIndex,
|
|
3471
3504
|
}), isCardHighlighted(block)
|
|
3472
3505
|
? renderCardHighlight({ className: 'absolute top-0 -right-4 z-40' })
|
|
@@ -3480,9 +3513,7 @@
|
|
|
3480
3513
|
|
|
3481
3514
|
const VISIBLE_ITEM_COUNT = 1;
|
|
3482
3515
|
|
|
3483
|
-
const Carousel = UniBlock(({ className, visibleItemCount = VISIBLE_ITEM_COUNT, noCardBorder, arrowsPadded = true, isGap = true, cardSize = 'normal', ...rest }) => {
|
|
3484
|
-
return (jsx(BlockWrapper, { className: style(className), defaultPadding: "p-6xl", ...rest, children: jsx(SwipeListControl, { className: style('relative max-w-full'), visibleItemCount: visibleItemCount, snapAlign: "snap-start", gap: isGap ? ITEMS_GAP : 0, padding: 0, arrowsPadded: arrowsPadded, hasBlur: true, children: renderCarouselCards({ noCardBorder, cardSize, ...rest }) }) }));
|
|
3485
|
-
}, {
|
|
3516
|
+
const Carousel = UniBlock(({ className, visibleItemCount = VISIBLE_ITEM_COUNT, noCardBorder, arrowsPadded = true, isGap = true, cardSize = 'normal', isNavButtons = false, ...rest }) => (jsx(BlockWrapper, { className: style(className), defaultPadding: "p-6xl", ...rest, children: jsx(SwipeListControl, { className: style('relative max-w-full'), visibleItemCount: visibleItemCount, snapAlign: "snap-start", gap: isGap ? ITEMS_GAP : 0, padding: 0, arrowsPadded: arrowsPadded, navButtons: isNavButtons ? getNavButton(rest?.block?.blocks) : [], hasBlur: true, children: renderCarouselCards({ noCardBorder, cardSize, isNavButtons, ...rest }) }) })), {
|
|
3486
3517
|
childrenTypes: [
|
|
3487
3518
|
'CarouselCard',
|
|
3488
3519
|
'CarouselCatalogCard',
|
|
@@ -3498,6 +3529,13 @@
|
|
|
3498
3529
|
},
|
|
3499
3530
|
}),
|
|
3500
3531
|
});
|
|
3532
|
+
const getNavButton = (blocks) => blocks?.map((_) => {
|
|
3533
|
+
const content = _?.content;
|
|
3534
|
+
return {
|
|
3535
|
+
title: content?.title,
|
|
3536
|
+
description: content?.additionalDescription || content?.description,
|
|
3537
|
+
};
|
|
3538
|
+
}) ?? [];
|
|
3501
3539
|
|
|
3502
3540
|
const titleSize = 'XS';
|
|
3503
3541
|
|
|
@@ -6461,7 +6499,7 @@
|
|
|
6461
6499
|
slots: () => [HEADER_SLOT, FOOTER_SLOT, STICKY_FOOTER_SLOT],
|
|
6462
6500
|
});
|
|
6463
6501
|
|
|
6464
|
-
const packageVersion = "0.14.
|
|
6502
|
+
const packageVersion = "0.14.534";
|
|
6465
6503
|
|
|
6466
6504
|
exports.Blocks = Blocks;
|
|
6467
6505
|
exports.ContentPage = ContentPage;
|