@redneckz/wildless-cms-uni-blocks 0.14.334 → 0.14.335

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.
@@ -2160,7 +2160,7 @@
2160
2160
  /** @deprecated */
2161
2161
  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" })));
2162
2162
 
2163
- const scrollButtonStyle$1 = 'absolute top-[calc(50%-24px)] z-40';
2163
+ const scrollButtonStyle$2 = 'absolute top-[calc(50%-24px)] z-40';
2164
2164
  const blurBaseStyle = 'absolute top-0 bottom-0 z-40 hidden @lg:block w-20 pointer-events-none';
2165
2165
  const CarouselScrollButtons = JSX(({ scroll, activeIndex, itemCount, arrowsPadded, hasEdgeBlocks, onScrollLeft, onScrollRight, }) => {
2166
2166
  const { canScrollLeft, canScrollRight, scrollLeft, scrollRight } = scroll;
@@ -2184,7 +2184,7 @@
2184
2184
  onScrollRight();
2185
2185
  }
2186
2186
  }, [scrollRight, onScrollRight, hasEdgeBlocks, canScrollLeft, activeIndex, itemCount]);
2187
- return (jsxs("div", { className: "m:hidden block", children: [renderBlur(scroll), canMoveLeft ? (jsx(ScrollLeftButton, { className: style(scrollButtonStyle$1, arrowsPadded ? 'left-1 m:left-8' : 'left-0'), onClick: handleScrollLeft })) : null, canMoveRight ? (jsx(ScrollRightButton, { className: style(scrollButtonStyle$1, arrowsPadded ? 'right-1 m:right-8' : 'right-0'), onClick: handleScrollRight })) : null] }));
2187
+ return (jsxs("div", { className: "m:hidden block", children: [renderBlur(scroll), canMoveLeft ? (jsx(ScrollLeftButton, { className: style(scrollButtonStyle$2, arrowsPadded ? 'left-1 m:left-8' : 'left-0'), onClick: handleScrollLeft })) : null, canMoveRight ? (jsx(ScrollRightButton, { className: style(scrollButtonStyle$2, arrowsPadded ? 'right-1 m:right-8' : 'right-0'), onClick: handleScrollRight })) : null] }));
2188
2188
  });
2189
2189
  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] }));
2190
2190
 
@@ -5379,22 +5379,26 @@
5379
5379
 
5380
5380
  const Placeholder = JSX(({ className, title, description = 'Блок в разработке...', ...rest }) => (jsxs(BlockWrapper, { className: style('box-border', className), ...rest, children: [jsx(Headline, { className: "max-w-[600px]", title: title, description: description, headlineVersion: "L", align: "text-left", isEmbedded: true }), jsx(Shimmer, {})] })));
5381
5381
 
