lucid-ui
Version:
A UI component library from Xandr.
132 lines • 4.6 kB
TypeScript
import React from 'react';
import PropTypes from 'prop-types';
import { StandardProps } from '../../util/component-types';
import * as reducers from './Expander.reducers';
/** Expander Label */
export interface IExpanderLabelProps extends StandardProps {
description?: string;
}
/** Additional Label */
export interface IExpanderAdditionalLabelProps extends StandardProps {
description?: string;
}
/** Expander */
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: {
/**
Expandable content.
*/
children: PropTypes.Requireable<PropTypes.ReactNodeLike>;
/**
Appended to the component-specific class names set on the root element.
*/
className: PropTypes.Requireable<string>;
/**
Indicates that the component is in the "expanded" state when true and in
the "unexpanded" state when false.
*/
isExpanded: PropTypes.Requireable<boolean>;
/**
Called when the user clicks on the component's header. Signature:
\`(isExpanded, { event, props }) => {}\`
*/
onToggle: PropTypes.Requireable<(...args: any[]) => any>;
/**
Passed through to the root element.
*/
style: PropTypes.Requireable<object>;
/**
Child element whose children represents content to be shown next to the
expander icon.
*/
Label: PropTypes.Requireable<any>;
/**
Child element whose children respresent content to be shown inside
Expander.Label and to the right of it
*/
AdditionalLabelContent: PropTypes.Requireable<PropTypes.ReactNodeLike>;
/**
Renders different variants of Expander. 'simple' is default.
'highlighted' is more prominant.
*/
kind: PropTypes.Requireable<string>;
};
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: {
/**
Used to identify the purpose of this switch to the user -- can be any
renderable content.
*/
children: PropTypes.Requireable<PropTypes.ReactNodeLike>;
};
};
static AdditionalLabelContent: {
(_props: IExpanderAdditionalLabelProps): null;
displayName: string;
peek: {
description: string;
};
propName: string;
propTypes: {
/**
Used to display additional information or/and actions next to expander label.
*/
children: PropTypes.Requireable<PropTypes.ReactNodeLike>;
};
};
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 };
//# sourceMappingURL=Expander.d.ts.map