import * as React from 'react'; import { BDSFunctional } from '../utils/typings/BDSComponentProps'; import type GalleryItem from './types/GalleryItem'; import type { GalleryThumbnailRef } from './GalleryThumbnail'; /** * GalleryContext */ declare const GalleryContext: React.Context; /** * GalleryConsumer */ declare const GalleryConsumer: React.Consumer; /** * Backyard React Gallery Provider * * Provides values to children and handles state management of the `Gallery`. * * Use this component to supply your own custom layout. * * Example: * ``` * * * * * * * * * * * * ``` */ declare const GalleryProvider: BDSFunctional; /** * Context values that can be passed to children via * * `const context = React.useContext(GalleryContext)` */ interface GalleryContextValues { /** * Current selected item number * Default: 0 */ item: GalleryProviderProps['item']; /** * Set the current selected item number */ setItem: React.Dispatch>; /** * List of `GalleryItem`s to be rendered/managed */ items: GalleryProviderProps['items']; /** * Whether or not the navigation buttons are disabled in the `GalleryViewport` */ disableNavigation: GalleryProviderProps['disableNavigation']; /** * The maximum number of thumbnails to be displayed * * Any thumbnails more than this are joined into an `excess` thumbnail */ maxThumbnails: GalleryProviderProps['maxThumbnails']; /** * `onClick` handler for the excess thumbnail */ onExcessClick?: GalleryProviderProps['onExcessClick']; /** * Shape of the gallery components */ shape: GalleryProviderProps['shape']; } interface GalleryProviderProps { /** * React Children to provide context to */ children: React.ReactNode; /** * Default item to be selected */ defaultItem?: number; /** * Whether or not the navigation buttons are disabled within the `GalleryViewport` */ disableNavigation?: boolean; /** * Current selected item */ item?: number; /** * List of `GalleryItem`s to be rendered */ items?: GalleryItem[]; /** * The maximum number of thumbnails to be displayed * * Any thumbnails more than this are joined into an `excess` thumbnail */ maxThumbnails?: number; /** * `onClick` handler for the excess thumbnail */ onExcessClick?: (event: React.MouseEvent) => void; /** * Shape of the gallery components */ shape?: 'rounded' | 'squared'; /** * Override props for `GalleryProvider` to either override current functionality * or provide new context to children. * * Useful if your custom `GalleryViewportItem` needs more external data */ override?: object; } export { GalleryProvider, GalleryContext, GalleryConsumer }; export type { GalleryContextValues, GalleryProviderProps }; export default GalleryProvider;