@ariakit/core 0.1.4 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (90) hide show
  1. package/CHANGELOG.md +66 -0
  2. package/cjs/__chunks/{QYB6XH64.cjs → 27ZAGOYG.cjs} +17 -13
  3. package/cjs/__chunks/6455U47T.cjs +37 -0
  4. package/cjs/__chunks/{ZPOXPO2L.cjs → 6SPJEESB.cjs} +33 -21
  5. package/cjs/__chunks/CNODBYSG.cjs +58 -0
  6. package/cjs/__chunks/{2YFRPUZP.cjs → DBHIHK7C.cjs} +6 -6
  7. package/cjs/__chunks/{W5IHD6VG.cjs → EUJ6NNA6.cjs} +56 -43
  8. package/cjs/__chunks/{4DQ3OTE7.cjs → FXEBKN6G.cjs} +22 -17
  9. package/cjs/__chunks/{ZJEEK57E.cjs → HEFJPUYD.cjs} +2 -2
  10. package/cjs/__chunks/{QNEPGQLL.cjs → M6ZA7XUP.cjs} +6 -2
  11. package/cjs/__chunks/RD3S4VKY.cjs +60 -0
  12. package/cjs/__chunks/{OFNGELMA.cjs → ZNW4LSWU.cjs} +8 -6
  13. package/cjs/checkbox/checkbox-store.cjs +14 -10
  14. package/cjs/collection/collection-store.cjs +6 -5
  15. package/cjs/combobox/combobox-store.cjs +49 -48
  16. package/cjs/composite/composite-overflow-store.cjs +7 -6
  17. package/cjs/composite/composite-store.cjs +7 -6
  18. package/cjs/dialog/dialog-store.cjs +6 -5
  19. package/cjs/disclosure/disclosure-store.cjs +5 -4
  20. package/cjs/disclosure/disclosure-store.d.ts +8 -0
  21. package/cjs/form/form-store.cjs +38 -35
  22. package/cjs/hovercard/hovercard-store.cjs +8 -7
  23. package/cjs/hovercard/hovercard-store.d.ts +3 -2
  24. package/cjs/index.cjs +3 -1
  25. package/cjs/menu/menu-bar-store.cjs +17 -13
  26. package/cjs/menu/menu-store.cjs +41 -43
  27. package/cjs/popover/popover-store.cjs +7 -6
  28. package/cjs/popover/popover-store.d.ts +8 -89
  29. package/cjs/radio/radio-store.cjs +25 -24
  30. package/cjs/select/select-store.cjs +42 -42
  31. package/cjs/tab/tab-store.cjs +29 -28
  32. package/cjs/tab/tab-store.d.ts +9 -0
  33. package/cjs/toolbar/toolbar-store.cjs +17 -13
  34. package/cjs/tooltip/tooltip-store.cjs +31 -79
  35. package/cjs/tooltip/tooltip-store.d.ts +20 -15
  36. package/cjs/tsconfig.build.tsbuildinfo +1 -1
  37. package/cjs/utils/array.cjs +1 -0
  38. package/cjs/utils/dom.cjs +3 -2
  39. package/cjs/utils/events.cjs +14 -9
  40. package/cjs/utils/focus.cjs +24 -14
  41. package/cjs/utils/misc.cjs +3 -2
  42. package/cjs/utils/platform.cjs +4 -3
  43. package/cjs/utils/store.cjs +4 -3
  44. package/esm/__chunks/3BAGFTL5.js +58 -0
  45. package/esm/__chunks/4BKCJXBM.js +37 -0
  46. package/esm/__chunks/{NA5BK7DD.js → BOKMNDR7.js} +22 -10
  47. package/esm/__chunks/{WFGVC6LE.js → EWHSN7GO.js} +17 -12
  48. package/esm/__chunks/{4T5RHRE5.js → MNNKHNLW.js} +1 -1
  49. package/esm/__chunks/{UVCATTRC.js → N6JW4ITM.js} +7 -5
  50. package/esm/__chunks/{RMD7SNCC.js → NWU4GBZ6.js} +5 -1
  51. package/esm/__chunks/{X7MJ3FB5.js → R6VHFWTV.js} +49 -36
  52. package/esm/__chunks/{DXA3K2FY.js → TFBCK4JB.js} +1 -1
  53. package/esm/__chunks/Z5IDQSMV.js +60 -0
  54. package/esm/__chunks/{IOAGNCXX.js → ZV2GEGPL.js} +14 -10
  55. package/esm/checkbox/checkbox-store.js +11 -7
  56. package/esm/collection/collection-store.js +5 -4
  57. package/esm/combobox/combobox-store.js +34 -33
  58. package/esm/composite/composite-overflow-store.js +6 -5
  59. package/esm/composite/composite-store.js +6 -5
  60. package/esm/dialog/dialog-store.js +5 -4
  61. package/esm/disclosure/disclosure-store.d.ts +8 -0
  62. package/esm/disclosure/disclosure-store.js +4 -3
  63. package/esm/form/form-store.js +24 -21
  64. package/esm/hovercard/hovercard-store.d.ts +3 -2
  65. package/esm/hovercard/hovercard-store.js +7 -6
  66. package/esm/index.js +2 -0
  67. package/esm/menu/menu-bar-store.js +15 -11
  68. package/esm/menu/menu-store.js +31 -33
  69. package/esm/popover/popover-store.d.ts +8 -89
  70. package/esm/popover/popover-store.js +6 -5
  71. package/esm/radio/radio-store.js +22 -21
  72. package/esm/select/select-store.js +29 -29
  73. package/esm/tab/tab-store.d.ts +9 -0
  74. package/esm/tab/tab-store.js +23 -22
  75. package/esm/toolbar/toolbar-store.js +15 -11
  76. package/esm/tooltip/tooltip-store.d.ts +20 -15
  77. package/esm/tooltip/tooltip-store.js +32 -80
  78. package/esm/tsconfig.build.tsbuildinfo +1 -1
  79. package/esm/utils/array.js +1 -0
  80. package/esm/utils/dom.js +2 -1
  81. package/esm/utils/events.js +10 -5
  82. package/esm/utils/focus.js +14 -4
  83. package/esm/utils/misc.js +2 -1
  84. package/esm/utils/platform.js +3 -2
  85. package/esm/utils/store.js +3 -2
  86. package/package.json +1 -1
  87. package/cjs/__chunks/DQHU5K4Q.cjs +0 -57
  88. package/cjs/__chunks/HLVPXX7H.cjs +0 -1491
  89. package/esm/__chunks/6HMPWUDT.js +0 -57
  90. package/esm/__chunks/6PEWNRTN.js +0 -1491
