/** @license MIT | @cube-dev/ui-kit v0.115.0 | Cube Dev Team */
import { useEffect, useState } from "react";
import { useFocus, useFocusVisible } from "react-aria";

//#region src/utils/react/interactions.ts
function useFocus$1({ isDisabled }, onlyVisible = false) {
	useEffect(() => {
		setIsFocused(false);
	}, [isDisabled]);
	let [isFocused, setIsFocused] = useState(false);
	let { isFocusVisible } = useFocusVisible({});
	let { focusProps } = useFocus({
		isDisabled,
		onFocusChange: setIsFocused
	});
	return {
		focusProps,
		isFocused: isFocused && (onlyVisible ? isFocusVisible : true)
	};
}

//#endregion
export { useFocus$1 as useFocus };
//# sourceMappingURL=interactions.js.map