UNPKG

@ariakit/react-core

Version:

Ariakit React core

41 lines (28 loc) 1.93 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 _PXZUDDVScjs = require('./PXZUDDVS.cjs'); var _RDNUVX4Vcjs = require('./RDNUVX4V.cjs'); var _4KGS3DOWcjs = require('./4KGS3DOW.cjs'); // src/composite/composite-store.ts var _compositestore = require('@ariakit/core/composite/composite-store'); var Core = _interopRequireWildcard(_compositestore); function useCompositeStoreOptions(props) { const id = _4KGS3DOWcjs.useId.call(void 0, props.id); return { id, ...props }; } function useCompositeStoreProps(store, update, props) { store = _PXZUDDVScjs.useCollectionStoreProps.call(void 0, store, update, props); _RDNUVX4Vcjs.useStoreProps.call(void 0, store, props, "activeId", "setActiveId"); _RDNUVX4Vcjs.useStoreProps.call(void 0, store, props, "includesBaseElement"); _RDNUVX4Vcjs.useStoreProps.call(void 0, store, props, "virtualFocus"); _RDNUVX4Vcjs.useStoreProps.call(void 0, store, props, "orientation"); _RDNUVX4Vcjs.useStoreProps.call(void 0, store, props, "rtl"); _RDNUVX4Vcjs.useStoreProps.call(void 0, store, props, "focusLoop"); _RDNUVX4Vcjs.useStoreProps.call(void 0, store, props, "focusWrap"); _RDNUVX4Vcjs.useStoreProps.call(void 0, store, props, "focusShift"); return store; } function useCompositeStore(props = {}) { props = useCompositeStoreOptions(props); const [store, update] = _RDNUVX4Vcjs.useStore.call(void 0, Core.createCompositeStore, props); return useCompositeStoreProps(store, update, props); } exports.useCompositeStoreOptions = useCompositeStoreOptions; exports.useCompositeStoreProps = useCompositeStoreProps; exports.useCompositeStore = useCompositeStore;