UNPKG

2.08 kBTypeScriptView Raw
1import * as React from 'react';
2import { PickOptional } from '../../helpers/typeUtils';
3import { OUIAProps } from '../../helpers';
4export interface NavExpandableProps extends React.DetailedHTMLProps<React.LiHTMLAttributes<HTMLLIElement>, HTMLLIElement>, OUIAProps {
5 /** Title shown for the expandable list */
6 title: string;
7 /** If defined, screen readers will read this text instead of the list title */
8 srText?: string;
9 /** Boolean to programatically expand or collapse section */
10 isExpanded?: boolean;
11 /** Anything that can be rendered inside of the expandable list */
12 children?: React.ReactNode;
13 /** Additional classes added to the container */
14 className?: string;
15 /** Group identifier, will be returned with the onToggle and onSelect callback passed to the Nav component */
16 groupId?: string | number;
17 /** If true makes the expandable list title active */
18 isActive?: boolean;
19 /** Identifier to use for the section aria label */
20 id?: string;
21 /** allow consumer to optionally override this callback and manage expand state externally. if passed will not call Nav's onToggle. */
22 onExpand?: (e: React.MouseEvent<HTMLButtonElement, MouseEvent>, val: boolean) => void;
23 /** Additional props added to the NavExpandable <button> */
24 buttonProps?: any;
25}
26interface NavExpandableState {
27 expandedState: boolean;
28 ouiaStateId: string;
29}
30export declare class NavExpandable extends React.Component<NavExpandableProps, NavExpandableState> {
31 static displayName: string;
32 static defaultProps: PickOptional<NavExpandableProps>;
33 id: string;
34 state: {
35 expandedState: boolean;
36 ouiaStateId: string;
37 };
38 componentDidMount(): void;
39 componentDidUpdate(prevProps: NavExpandableProps): void;
40 onExpand: (e: React.MouseEvent<HTMLButtonElement, MouseEvent>, onToggle: (event: React.MouseEvent<HTMLButtonElement, MouseEvent>, groupId: string | number, expandedState: boolean) => void) => void;
41 render(): JSX.Element;
42}
43export {};
44//# sourceMappingURL=NavExpandable.d.ts.map
\No newline at end of file