UNPKG

@engie-group/fluid-design-system-react

Version:

Fluid Design System React

45 lines (44 loc) 1.84 kB
import React from 'react'; import { NJPaginationArrowProps } from './NJPaginationArrow'; export declare const NJPaginationRoot: React.ForwardRefExoticComponent<PaginationBaseProps & { renderPageAs?: (props: NJPaginationPageRenderProps) => React.ReactElement<HTMLElement>; renderArrowAs?: (props: NJPaginationArrowRenderProps) => React.ReactElement<HTMLElement>; } & React.RefAttributes<HTMLElement>>; type NJPaginationArrowRenderProps = { arrowType: NJPaginationArrowProps['arrowType']; ['aria-label']: React.HTMLAttributes<HTMLButtonElement>['aria-label']; onClick: React.MouseEventHandler<HTMLButtonElement>; disabled: HTMLButtonElement['disabled']; }; type NJPaginationPageRenderProps = { index: number; current: boolean; ['aria-label']: React.HTMLAttributes<HTMLButtonElement>['aria-label']; onClick: React.MouseEventHandler<HTMLButtonElement>; }; export type NJPaginationRootProps = PaginationBaseProps & { renderPageAs?: (props: NJPaginationPageRenderProps) => React.ReactElement<HTMLElement>; renderArrowAs?: (props: NJPaginationArrowRenderProps) => React.ReactElement<HTMLElement>; }; export type PaginationBaseProps = { /** * Total number of pages */ count: number; /** * Current page */ currentItem?: number; /** * Text alternative for assistive technologies for previous button * @see https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-label */ ariaLabelPrevious: string; /** * Text alternative for assistive technologies for next button * @see https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-label */ ariaLabelNext: string; onChange?: (item: number, event: React.MouseEvent<HTMLAnchorElement | HTMLButtonElement>) => void; }; export {};