UNPKG

lucid-ui

Version:

A UI component library from AppNexus.

132 lines (131 loc) 4.22 kB
import React from 'react'; import { StandardProps } from '../../util/component-types'; import * as reducers from './Submarine.reducers'; export interface ISubmarineState { isExpanded: boolean; height: number; } interface ISubmarinePrimaryProps extends StandardProps { } interface ISumbarineTitleProps extends StandardProps { } interface ISubmarineBarProps extends StandardProps { Title?: ISumbarineTitleProps | string; } interface ISubmarineProps extends StandardProps { /** Sets the starting height of the Bar. */ height: number; /** Force the Submarine to be expanded or collapsed. */ isExpanded: boolean; /** Indicates if the Submarine should be shown or not. This will override the value of isExpanded. */ isHidden: boolean; /** Indicates if the Title should be shown when the Submarine is collapsed */ isTitleShownCollapsed: boolean; /** Allows animated expand and collapse behavior. */ isAnimated: boolean; /** Render the Submarine to the top or bottom of primary content. */ position: 'top' | 'bottom'; /** Disable user resizing of the Submarine. */ isResizeDisabled: boolean; /** Set the title of the Submarine. */ Title?: React.ReactNode; /** Set the title of the Submarine. */ Primary?: React.ReactNode; /** Set the title of the Submarine. */ Bar?: React.ReactNode; /** Called when the user is currently resizing the Submarine. */ onResizing: (height: number, { event, props }: { event: MouseEvent | TouchEvent; props: ISubmarineProps; }) => void; /** Called when the user resizes the Submarine. */ onResize: (height: number, { event, props }: { event: MouseEvent | TouchEvent; props: ISubmarineProps; }) => void; /** Called when the user expands or collapses the Submarine. */ onToggle: ({ event, props, }: { event: React.MouseEvent<HTMLButtonElement>; props: ISubmarineProps; }) => void; initialState?: Object; } declare class Submarine extends React.Component<ISubmarineProps, ISubmarineState> { static displayName: string; static Bar: { (_props: ISubmarineBarProps): null; peek: { description: string; }; displayName: string; propName: string; propTypes: { Title: any; }; }; static Title: { (_props: ISumbarineTitleProps): null; peek: { description: string; }; displayName: string; propName: string; }; static Primary: { (_props: ISubmarinePrimaryProps): null; peek: { description: string; }; displayName: string; propName: string; }; static peek: { description: string; categories: string[]; madeFrom: string[]; }; static reducers: typeof reducers; static propTypes: { className: any; children: any; height: any; isExpanded: any; isHidden: any; isTitleShownCollapsed: any; isAnimated: any; position: any; isResizeDisabled: any; Title: any; Bar: any; Primary: any; onResizing: any; onResize: any; onToggle: any; }; static defaultProps: { isExpanded: boolean; isAnimated: boolean; height: number; position: "bottom"; isResizeDisabled: boolean; isHidden: boolean; isTitleShownCollapsed: boolean; onResizing: (...args: any[]) => void; onResize: (...args: any[]) => void; onToggle: (...args: any[]) => void; }; handleExpanderClick: ({ event, }: { event: React.MouseEvent<HTMLButtonElement>; }) => void; handleResizing: (height: number, { event }: { event: MouseEvent | TouchEvent; }) => void; handleResize: (height: number, { event }: { event: MouseEvent | TouchEvent; }) => void; render(): JSX.Element; } declare const _default: typeof Submarine & import("../../util/state-management").IHybridComponent<ISubmarineProps, ISubmarineState>; export default _default; export { Submarine as SubmarineDumb };