@ariakit/core 0.4.18 → 0.4.19

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 (126) hide show
  1. package/CHANGELOG.md +5 -0
  2. package/cjs/__chunks/{MJNGPYVQ.cjs → 2RUCRSRF.cjs} +16 -16
  3. package/cjs/__chunks/{6BYUUR4M.cjs → 4TRESXTO.cjs} +7 -1
  4. package/cjs/__chunks/{AOXAROPF.cjs → 75F3RDBE.cjs} +14 -14
  5. package/cjs/__chunks/{SHOLYDNP.cjs → CTEQSOKZ.cjs} +2 -2
  6. package/cjs/__chunks/{T247D7JS.cjs → CVLMIMPT.cjs} +2 -2
  7. package/cjs/__chunks/{JNPL5IHP.cjs → G2CSOTWZ.cjs} +7 -7
  8. package/cjs/__chunks/{4ITB54IT.cjs → I4CBIWTX.cjs} +2 -3
  9. package/cjs/__chunks/{JNYCP2QO.cjs → LS2SNHDM.cjs} +6 -6
  10. package/cjs/__chunks/{UROTDZFK.cjs → R37KOEUW.cjs} +10 -10
  11. package/cjs/__chunks/{OYTZFOIJ.cjs → UGAVMSQJ.cjs} +18 -18
  12. package/cjs/__chunks/{HGVIF2R4.cjs → VC22SYOD.cjs} +24 -21
  13. package/cjs/__chunks/{WPBYRKFQ.cjs → WMTGHDLE.cjs} +15 -15
  14. package/cjs/checkbox/checkbox-store.cjs +5 -5
  15. package/cjs/checkbox/checkbox-store.d.cts +5 -5
  16. package/cjs/checkbox/checkbox-store.d.ts +5 -5
  17. package/cjs/collection/collection-store.cjs +5 -5
  18. package/cjs/collection/collection-store.d.cts +5 -5
  19. package/cjs/collection/collection-store.d.ts +5 -5
  20. package/cjs/combobox/combobox-store.cjs +40 -40
  21. package/cjs/combobox/combobox-store.d.cts +26 -26
  22. package/cjs/combobox/combobox-store.d.ts +26 -26
  23. package/cjs/composite/composite-overflow-store.cjs +6 -6
  24. package/cjs/composite/composite-store.cjs +6 -6
  25. package/cjs/composite/composite-store.d.cts +62 -54
  26. package/cjs/composite/composite-store.d.ts +62 -54
  27. package/cjs/dialog/dialog-store.cjs +5 -5
  28. package/cjs/disclosure/disclosure-store.cjs +4 -4
  29. package/cjs/disclosure/disclosure-store.d.cts +22 -22
  30. package/cjs/disclosure/disclosure-store.d.ts +22 -22
  31. package/cjs/form/form-store.cjs +41 -37
  32. package/cjs/form/form-store.d.cts +14 -14
  33. package/cjs/form/form-store.d.ts +14 -14
  34. package/cjs/hovercard/hovercard-store.cjs +7 -7
  35. package/cjs/hovercard/hovercard-store.d.cts +10 -10
  36. package/cjs/hovercard/hovercard-store.d.ts +10 -10
  37. package/cjs/menu/menu-bar-store.cjs +7 -7
  38. package/cjs/menu/menu-store.cjs +27 -27
  39. package/cjs/menu/menu-store.d.cts +10 -10
  40. package/cjs/menu/menu-store.d.ts +10 -10
  41. package/cjs/menubar/menubar-store.cjs +7 -7
  42. package/cjs/popover/popover-store.cjs +6 -6
  43. package/cjs/popover/popover-store.d.cts +17 -17
  44. package/cjs/popover/popover-store.d.ts +17 -17
  45. package/cjs/radio/radio-store.cjs +9 -9
  46. package/cjs/radio/radio-store.d.cts +1 -1
  47. package/cjs/radio/radio-store.d.ts +1 -1
  48. package/cjs/select/select-store.cjs +32 -32
  49. package/cjs/select/select-store.d.cts +17 -17
  50. package/cjs/select/select-store.d.ts +17 -17
  51. package/cjs/tab/tab-store.cjs +32 -32
  52. package/cjs/tab/tab-store.d.cts +20 -20
  53. package/cjs/tab/tab-store.d.ts +20 -20
  54. package/cjs/tag/tag-store.cjs +16 -16
  55. package/cjs/tag/tag-store.d.cts +5 -5
  56. package/cjs/tag/tag-store.d.ts +5 -5
  57. package/cjs/toolbar/toolbar-store.cjs +8 -8
  58. package/cjs/tooltip/tooltip-store.cjs +13 -13
  59. package/cjs/utils/dom.cjs +2 -2
  60. package/cjs/utils/events.cjs +6 -6
  61. package/cjs/utils/focus.cjs +12 -13
  62. package/cjs/utils/misc.cjs +4 -2
  63. package/cjs/utils/misc.d.cts +4 -0
  64. package/cjs/utils/misc.d.ts +4 -0
  65. package/cjs/utils/platform.cjs +3 -3
  66. package/cjs/utils/store.cjs +3 -3
  67. package/cjs/utils/store.d.cts +1 -1
  68. package/cjs/utils/store.d.ts +1 -1
  69. package/cjs/utils/undo.cjs +2 -2
  70. package/esm/__chunks/{KMAUV3TY.js → 7KNZCZ55.js} +1 -1
  71. package/esm/__chunks/{3DNM6L6E.js → G7XPWBXK.js} +1 -2
  72. package/esm/__chunks/{SNHYQNEZ.js → GMGLSF2B.js} +1 -1
  73. package/esm/__chunks/{WSDJ6ZRB.js → H7R2CY4Q.js} +3 -3
  74. package/esm/__chunks/{75BJEVSH.js → IHNLLH3I.js} +2 -2
  75. package/esm/__chunks/{N5XGANPW.js → KZX46JDB.js} +11 -8
  76. package/esm/__chunks/{BFGNM53A.js → MJ4ZJEIM.js} +5 -5
  77. package/esm/__chunks/{TIQDSBWP.js → TEVO2DMI.js} +3 -3
  78. package/esm/__chunks/{7LM4Q2XB.js → U4NM2NCP.js} +1 -1
  79. package/esm/__chunks/{RVTIKFRL.js → UNDE2QJS.js} +3 -3
  80. package/esm/__chunks/{XMCVU3LR.js → UWJK2WK2.js} +6 -0
  81. package/esm/__chunks/{SXKM4CGU.js → XTZ53NXG.js} +4 -4
  82. package/esm/checkbox/checkbox-store.d.ts +5 -5
  83. package/esm/checkbox/checkbox-store.js +2 -2
  84. package/esm/collection/collection-store.d.ts +5 -5
  85. package/esm/collection/collection-store.js +4 -4
  86. package/esm/combobox/combobox-store.d.ts +26 -26
  87. package/esm/combobox/combobox-store.js +9 -9
  88. package/esm/composite/composite-overflow-store.js +5 -5
  89. package/esm/composite/composite-store.d.ts +62 -54
  90. package/esm/composite/composite-store.js +5 -5
  91. package/esm/dialog/dialog-store.js +4 -4
  92. package/esm/disclosure/disclosure-store.d.ts +22 -22
  93. package/esm/disclosure/disclosure-store.js +3 -3
  94. package/esm/form/form-store.d.ts +14 -14
  95. package/esm/form/form-store.js +19 -15
  96. package/esm/hovercard/hovercard-store.d.ts +10 -10
  97. package/esm/hovercard/hovercard-store.js +6 -6
  98. package/esm/menu/menu-bar-store.js +6 -6
  99. package/esm/menu/menu-store.d.ts +10 -10
  100. package/esm/menu/menu-store.js +9 -9
  101. package/esm/menubar/menubar-store.js +6 -6
  102. package/esm/popover/popover-store.d.ts +17 -17
  103. package/esm/popover/popover-store.js +5 -5
  104. package/esm/radio/radio-store.d.ts +1 -1
  105. package/esm/radio/radio-store.js +5 -5
  106. package/esm/select/select-store.d.ts +17 -17
  107. package/esm/select/select-store.js +8 -8
  108. package/esm/tab/tab-store.d.ts +20 -20
  109. package/esm/tab/tab-store.js +5 -5
  110. package/esm/tag/tag-store.d.ts +5 -5
  111. package/esm/tag/tag-store.js +7 -7
  112. package/esm/toolbar/toolbar-store.js +5 -5
  113. package/esm/tooltip/tooltip-store.js +7 -7
  114. package/esm/utils/dom.js +1 -1
  115. package/esm/utils/events.js +4 -4
  116. package/esm/utils/focus.js +2 -3
  117. package/esm/utils/misc.d.ts +4 -0
  118. package/esm/utils/misc.js +3 -1
  119. package/esm/utils/platform.js +2 -2
  120. package/esm/utils/store.d.ts +1 -1
  121. package/esm/utils/store.js +2 -2
  122. package/esm/utils/undo.js +1 -1
  123. package/package.json +20 -21
  124. package/tsconfig.build.json +7 -2
  125. package/tsconfig.node.json +5 -0
  126. package/tsconfig.test.json +5 -0
