'use strict';

var React = require('react');
var index_module = require('../../../../../@radix-ui_react-use-callback-ref@1.0.0_react@18.2.0/node_modules/@radix-ui/react-use-callback-ref/dist/index.module.cjs');

/**
 * Listens for when the escape key is down
 */ function $addc16e1bbe58fd0$export$3a72a57244d6e765(onEscapeKeyDownProp) {
    const onEscapeKeyDown = index_module.useCallbackRef(onEscapeKeyDownProp);
    React.useEffect(()=>{
        const handleKeyDown = (event)=>{
            if (event.key === 'Escape') onEscapeKeyDown(event);
        };
        document.addEventListener('keydown', handleKeyDown);
        return ()=>document.removeEventListener('keydown', handleKeyDown)
        ;
    }, [
        onEscapeKeyDown
    ]);
}

exports.useEscapeKeydown = $addc16e1bbe58fd0$export$3a72a57244d6e765;
//# sourceMappingURL=index.module.cjs.map
