@ariakit/core 0.4.9 → 0.4.11

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 (72) hide show
  1. package/CHANGELOG.md +30 -0
  2. package/cjs/__chunks/{3IVNQNIV.cjs → 7EQBAZ46.cjs} +1 -2
  3. package/cjs/__chunks/{3QF3ODTR.cjs → BSLRW6E7.cjs} +15 -16
  4. package/cjs/__chunks/{H6ZQSQQL.cjs → C5P5S22J.cjs} +17 -18
  5. package/cjs/__chunks/{QLWAGBAQ.cjs → G2MFLTB2.cjs} +19 -20
  6. package/cjs/__chunks/{CCI5VM7E.cjs → G2NIRMCL.cjs} +19 -20
  7. package/cjs/__chunks/{ULSPM3Y3.cjs → GDZQUFNP.cjs} +1 -3
  8. package/cjs/__chunks/{N667HVED.cjs → I2G6EN27.cjs} +3 -4
  9. package/cjs/__chunks/LLZO7SOB.cjs +34 -0
  10. package/cjs/__chunks/LSC6QXJ7.cjs +41 -0
  11. package/cjs/__chunks/{BTUHABP4.cjs → MLCPLY2P.cjs} +3 -4
  12. package/cjs/__chunks/{7CES7GVE.cjs → SHOLYDNP.cjs} +1 -3
  13. package/cjs/__chunks/{KCEXELK7.cjs → TEPPO3KC.cjs} +7 -8
  14. package/cjs/__chunks/{PW36G76L.cjs → W3GMUKTU.cjs} +76 -99
  15. package/cjs/__chunks/{7WYII4AN.cjs → WCFMOJKV.cjs} +8 -7
  16. package/cjs/checkbox/checkbox-store.cjs +8 -9
  17. package/cjs/collection/collection-store.cjs +7 -8
  18. package/cjs/combobox/combobox-store.cjs +47 -48
  19. package/cjs/composite/composite-overflow-store.cjs +8 -9
  20. package/cjs/composite/composite-store.cjs +9 -10
  21. package/cjs/composite/composite-store.d.cts +30 -12
  22. package/cjs/composite/composite-store.d.ts +30 -12
  23. package/cjs/dialog/dialog-store.cjs +7 -8
  24. package/cjs/disclosure/disclosure-store.cjs +6 -7
  25. package/cjs/form/form-store.cjs +29 -30
  26. package/cjs/form/types.cjs +1 -1
  27. package/cjs/hovercard/hovercard-store.cjs +9 -10
  28. package/cjs/index.cjs +1 -2
  29. package/cjs/menu/menu-bar-store.cjs +10 -11
  30. package/cjs/menu/menu-store.cjs +34 -35
  31. package/cjs/menubar/menubar-store.cjs +10 -11
  32. package/cjs/popover/popover-store.cjs +8 -9
  33. package/cjs/radio/radio-store.cjs +15 -16
  34. package/cjs/select/select-store.cjs +39 -40
  35. package/cjs/tab/tab-store.cjs +45 -40
  36. package/cjs/tag/tag-store.cjs +21 -22
  37. package/cjs/toolbar/toolbar-store.cjs +11 -12
  38. package/cjs/tooltip/tooltip-store.cjs +16 -17
  39. package/cjs/utils/array.cjs +4 -5
  40. package/cjs/utils/dom.cjs +4 -5
  41. package/cjs/utils/events.cjs +9 -10
  42. package/cjs/utils/focus.cjs +13 -14
  43. package/cjs/utils/misc.cjs +4 -5
  44. package/cjs/utils/platform.cjs +5 -6
  45. package/cjs/utils/store.cjs +5 -6
  46. package/cjs/utils/types.cjs +1 -1
  47. package/cjs/utils/undo.cjs +4 -5
  48. package/esm/__chunks/{US4USQPI.js → 3VBK76MS.js} +1 -1
  49. package/esm/__chunks/{6DHTHWXD.js → 7DTP4AQO.js} +1 -1
  50. package/esm/__chunks/{D7EIQZAU.js → 7IJEP35G.js} +53 -75
  51. package/esm/__chunks/{HWOIWM4O.js → PQP5VPTV.js} +7 -4
  52. package/esm/__chunks/{PIWLWQMB.js → YKFX5MNB.js} +1 -1
  53. package/esm/collection/collection-store.js +2 -2
  54. package/esm/combobox/combobox-store.js +6 -6
  55. package/esm/composite/composite-store.d.ts +30 -12
  56. package/esm/composite/composite-store.js +3 -3
  57. package/esm/form/form-store.js +2 -2
  58. package/esm/menu/menu-bar-store.js +4 -4
  59. package/esm/menu/menu-store.js +3 -3
  60. package/esm/menubar/menubar-store.js +4 -4
  61. package/esm/radio/radio-store.js +3 -3
  62. package/esm/select/select-store.js +3 -3
  63. package/esm/tab/tab-store.js +11 -5
  64. package/esm/tag/tag-store.js +3 -3
  65. package/esm/toolbar/toolbar-store.js +3 -3
  66. package/esm/utils/dom.js +1 -1
  67. package/esm/utils/events.js +2 -2
  68. package/esm/utils/focus.js +1 -1
  69. package/esm/utils/platform.js +2 -2
  70. package/package.json +1 -1
  71. package/cjs/__chunks/VJAE2Y4T.cjs +0 -35
  72. package/cjs/__chunks/XIZWLBI2.cjs +0 -42
