UNPKG

lucid-ui

Version:

A UI component library from AppNexus.

92 lines (91 loc) 2.85 kB
import React from 'react'; import { StandardProps } from '../../util/component-types'; import * as reducers from './Expander.reducers'; interface IExpanderLabelProps extends StandardProps { description?: string; } interface IExpanderAdditionalLabelProps extends StandardProps { description?: string; } export interface IExpanderProps extends StandardProps, React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement> { /** * Indicates that the component is in the "expanded" state when true and in * the "unexpanded" state when false. * */ isExpanded: boolean; /** * Called when the user clicks on the component's header. * */ onToggle: (isExpanded: boolean, { event, props }: { event: React.MouseEvent; props: IExpanderProps; }) => void; /** Passed through to the root element. */ style?: React.CSSProperties; /** Child element whose children represents content to be shown next to the * expander icon. * */ Label?: React.ReactNode; /** Child element whose children respresent content to be shown inside * Expander.Label and to the right of it * */ AdditionalLabelContent?: React.ReactNode; /** Renders different variants of Expander. 'simple' is default. * 'highlighted' is more prominant. * */ kind: 'simple' | 'highlighted'; } export interface IExpanderState { isExpanded: boolean; } declare class Expander extends React.Component<IExpanderProps, IExpanderState> { static displayName: string; static propTypes: { children: any; className: any; isExpanded: any; onToggle: any; style: any; Label: any; AdditionalLabelContent: any; kind: any; }; static defaultProps: { isExpanded: boolean; onToggle: (...args: any[]) => void; kind: "simple"; }; static reducers: typeof reducers; static Label: { (_props: IExpanderLabelProps): null; displayName: string; peek: { description: string; }; propName: string; propTypes: { children: any; }; }; static AdditionalLabelContent: { (_props: IExpanderAdditionalLabelProps): null; displayName: string; peek: { description: string; }; propName: string; propTypes: { children: any; }; }; static peek: { description: string; categories: string[]; madeFrom: string[]; }; handleToggle: (event: React.MouseEvent) => void; render(): React.ReactNode; } declare const _default: typeof Expander & import("../../util/state-management").IHybridComponent<IExpanderProps, IExpanderState>; export default _default; export { Expander as ExpanderDumb };