@scbt-ecom/ui 0.153.6 → 0.153.8
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/lib/exports/ui.js +1 -1
- package/dist/lib/exports/widget.js +1 -1
- package/dist/lib/shared/style.css +1 -1
- package/dist/lib/shared/ui/carousel/Carousel.js +2 -0
- package/dist/lib/shared/ui/carousel/Carousel.js.map +1 -0
- package/dist/lib/shared/ui/carousel/index.js +1 -1
- package/dist/lib/shared/ui/carousel/model/constant.js +2 -0
- package/dist/lib/shared/ui/carousel/model/constant.js.map +1 -0
- package/dist/lib/shared/ui/carousel/model/helpers.js +1 -1
- package/dist/lib/shared/ui/carousel/model/helpers.js.map +1 -1
- package/dist/lib/shared/ui/carousel/model/hooks/useArrowNavigation.js.map +1 -1
- package/dist/lib/shared/ui/carousel/model/hooks/useDotsNavigation.js.map +1 -1
- package/dist/lib/shared/ui/carousel/model/index.js +1 -1
- package/dist/lib/shared/ui/carousel/ui/ArrowNavigationButton.js.map +1 -1
- package/dist/lib/shared/ui/carousel/ui/DotsNavigations.js +1 -1
- package/dist/lib/shared/ui/carousel/ui/DotsNavigations.js.map +1 -1
- package/dist/lib/shared/ui/carousel/ui/RenderSlides.js +2 -0
- package/dist/lib/shared/ui/carousel/ui/RenderSlides.js.map +1 -0
- package/dist/lib/shared/ui/carousel/ui/index.js +1 -1
- package/dist/lib/shared/ui/carousel/ui/slideVariants/SlideFullScreen.js +1 -1
- package/dist/lib/shared/ui/carousel/ui/slideVariants/SlideFullScreen.js.map +1 -1
- package/dist/lib/shared/ui/carousel/ui/slideVariants/SlideProductCard.js +1 -1
- package/dist/lib/shared/ui/carousel/ui/slideVariants/SlideProductCard.js.map +1 -1
- package/dist/lib/shared/ui/carousel/ui/slideVariants/SlideStepsList.js +2 -0
- package/dist/lib/shared/ui/carousel/ui/slideVariants/SlideStepsList.js.map +1 -0
- package/dist/lib/shared/ui/carousel/ui/slideVariants/index.js +1 -1
- package/dist/lib/shared/ui/carousel/ui/slideVariants/slide.module.css +1 -0
- package/dist/lib/shared/ui/carousel/ui/slideVariants/slide.module.css.js +2 -0
- package/dist/lib/shared/ui/carousel/ui/slideVariants/slide.module.css.js.map +1 -0
- package/dist/lib/shared/ui/carousel/ui/stepsList/StepListItemType.js +2 -0
- package/dist/lib/shared/ui/carousel/ui/stepsList/StepListItemType.js.map +1 -0
- package/dist/lib/shared/ui/carousel/ui/stepsList/StepsList.js +2 -0
- package/dist/lib/shared/ui/carousel/ui/stepsList/StepsList.js.map +1 -0
- package/dist/lib/shared/ui/carousel/ui/stepsList/index.js +2 -0
- package/dist/lib/shared/ui/carousel/ui/stepsList/index.js.map +1 -0
- package/dist/lib/shared/ui/carouselBase/CarouselBase.js.map +1 -0
- package/dist/lib/shared/ui/carouselBase/CarouselNative.js.map +1 -0
- package/dist/lib/shared/ui/carouselBase/index.js +2 -0
- package/dist/lib/shared/ui/carouselBase/index.js.map +1 -0
- package/dist/lib/shared/ui/carouselBase/model/helpers.js +2 -0
- package/dist/lib/shared/ui/carouselBase/model/helpers.js.map +1 -0
- package/dist/lib/shared/ui/carouselBase/model/hooks/index.js +2 -0
- package/dist/lib/shared/ui/carouselBase/model/hooks/index.js.map +1 -0
- package/dist/lib/shared/ui/carouselBase/model/hooks/useArrowNavigation.js +2 -0
- package/dist/lib/shared/ui/carouselBase/model/hooks/useArrowNavigation.js.map +1 -0
- package/dist/lib/shared/ui/carouselBase/model/hooks/useCarousel.js +2 -0
- package/dist/lib/shared/ui/carouselBase/model/hooks/useCarousel.js.map +1 -0
- package/dist/lib/shared/ui/carouselBase/model/hooks/useDotsNavigation.js +2 -0
- package/dist/lib/shared/ui/carouselBase/model/hooks/useDotsNavigation.js.map +1 -0
- package/dist/lib/shared/ui/carouselBase/model/index.js +2 -0
- package/dist/lib/shared/ui/carouselBase/model/index.js.map +1 -0
- package/dist/lib/shared/ui/carouselBase/model/types.js +2 -0
- package/dist/lib/shared/ui/carouselBase/model/types.js.map +1 -0
- package/dist/lib/shared/ui/carouselBase/ui/ArrowNavigationButton.js +2 -0
- package/dist/lib/shared/ui/carouselBase/ui/ArrowNavigationButton.js.map +1 -0
- package/dist/lib/shared/ui/carouselBase/ui/CarouselContent.js.map +1 -0
- package/dist/lib/shared/ui/carouselBase/ui/CarouselSlide.js.map +1 -0
- package/dist/lib/shared/ui/carouselBase/ui/ContainerWithNavigation.js.map +1 -0
- package/dist/lib/shared/ui/carouselBase/ui/DotsNavigations.js +2 -0
- package/dist/lib/shared/ui/carouselBase/ui/DotsNavigations.js.map +1 -0
- package/dist/lib/shared/ui/carouselBase/ui/index.js +2 -0
- package/dist/lib/shared/ui/carouselBase/ui/index.js.map +1 -0
- package/dist/lib/shared/ui/carouselBase/ui/slideVariants/SlideFullScreen.js +2 -0
- package/dist/lib/shared/ui/carouselBase/ui/slideVariants/SlideFullScreen.js.map +1 -0
- package/dist/lib/shared/ui/carouselBase/ui/slideVariants/SlideOnlyImage.js.map +1 -0
- package/dist/lib/shared/ui/carouselBase/ui/slideVariants/SlideProductCard.js +2 -0
- package/dist/lib/shared/ui/carouselBase/ui/slideVariants/SlideProductCard.js.map +1 -0
- package/dist/lib/shared/ui/carouselBase/ui/slideVariants/index.js +2 -0
- package/dist/lib/shared/ui/carouselBase/ui/slideVariants/index.js.map +1 -0
- package/dist/lib/shared/ui/formElements/controlled/radio/RadioGroupCardControl.js +1 -1
- package/dist/lib/shared/ui/formElements/controlled/radio/RadioGroupCardControl.js.map +1 -1
- package/dist/lib/shared/ui/formElements/uncontrolled/slider/ui/sliderAlgorithmic/SliderAlgorithmic.js +1 -1
- package/dist/lib/shared/ui/formElements/uncontrolled/slider/ui/sliderAlgorithmic/SliderAlgorithmic.js.map +1 -1
- package/dist/lib/shared/ui/formElements/uncontrolled/slider/ui/sliderAlgorithmic/hooks/useSliderAlgorithmic.js +1 -1
- package/dist/lib/shared/ui/formElements/uncontrolled/slider/ui/sliderAlgorithmic/hooks/useSliderAlgorithmic.js.map +1 -1
- package/dist/lib/shared/ui/formElements/uncontrolled/slider/ui/sliderMarks/SliderMarks.js +1 -1
- package/dist/lib/shared/ui/formElements/uncontrolled/slider/ui/sliderMarks/SliderMarks.js.map +1 -1
- package/dist/lib/shared/ui/formElements/uncontrolled/slider/ui/sliderMarks/hooks/useSliderMarks.js +1 -1
- package/dist/lib/shared/ui/formElements/uncontrolled/slider/ui/sliderMarks/hooks/useSliderMarks.js.map +1 -1
- package/dist/lib/shared/ui/formElements/uncontrolled/slider/ui/sliderStep/SliderStep.js +1 -1
- package/dist/lib/shared/ui/formElements/uncontrolled/slider/ui/sliderStep/SliderStep.js.map +1 -1
- package/dist/lib/shared/ui/formElements/uncontrolled/slider/ui/sliderStep/hooks/useSliderStep.js +1 -1
- package/dist/lib/shared/ui/formElements/uncontrolled/slider/ui/sliderStep/hooks/useSliderStep.js.map +1 -1
- package/dist/lib/shared/ui/index.js +1 -1
- package/dist/lib/widgets/carouselBlock/CarouselBlock.js +2 -0
- package/dist/lib/widgets/carouselBlock/CarouselBlock.js.map +1 -0
- package/dist/lib/widgets/carouselBlock/index.js +2 -0
- package/dist/lib/widgets/carouselBlock/index.js.map +1 -0
- package/dist/lib/widgets/index.js +1 -1
- package/dist/lib/widgets/model/helpers.js +2 -2
- package/dist/lib/widgets/model/helpers.js.map +1 -1
- package/dist/lib/widgets/stepper/ui/StepperCarousel.js +1 -1
- package/dist/lib/widgets/stepper/ui/StepperCarousel.js.map +1 -1
- package/dist/stats.html +1 -1
- package/dist/types/lib/shared/ui/carousel/Carousel.d.ts +30 -0
- package/dist/types/lib/shared/ui/carousel/index.d.ts +1 -2
- package/dist/types/lib/shared/ui/carousel/model/constant.d.ts +11 -0
- package/dist/types/lib/shared/ui/carousel/model/helpers.d.ts +1 -9
- package/dist/types/lib/shared/ui/carousel/model/hooks/useArrowNavigation.d.ts +2 -2
- package/dist/types/lib/shared/ui/carousel/model/hooks/useDotsNavigation.d.ts +2 -1
- package/dist/types/lib/shared/ui/carousel/model/index.d.ts +2 -1
- package/dist/types/lib/shared/ui/carousel/model/types.d.ts +22 -23
- package/dist/types/lib/shared/ui/carousel/ui/ArrowNavigationButton.d.ts +3 -3
- package/dist/types/lib/shared/ui/carousel/ui/DotsNavigations.d.ts +2 -3
- package/dist/types/lib/shared/ui/carousel/ui/RenderSlides.d.ts +14 -0
- package/dist/types/lib/shared/ui/carousel/ui/index.d.ts +3 -3
- package/dist/types/lib/shared/ui/carousel/ui/slideVariants/SlideFullScreen.d.ts +10 -7
- package/dist/types/lib/shared/ui/carousel/ui/slideVariants/SlideProductCard.d.ts +9 -6
- package/dist/types/lib/shared/ui/carousel/ui/slideVariants/SlideStepsList.d.ts +16 -0
- package/dist/types/lib/shared/ui/carousel/ui/slideVariants/index.d.ts +1 -1
- package/dist/types/lib/shared/ui/carousel/ui/stepsList/StepListItemType.d.ts +18 -0
- package/dist/types/lib/shared/ui/carousel/ui/stepsList/StepsList.d.ts +13 -0
- package/dist/types/lib/shared/ui/carousel/ui/stepsList/index.d.ts +2 -0
- package/dist/types/lib/shared/ui/{carousel → carouselBase}/CarouselBase.d.ts +3 -0
- package/dist/types/lib/shared/ui/carouselBase/index.d.ts +3 -0
- package/dist/types/lib/shared/ui/carouselBase/model/helpers.d.ts +9 -0
- package/dist/types/lib/shared/ui/carouselBase/model/hooks/index.d.ts +3 -0
- package/dist/types/lib/shared/ui/carouselBase/model/hooks/useArrowNavigation.d.ts +12 -0
- package/dist/types/lib/shared/ui/carouselBase/model/hooks/useCarousel.d.ts +12 -0
- package/dist/types/lib/shared/ui/carouselBase/model/hooks/useDotsNavigation.d.ts +15 -0
- package/dist/types/lib/shared/ui/carouselBase/model/index.d.ts +3 -0
- package/dist/types/lib/shared/ui/carouselBase/model/types.d.ts +27 -0
- package/dist/types/lib/shared/ui/carouselBase/ui/ArrowNavigationButton.d.ts +13 -0
- package/dist/types/lib/shared/ui/carouselBase/ui/DotsNavigations.d.ts +13 -0
- package/dist/types/lib/shared/ui/carouselBase/ui/index.d.ts +5 -0
- package/dist/types/lib/shared/ui/carouselBase/ui/slideVariants/SlideFullScreen.d.ts +19 -0
- package/dist/types/lib/shared/ui/carouselBase/ui/slideVariants/SlideProductCard.d.ts +20 -0
- package/dist/types/lib/shared/ui/carouselBase/ui/slideVariants/index.d.ts +3 -0
- package/dist/types/lib/shared/ui/formElements/uncontrolled/slider/ui/sliderAlgorithmic/hooks/useSliderAlgorithmic.d.ts +1 -0
- package/dist/types/lib/shared/ui/formElements/uncontrolled/slider/ui/sliderMarks/hooks/useSliderMarks.d.ts +1 -0
- package/dist/types/lib/shared/ui/formElements/uncontrolled/slider/ui/sliderStep/hooks/useSliderStep.d.ts +1 -0
- package/dist/types/lib/shared/ui/index.d.ts +2 -1
- package/dist/types/lib/widgets/carouselBlock/CarouselBlock.d.ts +5 -0
- package/dist/types/lib/widgets/carouselBlock/index.d.ts +1 -0
- package/dist/types/lib/widgets/index.d.ts +1 -0
- package/dist/types/lib/widgets/model/helpers.d.ts +2 -1
- package/package.json +1 -1
- package/dist/lib/shared/ui/carousel/CarouselBase.js.map +0 -1
- package/dist/lib/shared/ui/carousel/CarouselNative.js.map +0 -1
- package/dist/lib/shared/ui/carousel/ui/CarouselContent.js.map +0 -1
- package/dist/lib/shared/ui/carousel/ui/CarouselSlide.js.map +0 -1
- package/dist/lib/shared/ui/carousel/ui/ContainerWithNavigation.js.map +0 -1
- package/dist/lib/shared/ui/carousel/ui/slideVariants/SlideOnlyImage.js.map +0 -1
- /package/dist/lib/shared/ui/{carousel → carouselBase}/CarouselBase.js +0 -0
- /package/dist/lib/shared/ui/{carousel → carouselBase}/CarouselNative.js +0 -0
- /package/dist/lib/shared/ui/{carousel → carouselBase}/ui/CarouselContent.js +0 -0
- /package/dist/lib/shared/ui/{carousel → carouselBase}/ui/CarouselSlide.js +0 -0
- /package/dist/lib/shared/ui/{carousel → carouselBase}/ui/ContainerWithNavigation.js +0 -0
- /package/dist/lib/shared/ui/{carousel → carouselBase}/ui/slideVariants/SlideOnlyImage.js +0 -0
- /package/dist/types/lib/shared/ui/{carousel → carouselBase}/CarouselNative.d.ts +0 -0
- /package/dist/types/lib/shared/ui/{carousel → carouselBase}/ui/CarouselContent.d.ts +0 -0
- /package/dist/types/lib/shared/ui/{carousel → carouselBase}/ui/CarouselSlide.d.ts +0 -0
- /package/dist/types/lib/shared/ui/{carousel → carouselBase}/ui/ContainerWithNavigation.d.ts +0 -0
- /package/dist/types/lib/shared/ui/{carousel → carouselBase}/ui/slideVariants/SlideOnlyImage.d.ts +0 -0
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { Dispatch, SetStateAction } from 'react';
|
|
2
|
+
import { EmblaOptionsType } from 'embla-carousel';
|
|
3
|
+
import { AutoplayOptionsType } from 'embla-carousel-autoplay';
|
|
4
|
+
import { NavigationOptions, SlidesOptions, SlideVariant } from './model';
|
|
5
|
+
import { ArrowNavigationButtonClasses, RenderSlidesClasses, StepListClasses, StepListItemType } from './ui';
|
|
6
|
+
type CarouselClasses = {
|
|
7
|
+
overlay?: string;
|
|
8
|
+
arrowsWrapper?: string;
|
|
9
|
+
header?: string;
|
|
10
|
+
heading?: string;
|
|
11
|
+
dots?: string;
|
|
12
|
+
content?: string;
|
|
13
|
+
arrowNextClasses?: ArrowNavigationButtonClasses;
|
|
14
|
+
arrowPrevClasses?: ArrowNavigationButtonClasses;
|
|
15
|
+
stepsListClasses?: StepListClasses;
|
|
16
|
+
renderSlidesClasses?: RenderSlidesClasses;
|
|
17
|
+
};
|
|
18
|
+
export interface CarouselProps<V extends SlideVariant> {
|
|
19
|
+
setVisibleIndex: Dispatch<SetStateAction<number>>;
|
|
20
|
+
visibleIndex: number;
|
|
21
|
+
slidesOptions: SlidesOptions<V>;
|
|
22
|
+
heading?: string;
|
|
23
|
+
carouselOptions?: EmblaOptionsType;
|
|
24
|
+
autoPlayOptions?: AutoplayOptionsType;
|
|
25
|
+
navigationOptions?: NavigationOptions;
|
|
26
|
+
stepsList?: StepListItemType[];
|
|
27
|
+
classes?: CarouselClasses;
|
|
28
|
+
}
|
|
29
|
+
export declare const Carousel: <V extends SlideVariant>({ carouselOptions, navigationOptions, autoPlayOptions, slidesOptions, setVisibleIndex, visibleIndex, heading, stepsList, classes }: CarouselProps<V>) => import("react/jsx-runtime").JSX.Element;
|
|
30
|
+
export {};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { EmblaOptionsType } from 'embla-carousel';
|
|
2
|
+
import { AutoplayOptionsType } from 'embla-carousel-autoplay';
|
|
3
|
+
import { NavigationOptions } from './types';
|
|
4
|
+
export declare const SLIDE_VARIANT: {
|
|
5
|
+
readonly productCard: "productCard";
|
|
6
|
+
readonly fullScreen: "fullScreen";
|
|
7
|
+
readonly stepsList: "stepsList";
|
|
8
|
+
};
|
|
9
|
+
export declare const defaultCarouselOptions: EmblaOptionsType;
|
|
10
|
+
export declare const defaultNavigationOptions: NavigationOptions;
|
|
11
|
+
export declare const defaultAutoPlayOptions: AutoplayOptionsType;
|
|
@@ -1,9 +1 @@
|
|
|
1
|
-
|
|
2
|
-
import { AutoplayOptionsType } from 'embla-carousel-autoplay';
|
|
3
|
-
import { CarouselSlideVariant, DotsOptions, NavArrowOptions } from './types';
|
|
4
|
-
import { DiscriminatedUnion } from '../../../types';
|
|
5
|
-
export declare const defaultCarouselOptions: EmblaOptionsType;
|
|
6
|
-
export declare const defaultDotsOptions: DotsOptions;
|
|
7
|
-
export declare const defaultNavArrowOptions: NavArrowOptions;
|
|
8
|
-
export declare const defaultAutoPlayOptions: AutoplayOptionsType;
|
|
9
|
-
export declare const renderSlideVariant: (props: DiscriminatedUnion<"variant", CarouselSlideVariant>) => import("react/jsx-runtime").JSX.Element;
|
|
1
|
+
export declare const extractNumberFromString: (str: string) => number;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { EmblaCarouselType } from 'embla-carousel';
|
|
2
|
-
import {
|
|
2
|
+
import { NavigationModeType } from '../types';
|
|
3
3
|
type UseArrowNavigationProps = {
|
|
4
4
|
emblaApi: EmblaCarouselType | undefined;
|
|
5
5
|
navigationHandler?: (emblaApi: EmblaCarouselType) => void;
|
|
@@ -7,6 +7,6 @@ type UseArrowNavigationProps = {
|
|
|
7
7
|
export declare const useArrowNavigation: ({ emblaApi, navigationHandler }: UseArrowNavigationProps) => {
|
|
8
8
|
prevBtnDisabled: boolean;
|
|
9
9
|
nextBtnDisabled: boolean;
|
|
10
|
-
onClickNavigationButton: (mode:
|
|
10
|
+
onClickNavigationButton: (mode: NavigationModeType) => void;
|
|
11
11
|
};
|
|
12
12
|
export {};
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
+
import { Dispatch, SetStateAction } from 'react';
|
|
1
2
|
import { EmblaCarouselType } from 'embla-carousel';
|
|
2
3
|
type UseDotsNavigationProps = {
|
|
3
4
|
emblaApi: EmblaCarouselType | undefined;
|
|
4
5
|
navigationHandler: (emblaApi: EmblaCarouselType) => void;
|
|
5
|
-
setVisibleIndex:
|
|
6
|
+
setVisibleIndex: Dispatch<SetStateAction<number>>;
|
|
6
7
|
};
|
|
7
8
|
export type UseDotsNavigationReturn = {
|
|
8
9
|
scrollSnaps: number[];
|
|
@@ -1,27 +1,26 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
import { SlideFullScreenProps, SlideProductCardProps, SlideStepsListProps } from '../ui';
|
|
2
|
+
import { SLIDE_VARIANT } from './constant';
|
|
3
|
+
export type SlideVariant = keyof typeof SLIDE_VARIANT;
|
|
4
|
+
export type SlidesConfig = {
|
|
5
|
+
deskSlideWidth: string;
|
|
6
|
+
mobSlideWidth: string;
|
|
6
7
|
};
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
8
|
+
type SlideVariantPropsMap = {
|
|
9
|
+
fullScreen: SlideFullScreenProps;
|
|
10
|
+
productCard: SlideProductCardProps;
|
|
11
|
+
stepsList: SlideStepsListProps;
|
|
11
12
|
};
|
|
12
|
-
export type
|
|
13
|
-
export type
|
|
14
|
-
|
|
15
|
-
|
|
13
|
+
export type SlidesVariantProps<T extends SlideVariant> = SlideVariantPropsMap[T];
|
|
14
|
+
export type SlidesOptions<V extends SlideVariant> = {
|
|
15
|
+
slides: SlidesVariantProps<V>[];
|
|
16
|
+
slideVariant: V;
|
|
17
|
+
slidesConfig: SlidesConfig;
|
|
18
|
+
};
|
|
19
|
+
export type NavigationModeType = 'next' | 'prev';
|
|
20
|
+
export type NavigationOptions = {
|
|
21
|
+
dotsOnDesk?: boolean;
|
|
22
|
+
dotsOnMob?: boolean;
|
|
23
|
+
arrowsOnDesk?: boolean;
|
|
24
|
+
arrowsOnMob?: boolean;
|
|
16
25
|
};
|
|
17
|
-
interface SlideFullScreen extends SlideFullScreenProps, CarouselSlideProps {
|
|
18
|
-
variant: 'fullScreen';
|
|
19
|
-
}
|
|
20
|
-
interface SlideOnlyImage extends SlideOnlyImageProps, CarouselSlideProps {
|
|
21
|
-
variant: 'onlyImage';
|
|
22
|
-
}
|
|
23
|
-
interface SlideProductCard extends SlideProductCardProps, CarouselSlideProps {
|
|
24
|
-
variant: 'productCard';
|
|
25
|
-
}
|
|
26
|
-
export type CarouselSlideVariant = SlideFullScreen | SlideOnlyImage | SlideProductCard;
|
|
27
26
|
export {};
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { ComponentPropsWithRef } from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { NavigationModeType } from '../model';
|
|
3
3
|
export type ArrowNavigationButtonClasses = {
|
|
4
4
|
button?: string;
|
|
5
5
|
icon?: string;
|
|
6
6
|
};
|
|
7
7
|
interface ArrowNavigationButtonProps extends Omit<ComponentPropsWithRef<'button'>, 'onClick'> {
|
|
8
|
-
mode:
|
|
9
|
-
onClick: (mode:
|
|
8
|
+
mode: NavigationModeType;
|
|
9
|
+
onClick: (mode: NavigationModeType) => void;
|
|
10
10
|
classes?: ArrowNavigationButtonClasses;
|
|
11
11
|
}
|
|
12
12
|
export declare const ArrowNavigationButton: ({ mode, onClick, children, classes, ...props }: ArrowNavigationButtonProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,13 +1,12 @@
|
|
|
1
|
-
import { DotsOptions } from '../model';
|
|
2
1
|
export type DotsNavigationsClasses = {
|
|
3
2
|
dotsWrapper?: string;
|
|
4
3
|
dot?: string;
|
|
5
4
|
};
|
|
6
|
-
interface DotsNavigationsProps
|
|
5
|
+
interface DotsNavigationsProps {
|
|
7
6
|
scrollSnaps: number[];
|
|
8
7
|
onClickDot: (index: number) => void;
|
|
9
8
|
visibleIndex: number;
|
|
10
9
|
classes?: DotsNavigationsClasses;
|
|
11
10
|
}
|
|
12
|
-
export declare const DotsNavigations: ({ scrollSnaps, visibleIndex, onClickDot,
|
|
11
|
+
export declare const DotsNavigations: ({ scrollSnaps, visibleIndex, onClickDot, classes, ...props }: DotsNavigationsProps) => import("react/jsx-runtime").JSX.Element;
|
|
13
12
|
export {};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { CarouselProps } from '../Carousel';
|
|
2
|
+
import { SlideVariant } from '../model';
|
|
3
|
+
import { SlideFullScreenClasses, SlideProductCardClasses, SlideStepsListClasses } from './slideVariants';
|
|
4
|
+
export type RenderSlidesClasses = {
|
|
5
|
+
renderSlidesWrapper?: string;
|
|
6
|
+
slideProductCardClasses?: SlideProductCardClasses;
|
|
7
|
+
slideFullScreenClasses?: SlideFullScreenClasses;
|
|
8
|
+
slideStepsListClasses?: SlideStepsListClasses;
|
|
9
|
+
};
|
|
10
|
+
export interface RenderSlidesProps<V extends SlideVariant> {
|
|
11
|
+
slidesOptions: CarouselProps<V>['slidesOptions'];
|
|
12
|
+
classes?: RenderSlidesClasses;
|
|
13
|
+
}
|
|
14
|
+
export declare const RenderSlides: <V extends SlideVariant>({ slidesOptions, classes }: RenderSlidesProps<V>) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
+
export * from './slideVariants';
|
|
2
|
+
export * from './RenderSlides';
|
|
1
3
|
export * from './ArrowNavigationButton';
|
|
2
|
-
export * from './CarouselSlide';
|
|
3
4
|
export * from './DotsNavigations';
|
|
4
|
-
export * from './
|
|
5
|
-
export * from './CarouselContent';
|
|
5
|
+
export * from './stepsList';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
type SlideFullScreenClasses = {
|
|
1
|
+
import { SlidesConfig } from '../../model';
|
|
2
|
+
export type SlideFullScreenClasses = {
|
|
3
3
|
root?: string;
|
|
4
4
|
wrapper?: string;
|
|
5
5
|
numeric?: string;
|
|
@@ -9,11 +9,14 @@ type SlideFullScreenClasses = {
|
|
|
9
9
|
image?: string;
|
|
10
10
|
};
|
|
11
11
|
export interface SlideFullScreenProps {
|
|
12
|
-
|
|
12
|
+
slidesConfig: SlidesConfig;
|
|
13
|
+
slideIndex?: number;
|
|
13
14
|
title?: string;
|
|
14
15
|
description?: string;
|
|
15
|
-
|
|
16
|
-
|
|
16
|
+
imgProps?: {
|
|
17
|
+
src: string;
|
|
18
|
+
alt: string;
|
|
19
|
+
};
|
|
20
|
+
slideFullScreenClasses?: SlideFullScreenClasses;
|
|
17
21
|
}
|
|
18
|
-
export declare const SlideFullScreen: ({ slideIndex, title,
|
|
19
|
-
export {};
|
|
22
|
+
export declare const SlideFullScreen: ({ slideIndex, title, imgProps, description, slideFullScreenClasses, slidesConfig }: SlideFullScreenProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ButtonProps } from '../../../button';
|
|
2
|
-
import {
|
|
3
|
-
type SlideProductCardClasses = {
|
|
2
|
+
import { SlidesConfig } from '../../model';
|
|
3
|
+
export type SlideProductCardClasses = {
|
|
4
4
|
root?: string;
|
|
5
5
|
wrapper?: string;
|
|
6
6
|
textWrapper?: string;
|
|
@@ -10,11 +10,14 @@ type SlideProductCardClasses = {
|
|
|
10
10
|
button?: string;
|
|
11
11
|
};
|
|
12
12
|
export interface SlideProductCardProps {
|
|
13
|
+
slidesConfig: SlidesConfig;
|
|
13
14
|
title?: string;
|
|
14
15
|
description?: string;
|
|
15
|
-
imgProps?:
|
|
16
|
+
imgProps?: {
|
|
17
|
+
src: string;
|
|
18
|
+
alt: string;
|
|
19
|
+
};
|
|
16
20
|
buttonProps?: ButtonProps;
|
|
17
|
-
|
|
21
|
+
slideProductCardClasses?: SlideProductCardClasses;
|
|
18
22
|
}
|
|
19
|
-
export declare const SlideProductCard: ({ title, imgProps, description, buttonProps,
|
|
20
|
-
export {};
|
|
23
|
+
export declare const SlideProductCard: ({ title, imgProps, description, buttonProps, slideProductCardClasses, slidesConfig }: SlideProductCardProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { SlidesConfig } from '../../model';
|
|
2
|
+
export type SlideStepsListClasses = {
|
|
3
|
+
wrapper?: string;
|
|
4
|
+
imageWrapper?: string;
|
|
5
|
+
image?: string;
|
|
6
|
+
};
|
|
7
|
+
export interface SlideStepsListProps {
|
|
8
|
+
slidesConfig: SlidesConfig;
|
|
9
|
+
slideIndex?: number;
|
|
10
|
+
imgProps?: {
|
|
11
|
+
src: string;
|
|
12
|
+
alt: string;
|
|
13
|
+
};
|
|
14
|
+
slideStepsListClasses?: SlideStepsListClasses;
|
|
15
|
+
}
|
|
16
|
+
export declare const SlideStepsList: ({ imgProps, slideStepsListClasses, slidesConfig }: SlideStepsListProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export type StepListItemClasses = {
|
|
2
|
+
root?: string;
|
|
3
|
+
stepIndex?: string;
|
|
4
|
+
textBlock?: string;
|
|
5
|
+
subtitle?: string;
|
|
6
|
+
description?: string;
|
|
7
|
+
};
|
|
8
|
+
export type StepListItemType = {
|
|
9
|
+
subtitle: string;
|
|
10
|
+
description?: string;
|
|
11
|
+
};
|
|
12
|
+
export interface StepListItemProps extends StepListItemType {
|
|
13
|
+
stepIndex: number;
|
|
14
|
+
visibleIndex: number;
|
|
15
|
+
onChangeStep: (stepIndex: number) => void;
|
|
16
|
+
classes?: StepListItemClasses;
|
|
17
|
+
}
|
|
18
|
+
export declare const StepListItem: ({ subtitle, description, stepIndex, visibleIndex, onChangeStep, classes }: StepListItemProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { StepListItemClasses, StepListItemType } from './StepListItemType';
|
|
2
|
+
export type StepListClasses = {
|
|
3
|
+
stepListItemClasses?: StepListItemClasses;
|
|
4
|
+
stepsWrapper?: string;
|
|
5
|
+
};
|
|
6
|
+
export interface StepsListProps {
|
|
7
|
+
stepsList: StepListItemType[];
|
|
8
|
+
visibleIndex: number;
|
|
9
|
+
onChangeStep: (stepIndex: number) => void;
|
|
10
|
+
heading?: string;
|
|
11
|
+
classes?: StepListClasses;
|
|
12
|
+
}
|
|
13
|
+
export declare const StepsList: ({ stepsList, visibleIndex, onChangeStep, classes }: StepsListProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -25,4 +25,7 @@ export interface CarouselBaseProps extends HTMLAttributes<HTMLDivElement> {
|
|
|
25
25
|
visibleIndex: number;
|
|
26
26
|
classes?: CarouselClasses;
|
|
27
27
|
}
|
|
28
|
+
/**
|
|
29
|
+
* @deprecated dont use
|
|
30
|
+
*/
|
|
28
31
|
export declare const CarouselBase: ({ dotsOptions, navArrowOptions, carouselOptions, heading, autoPlayOptions, setVisibleIndex, visibleIndex, children, classes, ...props }: CarouselBaseProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { EmblaOptionsType } from 'embla-carousel';
|
|
2
|
+
import { AutoplayOptionsType } from 'embla-carousel-autoplay';
|
|
3
|
+
import { CarouselSlideVariant, DotsOptions, NavArrowOptions } from './types';
|
|
4
|
+
import { DiscriminatedUnion } from '../../../types';
|
|
5
|
+
export declare const defaultCarouselOptions: EmblaOptionsType;
|
|
6
|
+
export declare const defaultDotsOptions: DotsOptions;
|
|
7
|
+
export declare const defaultNavArrowOptions: NavArrowOptions;
|
|
8
|
+
export declare const defaultAutoPlayOptions: AutoplayOptionsType;
|
|
9
|
+
export declare const renderSlideVariant: (props: DiscriminatedUnion<"variant", CarouselSlideVariant>) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { EmblaCarouselType } from 'embla-carousel';
|
|
2
|
+
import { NavigationMode } from '../types';
|
|
3
|
+
type UseArrowNavigationProps = {
|
|
4
|
+
emblaApi: EmblaCarouselType | undefined;
|
|
5
|
+
navigationHandler?: (emblaApi: EmblaCarouselType) => void;
|
|
6
|
+
};
|
|
7
|
+
export declare const useArrowNavigation: ({ emblaApi, navigationHandler }: UseArrowNavigationProps) => {
|
|
8
|
+
prevBtnDisabled: boolean;
|
|
9
|
+
nextBtnDisabled: boolean;
|
|
10
|
+
onClickNavigationButton: (mode: NavigationMode) => void;
|
|
11
|
+
};
|
|
12
|
+
export {};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { EmblaCarouselType, EmblaOptionsType } from 'embla-carousel';
|
|
2
|
+
import { AutoplayOptionsType } from 'embla-carousel-autoplay';
|
|
3
|
+
type UseCarouselProps = {
|
|
4
|
+
carouselOptions: EmblaOptionsType;
|
|
5
|
+
autoPlayOptions?: AutoplayOptionsType;
|
|
6
|
+
};
|
|
7
|
+
export declare const useCarousel: ({ carouselOptions, autoPlayOptions }: UseCarouselProps) => {
|
|
8
|
+
emblaRef: import('embla-carousel-react').EmblaViewportRefType;
|
|
9
|
+
emblaApi: EmblaCarouselType | undefined;
|
|
10
|
+
navigationHandler: (emblaApi: EmblaCarouselType) => void;
|
|
11
|
+
};
|
|
12
|
+
export {};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { EmblaCarouselType } from 'embla-carousel';
|
|
2
|
+
type UseDotsNavigationProps = {
|
|
3
|
+
emblaApi: EmblaCarouselType | undefined;
|
|
4
|
+
navigationHandler: (emblaApi: EmblaCarouselType) => void;
|
|
5
|
+
setVisibleIndex: (index: number) => void;
|
|
6
|
+
};
|
|
7
|
+
export type UseDotsNavigationReturn = {
|
|
8
|
+
scrollSnaps: number[];
|
|
9
|
+
onClickDot: (index: number) => void;
|
|
10
|
+
};
|
|
11
|
+
export declare const useDotsNavigation: ({ emblaApi, navigationHandler, setVisibleIndex }: UseDotsNavigationProps) => {
|
|
12
|
+
scrollSnaps: number[];
|
|
13
|
+
onClickDot: (index: number) => void;
|
|
14
|
+
};
|
|
15
|
+
export {};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { CarouselSlideProps, SlideFullScreenProps, SlideOnlyImageProps, SlideProductCardProps } from '../ui';
|
|
2
|
+
export type DotsOptions = {
|
|
3
|
+
position?: 'bot-left' | 'center' | 'bot-right';
|
|
4
|
+
deskVisible?: boolean;
|
|
5
|
+
mobVisible?: boolean;
|
|
6
|
+
};
|
|
7
|
+
export type NavArrowOptions = {
|
|
8
|
+
position?: 'center' | 'top-right';
|
|
9
|
+
deskVisible?: boolean;
|
|
10
|
+
mobVisible?: boolean;
|
|
11
|
+
};
|
|
12
|
+
export type NavigationMode = 'next' | 'prev';
|
|
13
|
+
export type ImageProps = {
|
|
14
|
+
src: string;
|
|
15
|
+
alt: string;
|
|
16
|
+
};
|
|
17
|
+
interface SlideFullScreen extends SlideFullScreenProps, CarouselSlideProps {
|
|
18
|
+
variant: 'fullScreen';
|
|
19
|
+
}
|
|
20
|
+
interface SlideOnlyImage extends SlideOnlyImageProps, CarouselSlideProps {
|
|
21
|
+
variant: 'onlyImage';
|
|
22
|
+
}
|
|
23
|
+
interface SlideProductCard extends SlideProductCardProps, CarouselSlideProps {
|
|
24
|
+
variant: 'productCard';
|
|
25
|
+
}
|
|
26
|
+
export type CarouselSlideVariant = SlideFullScreen | SlideOnlyImage | SlideProductCard;
|
|
27
|
+
export {};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { ComponentPropsWithRef } from 'react';
|
|
2
|
+
import { NavigationMode } from '../model';
|
|
3
|
+
export type ArrowNavigationButtonClasses = {
|
|
4
|
+
button?: string;
|
|
5
|
+
icon?: string;
|
|
6
|
+
};
|
|
7
|
+
interface ArrowNavigationButtonProps extends Omit<ComponentPropsWithRef<'button'>, 'onClick'> {
|
|
8
|
+
mode: NavigationMode;
|
|
9
|
+
onClick: (mode: NavigationMode) => void;
|
|
10
|
+
classes?: ArrowNavigationButtonClasses;
|
|
11
|
+
}
|
|
12
|
+
export declare const ArrowNavigationButton: ({ mode, onClick, children, classes, ...props }: ArrowNavigationButtonProps) => import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
export {};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { DotsOptions } from '../model';
|
|
2
|
+
export type DotsNavigationsClasses = {
|
|
3
|
+
dotsWrapper?: string;
|
|
4
|
+
dot?: string;
|
|
5
|
+
};
|
|
6
|
+
interface DotsNavigationsProps extends Pick<DotsOptions, 'position'> {
|
|
7
|
+
scrollSnaps: number[];
|
|
8
|
+
onClickDot: (index: number) => void;
|
|
9
|
+
visibleIndex: number;
|
|
10
|
+
classes?: DotsNavigationsClasses;
|
|
11
|
+
}
|
|
12
|
+
export declare const DotsNavigations: ({ scrollSnaps, visibleIndex, onClickDot, position, classes, ...props }: DotsNavigationsProps) => import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
export {};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { ImageProps } from '../../model';
|
|
2
|
+
type SlideFullScreenClasses = {
|
|
3
|
+
root?: string;
|
|
4
|
+
wrapper?: string;
|
|
5
|
+
numeric?: string;
|
|
6
|
+
textWrapper?: string;
|
|
7
|
+
title?: string;
|
|
8
|
+
description?: string;
|
|
9
|
+
image?: string;
|
|
10
|
+
};
|
|
11
|
+
export interface SlideFullScreenProps {
|
|
12
|
+
slideIndex: number;
|
|
13
|
+
title?: string;
|
|
14
|
+
description?: string;
|
|
15
|
+
image?: ImageProps;
|
|
16
|
+
slideClasses?: SlideFullScreenClasses;
|
|
17
|
+
}
|
|
18
|
+
export declare const SlideFullScreen: ({ slideIndex, title, image, description, slideClasses }: SlideFullScreenProps) => import("react/jsx-runtime").JSX.Element;
|
|
19
|
+
export {};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { ButtonProps } from '../../../button';
|
|
2
|
+
import { ImageProps } from '../../model';
|
|
3
|
+
type SlideProductCardClasses = {
|
|
4
|
+
root?: string;
|
|
5
|
+
wrapper?: string;
|
|
6
|
+
textWrapper?: string;
|
|
7
|
+
title?: string;
|
|
8
|
+
description?: string;
|
|
9
|
+
image?: string;
|
|
10
|
+
button?: string;
|
|
11
|
+
};
|
|
12
|
+
export interface SlideProductCardProps {
|
|
13
|
+
title?: string;
|
|
14
|
+
description?: string;
|
|
15
|
+
imgProps?: ImageProps;
|
|
16
|
+
buttonProps?: ButtonProps;
|
|
17
|
+
slideClasses?: SlideProductCardClasses;
|
|
18
|
+
}
|
|
19
|
+
export declare const SlideProductCard: ({ title, imgProps, description, buttonProps, slideClasses }: SlideProductCardProps) => import("react/jsx-runtime").JSX.Element;
|
|
20
|
+
export {};
|
|
@@ -7,6 +7,7 @@ interface UseSliderAlgorithmic {
|
|
|
7
7
|
}
|
|
8
8
|
export declare const useSliderAlgorithmic: ({ min, max, defaultValue, value, onChange }: UseSliderAlgorithmic) => {
|
|
9
9
|
handleChangeSlider: (value?: number) => void;
|
|
10
|
+
handleBlur: () => void;
|
|
10
11
|
toSlider: (value: number | undefined) => number;
|
|
11
12
|
fromSlider: (value: number) => number;
|
|
12
13
|
sliderValue: number;
|
|
@@ -16,7 +16,7 @@ export * from './modal';
|
|
|
16
16
|
export * from './notification';
|
|
17
17
|
export * from './table';
|
|
18
18
|
export * from './pagination';
|
|
19
|
-
export * from './
|
|
19
|
+
export * from './carouselBase';
|
|
20
20
|
export * from './dialog';
|
|
21
21
|
export * from './providers';
|
|
22
22
|
export * from './heading';
|
|
@@ -32,3 +32,4 @@ export * from './dropdownList';
|
|
|
32
32
|
export * from './portal';
|
|
33
33
|
export * from './divider';
|
|
34
34
|
export * from './confirmable';
|
|
35
|
+
export * from './carousel';
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { CarouselProps, SlideVariant } from '../../shared/ui';
|
|
2
|
+
export interface CarouselBlockProps<V extends SlideVariant> extends CarouselProps<V> {
|
|
3
|
+
}
|
|
4
|
+
export declare const CarouselBlock: <V extends SlideVariant>(props: CarouselBlockProps<V>) => import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
export default CarouselBlock;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './CarouselBlock';
|
|
@@ -16,7 +16,8 @@ export declare const WIDGET_LIST_MAP: {
|
|
|
16
16
|
readonly userFeedback: import('react').LazyExoticComponent<(props: import('..').UserFeedbackProps) => import("react/jsx-runtime").JSX.Element>;
|
|
17
17
|
readonly infoTable: import('react').LazyExoticComponent<(<Key extends string, TData extends Record<Key, unknown>>(props: import('..').TableProps<Key, TData>) => import("react/jsx-runtime").JSX.Element)>;
|
|
18
18
|
readonly conditionBlock: import('react').LazyExoticComponent<(<WithImages extends boolean>({ headline, classes, conditions, conditionsWithCTA }: import('../conditionBlock/ConditionBlock').ConditionBlockClassesProps<WithImages>) => import("react/jsx-runtime").JSX.Element)>;
|
|
19
|
+
readonly carouselBlock: import('react').LazyExoticComponent<(<V extends import('../../shared/ui').SlideVariant>(props: import('..').CarouselBlockProps<V>) => import("react/jsx-runtime").JSX.Element)>;
|
|
19
20
|
readonly errorPage: import('react').LazyExoticComponent<({ errorText, title, subtitle, buttonProps, links, images, backgroundColor }: import('..').ErrorPageProps) => import("react/jsx-runtime").JSX.Element>;
|
|
20
21
|
};
|
|
21
22
|
export declare const KEYS_OF_WIDGET_LIST: readonly AllowedWidgets[];
|
|
22
|
-
export declare const widgetIds: Record<"footer" | "header" | "seoHeader" | "banner" | "calculator" | "form" | "formDialog" | "stepper" | "benefit" | "longBanner" | "usefulInfo" | "interLinking" | "infoBlock" | "userFeedback" | "infoTable" | "conditionBlock" | "errorPage", "footer" | "header" | "seoHeader" | "banner" | "calculator" | "form" | "formDialog" | "stepper" | "benefit" | "longBanner" | "usefulInfo" | "interLinking" | "infoBlock" | "userFeedback" | "infoTable" | "conditionBlock" | "errorPage">;
|
|
23
|
+
export declare const widgetIds: Record<"footer" | "header" | "seoHeader" | "banner" | "calculator" | "form" | "formDialog" | "stepper" | "benefit" | "longBanner" | "usefulInfo" | "interLinking" | "infoBlock" | "userFeedback" | "infoTable" | "conditionBlock" | "carouselBlock" | "errorPage", "footer" | "header" | "seoHeader" | "banner" | "calculator" | "form" | "formDialog" | "stepper" | "benefit" | "longBanner" | "usefulInfo" | "interLinking" | "infoBlock" | "userFeedback" | "infoTable" | "conditionBlock" | "carouselBlock" | "errorPage">;
|
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"CarouselBase.js","sources":["../../../../../lib/shared/ui/carousel/CarouselBase.tsx"],"sourcesContent":["import { type HTMLAttributes, type ReactNode } from 'react'\nimport { type EmblaOptionsType } from 'embla-carousel'\nimport type { AutoplayOptionsType } from 'embla-carousel-autoplay'\nimport { useDevice } from '../../hooks'\nimport { Heading } from '../heading'\nimport {\n defaultAutoPlayOptions,\n defaultCarouselOptions,\n defaultDotsOptions,\n defaultNavArrowOptions,\n type DotsOptions,\n type NavArrowOptions,\n useArrowNavigation,\n useCarousel,\n useDotsNavigation\n} from './model'\nimport { ArrowNavigationButton, type ArrowNavigationButtonClasses, CarouselContent, type CarouselContentClasses } from './ui'\nimport { ContainerWithNavigation, type ContainerWithNavigationClasses } from './ui/ContainerWithNavigation'\nimport { cn } from '$/shared/utils'\n\nexport type CarouselClasses = {\n root?: string\n header?: string\n heading?: string\n arrowsNavWrapper?: string\n arrowLeftClasses?: ArrowNavigationButtonClasses\n arrowRightClasses?: ArrowNavigationButtonClasses\n containerWithNavClasses?: ContainerWithNavigationClasses\n carouselContentClasses?: CarouselContentClasses\n}\n\nexport interface CarouselBaseProps extends HTMLAttributes<HTMLDivElement> {\n children: ReactNode\n heading?: string\n carouselOptions?: EmblaOptionsType\n dotsOptions?: DotsOptions\n navArrowOptions?: NavArrowOptions\n autoPlayOptions?: AutoplayOptionsType\n setVisibleIndex: (index: number) => void\n visibleIndex: number\n classes?: CarouselClasses\n}\n\nexport const CarouselBase = ({\n dotsOptions = defaultDotsOptions,\n navArrowOptions = defaultNavArrowOptions,\n carouselOptions = defaultCarouselOptions,\n heading,\n autoPlayOptions,\n setVisibleIndex,\n visibleIndex,\n children,\n classes,\n ...props\n}: CarouselBaseProps) => {\n const mergedCarouselOptions = { ...defaultCarouselOptions, ...carouselOptions }\n const mergedAutoPlayOptions = { ...defaultAutoPlayOptions, ...autoPlayOptions }\n const mergedNavArrowOptions = { ...defaultNavArrowOptions, ...navArrowOptions }\n const mergedDotsOptions = { ...defaultDotsOptions, ...dotsOptions }\n\n const { emblaApi, navigationHandler, emblaRef } = useCarousel({\n carouselOptions: mergedCarouselOptions,\n autoPlayOptions: mergedAutoPlayOptions\n })\n\n const dotsProps = useDotsNavigation({ emblaApi, navigationHandler, setVisibleIndex })\n const { prevBtnDisabled, nextBtnDisabled, onClickNavigationButton } = useArrowNavigation({\n emblaApi,\n navigationHandler\n })\n\n const { isMobile, isDesktop } = useDevice()\n const { deskVisible, mobVisible, position: navArrowPosition } = mergedNavArrowOptions ?? {}\n\n //Отображения стрелок если переданы и мобильное разрешение\n const withNavArrowsOnMob = mobVisible && isMobile\n //Отображения стрелок если переданы и полноэкранное разрешение\n const winNavArrowsOnDesk = deskVisible && isDesktop\n //Отображения стрелок если переданы\n const winNavArrows = winNavArrowsOnDesk || withNavArrowsOnMob\n\n const withHeadingAndArrowsTop = Boolean(heading) || (winNavArrows && navArrowPosition === 'top-right')\n\n return (\n <div className={cn('flex flex-col', classes?.root)} {...props}>\n {withHeadingAndArrowsTop && (\n <div className={cn('flex items-center justify-between gap-6', { 'mb-6': withHeadingAndArrowsTop }, classes?.header)}>\n {Boolean(heading) && (\n <Heading as='h2' className={cn(classes?.heading)}>\n Другие предложения\n </Heading>\n )}\n\n {winNavArrows && navArrowPosition === 'top-right' && (\n <div className={cn('ml-auto flex items-center gap-2', classes?.arrowsNavWrapper)}>\n <ArrowNavigationButton\n mode='prev'\n onClick={onClickNavigationButton}\n disabled={prevBtnDisabled}\n classes={classes?.arrowLeftClasses}\n />\n <ArrowNavigationButton\n mode='next'\n onClick={onClickNavigationButton}\n disabled={nextBtnDisabled}\n classes={classes?.arrowRightClasses}\n />\n </div>\n )}\n </div>\n )}\n\n {winNavArrows && navArrowPosition === 'center' ? (\n <ContainerWithNavigation\n onClickNavigationButton={onClickNavigationButton}\n prevBtnDisabled={prevBtnDisabled}\n nextBtnDisabled={nextBtnDisabled}\n classes={classes?.containerWithNavClasses}\n >\n <CarouselContent\n visibleIndex={visibleIndex}\n dotsOptions={mergedDotsOptions}\n ref={emblaRef}\n dotsProps={dotsProps}\n classes={classes?.carouselContentClasses}\n >\n {children}\n </CarouselContent>\n </ContainerWithNavigation>\n ) : (\n <CarouselContent\n visibleIndex={visibleIndex}\n dotsOptions={mergedDotsOptions}\n ref={emblaRef}\n dotsProps={dotsProps}\n classes={classes?.carouselContentClasses}\n >\n {children}\n </CarouselContent>\n )}\n </div>\n )\n}\n"],"names":["CarouselBase","dotsOptions","defaultDotsOptions","navArrowOptions","defaultNavArrowOptions","carouselOptions","defaultCarouselOptions","heading","autoPlayOptions","setVisibleIndex","visibleIndex","children","classes","props","mergedCarouselOptions","mergedAutoPlayOptions","defaultAutoPlayOptions","mergedNavArrowOptions","mergedDotsOptions","emblaApi","navigationHandler","emblaRef","useCarousel","dotsProps","useDotsNavigation","prevBtnDisabled","nextBtnDisabled","onClickNavigationButton","useArrowNavigation","isMobile","isDesktop","useDevice","deskVisible","mobVisible","navArrowPosition","winNavArrows","withHeadingAndArrowsTop","jsxs","cn","jsx","Heading","ArrowNavigationButton","ContainerWithNavigation","CarouselContent"],"mappings":"+tBA2CO,MAAMA,GAAe,CAAC,CAC3B,YAAAC,EAAcC,EACd,gBAAAC,EAAkBC,EAClB,gBAAAC,EAAkBC,EAClB,QAAAC,EACA,gBAAAC,EACA,gBAAAC,EACA,aAAAC,EACA,SAAAC,EACA,QAAAC,EACA,GAAGC,CACL,IAAyB,CACvB,MAAMC,EAAwB,CAAE,GAAGR,EAAwB,GAAGD,CAAA,EACxDU,EAAwB,CAAE,GAAGC,EAAwB,GAAGR,CAAA,EACxDS,EAAwB,CAAE,GAAGb,EAAwB,GAAGD,CAAA,EACxDe,EAAoB,CAAE,GAAGhB,EAAoB,GAAGD,CAAA,EAEhD,CAAE,SAAAkB,EAAU,kBAAAC,EAAmB,SAAAC,CAAA,EAAaC,EAAY,CAC5D,gBAAiBR,EACjB,gBAAiBC,CAAA,CAClB,EAEKQ,EAAYC,EAAkB,CAAE,SAAAL,EAAU,kBAAAC,EAAmB,gBAAAX,EAAiB,EAC9E,CAAE,gBAAAgB,EAAiB,gBAAAC,EAAiB,wBAAAC,CAAA,EAA4BC,EAAmB,CACvF,SAAAT,EACA,kBAAAC,CAAA,CACD,EAEK,CAAE,SAAAS,EAAU,UAAAC,CAAA,EAAcC,EAAA,EAC1B,CAAE,YAAAC,EAAa,WAAAC,EAAY,SAAUC,CAAA,EAAqBjB,GAAyB,CAAA,EAOnFkB,EAFqBH,GAAeF,GAFfG,GAAcJ,EAMnCO,EAA0B,EAAQ7B,GAAa4B,GAAgBD,IAAqB,YAE1F,OACEG,EAAC,OAAI,UAAWC,EAAG,gBAAiB1B,GAAS,IAAI,EAAI,GAAGC,EACrD,SAAA,CAAAuB,GACCC,EAAC,MAAA,CAAI,UAAWC,EAAG,0CAA2C,CAAE,OAAQF,CAAA,EAA2BxB,GAAS,MAAM,EAC/G,SAAA,CAAA,EAAQL,GACPgC,EAACC,EAAA,CAAQ,GAAG,KAAK,UAAWF,EAAG1B,GAAS,OAAO,EAAG,SAAA,oBAAA,CAElD,EAGDuB,GAAgBD,IAAqB,aACpCG,EAAC,MAAA,CAAI,UAAWC,EAAG,kCAAmC1B,GAAS,gBAAgB,EAC7E,SAAA,CAAA2B,EAACE,EAAA,CACC,KAAK,OACL,QAASd,EACT,SAAUF,EACV,QAASb,GAAS,gBAAA,CAAA,EAEpB2B,EAACE,EAAA,CACC,KAAK,OACL,QAASd,EACT,SAAUD,EACV,QAASd,GAAS,iBAAA,CAAA,CACpB,CAAA,CACF,CAAA,EAEJ,EAGDuB,GAAgBD,IAAqB,SACpCK,EAACG,EAAA,CACC,wBAAAf,EACA,gBAAAF,EACA,gBAAAC,EACA,QAASd,GAAS,wBAElB,SAAA2B,EAACI,EAAA,CACC,aAAAjC,EACA,YAAaQ,EACb,IAAKG,EACL,UAAAE,EACA,QAASX,GAAS,uBAEjB,SAAAD,CAAA,CAAA,CACH,CAAA,EAGF4B,EAACI,EAAA,CACC,aAAAjC,EACA,YAAaQ,EACb,IAAKG,EACL,UAAAE,EACA,QAASX,GAAS,uBAEjB,SAAAD,CAAA,CAAA,CACH,EAEJ,CAEJ"}
|