@@ -1,9 +1,10 @@
1
1
  import {
2
2
  createCollectionStore
3
- } from "../__chunks/WFGVC6LE.js";
4
- import "../__chunks/NA5BK7DD.js";
5
- import "../__chunks/RMD7SNCC.js";
6
- import "../__chunks/UVCATTRC.js";
3
+ } from "../__chunks/EWHSN7GO.js";
4
+ import "../__chunks/BOKMNDR7.js";
5
+ import "../__chunks/NWU4GBZ6.js";
6
+ import "../__chunks/N6JW4ITM.js";
7
+ import "../__chunks/4BKCJXBM.js";
7
8
  export {
8
9
  createCollectionStore
9
10
  };
@@ -1,36 +1,44 @@
1
1
  import {
2
2
  createPopoverStore
3
- } from "../__chunks/6PEWNRTN.js";
4
- import "../__chunks/4T5RHRE5.js";
5
- import "../__chunks/IOAGNCXX.js";
3
+ } from "../__chunks/Z5IDQSMV.js";
4
+ import "../__chunks/MNNKHNLW.js";
5
+ import "../__chunks/ZV2GEGPL.js";
6
6
  import {
7
7
  createCompositeStore
8
- } from "../__chunks/X7MJ3FB5.js";
9
- import "../__chunks/WFGVC6LE.js";
8
+ } from "../__chunks/R6VHFWTV.js";
9
+ import "../__chunks/EWHSN7GO.js";
10
10
  import {
11
11
  createStore,
12
12
  mergeStore
13
- } from "../__chunks/NA5BK7DD.js";
13
+ } from "../__chunks/BOKMNDR7.js";
14
14
  import {
15
15
  defaultValue
16
- } from "../__chunks/RMD7SNCC.js";
16
+ } from "../__chunks/NWU4GBZ6.js";
17
17
  import {
18
18
  isSafari,
19
19
  isTouchDevice
20
- } from "../__chunks/DXA3K2FY.js";
21
- import "../__chunks/UVCATTRC.js";
20
+ } from "../__chunks/TFBCK4JB.js";
21
+ import "../__chunks/N6JW4ITM.js";
22
22
  import "../__chunks/5XEKIOCW.js";
