import type React from "react"; import type { MenuItemProps, MenuProps } from "@mui/material"; import type { RequireKeysUnion } from "@monorail/types"; import type { ButtonProps } from "../Button.js"; import type { ButtonGroupProps } from "../ButtonGroup.js"; import type { SplitButtonClasses } from "./splitButtonClasses.js"; interface SplitButtonMenuItem extends Omit { startIcon?: JSX.Element; label: React.ReactNode; onClick: (event: React.MouseEvent) => void; } export interface SplitButtonProps extends Omit { variant?: Exclude; classes?: Partial; /** * Sets the SplitButton to select mode. When selecting a MenuItem, * the main button will change to the selected MenuItem, * and the MenuItem onClick handler will not be executed * @default false */ select?: boolean; /** * The MenuItems that will populate the SplitButton menu */ options: ReadonlyArray; /** * The components used for each slot inside the Popup. * @default {} */ slots?: { /** * The component used for the Menu. * @default Menu */ Menu?: React.JSXElementConstructor; /** * The component used for the MenuItems. * @default MenuItem */ MenuItem?: React.JSXElementConstructor; }; /** * The props used for each slot inside the Popup. * @default {} */ slotProps: { /** * Props applied to the Menu element. * @default {} */ menu?: Omit, "anchorEl" | "children" | "open">; /** * Props applied to the primary Button component * @default {} */ primaryButton?: Partial; /** * Props applied to the secondary (dropdown) Button component * @default {} */ secondaryButton: RequireKeysUnion, [ "aria-label", "aria-labelledby", "aria-hidden" ]>; }; } export {};