UNPKG

@utrecht/component-library-react

Version:

React component library bundle for the Municipality of Utrecht based on the NL Design System architecture

50 lines 2.15 kB
import { ForwardedRef, HTMLAttributes, ReactNode, RefObject } from 'react'; export interface AccordionSectionProps extends HTMLAttributes<HTMLDivElement> { headingLevel?: number; label: string; body: any; expanded?: boolean; disabled?: boolean; section?: boolean; onActivate?: Function; onButtonFocus?: Function; onButtonBlur?: Function; buttonRef?: RefObject<HTMLButtonElement>; icon?: ReactNode; } export declare const AccordionSection: import("react").ForwardRefExoticComponent<AccordionSectionProps & import("react").RefAttributes<HTMLDivElement>>; export interface AccordionProps extends HTMLAttributes<HTMLDivElement> { headingLevel?: number; heading?: string; group?: false; } export declare const Accordion: import("react").ForwardRefExoticComponent<AccordionProps & { children?: ReactNode | undefined; } & import("react").RefAttributes<HTMLDivElement>>; export declare const useAccordion: <T>(sections: T[], ref: RefObject<HTMLDivElement | undefined>) => { ref: RefObject<HTMLDivElement | undefined>; refs: RefObject<HTMLDivElement>[]; buttonRefs: RefObject<HTMLButtonElement>[]; activeElement: null; sections: T[]; focusNextSection: (activeElement: RefObject<HTMLDivElement>) => void; focusFirstSection: () => void; focusPreviousSection: (activeElement: RefObject<HTMLDivElement>) => void; focusLastSection: () => void; }; export interface AccordionSectionProviderProps { defaultExpanded?: boolean; expanded?: boolean; } export declare const useAccordionSection: ({ defaultExpanded, expanded }: AccordionSectionProviderProps, ref: ForwardedRef<HTMLDivElement>) => { ref: ForwardedRef<HTMLDivElement>; expanded: boolean; }; export interface AccordionProviderProps extends Pick<AccordionProps, 'heading' | 'headingLevel'>, Pick<AccordionSectionProps, 'icon'> { sections: AccordionSectionProps[]; } export declare const AccordionProvider: { ({ sections, icon, heading, headingLevel }: AccordionProviderProps): import("react/jsx-runtime").JSX.Element; displayName: string; }; //# sourceMappingURL=Accordion.d.ts.map