import React from 'react'; import PropTypes from 'prop-types'; import { ComponentProps } from '../utils/types'; interface HeaderPropsBase { /** * Renders the card actions. * * This prop cannot be used with actionPrimary and actionsSecondary. */ actions?: () => React.ReactNode; /** * Adds a primary action to the header. * For best results, use an icon-only button style. */ actionPrimary?: React.ReactNode; /** * Adds a secondary actions dropdown menu to the header with an "Actions" label. Make this prop a `Menu`. * * The `actions` prop is preferred so that a custom and unambiguous label can be added. */ actionsSecondary?: React.ReactNode; /** * @deprecated This prop is deprecated and will be removed in the next major version. * * Make the title an anchor so it can be bookmarked with a fragment. */ anchor?: string; children?: React.ReactNode; /** * A React ref which is set to the DOM element when the component mounts and null when it unmounts. */ elementRef?: React.Ref; /** * The icon to show before the title. */ icon?: React.ReactNode; /** * Used as the subheading. */ subtitle?: React.ReactNode; /** * Used as the main heading. */ title?: React.ReactNode; /** * Do not wrap Title and Subtitle. Long titles will truncate with an ellipsis. */ truncateTitle?: boolean; } interface HeaderWithActions extends HeaderPropsBase { actionsSecondary?: React.ReactNode; actionPrimary?: React.ReactNode; actions?: never; } interface HeaderWithActionsRenderProp extends HeaderPropsBase { actions: () => React.ReactNode; actionPrimary?: never; actionsSecondary?: never; } type HeaderProps = ComponentProps; /** * A styled container for `Card` header content. */ declare function Header({ actions, actionPrimary, actionsSecondary, anchor, children, icon, subtitle, title, truncateTitle, ...otherProps }: HeaderProps): React.JSX.Element; declare namespace Header { var propTypes: { actionPrimary: PropTypes.Requireable; actionsSecondary: PropTypes.Requireable; anchor: PropTypes.Requireable; children: PropTypes.Requireable; elementRef: PropTypes.Requireable; icon: PropTypes.Requireable; subtitle: PropTypes.Requireable; title: PropTypes.Requireable; truncateTitle: PropTypes.Requireable; }; } export default Header;