UNPKG

@ariakit/core

Version:
36 lines (33 loc) 957 B
"use client"; import { createCompositeStore } from "./2CHYBBFH.js"; import { createStore } from "./BCALMBPZ.js"; import { defaultValue } from "./PBFD2E7P.js"; import { __spreadProps, __spreadValues } from "./3YLGPPWQ.js"; // src/menubar/menubar-store.ts function createMenubarStore(props = {}) { var _a; const syncState = (_a = props.store) == null ? void 0 : _a.getState(); const composite = createCompositeStore(__spreadProps(__spreadValues({}, props), { orientation: defaultValue( props.orientation, syncState == null ? void 0 : syncState.orientation, "horizontal" ), focusLoop: defaultValue(props.focusLoop, syncState == null ? void 0 : syncState.focusLoop, true) })); const initialState = __spreadValues({}, composite.getState()); const menubar = createStore(initialState, composite, props.store); return __spreadValues(__spreadValues({}, composite), menubar); } export { createMenubarStore };