23
+ import {
24
+ __objRest,
25
+ __spreadProps,
26
+ __spreadValues
27
+ } from "../__chunks/4BKCJXBM.js";
23
28
 
24
29
  // src/combobox/combobox-store.ts
25
30
  var isSafariOnMobile = isSafari() && isTouchDevice();
26
- function createComboboxStore({
27
- menu,
28
- select,
29
- ...props
30
- } = {}) {
31
+ function createComboboxStore(_a = {}) {
32
+ var _b = _a, {
33
+ menu,
34
+ select
35
+ } = _b, props = __objRest(_b, [
36
+ "menu",
37
+ "select"
38
+ ]);
31
39
  const store = mergeStore(
32
40
  props.store,
33
- menu?.omit(
41
+ menu == null ? void 0 : menu.omit(
34
42
  "baseElement",
35
43
  "arrowElement",
36
44
  "anchorElement",
@@ -38,7 +46,7 @@ function createComboboxStore({
38
46
  "popoverElement",
39
47
  "disclosureElement"
40
48
  ),
41
- select?.omit(
49
+ select == null ? void 0 : select.omit(
42
50
  "value",
43
51
  "items",
44
52
  "renderedItems",
@@ -57,8 +65,7 @@ function createComboboxStore({
57
65
  props.defaultActiveId,
58
66
  null
59
67
  );
60
- const composite = createCompositeStore({
61
- ...props,
68
+ const composite = createCompositeStore(__spreadProps(__spreadValues({}, props), {
62
69
  store,
63
70
  activeId,
64
71
  includesBaseElement: defaultValue(
@@ -75,28 +82,25 @@ function createComboboxStore({
75
82
  focusWrap: defaultValue(props.focusWrap, syncState.focusWrap, true),
76
83
  virtualFocus: defaultValue(
77
84
  props.virtualFocus,
78
- syncState?.virtualFocus,
85
+ syncState == null ? void 0 : syncState.virtualFocus,
79
86
  !isSafariOnMobile
80
87
  )
81
- });
82
- const popover = createPopoverStore({
83
- ...props,
88
+ }));
89
+ const popover = createPopoverStore(__spreadProps(__spreadValues({}, props), {
84
90
  store,
85
91
  placement: defaultValue(
86
92
  props.placement,
87
93
  syncState.placement,
88
94
  "bottom-start"
89
95
  )
90
- });
96
+ }));
91
97
  const initialValue = defaultValue(
92
98
  props.value,
93
99
  syncState.value,
94
100
  props.defaultValue,
95
101
  ""
96
102
  );
97
- const initialState = {
98
- ...composite.getState(),
99
- ...popover.getState(),
103
+ const initialState = __spreadProps(__spreadValues(__spreadValues({}, composite.getState()), popover.getState()), {
100
104
  value: initialValue,
101
105
  resetValueOnHide: defaultValue(
102
106
  props.resetValueOnHide,
@@ -104,7 +108,7 @@ function createComboboxStore({
104
108
  false
105
109
  ),
106
110
  activeValue: syncState.activeValue
107
- };
111
+ });
108
112
  const combobox = createStore(initialState, composite, popover, store);
109
113
  combobox.setup(
110
114
  () => combobox.sync(
@@ -146,17 +150,14 @@ function createComboboxStore({
146
150
  return;
147
151
  const { activeId: activeId2 } = combobox.getState();
148
152
  const activeItem = composite.item(activeId2);
149
- combobox.setState("activeValue", activeItem?.value);
153
+ combobox.setState("activeValue", activeItem == null ? void 0 : activeItem.value);
150
154
  },
151
155
  ["moves", "renderedItems"]
152
156
  )
153
157
  );
154
- return {
155
- ...popover,
156
- ...composite,
157
- ...combobox,
158
+ return __spreadProps(__spreadValues(__spreadValues(__spreadValues({}, popover), composite), combobox), {
158
159
  setValue: (value) => combobox.setState("value", value)
159
- };
160
+ });
160
161
  }
161
162
  export {
162
163
  createComboboxStore
@@ -1,10 +1,11 @@
1
1
  import {
2
2
  createPopoverStore
3
- } from "../__chunks/6PEWNRTN.js";
4
- import "../__chunks/4T5RHRE5.js";
5
- import "../__chunks/IOAGNCXX.js";
6
- import "../__chunks/NA5BK7DD.js";
7
- import "../__chunks/RMD7SNCC.js";
3
+ } from "../__chunks/Z5IDQSMV.js";
4
+ import "../__chunks/MNNKHNLW.js";
5
+ import "../__chunks/ZV2GEGPL.js";
6
+ import "../__chunks/BOKMNDR7.js";
7
+ import "../__chunks/NWU4GBZ6.js";
8
+ import "../__chunks/4BKCJXBM.js";
8
9
 
9
10
  // src/composite/composite-overflow-store.ts
10
11
  function createCompositeOverflowStore(props = {}) {
@@ -1,11 +1,12 @@
1
1
  import {
2
2
  createCompositeStore
3
- } from "../__chunks/X7MJ3FB5.js";
4
- import "../__chunks/WFGVC6LE.js";
5
- import "../__chunks/NA5BK7DD.js";
6
- import "../__chunks/RMD7SNCC.js";
7
- import "../__chunks/UVCATTRC.js";
3
+ } from "../__chunks/R6VHFWTV.js";
4
+ import "../__chunks/EWHSN7GO.js";
5
+ import "../__chunks/BOKMNDR7.js";
6
+ import "../__chunks/NWU4GBZ6.js";
7
+ import "../__chunks/N6JW4ITM.js";
8
8
  import "../__chunks/5XEKIOCW.js";
9
+ import "../__chunks/4BKCJXBM.js";
9
10
  export {
10
11
  createCompositeStore
11
12
  };
@@ -1,9 +1,10 @@
1
1
  import {
2
2
  createDialogStore
3
- } from "../__chunks/4T5RHRE5.js";
4
- import "../__chunks/IOAGNCXX.js";
5
- import "../__chunks/NA5BK7DD.js";
6
- import "../__chunks/RMD7SNCC.js";
3
+ } from "../__chunks/MNNKHNLW.js";
4
+ import "../__chunks/ZV2GEGPL.js";
5
+ import "../__chunks/BOKMNDR7.js";
6
+ import "../__chunks/NWU4GBZ6.js";
7
+ import "../__chunks/4BKCJXBM.js";
7
8
  export {
8
9
  createDialogStore
9
10
  };
@@ -7,6 +7,10 @@ export declare function createDisclosureStore(props?: DisclosureStoreProps): Dis
7
7
  export interface DisclosureStoreState {
8
8
  /**
9
9
  * The visibility state of the content.
10
+ *
11
+ * Live examples:
12
+ * - [Dialog with React
13
+ * Router](https://ariakit.org/examples/dialog-react-router)
10
14
  * @default false
11
15
  */
12
16
  open: boolean;
@@ -58,6 +62,8 @@ export interface DisclosureStoreFunctions {
58
62
  * Live examples:
59
63
  * - [Textarea with inline
60
64
  * Combobox](https://ariakit.org/examples/combobox-textarea)
65
+ * - [Dialog with React
66
+ * Router](https://ariakit.org/examples/dialog-react-router)
61
67
  * @example
62
68
  * store.setOpen(true);
63
69
  * store.setOpen((open) => !open);
@@ -77,6 +83,8 @@ export interface DisclosureStoreFunctions {
77
83
  * Live examples:
78
84
  * - [Textarea with inline
79
85
  * Combobox](https://ariakit.org/examples/combobox-textarea)
86
+ * - [Dialog with React
87
+ * Router](https://ariakit.org/examples/dialog-react-router)
80
88
  */
81
89
  hide: () => void;
82
90
  /**
@@ -1,8 +1,9 @@
1
1
  import {
2
2
  createDisclosureStore
3
- } from "../__chunks/IOAGNCXX.js";
4
- import "../__chunks/NA5BK7DD.js";
5
- import "../__chunks/RMD7SNCC.js";
3
+ } from "../__chunks/ZV2GEGPL.js";
4
+ import "../__chunks/BOKMNDR7.js";
5
+ import "../__chunks/NWU4GBZ6.js";
6
+ import "../__chunks/4BKCJXBM.js";
6
7
  export {
7
8
  createDisclosureStore
8
9
  };
@@ -1,16 +1,20 @@
1
1
  import {
2
2
  createCollectionStore
3
- } from "../__chunks/WFGVC6LE.js";
3
+ } from "../__chunks/EWHSN7GO.js";
4
4
  import {
5
5
  createStore
6
- } from "../__chunks/NA5BK7DD.js";
6
+ } from "../__chunks/BOKMNDR7.js";
7
7
  import {
8
8
  applyState,
9
9
  defaultValue,
10
10
  isInteger,
11
11
  isObject
12
- } from "../__chunks/RMD7SNCC.js";
13
- import "../__chunks/UVCATTRC.js";
12
+ } from "../__chunks/NWU4GBZ6.js";
13
+ import "../__chunks/N6JW4ITM.js";
14
+ import {
15
+ __spreadProps,
16
+ __spreadValues
17
+ } from "../__chunks/4BKCJXBM.js";
14
18
 
15
19
  // src/form/form-store.ts
16
20
  function nextFrame() {
@@ -25,12 +29,13 @@ function hasMessages(object) {
25
29
  });
26
30
  }
27
31
  function get(values, path, defaultValue2) {
32
+ var _a;
28
33
  const [key, ...rest] = Array.isArray(path) ? path : `${path}`.split(".");
29
34
  if (key == null || !values) {
30
35
  return defaultValue2;
31
36
  }
32
37
  if (!rest.length) {
33
- return values[key] ?? defaultValue2;
38
+ return (_a = values[key]) != null ? _a : defaultValue2;
34
39
  }
35
40
  return get(values[key], rest, defaultValue2);
36
41
  }
@@ -56,7 +61,7 @@ function set(values, path, value) {
56
61
  nextValues2[index] = result;
57
62
  return nextValues2;
58
63
  }
59
- return { ...values, [key]: result };
64
+ return __spreadProps(__spreadValues({}, values), { [key]: result });
60
65
  }
61
66
  function setAll(values, value) {
62
67
  const result = {};
@@ -101,37 +106,37 @@ function createNames() {
101
106
  return new Proxy(/* @__PURE__ */ Object.create(null), getNameHandler(cache));
102
107
  }
103
108
  function createFormStore(props = {}) {
104
- const syncState = props.store?.getState();
109
+ var _a;
110
+ const syncState = (_a = props.store) == null ? void 0 : _a.getState();
105
111
  const collection = createCollectionStore(props);
106
112
  const values = defaultValue(
107
113
  props.values,
108
- syncState?.values,
114
+ syncState == null ? void 0 : syncState.values,
109
115
  props.defaultValues,
110
116
  {}
111
117
  );
112
118
  const errors = defaultValue(
113
119
  props.errors,
114
- syncState?.errors,
120
+ syncState == null ? void 0 : syncState.errors,
115
121
  props.defaultErrors,
116
122
  {}
117
123
  );
118
124
  const touched = defaultValue(
119
125
  props.touched,
120
- syncState?.touched,
126
+ syncState == null ? void 0 : syncState.touched,
121
127
  props.defaultTouched,
122
128
  {}
123
129
  );
124
- const initialState = {
125
- ...collection.getState(),
130
+ const initialState = __spreadProps(__spreadValues({}, collection.getState()), {
126
131
  values,
127
132
  errors,
128
133
  touched,
129
- validating: defaultValue(syncState?.validating, false),
130
- submitting: defaultValue(syncState?.submitting, false),
131
- submitSucceed: defaultValue(syncState?.submitSucceed, 0),
132
- submitFailed: defaultValue(syncState?.submitFailed, 0),
134
+ validating: defaultValue(syncState == null ? void 0 : syncState.validating, false),
135
+ submitting: defaultValue(syncState == null ? void 0 : syncState.submitting, false),
136
+ submitSucceed: defaultValue(syncState == null ? void 0 : syncState.submitSucceed, 0),
137
+ submitFailed: defaultValue(syncState == null ? void 0 : syncState.submitFailed, 0),
133
138
  valid: !hasMessages(errors)
134
- };
139
+ });
135
140
  const form = createStore(initialState, collection, props.store);
136
141
  const validateCallbacks = /* @__PURE__ */ new Set();
137
142
  const submitCallbacks = /* @__PURE__ */ new Set();
@@ -148,9 +153,7 @@ function createFormStore(props = {}) {
148
153
  form.setState("validating", false);
149
154
  }
150
155
  };
151
- return {
152
- ...collection,
153
- ...form,
156
+ return __spreadProps(__spreadValues(__spreadValues({}, collection), form), {
154
157
  names: createNames(),
155
158
  setValues: (values2) => form.setState("values", values2),
156
159
  getValue: (name) => get(form.getState().values, name),
@@ -232,7 +235,7 @@ function createFormStore(props = {}) {
232
235
  form.setState("submitSucceed", 0);
233
236
  form.setState("submitFailed", 0);
234
237
  }
235
- };
238
+ });
236
239
  }
237
240
  export {
238
241
  createFormStore,
@@ -11,8 +11,9 @@ export interface HovercardStoreState extends PopoverStoreState {
11
11
  */
12
12
  placement: PopoverStoreState["placement"];
13
13
  /**
14
- * The amount of time in milliseconds to wait before showing or hiding the
15
- * popover.
14
+ * The amount of time in milliseconds to wait before showing and hiding the
15
+ * popover. To control the delay for showing and hiding separately, use
16
+ * `showTimeout` and `hideTimeout`.
16
17
  * @default 500
17
18
  */
18
19
  timeout: number;
@@ -1,11 +1,12 @@
1
1
  import {
2
2
  createHovercardStore
3
- } from "../__chunks/6HMPWUDT.js";
4
- import "../__chunks/6PEWNRTN.js";
5
- import "../__chunks/4T5RHRE5.js";
6
- import "../__chunks/IOAGNCXX.js";
7
- import "../__chunks/NA5BK7DD.js";
8
- import "../__chunks/RMD7SNCC.js";
3
+ } from "../__chunks/3BAGFTL5.js";
4
+ import "../__chunks/Z5IDQSMV.js";
5
+ import "../__chunks/MNNKHNLW.js";
6
+ import "../__chunks/ZV2GEGPL.js";
7
+ import "../__chunks/BOKMNDR7.js";
8
+ import "../__chunks/NWU4GBZ6.js";
9
+ import "../__chunks/4BKCJXBM.js";
9
10
  export {
10
11
  createHovercardStore
11
12
  };
package/esm/index.js CHANGED
@@ -1,3 +1,5 @@
1
+ import "./__chunks/4BKCJXBM.js";
2
+
1
3
  // src/index.ts
2
4
  var src_default = {};
3
5
  export {
@@ -1,26 +1,30 @@
1
1
  import {
2
2
  createCompositeStore
3
- } from "../__chunks/X7MJ3FB5.js";
4
- import "../__chunks/WFGVC6LE.js";
5
- import "../__chunks/NA5BK7DD.js";
3
+ } from "../__chunks/R6VHFWTV.js";
4
+ import "../__chunks/EWHSN7GO.js";
5
+ import "../__chunks/BOKMNDR7.js";
6
6
  import {
7
7
  defaultValue
8
- } from "../__chunks/RMD7SNCC.js";
9
- import "../__chunks/UVCATTRC.js";
8
+ } from "../__chunks/NWU4GBZ6.js";
9
+ import "../__chunks/N6JW4ITM.js";
10
10
  import "../__chunks/5XEKIOCW.js";
11
+ import {
12
+ __spreadProps,
13
+ __spreadValues
14
+ } from "../__chunks/4BKCJXBM.js";
11
15
 
12
16
  // src/menu/menu-bar-store.ts
13
17
  function createMenuBarStore(props = {}) {
14
- const syncState = props.store?.getState();
15
- return createCompositeStore({
16
- ...props,
18
+ var _a;
19
+ const syncState = (_a = props.store) == null ? void 0 : _a.getState();
20
+ return createCompositeStore(__spreadProps(__spreadValues({}, props), {
17
21
  orientation: defaultValue(
18
22
  props.orientation,
19
- syncState?.orientation,
23
+ syncState == null ? void 0 : syncState.orientation,
20
24
  "horizontal"
21
25
  ),
22
- focusLoop: defaultValue(props.focusLoop, syncState?.focusLoop, true)
23
- });
26
+ focusLoop: defaultValue(props.focusLoop, syncState == null ? void 0 : syncState.focusLoop, true)
27
+ }));
24
28
  }
25
29
  export {
26
30
  createMenuBarStore
@@ -1,33 +1,39 @@
1
1
  import {
2
2
  createHovercardStore
3
- } from "../__chunks/6HMPWUDT.js";
4
- import "../__chunks/6PEWNRTN.js";
5
- import "../__chunks/4T5RHRE5.js";
6
- import "../__chunks/IOAGNCXX.js";
3
+ } from "../__chunks/3BAGFTL5.js";
4
+ import "../__chunks/Z5IDQSMV.js";
5
+ import "../__chunks/MNNKHNLW.js";
6
+ import "../__chunks/ZV2GEGPL.js";
7
7
  import {
8
8
  createCompositeStore
9
- } from "../__chunks/X7MJ3FB5.js";
10
- import "../__chunks/WFGVC6LE.js";
9
+ } from "../__chunks/R6VHFWTV.js";
10
+ import "../__chunks/EWHSN7GO.js";
11
11
  import {
12
12
  createStore,
13
13
  mergeStore
14
- } from "../__chunks/NA5BK7DD.js";
14
+ } from "../__chunks/BOKMNDR7.js";
15
15
  import {
16
16
  applyState,
17
17
  defaultValue
18
- } from "../__chunks/RMD7SNCC.js";
19
- import "../__chunks/UVCATTRC.js";
18
+ } from "../__chunks/NWU4GBZ6.js";
19
+ import "../__chunks/N6JW4ITM.js";
20
20
  import "../__chunks/5XEKIOCW.js";
21
+ import {
22
+ __objRest,
23
+ __spreadProps,
24
+ __spreadValues
25
+ } from "../__chunks/4BKCJXBM.js";
21
26
 
22
27
  // src/menu/menu-store.ts
23
- function createMenuStore({
24
- combobox,
25
- ...props
26
- } = {}) {
28
+ function createMenuStore(_a = {}) {
29
+ var _b = _a, {
30
+ combobox
31
+ } = _b, props = __objRest(_b, [
32
+ "combobox"
33
+ ]);
27
34
  const store = mergeStore(
28
35
  props.store,
29
- combobox?.omit(
30
- "baseElement",
36
+ combobox == null ? void 0 : combobox.omit(
31
37
  "arrowElement",
32
38
  "anchorElement",
33
39
  "contentElement",
@@ -36,17 +42,15 @@ function createMenuStore({
36
42
  )
37
43
  );
38
44
  const syncState = store.getState();
39
- const composite = createCompositeStore({
40
- ...props,
45
+ const composite = createCompositeStore(__spreadProps(__spreadValues({}, props), {
41
46
  store,
42
47
  orientation: defaultValue(
43
48
  props.orientation,
44
49
  syncState.orientation,
45
50
  "vertical"
46
51
  )
47
- });
48
- const hovercard = createHovercardStore({
49
- ...props,
52
+ }));
53
+ const hovercard = createHovercardStore(__spreadProps(__spreadValues({}, props), {
50
54
  store,
51
55
  placement: defaultValue(
52
56
  props.placement,
@@ -54,10 +58,8 @@ function createMenuStore({
54
58
  "bottom-start"
55
59
  ),
56
60
  hideTimeout: defaultValue(props.hideTimeout, syncState.hideTimeout, 0)
57
- });
58
- const initialState = {
59
- ...composite.getState(),
60
- ...hovercard.getState(),
61
+ }));
62
+ const initialState = __spreadProps(__spreadValues(__spreadValues({}, composite.getState()), hovercard.getState()), {
61
63
  initialFocus: defaultValue(syncState.initialFocus, "container"),
62
64
  values: defaultValue(
63
65
  props.values,
@@ -65,7 +67,7 @@ function createMenuStore({
65
67
  props.defaultValues,
66
68
  {}
67
69
  )
68
- };
70
+ });
69
71
  const menu = createStore(initialState, composite, hovercard, store);
70
72
  menu.setup(
71
73
  () => menu.sync(
@@ -77,10 +79,7 @@ function createMenuStore({
77
79
  ["mounted"]
78
80
  )
79
81
  );
80
- return {
81
- ...composite,
82
- ...hovercard,
83
- ...menu,
82
+ return __spreadProps(__spreadValues(__spreadValues(__spreadValues({}, composite), hovercard), menu), {
84
83
  setInitialFocus: (value) => menu.setState("initialFocus", value),
85
84
  setValues: (values) => menu.setState("values", values),
86
85
  setValue: (name, value) => {
@@ -95,13 +94,12 @@ function createMenuStore({
95
94
  const nextValue = applyState(value, prevValue);
96
95
  if (nextValue === prevValue)
97
96
  return values;
98
- return {
99
- ...values,
97
+ return __spreadProps(__spreadValues({}, values), {
100
98
  [name]: nextValue !== void 0 && nextValue
101
- };
99
+ });
102
100
  });
103
101
  }
104
- };
102
+ });
105
103
  }
106
104
  export {
107
105
  createMenuStore