UNPKG

koval-ui

Version:

React components collection with minimalistic design. Supports theming, layout, and input validation.

24 lines (23 loc) 464 B
"use client"; import { useCallback as s } from "react"; import { useEventListener as r, EventType as u } from "./useEventListener.js"; const y = (e, n, o) => { const i = s( (t) => { o && t.key === "Escape" && e(); }, [e, o] ); r(u.keydown, i); const m = s( (t) => { o && !n.current.contains(t.target) && e(); }, [e, o, n] ); r(u.mousedown, m); }; export { y as useDismiss }; //# sourceMappingURL=useDismiss.js.map