lucid-ui
Version:
A UI component library from Xandr.
191 lines • 6.66 kB
TypeScript
import React from 'react';
import PropTypes from 'prop-types';
import { StandardProps } from '../../util/component-types';
import * as reducers from './Submarine.reducers';
export interface ISubmarineState {
isExpanded: boolean;
height: number;
}
/** Primary */
export interface ISubmarinePrimaryProps extends StandardProps {
}
/** Title */
export interface ISumbarineTitleProps extends StandardProps {
}
/** Bar */
export interface ISubmarineBarProps extends StandardProps {
Title?: ISumbarineTitleProps | string;
}
export 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 content and title of the Submarine Bar. */
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: {
/**
Set the title of the Submarine. (alias for \`Submarine.Title\`)
*/
Title: PropTypes.Requireable<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: {
/**
Appended to the component-specific class names set on the root element.
Value is run through the \`classnames\` library.
*/
className: PropTypes.Requireable<string>;
/**
Direct children must be types {Submarine.Primary, Submarine.Bar,
Submarine.Title}. All content is composed as children of these
respective elements.
*/
children: PropTypes.Requireable<PropTypes.ReactNodeLike>;
/**
Sets the starting height of the Bar.
*/
height: PropTypes.Requireable<string | number>;
/**
Force the Submarine to be expanded or collapsed.
*/
isExpanded: PropTypes.Requireable<boolean>;
/**
Indicates if the Submarine should be shown or not. This will override
the value of isExpanded.
*/
isHidden: PropTypes.Requireable<boolean>;
/**
Indicates if the Title should be shown when the Submarine is collapsed
*/
isTitleShownCollapsed: PropTypes.Requireable<boolean>;
/**
Allows animated expand and collapse behavior.
*/
isAnimated: PropTypes.Requireable<boolean>;
/**
Render the Submarine to the top or bottom of primary content.
*/
position: PropTypes.Requireable<string>;
/**
Disable user resizing of the Submarine.
*/
isResizeDisabled: PropTypes.Requireable<boolean>;
/**
Set the title of the Submarine.
*/
Title: PropTypes.Requireable<any>;
/**
Set the Submarine Bar content.
*/
Bar: PropTypes.Requireable<any>;
/**
Set the primary content of the Submarine.
*/
Primary: PropTypes.Requireable<any>;
/**
Called when the user is currently resizing the Submarine. Signature:
\`(height, { event, props }) => {}\`
*/
onResizing: PropTypes.Requireable<(...args: any[]) => any>;
/**
Called when the user resizes the Submarine. Signature:
\`(height, { event, props }) => {}\`
*/
onResize: PropTypes.Requireable<(...args: any[]) => any>;
/**
Called when the user expands or collapses the Submarine. Signature:
\`({ event, props }) => {}\`
*/
onToggle: PropTypes.Requireable<(...args: any[]) => 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 };
//# sourceMappingURL=Submarine.d.ts.map