import { type KeyboardEvent, type MouseEvent } from "react"; export interface IToolbarItemRoleInput { value?: string; isSelected?: boolean; isDisabled?: boolean; onClick?: (event: MouseEvent) => void; onKeyDown?: (event: KeyboardEvent) => void; } /** * True for the keys an enclosing dropdown wrapper reacts to: the activation keys plus the vertical * arrows that open and close its popup. */ export declare function isPopupKey(event: KeyboardEvent): boolean; export interface IToolbarItemRoleButtonProps { role?: "radio"; "aria-checked"?: boolean; "aria-pressed"?: boolean; "aria-disabled"?: true; "data-value"?: string; onClick: (event: MouseEvent) => void; onKeyDown: (event: KeyboardEvent) => void; } export interface IToolbarItemRoleResult { isChecked: boolean; isDisabled: boolean; buttonProps: IToolbarItemRoleButtonProps; } /** * Button attributes of a toolbar item. Inside a segmented control the item is a radio; elsewhere it * is a toggle button when `isSelected` is given. * * Disabled items use `aria-disabled` instead of `disabled` so they stay reachable with arrow keys. * No tabIndex is rendered: a toolbar or a group writes the roving tabindex into the DOM, and an item * rendered through a portal keeps the browser default. React only rewrites the attribute when the * prop changes, so leaving it out is what keeps the DOM writes in place. */ export declare function useToolbarItemRole({ value, isSelected, isDisabled: isDisabledProp, onClick, onKeyDown, }: IToolbarItemRoleInput): IToolbarItemRoleResult; //# sourceMappingURL=useToolbarItemRole.d.ts.map