'use client'; import * as React from 'react'; import { useEventCallback } from '../utils'; var useTouchRipple = function useTouchRipple(props) { var disabled = props.disabled, disableFocusRipple = props.disableFocusRipple, disableRipple = props.disableRipple, disableTouchRipple = props.disableTouchRipple, focusVisible = props.focusVisible, rippleRef = props.rippleRef; React.useEffect(function () { if (focusVisible && !disableFocusRipple && !disableRipple) { var _rippleRef$current; (_rippleRef$current = rippleRef.current) == null || _rippleRef$current.pulsate(); } }, [rippleRef, focusVisible, disableFocusRipple, disableRipple]); function useRippleHandler(rippleAction) { var skipRippleAction = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : disableTouchRipple; return useEventCallback(function (event) { if (!skipRippleAction && rippleRef.current) { rippleRef.current[rippleAction](event); } return true; }); } var keydownRef = React.useRef(false); var handleKeyDown = useEventCallback(function (event) { if (!disableFocusRipple && !keydownRef.current && focusVisible && rippleRef.current && event.key === ' ') { keydownRef.current = true; rippleRef.current.stop(event, function () { var _rippleRef$current2; rippleRef == null || (_rippleRef$current2 = rippleRef.current) == null || _rippleRef$current2.start(event); }); } }); var handleKeyUp = useEventCallback(function (event) { // calling preventDefault in keyUp on a