UNPKG

lucid-ui

Version:

A UI component library from Xandr.

89 lines 3.84 kB
import React from 'react'; import PropTypes from 'prop-types'; import { Overwrite } from '../../util/component-types'; import { ISlidePanelProps, ISlidePanelSlideProps } from '../SlidePanel/SlidePanel'; export interface IInfiniteSlidePanelSlideProps extends ISlidePanelSlideProps { } export interface IInfiniteSlidePanelPropsRaw { /** The only allowed child is a render function which is passed the current slide's offset and returns the slide contents. Alternatively, you could pass one `<InfiniteSlidePanelSlide {...}>` element with the render function. The only reason do to the latter is to pass addiontal props to the slide element. */ children?: React.ReactNode | ((slideOffset: number) => React.ReactNode); /** The number of slides rendered at any given time. A good rule-of-thumb is that this should be at least 4 times the \`slidesToShow\` value. */ totalSlides: number; /** Animate slides transitions from changes in `offset`. */ isAnimated: boolean; /** Slides are rendered in a continuous loop, where the first slide repeats * after the last slide and vice-versa. DOM elements are re-ordered and * re-used. */ isLooped: boolean; /** Child components of SlidePanel */ Slide?: React.ReactNode; } declare type IInfiniteSlidePanelProps = Overwrite<ISlidePanelProps, IInfiniteSlidePanelPropsRaw>; export declare const InfiniteSlidePanel: { (props: IInfiniteSlidePanelProps): React.ReactElement; defaultProps: { offset: number; slidesToShow: number; onSwipe: (...args: any[]) => void; totalSlides: number; isAnimated: boolean; isLooped: boolean; }; Slide: { (_props: IInfiniteSlidePanelSlideProps): null; displayName: string; propName: string; peek: { description: string; }; }; _isPrivate: boolean; displayName: string; peek: { description: string; categories: string[]; madeFrom: string[]; }; propTypes: { /** Appended to the component-specific class names set on the root element. */ className: PropTypes.Requireable<string>; children: PropTypes.Requireable<string | number | boolean | {} | PropTypes.ReactElementLike | PropTypes.ReactNodeArray>; /** The only allowed child is a render function which is passed the current slide's offset and returns the slide contents: \`(slideOffset) => { //returns React.PropTypes.node }\` Alternatively, you could pass one \`<InfiniteSlidePanel.Slide {...}>\` element with the render function. The only reason do to the latter is to pass addiontal props to the slide element. */ /** The offset of the left-most rendered slide. */ offset: PropTypes.Requireable<number>; /** Max number of viewable slides to show simultaneously. */ slidesToShow: PropTypes.Requireable<number>; /** Called when a user's swipe would change the offset. Callback passes number of slides by the user (positive for forward swipes, negative for backwards swipes). Signature: \`(slidesSwiped, { event, props }) => {}\` */ onSwipe: PropTypes.Requireable<(...args: any[]) => any>; /** The number of slides rendered at any given time. A good rule-of-thumb is that this should be at least 4 times the \`slidesToShow\` value. */ totalSlides: PropTypes.Requireable<number>; /** Child components of SlidePanel */ Slide: PropTypes.Requireable<PropTypes.ReactNodeLike>; }; }; export default InfiniteSlidePanel; //# sourceMappingURL=InfiniteSlidePanel.d.ts.map