@sonic-equipment/ui 0.0.46 → 0.0.47
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/dist/index.js
CHANGED
|
@@ -6339,6 +6339,7 @@ function Carousel({ breakpoints, className, hasNavigation = true, hasOverflow =
|
|
|
6339
6339
|
const [isDragging, setIsDragging] = useState(false);
|
|
6340
6340
|
function handleSlideChange(swiper) {
|
|
6341
6341
|
setIsEnd(swiper.isEnd);
|
|
6342
|
+
setIsLocked(swiper.isLocked);
|
|
6342
6343
|
setIsBeginning(swiper.isBeginning);
|
|
6343
6344
|
}
|
|
6344
6345
|
const showNavigation = hasNavigation && !isLocked;
|
|
@@ -6348,7 +6349,7 @@ function Carousel({ breakpoints, className, hasNavigation = true, hasOverflow =
|
|
|
6348
6349
|
}), freeMode: {
|
|
6349
6350
|
enabled: true,
|
|
6350
6351
|
sticky: true,
|
|
6351
|
-
}, modules: [freeMode],
|
|
6352
|
+
}, modules: [freeMode], onSwiper: swiper => setIsLocked(swiper.isLocked), onTouchEnd: () => setIsDragging(false), onTouchStart: () => setIsDragging(true), onUpdate: swiper => handleSlideChange(swiper), slidesPerView: slidesPerView, spaceBetween: spaceBetween, children: [slides.map((slide, index) => (jsx(SwiperSlide, { className: clsx(styles$t.slide, slideClasses), children: slide }, index))), showNavigation && (jsxs("div", { className: clsx(styles$t['navigation-buttons'], styles$t[navigationButtonsPosition]), children: [jsx("div", { className: clsx(styles$t['navigation-button-wrapper'], styles$t['navigation-button-prev']), children: jsx(CarouselNavigationButton, { direction: "previous", isDisabled: isBeginning }) }), jsx("div", { className: clsx(styles$t['navigation-button-wrapper'], styles$t['navigation-button-next']), children: jsx(CarouselNavigationButton, { direction: "next", isDisabled: isEnd }) })] }))] }) }));
|
|
6352
6353
|
}
|
|
6353
6354
|
|
|
6354
6355
|
function CategoryCarousel({ categoryCards }) {
|
|
@@ -7069,47 +7070,49 @@ function PromoCard({ alt, href, srcSet, variant }) {
|
|
|
7069
7070
|
var styles$a = {"promos":"promo-cards-module-Dy4p3"};
|
|
7070
7071
|
|
|
7071
7072
|
// TODO: Remove this and use actual data instead when backend is implemented
|
|
7072
|
-
const tempPromoCards = [
|
|
7073
|
-
|
|
7074
|
-
|
|
7075
|
-
|
|
7076
|
-
|
|
7077
|
-
|
|
7078
|
-
|
|
7079
|
-
|
|
7080
|
-
|
|
7081
|
-
|
|
7082
|
-
|
|
7083
|
-
|
|
7084
|
-
|
|
7085
|
-
|
|
7086
|
-
|
|
7087
|
-
|
|
7088
|
-
|
|
7089
|
-
|
|
7090
|
-
|
|
7091
|
-
|
|
7092
|
-
|
|
7093
|
-
|
|
7094
|
-
|
|
7095
|
-
|
|
7096
|
-
|
|
7097
|
-
|
|
7098
|
-
|
|
7099
|
-
|
|
7100
|
-
|
|
7101
|
-
|
|
7102
|
-
|
|
7103
|
-
|
|
7104
|
-
|
|
7105
|
-
|
|
7106
|
-
|
|
7107
|
-
|
|
7108
|
-
|
|
7109
|
-
]
|
|
7110
|
-
function PromoCards({ promoCardsData =
|
|
7073
|
+
// const tempPromoCards: BannerItem[] = [
|
|
7074
|
+
// {
|
|
7075
|
+
// alt: 'Large promo card',
|
|
7076
|
+
// href: '#',
|
|
7077
|
+
// srcSet: [
|
|
7078
|
+
// {
|
|
7079
|
+
// src: '/images/promo-cards/promo-content-block-on-sale-svp.webp',
|
|
7080
|
+
// width: 310,
|
|
7081
|
+
// },
|
|
7082
|
+
// {
|
|
7083
|
+
// src: '/images/promo-cards/promo-content-block-on-sale-mvp.webp',
|
|
7084
|
+
// width: 527,
|
|
7085
|
+
// },
|
|
7086
|
+
// {
|
|
7087
|
+
// src: '/images/promo-cards/promo-content-block-on-sale-lvp.webp',
|
|
7088
|
+
// width: 720,
|
|
7089
|
+
// },
|
|
7090
|
+
// ],
|
|
7091
|
+
// },
|
|
7092
|
+
// {
|
|
7093
|
+
// alt: 'Small promo card',
|
|
7094
|
+
// href: '#',
|
|
7095
|
+
// srcSet: [
|
|
7096
|
+
// {
|
|
7097
|
+
// src: '/images/promo-cards/promo-content-block-cross-sell-svp.png',
|
|
7098
|
+
// width: 250,
|
|
7099
|
+
// },
|
|
7100
|
+
// {
|
|
7101
|
+
// src: '/images/promo-cards/promo-content-block-cross-sell-mvp.webp',
|
|
7102
|
+
// width: 264,
|
|
7103
|
+
// },
|
|
7104
|
+
// {
|
|
7105
|
+
// src: '/images/promo-cards/promo-content-block-cross-sell-lvp.webp',
|
|
7106
|
+
// width: 480,
|
|
7107
|
+
// },
|
|
7108
|
+
// ],
|
|
7109
|
+
// },
|
|
7110
|
+
// ]
|
|
7111
|
+
function PromoCards({ promoCardsData = [], }) {
|
|
7111
7112
|
const { lg } = useBreakpoint();
|
|
7112
7113
|
const promoCards = promoCardsData.map((promoCard, index) => (jsx(PromoCard, { alt: promoCard.alt, href: promoCard.href, srcSet: promoCard.srcSet, variant: index % 2 === 0 ? 'lg' : 'sm' }, `promo-card-${index}`)));
|
|
7114
|
+
if (promoCardsData.length === 0)
|
|
7115
|
+
return null;
|
|
7113
7116
|
return (jsx("div", { className: styles$a.promos, children: lg ? (jsx(Fragment, { children: promoCards })) : (jsx(Carousel, { hasNavigation: false, hasOverflow: false, slides: promoCards, spaceBetween: 16 })) }));
|
|
7114
7117
|
}
|
|
7115
7118
|
|