@@ -2,6 +2,12 @@ import type { CollectionStoreFunctions, CollectionStoreItem, CollectionStoreOpti
2
2
  import type { Store, StoreOptions, StoreProps } from "../utils/store.ts";
3
3
  import type { SetState } from "../utils/types.ts";
4
4
  type Orientation = "horizontal" | "vertical" | "both";
5
+ interface NextOptions extends Pick<Partial<CompositeStoreState>, "activeId" | "focusShift" | "focusLoop" | "focusWrap" | "includesBaseElement" | "renderedItems" | "rtl"> {
6
+ /**
7
+ * The number of items to skip.
8
+ */
9
+ skip?: number;
10
+ }
5
11
  /**
6
12
  * Creates a composite store.
7
13
  */
@@ -229,39 +235,51 @@ export interface CompositeStoreFunctions<T extends CompositeStoreItem = Composit
229
235
  /**
230
236
  * Returns the id of the next enabled item based on the current
231
237
  * [`activeId`](https://ariakit.org/reference/composite-provider#activeid)
232
- * state.
238
+ * state. You can pass additional options to override the current state.
233
239
  * @example
234
240
  * const nextId = store.next();
235
- * const nextNextId = store.next(2);
236
241
  */
237
- next: (skip?: number) => string | null | undefined;
242
+ next(options?: NextOptions): string | null | undefined;
243
+ /**
244
+ * @deprecated Use the object syntax instead: `next({ skip: 2 })`.
245
+ */
246
+ next(skip?: number): string | null | undefined;
238
247
  /**
239
248
  * Returns the id of the previous enabled item based on the current
240
249
  * [`activeId`](https://ariakit.org/reference/composite-provider#activeid)
241
- * state.
250
+ * state. You can pass additional options to override the current state.
242
251
  * @example
243
252
  * const previousId = store.previous();
244
- * const previousPreviousId = store.previous(2);
245
253
  */
246
- previous: (skip?: number) => string | null | undefined;
254
+ previous(options?: NextOptions): string | null | undefined;
255
+ /**
256
+ * @deprecated Use the object syntax instead: `previous({ skip: 2 })`.
257
+ */
258
+ previous(skip?: number): string | null | undefined;
247
259
  /**
248
260
  * Returns the id of the enabled item above based on the current
249
261
  * [`activeId`](https://ariakit.org/reference/composite-provider#activeid)
250
- * state.
262
+ * state. You can pass additional options to override the current state.
251
263
  * @example
252
264
  * const upId = store.up();
253
- * const upUpId = store.up(2);
254
265
  */
255
- up: (skip?: number) => string | null | undefined;
266
+ up(options?: NextOptions): string | null | undefined;
267
+ /**
268
+ * @deprecated Use the object syntax instead: `up({ skip: 2 })`.
269
+ */
270
+ up(skip?: number): string | null | undefined;
256
271
  /**
257
272
  * Returns the id of the enabled item below based on the current
258
273
  * [`activeId`](https://ariakit.org/reference/composite-provider#activeid)
259
- * state.
274
+ * state. You can pass additional options to override the current state.
260
275
  * @example
261
276
  * const downId = store.down();
262
- * const downDownId = store.down(2);
263
277
  */
264
- down: (skip?: number) => string | null | undefined;
278
+ down(options?: NextOptions): string | null | undefined;
279
+ /**
280
+ * @deprecated Use the object syntax instead: `down({ skip: 2 })`.
281
+ */
282
+ down(skip?: number): string | null | undefined;
265
283
  /**
266
284
  * Returns the id of the first enabled item.
267
285
  */
@@ -2,6 +2,12 @@ import type { CollectionStoreFunctions, CollectionStoreItem, CollectionStoreOpti
2
2
  import type { Store, StoreOptions, StoreProps } from "../utils/store.ts";
3
3
  import type { SetState } from "../utils/types.ts";
4
4
  type Orientation = "horizontal" | "vertical" | "both";
5
+ interface NextOptions extends Pick<Partial<CompositeStoreState>, "activeId" | "focusShift" | "focusLoop" | "focusWrap" | "includesBaseElement" | "renderedItems" | "rtl"> {
6
+ /**
7
+ * The number of items to skip.
8
+ */
9
+ skip?: number;
10
+ }
5
11
  /**
6
12
  * Creates a composite store.
7
13
  */
@@ -229,39 +235,51 @@ export interface CompositeStoreFunctions<T extends CompositeStoreItem = Composit
229
235
  /**
230
236
  * Returns the id of the next enabled item based on the current
231
237
  * [`activeId`](https://ariakit.org/reference/composite-provider#activeid)
232
- * state.
238
+ * state. You can pass additional options to override the current state.
233
239
  * @example
234
240
  * const nextId = store.next();
235
- * const nextNextId = store.next(2);
236
241
  */
237
- next: (skip?: number) => string | null | undefined;
242
+ next(options?: NextOptions): string | null | undefined;
243
+ /**
244
+ * @deprecated Use the object syntax instead: `next({ skip: 2 })`.
245
+ */
246
+ next(skip?: number): string | null | undefined;
238
247
  /**
239
248
  * Returns the id of the previous enabled item based on the current
240
249
  * [`activeId`](https://ariakit.org/reference/composite-provider#activeid)
241
- * state.
250
+ * state. You can pass additional options to override the current state.
242
251
  * @example
243
252
  * const previousId = store.previous();
244
- * const previousPreviousId = store.previous(2);
245
253
  */
246
- previous: (skip?: number) => string | null | undefined;
254
+ previous(options?: NextOptions): string | null | undefined;
255
+ /**
256
+ * @deprecated Use the object syntax instead: `previous({ skip: 2 })`.
257
+ */
258
+ previous(skip?: number): string | null | undefined;
247
259
  /**
248
260
  * Returns the id of the enabled item above based on the current
249
261
  * [`activeId`](https://ariakit.org/reference/composite-provider#activeid)
250
- * state.
262
+ * state. You can pass additional options to override the current state.
251
263
  * @example
252
264
  * const upId = store.up();
253
- * const upUpId = store.up(2);
254
265
  */
255
- up: (skip?: number) => string | null | undefined;
266
+ up(options?: NextOptions): string | null | undefined;
267
+ /**
268
+ * @deprecated Use the object syntax instead: `up({ skip: 2 })`.
269
+ */
270
+ up(skip?: number): string | null | undefined;
256
271
  /**
257
272
  * Returns the id of the enabled item below based on the current
258
273
  * [`activeId`](https://ariakit.org/reference/composite-provider#activeid)
259
- * state.
274
+ * state. You can pass additional options to override the current state.
260
275
  * @example
261
276
  * const downId = store.down();
262
- * const downDownId = store.down(2);
263
277
  */
264
- down: (skip?: number) => string | null | undefined;
278
+ down(options?: NextOptions): string | null | undefined;
279
+ /**
280
+ * @deprecated Use the object syntax instead: `down({ skip: 2 })`.
281
+ */
282
+ down(skip?: number): string | null | undefined;
265
283
  /**
266
284
  * Returns the id of the first enabled item.
267
285
  */
@@ -1,11 +1,10 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});"use client";
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
2
 
