lucid-ui
Version:
A UI component library from Xandr.
109 lines • 4.13 kB
TypeScript
import React from 'react';
import PropTypes from 'prop-types';
import { StandardProps } from '../../util/component-types';
import { IExpanderState } from '../Expander/Expander';
/** Header */
export interface IExpanderPanelHeaderProps extends StandardProps {
description?: string;
}
/** ExpanderPanel */
export interface IExpanderPanelProps extends StandardProps {
/** Indicates that the component is in the "expanded" state when true and in
the "unexpanded" state when false. */
isExpanded: boolean;
/** Indicates that the component is in the "disabled" state when true and in
the "enabled" state when false. */
isDisabled: boolean;
/** Controls the presence of padding on the inner content. */
hasPadding: boolean;
/** Optional. The callback that fires when the animation comes to a rest. */
onRest?: () => void;
/** Applies on onRest callback when rest state is closed. */
onRestAppliedOnCollapse?: boolean;
/** Called when the user clicks on the component's header. */
onToggle: (isExpanded: boolean, { event, props, }: {
event: React.MouseEvent;
props: IExpanderPanelProps;
}) => void;
/** prop alternative to Header child component passed through to the
underlying ExpanderPanel */
Header?: React.ReactNode;
}
declare class ExpanderPanel extends React.Component<IExpanderPanelProps, IExpanderState> {
static displayName: string;
static Header: {
(_props: IExpanderPanelHeaderProps): 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 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>;
/**
Indicates that the component is in the "disabled" state when true and in
the "enabled" state when false.
*/
isDisabled: PropTypes.Requireable<boolean>;
/**
Controls the presence of padding on the inner content.
*/
hasPadding: 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>;
/**
Optional. The callback that fires when the animation comes to a rest.
*/
onRest: PropTypes.Requireable<(...args: any[]) => any>;
onRestAppliedOnCollapse: PropTypes.Requireable<boolean>;
/**
prop alternative to Header child component passed through to the
underlying ExpanderPanel
*/
Header: PropTypes.Requireable<any>;
};
static peek: {
description: string;
categories: string[];
madeFrom: string[];
};
static defaultProps: {
isExpanded: boolean;
onToggle: (...args: any[]) => void;
hasPadding: boolean;
isDisabled: boolean;
};
handleToggle: (event: React.MouseEvent) => void;
render(): JSX.Element;
}
declare const _default: typeof ExpanderPanel & import("../../util/state-management").IHybridComponent<IExpanderPanelProps, IExpanderState>;
export default _default;
export { ExpanderPanel as ExpanderPanelDumb };
//# sourceMappingURL=ExpanderPanel.d.ts.map