@ariakit/core 0.3.9 → 0.3.10

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 (77) hide show
  1. package/CHANGELOG.md +5 -0
  2. package/cjs/__chunks/{2UK5WUJX.cjs → 5CBCKBZ2.cjs} +0 -2
  3. package/cjs/__chunks/{UTICNXST.cjs → CWDUO5EV.cjs} +4 -4
  4. package/cjs/__chunks/{5SIVMOID.cjs → HMO4CKUP.cjs} +4 -4
  5. package/cjs/__chunks/{2LS4JJ4S.cjs → MFSCSSBJ.cjs} +2 -2
  6. package/cjs/__chunks/{GJFZ5ZPP.cjs → MWNFQD55.cjs} +11 -11
  7. package/cjs/__chunks/{EFIT5L4X.cjs → Y6PHIDP6.cjs} +7 -7
  8. package/cjs/__chunks/{UCLKUBNP.cjs → YLMJBIQM.cjs} +16 -12
  9. package/cjs/__chunks/{JNFZSNOI.cjs → ZXCB7MXN.cjs} +6 -6
  10. package/cjs/checkbox/checkbox-store.cjs +3 -3
  11. package/cjs/checkbox/checkbox-store.d.cts +5 -2
  12. package/cjs/checkbox/checkbox-store.d.ts +5 -2
  13. package/cjs/collection/collection-store.cjs +3 -3
  14. package/cjs/collection/collection-store.d.cts +11 -11
  15. package/cjs/collection/collection-store.d.ts +11 -11
  16. package/cjs/combobox/combobox-store.cjs +20 -20
  17. package/cjs/combobox/combobox-store.d.cts +3 -1
  18. package/cjs/combobox/combobox-store.d.ts +3 -1
  19. package/cjs/composite/composite-overflow-store.cjs +5 -5
  20. package/cjs/composite/composite-store.cjs +4 -4
  21. package/cjs/composite/composite-store.d.cts +128 -54
  22. package/cjs/composite/composite-store.d.ts +128 -54
  23. package/cjs/dialog/dialog-store.cjs +4 -4
  24. package/cjs/disclosure/disclosure-store.cjs +3 -3
  25. package/cjs/disclosure/disclosure-store.d.cts +33 -27
  26. package/cjs/disclosure/disclosure-store.d.ts +33 -27
  27. package/cjs/form/form-store.cjs +7 -7
  28. package/cjs/form/form-store.d.cts +34 -25
  29. package/cjs/form/form-store.d.ts +34 -25
  30. package/cjs/hovercard/hovercard-store.cjs +6 -6
  31. package/cjs/menu/menu-bar-store.cjs +5 -5
  32. package/cjs/menu/menu-store.cjs +18 -18
  33. package/cjs/menubar/menubar-store.cjs +5 -5
  34. package/cjs/popover/popover-store.cjs +5 -5
  35. package/cjs/radio/radio-store.cjs +5 -5
  36. package/cjs/select/select-store.cjs +18 -18
  37. package/cjs/tab/tab-store.cjs +15 -15
  38. package/cjs/tab/tab-store.d.cts +15 -4
  39. package/cjs/tab/tab-store.d.ts +15 -4
  40. package/cjs/toolbar/toolbar-store.cjs +4 -4
  41. package/cjs/tooltip/tooltip-store.cjs +7 -7
  42. package/cjs/utils/store.cjs +2 -2
  43. package/esm/__chunks/{LT2OYWRD.js → 25MEC56I.js} +1 -1
  44. package/esm/__chunks/{J6JIOWCS.js → AKMSZ36N.js} +2 -2
  45. package/esm/__chunks/{A2J4XZ5T.js → K6ELJFXN.js} +0 -2
  46. package/esm/__chunks/{NKLTHWCR.js → L5RYKTVQ.js} +1 -1
  47. package/esm/__chunks/{TLN4ALYH.js → MYUKSFP5.js} +10 -6
  48. package/esm/__chunks/{T3DVYGXI.js → QJ5CUA32.js} +2 -2
  49. package/esm/__chunks/{EZ2TTBAQ.js → UUFF4PQ6.js} +2 -2
  50. package/esm/__chunks/{DLX2AS6C.js → VEUNYQYR.js} +2 -2
  51. package/esm/checkbox/checkbox-store.d.ts +5 -2
  52. package/esm/checkbox/checkbox-store.js +1 -1
  53. package/esm/collection/collection-store.d.ts +11 -11
  54. package/esm/collection/collection-store.js +2 -2
  55. package/esm/combobox/combobox-store.d.ts +3 -1
  56. package/esm/combobox/combobox-store.js +6 -6
  57. package/esm/composite/composite-overflow-store.js +4 -4
  58. package/esm/composite/composite-store.d.ts +128 -54
  59. package/esm/composite/composite-store.js +3 -3
  60. package/esm/dialog/dialog-store.js +3 -3
  61. package/esm/disclosure/disclosure-store.d.ts +33 -27
  62. package/esm/disclosure/disclosure-store.js +2 -2
  63. package/esm/form/form-store.d.ts +34 -25
  64. package/esm/form/form-store.js +2 -2
  65. package/esm/hovercard/hovercard-store.js +5 -5
  66. package/esm/menu/menu-bar-store.js +4 -4
  67. package/esm/menu/menu-store.js +7 -7
  68. package/esm/menubar/menubar-store.js +4 -4
  69. package/esm/popover/popover-store.js +4 -4
  70. package/esm/radio/radio-store.js +3 -3
  71. package/esm/select/select-store.js +6 -6
  72. package/esm/tab/tab-store.d.ts +15 -4
  73. package/esm/tab/tab-store.js +3 -3
  74. package/esm/toolbar/toolbar-store.js +3 -3
  75. package/esm/tooltip/tooltip-store.js +5 -5
  76. package/esm/utils/store.js +1 -1
  77. package/package.json +1 -1
