@ariakit/react-core
Version:
Ariakit React core
44 lines (29 loc) • 2.02 kB
JavaScript
;Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[key] = obj[key]; } } } newObj.default = obj; return newObj; } }
var _TZV62ZWDcjs = require('./TZV62ZWD.cjs');
var _25BPIGZHcjs = require('./25BPIGZH.cjs');
var _OZM4QA2Vcjs = require('./OZM4QA2V.cjs');
var _7EQBAZ46cjs = require('./7EQBAZ46.cjs');
// src/composite/composite-store.ts
var _compositestore = require('@ariakit/core/composite/composite-store'); var Core = _interopRequireWildcard(_compositestore);
function useCompositeStoreOptions(props) {
const id = _OZM4QA2Vcjs.useId.call(void 0, props.id);
return _7EQBAZ46cjs.__spreadValues.call(void 0, { id }, props);
}
function useCompositeStoreProps(store, update, props) {
store = _TZV62ZWDcjs.useCollectionStoreProps.call(void 0, store, update, props);
_25BPIGZHcjs.useStoreProps.call(void 0, store, props, "activeId", "setActiveId");
_25BPIGZHcjs.useStoreProps.call(void 0, store, props, "includesBaseElement");
_25BPIGZHcjs.useStoreProps.call(void 0, store, props, "virtualFocus");
_25BPIGZHcjs.useStoreProps.call(void 0, store, props, "orientation");
_25BPIGZHcjs.useStoreProps.call(void 0, store, props, "rtl");
_25BPIGZHcjs.useStoreProps.call(void 0, store, props, "focusLoop");
_25BPIGZHcjs.useStoreProps.call(void 0, store, props, "focusWrap");
_25BPIGZHcjs.useStoreProps.call(void 0, store, props, "focusShift");
return store;
}
function useCompositeStore(props = {}) {
props = useCompositeStoreOptions(props);
const [store, update] = _25BPIGZHcjs.useStore.call(void 0, Core.createCompositeStore, props);
return useCompositeStoreProps(store, update, props);
}
exports.useCompositeStoreOptions = useCompositeStoreOptions; exports.useCompositeStoreProps = useCompositeStoreProps; exports.useCompositeStore = useCompositeStore;