@@ -17,7 +17,7 @@ export interface CompositeStoreItem extends CollectionStoreItem {
17
17
  /**
18
18
  * The row id of the item. This is only used on two-dimensional composite
19
19
  * widgets (when using
20
- * [`CompositeRow`](https://ariakit.org/reference/composite-row)).
20
+ * [`CompositeRow`](https://ariakit.com/reference/composite-row)).
21
21
  */
22
22
  rowId?: string;
23
23
  /**
@@ -42,7 +42,7 @@ export interface CompositeStoreState<T extends CompositeStoreItem = CompositeSto
42
42
  * contains composite items. However, in a combobox, it's the input element.
43
43
  *
44
44
  * Live examples:
45
- * - [Sliding Menu](https://ariakit.org/examples/menu-slide)
45
+ * - [Sliding Menu](https://ariakit.com/examples/menu-slide)
46
46
  */
47
47
  baseElement: HTMLElement | null;
48
48
  /**
@@ -54,12 +54,12 @@ export interface CompositeStoreState<T extends CompositeStoreItem = CompositeSto
54
54
  * virtual focus.
55
55
  *
56
56
  * In both scenarios, the item in focus will carry the
57
- * [`data-active-item`](https://ariakit.org/guide/styling#data-active-item)
57
+ * [`data-active-item`](https://ariakit.com/guide/styling#data-active-item)
58
58
  * attribute.
59
59
  *
60
60
  * Live examples:
61
61
  * - [Select with Combobox and
62
- * Tabs](https://ariakit.org/examples/select-combobox-tab)
62
+ * Tabs](https://ariakit.com/examples/select-combobox-tab)
63
63
  * @default false
64
64
  */
65
65
  virtualFocus: boolean;
@@ -77,8 +77,8 @@ export interface CompositeStoreState<T extends CompositeStoreItem = CompositeSto
77
77
  orientation: Orientation;
78
78
  /**
79
79
  * Determines how the
80
- * [`next`](https://ariakit.org/reference/use-composite-store#next) and
81
- * [`previous`](https://ariakit.org/reference/use-composite-store#previous)
80
+ * [`next`](https://ariakit.com/reference/use-composite-store#next) and
81
+ * [`previous`](https://ariakit.com/reference/use-composite-store#previous)
82
82
  * functions will behave. If `rtl` is set to `true`, they will be inverted.
83
83
  *
84
84
  * This only affects the composite widget behavior. You still need to set
@@ -93,21 +93,21 @@ export interface CompositeStoreState<T extends CompositeStoreItem = CompositeSto
93
93
  * On one-dimensional composite widgets:
94
94
  * - `true` loops from the last item to the first item and vice-versa.
95
95
  * - `horizontal` loops only if
96
- * [`orientation`](https://ariakit.org/reference/composite-provider#orientation)
96
+ * [`orientation`](https://ariakit.com/reference/composite-provider#orientation)
97
97
  * is `horizontal` or not set.
98
98
  * - `vertical` loops only if
99
- * [`orientation`](https://ariakit.org/reference/composite-provider#orientation)
99
+ * [`orientation`](https://ariakit.com/reference/composite-provider#orientation)
100
100
  * is `vertical` or not set.
101
101
  * - If
102
- * [`includesBaseElement`](https://ariakit.org/reference/composite-provider#includesbaseelement)
102
+ * [`includesBaseElement`](https://ariakit.com/reference/composite-provider#includesbaseelement)
103
103
  * is set to `true` (or
104
- * [`activeId`](https://ariakit.org/reference/composite-provider#activeid)
104
+ * [`activeId`](https://ariakit.com/reference/composite-provider#activeid)
105
105
  * is initially set to `null`), the composite element will be focused in
106
106
  * between the last and first items.
107
107
  *
108
108
  * On two-dimensional composite widgets (when using
109
- * [`CompositeRow`](https://ariakit.org/reference/composite-row) or explicitly
110
- * passing a [`rowId`](https://ariakit.org/reference/composite-item#rowid)
109
+ * [`CompositeRow`](https://ariakit.com/reference/composite-row) or explicitly
110
+ * passing a [`rowId`](https://ariakit.com/reference/composite-item#rowid)
111
111
  * prop to composite items):
112
112
  * - `true` loops from the last row/column item to the first item in the same
113
113
  * row/column and vice-versa. If it's the last item in the last row, it
@@ -117,22 +117,22 @@ export interface CompositeStoreState<T extends CompositeStoreItem = CompositeSto
117
117
  * - `vertical` loops only from the last column item to the first item in the
118
118
  * column row.
119
119
  * - If
120
- * [`includesBaseElement`](https://ariakit.org/reference/composite-provider#includesbaseelement)
120
+ * [`includesBaseElement`](https://ariakit.com/reference/composite-provider#includesbaseelement)
121
121
  * is set to `true` (or
122
- * [`activeId`](https://ariakit.org/reference/composite-provider#activeid)
122
+ * [`activeId`](https://ariakit.com/reference/composite-provider#activeid)
123
123
  * is initially set to `null`), vertical loop will have no effect as moving
124
124
  * down from the last row or up from the first row will focus on the
125
125
  * composite element.
126
126
  * - If
127
- * [`focusWrap`](https://ariakit.org/reference/composite-provider#focuswrap)
127
+ * [`focusWrap`](https://ariakit.com/reference/composite-provider#focuswrap)
128
128
  * matches the value of `focusLoop`, it'll wrap between the last item in the
129
129
  * last row or column and the first item in the first row or column and
130
130
  * vice-versa.
131
131
  *
132
132
  * Live examples:
133
- * - [Command Menu](https://ariakit.org/examples/dialog-combobox-command-menu)
133
+ * - [Command Menu](https://ariakit.com/examples/dialog-combobox-command-menu)
134
134
  * - [Command Menu with
135
- * Tabs](https://ariakit.org/examples/dialog-combobox-tab-command-menu)
135
+ * Tabs](https://ariakit.com/examples/dialog-combobox-tab-command-menu)
136
136
  * @default false
137
137
  */
138
138
  focusLoop: boolean | Orientation;
@@ -145,14 +145,14 @@ export interface CompositeStoreState<T extends CompositeStoreItem = CompositeSto
145
145
  * - `horizontal` wraps only between rows.
146
146
  * - `vertical` wraps only between columns.
147
147
  * - If
148
- * [`focusLoop`](https://ariakit.org/reference/composite-provider#focusloop)
148
+ * [`focusLoop`](https://ariakit.com/reference/composite-provider#focusloop)
149
149
  * matches the value of `focusWrap`, it'll wrap between the last item in the
150
150
  * last row or column and the first item in the first row or column and
151
151
  * vice-versa.
152
152
  *
153
153
  * Live examples:
154
154
  * - [Command Menu with
155
- * Tabs](https://ariakit.org/examples/dialog-combobox-tab-command-menu)
155
+ * Tabs](https://ariakit.com/examples/dialog-combobox-tab-command-menu)
156
156
  * @default false
157
157
  */
158
158
  focusWrap: boolean | Orientation;
@@ -164,13 +164,13 @@ export interface CompositeStoreState<T extends CompositeStoreItem = CompositeSto
164
164
  *
165
165
  * Live examples:
166
166
  * - [Command Menu with
167
- * Tabs](https://ariakit.org/examples/dialog-combobox-tab-command-menu)
167
+ * Tabs](https://ariakit.com/examples/dialog-combobox-tab-command-menu)
168
168
  * @default false
169
169
  */
170
170
  focusShift: boolean;
171
171
  /**
172
172
  * The number of times the
173
- * [`move`](https://ariakit.org/reference/use-composite-store#move) function
173
+ * [`move`](https://ariakit.com/reference/use-composite-store#move) function
174
174
  * has been called.
175
175
  */
176
176
  moves: number;
@@ -184,27 +184,27 @@ export interface CompositeStoreState<T extends CompositeStoreItem = CompositeSto
184
184
  *
185
185
  * Live examples:
186
186
  * - [Submenu with
187
- * Combobox](https://ariakit.org/examples/menu-nested-combobox)
188
- * - [Command Menu](https://ariakit.org/examples/dialog-combobox-command-menu)
187
+ * Combobox](https://ariakit.com/examples/menu-nested-combobox)
188
+ * - [Command Menu](https://ariakit.com/examples/dialog-combobox-command-menu)
189
189
  * @default false
190
190
  */
191
191
  includesBaseElement: boolean;
192
192
  /**
193
193
  * The current active item `id`. The active item is the element within the
194
194
  * composite widget that has either DOM or virtual focus (in case
195
- * [`virtualFocus`](https://ariakit.org/reference/composite-provider#virtualfocus)
195
+ * [`virtualFocus`](https://ariakit.com/reference/composite-provider#virtualfocus)
196
196
  * is enabled).
197
197
  * - `null` represents the base composite element (the one with a [composite
198
198
  * role](https://w3c.github.io/aria/#composite)). Users will be able to
199
199
  * navigate out of it using arrow keys.
200
200
  * - If `activeId` is initially set to `null`, the
201
- * [`includesBaseElement`](https://ariakit.org/reference/composite-provider#includesbaseelement)
201
+ * [`includesBaseElement`](https://ariakit.com/reference/composite-provider#includesbaseelement)
202
202
  * prop will also default to `true`, which means the base composite element
203
203
  * itself will have focus and users will be able to navigate to it using
204
204
  * arrow keys.
205
205
  *
206
206
  * Live examples:
207
- * - [Combobox with Tabs](https://ariakit.org/examples/combobox-tabs)
207
+ * - [Combobox with Tabs](https://ariakit.com/examples/combobox-tabs)
208
208
  */
209
209
  activeId: string | null | undefined;
210
210
  }
@@ -215,9 +215,9 @@ export interface CompositeStoreFunctions<T extends CompositeStoreItem = Composit
215
215
  setBaseElement: SetState<CompositeStoreState<T>["baseElement"]>;
216
216
  /**
217
217
  * Sets the
218
- * [`activeId`](https://ariakit.org/reference/composite-provider#activeid)
218
+ * [`activeId`](https://ariakit.com/reference/composite-provider#activeid)
219
219
  * state _without moving focus_. If you want to move focus, use the
220
- * [`move`](https://ariakit.org/reference/use-composite-store#move) function
220
+ * [`move`](https://ariakit.com/reference/use-composite-store#move) function
221
221
  * instead.
222
222
  * @example
223
223
  * // Sets the composite element as the active item
@@ -234,11 +234,11 @@ export interface CompositeStoreFunctions<T extends CompositeStoreItem = Composit
234
234
  * [composite role](https://w3c.github.io/aria/#composite)). Users will be
235
235
  * able to navigate out of it using arrow keys.
236
236
  * - If you want to set the active item id _without moving focus_, use the
237
- * [`setActiveId`](https://ariakit.org/reference/use-composite-store#setactiveid)
237
+ * [`setActiveId`](https://ariakit.com/reference/use-composite-store#setactiveid)
238
238
  * function instead.
239
239
  *
240
240
  * Live examples:
241
- * - [Select Grid](https://ariakit.org/examples/select-grid)
241
+ * - [Select Grid](https://ariakit.com/examples/select-grid)
242
242
  * @example
243
243
  * // Moves focus to the composite element
244
244
  * store.move(null);
@@ -250,52 +250,60 @@ export interface CompositeStoreFunctions<T extends CompositeStoreItem = Composit
250
250
  move: (id?: string | null) => void;
251
251
  /**
252
252
  * Returns the id of the next enabled item based on the current
253
- * [`activeId`](https://ariakit.org/reference/composite-provider#activeid)
253
+ * [`activeId`](https://ariakit.com/reference/composite-provider#activeid)
254
254
  * state. You can pass additional options to override the current state.
255
255
  * @example
256
256
  * const nextId = store.next();
257
257
  */
258
- next(options?: NextOptions): string | null | undefined;
259
- /**
260
- * @deprecated Use the object syntax instead: `next({ skip: 2 })`.
261
- */
262
- next(skip?: number): string | null | undefined;
258
+ next: {
259
+ (options?: NextOptions): string | null | undefined;
260
+ /**
261
+ * @deprecated Use the object syntax instead: `next({ skip: 2 })`.
262
+ */
263
+ (skip?: number): string | null | undefined;
264
+ };
263
265
  /**
264
266
  * Returns the id of the previous enabled item based on the current
265
- * [`activeId`](https://ariakit.org/reference/composite-provider#activeid)
267
+ * [`activeId`](https://ariakit.com/reference/composite-provider#activeid)
266
268
  * state. You can pass additional options to override the current state.
267
269
  * @example
268
270
  * const previousId = store.previous();
269
271
  */
270
- previous(options?: NextOptions): string | null | undefined;
271
- /**
272
- * @deprecated Use the object syntax instead: `previous({ skip: 2 })`.
273
- */
274
- previous(skip?: number): string | null | undefined;
272
+ previous: {
273
+ (options?: NextOptions): string | null | undefined;
274
+ /**
275
+ * @deprecated Use the object syntax instead: `previous({ skip: 2 })`.
276
+ */
277
+ (skip?: number): string | null | undefined;
278
+ };
275
279
  /**
276
280
  * Returns the id of the enabled item above based on the current
277
- * [`activeId`](https://ariakit.org/reference/composite-provider#activeid)
281
+ * [`activeId`](https://ariakit.com/reference/composite-provider#activeid)
278
282
  * state. You can pass additional options to override the current state.
279
283
  * @example
280
284
  * const upId = store.up();
281
285
  */
282
- up(options?: NextOptions): string | null | undefined;
283
- /**
284
- * @deprecated Use the object syntax instead: `up({ skip: 2 })`.
285
- */
286
- up(skip?: number): string | null | undefined;
286
+ up: {
287
+ (options?: NextOptions): string | null | undefined;
288
+ /**
289
+ * @deprecated Use the object syntax instead: `up({ skip: 2 })`.
290
+ */
291
+ (skip?: number): string | null | undefined;
292
+ };
287
293
  /**
288
294
  * Returns the id of the enabled item below based on the current
289
- * [`activeId`](https://ariakit.org/reference/composite-provider#activeid)
295
+ * [`activeId`](https://ariakit.com/reference/composite-provider#activeid)
290
296
  * state. You can pass additional options to override the current state.
291
297
  * @example
292
298
  * const downId = store.down();
293
299
  */
294
- down(options?: NextOptions): string | null | undefined;
295
- /**
296
- * @deprecated Use the object syntax instead: `down({ skip: 2 })`.
297
- */
298
- down(skip?: number): string | null | undefined;
300
+ down: {
301
+ (options?: NextOptions): string | null | undefined;
302
+ /**
303
+ * @deprecated Use the object syntax instead: `down({ skip: 2 })`.
304
+ */
305
+ (skip?: number): string | null | undefined;
306
+ };
299
307
  /**
300
308
  * Returns the id of the first enabled item.
301
309
  */
@@ -1,12 +1,12 @@
1
1
  "use client";
2
2
  import {
3
3
  createCompositeStore
4
- } from "../__chunks/RVTIKFRL.js";
4
+ } from "../__chunks/UNDE2QJS.js";
5
5
  import "../__chunks/7PRQYBBV.js";
6
- import "../__chunks/N5XGANPW.js";
7
- import "../__chunks/3DNM6L6E.js";
8
- import "../__chunks/SXKM4CGU.js";
9
- import "../__chunks/XMCVU3LR.js";
6
+ import "../__chunks/KZX46JDB.js";
7
+ import "../__chunks/G7XPWBXK.js";
8
+ import "../__chunks/XTZ53NXG.js";
9
+ import "../__chunks/UWJK2WK2.js";
10
10
  export {
11
11
  createCompositeStore
12
12
  };
@@ -1,10 +1,10 @@
1
1
  "use client";
2
2
  import {
3
3
  createDialogStore
4
- } from "../__chunks/KMAUV3TY.js";
5
- import "../__chunks/75BJEVSH.js";
6
- import "../__chunks/SXKM4CGU.js";
7
- import "../__chunks/XMCVU3LR.js";
4
+ } from "../__chunks/7KNZCZ55.js";
5
+ import "../__chunks/IHNLLH3I.js";
6
+ import "../__chunks/XTZ53NXG.js";
7
+ import "../__chunks/UWJK2WK2.js";
8
8
  export {
9
9
  createDialogStore
10
10
  };
@@ -9,25 +9,25 @@ export interface DisclosureStoreState {
9
9
  * Whether the content is visible.
10
10
  *
11
11
  * Live examples:
12
- * - [Combobox with links](https://ariakit.org/examples/combobox-links)
12
+ * - [Combobox with links](https://ariakit.com/examples/combobox-links)
13
13
  * - [Dialog with React
14
- * Router](https://ariakit.org/examples/dialog-react-router)
15
- * - [Menu with Framer
16
- * Motion](https://ariakit.org/examples/menu-framer-motion)
17
- * - [Lazy Popover](https://ariakit.org/examples/popover-lazy)
14
+ * Router](https://ariakit.com/examples/dialog-react-router)
15
+ * - [Menu with
16
+ * Motion](https://ariakit.com/examples/menu-framer-motion)
17
+ * - [Lazy Popover](https://ariakit.com/examples/popover-lazy)
18
18
  * @default false
19
19
  */
20
20
  open: boolean;
21
21
  /**
22
22
  * The mounted state usually matches the
23
- * [`open`](https://ariakit.org/reference/disclosure-provider#open) value.
23
+ * [`open`](https://ariakit.com/reference/disclosure-provider#open) value.
24
24
  * However, if the content element is animated, it waits for the animation to
25
25
  * finish before turning `false`. This ensures the content element doesn't get
26
26
  * unmounted during the animation.
27
27
  *
28
28
  * Live examples:
29
- * - [Navigation Menubar](https://ariakit.org/examples/menubar-navigation)
30
- * - [Responsive Popover](https://ariakit.org/examples/popover-responsive)
29
+ * - [Navigation Menubar](https://ariakit.com/examples/menubar-navigation)
30
+ * - [Responsive Popover](https://ariakit.com/examples/popover-responsive)
31
31
  */
32
32
  mounted: boolean;
33
33
  /**
@@ -55,43 +55,43 @@ export interface DisclosureStoreState {
55
55
  }
56
56
  export interface DisclosureStoreFunctions extends Pick<DisclosureStoreOptions, "disclosure"> {
57
57
  /**
58
- * Sets the [`open`](https://ariakit.org/reference/disclosure-provider#open)
58
+ * Sets the [`open`](https://ariakit.com/reference/disclosure-provider#open)
59
59
  * state.
60
60
  *
61
61
  * Live examples:
62
62
  * - [Textarea with inline
63
- * Combobox](https://ariakit.org/examples/combobox-textarea)
63
+ * Combobox](https://ariakit.com/examples/combobox-textarea)
64
64
  * @example
65
65
  * store.setOpen(true);
66
66
  * store.setOpen((open) => !open);
67
67
  */
68
68
  setOpen: SetState<DisclosureStoreState["open"]>;
69
69
  /**
70
- * Sets the [`open`](https://ariakit.org/reference/disclosure-provider#open)
70
+ * Sets the [`open`](https://ariakit.com/reference/disclosure-provider#open)
71
71
  * state to `true`.
72
72
  *
73
73
  * Live examples:
74
74
  * - [Textarea with inline
75
- * Combobox](https://ariakit.org/examples/combobox-textarea)
76
- * - [Dialog with Framer
77
- * Motion](https://ariakit.org/examples/dialog-framer-motion)
78
- * - [Context Menu](https://ariakit.org/examples/menu-context-menu)
79
- * - [Navigation Menubar](https://ariakit.org/examples/menubar-navigation)
75
+ * Combobox](https://ariakit.com/examples/combobox-textarea)
76
+ * - [Dialog with
77
+ * Motion](https://ariakit.com/examples/dialog-framer-motion)
78
+ * - [Context Menu](https://ariakit.com/examples/menu-context-menu)
79
+ * - [Navigation Menubar](https://ariakit.com/examples/menubar-navigation)
80
80
  */
81
81
  show: () => void;
82
82
  /**
83
- * Sets the [`open`](https://ariakit.org/reference/disclosure-provider#open)
83
+ * Sets the [`open`](https://ariakit.com/reference/disclosure-provider#open)
84
84
  * state to `false`.
85
85
  *
86
86
  * Live examples:
87
87
  * - [Textarea with inline
88
- * Combobox](https://ariakit.org/examples/combobox-textarea)
89
- * - [Sliding Menu](https://ariakit.org/examples/menu-slide)
88
+ * Combobox](https://ariakit.com/examples/combobox-textarea)
89
+ * - [Sliding Menu](https://ariakit.com/examples/menu-slide)
90
90
  */
91
91
  hide: () => void;
92
92
  /**
93
93
  * Toggles the
94
- * [`open`](https://ariakit.org/reference/disclosure-provider#open) state.
94
+ * [`open`](https://ariakit.com/reference/disclosure-provider#open) state.
95
95
  */
96
96
  toggle: () => void;
97
97
  /**
@@ -109,7 +109,7 @@ export interface DisclosureStoreFunctions extends Pick<DisclosureStoreOptions, "
109
109
  * Sets the `disclosureElement` state.
110
110
  *
111
111
  * Live examples:
112
- * - [Navigation Menubar](https://ariakit.org/examples/menubar-navigation)
112
+ * - [Navigation Menubar](https://ariakit.com/examples/menubar-navigation)
113
113
  */
114
114
  setDisclosureElement: SetState<DisclosureStoreState["disclosureElement"]>;
115
115
  }
@@ -128,7 +128,7 @@ export interface DisclosureStoreOptions extends StoreOptions<DisclosureStoreStat
128
128
  * A reference to another disclosure store that controls another disclosure
129
129
  * component to keep them in sync. Element states like `contentElement` and
130
130
  * `disclosureElement` won't be synced. For that, use the
131
- * [`store`](https://ariakit.org/reference/disclosure-provider#store) prop
131
+ * [`store`](https://ariakit.com/reference/disclosure-provider#store) prop
132
132
  * instead.
133
133
  */
134
134
  disclosure?: DisclosureStore | null;
@@ -1,9 +1,9 @@
1
1
  "use client";
2
2
  import {
3
3
  createDisclosureStore
4
- } from "../__chunks/75BJEVSH.js";
5
- import "../__chunks/SXKM4CGU.js";
6
- import "../__chunks/XMCVU3LR.js";
4
+ } from "../__chunks/IHNLLH3I.js";
5
+ import "../__chunks/XTZ53NXG.js";
6
+ import "../__chunks/UWJK2WK2.js";
7
7
  export {
8
8
  createDisclosureStore
9
9
  };
@@ -21,8 +21,8 @@ export interface FormStoreState<T extends FormStoreValues = FormStoreValues> ext
21
21
  * Form values.
22
22
  *
23
23
  * Live examples:
24
- * - [FormRadio](https://ariakit.org/examples/form-radio)
25
- * - [FormSelect](https://ariakit.org/examples/form-select)
24
+ * - [FormRadio](https://ariakit.com/examples/form-radio)
25
+ * - [FormSelect](https://ariakit.com/examples/form-select)
26
26
  * @default {}
27
27
  */
28
28
  values: T;
@@ -48,13 +48,13 @@ export interface FormStoreState<T extends FormStoreValues = FormStoreValues> ext
48
48
  submitting: boolean;
49
49
  /**
50
50
  * The number of times
51
- * [`submit`](https://ariakit.org/reference/use-form-store#submit) has been
51
+ * [`submit`](https://ariakit.com/reference/use-form-store#submit) has been
52
52
  * called with a successful response.
53
53
  */
54
54
  submitSucceed: number;
55
55
  /**
56
56
  * The number of times
57
- * [`submit`](https://ariakit.org/reference/use-form-store#submit) has been
57
+ * [`submit`](https://ariakit.com/reference/use-form-store#submit) has been
58
58
  * called with an error response.
59
59
  */
60
60
  submitFailed: number;
@@ -64,8 +64,8 @@ export interface FormStoreFunctions<T extends FormStoreValues = FormStoreValues>
64
64
  * An object containing the names of the form fields for type safety.
65
65
  *
66
66
  * Live examples:
67
- * - [FormRadio](https://ariakit.org/examples/form-radio)
68
- * - [FormSelect](https://ariakit.org/examples/form-select)
67
+ * - [FormRadio](https://ariakit.com/examples/form-radio)
68
+ * - [FormSelect](https://ariakit.com/examples/form-select)
69
69
  * @example
70
70
  * store.names.name; // "name"
71
71
  * store.names.name.first; // "name.first"
@@ -73,7 +73,7 @@ export interface FormStoreFunctions<T extends FormStoreValues = FormStoreValues>
73
73
  */
74
74
  names: Names<T>;
75
75
  /**
76
- * Sets the [`values`](https://ariakit.org/reference/form-provider#values)
76
+ * Sets the [`values`](https://ariakit.com/reference/form-provider#values)
77
77
  * state.
78
78
  * @example
79
79
  * store.setValues({ name: "John" });
@@ -84,7 +84,7 @@ export interface FormStoreFunctions<T extends FormStoreValues = FormStoreValues>
84
84
  * Retrieves a field value.
85
85
  *
86
86
  * Live examples:
87
- * - [FormRadio](https://ariakit.org/examples/form-radio)
87
+ * - [FormRadio](https://ariakit.com/examples/form-radio)
88
88
  * @example
89
89
  * const nameValue = store.getValue("name");
90
90
  * // Can also use store.names for type-safety.
@@ -95,7 +95,7 @@ export interface FormStoreFunctions<T extends FormStoreValues = FormStoreValues>
95
95
  * Sets a field value.
96
96
  *
97
97
  * Live examples:
98
- * - [FormSelect](https://ariakit.org/examples/form-select)
98
+ * - [FormSelect](https://ariakit.com/examples/form-select)
99
99
  * @example
100
100
  * store.setValue("name", "John");
101
101
  * store.setValue("name", (value) => value + " Doe");
@@ -122,7 +122,7 @@ export interface FormStoreFunctions<T extends FormStoreValues = FormStoreValues>
122
122
  */
123
123
  removeValue: (name: StringLike, index: number) => void;
124
124
  /**
125
- * Sets the [`errors`](https://ariakit.org/reference/form-provider#errors)
125
+ * Sets the [`errors`](https://ariakit.com/reference/form-provider#errors)
126
126
  * state.
127
127
  * @example
128
128
  * store.setErrors({ name: "Name is required" });
@@ -141,7 +141,7 @@ export interface FormStoreFunctions<T extends FormStoreValues = FormStoreValues>
141
141
  * Sets a field error.
142
142
  *
143
143
  * Live examples:
144
- * - [FormRadio](https://ariakit.org/examples/form-radio)
144
+ * - [FormRadio](https://ariakit.com/examples/form-radio)
145
145
  * @example
146
146
  * store.setError("name", "Name is required");
147
147
  * store.setError("name", (error) => error + "!");
@@ -150,7 +150,7 @@ export interface FormStoreFunctions<T extends FormStoreValues = FormStoreValues>
150
150
  */
151
151
  setError: (name: StringLike, error: SetStateAction<ErrorMessage>) => void;
152
152
  /**
153
- * Sets the [`touched`](https://ariakit.org/reference/form-provider#touched)
153
+ * Sets the [`touched`](https://ariakit.com/reference/form-provider#touched)
154
154
  * state.
155
155
  * @example
156
156
  * store.setTouched({ name: true });
@@ -176,7 +176,7 @@ export interface FormStoreFunctions<T extends FormStoreValues = FormStoreValues>
176
176
  setFieldTouched: (name: StringLike, value: SetStateAction<boolean>) => void;
177
177
  /**
178
178
  * Function that accepts a callback that will be used to validate the form
179
- * when [`validate`](https://ariakit.org/reference/use-form-store#validate) is
179
+ * when [`validate`](https://ariakit.com/reference/use-form-store#validate) is
180
180
  * called. It returns a cleanup function that will remove the callback.
181
181
  * @example
182
182
  * const cleanup = store.onValidate(async (state) => {
@@ -189,7 +189,7 @@ export interface FormStoreFunctions<T extends FormStoreValues = FormStoreValues>
189
189
  onValidate: (callback: FormStoreCallback<FormStoreState<T>>) => () => void;
190
190
  /**
191
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.
192
+ * [`submit`](https://ariakit.com/reference/use-form-store#submit) is called.
193
193
  * It returns a cleanup function that will remove the callback.
194
194
  * @param callback The callback function.
195
195
  * @example
@@ -1,21 +1,21 @@
1
1
  "use client";
2
2
  import {
3
3
  createCollectionStore
4
- } from "../__chunks/N5XGANPW.js";
5
- import "../__chunks/3DNM6L6E.js";
4
+ } from "../__chunks/KZX46JDB.js";
5
+ import "../__chunks/G7XPWBXK.js";
6
6
  import {
7
7
  createStore,
8
8
  init,
9
9
  setup,
10
10
  sync,
11
11
  throwOnConflictingProps
12
- } from "../__chunks/SXKM4CGU.js";
12
+ } from "../__chunks/XTZ53NXG.js";
13
13
  import {
14
14
  applyState,
15
15
  defaultValue,
16
16
  isInteger,
17
17
  isObject
18
- } from "../__chunks/XMCVU3LR.js";
18
+ } from "../__chunks/UWJK2WK2.js";
19
19
 
20
20
  // src/form/form-store.ts
21
21
  function nextFrame() {
@@ -30,38 +30,42 @@ function hasMessages(object) {
30
30
  });
31
31
  }
32
32
  function get(values, path, defaultValue2) {
33
- var _a;
34
- const [key, ...rest] = Array.isArray(path) ? path : `${path}`.split(".");
33
+ const [key, ...rest] = Array.isArray(path) ? path : String(path).split(".");
35
34
  if (key == null || !values) {
36
35
  return defaultValue2;
37
36
  }
38
37
  if (!rest.length) {
39
- return (_a = values[key]) != null ? _a : defaultValue2;
38
+ return values[key] ?? defaultValue2;
40
39
  }
41
40
  return get(values[key], rest, defaultValue2);
42
41
  }
42
+ function getOrCreateNested(nestedValues, nextKey) {
43
+ if (Array.isArray(nestedValues) || isObject(nestedValues)) {
44
+ return nestedValues;
45
+ }
46
+ return isInteger(nextKey) ? [] : {};
47
+ }
43
48
  function set(values, path, value) {
44
- const [k, ...rest] = Array.isArray(path) ? path : `${path}`.split(".");
49
+ const [k, ...rest] = Array.isArray(path) ? path : String(path).split(".");
45
50
  if (k == null) return values;
46
51
  const key = k;
47
52
  const isIntegerKey = isInteger(key);
48
53
  const nextValues = isIntegerKey ? values || [] : values || {};
49
54
  const nestedValues = nextValues[key];
50
- const result = rest.length && (Array.isArray(nestedValues) || isObject(nestedValues)) ? set(nestedValues, rest, value) : value;
55
+ const nextKey = rest[0];
56
+ const result = rest.length && nextKey != null ? set(getOrCreateNested(nestedValues, nextKey), rest, value) : value;
51
57
  if (isIntegerKey) {
52
58
  const index = Number(key);
53
59
  if (values && Array.isArray(values)) {
54
- return [
55
- ...values.slice(0, index),
56
- result,
57
- ...values.slice(index + 1)
58
- ];
60
+ const copy = [...values];
61
+ copy[index] = result;
62
+ return copy;
59
63
  }
60
64
  const nextValues2 = [];
61
65
  nextValues2[index] = result;
62
66
  return nextValues2;
63
67
  }
64
- return { ...values, [key]: result };
68
+ return Object.assign({}, values, { [key]: result });
65
69
  }
66
70
  function setAll(values, value) {
67
71
  const result = {};