import React from 'react'; import PropTypes from 'prop-types'; import { ComponentProps } from '../utils/types'; /** @public */ type ItemClickHandler = (event: React.MouseEvent, data: { action?: string; icon?: React.ReactNode; label?: React.ReactNode; value?: any; }) => void; interface ItemPropsBase { /** * Changes the style if isMain=true, passed from SplitButton. * @private */ appearance?: 'default' | 'secondary' | 'primary' | 'destructive' | 'destructiveSecondary'; /** * Becomes the label. */ children?: React.ReactNode; /** * Prevents user from clicking the button. */ disabled?: boolean; /** * A React ref which is set to the DOM element when the component mounts and null when it unmounts. */ elementRef?: React.Ref; /** * Applies an icon in front of the label. */ icon?: React.ReactNode; /** * Becomes the main button. If no `Item`s have this prop, the first `Item` is the main button. */ isMain?: boolean; /** * A callback for when an item is clicked. */ onClick?: ItemClickHandler; } type ItemProps = ComponentProps; /** * An item within a `SplitButton`. */ declare function Item({ appearance, disabled, elementRef, icon: iconProp, isMain, children, onClick, ...otherProps }: ItemProps): React.JSX.Element; declare namespace Item { var propTypes: { appearance: PropTypes.Requireable; children: PropTypes.Requireable; disabled: PropTypes.Requireable; elementRef: PropTypes.Requireable; icon: PropTypes.Requireable; isMain: PropTypes.Requireable; onClick: PropTypes.Requireable<(...args: any[]) => any>; }; } export default Item; export { ItemClickHandler };