import { JSX } from 'react'; import type { WithDeterministicIdProps } from '@instructure/ui-react-utils'; import type { ViewProps } from '@instructure/ui-view'; type ExpandableToggleProps = (props?: { onClick?: (event: React.KeyboardEvent | React.MouseEvent) => void; [key: string]: unknown; }) => { 'aria-controls': string; 'aria-expanded': boolean; onClick: (event: React.KeyboardEvent | React.MouseEvent) => void; [key: string]: unknown; }; type RenderProps = { expanded: boolean; /** * Props to be spread onto the trigger element */ getToggleProps: ExpandableToggleProps; /** * Props to be spread onto the details element */ getDetailsProps: () => { id: string; }; }; type RenderExpandable = (props: RenderProps) => JSX.Element; type ExpandableOwnProps = { /** * Whether the content is expanded or hidden. Makes the component controlled, so if provided, the `onToggle` handler has to be provided too. */ expanded?: boolean; /** * Whether the content is initially expanded or hidden (uncontrolled) */ defaultExpanded: boolean; /** * Function invoked when this component is expanded/collapsed */ onToggle?: (event: React.KeyboardEvent | React.MouseEvent, expanded: boolean) => void; /** * Must be a function that returns a JSX element. It receives and object which * contains whether its expanded and objects that need to be spread on the * trigger and details elements. */ children?: RenderExpandable; /** * Must be a function that returns a JSX element. It receives and object which * contains whether its expanded and objects that need to be spread on the * trigger and details elements. * Identical to children */ render?: RenderExpandable; }; type ExpandableState = { expanded: boolean; }; type PropKeys = keyof ExpandableOwnProps; type AllowedPropKeys = Readonly>; type ExpandableProps = ExpandableOwnProps & WithDeterministicIdProps; declare const allowedProps: AllowedPropKeys; export type { ExpandableProps, ExpandableState, RenderExpandable, ExpandableToggleProps }; export { allowedProps }; //# sourceMappingURL=props.d.ts.map