import React from 'react'; import { DraggableProvidedDragHandleProps } from 'react-beautiful-dnd'; import { Props } from '../../../common'; import { ISectionProps } from '../../Popovers/DropdownMenu/subcomponents/Section'; declare type CardColors = 'neutral' | 'orange' | 'red' | 'grey' | 'indigo'; declare type ExpandContentButtonWidthType = 'shrink' | 'auto'; interface ICardBasicProps { /** the component that shows even in collapse mode */ mainContent: JSX.Element; /** the component that shows in expand mode only */ extraContent?: JSX.Element; /** If true, the card is in expand style */ isExpanded?: boolean; /** dropdown sections to show in the cards action button dropdown */ dropdownSections?: ISectionProps[]; /** callback when user toggle card */ onCardToggle?: () => void; /** The margins around the component */ margins?: Props.IMargins; /** The data-cy */ componentContext?: string; /** If the card should have a hover style */ isHoverable?: boolean; /** Background color of the card */ color?: CardColors; /** Setting to 'shrink' changes only toggle button area is clickable, 'auto' will keep both header and toggle buttons are clickable */ expandContentButtonWidth?: ExpandContentButtonWidthType; /** INTERNAL PROP - Used by DraggableCardList to power the drag handle */ dragHandleProps?: DraggableProvidedDragHandleProps; } interface ICardWithHrefProps extends ICardBasicProps { /** The url to navigate to when you click on the card header - not to be used with handleClick */ href: string; /** @deprecated Use `openInNewTab` instead. Where to open the href link */ target?: string; /** Open href in new tab */ openInNewTab?: boolean; } interface ICardWithHrefAndAnchorPropsProps extends ICardWithHrefProps { /** Props for the external anchor component */ anchorComponentProps: { [i: string]: any; }; } interface ICardWithHandleClickProps extends ICardBasicProps { /** A click handler that will be called when you click on the card header - not to be used with href */ handleClick: () => void; } declare type ICardProps = ICardBasicProps | ICardWithHrefProps | ICardWithHrefAndAnchorPropsProps | ICardWithHandleClickProps; interface ICardState { isActionButtonHover: boolean; isExpanded: boolean; } declare class Card extends React.PureComponent, ICardState> { static defaultProps: Partial; state: ICardState; render(): JSX.Element; private get anchorComponentProps(); private get href(); private get target(); private get openInNewTab(); private get handleClick(); private get forceShrinkExpandContentButton(); private get hasHrefOrHandleClick(); private get headerOnClick(); private handleCardToggle; private get isExpanded(); private get actionButtonDropdownMenu(); private actionButton; private toggleButton; private handleActionButtonClick; private handleActionButtonMouseOver; private handleActionButtonMouseOut; } export { Card, CardColors, ICardProps };