import { HTMLAttributes, ReactNode } from 'react'; import { DropdownMenuProps } from '@radix-ui/react-dropdown-menu'; import { HorizontalDirection } from '../../types'; import { IconName } from '../Icon'; export type ButtonType = 'primary' | 'secondary'; type MenuItem = { icon?: IconName; iconDir?: HorizontalDirection; label: ReactNode; type?: 'item'; items?: never; } & Omit, 'onSelect'>; type MenuGroup = { icon?: never; iconDir?: never; label?: never; type: 'group'; items: Array; }; type SubMenu = Omit & { items: Array; type: 'sub-menu'; }; export type Menu = SubMenu | MenuGroup | MenuItem; export interface SplitButtonProps extends DropdownMenuProps, Omit, 'dir' | 'style'> { /** The visual style variant of the button */ type?: ButtonType; /** Used for native button type attribute on the primary action button */ htmlType?: React.ButtonHTMLAttributes['type']; disabled?: boolean; fillWidth?: boolean; menu: Array; side?: 'top' | 'bottom'; icon?: IconName; iconDir?: HorizontalDirection; } export {};