import type { MouseEvent, KeyboardEvent } from 'react'; /** * A React hook to make any HTML element behave like an accessible button, * allowing it to be activated by both mouse clicks and keyboard (Enter/Spacebar). * * This hook is particularly useful when you need to use a non-button element (like a div or span) * but still want it to be fully accessible to screen readers and keyboard users, * adhering to WCAG guidelines. * * @param onPress The function to call when the element is clicked or activated by keyboard. * @returns An object containing props (onClick, onKeyDown, role, tabIndex) * to be spread onto the target HTML element. * * @example * // Example for a div acting as a button * const handleDivAction = () => console.log('Div button activated!'); * const divButtonProps = useAccessibleClick(handleDivAction); *
Click Me
*/ export declare const useButtonPattern: (onPress: (e: MouseEvent | KeyboardEvent) => void) => { onClick: (e: MouseEvent | KeyboardEvent) => void; onKeyDown: (event: KeyboardEvent) => void; role: string; tabIndex: number; }; //# sourceMappingURL=useButtonPattern.d.ts.map