3
+ var _I2G6EN27cjs = require('../__chunks/I2G6EN27.cjs');
4
+ require('../__chunks/G2MFLTB2.cjs');
5
+ require('../__chunks/BSLRW6E7.cjs');
6
+ require('../__chunks/MLCPLY2P.cjs');
7
+ require('../__chunks/7EQBAZ46.cjs');
3
8
 
4
- var _N667HVEDcjs = require('../__chunks/N667HVED.cjs');
5
- require('../__chunks/QLWAGBAQ.cjs');
6
- require('../__chunks/3QF3ODTR.cjs');
7
- require('../__chunks/BTUHABP4.cjs');
8
- require('../__chunks/3IVNQNIV.cjs');
9
9
 
10
-
11
- exports.createDialogStore = _N667HVEDcjs.createDialogStore;
10
+ exports.createDialogStore = _I2G6EN27cjs.createDialogStore;
@@ -1,10 +1,9 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});"use client";
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
2
 
3
+ var _G2MFLTB2cjs = require('../__chunks/G2MFLTB2.cjs');
4
+ require('../__chunks/BSLRW6E7.cjs');
5
+ require('../__chunks/MLCPLY2P.cjs');
6
+ require('../__chunks/7EQBAZ46.cjs');
3
7
 
4
- var _QLWAGBAQcjs = require('../__chunks/QLWAGBAQ.cjs');
5
- require('../__chunks/3QF3ODTR.cjs');
6
- require('../__chunks/BTUHABP4.cjs');
7
- require('../__chunks/3IVNQNIV.cjs');
8
8
 
9
-
10
- exports.createDisclosureStore = _QLWAGBAQcjs.createDisclosureStore;
9
+ exports.createDisclosureStore = _G2MFLTB2cjs.createDisclosureStore;
@@ -1,24 +1,23 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});"use client";
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
2
 
3
+ var _G2NIRMCLcjs = require('../__chunks/G2NIRMCL.cjs');
3
4
 
4
- var _CCI5VM7Ecjs = require('../__chunks/CCI5VM7E.cjs');
5
5
 
6
6
 
7
7
 
8
8
 
9
+ var _BSLRW6E7cjs = require('../__chunks/BSLRW6E7.cjs');
9
10
 
10
- var _3QF3ODTRcjs = require('../__chunks/3QF3ODTR.cjs');
11
11
 
12
12
 
13
13
 
14
14
 
15
+ var _MLCPLY2Pcjs = require('../__chunks/MLCPLY2P.cjs');
16
+ require('../__chunks/WCFMOJKV.cjs');
15
17
 
16
- var _BTUHABP4cjs = require('../__chunks/BTUHABP4.cjs');
17
- require('../__chunks/7WYII4AN.cjs');
18
18
 
19
19
 
