@ariakit/react-core
Version:
Ariakit React core
33 lines (20 loc) • 1.06 kB
JavaScript
;Object.defineProperty(exports, "__esModule", {value: true});
var _T3QB4FR3cjs = require('./T3QB4FR3.cjs');
var _WBFXWJUHcjs = require('./WBFXWJUH.cjs');
var _MZ2HG624cjs = require('./MZ2HG624.cjs');
// src/focusable/focusable-container.tsx
var _jsxruntime = require('react/jsx-runtime');
var TagName = "div";
var useFocusableContainer = _WBFXWJUHcjs.createHook.call(void 0, function useFocusableContainer2({ autoFocusOnShow = true, ...props }) {
props = _MZ2HG624cjs.useWrapElement.call(void 0,
props,
(element) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _T3QB4FR3cjs.FocusableContext.Provider, { value: autoFocusOnShow, children: element }),
[autoFocusOnShow]
);
return props;
});
var FocusableContainer = _WBFXWJUHcjs.forwardRef.call(void 0, function FocusableContainer2(props) {
const htmlProps = useFocusableContainer(props);
return _WBFXWJUHcjs.createElement.call(void 0, TagName, htmlProps);
});
exports.useFocusableContainer = useFocusableContainer; exports.FocusableContainer = FocusableContainer;