UNPKG

@amaui/ui-react

Version:
85 lines (84 loc) 4.03 kB
import React from 'react'; import { TMethod } from '@amaui/utils'; import AmauiSubscription from '@amaui/subscription'; import { ISurface } from '../Surface/Surface'; import { IElement, IValueBreakpoints, IElementReference, IPropsAny } from '../types'; export interface ICarouselValue { index?: number; x?: number; y?: number; } export type TCarouselItem = string | null | IElement | { element: IElement; }; export type TCarouseOnUpdate = (to: string | number, values: TCarouselItem[]) => any; export interface ICarousel extends Omit<ISurface, 'version'> { version?: 'regular' | 'transition' | Partial<Record<IValueBreakpoints, 'regular' | 'transition'>>; valueDefault?: ICarouselValue; value?: ICarouselValue; onChange?: (value: ICarouselValue) => any; id?: any; items?: Array<TCarouselItem>; orientation?: 'vertical' | 'horizontal' | Partial<Record<IValueBreakpoints, 'vertical' | 'horizontal'>>; itemSize?: 'auto' | Partial<Record<IValueBreakpoints, 'auto' | false>>; gap?: number | Partial<Record<IValueBreakpoints, number>>; move?: boolean | Partial<Record<IValueBreakpoints, boolean>>; moveValue?: number | Partial<Record<IValueBreakpoints, number>>; moveItems?: number | Partial<Record<IValueBreakpoints, number>>; moveBeyondEdge?: boolean | Partial<Record<IValueBreakpoints, boolean>>; free?: boolean | Partial<Record<IValueBreakpoints, boolean>>; swipe?: boolean | Partial<Record<IValueBreakpoints, boolean>>; background?: boolean | Partial<Record<IValueBreakpoints, boolean>>; index?: number; autoPlay?: boolean | Partial<Record<IValueBreakpoints, boolean>>; autoHeight?: boolean | Partial<Record<IValueBreakpoints, boolean>>; autoHeightDelay?: number; autoPlayInterval?: number; pauseOnHover?: boolean; round?: boolean | Partial<Record<IValueBreakpoints, boolean>>; arrows?: boolean | Partial<Record<IValueBreakpoints, boolean>>; mouseScroll?: boolean; momentum?: boolean | Partial<Record<IValueBreakpoints, boolean>>; previousSub?: AmauiSubscription; nextSub?: AmauiSubscription; updateSub?: AmauiSubscription; arrowsVisibility?: 'hover' | 'visible' | Partial<Record<IValueBreakpoints, 'hover' | 'visible'>>; arrowHideOnStartEnd?: boolean | Partial<Record<IValueBreakpoints, boolean>>; renderProgress?: (update: TCarouseOnUpdate) => IElement; renderArrowPrevious?: (update: () => any) => IElement; renderArrowNext?: (update: () => any) => IElement; progress?: boolean | Partial<Record<IValueBreakpoints, boolean>>; progressVisibility?: 'hover' | 'visible' | Partial<Record<IValueBreakpoints, 'hover' | 'visible'>>; start?: any; end?: any; noTransition?: boolean | Partial<Record<IValueBreakpoints, boolean>>; onUpdatePosition?: (value: ICarouselValue) => any; onInit?: TMethod; onUpdateItems?: TMethod; onBlur?: (event: React.FocusEvent<any>) => any; onFocus?: (event: React.FocusEvent<any>) => any; onMouseEnte?: (event: React.MouseEvent<any>) => any; onMouseLeave?: (event: React.MouseEvent<any>) => any; TransitionComponent?: IElementReference; ProgressTransitionComponent?: IElementReference; ArrowTransitionComponent?: IElementReference; ArrowPreviousTransitionComponent?: IElementReference; ArrowNextTransitionComponent?: IElementReference; IconButtonPrevious?: IElement; IconButtonNext?: IElement; IconPrevious?: IElementReference; IconNext?: IElementReference; ArrowProps?: IPropsAny; ArrowPreviousProps?: IPropsAny; ArrowNextProps?: IPropsAny; CarouselProps?: IPropsAny; TransitionsProps?: IPropsAny; TransitionComponentProps?: IPropsAny; ArrowTransitionComponentProps?: IPropsAny; ArrowPreviousTransitionComponentProps?: IPropsAny; ArrowNextTransitionComponentProps?: IPropsAny; ProgressTransitionComponentProps?: IPropsAny; ItemWrapperProps?: IPropsAny; } declare const Carousel: React.FC<ICarousel>; export default Carousel;