UNPKG

@ariakit/react-core

Version:

Ariakit React core

44 lines (29 loc) 2.02 kB
"use strict";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 _4EKRCHT6cjs = require('./4EKRCHT6.cjs'); var _76LCMKUIcjs = require('./76LCMKUI.cjs'); var _L5A2ID7Scjs = require('./L5A2ID7S.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 = _L5A2ID7Scjs.useId.call(void 0, props.id); return _7EQBAZ46cjs.__spreadValues.call(void 0, { id }, props); } function useCompositeStoreProps(store, update, props) { store = _4EKRCHT6cjs.useCollectionStoreProps.call(void 0, store, update, props); _76LCMKUIcjs.useStoreProps.call(void 0, store, props, "activeId", "setActiveId"); _76LCMKUIcjs.useStoreProps.call(void 0, store, props, "includesBaseElement"); _76LCMKUIcjs.useStoreProps.call(void 0, store, props, "virtualFocus"); _76LCMKUIcjs.useStoreProps.call(void 0, store, props, "orientation"); _76LCMKUIcjs.useStoreProps.call(void 0, store, props, "rtl"); _76LCMKUIcjs.useStoreProps.call(void 0, store, props, "focusLoop"); _76LCMKUIcjs.useStoreProps.call(void 0, store, props, "focusWrap"); _76LCMKUIcjs.useStoreProps.call(void 0, store, props, "focusShift"); return store; } function useCompositeStore(props = {}) { props = useCompositeStoreOptions(props); const [store, update] = _76LCMKUIcjs.useStore.call(void 0, Core.createCompositeStore, props); return useCompositeStoreProps(store, update, props); } exports.useCompositeStoreOptions = useCompositeStoreOptions; exports.useCompositeStoreProps = useCompositeStoreProps; exports.useCompositeStore = useCompositeStore;