@scbt-ecom/ui 0.64.1 → 0.66.0

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.
Files changed (36) hide show
  1. package/dist/{index-B00qeS0W.js → index-CywQGF6V.js} +9405 -9362
  2. package/dist/index-CywQGF6V.js.map +1 -0
  3. package/dist/shared/types/dicriminatedUnion.d.ts +7 -0
  4. package/dist/shared/types/index.d.ts +2 -0
  5. package/dist/shared/types/keysOf.d.ts +5 -0
  6. package/dist/shared/ui/button/index.d.ts +1 -0
  7. package/dist/shared/ui/button/model/helpers.d.ts +18 -1
  8. package/dist/shared/ui/buttonIcon/ButtonIcon.d.ts +1 -1
  9. package/dist/shared/ui/carousel/CarouselBase.d.ts +29 -0
  10. package/dist/shared/ui/carousel/index.d.ts +3 -0
  11. package/dist/shared/ui/carousel/model/helpers.d.ts +9 -0
  12. package/dist/shared/ui/carousel/model/hooks/index.d.ts +3 -0
  13. package/dist/shared/ui/carousel/model/hooks/useArrowNavigation.d.ts +12 -0
  14. package/dist/shared/ui/carousel/model/hooks/useCarousel.d.ts +12 -0
  15. package/dist/shared/ui/carousel/model/hooks/useDotsNavigation.d.ts +15 -0
  16. package/dist/shared/ui/carousel/model/index.d.ts +3 -0
  17. package/dist/shared/ui/carousel/model/types.d.ts +27 -0
  18. package/dist/shared/ui/carousel/ui/ArrowNavigationButton.d.ts +13 -0
  19. package/dist/shared/ui/carousel/ui/CarouselContent.d.ts +16 -0
  20. package/dist/shared/ui/carousel/ui/CarouselSlide.d.ts +10 -0
  21. package/dist/shared/ui/carousel/ui/ContainerWithNavigation.d.ts +16 -0
  22. package/dist/shared/ui/carousel/ui/DotsNavigations.d.ts +13 -0
  23. package/dist/shared/ui/carousel/ui/index.d.ts +5 -0
  24. package/dist/shared/ui/carousel/ui/slideVariants/SlideFullScreen.d.ts +19 -0
  25. package/dist/shared/ui/carousel/ui/slideVariants/SlideOnlyImage.d.ts +11 -0
  26. package/dist/shared/ui/carousel/ui/slideVariants/SlideProductCard.d.ts +20 -0
  27. package/dist/shared/ui/carousel/ui/slideVariants/index.d.ts +3 -0
  28. package/dist/shared/ui/customLink/model/helpers.d.ts +1 -1
  29. package/dist/shared/ui/index.d.ts +1 -0
  30. package/dist/shared/ui/loader/model/helpers.d.ts +1 -1
  31. package/dist/ui.js +2468 -858
  32. package/dist/ui.js.map +1 -1
  33. package/dist/widget.js +1 -1
  34. package/dist/widget.js.map +1 -1
  35. package/package.json +5 -2
  36. package/dist/index-B00qeS0W.js.map +0 -1
@@ -0,0 +1,7 @@
1
+ export type DiscriminatedUnion<Discriminator extends keyof Union, Union extends {
2
+ [Key in Discriminator]: unknown;
3
+ }> = Union extends {
4
+ [Key in Discriminator]: infer Value;
5
+ } ? Value extends Union[Discriminator] ? Extract<Union, {
6
+ [Key in Discriminator]: Value;
7
+ }> : never : never;
@@ -1 +1,3 @@
1
1
  export type * from './deepPartial';
2
+ export type * from './keysOf';
3
+ export type * from './dicriminatedUnion';
@@ -0,0 +1,5 @@
1
+ type Primitive = string | number | boolean | null | undefined;
2
+ export type KeysOf<T> = T extends Primitive ? never : T extends any[] ? KeysOf<T[number]> : T extends object ? {
3
+ [K in keyof T]: K | KeysOf<T[K]>;
4
+ }[keyof T] : never;
5
+ export {};
@@ -1 +1,2 @@
1
1
  export { Button, type ButtonProps } from './Button';
2
+ export { buttonPrimitiveIntent, buttonPrimitiveTextFormat, buttonPrimitiveSize } from './model/helpers';
@@ -1,8 +1,25 @@
1
1
  import { ButtonConfig } from '../Button';
2
2
  export declare const setButtonLoaderIntent: (intent: ButtonConfig["intent"]) => "primary" | "secondary" | null | undefined;
