@ariakit/core 0.3.9 → 0.3.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 (102) hide show
  1. package/CHANGELOG.md +15 -0
  2. package/cjs/__chunks/{JNFZSNOI.cjs → BFE5R4EZ.cjs} +17 -17
  3. package/cjs/__chunks/{EFIT5L4X.cjs → E53JW5BD.cjs} +12 -12
  4. package/cjs/__chunks/{2UK5WUJX.cjs → F6HPKLO2.cjs} +12 -14
  5. package/cjs/__chunks/{2LS4JJ4S.cjs → I3Y4EXEF.cjs} +2 -2
  6. package/cjs/__chunks/{3UT5FE6K.cjs → KBNYGXWI.cjs} +3 -0
  7. package/cjs/__chunks/{UCLKUBNP.cjs → MI6NUQYQ.cjs} +31 -18
  8. package/cjs/__chunks/{UTICNXST.cjs → NOFH2BLB.cjs} +7 -7
  9. package/cjs/__chunks/{GJFZ5ZPP.cjs → OTVLDMN2.cjs} +16 -16
  10. package/cjs/__chunks/{5SIVMOID.cjs → TQTGWD5K.cjs} +10 -10
  11. package/cjs/checkbox/checkbox-store.cjs +5 -5
  12. package/cjs/checkbox/checkbox-store.d.cts +5 -2
  13. package/cjs/checkbox/checkbox-store.d.ts +5 -2
  14. package/cjs/collection/collection-store.cjs +4 -4
  15. package/cjs/collection/collection-store.d.cts +11 -11
  16. package/cjs/collection/collection-store.d.ts +11 -11
  17. package/cjs/combobox/combobox-store.cjs +32 -32
  18. package/cjs/combobox/combobox-store.d.cts +3 -1
  19. package/cjs/combobox/combobox-store.d.ts +3 -1
  20. package/cjs/composite/composite-overflow-store.cjs +6 -6
  21. package/cjs/composite/composite-store.cjs +5 -5
  22. package/cjs/composite/composite-store.d.cts +128 -54
  23. package/cjs/composite/composite-store.d.ts +128 -54
  24. package/cjs/dialog/dialog-store.cjs +5 -5
  25. package/cjs/disclosure/disclosure-store.cjs +4 -4
  26. package/cjs/disclosure/disclosure-store.d.cts +33 -27
  27. package/cjs/disclosure/disclosure-store.d.ts +33 -27
  28. package/cjs/form/form-store.cjs +23 -23
  29. package/cjs/form/form-store.d.cts +35 -26
  30. package/cjs/form/form-store.d.ts +35 -26
  31. package/cjs/hovercard/hovercard-store.cjs +7 -7
  32. package/cjs/hovercard/hovercard-store.d.cts +14 -7
  33. package/cjs/hovercard/hovercard-store.d.ts +14 -7
  34. package/cjs/menu/menu-bar-store.cjs +6 -6
  35. package/cjs/menu/menu-store.cjs +26 -26
  36. package/cjs/menu/menu-store.d.cts +16 -7
  37. package/cjs/menu/menu-store.d.ts +16 -7
  38. package/cjs/menubar/menubar-store.cjs +6 -6
  39. package/cjs/popover/popover-store.cjs +6 -6
  40. package/cjs/popover/popover-store.d.cts +31 -6
  41. package/cjs/popover/popover-store.d.ts +31 -6
  42. package/cjs/radio/radio-store.cjs +8 -8
  43. package/cjs/radio/radio-store.d.cts +2 -1
  44. package/cjs/radio/radio-store.d.ts +2 -1
  45. package/cjs/select/select-store.cjs +28 -28
  46. package/cjs/select/select-store.d.cts +2 -1
  47. package/cjs/select/select-store.d.ts +2 -1
  48. package/cjs/tab/tab-store.cjs +20 -20
  49. package/cjs/tab/tab-store.d.cts +20 -15
  50. package/cjs/tab/tab-store.d.ts +20 -15
  51. package/cjs/toolbar/toolbar-store.cjs +7 -7
  52. package/cjs/toolbar/toolbar-store.d.cts +2 -6
  53. package/cjs/toolbar/toolbar-store.d.ts +2 -6
  54. package/cjs/tooltip/tooltip-store.cjs +12 -12
  55. package/cjs/tooltip/tooltip-store.d.cts +6 -4
  56. package/cjs/tooltip/tooltip-store.d.ts +6 -4
  57. package/cjs/utils/misc.cjs +2 -2
  58. package/cjs/utils/store.cjs +3 -3
  59. package/esm/__chunks/{TLN4ALYH.js → 22K762VQ.js} +22 -9
  60. package/esm/__chunks/{J6JIOWCS.js → AF6IUUFN.js} +3 -3
  61. package/esm/__chunks/{A2J4XZ5T.js → EAHJFCU4.js} +1 -3
  62. package/esm/__chunks/{DLX2AS6C.js → IERTEJ3A.js} +3 -3
  63. package/esm/__chunks/{T3DVYGXI.js → SOLWE6E5.js} +3 -3
  64. package/esm/__chunks/{LT2OYWRD.js → SX2XFD6A.js} +1 -1
  65. package/esm/__chunks/{EZ2TTBAQ.js → XU3EOSCU.js} +3 -3
  66. package/esm/__chunks/{I2VQ3XGR.js → Y3OOHFCN.js} +3 -0
  67. package/esm/__chunks/{NKLTHWCR.js → Z5IGYIPT.js} +2 -2
  68. package/esm/checkbox/checkbox-store.d.ts +5 -2
  69. package/esm/checkbox/checkbox-store.js +2 -2
  70. package/esm/collection/collection-store.d.ts +11 -11
  71. package/esm/collection/collection-store.js +3 -3
  72. package/esm/combobox/combobox-store.d.ts +3 -1
  73. package/esm/combobox/combobox-store.js +7 -7
  74. package/esm/composite/composite-overflow-store.js +5 -5
  75. package/esm/composite/composite-store.d.ts +128 -54
  76. package/esm/composite/composite-store.js +4 -4
  77. package/esm/dialog/dialog-store.js +4 -4
  78. package/esm/disclosure/disclosure-store.d.ts +33 -27
  79. package/esm/disclosure/disclosure-store.js +3 -3
  80. package/esm/form/form-store.d.ts +35 -26
  81. package/esm/form/form-store.js +3 -3
  82. package/esm/hovercard/hovercard-store.d.ts +14 -7
  83. package/esm/hovercard/hovercard-store.js +6 -6
  84. package/esm/menu/menu-bar-store.js +5 -5
  85. package/esm/menu/menu-store.d.ts +16 -7
  86. package/esm/menu/menu-store.js +8 -8
  87. package/esm/menubar/menubar-store.js +5 -5
  88. package/esm/popover/popover-store.d.ts +31 -6
  89. package/esm/popover/popover-store.js +5 -5
  90. package/esm/radio/radio-store.d.ts +2 -1
  91. package/esm/radio/radio-store.js +4 -4
  92. package/esm/select/select-store.d.ts +2 -1
  93. package/esm/select/select-store.js +7 -7
  94. package/esm/tab/tab-store.d.ts +20 -15
  95. package/esm/tab/tab-store.js +4 -4
  96. package/esm/toolbar/toolbar-store.d.ts +2 -6
  97. package/esm/toolbar/toolbar-store.js +4 -4
  98. package/esm/tooltip/tooltip-store.d.ts +6 -4
  99. package/esm/tooltip/tooltip-store.js +6 -6
  100. package/esm/utils/misc.js +1 -1
  101. package/esm/utils/store.js +2 -2
  102. package/package.json +1 -1
