@ariakit/react-core
Version:
Ariakit React core
34 lines (31 loc) • 835 B
JavaScript
"use client";
import {
FocusableContext
} from "./SWN3JYXT.js";
import {
createElement,
createHook,
forwardRef
} from "./ILRXHV7V.js";
import {
useWrapElement
} from "./K2XTQB3X.js";
// src/focusable/focusable-container.tsx
import { jsx } from "react/jsx-runtime";
var TagName = "div";
var useFocusableContainer = createHook(function useFocusableContainer2({ autoFocusOnShow = true, ...props }) {
props = useWrapElement(
props,
(element) => /* @__PURE__ */ jsx(FocusableContext.Provider, { value: autoFocusOnShow, children: element }),
[autoFocusOnShow]
);
return props;
});
var FocusableContainer = forwardRef(function FocusableContainer2(props) {
const htmlProps = useFocusableContainer(props);
return createElement(TagName, htmlProps);
});
export {
useFocusableContainer,
FocusableContainer
};