| 1 |
import { Component } from 'react'; |
| 2 |
import { PickOptional } from '../../helpers/typeUtils'; |
| 3 |
import { OUIAProps } from '../../helpers'; |
| 4 |
export interface NavExpandableProps extends Omit<React.DetailedHTMLProps<React.LiHTMLAttributes<HTMLLIElement>, HTMLLIElement>, 'title'>, OUIAProps { |
| 5 |
/** Title content shown for the expandable list */ |
| 6 |
title: React.ReactNode; |
| 7 |
/** If defined, screen readers will read this text instead of the list title */ |
| 8 |
srText?: string; |
| 9 |
/** Boolean to pragmatically 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?: (event: React.MouseEvent<HTMLButtonElement, MouseEvent>, val: boolean) => void; |
| 23 |
/** Additional props added to the NavExpandable <button> */ |
| 24 |
buttonProps?: any; |
| 25 |
/** Icon added before the nav item children. */ |
| 26 |
icon?: React.ReactNode; |
| 27 |
/** Value to overwrite the randomly generated data-ouia-component-id.*/ |
| 28 |
ouiaId?: number | string; |
| 29 |
} |
| 30 |
interface NavExpandableState { |
| 31 |
expandedState: boolean; |
| 32 |
} |
| 33 |
declare class NavExpandable extends Component<NavExpandableProps, NavExpandableState> { |
| 34 |
static displayName: string; |
| 35 |
static defaultProps: PickOptional<NavExpandableProps>; |
| 36 |
state: { |
| 37 |
expandedState: boolean; |
| 38 |
}; |
| 39 |
componentDidMount(): void; |
| 40 |
componentDidUpdate(prevProps: NavExpandableProps): void; |
| 41 |
onExpand: (event: React.MouseEvent<HTMLButtonElement, MouseEvent>, onToggle: (event: React.MouseEvent<HTMLButtonElement, MouseEvent>, groupId: string | number, expandedState: boolean) => void) => void; |
| 42 |
render(): import("react/jsx-runtime").JSX.Element; |
| 43 |
} |
| 44 |
export { NavExpandable }; |
| 45 |
//# sourceMappingURL=NavExpandable.d.ts.map |