import { MenuProps } from '../../../../../../../../../src/components/Menu'; import { MenuChildrenType } from '../../../../../../../../../src/components/Menu/MenuTypes'; import { DetailedHTMLProps, HTMLAttributes } from 'react'; import { IconNamesType } from '../../../../../../../../../src/utils'; /** * SplitButtonProps * @prop {MenuChildrenType} children - The menu items to display in the dropdown. * @prop {string} [className] - The class name to add to the component. * @prop {"sm" | "md"} [height] - The height of the SplitButton. * @prop {MenuProps} [menuProps] - The props to pass to the Menu component. * @prop {ButtonProps} buttonProps - The props to pass to the Button component. */ type AtLeastOneProps = { text: string; ariaLabel?: string; icon?: IconNamesType; } | { text?: string; ariaLabel: string; icon: IconNamesType; }; type SplitButtonButtonProps = { variant?: "primary" | "secondary"; onClick?: () => void; } & AtLeastOneProps; type SplitButtonMenuProps = Omit & { ariaLabel?: string; }; /** * Props for SplitButton component * @param {SplitButtonButtonProps} buttonProps - The props to pass to the Button component. * @param {SplitButtonMenuProps} menuProps - The props to pass to the Menu component. * @param {MenuChildrenType} children - The menu items to display in the dropdown. * @param {string} [className] - The class name to add to the component. * @param {"sm" | "md"} [height] - The height of the SplitButton. * @param {boolean} [createFirstMenuItem] - Whether to create a default menu item that behaves like the button if button text and onClick are defined. */ export interface SplitButtonProps extends DetailedHTMLProps, HTMLDivElement> { buttonProps?: SplitButtonButtonProps; menuProps?: SplitButtonMenuProps; children: MenuChildrenType; height?: "sm" | "md"; createFirstMenuItem?: boolean; } /** * SplitButton is a button that has a dropdown menu attached to it. * It is used to provide a primary action and secondary actions in a single component. * The primary action is a button that can have an icon and text. * The secondary actions are menu items that are displayed in a dropdown menu. The first menu item * should be created to behave like the primary button. If the button text and onClick are defined, * and @param createFirstMenuItem is true, a menu item will be created that behaves like the button. * Set @param createFirstMenuItem to false to manually generate this menu item to comply with this requirement. * * @param {SplitButtonProps} props * @example * console.log("Primary Button Clicked"), * icon: "settings", * }} * > * console.log("Menu Item 1 Clicked")}>Menu Item 1 * console.log("Menu Item 2 Clicked")}>Menu Item 2 * */ export declare const SplitButton: { ({ buttonProps: { variant, text: buttonText, ariaLabel: buttonAriaLabel, onClick, icon, }, height, createFirstMenuItem, className, menuProps: { ariaLabel: menuButtonAriaLabel, ...restMenu }, children, ...rest }: SplitButtonProps): import("react/jsx-runtime").JSX.Element; displayName: string; }; export {};