import React, { PureComponent, ReactNode } from 'react'; import { PickDefaultProps } from '../utils-typescript'; import PropTypes from 'prop-types'; export interface DropDownWrapperProps { /** * An optional `id` to attach to the wrapper. */ readonly id?: string; /** * An optional `className` to attach to the wrapper. */ readonly className?: string; /** * An optional style variant (default, darker) */ readonly style?: string; /** * An optional padding around the contents */ readonly padded?: boolean; /** * This prop controls the initial visual opened state of the `DropDown`. */ readonly isOpen?: boolean; /** * This callback gets called when the opened state toggles */ readonly onToggle?: (event: MouseEvent) => void; /** * The contents to be rendered, ideally `DropDown.Header` and `DropDown.Contents`. */ readonly children?: ReactNode; /** * An optional css theme to be injected. */ readonly theme?: DropDownWrapperTheme; } interface DropDownWrapperTheme { readonly 'dropDown': string; readonly 'dropDown--padded': string; readonly 'dropDown__btn': string; } export declare const defaultProps: PickDefaultProps; export interface DropDownWrapperState { readonly isOpen: boolean; } export interface StatelessDropDownWrapperWithoutClickOutsideBehaviorProps extends DropDownWrapperProps { onToggle: (event: MouseEvent) => void; onClose: (event?: MouseEvent) => void; } export interface ChildContext { toggleDropDown: (event: MouseEvent) => void; closeDropDown: (event: MouseEvent) => void; wrapperRef: React.RefObject; } export declare const StatelessDropDownWrapper: React.ComponentClass; export declare class DropDownWrapper extends PureComponent { static readonly defaultProps: Readonly>>; private updateIsOpenHandle; constructor(props: DropDownWrapperProps); componentWillUnmount(): void; render(): JSX.Element; private readonly updateIsOpen; private readonly handleToggle; private readonly handleClose; } export default DropDownWrapper; export interface ContextDropDownProps extends DropDownWrapperProps { isDropdownOpen?: boolean; wrapperRef?: React.RefObject; } export declare class ContextDropDownHeader extends PureComponent { static readonly contextTypes: { toggleDropDown: PropTypes.Validator<(...args: any[]) => any>; }; render(): JSX.Element; } export declare class ContextDropDownContents extends PureComponent { static readonly contextTypes: { closeDropDown: PropTypes.Validator<(...args: any[]) => any>; wrapperRef: PropTypes.Validator; }; render(): JSX.Element; }