3
+ export declare const buttonPrimitiveSize: {
4
+ readonly sm: "h-10";
5
+ readonly md: "h-12";
6
+ readonly lg: "h-14";
7
+ };
8
+ export declare const buttonPrimitiveTextFormat: {
9
+ readonly capitalize: "capitalize";
10
+ readonly uppercase: "uppercase";
11
+ readonly lowercase: "lowercase";
12
+ readonly initial: "initial";
13
+ };
14
+ export declare const buttonPrimitiveIntent: {
15
+ readonly primary: "bg-color-primary-default text-color-white outline-offset-[3px] hover:bg-color-primary-hover active:bg-color-primary-hover focus:bg-color-primary-default focus:outline-primary-focus disabled:bg-color-primary-disabled";
16
+ readonly secondary: "bg-transparent text-color-primary-default border border-solid border-primary-default hover:bg-color-primary-tr-hover active:bg-color-primary-tr-pressed active:border-primary-hover focus:outline-primary-focus focus:bg-color-primary-tr-focus disabled:bg-color-blue-grey-200 disabled:text-color-primary-disabled disabled:border-transparent";
17
+ readonly ghost: "bg-transparent text-color-primary-default hover:bg-color-primary-tr-hover hover:text-color-primary-hover focus:bg-color-primary-tr-focus focus:outline-primary-focus active:bg-color-primary-tr-pressed active:text-color-primary-hover disabled:text-color-primary-disabled disabled:bg-transparent";
18
+ readonly negative: "bg-color-secondary-default text-color-white outline-offset-[3px] hover:bg-color-secondary-hover disabled:bg-color-secondary-disabled active:bg-color-secondary-hover focus:bg-color-secondary-default focus:outline-primary-focus";
19
+ };
3
20
  export declare const buttonConfig: (props?: ({
4
21
  intent?: "primary" | "secondary" | "ghost" | "negative" | null | undefined;
5
- size?: "sm" | "md" | "lg" | null | undefined;
22
+ size?: "md" | "sm" | "lg" | null | undefined;
6
23
  textFormat?: "capitalize" | "uppercase" | "lowercase" | "initial" | null | undefined;
7
24
  isFull?: boolean | null | undefined;
8
25
  isLoading?: boolean | null | undefined;
@@ -6,7 +6,7 @@ type ButtonClasses = {
6
6
  };
7
7
  declare const buttonConfig: (props?: ({
8
8
  intent?: "primary" | "secondary" | "ghost" | null | undefined;
9
- size?: "sm" | "md" | "lg" | null | undefined;
9
+ size?: "md" | "sm" | "lg" | null | undefined;
10
10
  } & import('class-variance-authority/types').ClassProp) | undefined) => string;
11
11
  type ButtonProps = VariantProps<typeof buttonConfig>;
12
12
  export interface IButtonIconProps extends Omit<ComponentProps<'button'>, 'className'>, ButtonProps {
@@ -0,0 +1,29 @@
1
+ import { HTMLAttributes, ReactNode } from 'react';
2
+ import { EmblaOptionsType } from 'embla-carousel';
3
+ import { AutoplayOptionsType } from 'embla-carousel-autoplay';
4
+ import { DotsOptions, NavArrowOptions } from './model';
5
+ import { ArrowNavigationButtonClasses, CarouselContentClasses } from './ui';
6
+ import { ContainerWithNavigationClasses } from './ui/ContainerWithNavigation';
7
+ type CarouselClasses = {
8
+ root?: string;
9
+ header?: string;
10
+ heading?: string;
11
+ arrowsNavWrapper?: string;
12
+ arrowLeftClasses?: ArrowNavigationButtonClasses;
13
+ arrowRightClasses?: ArrowNavigationButtonClasses;
14
+ containerWithNavClasses?: ContainerWithNavigationClasses;
15
+ carouselContentClasses?: CarouselContentClasses;
16
+ };
17
+ export interface CarouselBaseProps extends HTMLAttributes<HTMLDivElement> {
18
+ children: ReactNode;
19
+ heading?: string;
20
+ carouselOptions?: EmblaOptionsType;
21
+ dotsOptions?: DotsOptions;
22
+ navArrowOptions?: NavArrowOptions;
23
+ autoPlayOptions?: AutoplayOptionsType;
24
+ setVisibleIndex: (index: number) => void;
25
+ visibleIndex: number;
26
+ classes?: CarouselClasses;
27
+ }
28
+ export declare const CarouselBase: ({ dotsOptions, navArrowOptions, carouselOptions, heading, autoPlayOptions, setVisibleIndex, visibleIndex, children, classes, ...props }: CarouselBaseProps) => import("react/jsx-runtime").JSX.Element;
29
+ export {};
@@ -0,0 +1,3 @@
1
+ export * from './CarouselBase';
2
+ export type * from './model/types';
3
+ export type * from './ui';
@@ -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,3 @@
1
+ export * from './useArrowNavigation';
2
+ export * from './useDotsNavigation';
3
+ export * from './useCarousel';
@@ -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,3 @@
1
+ export type * from './types';
2
+ export * from './hooks';
3
+ export * from './helpers';
@@ -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,16 @@
1
+ import { ReactNode } from 'react';
2
+ import { DotsOptions, UseDotsNavigationReturn } from '../model';
3
+ import { DotsNavigationsClasses } from './DotsNavigations';
4
+ export type CarouselContentClasses = {
5
+ dotsClasses?: DotsNavigationsClasses;
6
+ slidesOverlay?: string;
7
+ slidesWrapper?: string;
8
+ };
9
+ export interface CarouselContentProps {
10
+ classes?: CarouselContentClasses;
11
+ children: ReactNode;
12
+ dotsProps: UseDotsNavigationReturn;
13
+ dotsOptions: DotsOptions;
14
+ visibleIndex: number;
15
+ }
16
+ export declare const CarouselContent: import('react').ForwardRefExoticComponent<CarouselContentProps & import('react').RefAttributes<HTMLDivElement>>;
@@ -0,0 +1,10 @@
1
+ import { CarouselSlideVariant } from '../model';
2
+ import { DiscriminatedUnion } from '../../../types';
3
+ export type CarouselSlideClasses = {
4
+ root?: string;
5
+ slide?: string;
6
+ };
7
+ export type CarouselSlideProps = {
8
+ classes?: CarouselSlideClasses;
9
+ };
10
+ export declare const CarouselSlide: ({ classes, ...props }: DiscriminatedUnion<"variant", CarouselSlideVariant>) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,16 @@
1
+ import { ReactNode } from 'react';
2
+ import { NavigationMode } from '../model';
3
+ import { ArrowNavigationButtonClasses } from './ArrowNavigationButton';
4
+ export type ContainerWithNavigationClasses = {
5
+ wrapper?: string;
6
+ arrowLeftClasses?: ArrowNavigationButtonClasses;
7
+ arrowRightClasses?: ArrowNavigationButtonClasses;
8
+ };
9
+ export interface ContainerWithNavigationProps {
10
+ children: ReactNode;
11
+ prevBtnDisabled: boolean;
12
+ nextBtnDisabled: boolean;
13
+ onClickNavigationButton: (mode: NavigationMode) => void;
14
+ classes?: ContainerWithNavigationClasses;
15
+ }
16
+ export declare const ContainerWithNavigation: ({ children, prevBtnDisabled, nextBtnDisabled, onClickNavigationButton, classes }: ContainerWithNavigationProps) => import("react/jsx-runtime").JSX.Element;
@@ -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,5 @@
1
+ export * from './ArrowNavigationButton';
2
+ export * from './CarouselSlide';
3
+ export * from './DotsNavigations';
4
+ export * from './slideVariants';
5
+ export * from './CarouselContent';
@@ -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
+ imgProps?: ImageProps;
16
+ slideClasses?: SlideFullScreenClasses;
17
+ }
18
+ export declare const SlideFullScreen: ({ slideIndex, title, imgProps, description, slideClasses }: SlideFullScreenProps) => import("react/jsx-runtime").JSX.Element;
19
+ export {};
@@ -0,0 +1,11 @@
1
+ import { ImageProps } from '../../model';
2
+ type SlideOnlyImageClasses = {
3
+ root?: string;
4
+ image?: string;
5
+ };
6
+ export interface SlideOnlyImageProps {
7
+ imgProps?: ImageProps;
8
+ slideClasses?: SlideOnlyImageClasses;
9
+ }
10
+ export declare const SlideOnlyImage: ({ imgProps, slideClasses }: SlideOnlyImageProps) => import("react/jsx-runtime").JSX.Element;
11
+ 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 {};
@@ -0,0 +1,3 @@
1
+ export * from './SlideProductCard';
2
+ export * from './SlideOnlyImage';
3
+ export * from './SlideFullScreen';
@@ -2,7 +2,7 @@ export declare const customLinkConfig: (props?: ({
2
2
  intent?: "blue" | "white" | "dark" | null | undefined;
3
3
  withUnderline?: boolean | null | undefined;
4
4
  disabled?: boolean | null | undefined;
5
- size?: "sm" | "md" | null | undefined;
5
+ size?: "md" | "sm" | null | undefined;
6
6
  } & import('class-variance-authority/types').ClassProp) | undefined) => string;
7
7
  export declare const linkArrowConfig: (props?: ({
8
8
  intent?: "blue" | "white" | "dark" | null | undefined;
@@ -16,6 +16,7 @@ export * from './modal';
16
16
  export * from './notification';
17
17
  export * from './table';
18
18
  export * from './pagination';
19
+ export * from './carousel';
19
20
  export * from './providers';
20
21
  export * from './heading';
21
22
  export * from './icon';
@@ -3,5 +3,5 @@ export declare const wrapperConfig: (props?: ({
3
3
  } & import('class-variance-authority/types').ClassProp) | undefined) => string;
4
4
  export declare const loaderConfig: (props?: ({
5
5
  intent?: "primary" | "secondary" | null | undefined;
6
- size?: "sm" | "md" | "lg" | null | undefined;
6
+ size?: "md" | "sm" | "lg" | null | undefined;
7
7
  } & import('class-variance-authority/types').ClassProp) | undefined) => string;