5382
- const ProductGallery = JSX(({ className = '', padding, slides = [], ...rest }) => {
5382
+ const scrollButtonStyle$1 = 'hidden sm:flex absolute z-40 top-10';
5383
+ const ProductGallery = UniBlock(({ className = '', padding, slides = [], ...rest }) => {
5383
5384
  const [activeSlideIndex, setActiveSlideIndex] = useState(0);
5384
- return (jsxs(BlockWrapper, { className: style('box-border overflow-hidden', className), defaultPadding: "py-6xl", padding: padding, ...rest, children: [jsx("div", { className: "flex duration-1000", style: { transform: `translateX(-${activeSlideIndex * 100}%)` }, role: "list", children: slides.map(({ productBlock }, i) => (jsx("div", { className: "box-border grow-0 shrink-0 basis-full", role: "listitem", children: jsx(BaseProductTile, { className: "pl-6xl h-full", headlineVersion: "M", isFullWidthTitle: false, ...productBlock, ...rest }) }, String(i)))) }), jsx("div", { className: "h-28 px-xs mt-m -mb-m flex gap-xs box-border", children: slides.map(renderNavButton({ activeSlideIndex, onClick: setActiveSlideIndex })) })] }));
5385
+ const [containerRef, scroll] = useSwipeListScroll({
5386
+ itemCount: slides?.length || 0,
5387
+ });
5388
+ return (jsxs(BlockWrapper, { className: style('box-border overflow-hidden', className), defaultPadding: "pt-6xl", padding: padding, ...rest, children: [jsx("div", { className: "flex duration-1000", style: { transform: `translateX(-${activeSlideIndex * 100}%)` }, role: "list", children: slides.map(({ productBlock }, i) => (jsx("div", { className: "box-border grow-0 shrink-0 basis-full", role: "listitem", children: jsx(BaseProductTile, { className: "pl-6xl h-full", headlineVersion: "M", isFullWidthTitle: false, ...productBlock, ...rest }) }, String(i)))) }), jsxs("div", { className: "relative pr-xs mt-m -mb-m flex gap-xs box-border", children: [jsx(SwipeListContainer, { containerRef: containerRef, snapAlign: "snap-start", onVisibleIndicesChange: scroll.handleVisibleIndicesChange, itemClassName: 'h-40 flex items-stretch w-screen', gap: 8, children: slides.map(renderNavButton({ activeSlideIndex, onClick: setActiveSlideIndex })) }), scroll.canScrollLeft ? (jsx(ScrollLeftButton, { className: style('left-6', scrollButtonStyle$1), onClick: scroll.scrollLeft })) : null, scroll.canScrollRight ? (jsx(ScrollRightButton, { className: style('right-6', scrollButtonStyle$1), onClick: scroll.scrollRight })) : null] })] }));
5385
5389
  });
5386
5390
  const renderNavButton = ({ activeSlideIndex, onClick }) => ({ nav }, i) => {
5387
5391
  const isActive = i === activeSlideIndex;
5388
5392
  const btnClassName = isActive
5389
5393
  ? 'min-w-[350px] bg-white shadow-dark-blue border-none p-6'
5390
- : 'min-w-72 ease-in duration-300 bg-white/10 px-xl py-lg hover:py-xl backdrop-blur';
5394
+ : 'min-w-72 ease-in duration-300 bg-white/10 px-xl py-lg hover:backdrop-blur';
5391
5395
  const btnTitleClassName = isActive
5392
5396
  ? 'text-primary-text text-h6 py-xs'
5393
5397
  : 'text-l pb-2xs text-secondary-text group-data-secondary:text-white';
5394
5398
  const btnDescClassName = isActive
5395
5399
  ? 'text-secondary-text text-l font-light'
5396
5400
  : 'text-secondary-text text-m font-light group-data-secondary:text-white/80';
5397
- return (jsxs("button", { type: "button", onClick: () => onClick(i), "aria-label": nav?.title, className: style('relative px-xl box-border overflow-hidden text-left grow basis-0 border border-gray group-data-secondary:border-white/50', btnClassName), children: [jsx("div", { className: btnTitleClassName, children: nav?.title }), jsx("div", { className: btnDescClassName, children: nav?.description })] }, String(i)));
5401
+ 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', btnClassName), children: [jsx("div", { className: btnTitleClassName, children: nav?.title }), jsx("div", { className: btnDescClassName, children: nav?.description })] }, String(i)));
5398
5402
  };
5399
5403
 
5400
5404
  const RepresentativeOfficeInfo = JSX(({ address, email, telephone, button, className = '', __html, icon, title, version = 'primary', ...rest }) => (jsxs(BlockWrapper, { className: style('box-border text-left space-y-s', className), version: version, ...rest, children: [jsxs("div", { className: "w-full flex justify-between flex-row-reverse", children: [isIcon(icon) ? (jsx("div", { className: 'w-10 h-7 sm:w-24 sm:h-16', children: jsx(Img, { image: icon }) })) : null, title ? jsx(Heading, { headingType: "h3", as: "h3", title: title }) : null] }), jsxs("div", { className: "w-full space-y-m", children: [__html ? renderDescriptionBlock(__html) : null, renderBlock({
@@ -6238,7 +6242,7 @@
6238
6242
  slots: () => [HEADER_SLOT, FOOTER_SLOT, STICKY_FOOTER_SLOT],
6239
6243
  });
6240
6244
 
6241
- const packageVersion = "0.14.333";
6245
+ const packageVersion = "0.14.334";
6242
6246
 
6243
6247
  exports.Blocks = Blocks;
6244
6248
  exports.ContentPage = ContentPage;