20
-
21
- var _3IVNQNIVcjs = require('../__chunks/3IVNQNIV.cjs');
20
+ var _7EQBAZ46cjs = require('../__chunks/7EQBAZ46.cjs');
22
21
 
23
22
  // src/form/form-store.ts
24
23
  function nextFrame() {
@@ -26,7 +25,7 @@ function nextFrame() {
26
25
  }
27
26
  function hasMessages(object) {
28
27
  return Object.keys(object).some((key) => {
29
- if (_BTUHABP4cjs.isObject.call(void 0, object[key])) {
28
+ if (_MLCPLY2Pcjs.isObject.call(void 0, object[key])) {
30
29
  return hasMessages(object[key]);
31
30
  }
32
31
  return !!object[key];
@@ -47,10 +46,10 @@ function set(values, path, value) {
47
46
  const [k, ...rest] = Array.isArray(path) ? path : `${path}`.split(".");
48
47
  if (k == null) return values;
49
48
  const key = k;
50
- const isIntegerKey = _BTUHABP4cjs.isInteger.call(void 0, key);
49
+ const isIntegerKey = _MLCPLY2Pcjs.isInteger.call(void 0, key);
51
50
  const nextValues = isIntegerKey ? values || [] : values || {};
52
51
  const nestedValues = nextValues[key];
53
- const result = rest.length && (Array.isArray(nestedValues) || _BTUHABP4cjs.isObject.call(void 0, nestedValues)) ? set(nestedValues, rest, value) : value;
52
+ const result = rest.length && (Array.isArray(nestedValues) || _MLCPLY2Pcjs.isObject.call(void 0, nestedValues)) ? set(nestedValues, rest, value) : value;
54
53
  if (isIntegerKey) {
55
54
  const index = Number(key);
56
55
  if (values && Array.isArray(values)) {
@@ -64,7 +63,7 @@ function set(values, path, value) {
64
63
  nextValues2[index] = result;
65
64
  return nextValues2;
66
65
  }
67
- return _3IVNQNIVcjs.__spreadProps.call(void 0, _3IVNQNIVcjs.__spreadValues.call(void 0, {}, values), { [key]: result });
66
+ return _7EQBAZ46cjs.__spreadProps.call(void 0, _7EQBAZ46cjs.__spreadValues.call(void 0, {}, values), { [key]: result });
68
67
  }
69
68
  function setAll(values, value) {
70
69
  const result = {};
@@ -73,12 +72,12 @@ function setAll(values, value) {
73
72
  const currentValue = values[key];
74
73
  if (Array.isArray(currentValue)) {
75
74
  result[key] = currentValue.map((v) => {
76
- if (_BTUHABP4cjs.isObject.call(void 0, v)) {
75
+ if (_MLCPLY2Pcjs.isObject.call(void 0, v)) {
77
76
  return setAll(v, value);
78
77
  }
79
78
  return value;
80
79
  });
81
- } else if (_BTUHABP4cjs.isObject.call(void 0, currentValue)) {
80
+ } else if (_MLCPLY2Pcjs.isObject.call(void 0, currentValue)) {
82
81
  result[key] = setAll(currentValue, value);
83
82
  } else {
84
83
  result[key] = value;
@@ -113,46 +112,46 @@ function createNames() {
113
112
  }
114
113
  function createFormStore(props = {}) {
115
114
  var _a;
116
- _3QF3ODTRcjs.throwOnConflictingProps.call(void 0, props, props.store);
115
+ _BSLRW6E7cjs.throwOnConflictingProps.call(void 0, props, props.store);
117
116
  const syncState = (_a = props.store) == null ? void 0 : _a.getState();
118
- const collection = _CCI5VM7Ecjs.createCollectionStore.call(void 0, props);
119
- const values = _BTUHABP4cjs.defaultValue.call(void 0,
117
+ const collection = _G2NIRMCLcjs.createCollectionStore.call(void 0, props);
118
+ const values = _MLCPLY2Pcjs.defaultValue.call(void 0,
120
119
  props.values,
121
120
  syncState == null ? void 0 : syncState.values,
122
121
  props.defaultValues,
123
122
  {}
124
123
  );
125
- const errors = _BTUHABP4cjs.defaultValue.call(void 0,
124
+ const errors = _MLCPLY2Pcjs.defaultValue.call(void 0,
126
125
  props.errors,
127
126
  syncState == null ? void 0 : syncState.errors,
128
127
  props.defaultErrors,
129
128
  {}
130
129
  );
131
- const touched = _BTUHABP4cjs.defaultValue.call(void 0,
130
+ const touched = _MLCPLY2Pcjs.defaultValue.call(void 0,
132
131
  props.touched,
133
132
  syncState == null ? void 0 : syncState.touched,
134
133
  props.defaultTouched,
135
134
  {}
136
135
  );
137
- const initialState = _3IVNQNIVcjs.__spreadProps.call(void 0, _3IVNQNIVcjs.__spreadValues.call(void 0, {}, collection.getState()), {
136
+ const initialState = _7EQBAZ46cjs.__spreadProps.call(void 0, _7EQBAZ46cjs.__spreadValues.call(void 0, {}, collection.getState()), {
138
137
  values,
139
138
  errors,
140
139
  touched,
141
- validating: _BTUHABP4cjs.defaultValue.call(void 0, syncState == null ? void 0 : syncState.validating, false),
142
- submitting: _BTUHABP4cjs.defaultValue.call(void 0, syncState == null ? void 0 : syncState.submitting, false),
143
- submitSucceed: _BTUHABP4cjs.defaultValue.call(void 0, syncState == null ? void 0 : syncState.submitSucceed, 0),
144
- submitFailed: _BTUHABP4cjs.defaultValue.call(void 0, syncState == null ? void 0 : syncState.submitFailed, 0),
140
+ validating: _MLCPLY2Pcjs.defaultValue.call(void 0, syncState == null ? void 0 : syncState.validating, false),
141
+ submitting: _MLCPLY2Pcjs.defaultValue.call(void 0, syncState == null ? void 0 : syncState.submitting, false),
142
+ submitSucceed: _MLCPLY2Pcjs.defaultValue.call(void 0, syncState == null ? void 0 : syncState.submitSucceed, 0),
143
+ submitFailed: _MLCPLY2Pcjs.defaultValue.call(void 0, syncState == null ? void 0 : syncState.submitFailed, 0),
145
144
  valid: !hasMessages(errors)
146
145
  });
147
- const form = _3QF3ODTRcjs.createStore.call(void 0, initialState, collection, props.store);
146
+ const form = _BSLRW6E7cjs.createStore.call(void 0, initialState, collection, props.store);
148
147
  const syncCallbacks = getStoreCallbacks(props.store);
149
148
  const syncCallbacksState = syncCallbacks == null ? void 0 : syncCallbacks.getState();
150
149
  const callbacksInitialState = {
151
150
  validate: (syncCallbacksState == null ? void 0 : syncCallbacksState.validate) || [],
152
151
  submit: (syncCallbacksState == null ? void 0 : syncCallbacksState.submit) || []
153
152
  };
154
- const callbacks = _3QF3ODTRcjs.createStore.call(void 0, callbacksInitialState, syncCallbacks);
155
- _3QF3ODTRcjs.setup.call(void 0, form, () => _3QF3ODTRcjs.init.call(void 0, callbacks));
153
+ const callbacks = _BSLRW6E7cjs.createStore.call(void 0, callbacksInitialState, syncCallbacks);
154
+ _BSLRW6E7cjs.setup.call(void 0, form, () => _BSLRW6E7cjs.init.call(void 0, callbacks));
156
155
  const validate = async () => {
157
156
  form.setState("validating", true);
158
157
  form.setState("errors", {});
@@ -167,13 +166,13 @@ function createFormStore(props = {}) {
167
166
  form.setState("validating", false);
168
167
  }
169
168
  };
170
- return _3IVNQNIVcjs.__spreadProps.call(void 0, _3IVNQNIVcjs.__spreadValues.call(void 0, _3IVNQNIVcjs.__spreadValues.call(void 0, {}, collection), form), {
169
+ return _7EQBAZ46cjs.__spreadProps.call(void 0, _7EQBAZ46cjs.__spreadValues.call(void 0, _7EQBAZ46cjs.__spreadValues.call(void 0, {}, collection), form), {
171
170
  names: createNames(),
172
171
  setValues: (values2) => form.setState("values", values2),
173
172
  getValue: (name) => get(form.getState().values, name),
174
173
  setValue: (name, value) => form.setState("values", (values2) => {
175
174
  const prevValue = get(values2, name);
176
- const nextValue = _BTUHABP4cjs.applyState.call(void 0, value, prevValue);
175
+ const nextValue = _MLCPLY2Pcjs.applyState.call(void 0, value, prevValue);
177
176
  if (nextValue === prevValue) return values2;
178
177
  return set(values2, name, nextValue);
179
178
  }),
@@ -193,7 +192,7 @@ function createFormStore(props = {}) {
193
192
  getError: (name) => get(form.getState().errors, name),
194
193
  setError: (name, error) => form.setState("errors", (errors2) => {
195
194
  const prevError = get(errors2, name);
196
- const nextError = _BTUHABP4cjs.applyState.call(void 0, error, prevError);
195
+ const nextError = _MLCPLY2Pcjs.applyState.call(void 0, error, prevError);
197
196
  if (nextError === prevError) return errors2;
198
197
  return set(errors2, name, nextError);
199
198
  }),
@@ -201,7 +200,7 @@ function createFormStore(props = {}) {
201
200
  getFieldTouched: (name) => !!get(form.getState().touched, name),
202
201
  setFieldTouched: (name, value) => form.setState("touched", (touched2) => {
203
202
  const prevValue = get(touched2, name);
204
- const nextValue = _BTUHABP4cjs.applyState.call(void 0, value, prevValue);
203
+ const nextValue = _MLCPLY2Pcjs.applyState.call(void 0, value, prevValue);
205
204
  if (nextValue === prevValue) return touched2;
206
205
  return set(touched2, name, nextValue);
207
206
  }),
@@ -1 +1 @@
1
- "use strict";"use client";
1
+ "use strict";
@@ -1,13 +1,12 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});"use client";
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
2
 
3
+ var _LSC6QXJ7cjs = require('../__chunks/LSC6QXJ7.cjs');
4
+ require('../__chunks/C5P5S22J.cjs');
5
+ require('../__chunks/I2G6EN27.cjs');
6
+ require('../__chunks/G2MFLTB2.cjs');
7
+ require('../__chunks/BSLRW6E7.cjs');
8
+ require('../__chunks/MLCPLY2P.cjs');
9
+ require('../__chunks/7EQBAZ46.cjs');
3
10
 
4
- var _XIZWLBI2cjs = require('../__chunks/XIZWLBI2.cjs');
5
- require('../__chunks/H6ZQSQQL.cjs');
6
- require('../__chunks/N667HVED.cjs');
7
- require('../__chunks/QLWAGBAQ.cjs');
8
- require('../__chunks/3QF3ODTR.cjs');
9
- require('../__chunks/BTUHABP4.cjs');
10
- require('../__chunks/3IVNQNIV.cjs');
11
11
 
12
-
13
- exports.createHovercardStore = _XIZWLBI2cjs.createHovercardStore;
12
+ exports.createHovercardStore = _LSC6QXJ7cjs.createHovercardStore;
package/cjs/index.cjs CHANGED
@@ -1,5 +1,4 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});"use client";
2
- require('./__chunks/3IVNQNIV.cjs');
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});require('./__chunks/7EQBAZ46.cjs');
3
2
 
4
3
  // src/index.ts
5
4
  var src_default = {};
@@ -1,18 +1,17 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});"use client";
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
2
 
3
-
4
- var _VJAE2Y4Tcjs = require('../__chunks/VJAE2Y4T.cjs');
5
- require('../__chunks/PW36G76L.cjs');
6
- require('../__chunks/CCI5VM7E.cjs');
7
- require('../__chunks/ULSPM3Y3.cjs');
8
- require('../__chunks/3QF3ODTR.cjs');
9
- require('../__chunks/BTUHABP4.cjs');
10
- require('../__chunks/7WYII4AN.cjs');
11
- require('../__chunks/3IVNQNIV.cjs');
3
+ var _LLZO7SOBcjs = require('../__chunks/LLZO7SOB.cjs');
4
+ require('../__chunks/W3GMUKTU.cjs');
5
+ require('../__chunks/G2NIRMCL.cjs');
6
+ require('../__chunks/GDZQUFNP.cjs');
7
+ require('../__chunks/BSLRW6E7.cjs');
8
+ require('../__chunks/MLCPLY2P.cjs');
9
+ require('../__chunks/WCFMOJKV.cjs');
10
+ require('../__chunks/7EQBAZ46.cjs');
12
11
 
13
12
  // src/menu/menu-bar-store.ts
14
13
  function createMenuBarStore(props = {}) {
15
- return _VJAE2Y4Tcjs.createMenubarStore.call(void 0, props);
14
+ return _LLZO7SOBcjs.createMenubarStore.call(void 0, props);
16
15
  }
17
16
 
18
17
 
@@ -1,15 +1,15 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});"use client";
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
2
 
3
+ var _LSC6QXJ7cjs = require('../__chunks/LSC6QXJ7.cjs');
3
4
 
4
- var _XIZWLBI2cjs = require('../__chunks/XIZWLBI2.cjs');
5
5
 
6
+ var _W3GMUKTUcjs = require('../__chunks/W3GMUKTU.cjs');
7
+ require('../__chunks/G2NIRMCL.cjs');
8
+ require('../__chunks/GDZQUFNP.cjs');
9
+ require('../__chunks/C5P5S22J.cjs');
10
+ require('../__chunks/I2G6EN27.cjs');
11
+ require('../__chunks/G2MFLTB2.cjs');
6
12
 
7
- var _PW36G76Lcjs = require('../__chunks/PW36G76L.cjs');
8
- require('../__chunks/CCI5VM7E.cjs');
9
- require('../__chunks/ULSPM3Y3.cjs');
10
- require('../__chunks/H6ZQSQQL.cjs');
11
- require('../__chunks/N667HVED.cjs');
12
- require('../__chunks/QLWAGBAQ.cjs');
13
13
 
14
14
 
15
15
 
@@ -17,18 +17,17 @@ require('../__chunks/QLWAGBAQ.cjs');
17
17
 
18
18
 
19
19
 
20
+ var _BSLRW6E7cjs = require('../__chunks/BSLRW6E7.cjs');
20
21
 
21
- var _3QF3ODTRcjs = require('../__chunks/3QF3ODTR.cjs');
22
22
 
23
23
 
24
+ var _MLCPLY2Pcjs = require('../__chunks/MLCPLY2P.cjs');
25
+ require('../__chunks/WCFMOJKV.cjs');
24
26
 
25
- var _BTUHABP4cjs = require('../__chunks/BTUHABP4.cjs');
26
- require('../__chunks/7WYII4AN.cjs');
27
27
 
28
28
 
29
29
 
30
-
31
- var _3IVNQNIVcjs = require('../__chunks/3IVNQNIV.cjs');
30
+ var _7EQBAZ46cjs = require('../__chunks/7EQBAZ46.cjs');
32
31
 
33
32
  // src/menu/menu-store.ts
34
33
  function createMenuStore(_a = {}) {
@@ -36,16 +35,16 @@ function createMenuStore(_a = {}) {
36
35
  combobox,
37
36
  parent,
38
37
  menubar
39
- } = _b, props = _3IVNQNIVcjs.__objRest.call(void 0, _b, [
38
+ } = _b, props = _7EQBAZ46cjs.__objRest.call(void 0, _b, [
40
39
  "combobox",
41
40
  "parent",
42
41
  "menubar"
43
42
  ]);
44
43
  const parentIsMenubar = !!menubar && !parent;
45
- const store = _3QF3ODTRcjs.mergeStore.call(void 0,
44
+ const store = _BSLRW6E7cjs.mergeStore.call(void 0,
46
45
  props.store,
47
- _3QF3ODTRcjs.pick.call(void 0, parent, ["values"]),
48
- _3QF3ODTRcjs.omit.call(void 0, combobox, [
46
+ _BSLRW6E7cjs.pick.call(void 0, parent, ["values"]),
47
+ _BSLRW6E7cjs.omit.call(void 0, combobox, [
49
48
  "arrowElement",
50
49
  "anchorElement",
51
50
  "contentElement",
@@ -53,57 +52,57 @@ function createMenuStore(_a = {}) {
53
52
  "disclosureElement"
54
53
  ])
55
54
  );
56
- _3QF3ODTRcjs.throwOnConflictingProps.call(void 0, props, store);
55
+ _BSLRW6E7cjs.throwOnConflictingProps.call(void 0, props, store);
57
56
  const syncState = store.getState();
58
- const composite = _PW36G76Lcjs.createCompositeStore.call(void 0, _3IVNQNIVcjs.__spreadProps.call(void 0, _3IVNQNIVcjs.__spreadValues.call(void 0, {}, props), {
57
+ const composite = _W3GMUKTUcjs.createCompositeStore.call(void 0, _7EQBAZ46cjs.__spreadProps.call(void 0, _7EQBAZ46cjs.__spreadValues.call(void 0, {}, props), {
59
58
  store,
60
- orientation: _BTUHABP4cjs.defaultValue.call(void 0,
59
+ orientation: _MLCPLY2Pcjs.defaultValue.call(void 0,
61
60
  props.orientation,
62
61
  syncState.orientation,
63
62
  "vertical"
64
63
  )
65
64
  }));
66
- const hovercard = _XIZWLBI2cjs.createHovercardStore.call(void 0, _3IVNQNIVcjs.__spreadProps.call(void 0, _3IVNQNIVcjs.__spreadValues.call(void 0, {}, props), {
65
+ const hovercard = _LSC6QXJ7cjs.createHovercardStore.call(void 0, _7EQBAZ46cjs.__spreadProps.call(void 0, _7EQBAZ46cjs.__spreadValues.call(void 0, {}, props), {
67
66
  store,
68
- placement: _BTUHABP4cjs.defaultValue.call(void 0,
67
+ placement: _MLCPLY2Pcjs.defaultValue.call(void 0,
69
68
  props.placement,
70
69
  syncState.placement,
71
70
  "bottom-start"
72
71
  ),
73
- timeout: _BTUHABP4cjs.defaultValue.call(void 0,
72
+ timeout: _MLCPLY2Pcjs.defaultValue.call(void 0,
74
73
  props.timeout,
75
74
  syncState.timeout,
76
75
  parentIsMenubar ? 0 : 150
77
76
  ),
78
- hideTimeout: _BTUHABP4cjs.defaultValue.call(void 0, props.hideTimeout, syncState.hideTimeout, 0)
77
+ hideTimeout: _MLCPLY2Pcjs.defaultValue.call(void 0, props.hideTimeout, syncState.hideTimeout, 0)
79
78
  }));
80
- const initialState = _3IVNQNIVcjs.__spreadProps.call(void 0, _3IVNQNIVcjs.__spreadValues.call(void 0, _3IVNQNIVcjs.__spreadValues.call(void 0, {}, composite.getState()), hovercard.getState()), {
81
- initialFocus: _BTUHABP4cjs.defaultValue.call(void 0, syncState.initialFocus, "container"),
82
- values: _BTUHABP4cjs.defaultValue.call(void 0,
79
+ const initialState = _7EQBAZ46cjs.__spreadProps.call(void 0, _7EQBAZ46cjs.__spreadValues.call(void 0, _7EQBAZ46cjs.__spreadValues.call(void 0, {}, composite.getState()), hovercard.getState()), {
80
+ initialFocus: _MLCPLY2Pcjs.defaultValue.call(void 0, syncState.initialFocus, "container"),
81
+ values: _MLCPLY2Pcjs.defaultValue.call(void 0,
83
82
  props.values,
84
83
  syncState.values,
85
84
  props.defaultValues,
86
85
  {}
87
86
  )
88
87
  });
89
- const menu = _3QF3ODTRcjs.createStore.call(void 0, initialState, composite, hovercard, store);
90
- _3QF3ODTRcjs.setup.call(void 0,
88
+ const menu = _BSLRW6E7cjs.createStore.call(void 0, initialState, composite, hovercard, store);
89
+ _BSLRW6E7cjs.setup.call(void 0,
91
90
  menu,
92
- () => _3QF3ODTRcjs.sync.call(void 0, menu, ["mounted"], (state) => {
91
+ () => _BSLRW6E7cjs.sync.call(void 0, menu, ["mounted"], (state) => {
93
92
  if (state.mounted) return;
94
93
  menu.setState("activeId", null);
95
94
  })
96
95
  );
97
- _3QF3ODTRcjs.setup.call(void 0,
96
+ _BSLRW6E7cjs.setup.call(void 0,
98
97
  menu,
99
- () => _3QF3ODTRcjs.sync.call(void 0, parent, ["orientation"], (state) => {
98
+ () => _BSLRW6E7cjs.sync.call(void 0, parent, ["orientation"], (state) => {
100
99
  menu.setState(
101
100
  "placement",
102
101
  state.orientation === "vertical" ? "right-start" : "bottom-start"
103
102
  );
104
103
  })
105
104
  );
106
- return _3IVNQNIVcjs.__spreadProps.call(void 0, _3IVNQNIVcjs.__spreadValues.call(void 0, _3IVNQNIVcjs.__spreadValues.call(void 0, _3IVNQNIVcjs.__spreadValues.call(void 0, {}, composite), hovercard), menu), {
105
+ return _7EQBAZ46cjs.__spreadProps.call(void 0, _7EQBAZ46cjs.__spreadValues.call(void 0, _7EQBAZ46cjs.__spreadValues.call(void 0, _7EQBAZ46cjs.__spreadValues.call(void 0, {}, composite), hovercard), menu), {
107
106
  combobox,
108
107
  parent,
109
108
  menubar,
@@ -119,9 +118,9 @@ function createMenuStore(_a = {}) {
119
118
  if (Array.isArray(name)) return;
120
119
  menu.setState("values", (values) => {
121
120
  const prevValue = values[name];
122
- const nextValue = _BTUHABP4cjs.applyState.call(void 0, value, prevValue);
121
+ const nextValue = _MLCPLY2Pcjs.applyState.call(void 0, value, prevValue);
123
122
  if (nextValue === prevValue) return values;
124
- return _3IVNQNIVcjs.__spreadProps.call(void 0, _3IVNQNIVcjs.__spreadValues.call(void 0, {}, values), {
123
+ return _7EQBAZ46cjs.__spreadProps.call(void 0, _7EQBAZ46cjs.__spreadValues.call(void 0, {}, values), {
125
124
  [name]: nextValue !== void 0 && nextValue
126
125
  });
127
126
  });
@@ -1,14 +1,13 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});"use client";
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
2
 
3
+ var _LLZO7SOBcjs = require('../__chunks/LLZO7SOB.cjs');
4
+ require('../__chunks/W3GMUKTU.cjs');
5
+ require('../__chunks/G2NIRMCL.cjs');
6
+ require('../__chunks/GDZQUFNP.cjs');
7
+ require('../__chunks/BSLRW6E7.cjs');
8
+ require('../__chunks/MLCPLY2P.cjs');
9
+ require('../__chunks/WCFMOJKV.cjs');
10
+ require('../__chunks/7EQBAZ46.cjs');
3
11
 
4
- var _VJAE2Y4Tcjs = require('../__chunks/VJAE2Y4T.cjs');
5
- require('../__chunks/PW36G76L.cjs');
6
- require('../__chunks/CCI5VM7E.cjs');
7
- require('../__chunks/ULSPM3Y3.cjs');
8
- require('../__chunks/3QF3ODTR.cjs');
9
- require('../__chunks/BTUHABP4.cjs');
10
- require('../__chunks/7WYII4AN.cjs');
11
- require('../__chunks/3IVNQNIV.cjs');
12
12
 
13
-
14
- exports.createMenubarStore = _VJAE2Y4Tcjs.createMenubarStore;
13
+ exports.createMenubarStore = _LLZO7SOBcjs.createMenubarStore;
@@ -1,12 +1,11 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});"use client";
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
2
 
3
+ var _C5P5S22Jcjs = require('../__chunks/C5P5S22J.cjs');
4
+ require('../__chunks/I2G6EN27.cjs');
5
+ require('../__chunks/G2MFLTB2.cjs');
6
+ require('../__chunks/BSLRW6E7.cjs');
7
+ require('../__chunks/MLCPLY2P.cjs');
8
+ require('../__chunks/7EQBAZ46.cjs');
3
9
 
4
- var _H6ZQSQQLcjs = require('../__chunks/H6ZQSQQL.cjs');
5
- require('../__chunks/N667HVED.cjs');
6
- require('../__chunks/QLWAGBAQ.cjs');
7
- require('../__chunks/3QF3ODTR.cjs');
8
- require('../__chunks/BTUHABP4.cjs');
9
- require('../__chunks/3IVNQNIV.cjs');
10
10
 
11
-
12
- exports.createPopoverStore = _H6ZQSQQLcjs.createPopoverStore;
11
+ exports.createPopoverStore = _C5P5S22Jcjs.createPopoverStore;