@retailmenot/anchor
Version:
A React UI Library by RetailMeNot
33 lines (32 loc) • 1.57 kB
TypeScript
import * as React from 'react';
import { SpaceProps } from '@xstyled/system';
export declare type CollapseVariants = 'comfortable' | 'compact' | 'none' | string;
interface CollapseProps extends React.HTMLAttributes<HTMLDivElement>, SpaceProps {
/**
* Whether the component starts off open or closed. Can also be used to programmatically open/close the
* component.
*/
isOpen?: boolean;
/** Text to show for the opened state of the component */
openedText?: string;
/** Text to show for the closed state of the component */
closedText?: string;
/** Icon to show for the opened state of the component */
openedIcon?: React.ReactElement;
/** Icon to show for the closed state of the component */
closedIcon?: React.ReactElement;
/** 2 possible variants, compact (doc site) and comfortable (RMN CBO), and also none to allow for styling */
variant?: CollapseVariants;
/** This prop is solely used by the CollapseGroup component to make Collapse components have accordion behavior */
onClick?: any;
/** This mostly exists for CollapseGroup in order to hide the bottom border of stacked Collapse children */
hasBottomBorder?: boolean;
/** This specifies whether the contents of a closed collapse are removed from the dom vs hidden */
removeInactive?: boolean;
children?: any;
className?: string;
}
export declare const DEFAULT_OPENED_TEXT = "Close";
export declare const DEFAULT_CLOSED_TEXT = "Open";
export declare const Collapse: React.FunctionComponent<CollapseProps>;
export {};