@@ -1,13 +1,13 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});"use client";
2
2
 
3
3
 
4
- var _UCLKUBNPcjs = require('../__chunks/UCLKUBNP.cjs');
4
+ var _YLMJBIQMcjs = require('../__chunks/YLMJBIQM.cjs');
5
5
 
6
6
 
7
7
 
8
8
 
9
9
 
10
- var _2UK5WUJXcjs = require('../__chunks/2UK5WUJX.cjs');
10
+ var _5CBCKBZ2cjs = require('../__chunks/5CBCKBZ2.cjs');
11
11
 
12
12
 
13
13
 
@@ -114,9 +114,9 @@ function createNames() {
114
114
  }
115
115
  function createFormStore(props = {}) {
116
116
  var _a;
117
- _2UK5WUJXcjs.throwOnConflictingProps.call(void 0, props, props.store);
117
+ _5CBCKBZ2cjs.throwOnConflictingProps.call(void 0, props, props.store);
118
118
  const syncState = (_a = props.store) == null ? void 0 : _a.getState();
119
- const collection = _UCLKUBNPcjs.createCollectionStore.call(void 0, props);
119
+ const collection = _YLMJBIQMcjs.createCollectionStore.call(void 0, props);
120
120
  const values = _3UT5FE6Kcjs.defaultValue.call(void 0,
121
121
  props.values,
122
122
  syncState == null ? void 0 : syncState.values,
@@ -145,15 +145,15 @@ function createFormStore(props = {}) {
145
145
  submitFailed: _3UT5FE6Kcjs.defaultValue.call(void 0, syncState == null ? void 0 : syncState.submitFailed, 0),
146
146
  valid: !hasMessages(errors)
147
147
  });
148
- const form = _2UK5WUJXcjs.createStore.call(void 0, initialState, collection, props.store);
148
+ const form = _5CBCKBZ2cjs.createStore.call(void 0, initialState, collection, props.store);
149
149
  const syncCallbacks = getStoreCallbacks(props.store);
150
150
  const syncCallbacksState = syncCallbacks == null ? void 0 : syncCallbacks.getState();
151
151
  const callbacksInitialState = {
152
152
  validate: (syncCallbacksState == null ? void 0 : syncCallbacksState.validate) || [],
153
153
  submit: (syncCallbacksState == null ? void 0 : syncCallbacksState.submit) || []
154
154
  };
155
- const callbacks = _2UK5WUJXcjs.createStore.call(void 0, callbacksInitialState, syncCallbacks);
156
- _2UK5WUJXcjs.setup.call(void 0, form, () => _2UK5WUJXcjs.init.call(void 0, callbacks));
155
+ const callbacks = _5CBCKBZ2cjs.createStore.call(void 0, callbacksInitialState, syncCallbacks);
156
+ _5CBCKBZ2cjs.setup.call(void 0, form, () => _5CBCKBZ2cjs.init.call(void 0, callbacks));
157
157
  const validate = async () => {
158
158
  form.setState("validating", true);
159
159
  form.setState("errors", {});
@@ -19,6 +19,10 @@ export interface FormStoreItem extends CollectionStoreItem {
19
19
  export interface FormStoreState<T extends FormStoreValues = FormStoreValues> extends CollectionStoreState<FormStoreItem> {
20
20
  /**
21
21
  * Form values.
22
+ *
23
+ * Live examples:
24
+ * - [FormRadio](https://ariakit.org/examples/form-radio)
25
+ * - [FormSelect](https://ariakit.org/examples/form-select)
22
26
  * @default {}
23
27
  */
24
28
  values: T;
@@ -43,18 +47,25 @@ export interface FormStoreState<T extends FormStoreValues = FormStoreValues> ext
43
47
  */
44
48
  submitting: boolean;
45
49
  /**
46
- * The number of times `form.submit` has been called with a successful
47
- * response.
50
+ * The number of times
51
+ * [`submit`](https://ariakit.org/reference/use-form-store#submit) has been
52
+ * called with a successful response.
48
53
  */
49
54
  submitSucceed: number;
50
55
  /**
51
- * The number of times `form.submit` has been called with an error response.
56
+ * The number of times
57
+ * [`submit`](https://ariakit.org/reference/use-form-store#submit) has been
58
+ * called with an error response.
52
59
  */
53
60
  submitFailed: number;
54
61
  }
55
62
  export interface FormStoreFunctions<T extends FormStoreValues = FormStoreValues> extends CollectionStoreFunctions<FormStoreItem> {
56
63
  /**
57
64
  * An object containing the names of the form fields for type-safety.
65
+ *
66
+ * Live examples:
67
+ * - [FormRadio](https://ariakit.org/examples/form-radio)
68
+ * - [FormSelect](https://ariakit.org/examples/form-select)
58
69
  * @example
59
70
  * store.names.name; // "name"
60
71
  * store.names.name.first; // "name.first"
@@ -62,7 +73,8 @@ export interface FormStoreFunctions<T extends FormStoreValues = FormStoreValues>
62
73
  */
63
74
  names: Names<T>;
64
75
  /**
65
- * Sets the `values` state.
76
+ * Sets the [`values`](https://ariakit.org/reference/form-provider#values)
77
+ * state.
66
78
  * @example
67
79
  * store.setValues({ name: "John" });
68
80
  * store.setValues((values) => ({ ...values, name: "John" }));
@@ -70,7 +82,9 @@ export interface FormStoreFunctions<T extends FormStoreValues = FormStoreValues>
70
82
  setValues: SetState<FormStoreState<T>["values"]>;
71
83
  /**
72
84
  * Retrieves a field value.
73
- * @param name The field name.
85
+ *
86
+ * Live examples:
87
+ * - [FormRadio](https://ariakit.org/examples/form-radio)
74
88
  * @example
75
89
  * const nameValue = store.getValue("name");
76
90
  * // Can also use store.names for type-safety.
@@ -79,8 +93,9 @@ export interface FormStoreFunctions<T extends FormStoreValues = FormStoreValues>
79
93
  getValue: <T = any>(name: StringLike) => T;
80
94
  /**
81
95
  * Sets a field value.
82
- * @param name The field name.
83
- * @param value The field value.
96
+ *
97
+ * Live examples:
98
+ * - [FormSelect](https://ariakit.org/examples/form-select)
84
99
  * @example
85
100
  * store.setValue("name", "John");
86
101
  * store.setValue("name", (value) => value + " Doe");
@@ -90,8 +105,6 @@ export interface FormStoreFunctions<T extends FormStoreValues = FormStoreValues>
90
105
  setValue: <T>(name: StringLike, value: SetStateAction<T>) => void;
91
106
  /**
92
107
  * Pushes a value to an array field.
93
- * @param name The array field name.
94
- * @param value The value to push.
95
108
  * @example
96
109
  * store.pushValue("tags", "new tag");
97
110
  * store.pushValue("tags", { id: 1, name: "new tag" });
@@ -101,8 +114,6 @@ export interface FormStoreFunctions<T extends FormStoreValues = FormStoreValues>
101
114
  pushValue: <T>(name: StringLike, value: T) => void;
102
115
  /**
103
116
  * Removes a value from an array field.
104
- * @param name The array field name.
105
- * @param index The index of the value to remove.
106
117
  * @example
107
118
  * store.removeValue("tags", 0);
108
119
  * store.removeValue("tags", 1);
@@ -111,7 +122,8 @@ export interface FormStoreFunctions<T extends FormStoreValues = FormStoreValues>
111
122
  */
112
123
  removeValue: (name: StringLike, index: number) => void;
113
124
  /**
114
- * Sets the `errors` state.
125
+ * Sets the [`errors`](https://ariakit.org/reference/form-provider#errors)
126
+ * state.
115
127
  * @example
116
128
  * store.setErrors({ name: "Name is required" });
117
129
  * store.setErrors((errors) => ({ ...errors, name: "Name is required" }));
@@ -119,7 +131,6 @@ export interface FormStoreFunctions<T extends FormStoreValues = FormStoreValues>
119
131
  setErrors: SetState<FormStoreState<T>["errors"]>;
120
132
  /**
121
133
  * Retrieves a field error.
122
- * @param name The field name.
123
134
  * @example
124
135
  * const nameError = store.getError("name");
125
136
  * // Can also use store.names for type-safety.
@@ -128,8 +139,9 @@ export interface FormStoreFunctions<T extends FormStoreValues = FormStoreValues>
128
139
  getError: (name: StringLike) => ErrorMessage;
129
140
  /**
130
141
  * Sets a field error.
131
- * @param name The field name.
132
- * @param error The field error.
142
+ *
143
+ * Live examples:
144
+ * - [FormRadio](https://ariakit.org/examples/form-radio)
133
145
  * @example
134
146
  * store.setError("name", "Name is required");
135
147
  * store.setError("name", (error) => error + "!");
@@ -138,7 +150,8 @@ export interface FormStoreFunctions<T extends FormStoreValues = FormStoreValues>
138
150
  */
139
151
  setError: (name: StringLike, error: SetStateAction<ErrorMessage>) => void;
140
152
  /**
141
- * Sets the `touched` state.
153
+ * Sets the [`touched`](https://ariakit.org/reference/form-provider#touched)
154
+ * state.
142
155
  * @example
143
156
  * store.setTouched({ name: true });
144
157
  * store.setTouched((touched) => ({ ...touched, name: true }));
@@ -146,7 +159,6 @@ export interface FormStoreFunctions<T extends FormStoreValues = FormStoreValues>
146
159
  setTouched: SetState<FormStoreState<T>["touched"]>;
147
160
  /**
148
161
  * Retrieves a field touched state.
149
- * @param name The field name.
150
162
  * @example
151
163
  * const nameTouched = store.getFieldTouched("name");
152
164
  * // Can also use store.names for type-safety.
@@ -155,8 +167,6 @@ export interface FormStoreFunctions<T extends FormStoreValues = FormStoreValues>
155
167
  getFieldTouched: (name: StringLike) => boolean;
156
168
  /**
157
169
  * Sets a field touched state.
158
- * @param name The field name.
159
- * @param value The field touched state.
160
170
  * @example
161
171
  * store.setFieldTouched("name", true);
162
172
  * store.setFieldTouched("name", (value) => !value);
@@ -166,9 +176,8 @@ export interface FormStoreFunctions<T extends FormStoreValues = FormStoreValues>
166
176
  setFieldTouched: (name: StringLike, value: SetStateAction<boolean>) => void;
167
177
  /**
168
178
  * Function that accepts a callback that will be used to validate the form
169
- * when `validate` is called. It returns a cleanup function that will remove
170
- * the callback.
171
- * @param callback The callback function.
179
+ * when [`validate`](https://ariakit.org/reference/use-form-store#validate) is
180
+ * called. It returns a cleanup function that will remove the callback.
172
181
  * @example
173
182
  * const cleanup = store.onValidate(async (state) => {
174
183
  * const errors = await api.validate(state.values);
@@ -179,9 +188,9 @@ export interface FormStoreFunctions<T extends FormStoreValues = FormStoreValues>
179
188
  */
180
189
  onValidate: (callback: FormStoreCallback<FormStoreState<T>>) => void;
181
190
  /**
182
- * Function that accepts a callback that will be used to submit the form
183
- * when `submit` is called. It returns a cleanup function that will remove
184
- * the callback.
191
+ * Function that accepts a callback that will be used to submit the form when
192
+ * [`submit`](https://ariakit.org/reference/use-form-store#submit) is called.
193
+ * It returns a cleanup function that will remove the callback.
185
194
  * @param callback The callback function.
186
195
  * @example
187
196
  * const cleanup = store.onSubmit(async (state) => {
@@ -19,6 +19,10 @@ export interface FormStoreItem extends CollectionStoreItem {
19
19
  export interface FormStoreState<T extends FormStoreValues = FormStoreValues> extends CollectionStoreState<FormStoreItem> {
20
20
  /**
21
21
  * Form values.
22
+ *
23
+ * Live examples:
24
+ * - [FormRadio](https://ariakit.org/examples/form-radio)
25
+ * - [FormSelect](https://ariakit.org/examples/form-select)
22
26
  * @default {}
23
27
  */
24
28
  values: T;
@@ -43,18 +47,25 @@ export interface FormStoreState<T extends FormStoreValues = FormStoreValues> ext
43
47
  */
44
48
  submitting: boolean;
45
49
  /**
46
- * The number of times `form.submit` has been called with a successful
47
- * response.
50
+ * The number of times
51
+ * [`submit`](https://ariakit.org/reference/use-form-store#submit) has been
52
+ * called with a successful response.
48
53
  */
49
54
  submitSucceed: number;
50
55
  /**
51
- * The number of times `form.submit` has been called with an error response.
56
+ * The number of times
57
+ * [`submit`](https://ariakit.org/reference/use-form-store#submit) has been
58
+ * called with an error response.
52
59
  */
53
60
  submitFailed: number;
54
61
  }
55
62
  export interface FormStoreFunctions<T extends FormStoreValues = FormStoreValues> extends CollectionStoreFunctions<FormStoreItem> {
56
63
  /**
57
64
  * An object containing the names of the form fields for type-safety.
65
+ *
66
+ * Live examples:
67
+ * - [FormRadio](https://ariakit.org/examples/form-radio)
68
+ * - [FormSelect](https://ariakit.org/examples/form-select)
58
69
  * @example
59
70
  * store.names.name; // "name"
60
71
  * store.names.name.first; // "name.first"
@@ -62,7 +73,8 @@ export interface FormStoreFunctions<T extends FormStoreValues = FormStoreValues>
62
73
  */
63
74
  names: Names<T>;
64
75
  /**
65
- * Sets the `values` state.
76
+ * Sets the [`values`](https://ariakit.org/reference/form-provider#values)
77
+ * state.
66
78
  * @example
67
79
  * store.setValues({ name: "John" });
68
80
  * store.setValues((values) => ({ ...values, name: "John" }));
@@ -70,7 +82,9 @@ export interface FormStoreFunctions<T extends FormStoreValues = FormStoreValues>
70
82
  setValues: SetState<FormStoreState<T>["values"]>;
71
83
  /**
72
84
  * Retrieves a field value.
73
- * @param name The field name.
85
+ *
86
+ * Live examples:
87
+ * - [FormRadio](https://ariakit.org/examples/form-radio)
74
88
  * @example
75
89
  * const nameValue = store.getValue("name");
76
90
  * // Can also use store.names for type-safety.
@@ -79,8 +93,9 @@ export interface FormStoreFunctions<T extends FormStoreValues = FormStoreValues>
79
93
  getValue: <T = any>(name: StringLike) => T;
80
94
  /**
81
95
  * Sets a field value.
82
- * @param name The field name.
83
- * @param value The field value.
96
+ *
97
+ * Live examples:
98
+ * - [FormSelect](https://ariakit.org/examples/form-select)
84
99
  * @example
85
100
  * store.setValue("name", "John");
86
101
  * store.setValue("name", (value) => value + " Doe");
@@ -90,8 +105,6 @@ export interface FormStoreFunctions<T extends FormStoreValues = FormStoreValues>
90
105
  setValue: <T>(name: StringLike, value: SetStateAction<T>) => void;
91
106
  /**
92
107
  * Pushes a value to an array field.
93
- * @param name The array field name.
94
- * @param value The value to push.
95
108
  * @example
96
109
  * store.pushValue("tags", "new tag");
97
110
  * store.pushValue("tags", { id: 1, name: "new tag" });
@@ -101,8 +114,6 @@ export interface FormStoreFunctions<T extends FormStoreValues = FormStoreValues>
101
114
  pushValue: <T>(name: StringLike, value: T) => void;
102
115
  /**
103
116
  * Removes a value from an array field.
104
- * @param name The array field name.
105
- * @param index The index of the value to remove.
106
117
  * @example
107
118
  * store.removeValue("tags", 0);
108
119
  * store.removeValue("tags", 1);
@@ -111,7 +122,8 @@ export interface FormStoreFunctions<T extends FormStoreValues = FormStoreValues>
111
122
  */
112
123
  removeValue: (name: StringLike, index: number) => void;
113
124
  /**
114
- * Sets the `errors` state.
125
+ * Sets the [`errors`](https://ariakit.org/reference/form-provider#errors)
126
+ * state.
115
127
  * @example
116
128
  * store.setErrors({ name: "Name is required" });
117
129
  * store.setErrors((errors) => ({ ...errors, name: "Name is required" }));
@@ -119,7 +131,6 @@ export interface FormStoreFunctions<T extends FormStoreValues = FormStoreValues>
119
131
  setErrors: SetState<FormStoreState<T>["errors"]>;
120
132
  /**
121
133
  * Retrieves a field error.
122
- * @param name The field name.
123
134
  * @example
124
135
  * const nameError = store.getError("name");
125
136
  * // Can also use store.names for type-safety.
@@ -128,8 +139,9 @@ export interface FormStoreFunctions<T extends FormStoreValues = FormStoreValues>
128
139
  getError: (name: StringLike) => ErrorMessage;
129
140
  /**
130
141
  * Sets a field error.
131
- * @param name The field name.
132
- * @param error The field error.
142
+ *
143
+ * Live examples:
144
+ * - [FormRadio](https://ariakit.org/examples/form-radio)
133
145
  * @example
134
146
  * store.setError("name", "Name is required");
135
147
  * store.setError("name", (error) => error + "!");
@@ -138,7 +150,8 @@ export interface FormStoreFunctions<T extends FormStoreValues = FormStoreValues>
138
150
  */
139
151
  setError: (name: StringLike, error: SetStateAction<ErrorMessage>) => void;
140
152
  /**
141
- * Sets the `touched` state.
153
+ * Sets the [`touched`](https://ariakit.org/reference/form-provider#touched)
154
+ * state.
142
155
  * @example
143
156
  * store.setTouched({ name: true });
144
157
  * store.setTouched((touched) => ({ ...touched, name: true }));
@@ -146,7 +159,6 @@ export interface FormStoreFunctions<T extends FormStoreValues = FormStoreValues>
146
159
  setTouched: SetState<FormStoreState<T>["touched"]>;
147
160
  /**
148
161
  * Retrieves a field touched state.
149
- * @param name The field name.
150
162
  * @example
151
163
  * const nameTouched = store.getFieldTouched("name");
152
164
  * // Can also use store.names for type-safety.
@@ -155,8 +167,6 @@ export interface FormStoreFunctions<T extends FormStoreValues = FormStoreValues>
155
167
  getFieldTouched: (name: StringLike) => boolean;
156
168
  /**
157
169
  * Sets a field touched state.
158
- * @param name The field name.
159
- * @param value The field touched state.
160
170
  * @example
161
171
  * store.setFieldTouched("name", true);
162
172
  * store.setFieldTouched("name", (value) => !value);
@@ -166,9 +176,8 @@ export interface FormStoreFunctions<T extends FormStoreValues = FormStoreValues>
166
176
  setFieldTouched: (name: StringLike, value: SetStateAction<boolean>) => void;
167
177
  /**
168
178
  * Function that accepts a callback that will be used to validate the form
169
- * when `validate` is called. It returns a cleanup function that will remove
170
- * the callback.
171
- * @param callback The callback function.
179
+ * when [`validate`](https://ariakit.org/reference/use-form-store#validate) is
180
+ * called. It returns a cleanup function that will remove the callback.
172
181
  * @example
173
182
  * const cleanup = store.onValidate(async (state) => {
174
183
  * const errors = await api.validate(state.values);
@@ -179,9 +188,9 @@ export interface FormStoreFunctions<T extends FormStoreValues = FormStoreValues>
179
188
  */
180
189
  onValidate: (callback: FormStoreCallback<FormStoreState<T>>) => void;
181
190
  /**
182
- * Function that accepts a callback that will be used to submit the form
183
- * when `submit` is called. It returns a cleanup function that will remove
184
- * the callback.
191
+ * Function that accepts a callback that will be used to submit the form when
192
+ * [`submit`](https://ariakit.org/reference/use-form-store#submit) is called.
193
+ * It returns a cleanup function that will remove the callback.
185
194
  * @param callback The callback function.
186
195
  * @example
187
196
  * const cleanup = store.onSubmit(async (state) => {
@@ -1,13 +1,13 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});"use client";
2
2
 
3
3
 
4
- var _5SIVMOIDcjs = require('../__chunks/5SIVMOID.cjs');
5
- require('../__chunks/EFIT5L4X.cjs');
6
- require('../__chunks/2LS4JJ4S.cjs');
7
- require('../__chunks/GJFZ5ZPP.cjs');
8
- require('../__chunks/2UK5WUJX.cjs');
4
+ var _HMO4CKUPcjs = require('../__chunks/HMO4CKUP.cjs');
5
+ require('../__chunks/Y6PHIDP6.cjs');
6
+ require('../__chunks/MFSCSSBJ.cjs');
7
+ require('../__chunks/MWNFQD55.cjs');
8
+ require('../__chunks/5CBCKBZ2.cjs');
9
9
  require('../__chunks/3UT5FE6K.cjs');
10
10
  require('../__chunks/AV6KTKLE.cjs');
11
11
 
12
12
 
13
- exports.createHovercardStore = _5SIVMOIDcjs.createHovercardStore;
13
+ exports.createHovercardStore = _HMO4CKUPcjs.createHovercardStore;
@@ -1,10 +1,10 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});"use client";
2
2
 
3
3
 
4
- var _UTICNXSTcjs = require('../__chunks/UTICNXST.cjs');
5
- require('../__chunks/JNFZSNOI.cjs');
6
- require('../__chunks/UCLKUBNP.cjs');
7
- require('../__chunks/2UK5WUJX.cjs');
4
+ var _CWDUO5EVcjs = require('../__chunks/CWDUO5EV.cjs');
5
+ require('../__chunks/ZXCB7MXN.cjs');
6
+ require('../__chunks/YLMJBIQM.cjs');
7
+ require('../__chunks/5CBCKBZ2.cjs');
8
8
  require('../__chunks/3UT5FE6K.cjs');
9
9
  require('../__chunks/5F4DVUNS.cjs');
10
10
  require('../__chunks/ULSPM3Y3.cjs');
@@ -12,7 +12,7 @@ require('../__chunks/AV6KTKLE.cjs');
12
12
 
13
13
  // src/menu/menu-bar-store.ts
14
14
  function createMenuBarStore(props = {}) {
15
- return _UTICNXSTcjs.createMenubarStore.call(void 0, props);
15
+ return _CWDUO5EVcjs.createMenubarStore.call(void 0, props);
16
16
  }
17
17
 
18
18
 
@@ -1,14 +1,14 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});"use client";
2
2
 
3
3
 
4
- var _5SIVMOIDcjs = require('../__chunks/5SIVMOID.cjs');
5
- require('../__chunks/EFIT5L4X.cjs');
6
- require('../__chunks/2LS4JJ4S.cjs');
7
- require('../__chunks/GJFZ5ZPP.cjs');
4
+ var _HMO4CKUPcjs = require('../__chunks/HMO4CKUP.cjs');
5
+ require('../__chunks/Y6PHIDP6.cjs');
6
+ require('../__chunks/MFSCSSBJ.cjs');
7
+ require('../__chunks/MWNFQD55.cjs');
8
8
 
9
9
 
10
- var _JNFZSNOIcjs = require('../__chunks/JNFZSNOI.cjs');
11
- require('../__chunks/UCLKUBNP.cjs');
10
+ var _ZXCB7MXNcjs = require('../__chunks/ZXCB7MXN.cjs');
11
+ require('../__chunks/YLMJBIQM.cjs');
12
12
 
13
13
 
14
14
 
@@ -17,7 +17,7 @@ require('../__chunks/UCLKUBNP.cjs');
17
17
 
18
18
 
19
19
 
20
- var _2UK5WUJXcjs = require('../__chunks/2UK5WUJX.cjs');
20
+ var _5CBCKBZ2cjs = require('../__chunks/5CBCKBZ2.cjs');
21
21
 
22
22
 
23
23
 
@@ -42,10 +42,10 @@ function createMenuStore(_a = {}) {
42
42
  "menubar"
43
43
  ]);
44
44
  const parentIsMenubar = !!menubar && !parent;
45
- const store = _2UK5WUJXcjs.mergeStore.call(void 0,
45
+ const store = _5CBCKBZ2cjs.mergeStore.call(void 0,
46
46
  props.store,
47
- _2UK5WUJXcjs.pick.call(void 0, parent, ["values"]),
48
- _2UK5WUJXcjs.omit.call(void 0, combobox, [
47
+ _5CBCKBZ2cjs.pick.call(void 0, parent, ["values"]),
48
+ _5CBCKBZ2cjs.omit.call(void 0, combobox, [
49
49
  "arrowElement",
50
50
  "anchorElement",
51
51
  "contentElement",
@@ -53,9 +53,9 @@ function createMenuStore(_a = {}) {
53
53
  "disclosureElement"
54
54
  ])
55
55
  );
56
- _2UK5WUJXcjs.throwOnConflictingProps.call(void 0, props, store);
56
+ _5CBCKBZ2cjs.throwOnConflictingProps.call(void 0, props, store);
57
57
  const syncState = store.getState();
58
- const composite = _JNFZSNOIcjs.createCompositeStore.call(void 0, _AV6KTKLEcjs.__spreadProps.call(void 0, _AV6KTKLEcjs.__spreadValues.call(void 0, {}, props), {
58
+ const composite = _ZXCB7MXNcjs.createCompositeStore.call(void 0, _AV6KTKLEcjs.__spreadProps.call(void 0, _AV6KTKLEcjs.__spreadValues.call(void 0, {}, props), {
59
59
  store,
60
60
  orientation: _3UT5FE6Kcjs.defaultValue.call(void 0,
61
61
  props.orientation,
@@ -63,7 +63,7 @@ function createMenuStore(_a = {}) {
63
63
  "vertical"
64
64
  )
65
65
  }));
66
- const hovercard = _5SIVMOIDcjs.createHovercardStore.call(void 0, _AV6KTKLEcjs.__spreadProps.call(void 0, _AV6KTKLEcjs.__spreadValues.call(void 0, {}, props), {
66
+ const hovercard = _HMO4CKUPcjs.createHovercardStore.call(void 0, _AV6KTKLEcjs.__spreadProps.call(void 0, _AV6KTKLEcjs.__spreadValues.call(void 0, {}, props), {
67
67
  store,
68
68
  placement: _3UT5FE6Kcjs.defaultValue.call(void 0,
69
69
  props.placement,
@@ -86,18 +86,18 @@ function createMenuStore(_a = {}) {
86
86
  {}
87
87
  )
88
88
  });
89
- const menu = _2UK5WUJXcjs.createStore.call(void 0, initialState, composite, hovercard, store);
90
- _2UK5WUJXcjs.setup.call(void 0,
89
+ const menu = _5CBCKBZ2cjs.createStore.call(void 0, initialState, composite, hovercard, store);
90
+ _5CBCKBZ2cjs.setup.call(void 0,
91
91
  menu,
92
- () => _2UK5WUJXcjs.sync.call(void 0, menu, ["mounted"], (state) => {
92
+ () => _5CBCKBZ2cjs.sync.call(void 0, menu, ["mounted"], (state) => {
93
93
  if (state.mounted)
94
94
  return;
95
95
  menu.setState("activeId", null);
96
96
  })
97
97
  );
98
- _2UK5WUJXcjs.setup.call(void 0,
98
+ _5CBCKBZ2cjs.setup.call(void 0,
99
99
  menu,
100
- () => _2UK5WUJXcjs.sync.call(void 0, parent, ["orientation"], (state) => {
100
+ () => _5CBCKBZ2cjs.sync.call(void 0, parent, ["orientation"], (state) => {
101
101
  menu.setState(
102
102
  "placement",
103
103
  state.orientation === "vertical" ? "right-start" : "bottom-start"
@@ -1,14 +1,14 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});"use client";
2
2
 
3
3
 
4
- var _UTICNXSTcjs = require('../__chunks/UTICNXST.cjs');
5
- require('../__chunks/JNFZSNOI.cjs');
6
- require('../__chunks/UCLKUBNP.cjs');
7
- require('../__chunks/2UK5WUJX.cjs');
4
+ var _CWDUO5EVcjs = require('../__chunks/CWDUO5EV.cjs');
5
+ require('../__chunks/ZXCB7MXN.cjs');
6
+ require('../__chunks/YLMJBIQM.cjs');
7
+ require('../__chunks/5CBCKBZ2.cjs');
8
8
  require('../__chunks/3UT5FE6K.cjs');
9
9
  require('../__chunks/5F4DVUNS.cjs');
10
10
  require('../__chunks/ULSPM3Y3.cjs');
11
11
  require('../__chunks/AV6KTKLE.cjs');
12
12
 
13
13
 
14
- exports.createMenubarStore = _UTICNXSTcjs.createMenubarStore;
14
+ exports.createMenubarStore = _CWDUO5EVcjs.createMenubarStore;
@@ -1,12 +1,12 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});"use client";
2
2
 
3
3
 
4
- var _EFIT5L4Xcjs = require('../__chunks/EFIT5L4X.cjs');
5
- require('../__chunks/2LS4JJ4S.cjs');
6
- require('../__chunks/GJFZ5ZPP.cjs');
7
- require('../__chunks/2UK5WUJX.cjs');
4
+ var _Y6PHIDP6cjs = require('../__chunks/Y6PHIDP6.cjs');
5
+ require('../__chunks/MFSCSSBJ.cjs');
6
+ require('../__chunks/MWNFQD55.cjs');
7
+ require('../__chunks/5CBCKBZ2.cjs');
8
8
  require('../__chunks/3UT5FE6K.cjs');
9
9
  require('../__chunks/AV6KTKLE.cjs');
10
10
 
11
11
 
12
- exports.createPopoverStore = _EFIT5L4Xcjs.createPopoverStore;
12
+ exports.createPopoverStore = _Y6PHIDP6cjs.createPopoverStore;
@@ -1,11 +1,11 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});"use client";
2
2
 
3
3
 
4
- var _JNFZSNOIcjs = require('../__chunks/JNFZSNOI.cjs');
5
- require('../__chunks/UCLKUBNP.cjs');
4
+ var _ZXCB7MXNcjs = require('../__chunks/ZXCB7MXN.cjs');
5
+ require('../__chunks/YLMJBIQM.cjs');
6
6
 
7
7
 
8
- var _2UK5WUJXcjs = require('../__chunks/2UK5WUJX.cjs');
8
+ var _5CBCKBZ2cjs = require('../__chunks/5CBCKBZ2.cjs');
9
9
 
10
10
 
11
11
  var _3UT5FE6Kcjs = require('../__chunks/3UT5FE6K.cjs');
@@ -22,7 +22,7 @@ function createRadioStore(_a = {}) {
22
22
  var props = _AV6KTKLEcjs.__objRest.call(void 0, _a, []);
23
23
  var _a2;
24
24
  const syncState = (_a2 = props.store) == null ? void 0 : _a2.getState();
25
- const composite = _JNFZSNOIcjs.createCompositeStore.call(void 0, _AV6KTKLEcjs.__spreadProps.call(void 0, _AV6KTKLEcjs.__spreadValues.call(void 0, {}, props), {
25
+ const composite = _ZXCB7MXNcjs.createCompositeStore.call(void 0, _AV6KTKLEcjs.__spreadProps.call(void 0, _AV6KTKLEcjs.__spreadValues.call(void 0, {}, props), {
26
26
  focusLoop: _3UT5FE6Kcjs.defaultValue.call(void 0, props.focusLoop, syncState == null ? void 0 : syncState.focusLoop, true)
27
27
  }));
28
28
  const initialState = _AV6KTKLEcjs.__spreadProps.call(void 0, _AV6KTKLEcjs.__spreadValues.call(void 0, {}, composite.getState()), {
@@ -33,7 +33,7 @@ function createRadioStore(_a = {}) {
33
33
  null
34
34
  )
35
35
  });
36
- const radio = _2UK5WUJXcjs.createStore.call(void 0, initialState, composite, props.store);
36
+ const radio = _5CBCKBZ2cjs.createStore.call(void 0, initialState, composite, props.store);
37
37
  return _AV6KTKLEcjs.__spreadProps.call(void 0, _AV6KTKLEcjs.__spreadValues.call(void 0, _AV6KTKLEcjs.__spreadValues.call(void 0, {}, composite), radio), {
38
38
  setValue: (value) => radio.setState("value", value)
39
39
  });