@@ -9,13 +9,14 @@ export declare function createCompositeStore<T extends CompositeStoreItem = Comp
9
9
  export type CompositeStoreOrientation = Orientation;
10
10
  export interface CompositeStoreItem extends CollectionStoreItem {
11
11
  /**
12
- * The row id of the item. This is only used on two-dimensional composites
13
- * (when using `CompositeRow`).
12
+ * The row id of the item. This is only used on two-dimensional composite
13
+ * widgets (when using
14
+ * [`CompositeRow`](https://ariakit.org/reference/composite-row)).
14
15
  */
15
16
  rowId?: string;
16
17
  /**
17
- * If enabled, the item will be disabled and users won't be able to focus it
18
- * using arrow keys.
18
+ * If enabled, the item will be disabled and users won't be able to focus on
19
+ * it using arrow keys.
19
20
  */
20
21
  disabled?: boolean;
21
22
  /**
@@ -25,7 +26,11 @@ export interface CompositeStoreItem extends CollectionStoreItem {
25
26
  }
26
27
  export interface CompositeStoreState<T extends CompositeStoreItem = CompositeStoreItem> extends CollectionStoreState<T> {
27
28
  /**
28
- * The composite element.
29
+ * The composite element itself. Typically, it's the wrapper element that
30
+ * contains composite items. However, in a combobox, it's the input element.
31
+ *
32
+ * Live examples:
33
+ * - [Sliding Menu](https://ariakit.org/examples/menu-slide)
29
34
  */
30
35
  baseElement: HTMLElement | null;
31
36
  /**
@@ -35,6 +40,10 @@ export interface CompositeStoreState<T extends CompositeStoreItem = CompositeSto
35
40
  * tabindex](https://www.w3.org/WAI/ARIA/apg/practices/keyboard-interface/#kbd_roving_tabindex).
36
41
  * DOM focus will remain on the composite element while its items receive
37
42
  * virtual focus.
43
+ *
44
+ * In both scenarios, the item in focus will carry the
45
+ * [`data-active-item`](https://ariakit.org/guide/styling#data-active-item)
46
+ * attribute.
38
47
  * @default false
39
48
  */
40
49
  virtualFocus: boolean;
@@ -51,9 +60,13 @@ export interface CompositeStoreState<T extends CompositeStoreItem = CompositeSto
51
60
  */
52
61
  orientation: Orientation;
53
62
  /**
54
- * Determines how the `next` and `previous` functions will behave. If `rtl` is
55
- * set to `true`, they will be inverted. This only affects the composite
56
- * widget behavior. You still need to set `dir="rtl"` on HTML/CSS.
63
+ * Determines how the
64
+ * [`next`](https://ariakit.org/reference/use-composite-store#next) and
65
+ * [`previous`](https://ariakit.org/reference/use-composite-store#previous)
66
+ * functions will behave. If `rtl` is set to `true`, they will be inverted.
67
+ *
68
+ * This only affects the composite widget behavior. You still need to set
69
+ * `dir="rtl"` on HTML/CSS.
57
70
  * @default false
58
71
  */
59
72
  rtl: boolean;
@@ -61,15 +74,25 @@ export interface CompositeStoreState<T extends CompositeStoreItem = CompositeSto
61
74
  * Determines how the focus behaves when the user reaches the end of the
62
75
  * composite widget.
63
76
  *
64
- * On one-dimensional composites:
77
+ * On one-dimensional composite widgets:
65
78
  * - `true` loops from the last item to the first item and vice-versa.
66
- * - `horizontal` loops only if `orientation` is `horizontal` or not set.
67
- * - `vertical` loops only if `orientation` is `vertical` or not set.
68
- * - If `includesBaseElement` is set to `true` (or `activeId` is initially set
69
- * to `null`), the composite element will be focused in between the last and
70
- * first items.
79
+ * - `horizontal` loops only if
80
+ * [`orientation`](https://ariakit.org/reference/composite-provider#orientation)
81
+ * is `horizontal` or not set.
82
+ * - `vertical` loops only if
83
+ * [`orientation`](https://ariakit.org/reference/composite-provider#orientation)
84
+ * is `vertical` or not set.
85
+ * - If
86
+ * [`includesBaseElement`](https://ariakit.org/reference/composite-provider#includesbaseelement)
87
+ * is set to `true` (or
88
+ * [`activeId`](https://ariakit.org/reference/composite-provider#activeid)
89
+ * is initially set to `null`), the composite element will be focused in
90
+ * between the last and first items.
71
91
  *
72
- * On two-dimensional composites (when using `CompositeRow`):
92
+ * On two-dimensional composite widgets (when using
93
+ * [`CompositeRow`](https://ariakit.org/reference/composite-row) or explicitly
94
+ * passing a [`rowId`](https://ariakit.org/reference/composite-item#rowid)
95
+ * prop to composite items):
73
96
  * - `true` loops from the last row/column item to the first item in the same
74
97
  * row/column and vice-versa. If it's the last item in the last row, it
75
98
  * moves to the first item in the first row and vice-versa.
@@ -77,71 +100,99 @@ export interface CompositeStoreState<T extends CompositeStoreItem = CompositeSto
77
100
  * same row.
78
101
  * - `vertical` loops only from the last column item to the first item in the
79
102
  * column row.
80
- * - If `includesBaseElement` is set to `true` (or `activeId` is initially set
81
- * to `null`), vertical loop will have no effect as moving down from the
82
- * last row or up from the first row will focus the composite element.
83
- * - If `focusWrap` matches the value of `focusLoop`, it'll wrap between the
84
- * last item in the last row or column and the first item in the first row
85
- * or column and vice-versa.
103
+ * - If
104
+ * [`includesBaseElement`](https://ariakit.org/reference/composite-provider#includesbaseelement)
105
+ * is set to `true` (or
106
+ * [`activeId`](https://ariakit.org/reference/composite-provider#activeid)
107
+ * is initially set to `null`), vertical loop will have no effect as moving
108
+ * down from the last row or up from the first row will focus on the
109
+ * composite element.
110
+ * - If
111
+ * [`focusWrap`](https://ariakit.org/reference/composite-provider#focuswrap)
112
+ * matches the value of `focusLoop`, it'll wrap between the last item in the
113
+ * last row or column and the first item in the first row or column and
114
+ * vice-versa.
86
115
  * @default false
87
116
  */
88
117
  focusLoop: boolean | Orientation;
89
118
  /**
90
- * **Works only on two-dimensional composites**. If enabled, moving to the
91
- * next item from the last one in a row or column will focus the first item in
92
- * the next row or column and vice-versa.
119
+ * **Works only on two-dimensional composite widgets**.
120
+ *
121
+ * If enabled, moving to the next item from the last one in a row or column
122
+ * will focus on the first item in the next row or column and vice-versa.
93
123
  * - `true` wraps between rows and columns.
94
124
  * - `horizontal` wraps only between rows.
95
125
  * - `vertical` wraps only between columns.
96
- * - If `focusLoop` matches the value of `focusWrap`, it'll wrap between the
97
- * last item in the last row or column and the first item in the first row
98
- * or column and vice-versa.
126
+ * - If
127
+ * [`focusLoop`](https://ariakit.org/reference/composite-provider#focusloop)
128
+ * matches the value of `focusWrap`, it'll wrap between the last item in the
129
+ * last row or column and the first item in the first row or column and
130
+ * vice-versa.
99
131
  * @default false
100
132
  */
101
133
  focusWrap: boolean | Orientation;
102
134
  /**
103
- * **Works only on two-dimensional composites**. If enabled, moving up or down
104
- * when there's no next item or when the next item is disabled will shift to
105
- * the item right before it.
135
+ * **Works only on two-dimensional composite widgets**.
136
+ *
137
+ * If enabled, moving up or down when there's no next item or when the next
138
+ * item is disabled will shift to the item right before it.
106
139
  * @default false
107
140
  */
108
141
  focusShift: boolean;
109
142
  /**
110
- * The number of times the `move` function has been called.
143
+ * The number of times the
144
+ * [`move`](https://ariakit.org/reference/use-composite-store#move) function
145
+ * has been called.
111
146
  */
112
147
  moves: number;
113
148
  /**
114
- * Indicates if the composite element (such as `menu`, `combobox`, `listbox`,
115
- * `toolbar`, etc.) should be part of the focus order. In other words, moving
116
- * to the previous element when the first item is in focus will focus on the
149
+ * Indicates if the composite base element (the one with a [composite
150
+ * role](https://w3c.github.io/aria/#composite)) should be part of the focus
151
+ * order when navigating with arrow keys. In other words, moving to the
152
+ * previous element when the first item is in focus will focus on the
117
153
  * composite element itself. The same applies to the last item when moving to
118
154
  * the next element.
119
155
  *
120
156
  * Live examples:
121
157
  * - [Submenu with
122
158
  * Combobox](https://ariakit.org/examples/menu-nested-combobox)
159
+ * - [Combobox with tabs](https://ariakit.org/examples/combobox-tabs)
123
160
  * @default false
124
161
  */
125
162
  includesBaseElement: boolean;
126
163
  /**
127
- * The current focused item `id`.
128
- * - `null` focuses the base composite element and users will be able to
164
+ * The current active item `id`. The active item is the element within the
165
+ * composite widget that has either DOM or virtual focus (in case
166
+ * [`virtualFocus`](https://ariakit.org/reference/composite-provider#virtualfocus)
167
+ * is enabled).
168
+ * - `null` represents the base composite element (the one with a [composite
169
+ * role](https://w3c.github.io/aria/#composite)). Users will be able to
129
170
  * navigate out of it using arrow keys.
130
- * - If `activeId` is initially set to `null`, the `includesBaseElement` prop
131
- * will also default to `true`, which means the base composite element
171
+ * - If `activeId` is initially set to `null`, the
172
+ * [`includesBaseElement`](https://ariakit.org/reference/composite-provider#includesbaseelement)
173
+ * prop will also default to `true`, which means the base composite element
132
174
  * itself will have focus and users will be able to navigate to it using
133
175
  * arrow keys.
176
+ *
177
+ * Live examples:
178
+ * - [Combobox with tabs](https://ariakit.org/examples/combobox-tabs)
134
179
  */
135
180
  activeId: string | null | undefined;
136
181
  }
137
182
  export interface CompositeStoreFunctions<T extends CompositeStoreItem = CompositeStoreItem> extends CollectionStoreFunctions<T> {
138
183
  /**
139
- * Sets the `baseElement`.
184
+ * Sets the `baseElement` state.
140
185
  */
141
186
  setBaseElement: SetState<CompositeStoreState<T>["baseElement"]>;
142
187
  /**
143
- * Sets the `activeId` state without moving focus. If you want to move focus,
144
- * use the `move` function instead.
188
+ * Sets the
189
+ * [`activeId`](https://ariakit.org/reference/composite-provider#activeid)
190
+ * state _without moving focus_. If you want to move focus, use the
191
+ * [`move`](https://ariakit.org/reference/use-composite-store#move) function
192
+ * instead.
193
+ *
194
+ * Live examples:
195
+ * - [Combobox with tabs](https://ariakit.org/examples/combobox-tabs)
145
196
  * @example
146
197
  * // Sets the composite element as the active item
147
198
  * store.setActiveId(null);
@@ -152,9 +203,16 @@ export interface CompositeStoreFunctions<T extends CompositeStoreItem = Composit
152
203
  */
153
204
  setActiveId: SetState<CompositeStoreState<T>["activeId"]>;
154
205
  /**
155
- * Moves focus to a given item id and sets it as the active item. Passing
156
- * `null` will focus the composite element itself.
157
- * @param id The item id to move focus to.
206
+ * Moves focus to a given item id and sets it as the active item.
207
+ * - Passing `null` will focus on the composite element itself (the one with a
208
+ * [composite role](https://w3c.github.io/aria/#composite)). Users will be
209
+ * able to navigate out of it using arrow keys.
210
+ * - If you want to set the active item id _without moving focus_, use the
211
+ * [`setActiveId`](https://ariakit.org/reference/use-composite-store#setactiveid)
212
+ * function instead.
213
+ *
214
+ * Live examples:
215
+ * - [Select Grid](https://ariakit.org/examples/select-grid)
158
216
  * @example
159
217
  * // Moves focus to the composite element
160
218
  * store.move(null);
@@ -165,43 +223,59 @@ export interface CompositeStoreFunctions<T extends CompositeStoreItem = Composit
165
223
  */
166
224
  move: (id?: string | null) => void;
167
225
  /**
168
- * Returns the id of the next item based on the current `activeId` state.
169
- * @param skip The number of items to skip. Defaults to 1.
226
+ * Returns the id of the next enabled item based on the current
227
+ * [`activeId`](https://ariakit.org/reference/composite-provider#activeid)
228
+ * state.
229
+ *
230
+ * Live examples:
231
+ * - [Combobox with tabs](https://ariakit.org/examples/combobox-tabs)
170
232
  * @example
171
233
  * const nextId = store.next();
172
234
  * const nextNextId = store.next(2);
173
235
  */
174
236
  next: (skip?: number) => string | null | undefined;
175
237
  /**
176
- * Returns the id of the previous item based on the current `activeId` state.
177
- * @param skip The number of items to skip. Defaults to 1.
238
+ * Returns the id of the previous enabled item based on the current
239
+ * [`activeId`](https://ariakit.org/reference/composite-provider#activeid)
240
+ * state.
241
+ *
242
+ * Live examples:
243
+ * - [Combobox with tabs](https://ariakit.org/examples/combobox-tabs)
178
244
  * @example
179
245
  * const previousId = store.previous();
180
246
  * const previousPreviousId = store.previous(2);
181
247
  */
182
248
  previous: (skip?: number) => string | null | undefined;
183
249
  /**
184
- * Returns the id of the item above based on the current `activeId` state.
185
- * @param skip The number of items to skip. Defaults to 1.
250
+ * Returns the id of the enabled item above based on the current
251
+ * [`activeId`](https://ariakit.org/reference/composite-provider#activeid)
252
+ * state.
186
253
  * @example
187
254
  * const upId = store.up();
188
255
  * const upUpId = store.up(2);
189
256
  */
190
257
  up: (skip?: number) => string | null | undefined;
191
258
  /**
192
- * Returns the id of the item below based on the current `activeId` state.
193
- * @param skip The number of items to skip. Defaults to 1.
259
+ * Returns the id of the enabled item below based on the current
260
+ * [`activeId`](https://ariakit.org/reference/composite-provider#activeid)
261
+ * state.
194
262
  * @example
195
263
  * const downId = store.down();
196
264
  * const downDownId = store.down(2);
197
265
  */
198
266
  down: (skip?: number) => string | null | undefined;
199
267
  /**
200
- * Returns the id of the first item.
268
+ * Returns the id of the first enabled item.
269
+ *
270
+ * Live examples:
271
+ * - [Combobox with tabs](https://ariakit.org/examples/combobox-tabs)
201
272
  */
202
273
  first: () => string | null | undefined;
203
274
  /**
204
- * Returns the id of the last item.
275
+ * Returns the id of the last enabled item.
276
+ *
277
+ * Live examples:
278
+ * - [Combobox with tabs](https://ariakit.org/examples/combobox-tabs)
205
279
  */
206
280
  last: () => string | null | undefined;
207
281
  }
@@ -1,10 +1,10 @@
1
1
  "use client";
2
2
  import {
3
3
  createCompositeStore
4
- } from "../__chunks/DLX2AS6C.js";
5
- import "../__chunks/TLN4ALYH.js";
6
- import "../__chunks/A2J4XZ5T.js";
7
- import "../__chunks/I2VQ3XGR.js";
4
+ } from "../__chunks/IERTEJ3A.js";
5
+ import "../__chunks/22K762VQ.js";
6
+ import "../__chunks/EAHJFCU4.js";
7
+ import "../__chunks/Y3OOHFCN.js";
8
8
  import "../__chunks/DLOEKDPY.js";
9
9
  import "../__chunks/7PRQYBBV.js";
10
10
  import "../__chunks/4R3V3JGP.js";
@@ -1,10 +1,10 @@
1
1
  "use client";
2
2
  import {
3
3
  createDialogStore
4
- } from "../__chunks/LT2OYWRD.js";
5
- import "../__chunks/NKLTHWCR.js";
6
- import "../__chunks/A2J4XZ5T.js";
7
- import "../__chunks/I2VQ3XGR.js";
4
+ } from "../__chunks/SX2XFD6A.js";
5
+ import "../__chunks/Z5IGYIPT.js";
6
+ import "../__chunks/EAHJFCU4.js";
7
+ import "../__chunks/Y3OOHFCN.js";
8
8
  import "../__chunks/4R3V3JGP.js";
9
9
  export {
10
10
  createDialogStore
@@ -6,40 +6,38 @@ import type { SetState } from "../utils/types.js";
6
6
  export declare function createDisclosureStore(props?: DisclosureStoreProps): DisclosureStore;
7
7
  export interface DisclosureStoreState {
8
8
  /**
9
- * The visibility state of the content.
9
+ * Whether the content is visible.
10
10
  *
11
11
  * Live examples:
12
+ * - [Combobox with links](https://ariakit.org/examples/combobox-links)
12
13
  * - [Dialog with React
13
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
18
  * @default false
15
19
  */
16
20
  open: boolean;
17
21
  /**
18
- * The mounted state of the content. If `animated` is `false` or not defined,
19
- * this will be the same as `open`. Otherwise, it will wait for the animation
20
- * to complete before becoming `false` so the content is not unmounted while
21
- * animating.
22
+ * The mounted state usually matches the
23
+ * [`open`](https://ariakit.org/reference/disclosure-provider#open) value.
24
+ * However, if the content element is animated, it waits for the animation to
25
+ * finish before turning `false`. This ensures the content element doesn't get
26
+ * unmounted during the animation.
22
27
  *
23
28
  * Live examples:
24
- * - [Combobox with links](https://ariakit.org/examples/combobox-links)
25
- * - [Textarea with inline
26
- * Combobox](https://ariakit.org/examples/combobox-textarea)
29
+ * - [Navigation Menubar](https://ariakit.org/examples/menubar-navigation)
30
+ * - [Responsive Popover](https://ariakit.org/examples/popover-responsive)
27
31
  */
28
32
  mounted: boolean;
29
33
  /**
30
34
  * Determines whether the content should animate when it is shown or hidden.
31
35
  * - If `true`, the `animating` state will be `true` when the content is shown
32
- * or hidden and it will wait for `stopAnimation` to be called or a CSS
33
- * animation/transition to end before becoming `false`.
36
+ * or hidden and it will wait for a CSS animation/transition to end before
37
+ * becoming `false`.
34
38
  * - If it's set to a number, the `animating` state will be `true` when the
35
39
  * content is shown or hidden and it will wait for the number of
36
40
  * milliseconds to pass before becoming `false`.
37
- *
38
- * Live examples:
39
- * - [Navigation Menubar](https://ariakit.org/examples/menubar-navigation)
40
- * - [Animated Combobox](https://ariakit.org/examples/combobox-animated)
41
- * - [Animated Dialog](https://ariakit.org/examples/dialog-animated)
42
- * - [Animated Select](https://ariakit.org/examples/select-animated)
43
41
  * @default false
44
42
  */
45
43
  animated: boolean | number;
@@ -58,46 +56,50 @@ export interface DisclosureStoreState {
58
56
  }
59
57
  export interface DisclosureStoreFunctions {
60
58
  /**
61
- * Sets the `open` state.
59
+ * Sets the [`open`](https://ariakit.org/reference/disclosure-provider#open)
60
+ * state.
62
61
  *
63
62
  * Live examples:
64
63
  * - [Textarea with inline
65
64
  * Combobox](https://ariakit.org/examples/combobox-textarea)
66
- * - [Dialog with React
67
- * Router](https://ariakit.org/examples/dialog-react-router)
68
65
  * @example
69
66
  * store.setOpen(true);
70
67
  * store.setOpen((open) => !open);
71
68
  */
72
69
  setOpen: SetState<DisclosureStoreState["open"]>;
73
70
  /**
74
- * Sets the `open` state to `true`.
71
+ * Sets the [`open`](https://ariakit.org/reference/disclosure-provider#open)
72
+ * state to `true`.
75
73
  *
76
74
  * Live examples:
77
- * - [Navigation Menubar](https://ariakit.org/examples/menubar-navigation)
78
75
  * - [Textarea with inline
79
76
  * Combobox](https://ariakit.org/examples/combobox-textarea)
77
+ * - [Dialog with Framer
78
+ * Motion](https://ariakit.org/examples/dialog-framer-motion)
79
+ * - [Context Menu](https://ariakit.org/examples/menu-context-menu)
80
+ * - [Navigation Menubar](https://ariakit.org/examples/menubar-navigation)
80
81
  */
81
82
  show: () => void;
82
83
  /**
83
- * Sets the `open` state to `false`.
84
+ * Sets the [`open`](https://ariakit.org/reference/disclosure-provider#open)
85
+ * state to `false`.
84
86
  *
85
87
  * Live examples:
86
88
  * - [Textarea with inline
87
89
  * Combobox](https://ariakit.org/examples/combobox-textarea)
88
- * - [Dialog with React
89
- * Router](https://ariakit.org/examples/dialog-react-router)
90
90
  * - [Sliding Menu](https://ariakit.org/examples/menu-slide)
91
91
  */
92
92
  hide: () => void;
93
93
  /**
94
- * Toggles the `open` state.
94
+ * Toggles the
95
+ * [`open`](https://ariakit.org/reference/disclosure-provider#open) state.
95
96
  */
96
97
  toggle: () => void;
97
98
  /**
98
99
  * Sets the `animating` state to `false`, which will automatically set the
99
100
  * `mounted` state to `false` if it was `true`. This means that the content
100
101
  * element can be safely unmounted.
102
+ * @deprecated Use `setState("animating", false)` instead.
101
103
  */
102
104
  stopAnimation: () => void;
103
105
  /**
@@ -106,19 +108,23 @@ export interface DisclosureStoreFunctions {
106
108
  setContentElement: SetState<DisclosureStoreState["contentElement"]>;
107
109
  /**
108
110
  * Sets the `disclosureElement` state.
111
+ *
112
+ * Live examples:
113
+ * - [Navigation Menubar](https://ariakit.org/examples/menubar-navigation)
109
114
  */
110
115
  setDisclosureElement: SetState<DisclosureStoreState["disclosureElement"]>;
111
116
  }
112
117
  export interface DisclosureStoreOptions extends StoreOptions<DisclosureStoreState, "open" | "animated"> {
113
118
  /**
114
- * The default visibility state of the content.
119
+ * Whether the content should be visible by default.
115
120
  * @default false
116
121
  */
117
122
  defaultOpen?: DisclosureStoreState["open"];
118
123
  /**
119
124
  * A reference to another disclosure store that controls another disclosure
120
125
  * component to keep them in sync. Element states like `contentElement` and
121
- * `disclosureElement` won't be synced. For that, use the `store` prop
126
+ * `disclosureElement` won't be synced. For that, use the
127
+ * [`store`](https://ariakit.org/reference/disclosure-provider#store) prop
122
128
  * instead.
123
129
  */
124
130
  disclosure?: DisclosureStore | null;
@@ -1,9 +1,9 @@
1
1
  "use client";
2
2
  import {
3
3
  createDisclosureStore
4
- } from "../__chunks/NKLTHWCR.js";
5
- import "../__chunks/A2J4XZ5T.js";
6
- import "../__chunks/I2VQ3XGR.js";
4
+ } from "../__chunks/Z5IGYIPT.js";
5
+ import "../__chunks/EAHJFCU4.js";
6
+ import "../__chunks/Y3OOHFCN.js";
7
7
  import "../__chunks/4R3V3JGP.js";
8
8
  export {
9
9
  createDisclosureStore